« first day (1854 days earlier)      last day (3109 days later) » 

7:00 PM
I think its funny how the question itself has 4 upvotes, the accepted answer has 11, and you have 88
 
lol yeah
That answer took like an hour and a half to write
I was stuck waiting for someone to stop using a dev server, so I figured I might as well answer a question
then it just kind of evolved through subsequent edits into that masterpiece
 
@ShotgunNinja link pls
 
then I posted it as the first comment on a stickied Meta post about docs
88
A: Constructing Rectangle

Shotgun NinjaAssumptions I'm assuming you're unfamiliar with the syntax of the Java language, and trying to piece together your first Java class. I'm also assuming you need the following things: A definition of a Rectangle. The properties x and y, indicating the Rectangle's origin. The properties width a...

It's pretty basic "How do I objects" stuff
 
cool
 
@á¹¢hmiddty @Room I have an SQL question if anyone feels like helping.
 
7:04 PM
sure
 
@BenjaminGruenbaum go for it
 
I'm using SQL server and I want to return multiple rows from multiple tables in one go.
 
union
 
SELECT GROUP_CONCAT(Concat('TRUNCATE TABLE ',table_schema,'.',TABLE_NAME) SEPARATOR ';') FROM INFORMATION_SCHEMA.TABLES where table_schema in ('my_db');
should work :D
 
lol
 
7:05 PM
My query sets a few variables and then INSERT INTOs them, I want to return the variables.
 
@ShotgunNinja nice tutorial. happen to have a blog (no jerking, really good, would upvote if I had js :/)
 
The tables don't have the same structure.
 
use an as
 
So joins and unions are not what I'm looking for
@jumpstracks as?
 
to rename the columns and normalize the structures
 
7:06 PM
@BenjaminGruenbaum SELECT foo.bar AS that
 
@ssube let's say I have a list of books on the server and a list of cats, I want to return both lists in a single query - they have no field in common.
 
you can make common field names using the as syntax ssube mentioned
 
@BenjaminGruenbaum why would you want to do that?
 
Wait, I can just serialize them as XML. SQL Serve rdoes that.
 
if they have nothing in common, why are you returning them together?
 
7:07 PM
@ssube because I get the books and cats based on the same parameter.
 
(may be a better way of course)
 
@BenjaminGruenbaum so they do have something in common?
 
select foo.catName, bar.bookName from cats as foo join books as bar on (magic param);
 
@ssube let's say it's expensive to find @rlemon and I do so 10 billion times a day, I want to find all his fish and all his JavaScript books.
 
@rlemon do you need the as there?
 
7:08 PM
I don't want to hit the server twice
 
@ssube no, but I want it there okay?!
 
I'll serialize that as XML I think that works.
 
SELECT cats.catName, books.bookName FROM cats JOIN books ON author = 'rlemon'
ish. I'm really bad at SQL.
 
@ssube each field has like 10 properties
 
tbh, though, you're probably going to cause more problems than you solve trying to munge two queries together
I'd head towards proper indexes and a good cache, rather than combining the queries
 
7:10 PM
@BenjaminGruenbaum Good man. Hit it and quit it.
 
It's more like 10 queries to get an hierarchical structure, an SQL query that fetches it in one go is really slow.
I want a single round trip but not a single query.
 
@BenjaminGruenbaum just use mongodb FFS!!
 
@AwalGarg lmao, no, I want a real database, in Mongo that query would be impossible.
 
exactly. Since it would be impossible, you won't go looking for a way. Problem vanishes.
 
@BenjaminGruenbaum stored proc, server-side function, plenty of caching
 
7:11 PM
@BenjaminGruenbaum what do you mean single round trip not query? whos' the client, who's the server?
 
good connection pooling and caching, with the proper amount of memory, can be a lot faster than one big query
 
@ssube stored procedure would still perform a huge query.
 
in any case, you can always do... a.. distributed map reduce whatever in erlang
 
@ssube right, I don't want to do a single query, I want to build an hierarchical object on the client side based on several results that are tightly coupled.
@AwalGarg thanks bob
 
@AwalGarg hadpoop
 
7:13 PM
@jumpstracks client is C#, server is SQL Server
 
anytime
 
@BenjaminGruenbaum but not that tightly, just on the same search param?
 
@BenjaminGruenbaum c# on asp.net server? or ? I'm trying to get the staement of wanting multiple queries
sounded like you wanted 1 large query with multiple selects
 
