« first day (466 days earlier)      last day (3536 days later) » 
00:00 - 15:0015:00 - 00:00

12:09 AM
0
Q: Pathname matching and listing program

Tom ZychThis Python 3 program outputs a list of all pathnames in the filesystem that match a list of rules taken from a file. You can add and remove sets of pathnames. The original purpose was to generate lists of pathnames to feed to cpio for backups. A simplified version of one of my backup rulefiles ...

 
if (MyPatientCareReport.eHistory != null && // Check if eHistory field exists
    MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup != null && // Check if group exists
    MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup.Count > 0 && // Make sure items exist
    MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup[0].eHistory12 != null && // Null check
    MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup[0].eHistory12.PN != "8801015") // None reported value (NEMSIS)
^ One of the advantages of Objective-C being fine with sending messages to nil...
If you had such a god-awful looking object chain, you could just do...
 
or, one of the consequences of hoare's billion dollar mistake
 
if (![MyPatientCareReport.eHistory.eHistoryCurrentMedsGroup[0].eHistory12.PN isEqualToString:@"8801015"])
 
Much more elegant
 
Sort of.
You're still chaining a ton of shit together.
I'd still make it into several lines and store whatever .PN returns as a local variable before I even started the if statement.
Especially since that's the first thing he does in the if statement...
 
12:22 AM
i find that having numbers in method/class/whatever names (eHistory12) rings a lot of alarm bells
 
Sometimes, it depends.
 
so does having four dots in a statement ;)
 
haha yep
 
> Now it's hard to suggest what this could look like because I'm not familiar with the problem domain, and a lot of the names here are meaningless to me (eHistory12? is there an eHistory13?).
Oh... that's your answer.
 
I would have guessed it was an object model based on parsed HL7
 
12:26 AM
0
A: Achievements for iOS Game

nhgrifAs I commented, you really should look into using the GameCenter to handle all of your achievements. With that said, here's my thoughts on some of what you are doing. It doesn't ever make sense to ever have more than one DTAchievements instantiated, does it? It also seems a little clunky that ...

 
just realised the proper spelling is "pertinent"
 
12:42 AM
Nice answer @nhgrif too bad I can only UV once
 
> If I remove the status column, it runs very fast; but adding the subquery in the column section delays the query way too much (1.02 min execution)
FROM SACPAN_Establishments est
INNER JOIN SACPAN_EstablishmentActivities eact
    ON est.id = eact.establishment_FK
INNER JOIN SACPAN_ActivityTypes actTypes
    ON eact.activityType_FK = actTypes.code
INNER JOIN SACPAN_Regions reg
    ON est.region_FK = reg.code --
INNER JOIN SACPAN_Municipalities mun
    ON est.municipality_FK = mun.code
INNER JOIN SACPAN_ContactEstablishments ce
    ON ce.establishment_FK = est.id
INNER JOIN SACPAN_Contacts con
    ON ce.contact_FK = con.id
--JOIN SACPAN_Status stat ON stat.id = actTypes.status_FK
I wonder why
 
Is this a question somewhere?
 
Yeah. Found a zombie from last year: codereview.stackexchange.com/questions/23410/…
No answer, no UV (except mine), I think whoever looked at it got disinterested because it's quite big and clunky. It's going down tonight.
 
I feel like performance-related SQL questions are better-asked on DBA..
 
12:55 AM
0
Q: Binary search: first/last/random occurrence

gjdanisI've written some code to "binary search" a list, and return the first occurrence of the target: def bsearch(a, left, right, target, first_or_last = 'first'): """ Use binary search to find the first, last, or random index of target. >>> a = [1,1,1,1,1,1] >>> bsearch(a, 0, le...

 
They would likely disagree, they like "problems" like SO from my experience, especially with this large of a chunk of functional code
 
Hrm. To me, performance issues ARE problems in SQL.
 
Sure. Maybe they're just lazy lol.
But DBA is more centered around, well, what a DBA does, which is server maintenance and such, rather than DDL/DML queries
 
