« first day (1605 days earlier)      last day (3358 days later) » 

2:00 PM
Do you actually need to throw and catch it?
 
clean code
 
@Retsam hm, not sure.
 
7
Q: How can one get the file path of the caller function in node.js?

DextorHere is some sample code from three files: // foo.js var myFunc = require("./myFunc"); function foo(){ myFunc("message"); } // bar.js var myFunc = require("./myFunc"); function bar(){ myFunc("message"); } // myFunc.js module.exports = myFunc; function myFunc(arg1){ console.log(arg1); ...

 
@FlorianMargaine of course not
 
@darkyen00 Very few sockets, IIRC. Not sure
 
2:10 PM
@SomeGuy guide me oh wise one.
I bought a new battery though.
but its only 4400
 
Honestly don't remember
 
will last about 4 hours max.
Any place nearby ?
 
Erm, there's a Starbucks at the airport
I'm sure they've got sockets
Not that I've been there
Where are you headed anyway?
 
Someone edited one of my answers; I can edit it back without reviews?
What the hell? I thought I was going to "propose" them.
 
@SomeGuy Home. Jabalpur
Imagine Cup this year,
 
2:15 PM
Ah. Best of luck!
 
Question for you, how would you handle this
 
Made a simple app called "batua" which allows the lowest merchants to receive payments off credit cards in 30 seconds of transactions.
@SomeGuy ^ what do you think of that ?
 
Oh, that sounds really cool
 
I want to grab a list of strings from the database, and write, to a text file, a formatted log of the strings + a message next to each string
 
8-)
If only @Loktar or @RyanKinal can lend me a stripe account, i'd make them partner. lol
 
2:16 PM
Now, I want to have a nice padding between the string and the message, so that the messages are all aligned
 
@SomeGuy also the business model is good enough so that i can ccharge the user only 55 rupee per year.
 
Oh, wow
That's great
Think it'll take off?
 
a     message
ab    message
abc   message
abcd  message
Like this ^
For that, I need to calculate the longest string, before I begin processing
I work with promises, because the list of strings are gotten from the database, and the information (message) is gotten from making an HTTP request for each string.
How would you handle this padding?
 
You'll need to know the maximum length of the first part
 
@SomeGuy Right, the question is how to pass it to the next promise which handles this
 
2:20 PM
So, unless there are limitations on the string length, you'll have to wait for all of them to come in before formatting them
 
2:30 PM
ignore me, rewriting a file after each string is a bad idea (tm)...
 
:21985042 I don't really want to use an external scope to keep track of the max length
It's effectively global.
But I'm not sure how to pass it to the next promise handler.
 
reduce?
 
I could pass it along with the string array, but then I lose the ability to use Promise.map, which I still want.
 
Why does it need to be a separate handler? Shouldn't you just have a handler that takes the array of strings and handles whatever needs to be done?
 
@Retsam My flow is:
- Get all strings
- Make request for each string
 -- Make a check about each string's response
 -- Under certain conditions, log FAIL or WARN with a message into the file --- this needs to be formatted
- All done, show ending totals and stats
 
2:34 PM
So you're doing an async call to get all strings, then another async call for each string?
 
@Retsam Correct
 
getAllStrings().reduce(getLogs).then(formatLogs);
 
Ah. Yeah, I'd just use a closure, honestly.
 
@SomeGuy are you free on 12th ?
I'd like an autograph :3 /cc @AaditMShah
 
Haha, what time?
 
2:35 PM
@SomeGuy dunno... i will need some help though
 
@FlorianMargaine What's getLogs here? What does it return?
 
the way i have written it is the transaction system is open to implementation and a single standard.
 
With what?
 
@SomeGuy with the "batua" thing. I initially wanted to make it free of cost, but the server prices will be significiant, as well as sicne it works without the requirement of internet --- the sms sending cost are also high
and i will landing in Mumbai at around 10am then i will be sitting ducks till 4pm
 
@SecondRikudo something like function(logs, str) { return request(str).then(function() { logs.push({head: 'a', 'tail': someString}); return logs; }); }, []
 
2:38 PM
@darkyen00 Damn, I'll have college then
9-5
 