@jumpstracks C# on hundreds of virtual machine, single sql server, server needs to be fast.
I don't want a large query since it doesn't perform well.
@ssube sometimes yes, sometimes more.
A single query is not an option, that's a point I'm trying to make here. I profiled it.
 
@BenjaminGruenbaum also, if your 10 billion queries/day figure is right, you're looking at < 12k queries/second. A few SQL nodes can handle that no problem.
 
7:15 PM
I'll just serialize the output to xml
 
as in a union of queries or a fancy join?
 
ahahahahahahahaha @SterlingArcher i.imgur.com/ysYJjTA.gifv
 
@ssube not if the query takes 10 seconds to run
@jumpstracks yes.
 
dear god yes
 
7:15 PM
pre process into a fact table or something?
or a view? - basically denormalize it.
 
@BenjaminGruenbaum Selecting all of lemon's cats takes more than 10 seconds?
 
@ssube selecting all the operations ever performed by an insider in the stock exchange does.
@jumpstracks that's what this is doing - this is the cache process, runs about 30 vms
 
Am gonna try use webpack with react tonight
 
[] == []; // false
[] < []; // false
[] > []; // false
[] <= []; // true
[] >= []; //true
 
@PhilipposSlicher Welcome to the JavaScript chat! Please review the room pseudo-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.
 
7:17 PM
@BenjaminGruenbaum ... I read that as stack exchange :/
 
however the docs seem to suggest browserify
 
@BenjaminGruenbaum and you need all actions, of a type and by a person, every time?
 
@ssube yes, I do. Those actions change by the way.
I run this code whenever they do
 
> CommonJS module system like browserify or webpack.
 
7:18 PM
@BenjaminGruenbaum is it possible you're using the wrong type of database? Cassandra's sharding is based around the field order in the index, so you can get a whole person at once.
It's meant for data where you need to get one huge chunk from different tables, based on the same field.
 
nm, may be an oracle only feature
 
@ssube this code is used in a million other places, I need every bit of relational data in other scenarios. What this code does is effectively pour the relational data into an hierarchy for effective queries.
 
@rlemon 10/10
 
user1596138
@rlemon lmfaooooo
 
7:20 PM
@BenjaminGruenbaum We're doing something similar from Mongo to Cassandra, for a very similar query actually.
 
As in - this is not a database skin app - the data is actually queried extensively in a lot of places in different ways.
 
We take demographic data from our main DB, tweak it a bit and copy to Cassandra, then fetch all the data for a specific person (potentially millions of records).
 
@ssube right now our query takes about 3-4 seconds. It's way too slow. I want to get it down to about 100ms.
 
3-4 SECONDS!!!! Welcome to 1998
 
We were going to use SQL, but the sharding in Cassandra is way better for this type of bulk fetch.
 
7:21 PM
@ssube yeah, that makes sense. This is just copying to our cache layer - it's copying to redis where we use sorted sets and hashes to make queries very fast.
 
@rlemon Not even just kids man. I went out with this girl, she spent the first five minutes on her phone and half conversing with me, so I called her best friend up and had her show up and take her phone.
 
@Trasiva 10/10 (again)
 
that means she is not interested bro
take the hiint
 
yeah, having her phone taken is just creepy
 
7:22 PM
Sometimes I wonder if the engineers working at leading porn sites are actually able to keep up their productivity. I mean maintaining those websites at that scale would be hard (no... pun). And videos are specially tedious to manage right?
 
9/10 videos are not your fetish
in fact, may disgust you
 
I'm going with serializing it to XML on the server
 
I was paid to watch porn in order to test a video filter I made.
 
@rlemon well I imagine it would still be a bit "uncomfortable" right?
 
7:24 PM
@AwalGarg They're not the most dynamic of sites, though.
 
@AwalGarg depends on your mentality. does a urologist feel uncomfortable??
 
thx @AwalGarg
 
@BenjaminGruenbaum how does serializing to xml on server help query speed?
 
@jumpstracks it lets me return multiple results:
 
because it does......
 
7:25 PM
SELECT (SELECT * From @Performance FOR XML AUTO) as Performance,
	   (SELECT * From @Operations FOR XML AUTO) as Operations,
	   (SELECT * From @PortfolioItems FOR XML AUTO) as PortfolioItems,
 	   (SELECT * From @StockInfos FOR XML AUTO) as StockInfos,
 	   (SELECT * From @Fundamentals FOR XML AUTO) as Fundamentals,
 	   (SELECT * From @Companies FOR XML AUTO) as Companies,
 