Enhancing query performance is part of server maintenance, is it not...?
By the way, I saw something like this recently at work:
SELECT CASE WHEN @SomeVar = 1 THEN 'Foo' ELSE (CASE WHEN @SomeVar = 2 THEN 'Bar' ELSE (CASE WHEN @SomeVar = 3 THEN 'Bazz' ELSE (CASE WHEN @SomeVar = 4 THEN 'Guck' ELSE NULL))) AS SomeColumnName
If it's hard to tell.. that does the same as this:
SELECT CASE @SomeVar
	WHEN 1 THEN 'Foo'
	WHEN 2 THEN 'Bar'
	WHEN 3 THEN 'Bazz'
	WHEN 4 THEN 'Guck'
	ELSE NULL
END AS SomeColumnName
 
Actually it is not really... or not specifically anyways... if you look at the questions on DBA you will find they are quite different from what you expect to see on CR or SO
Nested CASE statements, that's weird
 
1:02 AM
It's not super weird. They're needed sometimes.
But when ever case is using the same variable, it's dumb.
 
^that
 
Well, I'm not sure whether they're ever needed, but they're sometimes not the worst
like SELECT CASE @SomeVar WHEN 1 THEN CASE @OtherVar WHEN 1 THEN 'Foo' ELSE 'Bar' END WHEN 2 THEN 'Bazz' ELSE NULL END
which can easily be rewritten as:
SELECT CASE WHEN @SomeVar = 1 AND @OtherVar = 1 THEN 'Foo' WHEN @SomeVar = 1 THEN 'Bar' ...
 
That Zombie OP... problem is obvious, 3 levels of nesting, all with multiple joins. Funny thing, he's joining all the same tables in the subqueries as he is in his main query
Gotta love his table aliases... est, est1, est2 come on
 
I use single letter aliases a lot.
But actually, we're pretty consistent with out aliases between the 4 programmers, and any new programmers will be taught what aliases mean what
Like, I might write 100 different queries, in all 100 queries, the alias J refers to the same table in all 100 queries. 'I' always refers to the same table, 'E', 'A', 'O' always refer to the same tables.
 
I see short aliases fine for ad-hoc stuff, but any code that will need maintained I think it's wise to make them at least semi-descriptive
 
1:17 AM
Some tables we use two letters, but there are again several of these that always refer to the same table.
These are in stored procedures and views.
But again, it's 100% consistent throughout all of them.
 
Well I guess that works then
 
If the aliases are hampering Mr.Maintainer, then he's not familiar enough with the database and need not touch the query.
 
Fair point. brb
 
1:39 AM
Oh good grief. Do you print a cheat sheet for new hires?
 
I would be tempted to. I guess I imagine a worse-case scenario where new hires would go into a query blind-folded... but even then one could eventually figure out a pattern, would just take longer
 
But why should they have to?
Granted, we do print a cheat sheet, but it's to standardize. Not explain.
 
Well I'll admit you've helped me refine my opinion about alias notation
 
Agreed about performance issues being problems though.
 
0
Q: Parity Bit Generator Webpage

massoverJavaScript concerns Is this the best way in jQuery to handle a button being pressed without making an HTTP req? $("#input-box-form").submit( function(event) { event.preventDefault(); var data = getParityData(); showParityData(data); }); This seems like a mess/redundant/I'm not doi...

 
2:06 AM
Am I right in thinking that there is no noticeable performance gain in using subquery vs. CTE? I think CTEs (except recursive ones) are used mostly for readability, one way or the other SQL has to run it each time it is called... right?
 
2:21 AM
0
Q: MP4 Parser: Reducing code duplication

user3370997I'm developing an MP4 parser. Each class represents each box in MP4 file, and every box class derives from base box class. The problem is that below code is duplicated on every box class: private ulong MyDataSize; public override ulong BoxContentEndOffset { get { return base....

0
Q: Am I breaking Open/Closed Principle with factory method

user3590149I believe I'm implementing a factory method for my DAO. I have three different types of DAO...SQL, Serial, RAM...each have there own subtypes. Would I be better with abstract factory method to allow for close modification and open for extension? Is there better way of having flexible storage D...

 
2:32 AM
I don't know as much as I would like to about CTEs @Phracis. =(
 
@ckuhn203 did you know you can hit tab after hitting a few letters after the @ and automagically complete the name?
But on-topic, I feel pretty certain my friend (very skilled at SQL Server) told me that, was just looking for confirmation :)
 
3:02 AM
0
A: Subquery performance too slow