crap :-(
 
and formatLogs can do the calculation (how many chars is the longest head)
 
@darkyen00 What can we do for you?
 
@FlorianMargaine So then I need to iterate all the strings again in formatLogs, right?
 
function handleStrings() {
    var maxLength;
    getStrings().then(function(strings) {
        maxLength = Math.max.apply(Math, strings.map((str)->str.length));
        return strings;
    })
    .map(getStringData, function(stringData) {
        //formatting here
    });
}
 
2:38 PM
Yeah, I see
 
@SecondRikudo yeah.
 
@SomeGuy write clients :D
 
Yeah, should be alright
 
you don't have much choice.
 
Thanks
 
2:39 PM
or .. simple review of code or anything (even documenting) will work.
i am also going to start a pilot with 48 shops and 2000 users in Jabalpur, lets see how that goes :D .. though i'd prefer one in more prominent cities like bombay and bangalore.
 
@darkyen00 Let's see what we can do
 
Awesome.
 
@FlorianMargaine @Retsam the code from the accepted answer above did more than I imagined was possible - I could get the whole module object including its exports, when the module was still being initialized
 
@copy giggity!
grats @rlemon on the house!
you should build a secret labyrinth!
 
Oglaf reference?
 
2:55 PM
@Retsam Never heard of them before now
the comic of the day is NSFW
kinda
 
Yeah, sorry I should have warned, virtually all Oglaf are NSFW.
user image
5
 
Labyrinths ARE awesome!
 
His face xD
Morning y'all
 
I know someone who uses the face from that last panel as their avatar; it makes a good one.
 
Guys, anyone knows a good PHP Sucks article? I gotta convince a conservative CEO to leave the platform for not going back.
 
3:01 PM
Google has many
but to be fair, if the company is fairly dependent on php, then you need to focus more on a business case for the benefits of switching
 
!!tell GabrielTomitsuka google PHP fractal of bad design
 
How much money will you save by switching?
etc
 
15% in 15 minutes
 
posted on March 09, 2015 by admin

New comic! Today's News:  Whee!

 
3:03 PM
Can I use str.includes() with babel in nodejs without including any further polyfills?
(Just require('babel/register'))
 
@Loktar hehe
 
clever girl
 
@NickDugger Yeah
 
@BenjaminGruenbaum is there a way to make the windows phone emulator work without a real windows phone ?
// vs ultimate 2013 asks me to connect a real device :-/
am gonna try again with vs community 2013 -- hope it works phoneGap
 
user image
3
how did I miss that? It sounds exactly like my sister
 
3:22 PM
Ah @FlorianMargaine I remembered why I couldn't do that to begin with
I want that for each string, as it completes it checks, it should output to console immediately.
 
@towc lol.
 
3:45 PM
@SecondRikudo then you can't have dynamically formatted strings based on all the strings... It's logically impossible
To format based on all the strings, you need all the strings first.
@SecondRikudo but honestly, store logs in some maybe-readable format, and use another software to read the logs
 
@FlorianMargaine I know
 
@SecondRikudo you could take apache logs format to be able to use apache log readers, for example
 
@FlorianMargaine I'm recording this for Jenkins
It stores the artifact created as is, and I want it to be readable.
Also, the console output needs to be readable as well
 
[time] stuff is readable
 
hah, that olaf
sometimes nice comics
 
3:54 PM
@FlorianMargaine not really
Not when you have tens of thousands of lines, and it's the message that matters the most :P
 
I wouldn't rely on my eyes if you have thousands of lines...
 
@FlorianMargaine vOv
Me neither, trust me.
I suggested to store it as JSON, and use another tool to look up for things
It's just that we don't currently have that other tool
 
2
Q: How to sort files based on the json property value inside the file?

kenorbI've downloaded list of videos via youtube-dl and each file has corresponding .json file containing certain properties. So I would like to sort the files based on the selected json property which is inside of corresponding .json file (e.g. by number of views count, property: view_count). What to...

(of course you're not going to use this, but just saying it'd be much easier to store in json and create this other tool.)
 
@FlorianMargaine unless Jenkins has a plugin for it, I don't think it's going to happen
Although, I'll ask my jenkins specialist.
 
i have one ajax request which takes more than 5 seconds to get a response. I have another ajax request which only takes few millisecond to get a response. The problem i am getting now is that I am not getting response to the second ajax request until my first ajax request is completed
I have seen that working on facebook. why doesn't it work on my website?
 
4:10 PM
> Compilation completed successfully in 8 minutes, 31 seconds.
Thanks IntelliJ you slow shit.
 
user1596138
@SterlingArcher ...Java!
 
Yeah, I was twiddling my thumbs for 8 minutes.
imgur.com/gallery/oOwjoym well this was unexpectedly amazing
#DidNotSeeThatComing
 
user1596138
Well then
 
4:27 PM
@SterlingArcher welcome to my life
 
4:47 PM
lmao at top porn comment there
 
@SterlingArcher In the original, the kid makes the goal
 
@jAndy she at 350 last I checked
 

« first day (1605 days earlier)      last day (3358 days later) »