« first day (531 days earlier)      last day (3481 days later) » 

6:04 PM
@200_success I'm guilty as well. I will cease immediately. Thanks for pointing that out
 
Wow, so my university just changed the afternoon's exam times without notifying anyone... they're now held 30 minutes earlier
Just got it via an email of the study coordinator, as an addendum
 
@Phrancis nahhh.... chat.stackexchange.com/…
 
@rolfl First I'm thinking @SimonAndréForsberg is posting it a lot... Then I scroll down and only see @rolfl ;)
 
ah, first good ok C# answer in a while..
now back to work :)
 
Sep 26 at 18:15, by Donald.McLean
We seriously need a better Friday meme.
 
6:12 PM
^^ one that's SFW apparently :)
22 mins ago, by TopinFrassi
@SimonAndréForsberg Well, I was in a meeting, opened remote desktop and that was right in front of my screen.. lol
although... 2nd Monitor in a meeting... regardless of content...
 
I didn't expect to need to use remote!
Plus I didn't remember what was on my screen at that moment
But, it was funny
 
@SimonAndréForsberg Yeah, @rolfl got me good! pulled a Rick Roll only with a Rebecca Black Song....UGH! color me embarrassed
anyone else here a Senior Programmer/Analyst? what should I expect (demand) to be paid. (maybe demand is too strong a word for what I am thinking /feeling)
 
0
Q: Is this system to block bots reliable?

StubbornI've got a page which contains a form: when page is requested, a session is stored: $_SESSION['ok']=date("His"); Plus, the form contains this hidden field: <input type="text" name="email-confirm" id="email-confirm" style="display:none;" placeholder="Do not fill this field"> When user sends ...

0
Q: Determine if open and close brackets match in Python

ArtOfWarfareI'm writing a Python method which checks Python code, given as a string, for errors. One of the things I want it to recognize is mismatched brackets, IE, [} would be a problem. To do this, I have a variable called stackTop which contains the most recently found opening bracket, and another one c...

0
Q: Conway's Game of LIfe

ZainI finished my program but I'm slightly confused about the last bit. I want the grid to be updated. Here is my code: mport java.util.Scanner; public class merp { private boolean [][] grid; //private booleans private boolean [][] zgrid; public void printGrid(){ for(int i =...

 
6:56 PM
Seriously, @SimonAndréForsberg, you need to cut that <censored/> right the <censored/> out.
 
