« first day (294 days earlier)      last day (4021 days later) » 

00:00
FINALLY! Reload!
You could try rule 86, 135 or 149 though, but they're all just variations of rule 30.
I also need a reload, so I will sleep. Good night.
Goodnight!
We're almost to 30 questions a day! I didn't even know we had that many questions a day...
00:20
Revised:
1
A: Bash script - automate an upload image + description process on a server

rolflYour code is so full of irrelevant content that distracts from the purpose of the code. The most Beautiful shell scripts are the ones that do a job, and do it well. They do it in a standard way with the least surprise. They accept input from pipes, redirects, and files, and they output in a way ...

^ @SimonAndréForsberg
@ChrisW: In case you didn't get my latest ping (apparently it was sent after you've already left), I've notified the other mods about your short answer Meta post. They may have something to contribute.
Okay?
Just letting you know.
0
Q: Is this contact form code breaking any rules?

LoaiCan you please review my PHP script below? It is for a contact form. Am I breaking any rules? Does it seem okay to you? <?php session_start(); if ($_SERVER['REQUEST_METHOD'] == 'POST'){ ob_start(); if(isset( $_REQUEST['name'], $_REQUEST['email'], ...

00:40
I had left chat, so your ping went to my Inbox.
Okay. I was never too sure how the regular pinging works when someone is no longer in chat.
Hello, @PeterSouter!
0
Q: Equation Evolution

user37303I'm coding something to simulate evolution, but with an equation that is tested to find the digitsum of an algorithm. Basically what it does is that it creates GENERATION Organisms, which have DNABITS ints, and it performs ((dna[0] & i) / i) + ((dna[1] & i) / i)... and then compares that to t...

01:09
0
Q: Compute bounding rectangle given 2 points quickly and efficiently

Mr. PolywhirlIs there a faster way to compute the bounding area between 2 points? // Minified Version public static Rectangle computeBounds(Point2D.Double p1, Point2D.Double p2) { double dx = p2.x - p1.x, dy = p2.y - p1.y; return new Rectangle((int) (dx < 0 ? p2.x : p1.x), (int) (dy < 0 ? p2....

01:28
0
Q: Optimize Java code that is run length encoding 2d array

user3317808My goal is to save space occupied by 2D array(sea) that has 3 different values Ocean sea;//Ocean class has member 'private int[][] oceanMatrix;' public final static int EMPTY = 1; public final static int SHARK = 2; public final static int FISH = 3; by compressing it and place in two one dime...

02:16
0
Q: Javascript var detect = document.createElement

BlitzCraigI am trying to analyize the following bit of code for the outcomes: var supportsHTML5MP4Video = function (){ var detect = document.createElement('video') || false; if(!detect){ return false; } return typeof detect.canPlayType !== "undefined" && (detect.canPlayType("video/mp4") === "maybe" || det...

 
1 hour later…
03:38
@Jamal Enough issues have been fixed where this could be re-opened.
2
Q: Recursive calculator in C

user2327670This is a calculator I wrote for a student's project. It still has a problem (one that I know of), where it can't handle inputs of the form 2*2*2... (more than one * or / sign). The case 2*2 was solved in hackish ways. I'd appreciate any remarks or advice on the code and possibly how to solve t...

Done
04:08
@Jamal And shot:
0
A: Recursive calculator in C

syb0rgThings you did well on: Organization Use of comments Things that could be improved: Compilation I couldn't compile this program with this method written the way it is. int len(char * p) { return int(strlen(p)); } I'm going to assume that is due to the issues of you compiling it wi...

0
Q: Code review: C OpenSSL PBKDF2-HMAC-SHAx proof of concept

Anti-weakpasswordsI have regrettably been away from C programming for a very long time, so I'd like to get a quick code review of a first proof of concept, before I get too far into adding capabilies, using the getopt library for arguments, alternate output and input character sets, a PolarSSL implementation, and ...

04:41
@StackExchange Not much to improve on you, but I mentioned a few things:
0
A: OpenSSL PBKDF2-HMAC-SHAx proof of concept

syb0rgThings you did well on: Looks like you weren't too rusty based on this code. Looks very nice organizationally. You return different values for different error conditions. Things you could improve on: Standards Initialize i in your for loops.(C99) for (unsigned int i = 0; i < sizeof(diges...

And with that, I'm off to bed. Good night!
Hey... not yet...
You have zombies to vote on ... ;-)
@rolfl I was just looking through some of your newer answers. :P
good, just checking .... as an aside, I feel that voting, in general , has slowed down... people working? or watching the olympics?
I could have to do with the large input of questions, resulting in a larger output of answers.
We have been increasing in questions per day.
I wonder where Mat's Mug is. The answers feed needs updating.
Yeah, anyway, nutcan, you were off to bed.... ;-)
04:46
hey I am only here for a second, but will be back tomorrow
(or is that 'regenerate').
Well, then @Malachi off you go then ;-)
lol
hey is anyone else an AI Committee?
0
Q: What is the Definition of Artificial Intelligence?

MalachiI am a programmer and I think a lot about creating something that will think on it's own. What is the Definition of Artificial Intelligence, if I were to program a modified vehicle to Travel and search for something in a field but return to the charging station and have it charge itself when i...

+1
thank you. there is another question that I posed there as well. I am going to have several more tomorrow
do you work with the AI part of Watson? or just the DB part?
Hmm, that would be a fun site to join: AI beta.
04:54
As you are discovering.... AI is not as clear-cut as you would think.
There is no DB part to watson, not in the traditional sense....
I know that.
you should ask some high level questions @rolfl
The real brains in watson is in the way it is able to interpret natural language content (both the quesitons and the source data), and then there is a lot of really, really smart analytical engines that are applied to the system to give the final results...
are you on AI too?
When you break watson down it is a collection of mathematical functions and algorithms, that, when combined just right, do magic
doesn't watson just translate the spoken word into written word and then match the words in a certain way depending on what words come first or second or last?
04:58
Also, a huge amount of the really, really smart stuff is done while building up the right data in just the right way.... and that happens outside of the question/answer process (there is a lot of pre-processing of things).
sounds like fun, but all that AI stuff has my head hurting so I am going to relax and play some video games for a little bit...lol
2
@Malachi - you don't need $3million in hardware to do that: doesn't watson just translate the spoken word into written word and then match the words in a certain way depending on what words come first or second or last?
I was just playing. I know there is a lot more to it than just that.
I am going to ask a question right up your alley on that site.
what kind of AI does Watson Utilize?
Yeah, and I have said about as much about it as wiki lets me ;-)
what do you mean what wiki lets you?
05:09
Watson is an artificially intelligent computer system capable of answering questions posed in natural language, developed in IBM's DeepQA project by a research team led by principal investigator David Ferrucci. Watson was named after IBM's Thomas J. Watson. The computer system was specifically developed to answer questions on the quiz show Jeopardy!. In 2011, Watson competed on Jeopardy! against former winners Brad Rutter and Ken Jennings. Watson received the first prize of $1 million. Watson had access to 200 million pages of structured and unstructured content consuming four terabytes...
05:57
Maybe sometime all Stack Exchanges will become obsolete, replaced by cheaper, better Watsons.
06:15
I think most of the $3Million worth of hardware is the processors and such and not the Actual algorithms that it takes
@Malachi - Uhm, the 3Mil was purely a projected hardware cost. If you want to talk software, IBM recently announced investing an additional $2Billion.... and that is the software coset to IBM (the time of programmers)
@rolfl I wonder if they need another programmer???
@rolfl remind me tomorrow and i will read through that answer...lol off to bed with me... goodnight everyone
 
2 hours later…
08:23
Good morning. :)
09:00
0
Q: Update PHP function GetSQLValueString