@BenjaminGruenbaum Oh yeah, thats actualy good
 
@ssube ..and? I am mostly talking about sysadmin tasks.
 
@BenjaminGruenbaum do you know why the queries take 10 seconds to get data?
 
@PhilipposSlicher it does a query in about a second and a half, way too slow
 
yeah, in what world does ONE query take that long
 
7:26 PM
well, sysadmins their wouldn't have to watch that stuff either
 
@AwalGarg dynamic sites are harder to manage. Incoming data is a pain, outgoing isn't.
 
@ssube because it's a gigantic 550 lines query over multiple tables that does 9-level-deep joins.
 
@BenjaminGruenbaum I mean if you break it down into one query per table.
 
split it up to different sprocs and only run the ones you need when you need them?
 
@ssube that's what I did, pretty much. It's not nested 9 levels deep anymore, there is a single join.
 
7:27 PM
@ssube (honest question) did you learn programming/tech at university or self?
 
@BenjaminGruenbaum Right. I think I'm missing something performance-wise. The 550 line query was ~10 secs, then it got better, but not good enough?
 
@AwalGarg ik you didnt ask me, but I know 9 languages, 3-5 fluent, self tought
 
@AwalGarg Spent most of high school doing it as a hobby, instead of having friends, then got a job.
 
@ssube yes, it was 10 seconds long, got it to two with this XML trick, need to still get it 10 times faster, I think I'll create some indexed views to make things go faster.
 
@PhilipposSlicher That's great!
 
7:28 PM
@BenjaminGruenbaum I assume you ran explain on the old and new queries?
 
@ssube yes, of course, no indices are missing.
 
@AwalGarg yeah it is! So fun, and I'm not even over 18 yet
 
@ssube That's great too! (not having friends, I mean)
@PhilipposSlicher oooh nice! I just turned 18 :) I know a couple less than you though
 
friends are overrated. all you need is like 6 cats.
 
@BenjaminGruenbaum Hm. Sounds like you've covered almost everything besides changing how the data is stored.
 
7:30 PM
@AwalGarg Nice, have fun then!
 
@AwalGarg it was not, which is why I'm going hard on the socializing and partying for the last year or so
 
@rlemon lol @ '6'
 
@ssube I think the data is stored poorly for this use case - but the thing is: this use case is far from the only one.
 
@AwalGarg Now you just need to go try and get laid.
 
This is what I'm doing here to begin with :)
 
7:31 PM
@BenjaminGruenbaum Yep. Depending on just how consistent you need things to be, different databases (or even just different table layouts) for different queries is useful. Especially at any kind of scale.
 
doing anything special once on client? ex can you use an insert into and skip client writing back to server?
 
@jumpstracks I'm dumping it to REDIS on the client.
 
We could never calculate population membership with mongo, we tried and it took days. With the data broken down correctly in Cassandra, it's under an hour now.
 
I have to grab data, build objects, grab more data, add to existing objects, repeat. Should I just chain ajax callbacks?
 
@ssube from my experience, having non-nerd friends is a big distraction to your non-non-nerd tasks.
Then again, I have been a nerd for like 1.5 years.
 
7:33 PM
@AwalGarg how long have you been in tech
ah
 
gets old after 15+ yrs
 
@AwalGarg personally, I've benefited tremendously. Spending my free time doing things unrelated to work (not playing video games, not talking about tech) is fantastic.
 
Hmm, interesting, the expensive part of the query is on a table with only 2 million rows
 
your codebase must be strong if one change only introduces a single bug.
 
7:33 PM
@rlemon yep..........
 
Actually that's the join too (the result of the join is that table), 76% of the query, I'll make an indexed view.
That should speed things up
 
ONLY one bug
 
Hi guys, is there any obvious reason that my __dirname return / when I run node at ~/?
 
I have to grab data from db, build objects, grab more, add to objects. Is chaining ajax calls the best way of doing it?
 
even more cheesy jokes
 
7:34 PM
hah
 
when will this nightmare end?
 
@rlemon Two bugs. He started with 99, fixed one (98), and now 100 (which is +2)
 
@AwalGarg ooh, look at you with your fancy reading comprehension
 
@AwalGarg we assume the fix worked.
I count a regression bug as the same bug.
 
