« first day (604 days earlier)      last day (4361 days later) » 

12:53 AM
Can somebody find a better answer to this? I feel the current answer is a bit messy: stackoverflow.com/questions/10973332/…
 
it would be better if it was a loop
 
that's what I thought, but for some reason it only runs once?
though i'm pretty sure i'm initializing / using it right
 
does the current answer not blink twice?
 
it does, but if I want it to blink more I just have to keep stacking
that's why I feel it's messy
I would like to blink it 3-4 times. Enough so it grabs the users attention and is able to read it.
 
wait let me try
 
1:19 AM
I posted an answer
 
<3
its clean and works like a charm, thanks
 
you're welcome^^
 
 
1 hour later…
2:32 AM
0
Q: JavaScript replace

John RI am not sure the square brackets are correct (although it has not yet failed some simple tests). I would also like to reduce and simplify this code to one line if practical. I think the code is self explanatory. str = str.replace(/[\n]/g,'<br>') str = str.replace(/[\t]/g,'&nbsp;&a...

 
user986408
i have an array of objects ... how can i make a hughe string out of it (want to persists the array) ?
 
user986408
well i can also make an object instead of the array.. but what would be the function to add elements to an object? (instead of push)
 
well you can call toString() on just about any object to make it into a string
but maybe that's not what you want
so what are you really trying to accomplish?
 
user986408
well.. i have an array which get filled dynamically with objects
 
user986408
and i have a save function which should make this array to some json string so that i can persist it via local storage
 
user986408
2:43 AM
array because i'm using push() to do it dynamically
 
ok, so why don't you just keep it an array?
to add an item to an object, you have to specify the property name and the value
array's are like objects but the property name is implicitly a number that grows and shrinks on its own when you push or pop it
 
user986408
var element = new WKTouch(img.id);
element.init();
Elements.eList.push(element);
 
user986408
this is my current code
 
user986408
eList is an array
 
alright, so far so good
 
user986408
2:51 AM
var my_json = JSON.stringify(this.eList);
 
user986408
this wont work
 
user986408
because it has to be some object struct i think.. and not an array
 
ah I see. yeah it has to be a data object. function objects won't work
 
user986408
but i could make eList an object.. like init it with {} instead of []
 
user986408
but how would i replace the push() part ?
 
2:54 AM
no no, that part is fine. the problem is "element"
when you say "new WKTouch()" you're creating a code object
 
user986408
yes
 
but only data objects can be serialized
 
user986408
oh u mean.. pushing also works with objects ?
 
no no, the push method only works on an array, but it doesn't matter if there is objects in the array or numbers or whatever
 
user986408
ok so.. basically i cant stringify it this way..
 
user986408
2:59 AM
with code objects
 
user986408
?
 
yeah, you need data objects in your array. what is it about WKTouch that you need to save? how can you make it into a string? you need to make a method that extracts the data from it and returns a data object
 
user986408
well.. it has the node stored.. and numbers like rotation, scale
 
user986408
gonna try that
 
user986408
thanks for the tip with the code object
 
user986408
3:04 AM
gn8
 
4:36 AM
good morning my friends :D
& trolls :D
 
good evening
 
5:19 AM
anyone know how i can get the element that was clicked in a jquery ajax success
trying to interact with dataTable
and delete a tr
but success: doesnt pass back the form element that was clicked
 
when an object is clicked, the target element can be referenced by "event.target" where "event" is the parameter passed to the event handler function
 
success: function(r, s, xhr){
				console.log(xhr);
				setTimeout(function(){
					var pos = $('table.datatable').closest("tr").get(0);
					var aPos = oTable.fnGetPosition( pos );
					oTable.fnDeleteRow( aPos );
				}, 400);
			},
so where would i do that at
var pos line is where its supposed to get the tr that was clicked so we can remove it
 
you need to capture the click event in the code surrounding this
 
NFI been up way too long
trying to avoid using another library just to do this >_>
 
"$('.confirm-delete').click(function(){" make it like this: $('.confirm-delete').click(function(event){
so that you capture the event object
 
5:27 AM
ooooo
and then just do event.target?
event.target.closest("tr")....
 
yup, that will refer to the object clicked
umm maybe you need to make it into a jquery object first
$(event.target).closet("tr")
 
bah
"object has no tr"
TypeError: Object #<HTMLElement> has no method 'closest'
 
"$(event.target).closet("tr")"
^ make event.target from a DOMElement into a jQuery object first
DOM Elements have no method "closest" only jQuery objects do
 
hmm
did that in the succes(); and it didnt work, did it by it-self and it did
is there a need for get(0)?
 
@Abhishek , can you help me to fix this stackoverflow.com/questions/10964184/…
 
5:39 AM
@Mike the get(0) will make the result back into a DOM element. but anyway, maybe you don't need the 'closest("tr")' at all. what is the object that is clicked? a button? a td? maybe what you need is "event.target.parentElement.parentElement" or maybe even another parentElement
 
the obj thats clicked is an href
its like 3 or 4 levels deep
 
your original code is looking for a TR, so... the A is probably inside a TD inside a TR, so you need to go up 3 levels to get the TR
 
thanks @endoalir
 
welcome^^
 
6:11 AM
0
Q: what is the difference between the below two syntaxes?

Hari $(function () { function foo() { return true; } log(bar()); // getting error var bar = function() { return true; }; }); $(function () { function foo() { return true; } log(bar()); // working function bar() { return true; }; }); ...

 
6:23 AM
I fucked up my node.js and i didnt do anything :-|
wow linux is weird
 
6:49 AM
@ThatWebNerd var s; this.eList.forEach( function( o ) { s += JSON.stringify( o ); } );
@Abhishek o/
 
@FlorianMargaine \O
 
how ya doin?
 
feeling much better then weekend :-)
and finally native-asnyc modules are working :D
 
nice :)
 
hmm... I need a program to automate sleep, so I can stay up and not have to worry about it
 
6:56 AM
nah, sleep > code
 
what about you florian how have you been ?
u can automate code though
 
meta programming
fine, thanks
been playing this week end :p
 
:-D
 
:o
 
@Esailija o/
 
6:59 AM
morning
 
yo
 
mp3_dec = require('mpg123'):

mp3_dec.decode('scan','foo.mp3'); // scan tells only id3 to parse
mp3_dec.on('id3',function(tags){
 console.dir(tags);
});
// thats my work since morning :-D
 
^^
 
[ the dirty C++ side has been abstracted lol ]
 
Well there's a colon in the first line :O
 
7:05 AM
syntax error lol
 
heh
 
alright going back to C++
lets see how fast ++ can be
 
faster than js, that's for sure
 
LOL
i also have to make sure the people who work on the top of this have a clue about wtf this is :-|
 
where the fuck were the specs for xing / vbri header
@Abhishek ?
I have them in my code but don't remember where I got them from
 
7:15 AM
wait
Hydrogen Audio ?
I got frustrated of trying to read various layers and vbri so i just used libmpg123
scroll down
E ?
 
2
Q: How do I calculate the length of an MP3 file in a remote location without downloading the entire file?

MunimI run an independent music website. We have a huge repository of MP3 files stored on our Amazon S3 CDN. We never cared to store the size of the audio in the database while uploading. Now, I need the length of each of these files in minutes and seconds. I am not sure if the TLEN ID3 info is set ...

I answered there
thanks
 
@Esailija what a insanite :-?
php has modules for doing so :-|
// i am refering to the person lol
i bet he didnt even googled before asking :P
 
what module
 
@Abhishek add an answer
 
I wouldn't google either, it's so easy to do :D
I have javascript ready for it
 
7:28 AM
be better than @Esailija
 
nah
 
it's not hard.
 
NO TELL ME AND TEHN I CAN EDIT
 
let him do the hard way (XD)
i am sure i used something like it in past though
lemme re-google
 
0
Q: Using a smarty array in javascript

AnaI am trying to use smarty in javascript. Here is my code: <h1>Create Backend Users</h1> <script> $(function() { var availableTags = [ {foreach from=$ufl item=uflItem} <tr> <td>{$uflItem['firstname']}</td> ...

concerns separation, guys! :(
 
morning
 
Good Afternoon
 
@Abhishek lol but that requires the whole file to work with
 
good afternoon :D Sorry my bad
 
(x_x) it does ?
 
7:32 AM
well where is docs
 
good morning.
 
@Abhishek I can't find any info if it can so I assume it can't :D
 
lol
 
it's very custom requirement anyway
 
@FlorianMargaine. I have got different response in terminal when I run console.log(' I am running on '+ process.env.PORT)
 
7:35 AM
can you find anything about the words stream
in that
 
" I am running on undefined "
 
$remotefilename = 'http://www.example.com/filename.mp3';
if ($fp_remote = fopen($remotefilename, 'rb')) {
    $localtempfilename = tempnam('/tmp', 'getID3');
    if ($fp_local = fopen($localtempfilename, 'wb')) {
        while ($buffer = fread($fp_remote, 8192)) {
            fwrite($fp_local, $buffer);
        }
        fclose($fp_local);

		// Initialize getID3 engine
		$getID3 = new getID3;

		$ThisFileInfo = $getID3->analyze($filename);

        // Delete temporary file
        unlink($localtempfilename);
 
dude
 
yeah its doing the whole download tantrum
 
   while ($buffer = fread($fp_remote, 8192)) {
        fwrite($fp_local, $buffer);
    }
 
7:36 AM
i cant read it (XD)
 
IM IN UR PHP, DOWNLOADING THE ENTIRE MP3 FILESZ
 
unformatted so i used here
 
@ankit using express?
 
yes
 
app.address().port
 
@Abhishek can't see any streaming support
 
i wonder what the heck i used
 
wait
 
:-|
 
it does do
$this->fd = fopen($filename,'rb');
IN THE CONSTRUCTOR
 
7:38 AM
@FlorianMargaine Cannot read property 'port' of null
 
and downloads only 1024 bytes ?
 
yes it has streaming support
 
" I am running on null" if console.log(' I am running on ' + app.address());
 
awesome
 
@ankit show me the line where you instantiate app
 
7:40 AM
told ya
but this aint what i used (XD)
 
var express = require('express');

var app = express.createServer();

app.get('/test', function(req, res){
    res.send('Hello World');
    console.log('test');
});

app.listen(process.env.PORT || 3000,'localhost');
console.log(' I am running on ' + app.address());
 
it was a huge library >_>
 
@FlorianMargaine , please look at last message.
 
let moi see
can u tell me what version of express are you at ankit ?
 
"name": "express",
  "description": "Sinatra inspired web development framework",
  "version": "2.5.9",
  "author": {
    "name": "TJ Holowaychuk",
    "email": "tj@vision-media.ca"
  }
2.5.9 if I look at readme.
Is this happen because of using ubuntu on virtualbox.
 
7:43 AM
nah
btw app.address(); is not a member :-(
reading the docs of express
because the article you are reading that infromation from is outdated
 
8:31 AM
any way to convert a webpage to pdf ?
Click a button and a dialog box pops up asking you to save the current page as a PDF.. something along those lines
 
8:45 AM
js only?
 
@sh
 
hello @Somebody
 
@ShyamK Iam not sure but maybe you will need server side script
 
9:01 AM
@ShyamK there are some web service to do this. just put the button they provided into your pages/blog-posts. web2pdfconvert.com/pdf-button#cid5
 
there's a Windows application or two that lets you print to a PDF
 
either server side script, or flash.
 
yeah flash is a good thing when done properly but too much use of this makes the webpage slower
and also flash player is also needed
 
flash player is installed in 99% of computers worldwide
also, I'm not talking about a flash page, just a flash component to get a pdf file
and seeing the number of flash webpages, this kind of component is definitely not heavy
 
9:18 AM
ok
iam definitely in 1 % but today will surely come in 99%
 
you don't watch youtube?
the #1 reason any person has flash installed :D
 
youtube has html5 videos :p
 
you have to join the html5 trial explicitly
iirc, if you try to watch video without flash it will just say install flash
html5 also sucks because no content protection
my god why is it so cold all the time, it's summer ffs
 
you guys know of this? phoboslab.org/ztype
 
Good morning everyone!
@Esailija hi
 
9:33 AM
@Esailija yeah it's not perfect, but you don't need flash if you know :p
 
Guys, I have a question regarding FancyBox and usage of it with iframe.
 
I have two buttons there. One submits a form and other makes ajax request. But I need then to interact with system differently from how they do now.
 
damnit
I hate php
 
:)
 
9:38 AM
$str = 'some string'; $str += '...'; // $str === 0
 
For example submiting a form will take to other page and since I'm in iframe it loads it there. I would need it, to close fancybox and reload main window to point to that form.
Is it doable at all?
 
for those wondering, this is the correct way: $str .= '...';
@Eugene it seems doable
your iframe is in the same domain, right?
you can access the parent window with the parent object
 
@FlorianMargaine yes.
Okey, but how would I reload main window, that is in the back and close current iframe also?
 
parent.location.reload() ?
current iframe will be closed if you reload the page
 
9:53 AM
@FlorianMargaine I suck at that game, got overwhelmed always :X
 
like exhausted from all the tpying
 
well I do too at a certain point
I mean, there is no end
it's like tetris :p
 
afraid to get carpel tunnel syndrome from it
 
expert mode is hard though
 
9:55 AM
I got to wave 18 or something in expert mode
 
oh nice
 
then I just started getting tired
maybe mechanical keyboard sucks for it?
 
@FlorianMargaine but could I do it somehow smoother?
For example parent.location.reload(); will only reload the parent windown
 
@Eugene yeah, $( parent.body ).fadeOut( function() { parent.location.reload(); } );
 
9:56 AM
:X
it will reload everything
 
I would like to change location to where the parent window should go
i.e.
current url is something like blablabla.com/bla/bla
So I start fancybox on that page
 
^^
 
@Edditoria I tried this out and it didn't seem to be working..
 
Next I submit form inside fancybox and it should redirect main window someplace like blablabla.com/bla/blood
 
Not just reload page where I've been blablabla.com/bla/bla
 
Result
Words per minute (WPM) 87
lol
iSuck
 
you're better than many people though
:p
most of my friends range from 30 to 60, one got to 90
 
a good question for SO is Has anyone really been far even as decided to use even go want to do look more like?
 
@FlorianMargaine any further suggestions to my explanation?
 
10:01 AM
@Esailija ???????
 
@Eugene I don't understand what you mean, so no
“You’ve got to be kidding me. I’ve been further even more decided to use even go need to do look more as anyone can. Can you really be far even as decided half as much to use go wish for that? My guess is that when one really been far even as decided once to use even go want, it is then that he has really been far even as decided to use even go want to do look more like. It’s just common sense.”
mind blowing :D
 
@FlorianMargaine you have a page. You have some trigger on it, that starts fancybox. FancyBox loads iframe. Page loaded in iframe has form and button in it, that will submit this form. Form is submited to diff. url, then the current pages url with form. Since it is iframe, it tryed to do it there. I would like to submit form, close fancybox and redirect main window to the page where form is submited.
 
ooooh
makes sense now
 
^_^
 
10:07 AM
I have no idea without changing the backend though
 
:(
Could I listen from outside iframe (fancybox) to what happens inside of it?
For example same thing. When button is pushed I close fancybox from outside and then change location of the main window to redirect it.
 
somehow
you can trigger something from the iframe
with parent
 
is there some kind of scam scene going on
or whatever
 
i want to display the pdf file in web browser which can't be downloaded is there any way using java script or html?
 
@Esailija actually, this is perfectly valid
 
10:21 AM
making a question and answer as if it was some blog is not valid
 
65
Q: Posting and answering questions you have already found the answer to

Bogdan_ChSometimes you spend a day or more to solve a technical problem and when you finally solve it, you may want to post it on your blog (if you have one) to share with the community. However, most developers doesn't have a lot of time to update their blogs, and that is why personal blogs are not rank...

it is :)
 
he already knew the answer before he even asked
 
and that's perfectly valid.
 
oh
 
Jeff Atwood says so!
 
10:23 AM
fuck him
that's just stupid
I guess I could find a duplicate then
 
yep, duplicate would be fine
but having SO as "little blog" is perfectly fine, and is wanted
 
Hi I dont suppose anyone can help? - stackoverflow.com/questions/10976981/…
for some reason I cant seem to get the value of textBox1's text to use in my javascript function
it returns as null
 
@FlorianMargaine I disagree though, I can't believe that meta post.
 
your opinion is this one
3
A: Posting and answering questions you have already found the answer to

GordonNote: This answer is also in response to http://blog.stackoverflow.com/2012/05/encyclopedia-stack-exchange and the short exchange I had with @spolsky on Twitter about it (which is too limited as a channel to discuss this topic). I disagree with answering your own questions or using StackOverfl...

which I can understand, but sort of like the "blog" kind allowed, it's often useful for many people
 
i want to display the pdf file in web browser which can't be downloaded is there any way by using java script or html plz help me
 
10:35 AM
use pdf.js
@ChaitanyaTummagunta
 
10:49 AM
@FlorianMargaine I found exact duplicate :D v
 
@Abhishek Thank you ............
 
People in the world these days _
 
11:05 AM
hello JS pros
 
hello jurka

- jsRookie
 
Does anyone know how much memory each var number = 43; takes ?
declaring float variable
4 bytes ?
 
64bits
 
I can not find any information of the javascript type sizes how much memory these take
like creating object literals
var o = { };
 
dont worry about memory management in javascript :-D
 
11:07 AM
and the string-s var char = 'a'
just curious, no one has touched this topic
 
read that :-)
there is all the info you need :-)
 
11:30 AM
@jurka It depends on the JS engine. It will certainly use more memory than a plain int/long in C.
 
ok ill have a look
what about v8
 
@Abhishek This specifies how much memory the number itself uses. However, it will be wrapped in an object (e.g. JSObject in SpiderMonkey) so the total memory usage will be higher.
 
@ThiefMaster the OP was wondering how much memory each object uses
ofcourse the total memory usage is going to be higher due to wrapping
and @jurka consider reading v8 source code thats the best option :D
 
indeed >D
 
11:53 AM
@Esailija it's not really a duplicate. It is in the generic way, but it's not specific to styles
 
how is it not specific to styles?
.style.text-align is what the op attempted
 
the question's title, that is
so... SEO wise
 
ok so it's not character for character duplicate
but it covers exactly the same ground
 
you know what I mean :]
yep, but a google search might not get to it
 
how to use hyphenated properties AND the fact that js uses camelCase
what has that to do with anything :O
if you close for duplicate, the google can find the post just as well
it won't get deleted
 
11:55 AM
guess so :p
but the fact that it took you some minutes to find a duplicate should say it all :p
 
I didn't start looking duplicate because I thought it would get deleted for being a blog post
but like I said, closing for duplicate doesn't exclude it from google search
 
so closevote up?
:D
 
lol
 
11:58 AM
done :)
I'm reading this condom with a big voice
it's lul
 
Sam
Afternoon everyone
 

« first day (604 days earlier)      last day (4361 days later) »