7:17 PM
0
Q: Implementation of Vertex Similarity algorithm (Blondel's Similarity Measure)

RyanI am implementing the vertex similarity algorithm in this paper. The adjacency matrices I will be dealing with, however, will be very large, on the order of 30k vertices (I provided sample matrices in the main method). The algorithm is to calculate S(k+1) as an iterative matrix. The algorithm is...

 
@Malachi Too many factors. Pay where I live is higher because of cost-of-living. I have 26 years experience in a wide variety of technologies.
 
@Donald.McLean 26 years really sounds like a lot
Hard to grasp for me when I'm not even that old
 
@Donald.McLean I only have 4 years. but sometimes feel like I should be paid more, for doing things that don't fall under the category of programmer
 
@skiwi That's just my time working as a developer. I have another 6 years in a related technical field.
It's been 38 years since I took my first programming class.
 
I'm in the Northeast US with 11 years experience and the compensation here is quite a bit smaller than it is in some places in the US, but then so is the cost of living (mostly due to snow, and angry Browns fans).
 
7:26 PM
<geezing it up/>
 
@Donald.McLean I see... I'm wondering though if one can have a 26-year long learning curve, as programmers always learn... but is there no end to it?
 
Definitely no end.
 
What about the programming paradigms?
 
@skiwi TL;DR - no. Think about the difference between Java 1 and Java 8. Then add the fact that Java didn't even exist when I started working as a programmer.
2
 
Some I work with love to regale me with tales about how much fun they had with an ASR-33 Teletype (en.wikipedia.org/wiki/Teletype_Model_33)
 
7:28 PM
Better to abstract away from languages, because new ones will always come
 
Even methodologies and best practices change.
Try talking to a die-hard COBOL programmer about interface segregation and Garbage Collection.
 
Hey everyone!
 
I almost got to learn how to program a plug-board computer.
 
@xDaevax They don't even know what Garbage Collection means
I just learned that here in the netherlands they're talking about offering programming classes in elementary school
 
I think one key to always learning is not to be dogmatic about any one practice or language and be willing to try different languages (even if PHP doesn't support method overloading). ;)
 
7:33 PM
@xDaevax Agreed... except COBOL, should we go back to learn that?
 
Depends on your environment. Wouldn't hurt to be familiar if you're at a company that still uses it, but I wouldn't expend a lot of energy (at least if you're focused on your future career).
@Marc-Andre Hello
 
Bonjour @Marc-Andre !
 
1
A: Should we encourage deliberately incomplete answers?

Elias Van OotegemAbsolutely not. Encouraging incomplete answers can easily be mistaken for encouraging answers that just point out a single problem in a snippet of code that is littered with potential issues. This might have the OP believe that his/her code is acceptable, and that he just has to do some minor tw...

 
@xDaevax Hi new in chat or am I just less present ?
Bien le bonjour Mr @Phrancis
 
I suppose relatively new to this room.
Been lurking for a bit
 
7:39 PM
Je n'ai aucune idée de ce que je dis, mais c'est français, @Marc-Andre
5
 
@skiwi Even if you have no idea of what you;re saying it is exactly what you meant !
 
@Marc-Andre Je ne parle pas français
That was hand written, btw
So probably full of grammatical errors ;)
 
Actually it's spotless
 
It's not the most difficult sentence though
 
I took French in high-school, but I have forgotten much.
That was 33 years ago.
 
7:50 PM
@Donald.McLean That tends to happen... After 33 years
But I forgot most if not all after 6 years
 
@skiwi I can say that I was perfect too!
 
0
Q: Function for rendering custom fonts

EdeniaSo. I have a function that converts any normal true-type font to my own font file .bff That function works correct and am not going to post that function for that matter. (also the function is only compatible with a specific engine you may not hear about) Anyway.. if i post the .bff file and you ...

 
It makes sense that human languages, just like programming languages I assume, are forgotten in time if they are not used regularly
 
8:10 PM
0
Q: jQuery hide and show option value from a dropdown

drew578I have form with a add field button that does a ajax call to add a new field. Each field containts a list of options to choose from. When is public is Yes, I need to remove option value = "contacts" and "file upload" from the drop and when the Add field button is clicked. If the is public is no, ...

0
Q: Confusion over using generics in MVC project

archytectWas suggested to look into generics from another thread and being a noob I tried it out and I think I've confused myself a bit. Consider the following. Remote service accepts SecondAction=Search and SecondAction=Update. For SecondAction=Search sending a Query parameter is sufficient enough. For ...

 
Lo, and behold, I have posted *** a question ***!
4
 
@rolfl What's unexpected about it? The range of what's removed? I agree, hence the first main point of my review
 
0
Q: Value Mapper service

Donald.McLeanI have some data I'm getting from an external source that I don't control and have been told that I have to map some of it to "user friendly" display values. So I wrote a little utility service to do this. Populating selectors, I need to convert a list of values. Displaying data records, I have ...

0
Q: Slot machine basic

user56334So I made this amateur slot machine... Anything you think i should change? Or is there any bugs you might be able to find. Or if you can find a way to shrink the code yet get the same result import random print("Welcome to slot_0_machine!") print("Lets play!") cash=100000 end=0 win=0 single_7=10...

 
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

void removeSubstring(char *str, const char *toRemove)
{
	size_t length = strlen(toRemove);
	while((str = strstr(str, toRemove)))
	{
		memmove(str, str + length, 1 + strlen(str + length));
	}
	printf("%s\n", str);
}

