« first day (1381 days earlier)      last day (3557 days later) » 

6:03 AM
@Zirak I've already read that twice :D
 
6:14 AM
An interviewer said that? With confidence?
Where do I get my interviewer badge?
One day I'll be really talented at CSS and JS
 
@BenjaminGruenbaum got a ticket, landing on august 24
if you wanted to pick me up from the airport
 
@Mosho cool stuff :)
@Mosho why would I want to do that :P?
 
m59
Hey guys, I need to affirm my thinking:
I have a json that contains some data sets including base64 images
those are, of course, massive
 
@BenjaminGruenbaum because you are a really nice guy
 
m59
If I ng-repeat that array, the performance is HORRID
 
6:20 AM
@Mosho I don't have a car :P
 
and I told gilad I would start on the 25th :P
 
m59
Surely, it's the base64 images?
 
@m59 remove the images and check?
Also, bind the ng-repeat to the index.
 
m59
that doesn't necessarily confirm anything
 
@m59 I assume you're already using track by ?
 
m59
6:21 AM
I wasn't. I didn't know that affected performance.
Unless there's any reason to assume it isn't the base64 data in the json, I'm going to setup a route for the images and replace the data in the json with a link to the image
I was just thinking how bad it would suck if I did that and had the same performance issue, lol
 
:D
 
m59
In my case, it seems like the right thing to do to keep the images in the database like this, but they're awfully annoying to be in the table they're in anyway.
Everytime I do a query in the command line, it explodes with lines of image data haha
 
woah, it's a party here
 
m59
You're up late! Late night party bruh!
 
late?
it's not even 11:30
 
m59
6:25 AM
Close :)
You don't have work early?
 
HA
I'm a software developer - I get in early at 10
 
m59
haha epic
 
Although I'll probably be working late
 
What happened ? I had to scroll in the list of rooms to find the JS one. Are you all dead ? Or is there a reason for a dozen of active rooms dedidcated to Java ?
 
I'm not dead, just asleep
 
m59
6:35 AM
@BenjaminGruenbaum Ohhh duh. Of course track by affects performance haha
I was just trying to avoid replacing the items in the list in the first place.
 
@m59 explain
 
m59
what I was doing, or track by?
Heck, both are easy -
 
why and how track by impacts performance.
 
m59
afaik - track by tells angular what to use to determine if it needs to recreate items that already exist
if you track by index and leave items 0-9 in place, it won't worry with them when new items are added
it just focuses on the new items (indices)
Or if you tracked by item.id it would only deal with items that have an id that wasn't there before
So, if I do $scope.item = whatever each update,, without track by it recreates the whole list.
With it, it only deals with the changes
 
so I should always use it?
 
m59
6:41 AM
Seems so
 
neat.
anyway, bedtime
 
m59
Like, what I was doing to get the same effect (if I'm right) is to only like splice / concat
err actually that doesn't even work, I don't think
 
hello. does anybody know if I can "catch" the content(text) on change event for a dropdown list?
actually my dropdownlist is not changing at all.. I just overwrite the text so no 'onchange' event is catched
 
m59
I can't remember, it's much later here :)
@SomeKittensUx2666 night!
 
how can I test in JS if the context has been changed (the text was changed)
 
m59
6:43 AM
Wouldn't context refer to the element the event occurs on, not text? I'm not sure what you're trying to say.
 
Well my dropdown is something like this
it has 1 element (option) and I have several <li>s
when I select a specific <li> I overwrite the option text
 
m59
lol, just make a fiddle :)
 
so there is no .change() event
 
m59
This is what it sounds like you said:

<ul>
  <option></option>
  <li></li>
  <li></li>
</ul>
 
just asking, if there is any way of catching that "specific" event. So it is definitely not '.change()'
 
m59
6:44 AM
and that's not valid html haha
 
I'll fiddle
 
m59
Oh, I meant push not concat doh. I doubt anyone is paying attention anyway.
 
jsfiddle.net/DZ7dc is something like this. So I use a <select>
 <select href="#" id="drop2" role="button" class="dropdown-toggle" data-toggle="dropdown" style="width:177px; height: 34px; border-radius: 4px; border: 1px solid #ccc;">
                                    <option hidden="true" id="selectedObject" value='@EES.Globalization.Resource.Select'>@EES.Globalization.Resource.Select</option>
                                </select>
