« first day (558 days earlier)      last day (3462 days later) » 

3:02 PM
Entering main
Hello world
 
... near-infinite loop?
 
> The next release of .NET will enable .NET cloud applications on multiple platforms, with future support of the core .NET server runtime and libraries for Linux and Mac. This implementation will be part of the .NET Foundation, home of the increasing number of .NET components being open sourced.
 
> The next release of .NET will enable .NET cloud applications on multiple platforms .... like, what? Windows 7 and windows 8? or intel and AMD?
We're not talking mac, linux, etc. are we?
 
> with future support of the core .NET server runtime and libraries for Linux and Mac.
 
@rolfl that's the spirit ;)
@Mat'sMug Welcome to the real world.
9
 
3:11 PM
@Mat'sMug How did I miss that in the comment? Crap, I'm tired.
 
I can write PHP and Python in VS2013 if I want
 
Checks calendar... it's not April 1st... Microsoft will offer support for Mac???
4
 
but not Java
 
@Mat'sMug Two wrongs doesn't make a right. PHP and VS2013?
4
 
@Mat'sMug Python maybe, but PHP.........
Hey Phrancis, how would you handle an OR join.
 
3:14 PM
I bet I can write Java in VS2013 too
 
@SimonAndréForsberg I forwarded you the newsletter
 
but the build step is a bit weird...
 
Like, I have a table with two columns. I want to return records where either A or B inner joins.
 
You haven't written Java in the boss way until you've used textpad and javac.
 
it involves opening cmd and javac
 
3:15 PM
@RubberDuck JOIN ON column1 = column2 OR column3 = column4 ?
 
That works??
 
conditional join
 
@Unihedron Uhm, vi... ;-)
 
JOIN ON column1 = column2 OR column1 = column3??
 
I don't see why not
 
3:15 PM
That's awesome.
 
and slower than normal joins
 
Right, so the other option is a Union, right?
 
no
 
@ducky doesn't like typing.
 
because (theoretically) both column1 = column2 and column3 = column4 match
 
3:17 PM
Union should work also, if you don't care too much about ORDER BY
 
and with union you get duplicates
 
Not with UNION, only with UNION ALL.
 
@Pimgd What do you mean?
 
are there any Captchas that are as secure as Google's but easier for people to read?
 
The set of data where column1 = column2 and the set of data where column3 = column4 might overlap
 
3:21 PM
@Pimgd You can probably write it, but you probably can't compile it.
 
0
Q: AngularJS refactoring help needed

MercerHere's my javascript code: var propertiesModule = angular.module('app.properties', []); propertiesModule.controller('PropertiesCtrl', ['$scope', '$routeParams', 'PropertiesService', 'ApplicationService', 'PlatformService', 'Page', function ($scope, $routeParams, PropertiesService, ApplicationSe...

 
Look at that. I managed to write up the tree structure for a mathematical expression on the busride home
all I have to do now is turn it into something genetic
 
like, a DNA tree structure
 
Yeah
No
Sort of
 
generic, or genetic?
 
3:23 PM
I'm creating a genetic algorithm which will allow the user to specify a number, say "30", and the algorithm will generate equations that result in that outcome
but not by brute forcing
Following the genetic programming approach
 
oh, thought it was a typo ;)
 
mutate algorithm by combining it with another, or by mutating a single element in the existing equation
 
@JeroenVannevel that sounds very interesting.
 
and then evolve that towards the target outcome by evaluating it to the fitness function
I'm just following the stuff I read on wikipedia about it, but at least I can now generate a tree structure and it works!
Element ops = new AdditionOperator
{
	LeftElement = new ValueElement(5),
	RightElement = new SubtractionOperator
	{
		LeftElement = new ValueElement(6),
		RightElement = new ValueElement(2)
	}
}; // 5 + (6 - 2)

tree.AddOperations(ops);
Console.WriteLine(tree.GetResult());
Prints out 9, baby
Time to add some generations and a simple mutation to it
I'll put it up for CR once it works
 
3:27 PM
ooooh I like this
 
