« first day (1632 days earlier)      last day (3541 days later) » 
00:00 - 17:0017:00 - 00:00

17:09
Okay so now the client is processing the 98 MB JSON response from the server.
However the JSON.parse seems to get stuck, no surprise
yes, a 98 MB uncompressed file of trues and falses representing a voxel map that is 512*512*64
0
Q: Invalid HTTP status code 405 AngularJS with WCF rest service

SajeetharanI am developing a sample application with wcf and angularjs. I have tested the wcf method with rest client and it works fine. But when i tried to post the data it gives me this error. XMLHttpRequest cannot load http://localhost:53455/eSuperVision.svc/CreateUser. Invalid HTTP status code 405 I ...

Evidently the garbage collector is also having some intestinal problems trying to clear it all off Very Quickly (tm)
So how long exactly is the JSON parser supposed to take to process a 98 mb file of 3 dimensional boolean arrays?
17:14
you can parse streaming json
Okay this is evidently not my program's fault
I just tried a jsperf for JSON.parse and it's hung up on the first test
What's going on?
morning
does jsperf.com/json-parse-speed/11 do anything on firefox for any of you?
17:58
@AwalGarg it's not as common though
For a 98mb 3d boolean array it'd be crazy to represent JSON
That's like 70 floppy disks
better a byte would have 8 spots for that
Each boolean takes false, which is 7 bytes if you're lucky - so in one kb you can have 146 booleans. If you use binary data a boolean is a bit, and you can store 8196 booleans in a kb
assume base64
x,y,z,color,alpha,reserved,reserved,control
18:01
BACK IN MY DAY: We had to reformat a computer without network capability, so we had to back up everything by copying it onto a floppy and moving it over the sneakernet. We had three floppies.
@JanDvorak Assume a frictionless, spherical base64
with, or without udders?
@SomeKittens instealled win95 on a lot of floppys, needed to reinitiate sneakernet transfer for a few of those packets as they were corrupted
2nd transfer had backups, still a 3rd one needed
the days/.//
@JanDvorak six-bit udders
ohh and tried to transfer data over the PING protocol lol
reason I'm using boolean is to save on memory in the long run (1 bit instead of 4), at the expense of boolean verbosity
18:05
uh... wat?
"true....." "false......" "t" <-- nope, gotta be more specific
@oldmud0 not a single language I know stores a boolean as a single bit,you should still store it as one in storage and then read it.
ok then
Your 98 mb array would become a 1.75 mb array if you encode it as binary data and not a textual format like JSON
You can then read it into a Buffer as one chunk and then work on it as binary data - reading it as Ints and using bitwise operations - that way you wouldn't even need to have 98mb in memory ever.
You'd just have 1.75 of memory taken, a 56 fold improvement and access would likely be even faster and so would writing it back.
well I'm making a bot for a voxlap game. In reality the map is RLE'd, compressed with zlib, then transmitted over ENet with the packet compressor enabled. So I only receive about 682000 bytes from the server, then the bot sets up a simple HTTP server that takes requests from the voxel clients that want the map data in JSON.
18:12
@BenjaminGruenbaum You never answered why TypeFlow (or whatever FB's thing is called) >> TypeScript
I'm on vacation with my family so internet is scarce - so I might not get pings, I'm here now - what was the question?
@BenjaminGruenbaum gcc can optimize if you have more bools to group them into a single byte
@oldmud0 You've attached rocket engines to a donkey. Instead of refining the rocket engines, try a car.
not sure how to go about that still...
@BenjaminGruenbaum I was musing on using TypeScript for the CryptoPals challenges (as I've had type issues) and you said to use Facebook's thing
also, yay vacation!
18:14
@CSᵠ yeah, so can clang - but only if you never ask for their location and never hold a pointer to them or something like that.
@SomeKittens oh, if you use flowtype + babel it's a better stack but it doesn't work too well on windows.
Babel > TypeScript
Yes, but what makes it better?
Babel has the whole of ES6, typescipt has a limited subset
Babel doesn't tie you to a language - it's just JavaScript
Flow is a better type system than TypeScript most of the time
Best libraries for Localstorage phonegap app, I know one amplifyjs, but worrying about best libraries which can handle large user data
@BenjaminGruenbaum Ah, that makes sense. TS does have the advantage of being the thing used for Angular 2.
@SomeKittens not sure how that's an advantage
18:20
Yeah, I've followed some of the design docs.
I have to go soon, anything else?
(removed)
Enjoy wherever you are!
@BenjaminGruenbaum, do you know any Webstorage libraries
18:26
@pirabdulwakeel BenjaminGruenbaum is afk.
afk, sound more like brb
Hey, are you complaining the person you've pinged randomly isn't here?
Most of the time, whenever need help, benjamin is here to help me.
Help vampires usually shouldn't have such a narrow diet
@pirabdulwakeel I bet Google knows more than he does.
18:29
I don't think so, for a specific problem
He love hitchhikers.
back from shower
5
Thanks for the star
18:48
No problemo, amigo!
I live to please
Hmm no good links today eh?
Come on team. Let's get some good links going.
A good link. Just for you.
19:33
thats interesting.
node hosting will be on godaddy
godaddy sucks, however thats still cool.
@Loktar that's oooold
Feb isn't that old
lol I just saw it because I host with them and wanted to add another instance lol
Ill be cancelling now though, i don't want to deal with godaddy personally
you're like my grandpa saying stuff like "yeah cell phone is super cool!"
hahah whatever
19:36
I had to look at the date, I thought it was posted April 1st maybe
but nope :/
is it possible to know if a user is looking at your site in the current tab?
I need a new host
looking at digital ocean vs ramnode
@corvid visibility api
my vps is costing me $158 a month, and is slow
thats just BS imo.
19:41
@Loktar DO is cool. For VPS I always go with ovh though
ovh?
ill check them out
But that's mainly because they're french...
@FlorianMargaine how do you know so many things? ._. thank you good sir
ooh lol
@Loktar WTF?!
19:42
The prices are the best in France though
@FlorianMargaine how do you know so many things? ._. thank you good sir
@PeeHaa yeah it has 8gb ram iirc
@Loktar rlemon is at ovh too
thats what upped the price so much
@Loktar wow 8G... ;)
I pay 60 for that and I know my supplier is expensive
s/expensive/not cheap
19:44
@PeeHaa on a vps?
yes
I get 16tb of bandwidth as well
/me looks at plan again
oh its also managed :P
That is a lot. However I don't think where I am they are actually checking bandwidth.
@Loktar aha managed.
that def bumps the price up a bit
my colo server for example is like $90 a month
unmetered 100mbit and I have my own 1u
Yeah. "managed" is always way more expensive. Why do you have managed in the first place?
@Loktar I fucking hate hardware :P
19:46
same
I have an HDD failing in my array :/
so I need to have it shipped back, then I'm done with colo
Mucking about with TypeScript
Equal parts great and annoying
@Loktar ugggghhh. Did I mention I hate hardware yet
because I do
haha
:D
Ain´t nobody got time fo that
yeah exactly, it sucks
now I need to pay like $150 to have it shipped back which really sucks
19:50
:(
theoritically, should this work? return token || throw new Error('no token available');
Sure, but don't do that
@BenjaminGruenbaum yeah he should better not be using json if he has that large of data imo.
anyone has implemented a tray icon for a node-webkit before? new gui.Tray for some reason has no effect on unity :/
hmm, python gtk is so complicated :(
@IanClark o/
20:05
\o @AwalGarg :) - how're you?
@IanClark good. writing python :)
like it as a language very much, but the gtk api is so uncool.
Python would be great if it had curly brackets
yeah I miss them too a bit. but I guess you get used to it...
Yeah I had the pleasure of using python in a project for school
Got used to it pretty quickly, but I still missed them :(
same
JS is till now the best toy language I have used...
2
20:28
why toy?
@CSᵠ Too many/not enough Monads.
21:18
@AwalGarg its a beautiful language, though I think all UI stuff is lacking. Screw curly braces! Unfortunately in comparison to JS its obviously a much more mature and consistent language too!
The "batteries included" slogan is really accurate. Its nice to see that ES6 plans on bringing a lot of the features that I love in python, but its readability and customisability (e.g. operator overloading) I love (though some hate)
@CSᵠ terrible behavior of typeof, ==, frameworks becoming old as last hour, too much unstability etc. These are not signs of JS being bad, it is just evolving. It will be awesome as python (and PHP :P) one day. I love JS a lot.
@IanClark true. python's consistency is lovable.
Ultimately though, why would you ever really develop anything not for the web these days.
JavaScript will always win, just because of that.
@AwalGarg i agree, really shit... typeof
Users don't give a shit about what language you used.
^ 100% true story
21:29
ya
@phenomnomnominal Because many applications don't have an interface
users see the bugs though
@IanClark I wish ES6 brought named parameters like python. they are too good.
@copy meh, those are just pointless then :P
I find the majority of web applications pointless
21:31
@copy the one you are on right now?
@copy a web interface*
the CLI is still an interface
@phenomnomnominal @copy a interface* (source)
dammit @FlorianMargaine!
@AwalGarg IRC
@FlorianMargaine No, I mean no user interface at all
21:32
@AwalGarg I wish I could get rid of it.
@copy you mean the CLI is pointless?
@copy oh. That groundbreakingly terrible thing?
or I misunderstood something
@FlorianMargaine getting enrolled in academics helps. I can only come here on weekends now :P
@AwalGarg meh. I keep wanting to redo SO chat in ncurses or something, the web interface sucks
@copy if it has no user interface at all, how do you run it?
21:34
@phenomnomnominal Like every other server
@FlorianMargaine you collaborated with @dystroy to make miaou, which I like very much.
@copy at some point, someone has to start it though.
which means it has to have a UI of some sort
@phenomnomnominal hook into the kernel runtime
something without an interface is like a someone making a function and forgetting to call it.
and run it with a screwdriver
21:35
@phenomnomnominal No, you type ./foo and it runs
that's an interface
@copy where do you type it?
a very nice, simple one, but still an interface
3 mins ago, by Florian Margaine
the CLI is still an interface
Heya, don’t know if you care enough here about your starred messages, but if you do, this might be useful to the ROs. (*shameless plug*)
21:35
Yes, but it's unrelated to the program
@poke we don't care around here
except really stupid stuff
Alright ;)
the script can be useful for when someone spams stars though
usually around winterbash
@poke nice! :)
....Seriously? It was an off-by-TWO?
21:49
@AwalGarg using a single obj argument in JS is hardly intuitive I agree, even if you add JSDoc style notes
@IanClark and setting default param values on it is even more of a pain
func (arg) { arg = arg || 'def'; } <-> func (obj) { obj.foo = obj.foo || 'ughh'; // repeat 10 more times }
and for better consistency, you'd have to use if typeof foo !== 'undefined'..
@AwalGarg Especially if passing in an empty string is a valid argument :)
@AwalGarg _.defaults
@GrantWatters true.
@phenomnomnominal well I can implement a lot of functionality missing that way, but I want it native.
@AwalGarg why?
21:57
@AwalGarg I can’t wait for ES6 destructuring default parameters…
because named params are syntactical features, imo. libraries are not meant to implement them.
@poke yeah they are quite nice. super handy to emulate multiple return values like go too.
Also generally avoiding default parameters alltogether if possible can be a good idea. It makes your code easier to follow, maintain, and refactor. Granted there are cases where they are good/useful..
How do you solve default configuration then? Just don’t provide defaults and require the user to specify everything?
@SimonSarris You have time to comment on HN but not to reply to me? For shame!
@AwalGarg every single library has its function to handle that
most famous is jquery's extend
12
A: jQuery - plugin options default extend()

