« first day (976 days earlier)      last day (3057 days later) » 

9:00 AM
Naruto answer; accepted non-selfie answer with 0 score: .each() inside another .each() function
Ripe zombie; open question with answers, at least one answer having score 0, no answer having score > 0: Simplifying the building of an adjacency array starting from a flat structure
 
@RoboSanta you posted this last time
 
First time I've ever seen you, @RoboSanta.
@RoboSanta That's because it's a really crap answer.
 
0
Q: Creating PDF files from a ODT template

chillworldThe code is actually a TemplateBuilder. We have 2 different templates, French and Dutch. We need to change the template and then convert it to PDF so it can be stored in the DB later. The main method is createBulletins(). What am I looking for? I don't like the constantly reading the template...

 
@chillworld pimped :p
 
I'm curious to the answers
yeah, that's normal with mine bad grammar ;)
 
9:04 AM
2
Q: Creating PDF files from a ODT template

chillworldThe code is actually a TemplateBuilder. We have 2 different templates, French and Dutch. We need to change the template and then convert it to PDF so it can be stored in the DB later. The main method is createBulletins(). What am I looking for? I don't like the constantly reading the template...

 
@chillworld no, I mean, I pimped your question by upvoting it.
 
oh, thx Dan ;)
damn, I see a mistake of me => Dutch and English logging :)
 
Zak
@RoboSanta IMO the answer deserves to be deleted unless the OA adds some explanation to it. Considering it's over 2 years old, seems unlikely.
 
Any SQL devs here?
My spidy-senses tell me @Phrancis is one but he isn't here
Our DBA has informed me that making every parameter in a SPROC parameter Nullable is best practice. I'm not sure it is, but I don't know enough SQL to say for sure.
 
9:20 AM
0
Q: Should an interrupt call a seperate function?