7:35 PM
or did it......dun dun dun
 
@rlemon technically it is a new bug :/ "technically"
 
When this happens:
 
@AwalGarg "technically" management doesn't care. it is filed under the same issue in jira
 
hey @nicael
 
lol
 
7:38 PM
this doesn even work:
he never declared beAwesome()
 
or the other syntax error
 
He doesn't get to execution.
 
yes i know
 
Yeah, there isn't even a main method declared
 
but lets be nice
 
7:38 PM
@PhilipposSlicher no
it's better to be write than it is to be nice
 
@PhilipposSlicher Uncaught ReferenceError: nice is not defined
 
@PhilipposSlicher hi there
 
@PhilipposSlicher ... you are in the JS room. don't expect us to be "nice" to code.
 
user1596138
@PhilipposSlicher He never declared sad, nor it's property stop. But nice try
 
@nicael well hello there nicael
 
7:39 PM
How does property.() work?
 
it doesn't
 
^
 
exactly!
it DOESNT
 
Stop confusing me with bad code!
 
@PhilipposSlicher tell me more about that "getting laid" part. how to
 
7:40 PM
@AwalGarg idk, I just post wrong code :)
 
Lol, the irony you never stop being sad :D
 
The trick to getting it in, is keeping it light, non-threatening, and funny. If you can do that, you've already did most of the work.,
 
@AwalGarg Take a girl out, make her laugh.
 
@nicael hey again
 
7:41 PM
Not at you, with you.
 
ahh, well... I quit.
 
or at you
some women are into that
 
Make her laugh, have a drink, go for a smoke, and you're good.
 
I don't think he drinks or smokes
 
2 mins ago, by nicael
@PhilipposSlicher hi there
 
7:41 PM
Or just show her a bunch of code you wrote. I'm sure that will do it too.
 
show her your badass java applet skills
 
If I do either of that, I shall be hanged.
(Not that I want to)
 
@rlemon but assembly is scarier, so go with assembly
 
Cringed at the word applet.
 
asm isn't scary.
 
7:42 PM
binary then????
 
you kids today.
 
Hahahaha
 
applets were all the rage
 
asm is the simplest language ever
 
well crap. I hacked a fix for the calendar.
 
7:42 PM
no its not, binary is EASIER, SUPER SUPER easy, you know, if you already know it
 