And I made it nicely modular so I can add other kinds of operators without a problem
So. Kinky.
3
 
> oooooh I like this
> So. Kinky
What's happening here?
 
oh look, a banana!
3
 
@Unihedron hoping to find something a little cheaper than that.....like free, but I like that one
 
3:45 PM
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x6c7be8ee, pid=3384, tid=3056
#
Yay, native code~
it's also not gonna tell you what line did that too
 
in VBA, 1 min ago, by vba4all
@enderland + @Mat'sMug there's a better one - a question posted in their About Me
7
 
OMGOSH
 
4:07 PM
0
Q: Function to replace color in bmp

EdeniaI wrote a function to replace color in a bitmap image. For beginners in image processing, it could be exclusively useful, since they could use it to replace the entire gamma of a color or to replace a color with gradient/abstract lines, following the function's logic. Main problem of the funct...

 
hi
i need help on this
0
Q: Is this interpretation correct on usage of interface?

overexchangeWe have numerous threads talking about the usage of interface vis-a-vis abstract class Taking reference of an answer, given by Prasun looks complete answer to me. Do you think this is complete answer? Please confirm, if my interpretation of this answer looks correct, considering below example....

 
@Mat'sMug That is... HILARIOUS.
 
@overexchange have you considered that they could return "F" and "S2," instead of "F3" and "S2,2"?
That way the burden of counting is placed on the external source
 
is it just me or is this not a CR question??
 
the problems disappear, all you get is "return "F"" and "return "S"+hungerLevel+",""
 
4:13 PM
@Pimgd i considered S2,2
 
0
Q: Improved stack implementation using a linked list

recursivePointerSince my original stack implementation have lots of bugs that I did not noticed, I thought I would recreate it. Please review this version. Note about pointers: I know using std::unique_ptr is better so we don't need to do manual deletes, but when I tried it here it results in disaster. I think ...

 
send request
get HTML page back
that's fine and all, but I wanted a json response...
 
So why ask for HTML if you want JSON? ;-)
 
Because it just does that for some reason
 
Probably because it is a web page, and not a RESTful API?
 
4:21 PM
Open session: OK
Connected with pimtest
Reading value:
{
   "request" : {},
   "response" : {
      "foo" : 50
   }
}

writing value:
{
   "request" : {
      "foo" : 10
   },
   "response" : {}
}

Reading value:
{
   "request" : {},
   "response" : {
      "foo" : 10
   }
}

ending test
Yaaaay~
This concludes my entire workday
It does things!
3
now I need to tack GSON in and then I can read the values too instead of just printing the byte array I get back
 
My code evolves! Somewhat literally!
 
and after that I get to explain why 1 hour tasks take 2 work days
@JeroenVannevel But can it take over the world?
 
@Pimgd Yes it mother fucking can!
I'm not shitting you when I say that was the exact output as soon as you said that
 
It doesn't seem to be self-replicating yet
 
It found the answer to the universe.
In only 15 steps
 
4:27 PM
@JeroenVannevel You have the time for it?
Yesterday you talk about wanting to play with it... and today you already can do it!
 
That's how we do things here in Belgium
 
Damn... and you are copying our Brabant provinces aswell
 
Now all I have to do is clean up the code and show off to my groupmates
 
What is it exactly that you did though?
 
1 hour ago, by Jeroen Vannevel
I'm creating a genetic algorithm which will allow the user to specify a number, say "30", and the algorithm will generate equations that result in that outcome
and downwards
 
4:30 PM
Tomorrow...
I'll make my code do more things!
Yeeees
 
@Pimgd i think this should work
public String toEncode(int sameNeighborCount){
    	String str = "S";
    	if(sameNeighborCount > 1)
    		str.concat(String.valueOf(sameNeighborCount));
    	else{
    		str.concat(String.valueOf(this.hungerLevel));
    		return str;
    	}
    	str.concat(",");
    	str.concat(String.valueOf(this.hungerLevel));
    	return str;
    }
 
@JeroenVannevel Sounds interesting
 