PhrancisNitpicking I find your table aliases to be difficult to follow. Take this with a grain of salt coming from an outsider to your organization. I find eact, eact3, eact4, etc. to be difficult to follow. Granted, if there is an internal, consistent standard, disregard this part. SELECT DISTINCT Th...

@nhgrif @ckuhn203 @rolfl thoughts?^^
 
3:38 AM
0
Q: Transaction handling for multiple SQL statements

ChathurangaIn this code I update two tables called Payment and SalaryTrans. First I insert records (Salary payments) to Payment table and then I update SalaryTrans table. When records are inserted to Payment table, ID is auto generated (Auto increment column) and then this ID should be updated in SalaryTran...

0
Q: Please help me improving this code that I wrote in Objective C

Hitesh NalamwarI am new to iOS development, I wrote this code but the company said this is bad architecture & it's not acceptable. I Want to improve this code please help me. The code given below: UITabBarController * tab = (UITabBarController *) self.window.rootViewController; UINavigationController * nav =...

 
> Please help me improving this title that I wrote
 
 
1 hour later…
4:48 AM
Sorry @Phrancis. I was playing Robozzle.
 
All good, we all need time away from @CaptainObvious ;)
 
Don't say that. :-( He just wants friends.
 
5:05 AM
morning @all
 
morning @chillworld
is there a way to get hidden code blocks to work?
 
@mjolka what language?
 
stackexchange markdown :)
>! int n = line.length();
does not work
 
link me plz
 
i haven't posted it yet so can't link
but like in any CR editor
 
5:18 AM
maybe you find the enswer you are looking for there
 
@chillworld thanks, but i think the hidden text syntax is specific to stackexchange
and just doesn't mix well with code
 
cause I'm a beginner in editing :)
how do you say it has to be hidden?
 
well it's in answer to this question codereview.stackexchange.com/questions/59645/…
and i thought it would be better for the OP if there wasn't just a chunk of code showing exactly how to do it
but still hidden, so they could check it after they solved it on their own
 
96
Q: Add markdown support for hidden-until-you-click text (aka spoilers)

Joel CoehoornUse cases: Programming puzzles. This way the answer can be posted the same time as the question, eliminating doubt that no answer is possible for hard questions and proving that the question is not a homework exercise (since the author already has the answer) The socratic method. In your answer...

 
@chillworld yeah that's where i found the >! syntax, but code inside that isn't formatted as code
 
5:26 AM
aah maybe put the code tag?
 
i just realised in the accepted answer to that question, they don't seem to be populating the cache :O
 
>! <code>
>!int i = 10;
>!<code>
 
@chillworld thank you! :D
 
Monking @all
 
5:30 AM
monking @Heslacher :)
 
well, I'm testing it but not sure it looks like code
 
0
Q: A simple dictionary tool, extensible with plugins

janosI'm working on a simple dictionary tool, with a base class that can be extended by plugins to represent different dictionaries. The base class does most of the heavy lifting: it keeps the index of all entries in memory, and it handles searching the index. Plugins that extend this class implement ...

 
@mjolka this is the solution :
>! <pre><code>
>! int i = 10;
>! </code></pre>
 
0
Q: optimize code that it changes automaticly the code

TarikI am very happy with the help I am getting here. It seems that I'm almost done with the vba code. Because of my unstructured code (cause of inexperience) I am facing two kinds of problems the first is that the code has to be optimized. Second but foremost I can't figure out how I can make the fol...

 
@CaptainObvious automagicly ?
 
5:39 AM
@Phrancis a generator for code, it exist
@Phrancis off topic?
or an @ckuhn203 question ^^
 
Should we introduce an tag with a link to this question ?
 
@chillworld I was just playing words on the Automagically meme
 
my eyes, they burn
 
oh damn, didn't read that, reading to fast => magicaly I readed from your sentence
@mjolka the fridge can help :p
 
s/magicly/maticly/
 
5:47 AM
@Heslacher well Tarik definitly need more experiance. I'll just hope he get's well formed here cause bad habbit's are difficult to change
 
@CaptainObvious this is a lot of code... perhaps a little tweaking needed?
 
@chillworld I guess he had been told about meaningful variables name
 