Now, when I select a specific <li> I overwrite that <OPTION> content
and I also make validation on it. The validation disappear when a valid <li> was selected. But it disappear only on (.change()) event
and since there is no (.change()) event, the validation will still exist
 
Is that question too broad ?
0
Q: Is Redis faster than MySQL?

user3289157I just read that Redis is "persistent". Does that mean that it is stored in the hard disk? If yes, how can it be faster than MySQL, which is also hard disk based? Obviously, I am just a beginner, so don't be too harsh.

 
mornings
 
6:51 AM
Hi
 
m59
@shemuel still not following :( I don't see what needs to be validated, or what action should cause the message to disappear.
@shemuel The only thing I can think you're trying to say is that you're looking for change event on the li ?? You would just use click
@dystroy yeah
 
That was actually a lot of fun to answer :D
 
m59
to me it is, because a basic understanding of what both of them are would render the question useless, and he admits he doesn't understand them.
 
@Feeds here is a ref for everyone else.
 
@BenjaminGruenbaum Don't repeat yourself yourself
(You've a repeated header in there; What it does)
 
7:01 AM
@m59 In fact my impression is that many developers don't really understand the use cases of a store like Redis
 
m59
I've never needed data that isn't heavily relational (that I know of), so you can count me among them. I just understand basically what it does - not at all why.
But I'd be glad to hear your thoughts on that!! @dystroy
 
@m59 I gave an example
That's how I can restart my simple Miaou node, sometimes very frequently, without users noticing : the sessions are stored in Redis, in another process
 
I have 2 divs in a wrapper. the wrapper has a set height, one of the divs has a variable height, and I want the other div to take up the rest of the wrapper. wat do?
 
m59
@dystroy ohhhhhh, yep. I know of that one. I guess I do know :) I was thinking you meant as in use case RATHER than mysql.
Like, people talk about using MongoDB rather than SQL, and I can't see anyway that is good thanks to that article that has been popular here several times
 
In fact relational db are so fast now that even when you can imagine another type of reliable storage, it's often not a good idea (apart if you mostly store blobs and don't really query).
 
7:08 AM
@dystroy The only reason why I wouldn't use a DB these days (be it relational or not) is if I store files.
It just gives you so many free stuff, it's madness not to
 
(I included "files" in "blobs")
 
m59
@dystroy bro, do you even query?
=D
 
yeah I do
 
m59
heheh
 
hoho
 
7:10 AM
@dystroy And even then I usually store files metadata on a database. The only thing that isn't kept in a database is the file itself.
 
BTW I focused last week on querying optimization in Miaou
 
m59
In related though - I couldn't decide if files should be in blob or text
 
@m59 text ?
 
m59
like MEDIUMTEXT
 
but why ?
 
7:10 AM
@m59 Neither, don't store files in the database?
 
m59
@SecondRikudo disagree =D
 
@m59 Your reasoning?
 
If you want to store your files in DB, unless you want to do a full text search, I don't see why to store in text
 
m59
@dystroy well, as usual, there's debates on every topic, seemingly no matter how bad one option is
 
There's a good reason (but not usually good enough) to keep files in DB : consistency : you backup and clean more easily
 
7:11 AM
@BenjaminGruenbaum After all the time you put to answer it?
 
m59
and I couldn't find a good argument to turn it in favor for either
 
@m59 Easy, the file system is optimized for... files.
If you have millions of files, the file system will handle it much better than your database ever could.
 
m59
So, the only thing I found is that blob could get screwed based on collation
@SecondRikudo sorry, was referring to the type still. The files are relational - I mean - very much so.
 
@SecondRikudo lol wrong one
 
@BenjaminGruenbaum I was about to ask...
 
7:13 AM
@BenjaminGruenbaum :P Figured
 
m59
The amount of increased complexity is (seemingly) outrageous to use file system over database.
 
@m59 I often combine both, like storing a hash in DB
 
m59
At this point, I imagine rebuilding the whole project in the future - when I'm not the only developer (and I'm a junior) trying to build this giant thing.
 
hello
can I preview a image in a zip file by javascript anyone ?
 
m59
7:17 AM
@BenjaminGruenbaum could probably finish my project in a week LOL
but he probably gets paid multiples of my income, so such is life :)
 
@m59 not going to happen :D
 
m59
hmm? I was just making an observation. I feel slow.
but I think I'm doing ok considering the level I'm on. If I were making a lot more money, I'd feel bad about my current performance.
I have a friend that's working with Amazon. She goes through 5 months of training making 3x my pay. I mean - surely I'm doing fine just jumping in on this by myself.
 