@Pimgd i was concentrating more on whether app is well designed, am sure methods may have bugs but am confident that is not my concern.
i can easily change it
 
@skiwi Once I've cleaned it up and moved away from testcase and towards actual implementation, I'll put it up for CR
probably tonight
 
0
Q: UdpClient C# Receving Message

John Stevenin I am using Microsoft Libraries to create network between devices under the same router. I am using UdpClient, one to send, and one to receive. I have a class called UDPSend which sends, and a class UDPReceive which receives, everything is fine here. The problem comes when, i change the Sending a...

0
Q: Checking if my code is secure. Any Tips?

Hector Hammetti'm deploying a php proyect, and well, i always try to use prepared statements, but unfurtunatelly, GoDaddy does not have the mod mysqlnd which i use it for the function mysqli_stmt_get_result($stmt), so i had to start using mysqli_query in order to use the classic while($row = mysqli_fetch_arra...

 
4:42 PM
@JeroenVannevel Cool!
 
5:00 PM
Should I downvote these other "extra" answers on this question? codereview.stackexchange.com/a/69746/27623
 
@syb0rg I think it would be agood course of action, as far as I know we only allow two answers from the same person if they are competing in some way
All the three snippets there are just completely irrelevant snippets, if you abstract away from that they're posted on the same question
 
Yeah, and I did point him to the meta post about it and he did post another answer even after I made that comment
 
0
Q: Percentage based drop prize on Mob entity kill

user3123545I have created a simple percentage based random prize drop for killing certain mobs. A drop is basically what the player will get in return for killing a mob, as a reward. So I have a large list of Mobs saved in an XML file which looks like this: <?xml version="1.0" encoding="UTF-8"?> <drops>

 
I'm downvoting both newer answers as these could have very easily fit into your first answer to make it more substantive. I would suggest that you edit them into your original answer and then delete the two extra posts. — Phrancis 34 secs ago
 
5:38 PM
0
Q: Can I get around manually resuming a thread in this C++ thread class?

Felix DombekI have inherited a C++ Win32 thread class which roughly works like this. I am looking for ways to improve the design; specifically I am looking for a way to get rid of the spurious Resume() call at the end of initialization. Is there a way this can be automated or omitted? Base class class CTh...

 
Why would I ask for a review if the code works perfectly? Well, in my opinion it is slow, because of the number of operations it has to perform. That number could be reduced by changing the method. Once i heard that fseek is slow. Multiply that by the size of the image.. — Edenia 1 min ago
is she ignoring/misunderstanding what I'm saying
or am I not making any sense
 
@AlexM. Makes sense to me
Though the OP isn't required to do that, and a reviewer could now benchmark the code since it is a compilable snippet of code
 
yeah, I figured it's not against the rules
her solution is absurdly slow, and I was surprised that she did not try to find out why it's so slow by herself
I doubt the hardware she runs it on is that bad
 
If I had the time, I would review it myself. Unfortunately, I have a Matlab midterm in a few hours I'm cramming for
 
anyway, the question attracted my attention because it is a familiar problem
 
5:51 PM
Which makes me wonder why I'm distracting myself on here.... haha
 
I had to do something that applied the same principle to TGA images for the training project when I joined my current workplace
except mine was a distributed system, with the conversion split among clients communicating via TCP/IP
 
@AlexM. Feel free to review it then! Do you have a Mac by the way?
 
nope
 
Oh, never mind then
I was going to say, profiling is a breeze with xcode
 
I am curious to see what speed increase not doing so much I/O would bring her
 
5:53 PM
A lot, I/O operations are usually quite expensive even when buffered
 
with my final solution I was able to convert ~40MB worth of TGAs in much less than a second
 
But reading isn't as bad as writing
 
it was of course parallelized to hell but hey
I hope I'm not remembering the times wrong, hehe
 
Oh, I remembered why I didn't review that user's C code. She uses Window's version of C
BLECH
 
actually, I think that's all perfectly portable C
 
5:55 PM
DWORD isn't portable
 
DWORD is a typedef made by her
 