geomoThe old function was : <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue; switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "...

09:43
0
Q: Repository pattern with plain old PHP object

MoonI've been reading a lot about repository patterns these days. At first, the pattern seemed easy. Most of the examples I read over the web use an ORM like below. interface MemberRepositoryInterface { public function find($id); } class MemberRepository implements MemberRepositoryInterface { ...

 
2 hours later…
11:56
Sorry, Simon , but, when @Simon says "do this....", I guess you have to do it, huh?
2
 
1 hour later…
13:11
@rolfl Haha, it depends on what I am saying :P
 
1 hour later…
14:14
0
Q: Create Javascript Config Object String from Clojure Map

erturneI wrote a function to generate a string of javascript code from a clojure map. The idea is to use it in the creation of an HTML response, so that Javascript on a web page has access to the same application configuration as the back end. Is there a better way to do this? (defn javascript-config ...

15:02
0
Q: for loop instead of sleep

nathanin c using sleep would make the program for a short interval of time: sleep(2000);//or whatever the number (in milliseconds) But I really don't want to include unistd.h just to use sleep so I'm doing it this way: for(int i=0; i<=100000000000; i++); <----- note that the loop doesn't do anythi...

15:14
0
Q: How to code imperatively in Haskell efficiently?

DragnoThis is the C++ code of my implementation of Knuth's algorithm M that produces mixed-radix numbers: #include "visit.h" void algorithmM(vector<int>& m) { m.insert(m.begin(),2); const int n=m.size(); vector<int> a(n,0); M2: visit(false,a); int j=n-1; M4: if (a[j]==m[j]-1) {a[j]=0;...

Hi there @200
0
Q: PHP Strategy pattern not working: What Am I doing wrong?

DanielTheRocketManI am a very beginning in PHP and Design Patterns. I have been studying the amazing Head First Design patterns. So, I have been trying to translate the original to PHP. However, I must be doing things very wrong, because it is not working. Can you help me? <?php interface FlyBehavior{ public...

15:47
Just discovered a brilliant windows tool..... I don't normally do 'endorsements', but this one is good if you are running out of disk-space: windirstat.info
16:02
0
Q: Review Chess: First Project

darkryder Hello there :) Code-Source: https://github.com/darkryder/Chess-python I'd made a project using pygame in python around 3 months ago. This was my first big project after I started learning how to program in college. Now I'd like to know just how good my programming syntax and style is. Whethe...

I think I have those features, except the extension list, in Total Commander.
Perhaps, but the pictoral graphic at the bottom half allows you to see big things, and patterns.
If TC has that, then that is the feature that I think is best ;-)
That is what my disk now looks like.... now that I have brought it from 99.8% full back to 75%
The four major blocks at the top are my "User" folder, then s3kr1t stuff, then the blue is the swap/hibernate section, and the red stuff is C:\windows
Interesting, the checkerboard of blue blocks on the right-margin of the top-left big square, are 700 photos... 150 @ 25MB, and 550 @ 5MB. Makes a pretty pattern
16:27
@rolfl I posted another Question on AI
@Malachi - been voting much here?
I helped close that question. I just got up so my Hard Disks haven't spun up to speed yet
16:55
@rolfl Yeah OK, that feature is missing from TC I have to admit :)
17:14
0
Q: Function to return any array of structs