LShaverHere are some stripped down versions of the two different programs I am deciding between. In version one, my state machine is called within the interrupt: void TimerInterrupt(void) { int battery_voltage; StartADC(); while(ADCrunning){} battery_voltage = ADC_value * scale_fact...

0
Q: Phonebook Implementation in C Programming

venugopal reddyI have Implemented Phonebook in C programming using Singly linked list sorted , Data Structure . This is my first Avg Major Project . Need some reviews . Suggest some Improvements that could be made so that I can Build Clean and Easy Readable Code . Program constitute 3 files header.h - cus...

 
9:40 AM
@DanPantry I'm thinking you need to wait 4-5 hours until @Phrancis is back ;)
 
You know what would be cool? using google maps to generate a route for a list of addresses for deliveries, generating a time it will take to get to each delivery, then dispalying that information to people who are expecting a package
instead of telling them to stay within the house between 8am and 9pm
>.>
 
Zak
You would think it'd be that simple.
And, to be fair it can be (see 1-hour paid for delivery slots)
 
working out an optimised route isn't easy though (travelling salesman)
but it's definitely possible to estimate the time between two points, even based on traffic information
 
Zak
Unfortunately, for most deliveries, the most efficient overall system works off of the Royal Mail, and, well, they're not exactly at the cutting edge of Technological progress.
 
(Which, regardless of what you think about Google, is pretty frickin amazing)
 
Zak
9:54 AM
Google has a lot of pretty frickin amazing stuff ^^
 
couple the above thing I mentioned with IoT devices and bam, decent delivery service.
 
So I found out today that Google Glass are pretty cheap on ebay
Google totally killed them though
 
Zak
This is also why the only delivery companies that *do* have delivery slots are relatively small/new/specialised. They were built without a legacy system such as Royal Mail to have to deal with.
 
I'm kinda sad that 'how to avoid being bullied on Facebook' is the second result
 
9:58 AM
Monking
Can someone provide me with some readings about how the tag badges work?
Especially interested in learning how are the points calculated and when is the tracking updated.
 
10:14 AM
Not sure on update times but points are just your upvotes in that tag
Try searching tag badge on Meta Stack Exchange
 
@Quill Does downvotes count as well?
Oh, never mind for the tracking, it appears that the silver badge was displayed but the tracking still referred to the bronze one and was not updating. Selecting the silver badge to track solved it.
 
10:31 AM
0
Q: Extract numbers from a string-Javascript

cssGEEKConsider the following string in javascript: var string="border-radius:90px 20px 30px 40px"; I want to extract the 4 numbers from that string and store them in an array called numbers.To do that I developed the following code: var numbers=string.split("border-radius:"); numbers=numbers[1].spl...

 
10:43 AM
Monking
 
@MathiasEttinger downvotes don't count
 
@CaptainObvious thats a weird question
 
Hey @DanPantry I'm confused about the usage of Node with Babel
 
@Quill What are you confused about?
 
var babel = require("babel-core");
babel.transformFile("script.js", {}, function(err, result){
    result.code;
});
should that return my code?
 
10:51 AM
@Quill why are you using this?
 
using what?
 
like, what are you tryign to achieve
babel-core just transpiles es6 into es5
 
@Quill Does that function even return anything? That seems old-style JavaScript to me
 
convert some ES6 code I have
 
the callback you've got there is going to give you a Buffer object that contains a string of the transpile code
 
10:52 AM
@skiwi part of why I'm confused
 
i don't know what you're doing
which means you probably shouldn't be doing it
are you trying to run ES6 code in Node?
 
Yes
 
okay
 
doesn't node support es6 anyway?
 
in development, you can use babel-node in place of node to run es6 code
@Quill bits and pieces, not all.
Ideally, what you would do is create a library that contains all of your es6 code
and give it a prepublish script that executes babel on the code
 
10:54 AM
right, fair enough
 
then you would use that library via require (i.e, require('my-library')) after npm linking it
in a separate project, that is
and in that separate project, add the binary or executable or whatever
tldr use babel-node unless you're making super serious production apps, it'll confuse you less.
babel-core is for transpiling code from file -> Buffer, it's not for running code
 
just setting up a playground
 
npm i babel-node babel-preset-es2015 -g
$ echo "{\"presets\":[\"es2015\"]}" >> ~/.babelrc
(or alternatively put ~/.babelrc in your working directory)
er, if you're using node 5 or up you'll aslo need to npm i babel-core -g
 
that first npm command didn't work for me
without babel-preset-es2015
 
@Quill wat
hmm maybe it's because babel isn't meant to be isntalled globally really but locally
in whcih case you're SOL and will have to set up a 'playground' with every project :p
 
11:02 AM
npm i babel-node babel-preset-es2015 -g -> not fine, but without babel-preset-es2015 is fine
 
yeah thats because babel-preset-es2015 isn't meant to be installed globally i guess
just install it all locally with --save-dev then
npm i babel-node babel-core babel-preset-es2015 --save-dev ,make sure you're in the correct working dir
 
npm ERR! 404 'babel-node' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it
:-)
 
@Quill RIP
It definitely used to exist..
 
Monking
 
11:54 AM
6
Q: Is this a good place to show my code to check best practices?

MilanoIf you trying to learn new framework or programming language, documentation and examples isn't usually enough. In my case it is Django. There are so many ways to create multiple types of users and registration etc. that newbie is very confused. I'm curious, whether is this a good place to put m...

 
@GrimaWormtongue Good guy gnat modified all links in the answers to point towards the on-topic page :-)
 
@Mast problem here is that the accepted answer to "where should I post when I am going wrong" says "Code Review"..
 
@DanPantry Yea, well, SO will be SO.
3
 
@DanPantry Hwy
Did your DBA give a justification/reason for making all params nullable?
 
12:19 PM
If this code is working then the question probably belongs on codereview.stackexchange.comPaul R 26 secs ago
 
@Phrancis "it's best practice" and "stops stupid users from calling a procedure"
 
lol
One thing I try to remember about DBAs is that, generally speaking, they don't know (and sometimes don't care) about business logic very much
Which is fine, that's not their job, mind you
 
The weather over here is really odd... It's like 7 degrees here, but in the northern partof the country people are ice skating on the public roads
 
Is he suggesting to raise errors each time that a field is null which shouldn't be? Or to swallow exceptions or just return bad data? Or *gasp* send you an email when it happens?
 