I get concerned when I start seeing this "accordeon" pattern...
              End If
            End If
         End If
         '-Gbc end
         '-Mbc START
         '--1B4B START
         If Sheets("tot_list").Cells(a, 7).Value = "1B4B" And blsers = "Mbc" And blsstdperklas = Sheets("StdntKlas").Cells(3, 5).Value And blskoppeling = "" And blsAanwezig = "" Then
            If counterD <= blsstdperklas And DDD = 0 Then
                Sheets("tot_list").Cells(a, 9).Value = blsers
                counterD = counterD + 1
                'Sheets("tot_list").Cells(a, 10).Value = counterD
I think to myself, this may as well be XML...
 
tGbc = n4A4 + n3A4 + n9N4
tMbc = n1B4B + n2A3
tAgd = n1A2B + n2A4
tELE = n3A3 + n3A4
tYeh = n4A4 + 0
trkh = n2E4 + n3E4
tsvh = n1B4C + 0
 
@Phrancis I voted to close.
 
5:52 AM
In other words, Ctrl-C + Ctrl-V is not how you write programs
 
did comment the question why I did
@Phrancis see his first question ;)
 
@chillworld
resultst = n9N4 + n1A2A + n1A2B + n2A2 + n2A3 + n3A3 + n1B4A + n1B4B + n1B4C + n1B4D + n2G4 + n3G4 + n4G4 + n2A4 + n3A4 + n4A4 + n1E3 + n1E4 + n2E4 + n3E3 + n3E4 + n4E4
 
@Phrancis and that so late in the evening :p
 
It's almost 2 AM and I know nothing about VB and I still think this is garbage...
 
5:58 AM
As a guess, it is the result of macro recording
 
I think it's the guy that is succeeded with 50%
but on the other hand, we can help him to improve himself
but it will take time I'm afraid
 
Help yourself, there's a 1000 lines of codes and some potential upvotes waiting for you ;)
 
@Phrancis mhh I'm sticking to Java
 
Maybe the Mug can look at it - he seems to enjoy VBA
(for some reason)
 
I'm guessing ckuhn will answer it, he migrated the first question from SO to here, did a lot to help him and give him a nice "welcome" here.
so, I'm guessing he will see it like a pupil he need to help
 
6:03 AM
I hope so lol.
 
oh damn, already 3 min to late for mine coffee
brb
 
@chillworld I read a bit about Belgium on the wikipedia and the language spread seems interesting
Certainly seems more interesting than USA where I live or Canada where I'm from
I grew up reading Goscinny & Uderzo "Asterix" comics and always enjoyed them :D
 
6:29 AM
0
Q: Find a triplet from three linked lists with sum equal to a given number

JavaDeveloper Given three linked lists, say a, b and c, find one node from each list such that the sum of the values of the nodes is equal to a given number. For example, if the three linked lists are 12->6->29, 23->5->8 and 90->20->59, and the given number is 101, the output should be tripel “6 5 90″. ...

 
@Phrancis you know the smurfs come from belgium also?
and we are the country with the most beers ^^
 
0
Q: Faster way to render xml (10mb) file , loop the content and display output in php

sachin<?php $xml = simplexml_load_file("http://www.example.com/example.xml"); //echo "<pre>"; //print_r($xml); $cnt =0; $customereview=''; foreach($xml->comment as $comment){ if($comment->ProdNid == $productID){ ...

 
6:47 AM
I knew about the beers lol. Smurfs I did not know. But I love Belgian ales
I did grow up on Smurfs as well though they were called "Schtroumpfs"
 
I do love some of them to :) (palm, leffe, stella artois and of course the best cherry beer : liefmans)
indeed, belgium has 3 languages. smurfs are from origin french language
 
0
Q: Ideal & idomatic javascript interface for RESTful API

AmeyI am trying to write an angular service to interface with a RESTful API. For sake of simplicity, lets assume the API is + Company |___+ Department | |____ Person | |____ Person Notice how person can be under Company > Department or directly underCompany. Each of the entities (Company, ...

 
I like Hoegaarden a lot :)
Haven't had the others, besides Stella
 
7:02 AM
For some reason I'm programmers.SE right now... I need sleep
> It's also unlikely that you will ever understand everything in the stack, but that's okay - nobody understands the entire stack used to compute anything today. The human brain is too slow and too valuable to try such a stunt anymore.
 