There's a rule about rewriting a complex program, especially one that you feel is too complex : Its usually much longer than forecasted to gain the same level of features and user happiness. It's always underestimated.
 
m59
@dystroy perhaps. I just don't have a lot of time to debate things. I sort of just need to get enough going to launch it so my boss is happy. My 30k salary is so little investment that it wouldn't be a noticeable loss to redo all of this later. (if our project succeeds)
and if it's warranted hehe
 
@m59 there is no reason to assume you'll do a better job the second time.
Joel Spolsky has an article about it.
 
m59
7:30 AM
Might not be me
The goal is to get some revenue and hire someone else
I'm very unhappy with the css :(
 
@BenjaminGruenbaum: thanks! :)
 
m59
@BenjaminGruenbaum ty
@BenjaminGruenbaum you don't think that if a scrubbier developer had written the first draft of facebook, that it would be worth a rewrite? I mean, if you could rewrite all of my stuff in a short time and do it better - I think it would be worth getting the revenue to hire someone like you to do so
 
Rewrite happens every day. But rewriting a whole program because it's ugly is usually a disaster (but sometimes you must try to do it, just keep a plan B)
 
Jes
how to print the index of an array value
var tags = [];
tags.push(tag);
document.getElementById(hidden_txtbox).value +=tags+',';
 
7:37 AM
@m59 gradual refactoring
 
Jes
when i print the array i get raw data without the index
i cannot loop this
 
@Jes why would you loop the printed data :O?
 
m59
ah, I see your point.
 
Jes
when i looped the array to print each data returns empty
i m setting the array to a hidden text box value
 
am I the only one who instantly validates all indian flags?
 
7:45 AM
@FlorianMargaine no
 
@FlorianMargaine Nope, same here.
As per Shog's recommendation on my post.
 
m59
link?
 
30
Q: Disallow languages other than English in chat

Second Rikudo Please note that I am proposing a Policy Change in this post and not a Software Change on purpose. That's because software changes are hard to make, and policy changes are easy. I can propose a million changes to the chat software, and in fact, many have been already proposed. It happened a...

 
m59
ty
 
@Zirak they only burn for you sir.
 
m59
7:51 AM
@SecondRikudo golly, this person is uptight "Lightness Races in Orbit"
 
@m59 He's a lounge regular.
 
m59
an uptight one :) lol
must be an amazing programmer
 
@FlorianMargaine no, you're not the only one
 
Hi all I need help
Please see my question
0
Q: While sending base64 image to server in ajax post "/" are getting gconverted to '%'

Nikhil AgrawalHi Actually I want to upload an image as base64 to server. So I am sending request like this $.post(Config.serviceURL('captureImage/' + memid), { imageString: imageData }, function(data) { alert("Image uploaded!", data); }).fail(function() { alert("error"); }); The imageData parame...

 
@NikhilAgrawal Wait so... you convert the image to base64, and upload that with AJAX?
 
7:58 AM
@SecondRikudo Yes
 
Not to mention that base64 encoding doesn't have any slashes in it...
 
it has forward slashes
 
base64 encoding doesn't have any forward slashes in it
 
@BenjaminGruenbaum (late) +1 for the Joel link, very relevant to my current project :)
 
8:01 AM
it has forward slashes
 
m59
@SecondRikudo they do as far as I can tell
 
@IanClark yw
 
@m59 In what implementation?
 
m59
uh...the js one, I guess??
 
@SecondRikudo Have you seen the link
the image has forward slashes
 
8:03 AM
@m59 Example please.
 
m59
@SecondRikudo I just created this
 
Okay
@NikhilAgrawal Also, why do you convert the image to base64 and upload it like that?
You realise that base64 is approximately 33% larger than the original image size, right?
 
Actually this is for testing purpose
the actual implementation is
In ipad we have photo capture
which gived us base 64
we have to upload it
So In web I am testing the service
 
@NikhilAgrawal The reason is that POST uses the x-www-form-urlencoded content-type by default, and so JavaScript will by default URL encode the entire thing.
 
m59
@SecondRikudo that image I posted, that was what the browser created automatically when I dropped the file in an input and read it with the file readers readAsDataUrl
in case you were curious
 
8:07 AM
It's also the reason why you need enctype="multipart/form-data" in forms where you upload files.
 
m59
night all!
 