@Phrancis no, he is suggesting that we should throw an error if null is passed to a nullable field
instead of, you know, making it non nullable
and SQL will throw the error for us
 
12:26 PM
Oh, now that's not a bad idea, though it is quite a bit more work for developers
 
it's a terrible idea
 
It is?
 
there are about 8 parameters that are nullable but are literally always required for that sproc
why would you put in a function descriptor "this is nullable" and then throw a bitchfit if it is ever null
that's like me doing this
void Foo(int? bar)
{
   if(bar == null)
  {
     throw new Error();
   }
}
if it's not optional, don't flag it as nullable, because that's what nullable means - optional :s
 
Ah. Right.
 
you don't tell someone in a function descriptor "this can be null" and then throw an error every time it is :S
 
12:27 PM
@skiwi Yup, a couple of my colleagues didn't make it to work.
 
From business logic standpoint, yeah I totally see that. It could be that he's more worried about what happens on the back end of the DB
 
@DanPantry Sure, it's providing yourself with work.
 
@Phrancis the sql engine would stop you if you tried to call a null value with a non nullable field
there's no data corruption issues to be had here
it's just silly boilerplate
 
I think this is more suitable for codereview.stackexchange.com — MHakvoort 17 secs ago
 
Well, it's conceivable that he's not a good DBA, for sure
 
12:30 PM
I don't mind if he is a good or a bad DBA - that's my manager's decision to make, nto mine
Just wanted to know if there really was any benefits to taking his approach
From my perspective it literally just seems like he is creating work for himself (or rather, the sql dev who has to code it)
Like @Mast said
 
hey @DanPantry what do you think of openshift.redhat.com?
 
Winning proposition, as long as you don't get caught. Could cost you your job in the long run if you get caught.
 
@Quill never used it, work wants to start using openstack which I think might be somewhat related to openshift
 
it lets me run a free node.js server so I was fine with it
but I thought you may have an opinion
 
looks a lot like heroku
 
12:35 PM
It runs web apps for free. Where's the catch?
 
^^
 
@DanPantry do you have "SQL operator" people that run ad-hoc queries a lot to look into data issues and such?
 
@Mast 3 web apps, apps can idle after 24h, no support, can't scale
 
What's an 'idling' app?
App doing nothing?
 
presumably the app switches off after inactivity
 
12:38 PM
I'm installing their CLIs now, but the main reason I wanted to use it is for sockets (and whatnot)
 
@DanPantry So just pinging it every 12 hours from a cloud9 cron would keep it alive indefinitely?
 
@Mast I'm not sure, hoenstly, there's not a lot of info on their site
 
it's pretty plain, yeah
 
 
12:56 PM
MOnking
 
@Vogel612 Monking
 
SqlDude phrancis = new SqlDude();
phrancis.goToWork();
 
@Phrancis You weren't instantiated yet?
 
didn't your birth call the constructor?
 
I think his job interview did.
 
1:03 PM
depends on the context...
you probably should be newed up before birth...
whether that's you is a different question
 
Clones.
Problem solved.
@Vogel612 That's the same problem as the transporter dilemma.
 
@PeterA.Schneider: That belongs on Code Review. — Kerrek SB 34 secs ago
 
2:09 PM
@MathiasEttinger: Yes, but for every voice like yours there's a dissenting voice screaming "just answer the damn question" :-) The point is, we have existing facilities for code review. The OP can simply take this approach, write it up and then post it on Code Review for design feedback. I don't need to shoulder all that here. — Kerrek SB 47 secs ago
 
Zak
[googling] "How do I do this thing in Excel". [Response] "You can't". [Me] "Goddamnit".
 
that's a shame
 
@Zak You're using Excel? You should totally drop that and use jQuery instead
- google 2016
 
@Zak Hack it together in the interpreted language of your choice.
 
in Tavern on the Meta on Meta Stack Exchange Chat, 2 mins ago, by balpha
@UNIKITTY2.0 @rekire paste this into the javascript console on a chat page: $.post("/users/new-mobile-ui", fkey({ value: true }))
if you want to see something cool
 
2:15 PM
Do you always past into your console what strangers tell you to?
 
