« first day (2081 days earlier)      last day (2860 days later) » 

2:51 AM
I am picking up Python out of necessary. How can Python be so slow?
 
It's to give other languages a fighting chance
 
Make sense. It got type. It got class. It is compiled. Yet... I don't think I used any language that runs slower. SQL included. I would imagine they worked hard to make it slow.
 
try Ruby
 
Trying to mod a Ren'py game. Other language not an option. Giving up is an option. :<
 
I've got an off-topic question about Java but the Java rooms are desolate. If I have a UML class diagram, with types mentioned with capitals, do I use the reference or primative types? Eg: Float[] and Integer
 
3:09 AM
@AndrewL. The boxed types.
 
So capitals?
Float[], Integer, Float
@Sheepy ^ I'm just going to ask my instructor
 
Yes. Float alone may be a typo, but there are no primitive integer. There is only primitive int. So it should be boxed.
 
I've read around that Integer in UML is int in Java
Hmm
 
UML sucks
 
I don't know your instructor, but when I write UML, I use int for int. Most tools support that.
UML is just another tool that fit some jobs. Some of my problems has to be solved in UML. Coding it first is too expensive. And it's a great communication tool.
 
3:13 AM
Exactly. Confusing.
 
Is it a valid technique to initialize stuff by setting it to invalid values, then waiting for the reset-on-invalid-values code to kick in?
 
There is Integer (final), Float[], Integer
That's what's listed after the colon on the types
 
@JanDvorak You mean other than lazy initialisation?
@AndrewL. If you google image "java uml" you'll see diagrams like this. From my experience, in practice it's common standard to use primitive names for primitives.
 
I have a force simulation. Sometimes two elements get to exactly the same position, then start repulsing each other. The result is infinite force and a bunch of NaNs, at which point I randomise the affected values. So, I've had the bright idea to initialise the simulation by setting everything to NaN.
 
I personally would initialise them somewhere separate from the validation code. Less indirect logic. But I guess it's ok to combine them.
 
3:18 AM
That's the thing. I feel like it should be boxed types but the textbook hasn't gone through that yet. I just know boxed and unboxed primitive types exist
 
@AndrewL. And in practice, they don't differ much... when you are still learning it :)
 
I'd suggest going for the boxed types. Worst case you'll introduce a weird bug when one of your values goes null.
 
So you may use whichever you want as long as it works, I guess. If it doesn't work, you've learned something!
 
Well, this certain instructor told me to get everything correct, spacing capitalization, etc. He said to look at the diagram and do exactly as it says. Everything exact
So I already shot an email at him. Hope he responds
 
boxed then
 
3:21 AM
Wow. You guys were right. Boxed types
:^)
 
Worst case you can try shooting other stuff
 
This instructor is lightning fast with emails. Sent one at 10:17, gets back 5 mins later
 
You should try to explain (in a "thanks" reply) that you are confused because you haven't learned that yet. That'll help your instructor know what is happening.
 
nice
 
I actually know more Java than they teach but I desperately need that 4.0 so meticulously running and checking every single line.
 
3:23 AM
Good luck. We can use more programmers like you :)
 
UML is a programming language designed to turn managers into programmers and programmers into compilers
 
I whipped up the code in about 15 minutes. Been checking for about 1.5 hours. Good thing I did. Caught some capitalization and arithmetic errors, and of course this
 
I call that "first draft"
 
To me, UML seems good in theory but I don't like it in practice
 
@JanDvorak Can't argue with that. It is easy to take UML too far... by both sides.
 
3:25 AM
Definitely. Now I'm going to refactor the code so it's more efficient
 
afterwards you're stuck in an endless loop of make it work -> collect new requirements -> code new draft
 
I don't benefit by using UML. I already have everything laid out in my head before I jump in and it feels weird having to write it all down
 
Curiously, this also happens with personal stuff
@AndrewL. real programmers don't use UML
They draft the ER diagram on a whiteboard, take a photo and then code from memory anyways.
 
Either I am getting old, or my systems are getting to complex for my brain. Or both. Last week I drawn a simplified sequence diagram with 20 objects and 100 messages flying around.
 