int main(void)
{
	char* str = strdup("test this out");

	removeSubstring(str, " this");
	printf("%s\n", str);
}
(null)
test out
Program ended with exit code: 0
Curious results... why is that first one NULL...
 
0
Q: Given a String, return a boolean if it is a number

daydreamerYesterday in an online interview, the interviewer asked me this question: If I give you a string, you have to return if a string is number or not. You are not allowed to use any parse function available. This was my first online interview after a long long time, so I took way too much tim...

 
8:24 PM
Why am I always trying to make things do things they can't do?
 
@RubberDuck spend too much time with the Mug? ;-)
3
 
lol
 
@Phrancis Must be.
 
in VBA, 9 mins ago, by Mat's Mug
Funny, I was thinking of finding a way to use my LinqEnumerable class to generate T-SQL dynamically... sort of like.. LINQ-to-SQL for VBA... I guess I am kind of an insane mug....
 
There seriously has to be some way to have a dynamic number of columns in a BIDS source.
 
8:27 PM
that's VS2008?
 
I can generate a dynamic number of columns in SQL, but I can't get it out.
@Mat'sMug Yeah. 2008R2
 
SSRS?
 
I think the version I'm using is called SSIS. Microsoft's SQL Server team can't seem to sitck to a name.
 
SSRS is Reporting Services; SSIS is Integration Services, and SSAS is Analysis Services :)
they're all dev'd in BIDS (now SSDT)
 
I have this beautfiul sproc that returns a dynamic pivot, but I've no way to export the damn thing because there's no way of knowing what and how many collumns there will be until runtime.
 
8:31 PM
IIRC there's a pivot data flow component you can use
i.e. do the pivot within SSIS, not in your data source
 
I don't think it can handle a dynamic number of columns though.
Worth looking at though.
 
1
A: Dynamic Pivot result into fixed table (SSIS or SQL)

bobsThis is a bit tricky to handle if the calling process doesn't know what the columns are in the results. To insert into a table (permanent or temporary), the number of columns inserted must match the number of columns to insert. Here's how you would insert the results of the SP to a table. Noti...

Maybe this @ducky? ^^
 
Hey @Morwenn
 
@syb0rg You're fast :)
 
I haven't used dynamic SQL much at all because none of my RDBMS support it.
Wish I had access to a MS SQL machine to play with it
 
8:38 PM
@Morwenn On occasion, yeah :p
 
Today, I decided that doing a bunch of asserts was the poor man's testsuite.
 
0
Q: Inserting a NULL value into a SQLite3 DB using Python

user2337529I am just starting out with database programming, so I thought I would write a simple program using SQLite3 and Python. I want to check if there is an etag in the feed's header and if it exists, insert into my database table. If it's not there, insert NULL. I can't get it to work. What am I d...

 
@Morwenn still better than asserting that the code just works ;)
 
@Mat'sMug That's how much of my code currently rolls...
 
@Phrancis No, but thanks. I mean, I could just hardcode it, but I I might not have values for each column on each run. I don't want to include entire columns of nulls... I'll figure something out.
 
8:40 PM
Point is: I search for a good test framework before realizing that there were dozens.
The one I found relies on dirty macro trickery and heavy template wizardry.
I encountered a problem but managed to solve it by dirtifying a little bit more the test framework implementation.
 
@RubberDuck I didn't think a pivot would keep null values, but then again with dynamic I guess you tell it to just select whatever column and it just does it. Dynamic SQL just sounds dirty to me...
Of course, neither RDBMS I use support PIVOT either so I could be wrong
 
Today, I used a... const_cast!
To cast away a const.
 
@Phrancis You have to hard code the columns in a TSQL pivot. I'm looking at this of microsoft's pivot transformation now.
I don't really use the GUI tool much. I do most of my work in TSQL and just use the GUI to execute it.
Looks like you have to hardcode it in SSIS too...
 