user37327I know there has to be a better and easier way to do what I am trying to do so I’m sorry for my lack of knowledge of programming. I have left comments to explain my thought process. Thank you for your help and input. #include <iostream> #include <vector> using namespace std; struct selection ...

@SimonAndréForsberg Hi
@palacsint Thanks for killing the Voxel one too ... I hate questions requiring esoteric domain-specific knowledge.
But you have managed to cover it just fine.
@200_success Reactions are good today I see :)
17:45
0
Q: Relevant performance difference C#-VB.NET - Recursion vs. Loops

varocarbasWhile performing a detailed testing of different binary search algorithms, I have observed a very curious performance lag between the C# and VB.NET versions (whose codes are virtually identical copies). The most curious thing is that this difference disappeared after carrying out various modifica...

Yay! 2500 views and a badge for my Bejeweled question!
1
Q: Recommended improved match-finding algorithm for Bejeweled game?

JamalI'm trying to determine a sensible method of finding matches of 3, 4, or 5, for each rows and column. The player looks for areas (rows or columns) in the game board where the same "gem" will, after swapping two adjacent pieces (one swap each turn), repeat for 3-5 consecutive spots. Here's an ex...

2.5K views on a +1 score question.... that amazes me....
+3/-2 should I say
+4/-2 should I say
I guess a lot of off-site people find it in search, but don't want to register and try to contribute to it. it just goes to show how important it is to have good titles!
18:01
Yeah, it seems appropriate that the bejeweled question scores a shiny/pretty badge...
2
Re-open candidate needs attention:
1
Q: Is this a good PHP strategy pattern?