@Phrancis I can tell you a story about hoegaarden
@Phrancis sleep well
@Phrancis Hoegaarden moved the manufacturing of hoegaarden from Hoegaarden to other place. => beer manufactured at other place wasn't that good.
So they did try to import the water from hoegaarden to the other place => still no effect.
At last they just restarted the factory in hoegaarden cause the sell of hoegaarden became so bad(almost nobody liked it anymore) and now the taste is back allright
 
What was the secret @chillworld ?
On Programmers...
> I haven't figured out a relational database structure FOR date nights with my wife, but I HAVE thought about relational database projects ON date nights with my wife..
 
well, nobody knows (If I knew I would have more money then I do now ^^)
@Phrancis lols
mhh for the 20'est time trying to create a person in min eapplication :)
Had to repair first some faults in the gui => then multiple faults from the model came up :s
 
7:19 AM
delete from [The 2nd Monitor] where UserName = Phrancis
TTGTB
 
Cu phrancis
 
0
Q: Convert a list of sets into the minimum list of non-intersecting sets

Andrew ShepherdI have a list of lists. The same items may appear in multiple lists. I want to break this down into a new list of lists where Each item only appears once in the entire list of lists. For each list in this new list, on every list in the old list, the new list will either be a subset of will not...

 
7:57 AM
0
Q: Locking viewport to the top element on window resize

SylinOn a responsive website where elements may shrink/expand according to the size of your viewport, the elements that was at the top of your viewport at the time may get pushed down/up as the elements above them get squished/expanded. Forcing you to scroll down/up again in order to get to the same a...

 
8:16 AM
0
Q: An If Statement Nested In Switch in Java