8:58 PM
I have a friend that's a freaking genius with all things MS SQL, if you can explain your problem in a way that fits in an email I can run it by him I would bet money that he can find a way to do what you are wanting to do
 
I think I found a way. I just really don't like it. But thanks. If I'm still having issues with it next week I might do that.
 
9:23 PM
STOP MESSING UP MY SPREADSHEETS PEOPLE
 
I'll pimp my 1-score answer since I've just now given it a good makeover.
 
@200_success @Donald.McLean I'm sorry. It was not my intention to "over-do" it. Especially not today. I was just so happy that it was finally <censored />-day, after having spent the whole week staring at Flash banners at work. FWIW, the song makes me happy, and I like it. I guess that's just me around here though.
 
@SimonAndréForsberg No need to apologize. You do realize that your song is #2 on the Ten Most Annoying Songs list, right? :-)
 
You're making Flash? Eww...
 
We evaluated Flash, but fortunately, I was able to talk management out of it.
 
9:37 PM
@Donald.McLean yup, I am aware of that. Honestly, I think there is too much hate on that song. Especially on Miss Black herself. Many people does not seem to be aware of the story behind the song.
 
0
Q: Basic C# calculator (+,-,*,/) for learning purposes, requesting best practice/semantics

happsewMy 'teacher' requested this problem be solved by parsing the input into a tree based on the order of operations. The class Calc variables are specific to his instruction (except precedence) as well as the getValue() method, everything else is subject to review. This is my first real program in C#...

 
@SimonAndréForsberg I don't hate anyone, I just find the song exceedingly annoying. But I sometimes find songs by groups that I like exceedingly annoying too. (Love Rollercoaster cover by the Red Hot Chili Peppers.
 
It's based off of the original code, but performs completely different
 
@Phrancis Yes, I am. Advertisement banners. I was told that it was Flash programming, but it is more Flash make-this-look-the-way-we-want-to-design. It is an awesome place to work at though, and I won't be working every day, so it's nice. And, I get to visit Gothenburg a bit.
 
9:43 PM
Is Flash a central part of your job or more of an occasional project?
 
0
Q: Fastest way of removing a substring from a string

syb0rgTaking a break from my C++ series, I recently reviewed the code in this question. I ended up writing my own separate derivation of the function so that I could remove all of the substrings from a certain string. #include <stdio.h> #include <string.h> #include <time.h> #define NUM_CYCLES 100000...

 
@Phrancis considering it's the only thing I've been doing this week, ummm..... pretty central.
I have been doing some HTML + CSS + JavaScript as well, but Flash has really been the main part.
 
Hah so web design huh. I never pictured you doing much web design for some reason. Glad you enjoy it!
 
@Phrancis I also didn't picture it. I'm definitely not a web designer kind of guy.
Although if there's anything I'm learning from this job, it is that I can probably work with more or less any area that involves using computers that I want to.
If I see myself as definitely not a web designer or a Flash designer, and it turns out that I can handle those things quite well, then what are the limits for what I can do?
 
That's a great attitude!
 
9:52 PM
0
Q: My iPod is slower than my iPad

bazolaMany of the variables in my 2D mining game were declared as constants like so: DWConstants.h static const int kBlockSpriteWidth = 64; static const float kBufferFactor = 2.5; static const int kMaxBlockDamage = 3; This was all well and good for initial testing, but I soon found out that there w...

 
I like web design pretty well, though I haven't done any advanced stuff. Maybe I should consider going more into it, dig into CSS, PHP and JavaScript.
 
@Phrancis I can really recommend especially CSS. JavaScript is useful when you need it.
As for PHP.... well... I think we all know my opinions about that...
 
Updating... brb
 
Well it looks like PHP can do a lot of cool stuff server-side. It's just... a bit clunky-looking ;-)
 
@CaptainObvious For a second, I thought this was an Ask Different question.
 
9:58 PM
@Phrancis PHP can do a lot. And PHP can be a good language to start learning about server-sided development. Just don't get stuck in it!
 