DanielTheRocketManI am a very beginning in PHP and Design Patterns. I have been studying the amazing Head First Design patterns. So, I have been trying to translate the original to PHP. The class is working well. However, I would like to ask: Is this considered good PHP? Someone mentioned that this is not a Stra...

A C# answer for a Java question, from a 1-rep user. Just delete it?
0
A: Remove duplicates from string without using additional buffer

Gurunath NavaleI have used C# to code. Duplicates are removed inline public static void removeDuplicate(char[] inpStr) { if (inpStr == null) return; if (inpStr.Length < 2) return; for (int i = 0; i < inpStr.Length; ++i) { int j, k; f...

@Jamal not because it's C# (it would be Java with Lengthlength and Console.WriteLineSystem.out.println). It is however VLQ because it doesn't explain what has been improved
Reopened
@amon: I'll comment on it first, then delete if nothing is changed.
@Jamal great, thanks
18:18
Why the comment-less close-votes?
1
Q: Function to return any array of structs

user37327I know there has to be a better and easier way to do what I am trying to do so I'm sorry for my lack of knowledge of programming. I have left comments to explain my thought process. #include <iostream> #include <vector> using namespace std; struct selection //vector array to tell me what is ...

@rolfl Exactly what I was going to ask!
For someone not experienced in C++, it would be helpful if the close-voter commented on the reason for closing as "not working code"
@rolfl because I couldn't make it run (the close reason would have later expressed that sufficiently). Then again, C++ isn't my area of expertise so I may have screwed up something.
It fails to compile on Ideone. Just a runtime error.
@amon - others ... I see the close-reasons in the close-review queue now.... but ....
After removing the pause.
18:23
I first saw it on the first-question review queue, and those reasons are not there.
Also, if it gets closed without comment, it ends up being flagged... which is a PITA.
yup, that auto-flag is a good reason to add comments when close voting ^^
As Simon says, it is hard for the non-domain-specific people to make a judgement-call unless there is a reason for these things... which means either trying to figure it out for ourselves, or skipping.... neither is satisfactory
Okay, I found the problem. The "what I would like to happen..." part should've been commented out.
I've closed as "not working" for now.
@amon - while you are in here.... I was seriously looking in to your monad-in-java question (but I know little about monads)... it has lead me down an interesting path, and I think that the 'right' solution to the problem is "Java 8".
@rolfl yes, Java 8 would solve the syntax issues around Function<…> and allow some other nice things. But it's far from perfect (e.g. in the treatment of generics)
The solution isn't Java 8, it's Scala
2
18:35
fair point ;-)
still, I'd be very interested in a review – I put my answer in there only to prevent a future zombie
yeah, as I say, I have had to start from scratch on the monad stuff.... so I am having to learn before I review ... it will take a bit.
but, it is an interesting concept, and one I could have used a few years ago for a different (but still active) project, and it has a 'future application' in mind.
18:58
0
Q: The Reve Puzzle

Sc4rI'm trying to solve The Reve Puzzle (trying to get all the disk to the last peg; similar to the towers of hanoi problem.) this is what I've come up with so far. def solve(disk, source, temppeg1, temppeg2, destination): if disk == 1: print((source, destination)) elif disk == 2: ...

0
Q: Ruby: Refactoring a Delimiter

Lucien LachanceIs there a more cleaner approach to this? I'm doing the String calculator Kata posted by Roy Osherove. I generated a string of supported characters I would like to use, if the string passed into my calculator object isn't supported, raise an error. def supported? s = [*(33..46), *(58..64)].map(

19:28
0
Q: Produce bitcoin private key from 31 playing cards. What would make this more useful for other programmers?

githubphagocyteI've written some python code to generate a random hexadecimal string using 31 playing cards drawn without replacement (so no card appears more than once). This is sufficient to provide more than 160 random bits, which is considered sufficient for a bitcoin private key. I'm interested to know wh...

@rolfl Thanks :)
19:50
First answer by new user deserves votes:
1
A: for loop instead of sleep