ProI'm a beginner to Java and I just built this simple program but the out put keeps coming out as the default case and Netbeans doesn't seem to notice any errors in the code. I will love some help. This is the code: Scanner D = new Scanner (System.in); System.out.println("Enter your Gra...

 
 
2 hours later…
10:32 AM
0
Q: How to replace a 4 char string with only a single char string?

MFJonesI want to know if I can do this: Find "sqrt" in a string Replace "sqrt" with only "#" I have the following code but its not working. How come? size_t found = 0; found = modifiedExpr.find("sqrt"); if(found!=std::string::npos) { modifiedExpr.replace(modifiedExpr.find(sqrt),sqrt.length(),"#...

 
changing code for trying to help but it's valdalism on the code of the OP
 
@chillworld actually It's an attempt to comment IMO. "I like this answer, but it could be better by .." is always worth a comment.
dumb thing is... that guy's not allowed to comment just yet...
50 rep required.
either way ima grab a bite.
 
11:04 AM
smakelijk ^^
 
@CaptainObvious That's off-topic. OP says their code does not work.
 
11:15 AM
0
Q: Fetch details from server

helpI am using this code to fetch some details from server from my android app. How can I improve it ? Here I am also transferring some data from one activity to another. This is how I have written my Fetch_Details class:- public class Fetch_Details extends Activity{ //JSON Node Names pri...

0
Q: PHP validation using preg_match functions

PrakashI need some improvements on my code. I did some validation by preg_match and functions. This is my code: <?php $error=''; if(isset($_POST['submit'])) { if(nameField($_POST['name'])=='') { $error="Invalid Name"; } if(numberField($_POST['phone'])=='') { $error.="<br>Invalid Number"; } if(...

 
@Corbin You should split your answer to my question into two answers.
 
11:35 AM
@ckuhn203 We print a cheat sheet, but it's to help with "status" columns in various different tables and such. Only recently (just before I started) did someone figure out you could leave a note about a column in the database itself.
But you don't need a cheat-sheet for the aliases... the cheat sheet for alias is the FROM clause where you define your aliases...
@Phrancis Generally speaking, there is no performance difference between a CTE and a subquery.
But the enhanced readability of CTEs make it easier to write a more efficient query that performs better. Theoretically, any CTE can be turned into a subquery that performs exactly the same, but it tends to be really confusing to read
 
0
Q: How would I properly use the or function in this case?

Omer Mikhail KhanOn the part where I try to use the len function and the or function I get an error saying: Enter your name here. r Hello, r. My name is Omer. If you solve this integral: 5x^4 + e^x - cos(x); you'll get my number. Would you like to? no Okay then. How about I give you my number in exchange for yo...

 
12:17 PM
@Heslacher Yeah. That.
 
;-)
 
Greetings, Programs.
 
greetings
 
Greetings, @Donald.McLean
 
Monking @all.
 
12:19 PM
Monking
 
I was serious about the bonus points @Heslacher. There will be a bounty for anyone who can tell me what algorithm that is. =)
Thanks for looking at it.
 
I reviewed your question @ckuhn203, one vba question a day is enough
 
That's what I mean. Thanks for looking at my question.
 
@Donald.McLean Greetings, User!
 
@Heslacher Whoever wrote that should be banished to a deserted planet where there are no computers or power.
4
 
12:23 PM
I was "interrupted" yesterday concerning Mazel Tov! ;)
 
@Donald.McLean And no sand! Forbid people writing code in sand.
2
Or paper, or anything
 
If they're going to spend their time scratching meaningless crap in the sand, more power to them.
Though in truth, I'm still not entirely decided on whether or not they deserve a planet with an atmosphere.
2
 
I'm really now wondering whether it is ethical if I ask my employer if I am allowed to "claim" some parts of a project, by in return making it in my own time. Example: A big project that takes months, and I could "claim" a module that checks whether a VAT Number is a correct number (per country codes).
The more I question myself about it, the more I start to doubt
 
@Donald.McLean <shrugs> everyone started somewhere.
 
From my own point of view who had never worked in companies before, it made sense to own the code you worked on (which in reality isn't the case).
But an employer really isn't going to care about 1 or 2 days less time spent on the project, such that someone can "take" his code.
 
12:30 PM
0
Q: Lock-free multiple producer single consumer message queue in C#

glopesFor a while now I've been after a lock-free, simple and scalable implementation of a multiple producer, single consumer queue for delegates in C#. I think I finally have it. I've run basic tests on it showing it works, and the design is so simple that I've managed to convince myself it is rock-so...

 
Do others have any opinion on that?
 
Yeah. It's shit.
I've always wished I owned more of my code.
Thousands of lines of "toolbox" code I can't take with me.
 
I think I do have a serious change to "obtain" my own code, but I'm really doubting whether I should
 
How important is it to you? How hard will it be to rewrite it?
 
Not too hard and neither really important
Just in the former I did spend a bunch of my own time
Nothing really crazy though, a few days maybe
 
12:37 PM
@all new awake's hi there
@ckuhn203 your protege has posted another question
 
It's nothing project-critical though, should I consider pushing them towards open-sourcing those parts?
 
@chillworld This one?
1
Q: Optimizing code that changes other code automatically

TarikI am very happy with the help I am getting here. It seems that I'm almost done with the VBA code. Because of my unstructured code (due to inexperience) I am facing two kinds of problems: The first is that the code has to be optimized. The second, foremost I can't figure out how I can make the...

 
indeed
 
Ain't it nice to get praised on so-meta? (by a 25k user)
> - by somebody with a not inconsiderable amount of reputation and activity on that site -
 
is it me or do it smell here :p
 
12:39 PM
I cringed a bit @chillworld. Hopefully he'll fix up the question.
 
@chillworld just a bit.
 
@skiwi, is it worth making someone you work for angry about it? I don't know them, but I could imagine someone getting pretty butthurt.
 
@ckuhn203 sorry I had to vote to close, but I did try to put the comment as good as I can
 
I would have VTC'd it too if I'd been awake.
 
@ckuhn203 Well yea, probably not, it's not rocket science or anything
I'm just a bit sad to see it rot in private domain, when it could help others
 
12:43 PM
I know that feeling.
 
@skiwi Yeah, I understood you when you pinged me yesterday. :p
 
@skiwi you could "alter" the code and post it to github ;)
code you write @home with the experiance of work is still your code ;)
 
Damn right.
 
you must just see that you don't have a trace to home
So the best is on stick, never email it or publish it directly from work
and refactor the whole thing to your style
I'm deconnecting in 2 weeks mine pc and give it back to the stock
I have right to an I7, they promised me an I7 and the pc what was going to me I'm not getting.
I'm done with it, give back pc, and accept only a i7 back
 
1:01 PM
@kleinfreund Good :)
 
0
Q: Stone Game One Four

invincible Alice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove either one stone or four stones. The player who picks the last stone, wins. They follow the "Ladies First" norm. Hence Alice is always t...

 
@chillworld But then I'm not allowed to reuse any code, right?
@chillworld How do you mean that?
 
@skiwi, you not allowed to copy code
but you can rewrite it @home (so code is always different as at work)
 
Rewriting is ugly...
Hmm the other way
 
or lazy stuff => copy code to usb, refactor it to your style
 
1:04 PM
I could decide to not take my current code to work
 
and when they ask, you writed the code at home
 
Make a Java 8 version at work (very quick)
and finish the Java 6 version at home
 
indeed
 
The code in question has never been to work yet (officially), since I run everything from my own PC :)
Finishing the Java 6 version might take longer than rewriting it from scratch in Java 8
 