Hahah. I actually kind of like writing it, keeps it challenging
 
By the way, this is a site that I have been involved in building, it got published today: volvocars.com/se/sales-services/sales/fleet-sales/pages/…
 
Hmmm @SimonAndréForsberg IE8 mangled it pretty bad, it tucked everything but the header and footer way over to the right
I'm sure it looks beautiful in a real browser lol.
Well TTGH
 
@Phrancis Hey I was only responsible for making it work in Google Chrome, someone else was responsible for supporting the odd browsers :)
I don't even know if they want the site working in IE8, or if IE9 is the lowest intended supported version of IE.
 
10:16 PM
looks nice @SimonAndréForsberg
 
@bazola Thanks. I guess you're not using IE8 then :)
 
i would rather tear my eyeballs out of my head :)
i finally solved my concurrency problems today, very happy with it now (although the performance Still sucks on the anemic iHardware)
 
Monking
 
-1
Q: Validating Menu Items for an error window and throwing an exception such a case occurs

jhsu91public static void main(String[] args) throws Exception{ File file = new File("C:/Program Files/Selenium/IEDriverServer.exe"); System.setProperty("webdriver.ie.driver", file.getAbsolutePath()); driver.get("http://ap-apbase-d002/Ecx.Web/Account/Login/?ReturnUrl=%2fEcx.Web%2...

0
Q: Hacking up my Texture Atlas

bazolaI have spent quite a bit of time trying to optimize the performance of my 2D mining game. After a lot of research, experimentation, and testing, I finally found something very interesting that improved my performance pretty dramatically when rendering lots of tiles on the screen. Initially I di...

 
@TheFailure Hi, @TheFailure. Noticed you're a new chat user this week. I haven't yet had the pleasure of meeting you. Hello and Welcome to Code Review!
 
10:20 PM
hey @TheFailure, i see you haven't changed your name to something more uplifting yet :)
 
@bazola no idea how...
@SimonAndréForsberg Thanks!
 
@TheFailure go to your profile and click edit
 
Oh, displayname
Hmm
 
0
Q: Make a “Web-Proxy” - Step By Step

padfootI'm asking my question here because of a suggestion. I've asked it "here" before. My problem with links is solved, next challenge is to copy pictures on remote page to my own host, then replace the links in source code. Any idea? Thank you Well, finally I started creating a web proxy. I dec...

0
Q: Implement a Min Heap In clojure

abcI am trying to implement a min heap using either a vector or a map to represent. In the min-heap each node has a value and 0, 1 or 2 children heaps.To add a new value to the heap it is added to the top of the heap. If the heap is empty the new value becomes the root.If heap is not empty then the ...

 
10:37 PM
Sooo
 
@CaptainObvious I guess someone doesn't want weekend homework to do.
 
I have a question
1
Q: Given a String, return a boolean if it is a number

daydreamerYesterday in an online interview, the interviewer asked me this question: If I give you a string, you have to return if a string is number or not. You are not allowed to use any parse function available. This was my first online interview after a long long time, so I took way too much tim...

Says you are not allowed to use a parsefunction
Whats stopping you from taking something that works from
 
@TheFailure I guess the whole idea of the question is that you should re-implement it your way, not look at how it has already been implemented elsewhere.
 
Hmmm
My answer would be look on grepcode ;)
 
@TheFailure that is not really a review of the code though :)
 
10:49 PM
I mean for : If I give you a string, you have to return if a string is number or not. You are not allowed to use any parse function available
 
silly interview question
too bad it's java, because in c# a single-line answer would be !string.IsNullOrEmpty(toTest) && toTest.All(c => c >= '0' && c <= '9');
 
@DanLyons so you consider -21.35 to not be a number?
 
oops, didn't read that far :P
 
'is a number' is more than just 'all characters being 0-9 digits'
 
@janos Why isn't 0xFF9999 a number?
Actually, all Strings would be numbers
 