PeterisThis is called 'busywaiting', and will work but has the following disadvantages: It will perform 'work' on your program instead of yielding control to OS and other programs - so it doesn't "play nice" with others; on a common computer there are many programs running at the same time that could ...

0
Q: Calendar in Python

codyc4321I have a sloppy first program I want to learn how to simplify. DSM suggested using dictionary lookups to simplify complex if statements. I will read about that on my own but any advice would be appreciated of course. Overall how can I make this less sloppy and easier to read? The calendar calcul...

20:16
0
Q: Proper techniques for allowing many views to subscribe to window.unload?

Sean AndersonI would like to execute code for many views whenever the window is unloaded. For instance, I could have something like this in a view's initialize: initialize: function() { $(window).unload(this.stopListening.bind(this)); } I'm wondering if it would be better to have a manager which aggre...

0
Q: Calendar in python (embedded)

codyc4321I have a sloppy first program I want to learn how to simplify. DSM suggested using dictionary lookups to simplify complex if statements. I will read about that on my own but any advice would be appreciated of course. Overall how can I make this less sloppy and easier to read? The calendar calcul...

@palacsint: Killing zombies today, are we? :-)
I am amazed at how much rep you can get on Code Review from just one answer
If that "for-loop vs. sleep" question was on SO, my answer would probably just get one or two votes.
2
20:31
Just another sign that people are finally voting! :D Plus, naturally, it's easier to locate answers. On SO, your answer is just a needle in a haystack.
@Jamal Yes, it seems that there are a quite interesting questions without answers :)
@SimonAndréForsberg A felt the same a few years ago
@palacsint Feel free to kill as many as you can! There are plenty (zombies and badges, that is).
Just stay away from PEuler#2 ;-)
@rolfl What have I missed? :)
I'd vote for those now, but I'm out of ammo. Reload in three and a half hours.
20:35
0
Q: Msbuild batch - if any build fails than skip the last one

StefanI have this batch that builds some projects using msbuild. What I want to do is to skip building my-last.proj if any of the above builds fail: my-proj1.proj to my-proj5.proj using environment variables. I'm sure that there is another cleaner way to do this, but so far I just can't figure it out...

@Jamal this post notification can be removed:
9
A: Python Caesar's Cipher: How could I do it better?

Joran BeasleyPython strings have a translate method that applies a substitution cipher. There is also a function str.maketrans (string.maketrans in Python 2) that helps with building the translation table: >>> from string import ascii_lowercase as alphabet >>> shift = 13 >>> cipher = str.maketrans(alphabet, ...

@SimonAndréForsberg: Looks like you barely posted that answer before amon. Enlightened!
Thanks, Santa!
Done
Some python guru (@200_success?) might want to take a look at this user's answers, some of them have down-votes but I'm not sure if they deserve them or not.
20:39
I believe that's Gareth's department. He has seen one of those answers, it seems.
The sleep question is #2 on the hot list!
Well that explains the up-votes I'm getting...
We surely need them, as well as the traffic. Today otherwise seems like a slow day.
0
Q: Command line reverse polish calculator

Ionut Grt. Write the program expr, which evaluatesa reverse Polish expression from the command line, where each operator or operand is a separate argument. From example expr 2 3 4 + * There are 4 files: calc.c #include <stdio.h> #include <stdlib.h> #include "calc.h" int main(int argc, char *argv[]...

0
Q: Converting SpriteSheet Metadata .txt to .yaml

SoulBeaverFor practice I decided that I wanted to write an animation class for SpriteSheets. The problem is that a single Sprite can have different widths depending on the action they are drawn to act. A tool called Sprite Sheet Packer creates a Map file documenting the index and bounds of each sprite. Thi...

0
Q: Removing list of words from a text file in Ruby

redmaveI have two files. File 1. Has a list of all the dictionary words File 2. Has a list of all prepositions. I want to remove all the prepositions from the dictionary. I want to reduce the number of lines in my code and also make it more elegant, idiomatic and readable. #!/usr/bin/env rub...

20:56
@Jamal Napalmed.
Aww man, I missed a popular C question...
And nothing that I can see to add either :(
Well, you can always add up-votes :)
-1
Q: Create an asp.net MVC model and connect it to a WMS or WFS geo services

CesarDI am trying to create an MVC application and create a Model based in information received from a Web Feature Service or a Web Map Service. I really need to create the model because I want to use the data that I receive in DevExpress components. What I would like to know is if I can create a model...

21:12
Many new questions today, but hardly anyone around to review them! If I were more experienced, I'd answer them myself.
I'm too busy and inexperienced myself... :/
@SimonAndréForsberg Already did ;)
I'd love to finish off the three-tag burnination, but I don't want to push down the new questions.
0
Q: Simplifying an AngularJs directive that counts the number of characters entered in a textarea