I should try and fix the authors code.... but too many bad things in my code :(
 
more 10/10 logic
 
in HS engineering we had to hand convert octal hex to binary (paper and pencil)
my teacher was an ass
 
@rlemon that sucks, I hate doing that
 
@AwalGarg my first real coding was making a BBS, I ended up having to convert from asm, to hex, to decimal, and poke it into memory... took me about 2 weeks to make a character translation matrix to go from commodore to ibm ascii.
 
7:44 PM
when would you ever have to do it by hand unless writing a converter or fixing some extreme edge case bug and work at a low level for that to matter
?!
you wouldn't
I even work in embedded, and I've never had to read/write binary for my job
 
heh can't say I have either, although I've been asked about bitwise operations.
 
@PhilipposSlicher Add some NAND, NOR, XNOR.
 
yea, its VERY rare, same with asm
 
asm isn't rare at all
 
@KendallFrey of course, of course
 
7:45 PM
It's not real until you're only dealing with 0's and 1's. Everything else is just pretending.
 
Is there a way to do something like for..of as a reduce? I have:
 
what about neural chips? way different than binary me thinks
 
for (let value of item) {
  if (isEmpty(value)) {
    return true;
  }
}
return false;
I presume I can do this is one reduce... somehow.
 
it is, you wouldn't see a app in asm, reserved for boot/kernel stuff really
 
Octal to Binary is oddly... simple.
 
7:46 PM
@RoelvanUden item.any(isEmpty)
 
@rlemon We do a lot of that with our embedded system, but that's because it deals with vehicle CAN channels.
 
Questions of usefulness aside.
 
@QuestionC again, embedded development.
 
@nicael hey go to personal chat as well
 
7:47 PM
@ssube an indexed view really helped ^^
 
@KendallFrey It may be an object, not an array (thus {})
 
@Trasiva but are you actually converting raw binary, or are you applying a bit mask operation on a bit field.
 
@rlemon Some of column A, mostly column B depending on the data.
 
My hair is literally falling out looking for places to rent
 
@SterlingArcher I got a hole you can rent.
 
7:48 PM
sry
@Trasiva woah
 
@RoelvanUden Doesn't that also eliminate reduce?
 
@Trasiva the lowest level we have gone was using a breakout and attaching an oscilloscope to the serial cables to read the actual wave patterns. but that was once in like 5 years. and the bug was VERY obscure.
 
@KendallFrey Well, I want something like reduce :P
 
First they don't want a medium dog, so we got rejected. Now they're reconsidering him. If we don't get this place, I'm going to get into a major fight with my roommates because they're looking at places that don't fit my desires, only theirs
 
@KendallFrey For all I care it would be Object.values(obj).every(isEmpty)
 
7:49 PM
@SterlingArcher time to move on your own brah
seriously.
take the plunge
 
@RoelvanUden What about .call?
 
It's going to create a MAJOR rift with my brother if I pull out
3
 
@rlemon Most of this stuff was designed before I got here, but one of our units have to be able to handle 4500/s.
 
!!phrasing
 
7:50 PM
@KendallFrey Not sure how that would work
 
So I'm trying desperately to avoid it, but they sure as hell are pushing me into that "fuck it they'll get over it n a few years" zone
 
@Trasiva 4500 sarcasms?
 
@KendallFrey Uses .length and indices, not Symbol.iterator
 
@rlemon messages a second.
 
@copy durn
 
7:51 PM
All they keep saying to me is "one day you'll have your own place and can make your own choices"
 
@RoelvanUden I don't think you can, I keep reimplementing these things too
 
The fuck I cant make my own choice.
 
So this is probably a dumb question but... if you can compile everything you need with node, why do people use gulp? Is it just so you can develop for front end without a server?
 
@SterlingArcher roll a dice, let fate or chance decide for you.
 
> one day you'll remove your head from your ass and you can smell your own bullshit
@SterlingArcher ^
 
7:52 PM
@corvid Because you dont need gulp and other dev tools in your production server
 
@corvid Same reason people use express
it does nice things for you
 
Oh I'm using express
 
If speed doesn't matter, you can convert to array first
 
@SterlingArcher So bounce. Do your own thing finally.
 
7:53 PM
Like I said, I'd rather not get into a massive fight with my family
 
says trasiva
 
@SterlingArcher why a fight? if you can't avoid, can you reduce it by taking longer to 100% move out?
 
Which I directed at Sterling obviously.
 
i know, just being bored
 
7:55 PM
@jumpstracks I promised them one more year renting with them, but I didn't realize that they would force decisions down my throat
 
@SterlingArcher Except they decided to go and move.
 
No, we got price evicted
 
The fuck is that?
 
We wanted to stay in our current situation for one more year, which is working fine, then the leasing company decided to raise our rent $1000 a month
 
7:56 PM
They just jack up the rent until you can't afford it?
 
Exactly
 
seems like most agents
 
That's pretty fucked.
 
illegal in Ontario, Canada by the way
 
7:57 PM
they can only raise rent 7% annually here
 
I hope you slapped them in the face with your dick and broke their jaw.
 
I can't afford to move to canada :(
 
heh.. here we felt bad kicking up tenants rent by $50
 
Move to Syrupland
 
7:57 PM
If I had a house I'd totes rent it to you
 
here, they removed the yearly incrememnt law
ha
 
bs to me!
 
I'm sure @rlemon would build you a little shack and rent it to you on the cheap.
 
sorry can't afford rent, still my property to do with as I please, sorry don't believe in rent control
 
7:58 PM
@SterlingArcher I can build you a shack in my back yard
@Trasiva dammit
ninja'd
 
@rlemon Great minds think alike.
 
so what's your excuse?
 
All I want is my privacy. But if I get stuck in a room design for a kid to grow up in, I'll have a shitty closet and no privacy
 
:P
 
I think we still have a tiny shack in our yard
 
7:59 PM
In a basement room, I feel like I'm paying for my room, and not their master suite
Ugh. I just want this to end.
 
as in, a roof and 2.5 walls, and 20sqft of floor
 
so move on your own
you are what?? 24? 25?
time to leave the nest dude
if they blame you, tell them to grow the fuck up
 
it will in a year? I'd just stick it out, and make sure they no you're moving no if ands or butts
 
crl
lived in a 9m² for years (student rooms)
 
family is too important
 

« first day (1854 days earlier)      last day (3109 days later) »