11:02 PM
NAA of the year:
-1
A: Implementation of Vertex Similarity algorithm (Blondel's Similarity Measure)

RyanThanks for the help! Those suggestions are great.

> Oops sorry I meant it as a comment (on mobile). – Ryan 28 secs ago
TTGTB
 
11:15 PM
Posted my answer
@DanLyons did I beat the silly interview question?
@RubberDuck Hai
 
Hola @TheKittyKat
 
@RubberDuck Was my last answer valid in your opinion?
0
A: Given a String, return a boolean if it is a number

TheKittyKatAs base 10 was not specified as the input this answer applies. Numbers can represented in different bases or radix which means using a base that contains every single character that can be input would allow for any String to be called a number. Take Base 36 for an example, it contains every lett...

 
I think I must be slipping..... slow vote day.
 
Or does it bend the rules a little too much
 
That bends it slightly too much. Typically, if the number is in a non-decimal base, the number has a prefix like 0x
 
11:28 PM
It is valid....
 
What I don't understand is why there's not use of BigDecimal. It's not a 'parse' function.
 
Thats basically the same as taking the actual algorithm off grepcode and saying it is not in a function
Should I remove the answer?
 
try{new BigDecimal(input); return true;} catch (Exception e) {return false;}
Nah, leave it. I looked at the question, decided it was badly specified, so any answer is really valid.
Your answer did not (yet) get my +1, still deciding.
 
Damn ;_)
;)
 
hmm, if the input is.... ???? your answer will return 'true'.
that's not right.
 
11:32 PM
Do I need to add something?
Why?
Oh....
 
0
Q: has_cycle in directed and undirected graphs

user2617521I wrote a program that can tell if a graph has_cycle or not. Can you please suggest more elegant and eloquent ways for this program? (Perhaps better ways to represent a graph with vertices and edges?) def has_cycle(g, directed=False): def dfs(x, entered, exited, tree_edges, back_edges): ...

 
The radix could have already included "."?
@rolfl
 
The question is badly worded, but I think returning true always is... wrong. What about input like ""
 
In europe 1.000.000,95 is a valid number as you write the , and . the other way round
and putting multiple , in a number doesnt change anything
now just multiple ,,,
0
Oh
Lets see
 
I think your code will not return the right result with isNumber("💩 💩 💩 💩 💩 ");
 
11:37 PM
Ok, sorry
I removed it
 
(always wanted to use the unicode "pile of poo" character ;-)
 
Btw, Strings are char[] right
and each char has a numeric value to it
Whats stopping that string of values from being a "Number"?
You can always get the value of the String
 
And, you're right, but there's no point in that speculation... too many what-ifs.
 
Damn
I would have surely got the job ;)
 
11:41 PM
Hey Loki, I got Reversal from the vim proposal... close-post.
+20 answe on a -5 or worse question.
 
I though you were saying that had changed their minds for a second.
@TheKittyKat If you set the local of your application the streams will automatically handle that.
 
@LokiAstari - got my +1, but the second answer using fmod() does C's float have a NaN value?
what is fmod on NaN?
Boss, I'm not satisfied with this answer. Might wait for an expert before accepting. — Slodge Monster Oct 13 at 15:38
And you're the expert?
 
Its NaN any action on NaN results in NaN. Except comparison which always returns false. So NaN will return false on comparison to NaN
 
so the fmod(NaN, 1.0) == 0.0 will be false, so that's OK.
 
Exactly.
 
11:52 PM
Your typos are about as bad as mine.
sutch that:
definately no fractual part
 
Yes. English as a language is so broken; that I don't really care if I abuse it a bit more.
 
Fair enough. My typos are becoming somewhat well known.
I let out my classic one yesterday... I have a habit of mis-timing the spacebar, and end up with things like doe snot... which I repeated again.
 
Thats stupid the same NaN in memory is not equal to itself...
 
It's the 'right thing'. promise
 

« first day (531 days earlier)      last day (3481 days later) »