balteoI am trying to implement an AngularJs directive that would count the number of characters entered into a textarea and display it to the user. Note: it will actually become much more complex later on and will become a full-fledged component that will be similar to the js component used by Stacko...

Just spent about 4 hours reviewing some Java code....
4
Q: Project Euler "Even Fibonacci numbers" in Java 8

skiwiI'm looking for general advice on my code on the following problem: 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 Fib...

@palacsint ^^^ That ... ;-)
First ... install Java.
Second ... install a new eclipse environment...
Third... learn streams!
Fourth... pretend I am an expert, and review!
3
Fifth... profit?
.....
Oh, Zero'th ... make space on your computer to download things....
For what it's worth, apart from the people I work with who wrote Java8, I am the first person I work with to use Java8 ;-)
21:29
1
Q: Class naming conventions

Thomas JunkI have the following scenario: The (web-) application is built with Java/Spring. I have several REST-endpoints which deliver data prepared to be consumed by a frontend by datatables.net. Each of this endpoint has a somehow similar signature (sEcho, iDisplayStart, iDisplayLength etc.) which are s...

@rolfl And I'll probably be the first to read a Java 8 review on Code Review :)
wtf, 1_000_000 is a number in Java 8? :)
@SimonAndréForsberg yes:)
@rolfl Hm, I finally have a reason to install java 8...
sounds useful. I tend to divide by a billion or a trillion quite often, when converting nanoseconds to seconds for example.
tomorrow... :)
@SimonAndréForsberg: What about TImeUnit?
Yes, I should really get used to using that instead :)
I have been aware of it's existence for a while, I just always keep forgetting it
21:43
@SimonAndréForsberg This downvote was fair. Code is wrong.
-1
A: Append nones to list if is too short

Joran Beasleydef nones(length,mylist): if len(mylist) > length: raise AttributeError('Length error list is too long.') for i in range(length): try: yield mylist[i] except IndexError: yield None print list(nones(20,[1,2,3])) it doesnt exactly match what you described but thi...

@rolfl Spliterators? Seriously? I wonder how long it took for the Java folks to come up with that name.
And... what is a spliterator exactly? Gotta look that up.
And now we have .
@Jamal Should that be synomized?
I cannot determine that myself.
@rolfl What do you think? You answered the a question, should the tag be kept or synonymized?
21:54
First, we need someone with score-5 in Java-8 ... right? ;-)
@syb0rg - we had this discussion a few hours ago.... my opinion is that it is a tag with a 'best-before' date, and should not exist (or it should be a synonym).
In 12 months time the 'domain' will be different, and the tag will be irrelevant.
Also, I am peeved that, if there is going to be a java-8 tag, that I don't get the taxonomist ;-)
Well, it looks like @Jamal has final say: only moderators can propose version specific synonyms.
@rolfl Hey, I already upvoted :P
When Mat's Mug returns, you can ask him.
I can perform any synonymization (and only merges), but this may still require specific knowledge, which I do not have. So, I'll have to be the "judge" in this case.
(or just copy off of SO...)

Java8 discussion

23 hours ago, 11 minutes total – 41 messages, 8 users, 5 stars

Bookmarked 22 secs ago by rolfl

@rolfl That was yesterday, not a few hours ago ;)
Got a pedantic screw too tight in there?
3
22:05
With this question being closed, and then reopened, it didn't receive much attention.
3
A: Recursive calculator in C

syb0rgThings you did well on: Organization Use of comments Using switch statements instead of multiple if-elses. Things that could be improved: Compilation I couldn't compile this program with this method written the way it is. int len(char * p) { return int(strlen(p)); } I'm going to a...