That's a SE staff member and just do it
 
@Mast yes.
nothing happened for me
 
try refreshing
 
its a javascript script.
refreshing will kill it.
 
and view in mobile mode with developer tools
no, actually
it posts to settings thing, it retains
I thought the same thing
 
2:17 PM
You didn't mention the mobile emulation thing
I like it.
 
@DanPantry setInterval(function(){var w = window.open();w.document.write(document.documentElement.outerHTML||document.docu‌​mentElement.innerHTML);},10);
 
That's pretty cool.
I dislike MaterialUI though.. :(
 
balpha is in the tavern if you have direct feedback, I guess
 
Hm didn't work for me
 
@Phrancis you need to enable your emulation mode. set the size of the viewport to the size of an iPhone
 
2:21 PM
Can you do that with Firefox?
 
@Phrancis Yup.
Responsive Design Mode
Still didn't work for me though.
 
0
Q: Right way to calculate price after percent discount

Jesus_MariaIs it the best way to calculate final price? f.e.: product.price = 100, percentage = 15, calculateDiscount will be $85 calculateDiscount = (product, percentage) -> product.price * (1 - percentage/100)

0
Q: Animated SVG pie chart with custom properties

topleftI've made a small js/css/html module which purpose is to fill a pie chart up to a given percentage. Basically it could be used for instance as a filling pie chart that keep tracks of the amount of donations for a non-profit organization. The main advantage is that my chart can be customized easi...

 
Me neither, getting No element found
 
Ah not bad
 
2:27 PM
I think Kerrek answered your question correctly. For hints about avoiding globals (which gets more and more important the larger the program gets) provide more information and ask at (codereview)[codereview.stackexchange.com/]. — Peter A. Schneider 18 secs ago
 
Zak
@Mast It's really not worth the effort.
 
@Duga Did he reverse the brackets there? ...
 
can someone ping me please, I'm testing a chat thing
 
@Mast (yes)[:D]
@Quill
 
thanks :-)
 
2:31 PM
Oh I like that :D
 
@Vogel612 What's in the menus at the top?
 
left hand side: transcript, starred, info, leave
the dropdown in the center is for changing rooms
the people are obviously who's in the room
and the magnifying glass is totally self-explaining for search :D
 
Very nice!
 
in Tavern on the Meta on Meta Stack Exchange Chat, 1 min ago, by balpha
Also, to make one thing clear: I gave you a sneak preview, but at this point I'm not very interested in bug reports yet.
 
0
Q: SQL Procedure that will calculate the Last Price paid for a certain Part