I guess it's the latter
 
3:30 AM
And in the process we found a bug and now we are back to the class diagram.
 
Lol
So how's your day been going guys?
 
The last project I've been building from scratch had some 10-15 tables. We didn't even bother drawing the class diagram
 
@BenjaminGruenbaum That's really cool, let him know that he does great work
 
Yup. No point drawing up blueprint and calculating support force when you're just setting up a mail box, as I read from a book about software design.
My day is bad. Not getting good sleep these days...
 
Unless, like most of us, you're making the mailbox support pole out of drinking straws held together by modelling clay (read: PHP)
 
3:37 AM
Well dang
All the values in a Float[] array are null instead of 0.0 in a float[] array.
 
indeed
19 mins ago, by Jan Dvorak
I'd suggest going for the boxed types. Worst case you'll introduce a weird bug when one of your values goes null.
 
Ahh
 
No, you shouldn't have to. Autoboxing.
 
Oh woops
nevermind
Hmm. Saying I've got an NPE from getting element from list with an Integer subscript
Ahh because I didn't initialize it
 
(-,o)
 
3:44 AM
Arrays.fill( array, Float.valueOf( 0 ) )
 
Argh! I've got to initialize everything
 
In Javascript, you have to as well
 
True.
The assignment directions are confusing. It tells to initialize some fields in the constructor but not all for some reason
 
In Haskell, initializing is all you do.
 
:)
I'm scared to turn in the assignment. I need to go through again
 
3:51 AM
Then the project is already overdone
 
Also, the instructor insists on using printf. Why not use print or println with string concatenation?
printf is slower and worser in performance is it not?
or is that only the case in c++?
 
but it's easier to read.
 
true
It's done. I'm turning it in
Now onto studying for my math final!!!1! yay!1!1
 