The code most certainly could be portable though
 
typedef unsigned long dword;
so it's portable
 
Oh, missed that
 
tip: it doesn't include any Windows-specific headers
 
5:56 PM
Why would she typedef that to something that is already reserved by Microsoft...
 
so DWORD couldn't be defined anywhere else
 
I know
But do you have to declare any header's to use an int?
 
what?
 
It's a built in type, exactly
 
I don't follow your reasoning
 
5:57 PM
Windows C compilers look at DWORD as a built in type
 
no they don't
 
I think anyways, last time I used one
That was a long time ago though
Shoot, lunch
 
I doubt you ever used DWORD without including a header file defining it or defining it yourself
 
I'm sure I can scrounge up the source code later
But I have to go now, bye!
 
you'd have to scrounge up the compiler
which is most likely nonstandard
and is probably not made by Microsoft
 
5:58 PM
Probably not
 
also there are no Windows compilers
just Windows distributions for existing compilers
 
Lol, hence my hatred for C on Windows
Okay, actually have to go now
 
C on Windows is the same as C on any other platform if you don't use anything specific to Windows
use standard features only and you're golden
 
The problem with "don't use anything specific to a platform" is that some platform-specific things are not standardized.
 
yes
 
6:02 PM
At least, they standardized a threading API in C11.
 
that's beyond the point though
 
But before that... well, it was pretty platform-specific.
 
"C on Windows" doesn't make sense
"Microsoft's C APIs" or whatever makes more sense
20:00, time for me to head home
yay
 
6:15 PM
0
Q: Security of blog system

