« first day (2561 days earlier)      last day (2612 days later) » 

11:02
I don't think you can categorize that in terms of best practice. Passing an object is nice, passing an object with default arguments is also nice
yep
I'm using destructuring
but I found an issue
what if I want to pass no parameters
I have to do myFunc({})
which is ugly AF
@Neoares Set a default value
what do you mean
no no, I have default values for all of them
constructor ({autoPlay = false, log = false, wideScreen = null}) {
but if I want to call the constructor and leave it all with default values
I have to call it passing an empty object
constructor ({autoPlay = false, log = false, wideScreen = null} = {}) {
11:07
:o
!!magic2
let me try but I think I'll have another problem then xD
hm... no, it works
I though I was going to get errors on variable usage
this is awesome
more fun to come if one of the default arguments is an object aswell
animate( { node, id = 'last', rules:{ delay = '0', duration = 200, timing = 'linear', iterations = 1, direction = 'normal', mode = 'forwards', name = '' } = { } } = { } )
I think this is where best practice ends :P
lol
you're a magician
to come back to the original question.. I think if you have such deep data structures, it should be best practice to solve that more "oldschool" within the function body
I mean... this is probably edgy, but if there are even more data structures this becomes ugly/unreadable af
11:13
at the moment I have just normal variables
no objects
by the way, can't you split that object in different lines?
just to make it more readable
yea for more simple data structures destructuring is perfect
yea definitely, but I wouldn't know if that makes it more readable
yea
animate( {
	node, id = 'last', rules: {
  	delay = '0',
    duration = 200,
    timing = 'linear',
    iterations = 1,
    direction = 'normal',
    mode = 'forwards',
    name = '' } = { }
  } = { } )
chat weird format...
might be better, but I hate that kind of style. Function definitions must be one-liners! :-P
11:28
i got a challenge for you guys
sqlfiddle.com/#!6/ba9c8/3
this is the fiddle

get the nth grand children of id '28'
Do my homework
nope
that ain't a homework
i was able to reach to one nested.
can't able to find a way to make it nth
Do my homework anyway
learn how to do SQL JOIN statements
or, in case you did not understand: do your own homework
Also, don't spam your question in 3 different rooms.
11:33
Lol did he just call Ben a noob XD
I am actually tempted to flag
@jAndy you don't understand, it's a challenge
An opportunity
I fully understand. That's what my professors and teachers told me every time when they gave homework
I'm not going to flag since it's not a case for a mod, but I think his repeated behavior is something that ROs should take note of
@KamilSolecki Oh we know
11:35
@jAndy that doesn't make it seem less slimy
@BenFortune ye but ones who come in the evenings might not
@KamilSolecki We have a system in place
aaand kicked from C# room
He's on the vamp list
@KendallFrey why do you always do the fun things before me
11:37
Because I'm a few months older than you
(I don't actually know when your birthday is)
20 may
Yours?
jan
so, yeah :D
Fuk u kendoll :(
I don't have a ken doll to fuk
11:38
at least star the noob, that's funny
7
:-D
11:50
@FlorianMargaine @Loktar @KendallFrey is only game, y u hef to be mad
flags everywhere
Man, people are amazing
@rlemon God fucking damnit still really
it's been years
@Cereal yes, it has been years that the four of us have been pinging eachother every friday with the link to that video
I'm glad you've finally caught on
11:59
This is the first time I've noticed in the past few months
it's pretty much the only time I talk to @FlorianMargaine
Greetings everyone
I got a script , I'm making AJAX calls to POST to a REST service
var JSONObject= {"amount":parseInt(numbers.text()), "loanTenor":parseInt(duration.text())};
var jsonData = $.parseJSON(JSON.stringify(JSONObject));
Inb4 cap
1 message moved to Trash can
@gbade_ Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
12:01
Okay
1 message moved to Trash can
@gbade_ Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
From
data: jsonData,

I'm getting a 400 Bad Request
I added a breakpoint and discovered that the request comes like this

jsonData = {amount: 525000, loanTenor: 6}
whereas it should be this -
jsonData = {''amount":525000, "loanTenor":6}
Please how can I resolve this?
@gbade_ use JSON
I'm using JSON
Did you get my previous post?
You just said you're not
{amount: 525000, loanTenor: 6} This is not JSON
12:07
I know
@KendallFrey He posted what he's doing above
I did this
var JSONObject= {"amount":parseInt(numbers.text()), "loanTenor":parseInt(duration.text())};
var jsonData = $.parseJSON(JSON.stringify(JSONObject));
var JSONObject= {"amount":parseInt(numbers.text()), "loanTenor":parseInt(duration.text())};
var jsonData = $.parseJSON(JSON.stringify(JSONObject));
I parsed with jSON and it gave me


{amount: 525000, loanTenor: 6}
I recently had my appendix removed. Will this cause more strain on my glossary and index?
12:09
@Cereal Please how do you format to write code here
@gbade_ Well once it's parsed then yeah it's not supposed to be JSON
You hit ctrl+k after pasting then code, then you hit send
hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@Cereal
Thanks
@KendallFrey how do I then parse it so it'd be JSON?
No, that's not how it works
You parse it from JSON, not to JSON
12:12
Okay, so how would I rewrite this -

var JSONObject= {"amount":parseInt(numbers.text()), "loanTenor":parseInt(duration.text())};
var jsonData = $.parseJSON(JSON.stringify(JSONObject));
@gbade_ You're confused.

Your first line, `var JSONObject= {"amount":parseInt(numbers.text()), "loanTenor":parseInt(duration.text())};` puts a physical object into JSONObject
@gbade_ var jsonData = JSONObject;
Meaning, JSONObject.amount would return whatever numbers.text() was
JSON.stringify turns an object into a string
Okay. Thank you
12:13
So in this case, "{\"amount\":1,\"loanTenor\":2}" or so
$.parseJSON turns a JSON string into an object again
guys this might be silly, how can i change the font color in command prompt. some text ares not visible
json is old news anyways, everyone is using XML again
i changed color in properties tab but still it does not
12:15
@Sajeetharan Which one? Windows? If so, which version?
windows 10
@Sajeetharan That works fine for me vOv
@KendallFrey

var jsonData = JSONObject;
Still shows this -
{amount: 525000, loanTenor: 6}
you can use color command
@user1033241 Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
12:16
@gbade_ Yes, that's the object you created
@user1033241 how'
"color ?"
@gbade_ a 400 Bad Request is an http response, the problem is on your server, not your javascript
i amddoing this gulp cpd
how can i add color
Is there any way to block loading of a specific resource in chrome? for example I want to block loading of a specific css file
By loading i mean "GET" ing
@user1033241 how
I'd try that
@OliverSalzburg thx I'll give it a shot
@KendallFrey, exactly how can I create the JSON object to have this format -
{"amount": 525000, "loanTenor": 6}

rather than
{amount: 525000, loanTenor: 6}
@gbade_ Which do you want, JSON, or an object?
JSON is a string
12:20
You're a string
JSON
@gbade_ You can send an object just fine
@gbade_ Then JSON.stringify
Okay. I actually did that
Lol shitstorm, what an entitled douche
12:21
Only I then parsed it
@gbade_ And then you parsed it right back into an object again
@KendallFrey yeah, I kind of confused myself
My bad
@BenFortune I see no poopstorm :O
probably just getting caught up with arrow
Ah yeah
I already forgot :P
12:24
oh, he's back and banned again already?
he said teresko had a dirty face
that was kinda funny
god @tereško wash yourself
That is exactly what he said xd
lol, I see that (after posting)
wtf Edge renames .msi downloads to .man
.exe is apparently fine though
12:26
Am I going mad this imgur.com/a/qsgqA is an object literally right before putting it into a socket and this imgur.com/a/Zz9eh is it literally right as it comes out what could I be missing
The patriarchy strikes again
.jpg.exe should be default windows file ending für executables
@KamilSolecki I'm looking at one
Is there a timeout of loading of a js or css file?
in browsers
@kikjezrous What's the problem
12:28
Here's the server-side code
For one, I'm putting in a real 'size' and getting out a NaN
Is there a hotkey in vs code to open the last file you closed?
like ctrl+shift+tab opens the last tab you close in a browser
@Cereal ctrl+shift+t?
Why/when/where/how could 'color', 'size' and 'facing' be changed in this?
12:31
If there isn't, you can probably create a shortcut for it, I'm sure there are bindings
I'm absolutely perpelexed
@kikjezrous Have you checked the actual network traffic to find out which is going across?
Good idea, I'll take a look
@BenFortune Opens the last closed editor
If you're in a file, and hit "ctrl+p", select a file
12:35
ah
... looks like the proper one's going through?
It opens a file in the current tab, and I can't find an easy way to switch back to the previous one
@kikjezrous Which is the proper one?
The one from the server, without NaNs
@Cereal Maybe something like
{
    "key": "ctrl+shift+t",
    "command": "workbench.action.quickOpenRecent"
}
12:37
I think "recent" in code's perspective is recently opened file, outside of the workspace
1 message moved to Trash can
@kikjezrous Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@Cereal Oh yeah, that's just for workspaces
Here's when 'gui' is initialized in the client
var gui = {
    skills: {
        typeData:[],
        points: 0,
    },
    upgrades: [],
    score: 0,
    progress: 0,
    level: 0,
    type: "Unknown Viewport"
};
@Cereal Ctrl+Shift+T is "Reopen closed editor" for me. IIRC that's the default
Good morning all
12:38
Oh, well now hitting ctrl+p and selecting a file is opening it in a new tab
What in the world is going on
Now it's replacing the current one!
how do you create a 1 on 0 or 1 relation in sql?
google gives me a shit ton of "boolean 0/1" results
Okay
I'm lost as shit now
Time to make a new full question
12:42
@Wietlol wat?
I need to make a sensor I can put in my coffee to notify me when the optimal drinking time is
And what SQL?
I make coffee, too hot to drink. start working, forget about coffee, now it's too cold.
ffs
MsSql
I have two tables (a and b)
@Wietlol are you talking about joining?
12:42
@Wietlol Shocking
and a has a field which has the id of a row in table b
every row in table b only belongs to one row in table a
but the rows in table a can also have a null value so no row of table b
@rlemon I brought in a thermos for that exact problem
but what constraint is it?
Okay this has to be a bug. I just switched to tab 1, opened a file, and it overwrote tab 2
@Cereal gives me a reason to use one of my arduinos
12:44
It either has an ID or NULL
What kind of constraint do you need for that?
If that is your question, the answer is "none" :P
I end up with a 1 on many relation
@Wietlol I think that's a LEFT JOIN, right?
Where do you "end up" with it?
@Vap0r not in a select though
@rlemon most be some cast-based indian insult
12:46
@OliverSalzburg hmm... i think it might be Entity Framework
Ah
If you only want 1 record to reference another record in table B, then you might want a UNIQUE constraint on that FK column
@Wietlol what does the text that does this look like? Is it SQL, is it LINQ?
0
Q: Real values go into a socket and NaNs come out

kikjezrousOkay so I'm sending an object gui through a socket and values of gui.upgrades are getting messed up somehow. size becomes a NaN, facing becomes some random value, and color is modified. gui.upgrades before entering the socket: Image // Code gui.upgrades after exiting the socket: Image // Code ...

Real values go in, NaNs come out... you can't explain that!
I've got not a clue what's going on
12:48
@Vap0r its the EF that generates an IEnumerable for the 'b' values in the 'a' class
The change in color seems to indicate that perhaps somehow it was intentional on my part. 8 represents blue which is what I wanted to have it set to although I hadn't done it yet. I'm just sure where or how this is changing
@Wietlol oh sorry man :( I don't use EF never really cared for it too much
@OliverSalzburg lemme try that
@OliverSalzburg doesnt work, duplicate key "NULL"
@OliverSalzburg hey, check my comment in reply instead of hastily downvoting?
Maybe it's not a bug. Does this sound like a bug to you guys?

If you open a file in VS Code, then switch files, it will overwrite the opened file provided no changes were made to the file, and the file wasn't saved.

If you have >1 files open, opening a new file will replace the first file in the above described state, regardless of which tab has focus
12:54
Guess at this point you'd only be able to know by checking documentation but I've got to say this behavior never seemed weird
I just thought of it as trying to keep the workspace clean
@kikjezrous How about you don't assume I downvoted your question?
@Wietlol Well, that's a problem :D
@Mosho an app called WorldBuilder
the creator posted it to reddit w/ some details and a fulla lbum
@OliverSalzburg fair enough. Do you have advice for improving my question?
@kikjezrous I left a comment
Then I returned to work :D
I've replied
12:56
434
Q: How do I create a unique constraint that also allows nulls?

StuartI want to have a unique constraint on a column which I am going to populate with GUIDs. However, my data contains null values for this columns. How do I create the constraint that allows multiple null values? Here's an example scenario. Consider this schema: CREATE TABLE People ( Id INT CONST...

@kikjezrous Haven't checked yet. I'm actually at work. Even though it doesn't seem like it all the time ;D
Got it haha

« first day (2561 days earlier)      last day (2612 days later) »