m90You mixed up the order of the arguments in your $.extend (target should be first), it should be: settings = $.extend(settings, options); See this fiddle and the docs for $.extend() To avoid confusion you can also extend your settings with your defaults like this: methods.init = function(opti...

22:06
@poke Depends what you're doing.. but setup/configuration would likely be a case where defaults are a good thing. But in general writing a function like "function doThing(data, doOptionalThing) { ... }", you should just consider doOptionalThing a required parameter. When reading through the code, you know whats happening rather than having to go look at the docs/source for 'doThing' to see that doOptionalThing is default 'false' or that it may even have a second param.
Then again I'm also a proponent of inline comments.. for example code calling 'doThing' would look like doThing({ data: "test" }, /*doOptionalThing*/false). Means you don't have to think about what doThing might be doing at all, or what your params might be doing.. its all there for you.
Yeah, that makes sense. Although I’m not a fan of doThing(data, false) / doThing(data, true) calls anyway. They are not self-explanatory enough. JavaScript would need named arguments there: doThing(data, doOptionalThing = true).
I just prefer doThingWith and doThingWithout
@poke ^ agreed, which is why having inline comments like that for the params is useful :)
@FlorianMargaine Also a great pattern.. but I think it works best if you have simpler functions that only have a single parameter that is going to change the behavior. If it starts being more complex then having helper functions start to be more confusing. Granted you could also argue that you should write complicated functions like that.. :)
@GrantWatters if you start having several optional parameters, yeah, you're doing something wrong
@FlorianMargaine But it does happen sometimes, or if you're inheriting code from someone else, etc.. the inline comments can still be helpful if you aren't going to refactor the offending functions
22:14
Another alternative to inline comments would be to just spend a variable on it:
let doOptionalThing = true;
doThing(data, doOptionalThing);
@poke Absolutely :) The tradeoff being vertical space and polluting your local scope with additional var declarations. Not things that are the end of the world for sure, but I find the alternative to have less of a downside
@GrantWatters Or split to two functions...
@SecondRikudo Yes, I believe Florian mentioned that :)
@GrantWatters dunno, I've never needed that
(and yes, I've inherited big codebases)
AssertionError: true
...wat
22:22
it expected false
  assert.equal(crypted, ecb.encrypt(Buffer.concat([oneShort, bite])), true);
^ that's what's throwing it
you're passing 3 args to assert.equal
the third one is the message right?
true is the error message
...shoot
yep, that was totally it
use TS, it would've caught it :P
22:23
@FlorianMargaine I AM using TS!
then it's bad. Report bug.
typescript?
it shouldn't accept a boolean when it expects a string
@JohanLarsson Yeah
and Buffer.concat shouldn't accept only one argument...
22:24
@FlorianMargaine But isn’t “true” a perfectly valid error message? ;P
@poke well, I said boolean, not string
;)
@poke Just guessing that it accepts varargs like log would rather than explicitly a string
I love the little thing in emacs that transforms lambda into a lambda symbol
22:25
@FlorianMargaine Or OCaml
looks like it is expecting a string, but optionally?
@FlorianMargaine So cute
@SomeKittens the argument is optional
but yes, it expects a string
That does look like a bug (providing an optional argument that's wrong is still accepted)
the playground catches it though
22:28
So I'm importing wrong?
dunno
but yeah, something's fishy somewhere
The extern definitions are wrong
This whole thing has been an absolute mess.
I've found five different off-by-ones.
gridstylesheets.org The future is now! :D
Also, do you know why node's crypto adds an extra block when the data to be encrypted is an exact multiple of the key size?
22:32
@SomeKittens You mean block size?
aaaand beat it!
@copy yeah, block size
reminds me of tar
such a waste
"if it's not a multiple of 512, fill with NUL bytes until it is"
Maybe the padding includes the length? @SomeKittens
nope
the length is filesize
the padding is for legacy reasons
@FlorianMargaine Is that internally or only the end of the tar file?
22:34
> For compatibility with tape drives that use fixed block sizes, programs
that read or write tar files always read or write a fixed number of
records with each I/O operation.
@copy internally, after each file entry
That still makes sense though
yeah, but it's still a waste
although I guess that gzip can compress this pretty well
1 message moved from HTML / CSS / WebDesign
reminds me that I wanted to implement gzip...
the rfc was a pretty good doc: tools.ietf.org/html/rfc1952#page-5
22:39
@copy not needed in tar, the length is specified in the headers
There are several padding schemes that require an extra block if the input size is a multiple of the block size
So that the padding can be distinguished from the last block
hm
I think it's just easier to specify a length
you just use a couple of bytes for that, and you're set
That's what is often done
4 bytes ought to be enough for anybody
No
22:45
that was a joke :P
Got me, Mr Comedian
Now what headset should I buy?
Beats by Dr Dre, of course
Ugh
22:47
don't listen to me for headsets, I'm deaf
Really?
kinda
I wear hearing aids since (almost) birth, but I'm still bad at hearing things, so I can't tell you the difference of quality between 2 headsets
I'm getting a weird problem with Meteor :\
23:16
@copy Pick one from here: aftershokz.com/products
@FlorianMargaine also you might find those ^ delightful
Hello All
I gotta question..duh
no association btw
i need an idea for solving this problem
so I have a array of objects
go
here is a fiddle to better illustrate
I need to loop over this array of objects and consolidate the values of each item down to one type that contains an array of the values for that type
23:23
you kinda need 2 pass
Whats the sort call for?
sort the type, then the values
hmm let me take a look
I need to consolidate the array
so that way it just has three types
of type a,b,c
and the values for each
what are you using it for?
wow
that output is better than what I wanted
how did I not think of that
so simple and works perfectly
23:30
make sure you're breaking it down into sub-problems.. working backwards from your goal is helpful :)
Hi, I know this is not an efficient practice, but is there a way to restart a node.js file from within the node code itself?
you know where you want your data to end up, figure out each step along the way rather than trying to jump straight to the end
thanks man I appreciate it
I basically want to "reload" the node code from within the code itself.
@Zirak?
23:47
anyone here happen to be good with mongodb? Got what should be a pretty easy question...
{
  _id: "someid",
  profile: {
    characters: [{
      //some array of objects goes here
    }]
  }
}
I want to query the characters array, see if an entity exist, and return the single object from the array. How would that be done?
@corvid You'd like to search through the characters array to find if something equals to one of the elements in the array?
well, that is a single entry within the users collection. I'd like to search all the arrays of characters in the user collection, if that makes sense.
So characters would be mainArrayName[1][0]?
I guess you could use indexOf() on mainArrayName[1][0]
Oh, because it's for each user, I guess it would be user[i][1][0]
00:00 - 17:0017:00 - 00:00

« first day (1632 days earlier)      last day (3541 days later) »