James NixonI just want to know if my PHP code is secure and if it's as clean as it can be. I'm trying to make a blog system and I want to make sure all my users information is safe and secure, although this is just an install script. <?php ob_start(); if (isset($_POST['submit'])) { ### SQL INFO CHECK...

 
6:36 PM
0
Q: Calculator using PHP with logging to mysql database

KadInto Hello, i have made a calculator in PHP and i need some feedback in terms of security and peformance. Or any other general improvments! You can download a zip file with all the contents from the link bellow if you wish to try it out for yourself! I rewrote the scource and comments from norw...

 
A calculator with in-built logging... now that sounds fishy
 
0
Q: Slot machine: writing user's name/score to txt file in Java

chosuohaI'm really (really) new to Java, and I'm trying to include a feature in my slot machine program that writes the user's name and score to a txt file so that when the user selects option 2, they can view their scores. I've looked at online tutorials, but I don't even know where to begin with this, ...

 
6:54 PM
hello
 
@skiwi: I'm looking over more parallel tags, starting with this answer edited just now. I don't think I can review any of the other CUDA code, though. I'm still looking at OpenMP now.
 
@Jamal You make me realize that I know nothing about the language extensions for parallelism.
Well, it's not entirely true, I know about Cilk Plus cilk_spawn, cilk_sync, cilk_for and array notations.
 
7:12 PM
I was also surprised to know that there is a .cu extension for CUDA programs in C.
 
Too many things to learn about parallel, concurrent and GPU programming.
 
Very true, though I'm glad to have gotten a basic understanding.
 
I recently learnt about reducers and how they work. That was interesting.
Clever people managed to create many interesting things. It's hard to come up with something that hasn't already been done.
 
@Jamal They're not easy to review either
@Morwenn It's way easier to be "useful" in a parallel sense though than in a linear sense
And wow, that was a real cryptic message there
I mean in the regular linear sense lots of algorithms are explored and improved already, while in the parallel sense there's still loads of things to be done
 
But it's like really hard to get right.
 
7:24 PM
@Phrancis Why is it surprising for Microsoft to make software for the Mac? Microsoft Excel was originally available for Mac OS first.
 
"Internet Explorer for Mac"
 
I was more thinking on development side. They seem quite protective of their technologies (can't really blame them, I guess; that's why it surprised me)
@Morwenn Yuck. Most ironic program ever.
 
Late OpenMP answer here, though it's mostly stylistic stuff. The first answer already mentioned OpenMP specifics.
 
7:40 PM
I just got another answer to my question: codereview.stackexchange.com/a/69771
It does contain some useful suggestions, particularly that this is a solved problem, but it doesn't really review my code.
What should I do about this?
 
You could leave a comment about this, possibly accompanied by a downvote.
4
 
OK.
 
@hosch250 downvote it.
 
0
Q: Dapper Helper Service - Have I made any mistakes?

CountZeroWritten a very light wrapper around dapper to help with unit testing and streamlining the dapper commands I need. Execute is a method created to remove the code duplication of opening and closing the db connection and enlisting it in a transaction. Code is very quick at inserts with this meth...

 
7:56 PM
oh this is cool - @Phrancis did you know that?
69
A: Create a date with T-SQL

Cade RouxSQL Server 2012 has a wonderful and long-awaited new DATEFROMPARTS function (which will raise an error if the date is invalid - my main objection to a DATEADD-based solution to this problem): http://msdn.microsoft.com/en-us/library/hh213228.aspx DATEFROMPARTS(ycolumn, mcolumn, dcolumn) or DA...

True, but you already have pretty good reviews of it. If you want to be pedantic about it, a reasonable review is "don't do that, use BlockingCollection" instead. — breischl 4 mins ago
wow
 
@Mat'sMug PostgreSQL has had that for a while ;)
1
Q: generate date out of multiple columns

speendoI have a (Postgre)SQL table in which dates are stored like this YEAR B-MONTH E-MONTH 2000 01 05 2004 03 06 2010 07 12 2004 01 12 How can I turn these to "real" date fields? I'd like the output to look like this: BEGIN END 20...

^^ from 2011
 
IKR
(+1) and yay, whee, now let's wait another 10 years to get a builtin split-string-by-a-separator table function :D — quetzalcoatl Feb 6 '13 at 12:27
 
But do look at the date/time functions it's got a lot of cool stuff there: postgresql.org/docs/9.1/static/functions-datetime.html
 
@Phrancis do you also know Oracle 11g ?
 
@JaDogg I haven't used it. I hate the Oracle syntax, I've reviewed a few posts and RTFM each time.
 
8:03 PM
oh
 
I've heard it's a very solid RDBMS though.
 
Yaay, [badge:nice question] on my first question!
6
 
@JaDogg in almost all SQL you can do this:
INSERT IN table VALUES
('foo'),
('bar'),
('baz');
 
ok
 
Same thing in Oracle:
INSERT IN table VALUES ('foo');
INSERT IN table VALUES ('bar');
INSERT IN table VALUES ('baz');
 
8:06 PM
lol, not enough syntactic sugars !
 
0
Q: Idiomatic way to implement `tail -f` in clojure

zerkmsDisclaimer: This is just an educational task to learn how to program in clojure and switch brain to immutable state-way of developing (the provided snipped has some unused variables which I didn't clean up since they will be used soon and are easy to understand). The current milestone: to implem...

 
8:22 PM
@hosch250 ([tag : nice-question]) next time ;)
 
8:53 PM
1
Q: Clarification on jQuery global variables in external files and scope

velocirabbitNow that I've used it a lot, I think I'm starting to get the hang of jQuery and its capabilities. One thing I'm still unclear about is how global variables are initiated and used, and when the variable is in reference to a jQuery object, both cases especially in and with external JavaScript files...

 
9:40 PM
@kleinfreund are you around?
 
uh, wut?
 
@Mat'sMug OUCH
 
actually..
in VBA, 4 mins ago, by RubberDuck
user image
 
0
Q: Rename files to all lowercase letters

janosI use this Bash script to rename specified files to all lowercase letters: #!/bin/bash usage() { test $# = 0 || echo "$@" echo "Usage: $0 [OPTION]... FILE..." echo echo "Rename files to all lowercase letters." echo echo " -n, --dry-run Dry run, show what would h...

 
9:59 PM
@JeroenVannevel Any progress with your fun stuff?
 
@SimonAndréForsberg Literally just finished it
Looks like my algorithms can make babies
3
 
Hey peeps.
 
sometimes it'll be stuck in a local loop and fornicate with itself, but eventually they die out when they're alone
 
@janos Yeah, I'm here.
 
They mutate so badly, they can't stay alive
 
10:02 PM
hey @kleinfreund!
 
It's a bloody game
 
Hi!
 
Thanks for the accept, I was just wondering if you're sure you don't want to accept 200's answer instead
I thought it was more useful and mine just added minor stuff
 
Hm, I guess I could do either without worrying too much.
The point about the main function was quite important in my opinion, though.
Also, there'll be more things to review later on.
 
@JeroenVannevel How do you apply your mutations?
 
10:05 PM
@JeroenVannevel I believe that's a common problem in genetic programming.
 
@Morwenn walk through the tree and each node has a chance of mutating. If it's a ValueElement (aka: a number) it will simply generate a new one. If it's an operator it will create a new instance and set the LeftElement and RightElement with the values of the previous operator
I've only implemented binary operators
 
@janos Plus you both have enough internet points. It doesn't really matter. :P
 
There might be some kinds of trees where mutations don't do too many things.
 
@SimonAndréForsberg Yeah, I figure I can easily fix it by wiping the world when there's only one algorithm left but that takes the fun away out of seeing it struggle
I'm not entirely sure if I apply the theory correctly though
right now I kill everyone that isn't within a certain range of the target value
but I feel like just killing off the bottom 10% might be better
 
@JeroenVannevel Are you using any crossover or just pure mutation?
 
10:10 PM
and I start a new population with mutants and children
parents are gone
so not too sure about that either
@SimonAndréForsberg both
 
@JeroenVannevel In generally, you're supposed to have a percntage of chance of dying which increases when the solution is poor.
@JeroenVannevel That allows to keep mostly good solutions, but also to keep some poor ones, just in case.
 
@JeroenVannevel If you haven't seen it, take a look at boxcar2d.com
 
10:26 PM
0
Q: Where equations are born and mutants are burried

Jeroen VannevelI've read up on genetic programming yesterday so I figured I'd try to implement something myself. I would like the main focus to be on whether or not I've implemented the idea behind it correctly. The thought behind it is simple: given a number and a few parameters, generate an equation that y...

 
Awesome title!
 
@Morwenn I see. So where I now have a 100% death chance, I should gradually go from 0% to 100%? And those that are within the acceptable range should stay with a 0% chance?
 
(except for "burried" typo ;)
 
@Phrancis Yo no séo que tú hablas
 
@JeroenVannevel If I remember correctly, nothing is supposed to have a 0% chance of dying. But having many solutions helps with random numbers.
 
10:28 PM
@SimonAndréForsberg that's awesome
@Morwenn Alright, makes sense. Feel free to throw it all in an answer, I'll make sure all substantial answers got some reps
 
2
Q: Where equations are born and mutants are buried

Jeroen VannevelI've read up on genetic programming yesterday so I figured I'd try to implement something myself. I would like the main focus to be on whether or not I've implemented the idea behind it correctly. The thought behind it is simple: given a number and a few parameters, generate an equation that y...

 
@JeroenVannevel I don't think that I will be abe to tell more than what I just explained. I'm not even sure that what I told was correct ^^"
 
@Morwenn Well it sounds correct
which is totally good enough for me
 
I may be mixing genetic agorithms and classifiers.
 
0
A: Consecutive animations

nhgrifWe have some magic numbers. Also, why don't we use modern syntax for our NSNumber objects? NSNumber *opacityFromValue = @0.3f; NSNumber *opacityToValue = @0.0f; CGFloat fadeLoadBarDuration = 0.8; CGFloat fadeCheckmarkDuration = 1.0; CGFloat timeCheckmarkOffset = 0.5; And now use these numbe...

 
10:45 PM
@nhgrif Short but sweet
 
10:59 PM
@JeroenVannevel I tried to answer your question. But in the end, this is a design/algorithmic review more than a code review.
 

« first day (558 days earlier)      last day (3462 days later) »