//note to all developers: This thing gets executed each frame of an animation. Try to make sure it's fast.
(function doFrame(){...
 
4:09 AM
Is there a scriptable refactoring tool? Not one that chooses what to refactor (automated) or one that adds refactoring to an IDE, but a refactoring tool that I can incorporate into a build process to transpile the JavaScript before deployment?
 
The forum you linked only mentions an IDE based refactoring tool.
I'm well aware of JetBrains refactoring, but I need a scriptable refactoring tool, where I can write a list of refactors and repeat it every time I run the deployment process.
 
4:25 AM
You can write yous own refactoring plugin in for JetBrain IDEs - in Java. If you want to do it in JS, I guess minifiers and transpilers would be a good starting point, as what they do is pretty close to refactoring.
 
5:17 AM
Anyone have any interesting ideas on how to improve performance when searching 4000 addresses for user entered content? At the moment its across all associated
 (address.address1 != null && address.address1.toLowerCase().indexOf(searchValue) > -1)
fields.
 
indexes
 
5:29 AM
I fell in love with Flexbox. Now we just need to phase out IE9 and IE10 support in my job.
What is the best HTML5 element for a control panel - a heap of control panel blocks, each of which is a heap of form elements? Normally you group form elements into forms, but is the control panel a form, or each of its blocks (I guess it's the latter)? Also, they don't trigger any navigation, though I do want the Enter key to trigger a JS action.
> The mantra of a modern web design. Eff facts; effects!
I'm tempted to use HTML5 custom tags.
 
6:07 AM
MDN says "The HTML <form> element represents a document section that contains interactive controls to submit information to a web server." - but I'm not sending anything.
 
6:23 AM
Why not simply use divs like for almost any other element group ?
 
6:47 AM
Hi
 
@rism Scanning 4000 address - around 12000 short lines - like that should not be very slow. Where are you scanning it (server-side?) and what is the current speed?
@JanDvorak <fieldset> or, more recently, <details>
 
hi
 
hi~
 
How to find out missing and added contents from two strings using jQuery?
 
jQuery does not do (much) string manipulation. Do you mean JavaScript?
 
6:54 AM
Thanks. Somehow I forgot about fieldsets.
 
Is that possible using jQuery or Javascript?
 
@shine First you tell us, what is the difference between the two?
 
/afk
 
@Sheepy is that a command slash, or an end-tag slash?
 
A: What OS do you use?
B: Chromium
A: So Linux, right?
awwwh :)
 
6:56 AM
@Sheepy I can't see how <details> fits=
 
The requirement is i have to find out what text missing and what text added from previous?
@JanDvorak To highlight added contents from previous and new values
 
@shine I mean, between jQuery and Javascript
@shine Say a = "hello world", and b = "worldly hello". What was added and what was removed?
 
does anyone know how to break on exceptions when debugging in Node 6?
 
does global.onerror work?
 
@JanDvorak Some big forms have collapsible sections.
 
7:04 AM
Mine's not that big. More like 10 elements in 3 blocks.
 
Back to reality.
 
Back to life.
 
Got a nice tan though
 
@shine Kind of. You see, given two string, every programming languages can tell that they are different, but no language can tell how they become different. The art (yes, art) of trying to deduce the "how" is called "text diff".
 
user3119231
heyho
 
7:06 AM
@FilipDupanović run with --debug and add debugger to set breakpoints .. or are you debugging node.js in chrome dev tools
 
Thanks for the updates.

i have a logging module for my project super admin can view what changes made by sub admin. Super admin can view previous contents and new contents edit made by a user. contents may be html or anything. Now the requirement is i have to highlight added contents.
 
@shine You still haven't answered my question.
 
@cswl straight up using node debug; there used to be some V8 helpers in Node 5, but they've updated those low hanging bits
 
@shine Now that we have told you the keywords, if you google "javascript text diff" you will get libraries like jsdiff, which may fit your bill. Good luck :)
 
@FilipDupanović Iron node
 
7:09 AM
As for the text diff algorithm, I like the Levenshtein algorithm, or perhaps LCS.
 
As long as I can ignore spaces I use whatever the diff tool in my hands defaults to :p
@Maurice Morning~
 
@Sheepy Let me check
 
Because theory of evolution doesn't apply to IT. Those who create insecure systems still procreate. — techraf 2 hours ago
 
=o
 
@Sheepy Its good example what am searching for really thanks.
 
7:19 AM
@JanDvorak Our of our clients, who rejected our website maintenance plan and decide to self-host their joomla site, just got infested and blocked by all browsers and ask whether we kept any 3 years old backup.
 
Did you not use GIT?
 
I do. But you see, I didn't do that project. (shrug)
 
I even use GIT for stuff that involves me back-and-forthing a single file between me and the client. One extra benefit is that you can quickly diff the changes made by the client.
 
Good habit.
 
hey morning guys.
does anyone know how to get InnerText in the code below using vanilla js
<li class="level-1">
	<div class="A-level-2"> </div>
	<div class="B-level-2">
		<div class="A-level-3">
			<h2 class="base-level">
				<a href="/somelink"; title="someTitle"> InnerText </a>
			</h2>
		</div>
	</div>
</li>
 
7:28 AM
textContent
 
@Ming the html is wrong
 
@towc wrong?
 
@towc Why so?
 
"/somelink"; should just be "/somelink"
 
@JanDvorak how to do so for document.getElements
 
7:29 AM
@towc gotcha
 
assuming starting from `class='level-1'
 
@Ming document.querySelector( 'a' ).textContent
 
@Ming getElemensBy<Something> returns a collection of elements
 
@Ming an element list doesn't have a text content. Its elements do.
 
comparable to an array
you need to pick an item in the collection that is your element
 
7:30 AM
i need to start from level-1 though
 
then run .textContent on it
 
@Ming document.querySelector( '.level-1' ).textContent.trim()
 
so, are you looking for the css selector?
 
yeah
 
!!tell Ming mdn querySelector
 
7:30 AM
@FilipDupanović no I dodn't get any log. also I don't need to bind the handler, because I am using arrow functions which get the context
 
or document.getElementsByClassName
 
cap? :/
sure, you could use className
and in fact according to the codestyle I use, every element that needs to be selected has its own class
but then I still use querySelector
 
document.querySelectorAll('.search-listing').textContent this doesnt work though @Sheepy
 
One method to query them all! Or two methods, hmm.
 
in your case looks like querySelector is the best way, as you are going to have more elements with the class someTitle
 
7:33 AM
undefined
 
@Ming querySelectorAll gives a collection
 
oh yeah
 
NodeList
 
@Ming [].map.call( document.querySelectorAll('.search-listing'), e => e.textContent )
 
but i just want from B-level-2. textContent gives me content from A-level-2 as well though
 
7:35 AM
don't get scared by that code
 
specifically target that nth child element
that code looks cryptic. lol
 
querySelector( 'stuff child:nth-child(pick what you want)')
don't stuff the child
 
@Ming Listen our advise and check this "querySelectorAll" stuff. It's almost as powerful as your jQuery selector, and certainly many times faster.
 
@Sheepy yeah. think will use that. Thanks. will check it out further.
@JanDvorak @towc thanks for your help . :)
 
7:47 AM
Hye, while trying to start a tcp server on windows, on localhost, I am getting error EACCESS localhost... I have admin privileges and I've tried after elevating the command prompt too...
unlike most posts I see on SO, they state a similar error with the port being specified (instead of host)
 
@deostroll Is there a port number after "localhost"?
 
nope...
 
@FilipDupanović the problem was including the JSConsole script. It was blocking console.logs for some reason and also events, but the form onSubmit event still doesn't work
 
ah damn I got the error
I don't need to set host...
 
Wonderful XD
Sorry didn't see you were on port 8000. That would exclude common port problem.
 
7:56 AM
@Victor hmm, dunno, LGTM, you wired everything together nicely and there's nothing going on crazy with the state
 
!!urban LGTM
@FilipDupanović thank you :)
 
@Victor did you try something silly, like quickly shaking the tree down, maybe replacing that custom button with a native control until you're able to capture the synthetic event?
 
@FilipDupanović I tried, yeah. Nothing was working. No click/touchtap/submit event
I removed the jsconsole script and the clicks and console.logs work now, but I can't get the form submission to work
 
LGTM = Let Google Teach Me ?
 
looks good to me :D
 
8:07 AM
@FilipDupanović i searched nodejs repo.. there was --debug-brk but turns out it just breaks on the first line in the new experimental v8 inspector... though you can hit pause on execptions in the v8-inspector after that.. tried it with the latest 7.0 nightly
 
@FilipDupanović yeah, but @CapricaSix is not answering it :(
 
@cswl is that node-inspector you're referring to?
 
OMG, I love this
socket.send( Events.BLOG_POST_COMMENT, {
    post_id,
    comment
} );
The object literal, I mean
 
Yes. You can mix it with other old and new syntax too. :)
I think I like object destructuring more, though.
 
still, new syntax is super sweet; Object.assign({}, mine, theirs) vs {...mine, ...theirs}
 
8:14 AM
node --inspect --debug-brk file.js which will give a url to chrome-devtools...
 
@FilipDupanović Hmm. I don't think spread works with objects that way?
 
@Sheepy I haven't seen that yet
 
@Sheepy it's a stage-2 proposal, supported in babel..
 
So, ES9 or so.
 
@Sheepy I am using stage-0 in babel now
 
8:18 AM
If at all. Let me see where is array comprehension now...
@Victor Good for you. I used to live at the bleeding edge too. Eventually lost too much blood.
 
@Sheepy hmm, it's not going to come in
 
There's also a proposal for private fields, with no reflection.
 
here's Babel's implementation babeljs.io/repl/…
 
@Sheepy Lol
 
here's the proposal, currently at Stage 2 github.com/sebmarkbage/ecmascript-rest-spread
 
8:22 AM
but are those things going to be eventually natively available?
 
@Sheepy it extends the destructuring algorithm for spread assignment
 
I mean, in the browsers
 
class Foo (bar) {
  private #bar = bar;

  getBar() {
     return this.#bar
  }
}
 
@cswl is it available in babel?
 
@FilipDupanović the proposal isn't well formulated
 
8:25 AM
Nope.. That's three proposals right there... all of which are strawmen...
 
@cswl Fuck's this?
 
I have seen private property proposal since... oh, since the beginning, actually. Glad to see we're still trying to figure it out.
 
@Sheepy how would that even work?
 
@littlepootis That's exactly why js still don't have it :|
 
@BenFortune making the content of bar private?
But that is already possible with the current engine. That "private" keyword isn't required
 
8:31 AM
Do we have a pipe operator in js yet? Preferrably with a T operator and an open and closed valve operator aswell
 
guys, could you please give me some advice on something?
 
@Victor sup?
 
abhi, do you mean the | from cmd or piping streams ?
 
I have blog posts with comments came through a websocket, so they are live. The owner can edit a comment in-place. What should happen with the live data stream while the user is editing?
 
@Victor I don't know how the group works; to my understanding, it already takes a lot of effort to put a proposal into stage-0, but it would still take a lot of work to get it to stage-4 and then it'd have to wait for the next publication
 
8:32 AM
@KarelG YEAH
 
do you mean both ? :O
 
I am almost mad doing

a.pipe(b).pipe(c).pipe(d);
 
@KarelG In what context is this valid syntax?
 
but then we don't even have a stream spec in js
 
it's not valid syntax, he's only suggesting it
 
8:33 AM
Ah, my bad
 
eh, the piping can only be done if there is a stream implementation of collections. Which isn't the case in js i think
 
Its funnier when you have to pipe to / from multiple sources
a.pipe(b);
a.pipe(c);
a.pipe(d);
a.pipe(e);
 
that private field proposal is not required because it's already possible in js
 
@cswl until and unless babel implements them they are text files
 
8:35 AM
people wants to make javascript java ... fuck 'm
 
@KarelG this is a conspiracy by Java developers
 
same for those class and constructor thing
 
They all do not prevent runtime modification, except closures perhaps....
 
I won't mind at all if we get Java 8 Stream in JS. Please make sure it comes with automatic multi-thread support like Java.
 
multi-what?
JS is threading aware now?
 
8:36 AM
we're getting shared array buffers!
 
there is background threading API avialable, but multithreading ?
 
\o/
 
Javascript people need to stop
adding more features
and fix the bunch of broken API's they have polluted the global scope with
 
well to be fair, the lack of private fields in ES6 classes is pretty annoying
 
8:38 AM
@FlorianMargaine You know, Java actually has a fully multi-thread implementation of JavaScript. I can create Thread and sync and wait.
 
like WebRTC
 
@StephanMuller It's just sugar, you don't have to use them. If you want private fields, use something like the revealing module pattern
 
@Abhishrek +1
 
I recently found out WebRTC is eternally broken
 
that ES6 class is a syntactic sugar too
 
8:41 AM
:-( extremely dissappointed
 
huh, y?
 
@FilipDupanović ES6 class or Webrtc?
 
@FilipDupanović interesting read. I'm an avid FF user and i sometimes contributes to it but i wasn't aware of that. Seems a nice step but ... if you ask me, it is not required. One thread per tab is quite logical for me. And safe.
 
How to programmatically close a server?
 
@Abhishrek WebRTC, we're looking at work at removing our WS proxy and letting the clients talk to each other directly
@KarelG yes, this summer was innocuous; next summer we might get a great deal more than a simple operator :P
 
8:44 AM
@Abhishrek please?
 
@deostroll ?
 
"close" as in which context ?
the server program or the connection
 
The livedatastream
well depends on what you want to do :P
if you want to stream updates to the server
so other people can see him make typing mistakes
 
@FilipDupanović And an array method. Don't forget that. ;)
 
do that :D
otherwise just leave it idle
until the client has finished typing
 
8:45 AM
a server started with net.Server
 
@FilipDupanović I tried to make a simple star topology app with WebRTC
it works fineish if you are trying to do just datastreams
as soon as you go video :-| cthulhu shows up
 
@Abhishrek phew
 
also if you are not already use simple-peer
 
chutulu?
choo choo
 
8:47 AM
fixed^
 
right, I was doing the mistake of calling close on the callback argument...
 
mornin
 

« first day (2081 days earlier)      last day (2860 days later) »