voila also solution
 
1:07 PM
0
Q: Recursive method calls to delete files/subdirectories (TPL)

hotleadsingerguyI asked this question on stackoverflow and they suggested asking it here. I used to use the backgroundworker that comes with WinForms but I'm migrating away from it in a few applications because I also want to get rid of the WinForms aspects. This method clears out a specified directory (includin...

 
I'm off to home
 
pfft ;P
 
Monking
 
monking @Malachi
 
0
Q: Php code basic stuff from a novice coder

Josh KirkpatrickHi i have been making a web page in PHP and javascript to take employees clock times and do some things with them so i can display them everything is currently working quite well but the code looks like a dog has had a shite all over it, here it is <html> <meta http-equiv="refresh" conte...

 
1:24 PM
:o I like this
public void testIntBox() {
    Box<int> box = new Box<>();
    box.set(3);
    assertEquals(3, box.get());
    assertEquals("Box${0=I}", box.getClass().getSimpleName());
}
They seemingly got it working in a very very very early alpha prototype version of new project in Java
 
@skiwi Huh?
I get everything except the constructor and that final assert. Shouldn't that new call be new Box<Int>();
 
@Donald.McLean Java 7 onwards has diamond inference
or... what do you mean?
This is a class defined as Box<any T>, and it got specialized to Box<T=int> at runtime, if that makes sense to you
where T=int specialization ensures that the integer-related opcodes are being used, instead of object-related ones
 
My point is that the call to new fails to specify the type specialization. new Box<>() is not the same as Box<Int>() - is it?
 
But the type has already been specified as Box<int> in the declaration
new Box<>() in that context is exactly equal to new Box<int>()
 
When you say "new project in Java" - do you mean some kind of work on the JVM and such?
 
1:34 PM
yes
That Project Valhalla I'm sure I talked earlier about
forgive me if that wasn't clear from start :)
 
0
Q: OP says it works, the contest engine doesn't.

ckuhn203What do we do when OP says his solution works, but the contest engine says it doesn't? Should we give it the benefit of the doubt, as "It works to the best of my knowledge.", or close it as broken code? This is the question that brought me here. OP says it works for the test cases, but is gettin...

 
Ahhh. NOW it makes sense.
Type inference can be useful for reducing the clutter in a program, but it can also get you into serious trouble.
 
Hmm, how?
Java doesn't have any val or auto declaration, so it should never be ambigious?
 
Monking
 
Scala uses type inference quite a bit so people get lazy about specifying types in variable declarations. And then there are converters, if you have an A and try to use it as a B, if there's a converter declared somewhere, the system will use the converter. So you can run into cases where what the converter is doing isn't exactly what you want, and everything goes to heck and you don't know why.
2
 
1:47 PM
Monking @Phrancis.
 
Monking @Phrancis
 
@Donald.McLean Ah I was afraid of that already, I don't really like not declaring types but let the compile figure everything out.
At least not until it can read my mind.
2
 
2:04 PM
@Donald.McLean, you are a room owner somewhere right? At least a moderator
Do you have any clue whether Atom feeds to chat rooms in general work at all?
 
@skiwi I am The Great And All Powerful MODERATOR (on Astronomy and because of the peculiarity of how chat works, all of chat).
@skiwi I don't even know what an Atom feed is.
 
It's a feed, like an RSS feed, but then an Atom feed
 
If that has something to do with chemistry, then you should be talking to my dad.
 
haha, but nope
 
I take it you want to add a feed to a chat room?
 
2:13 PM
0
Q: Atom feed in the chatroom is not working

skiwiWe have got an Atom feed set up in our chatroom, and it is never posting any messages into the chatroom. The Atom feed url is: https://github.com/skiwi2/JavaLuaInteropTest/commits/master.atom We did see that, when adding the feed, it got the five latest entries and parsed them, but after that i...