@SecondRikudo So what should I do should I speify other datatype
 
@NikhilAgrawal I'm not sure how jQuery does it, but yes, that's what you should do.
 
Is the Rene Magritte museum in Brussels any good?
 
0
Q: Javascript Bang Methods

StarkersOur mission here is to kick Piers Morgan in the nads by calling giveKickInTheNads on his variable, piers: var StringInstanceExtensions = { flip: function(){ return this.split('').reverse().join('') }, add: function(char){ return this + char }, re...

lol
 
8:27 AM
This isn't a real question, is it ? Seriously, why bother asking if it's possible to put ! or ? at the end of a function name...
 
pretty funny nevertheless
 
@dystroy Ruby lets you
 
@JanDvorak yes but do you really have to ask SO to know if it's possible in JS ? I mean if you're not just wanting to ask a funny question...
 
I did downvote for the title / first paragraph
 
8:36 AM
jsfiddle.net/X4mAR Does this not load for anyone else?
 
@SecondRikudo still waiting
 
Yeah, it eventually loaded for me, but @BenjaminGruenbaum it's broken for me.
 
still waiting
 
@dystroy It's because it's trying to download bluebird, which is responding with 504
 
8:41 AM
@BenjaminGruenbaum In your fiddle, the link to bluebird is broken
Which causes 1. the entire fiddle to hang, and 2. the code not to work
 
@BenjaminGruenbaum jsfiddle.net/X4mAR/7 Even after adding it from a different source, it still fails to execute
Uncaught TypeError: undefined is not a function
This line: var p = Promise.delay(1000).then(function () {
 
Oh, maybe the branch is deleted
@SecondRikudo your link doesn't work since you included Bluebird 1.2.4 which is old
So it doesn't have .setScheduler
 
Does no one have it hosted in some proper CDN? XD
 
rawgit is a proper cdn, usually
 
8:47 AM
-1
Q: Ajax Async False Freeze

BrentCurrent code Updated I need the bellow to work with async false as on async true some uploads do not hit the server. The UI just needs to not freeze with async false. $("#goLive" ).click(function() { //This is fadein Spinner only apears at end of upload? $('.containerFixed').fad...

 
cdnjs has the same problem (and uses an older version as well)
 
Can anyone have a look at this, put 150 bounty up
Just need a rough idea will accept answer, morning all btw
 
@Brent I'm so close to downvoting it... have you read "How to return the response from an AJAX call"?
 
Sorrty
I'll rename
 
Nonono @Brent
 
8:48 AM
Why so many downbvotes?
 
If you use async:false your browser will freeze. You can't have a cake and eat it too. — Jan Dvorak 11 secs ago
 
I'm speaking about concurrency in JavaScript... doing async:false inherently freezes the browser.
I didn't downvote by the wayt
 
Yeah so how can i use async true but all the uploads go up
If i use async true some uploads fail, but if I use async false they all work.
 
@Brent now that's a better question: first debug why they fail. Then fix that.
 
Lemme try to answe it
 
8:49 AM
Does the server not like concurrent requests? Either fix that, or queue them up.
 
I have debugged everthing uploads fine in false, but async true its like my php cant keep uo with it
How can i que them up?
 
try queuing the uploads up
 
on the PHP or javascript
?
 
var mutex = $.Promise().resolve()
...
mutex = mutex.then(function(){return $.ajax(...)})
 
Anyone? :S
 
8:53 AM
@Brent ^^
 
I've put up 150 bounty for any good awnser
Will reward it :)
 
Oh, sweet... This vamp has ignored me for some reason
 
0
A: Ajax Async False Freeze

Benjamin GruenbaumHere is a solution that will make the uploads one by one without using async: false while still using asynchronous i/o and not freezing the browser by using promises for synchronization. You should definitely read mine and Felix's answer on How to return the response from an AJAX call first and ...

@JanDvorak that's actually prerty close to my answer :P
 
I like $.when()
 
I read that as "I like dollars when..." and then thought "... there are lots of them!"
 
8:57 AM
@JanDvorak me too :D
@dystroy Why implement an async queue yourself in the answer?
 
@BenjaminGruenbaum I've done it once. Then I realised that and deleted it.
 
sec just looking
thanks
 
@Brent sure, but whatever you do be sure to read "How to return the response from an AJAX call" because your problem is understnading concurrency in JavaScript
 

« first day (1381 days earlier)      last day (3557 days later) »