Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 13:47
    straight-shoota closed #12051
  • 13:47
    straight-shoota closed #12050
  • 12:17
    beta-ziliani edited #7318
  • May 15 08:43
    r00ster91 closed #7318
  • May 15 08:17
    r00ster91 closed #7690
  • May 14 17:01
    Blacksmoke16 labeled #11995
  • May 14 13:03
    webhive closed #12055
  • May 14 10:19
    straight-shoota milestoned #12051
  • May 14 10:00
    I3oris edited #12051
  • May 14 08:45
    oprypin review_requested #11977
  • May 13 23:29
    Blacksmoke16 unlabeled #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:56
    Blacksmoke16 edited #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 labeled #12061
  • May 13 22:54
    Blacksmoke16 opened #12061
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota labeled #12060
  • May 13 20:14
    straight-shoota opened #12060
Ghost
@ghost~55586c4815522ed4b3e08557
I think you want input: nil in the process creation line
From IRC (bridge bot)
@FromIRC
<linuksz> input: nil works
<linuksz> but why should it be nil when i want to use it
<linuksz> ?
Ghost
@ghost~55586c4815522ed4b3e08557
it's kinda weird we know (it'll be changed soon), specifying nil will allows you to control the process. Using true will just let the terminal (where you run your program) interact with the process, not your program.. (makes sense?)
From IRC (bridge bot)
@FromIRC
<linuksz> so it always controls the input, but when it's true, i can write text for dmenu from the terminal?
<linuksz> and when it's nil, it can be accessed from the program?
Ghost
@ghost~55586c4815522ed4b3e08557
Exactly
From IRC (bridge bot)
@FromIRC
<linuksz> can i do the same thing with the output of the program?
Ghost
@ghost~55586c4815522ed4b3e08557
It'll be clearer when #4445 is merged
From IRC (bridge bot)
@FromIRC
<Papierkorb> ... Or just curl http://example.com - Yes, with backticks.
<linuksz> but why do the above example use a memory io
<linuksz> ?
Gabriel Torrecillas Sartori
@G4BB3R
What is the idiomatic way to transform (a | nil) into a ? I mean, giving it a default value if nil
Ghost
@ghost~55586c4815522ed4b3e08557
It depends, how do you assign a ?
From IRC (bridge bot)
@FromIRC
<Papierkorb> @G4BB3R, a || "some default"
<Papierkorb> Watch out for when used on a Bool?
Hanyuan Li
@hanyuone
Has anyone used libgen?
From IRC (bridge bot)
@FromIRC
<bmcginty> @Qwerp-Derp: Yes. I couldn't get it to remove common prefixes from things, but that was my only issue.
Hanyuan Li
@hanyuone
Hmmm, what do I put in the "includes" field?
name: LibGTK
ldflags: "-lgtk-3"
packages: "gtk-3"
destdir: src/libgtk
definitions:
  application:
    description: Application
    includes: [ gtk/application.h ]
    prefixes: [ gtk_ ]
Currently I have this, but it doesn't work
bmcginty?
I'm confused as to why this syntax:
a, b : Int32
is available in structs, but not classes
Hanyuan Li
@hanyuone
Hello?
Serdar Dogruyol - Sedo セド
@sdogruyol
hi @Qwerp-Derp
Hanyuan Li
@hanyuone
Hello @sdogruyol!
I'm having problems with libgen, can you help?
Serdar Dogruyol - Sedo セド
@sdogruyol
sorry, I don't have much experience with libgen @Qwerp-Derp
Gabriel Torrecillas Sartori
@G4BB3R
There is no (easy) way to load from DB and it receive a json with correct column names instead of list with values?
From IRC (bridge bot)
@FromIRC
<RX14> "a json" do you mean a named tuple?
unreadable
@unreadable
you can get the result as a tuple
I made a function that converts that tupple to json
Gabriel Torrecillas Sartori
@G4BB3R
image.png
From IRC (bridge bot)
@FromIRC
<RX14> you want something like this: crystal-lang/crystal-db#56
unreadable
@unreadable
  #converts tuples to json
def to_json(keys : Tuple, values : Tuple) : String
    if keys.size != values.size
      puts "Different tuple sizes!"
      return ""
    end
    json = "{"
    keys.size.times do |i|
      key = "\"" + keys[i] + "\":"
      val = "\"" + values[i] + "\","
      json += (key + val)
    end
    json.rchop + "}"
end
I
ex: to_json({"name", "email",}tuple)
From IRC (bridge bot)
@FromIRC
<RX14> please please don't do that
<RX14> that's no escaping at all
<RX14> use JSON.build
unreadable
@unreadable
Not sure if needed
Yeah I've used that before
require "json"

string = JSON.build do |json|
  json.object do
    json.field "name", "foo"
    json.field "values" do
      json.array do
        json.number 1
        json.number 2
        json.number 3
      end
    end
  end
end
string # => %<{"name":"foo","values":[1,2,3]}>
From IRC (bridge bot)
@FromIRC
<RX14> it's always needed
unreadable
@unreadable
In my case the data is queried from the database
not directly from the user
From IRC (bridge bot)
@FromIRC
<RX14> and where does the data in the db come from?