@Donald.McLean ▲▲
 
@Donald.McLean Yes
 
Ok then. Since I have no clue, I'll let the PTB handle that.
 
0
Q: PHP MySQL page load issue

yamanzandemI just have a general question. I am concerned with the speed of my PHP website, which is set to go into production soon. My concern is the length of time it takes for the page to run a query. On my page, I have about 14 filters in an HTML form. I am using the method GET to retrieve all the val...

 
I don't know whether I should put the chatroom link, I don't want it to be filled up with strangers :)
 
You mean there are people stranger than the ones we already have?
3
 
2:19 PM
:d
Hi
 
@Bhathiya-JaDogg-Perera Good morning.
 
Aye, It's 7PM here, Good Morning to you too
How's the Hubble ?
 
The Hubble is doing fine at the moment.
 
:p
5
Q: Project Euler #2

Bhathiya-JaDogg-PereraProblem: Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be: 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ... By considering the terms in the Fibonacci sequence whose values do not exceed four milli...

@Donald.McLean Do you have any Sri Lankan co-workers there ?
Thanks Santas :d
 
@Bhathiya-JaDogg-Perera Not that I am specifically aware of. We have a number of folks from outside the US though. Lots of Italians, several people from India, and several from Africa. They've been hiring quite a bit lately in the ramp-up to support the JWST and I don't know a lot of those folks.
 
2:31 PM
Is @rolfl in here?
 
:D
@ckuhn203 Hi
 
Hi @Bhathiya-JaDogg-Perera.
 
What did you think about Vocaloid concert ?
 
@ckuhn203 Nope
 
@ckuhn203 Where could he be?
 
2:37 PM
@HassanAlthaf nope. definitely not.
 
Would it be appropriate to migrate that question to SO or no?
 
@Vogel612 what then.?
 
@rolfl requesting vacuum on @HassanAlthaf comment...
 
flag it.
 
@HassanAlthaf ridiculed with orthography mistakes and using a simple concept.
 
2:38 PM
Done. Thanks. I'm never sure about flagging things.
 
aside from that it's PHP, which is a synonym for bad code..
2
 
thanks.
makes it easier from a mod perspective.
 
Not a problem.
 
btw,Where is 200_success ?
 
@ckuhn203 Flag em all, let the mods sort em out!
2
 
2:41 PM
0
Q: please help me with this asap

takuAlice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove either one stone or four stones. The player who picks the last stone, wins. They follow the "Ladies First" norm. Hence Alice is always the ...

 
let SE know we need more mods to handle all the flags!
go to SO and Flag like there is no tomorrow! tons of bad posts there!
 
@CaptainObvious another post?? D:
Oh, Off topic. Yay!
 
@CaptainObvious repeat customer? @rolfl
 
Isn't Captain Obvious a bot ?
 
checking it out.
 
2:45 PM
@CaptainObvious, both have the same homework ;-)
http://stackoverflow.com/questions/25283923/homework-help-in-c-please-provide-a-solution
 
@Bhathiya-JaDogg-Perera just because it is a bot doesn't mean it doesn't have feelings
9
 
-1
Q: Stone Game - One Four

adiAlice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove either one stone or four stones. The player who picks the last stone, wins. They follow the "Ladies First" norm. Hence Alice is always the ...

one more
 
at least the original from invincible had code!
 
Yes, but for 8 stones only Alice can win (optimal played)
 
1
Q: What's Off Topic On 2nd Monitor?

Bhathiya-JaDogg-PereraExactly what is considered strictly off topic there ? Anyone can assume the obvious: NSFW are off topic,and should be flagged. Anything else ?

 
2:54 PM
@Malachi hahahahaha
 
Does anyone know how to give commandline input in IDEOne ?
 
What is NSFW?
 
Not safe for work.
 
Oh ok
 
@ckuhn203 : Thanks
 
2:57 PM
Np @Bhathiya
 
Someone please upvote @Heslacher answer so his much more thorough answer shows before my nitpicking one please
 
@Phrancis I can remove my vote on your answer also ;-)
 
That's totally fine
 
Thanks @Santas
 
00:00 - 15:0015:00 - 00:00

« first day (466 days earlier)      last day (3536 days later) »