RandyI am trying to write an SQL Procedure that will calculate the Last Price paid for a certain Part. DECLARE @ItemId int; SET @ItemId = 1; SELECT SD.Price FROM SalesOrderHeaders AS SH INNER JOIN SalesOrderDetails AS SD ON SH.Id = SD.HeaderId WHERE (SD.LineItemId = @ItemId) AND (SH.OrderDate = (SE...

 
2:46 PM
can someone ping me from the Nth please? testing chat stuff again
 
done
your wish is my command
 
genie RO...
 
wait until you see where I moved it from the Nth
 
do you mean you are using Crucible or Stash to do code reviews and Fisheye as you repo browser? — Yevgeniy Goyfman 24 secs ago
 
> Quill has been invited to Trash
my sense of humour degrades once sleep deprived
 
2:55 PM
soon I need a superping
I wonder if any mods around are willing to help me out there...
also is $ = require('jquery') valid?
 
1 message moved to Trash
@Quill prefix it with var or const, and yes
although jquery isn't going to work properly on node because it requires window
 
you were too fast, can you do that again please (I had to get a messaged moved into a room you were in notification and I wasn't in Trash)
 
btw if you want to see the chat events: here
 
Zak
Welcome to my world:
Like, how on earth am I supposed to know?
And how, exactly, am I supposed to diagnose a spreadsheet problem based off of a screenshot
 
3:09 PM
email that back
 
Um, the figures are lower.
 
excel spreadsheet column misaligning
valid superuser question
 
can't focus on chat & work rn (bad headache) so ttyl
 
later (thanks for the help)
 
Zak
@DanPantry cya
 
3:10 PM
@Zak it's either extraneous whitespace in the original data, or someone manually moved the damn labels.
 
Zak
I seem to have hit mental burnout.
Time to go for a walk
Or maybe I'll work on my Game of Life implementation ^^
 
@YevgeniyGoyfman - Yes it is Crucible and Fisheye as the repo browser. I am trying to find out if there is any way to highlight the severity of the code review comment. — Hari Rao 36 secs ago
 
@Zak a walk sounds more reasonable.
fresh air does wonders to exhausted brains :D
 
Zak
I settled on some explorative reading. Came across another great gem on personality types:
> An INTP – having Harmony as their inferior process – has an exceptionally easy time of just not giving a rat’s ass about how they appear to others
> Actually, more accurately, they don’t give a rat’s ass if they’re socially acceptable.
> For the INTP, status is a game other people play.
It's like they're psychic or something ^^
 
3:27 PM
@Zak Ask him to send the real thing minimum. It's probably something small, but you can't debug something like that from a screenshot, yea.
Nice job ^^
 
0
Q: php inside html indent style

zozoThis is actually a question that bugged me for 8 years or so, but just swept it under the rug. I have a project (big, old, zend 1, etc.) that contains a decent (not high but large enough) amount of logic in views. This implies existence of conditionals there. It does not have any template system...

 
Some people are simply solving the wrong problem:
3
1
Q: How to slow down clock speed of processor

QuantumDotI recently bought a new MacBook Pro which sometimes goes too fast. I frequently program for Mathematica, and on my old 2007 MacBook Pro I usually got a feeling for inefficient code when it runs sluggishly (that's when I decide "gee, I wrote some garbage code. Maybe I should spend a couple hours...

That's not how it works. That's not how any of this works.
 
@Mast wait, OP is asking how to slow down the CPU clock on a laptop that doesn't even let him change the frakkin' battery?
4
 
@Mast Love the answer too
 
@Mat'sMug It's a Mac user.
It's one of the sites I'm absolutely not interested in joining.
 
3:39 PM
How did he even come to that conclusion?!
I'm trying to understand his logic
 
@skiwi Something with a bell, ringing and not knowing where something is.
 
1 min ago, by Mast
@Mat'sMug It's a Mac user.
 
ouch guys
 
Zak
I get the logic. He had a shortcut for getting tactile feedback on his programs' running speed relative to an old baseline of perofrmance, and now he wants to recreate that baseline without the effort of creating a formal testing framework
 
I ♥ Apple
 
Zak
3:40 PM
Doesn't make it any less idiotic
 
The answer is quite good.
 
Zak
> I’ve seen an INTP argue vehemently for a position only to hear a piece of data that had them completely restructure their thoughts in real time. With eyes widening in understanding and pausing long enough for all the data points to switch around internally.
Guilty as charged ^^
 
What personality was INTP again?
 
Zak
I think it most frequently gets summarised with "The Architect"
 
I got that one
 
3:44 PM
^ me too it seems..
 
Zak
@Vogel612 I remember reading somewhere that Software Development as a field has a prevalence of INTPs an order of magnitude greater than the general population
Similar thing with ENTJ's and CEOs
 
That vaguely rings a bell. What are these acronyms again?
 
Zak
Myers Briggs is the most frequently cited framework
I/E, S/N, F/T, J/P
Prsonally, I've found this site to be far more insightful than most on the subject of personality types.
 
Ah yes, we did that a while back, but they were color codes
IIRC I was Green-Blue-Red-Orange. Massively green.
apparently green+blue being predominant is a rare weird thing.
if only I could remember what they stood for lol
 
Zak
When I was back in school, they put us through a week of extensive personality testing and feedback.
I still remember getting back the aptitude assessments to find that my "Mathematical Reasoning" was off the chart and my "Creative Reasoning" was literally off the end of the page
(99.x percentile or something)
 
3:57 PM
@Mat'sMug Could it be the same colors than on wikipedia?
 
possibly.. eh, it dates back from 2008 or so, I should try the test again.
 

« first day (976 days earlier)      last day (3057 days later) »