2
Q: AI bot Java dungeon game

Ciaran AshtonI have written a script that allows a user to walk around a dungeon pick up gold and once they have picked it all up they can exit the game through an exit. What I am doing now is writing a bot to do the same. So far I have come up with a 'stupid' bot that is based mainly on randomness. The bot ...

0
Q: Trying to convert an extended Array.prototype to a function

user35295I got a random image rotator working by using the following script (demo). But I was told that it is a bad practice to extend Array.prototype. And it does. It conflicts with the chained select box unless I modify the selected box script. So I guess it's better to not use Array.prototype.shuffle ,...

When I woke up today I really didn't expect any chance to get rep-capped, now there's 1 hour and 45 minutes left and I realize that I'm not that far off...
Nudge-nudge?
Crap you were quick-draw-shot that AI Bot!
@SimonAndréForsberg Is well on his way to hitting the rep-cap today.
@rolfl Fastest review in the west!
As soon as I saw that AI question I just realized it was the perfect question for me :)
22:16
That's what I am doing wrong ... you give a 2 minute review to a sleep question, and get +150 ....
5
I do a 4 hour review ... and get +40
Only because I begged.
There might be things to explain better or things I haven't mentioned in the AI question though.
@SimonAndréForsberg Like these?
0
A: AI bot Java dungeon game

syb0rgA couple notes: You have a lot of if-else statements. if(i == 0){ bot.moveN(); }else if(i == 1){ bot.moveE(); }else if(i == 2){ bot.moveS(); }else if(i == 3){ bot.moveW(); }else{ System.out.println("SOMETHING WENT WRONG!!!"); } Use a switch instead. switch(i) { ca...

Haha, I guess sometimes you just gotta be lucky... FYI, I found your 4 hour review question very helpful.
Just remember that you haven't stopped getting reputation on the 4 hour review yet.
Meh, yeah, that's true, but, in fairness, I'm not going to get much more reputation today anyway ;-)
I haven't gotten any. :-) More mod stuffs to do anyway.
22:21
@syb0rg - get your C-crap out of Java answers ;-)
1-liner declarations are wrong ;-)
That's not good in C, either. I don't think it's good anywhere.
Really? For a small amount of variables in one type I heard it was preferable.
Well I guess I'm wrong here...
I quote:
int foo,  fooarray[]; //WRONG!
Revising answer...
Revised.
Hello @JeffVanzella
22:30
Hi!
Hi!
Now all I need is one good accept.
This one shouldn't be closed as “has to include code” – that has been fixed long before the last CV was given:
1
Q: Relevant performance difference C#-VB.NET - Recursion vs. Loops

varocarbasWhile performing a detailed testing of different binary search algorithms, I have observed a very curious performance lag between the C# and VB.NET versions (whose codes are virtually identical copies). The most curious thing is that this difference disappeared after carrying out various modifica...

not a great question, I still put in a vote to reopen
@amon added my reopen vote
23:03
@SimonAndréForsberg - no you don't .... one slipped through on a no-votes-left day ;-)
@rolfl Now I'm at 216 thanks to an "undownvote" on your bash script answer
Why is that question tagged with php btw?
5
Q: Bash script - automate an upload image + description process on a server

David JordanI was tasked at work to improve a system where through a web interface a client, which eventually became us, uploads a bunch of images with descriptions (latter coming from csv files), the images are then automatically resized yada yada for the site. Nowt wrong with the latter, but the upload a...

good question... there was some PHP in there.... I am sure
Hello @nhgrif
Yes, @SimonAndréForsberg - look at the longest line .... I never mentioned that in my review.
Hi, syb0rg. How's the ObjC coming along?
I'm thinking about starting an iOS TicTacToe project as a practice
23:12
@nhgrif Ultimate Tic-Tac-Toe?
@nhgrif Tic Tac Toe Ultimate, I hope?
What's... ultimate?
And it's coming along fine. The tutorials can be a bit tiresome though.
A movie quote generator isn't the most interesting project.
Ultimate TTT is our current coding challenge
14
Q: Weekend-Challenge Reboot

Mat's MugIn December 2013 we held a bunch of weekly weekend-challenge events, which was fun, and generated posts that made it to the site's newsletter, week after week. One may want to tweak this query so as to filter posts created before December 30th, 2013. Some weekend-challenge stats up to that date:...

23:14
See zomis.net/ttt/TTTWeb.html for one playable version of it
That reminds me, I need to finish up my C version of that...
I fear the "winner" code may be messy in the end.
♭ ♮ ♯ ♩ ♪ ♫ ♬ Ultimate, Ultimate, Ultimate ♭ ♮ ♯ ♩ ♪ ♫ ♬
And I gotta put up my Java code for review soon.
Java8 ?
Nope, just Java 7. Or 6, can't remember :P
23:16
I just played that ultimate tic tac toe, and won.
What I don't understand, how does it determine what square you get to move in?
I'm not entirely happy about my classes though, I started doing some refactoring today but I realized that it wouldn't work very well (i.e. it would introduce some code duplication) so I learned how to use Git's "Reset" feature
@nhgrif that version is crappy, and written by some Swede
@nhgrif Well, if you were playing against an AI, I gotta admit that the AIs still stink for now.
@nhgrif - there are rules, explained in the weekend-challenge
I found a tic tac toe example in a book that teaches php. I am going to work on that and see if I can't do it and then make it look super pretty. this will help me learn PHP and show off my Non existent CSS/HTML skills....lol
23:17
@rolfl Lol, and I assume your unwritten version is better? :)
@SimonAndréForsberg of course, at least it is good enough that I have never been able to beat it, unlike your version
@rolfl You have an AI?
Or you haven't been able to beat it because you have no AI? ;)
The latter ;-)
thought so :)
But I have watson ... ;-)
23:19
lol, that's true. That's pretty much the step above my little UTTT AI :)
Where's the weekend challenge?
So I can see the rules.
I hope to be able to work a bit with my AI in the near future, I gotta apply the things I learned on AI.SE
@nhgrif syborg posted the meta question above
I don't see it. :/
Basically: If you play in the top-left square of any board, your opponent must play somewhere in the top-left board
23:22
If a player is sent to a board that is already won, then the player may play anywhere.
Also, the animation at bejofo.net/ttt might help you understand it better
Player 2 plays in the board that corresponds to the square Player 1 played in. If board == complete, play in any incomplete board.
My next project .... super cool!
How does it know when its run out of ink?
23:25
@nhgrif Meh, who cares ... ;-) ?
@syb0rg timing problem.... let me edit...
@syb0rg congratulations on the 7th .... ;-)
@rolfl Lol with the timing problem, and thanks!
Well syb0rg, if the tutorials aren't interesting enough, you can always start doing your own stuff. You've got the basics down now, right?
Yeah, kinda.
I just need more experience actually using the language.
Not just copying and pasting code snippets from the tutorial and figuring out the logic.
Yeah. So just write your own little mini-apps. Think of a simple app (even if it's something already on the app store a million times) and write that on your own.
One thing I'd suggest practicing, if the tutorials haven't run you through it yet, is UITableView. You pretty much use some form of these in virtually every app.
2
Hmm, I haven't used that yet. I'll look for a tutorial on how to use it and integrate it into an app.
23:39
And I thought tables weren't supposed to be used for layout :)
I don't see how the two are related. :/
A table can be autolayouted.
I'm speaking in HTML terms. @kleinfreund has told me several times that HTML tables shouldn't be used for layout.
Oh. I don't know what an HTML table is. We're talking iOS table views.
I know you are :) I was just trying to make a bad joke.
lol
4
23:52
Hmm. The only hard part about writing an ultimate tic tac toe program (versus ordinary tic tac toe) is the logic for handling where the legal plays are (and that doesn't seem too complicated.
But the logic for checking for a winner on the meta board is identical to the logic for checking the winner on any other board.
But then if you want to make it clean code, without too much code duplication, it becomes significantly harder...
I don't see how.
You'll see if you post your question up for review.
@nhgrif Try writing it in C and you will see how ;)
C isn't OOP.
I'm just getting my project started...
so it'll be sometime before I can post any code
23:59
take your time
But for starters I know I can write a method to check both individual boards and the meta board for a winner.
Yeah, I know. That's the easy part.

« first day (294 days earlier)      last day (4021 days later) »