« first day (258 days earlier)      last day (3766 days later) » 

1:01 PM
@rolfl So far I've improved the speed from 4 rows per second to approximately 10. Not sure how fast they would like to have it though...
@StackExchange Could you please wait with the Java/Android questions until some time when I have time to answer them?
 
1:18 PM
0
Q: Refactoring multistep form rails

LondonI've implemented just as Ryan Bates suggested in his railscast episode, I've got everything working just right, so here is his approach in the controller : def new session[:order_params] ||= {} @order = Order.new(session[:order_params]) @order.current_step = session[:order_step] en...

 
woah 34 new entries in the RSS answers feeds!
'morning! (@SimonAndréForsberg good afternoon!)
 
@retailcoder Afternoon!
@retailcoder don't miss my latest answer!
 
2
A: Trying to avoid developing bad habits early on

JosayOn top of the comments already given : Keep things simple : while (playAgain == true) can be written while (playAgain) if (A) variable=false; else variable=true; can be written variable = !A; Do not repeat yourself : if you deal a lot with user input and checking values, make it a function you...

0
A: How to re-factor this android/java code?

Simon André ForsbergAssuming that setT5RadioGroup only sets a variable within the fragment: In your fragment, use RadioGroup[] radioGroups = new RadioGroup[10]; setTRadioGroup(int number, RadioGroup grp) { this.radioGroups[number] = grp; } In your activity, or whatever it is: for (int i = 0; i < rowids.lengt...

^ out of votes
2
A: Trying to avoid developing bad habits early on

rolflBoth Josay and Max have given great answers. There are two things I would like to add. There is no need to carry the playagain boolean variable. You can simply: do { .... } while (playAgain()); There is a bug in your getObjective() method. You will never generate the 'max' value itself (u...

1
A: Performance of Large BigInteger square root and cube root functions, and excessively large array

Bruno CostaThis is only a form/style review and not algorithm review, as I don't really know what some of your algorithms are supposed to do. There are some changes that I would do in your code. The first one would be replace the while loops for do while loops, and get rid of the flag go. In case of sqrt t...

0
A: How to hide implementation of JDBC while processing large query in client's code?

rolflYour assumption that the entire dataset is read in to memory is not necessarily accurate. The JDBC clients I have worked with (DB2, MS-SQLServer, Sybase, Oracle, etc.) each default to, or have an option to limit the size of the client-side buffer. You only have a small amount of data on the actua...

 
@retailcoder Out of votes already? This answers feed can't be good for your health...
 
lol. it's @200_success's query's fault.
3
A: Clojure - substring? function

ShlomiAs you wrote in your comments, (.contains "str" "sub") is perfectly fine. it is indeed java interop - it runs the method contains on String object "str". two more comments, first, passing str as a var name isnt so good, since str is a function, so you should consider giving it a different name. ...

5
A: Trying to avoid developing bad habits early on

MaxOverall it looks pretty good. A few pointers though... Try to indent your code properly. Most of it looks good but on a few places you have missed an indentation. e.g., do { setMax(); setObjective(); userGuess(); playAgain(); } while (playAgain == true); Don't consume nor fail silently on exc...

1
A: Secure math expressions using PHP eval()

jwgIt looks pretty reasonable to me. A couple of points: You seem to be assuming that a function start with a letter. Functions CAN start with an underscore. Are you sure there is no such function that can be exploited? The regex in the section 'Invalid function calls' seems like it could be simpl...

0
A: MaxSum sub matrix within a matrix

JosayThe begin returned by maxSubArraySub can be wrong as we update start after we've found a good candidate for the maximal sum. This can lead to potential bugs (I am way too lazy to find an actual case where it makes a difference but that should be possible). The solution from http://en.wikipedia.or...

 
1:28 PM
@retailcoder What does the query do, is it returning the answers with 0 votes?
 
exactly. and I tweaked it so I could filter
2
A: Data structure for handling bibtex files

DrarquaI would stop using the print >> sys.stderr and use the logging module. EDIT: Why i suggested the use of the logging module. The reason it is easier to put a timestamp in each message, and when you want to remove log messages, you won’t get them confused for real print() calls.

^^ bad one
0
A: How to improve this current contact form?

LoaiThank you all for your feedback, I have now updated the form, please take a look at let me know if it is secure: Is this secure? Thank you!

^^ NAA
1
A: Inserting using multiple contexts into LocalDB

helgeheldreI'm not sure i understand exactly why you have multiple contexts. If you keep to one context you can do one SaveChanges(). That should save you some time in storing data. Do all your SaveChanges() take equal amount of time? You could add a timer inside the contexts to print out a console mess...

1
A: How should I set a daily method as executed, from inside or from outside?

ChrisWI prefer it if classes manage their own state as much as possible: that makes it difficult to use them incorrectly. For example, in the code above you are able to 'forget' to call SetAsExecuted and can thus write a bug. So if ExecutedToday is a property of Service then it's better if Service ma...

3
A: How should I set a daily method as executed, from inside or from outside?

helgeheldreAs your code stands now it looks to me as if the timer has some responsibilities it shouldent have. My suggestion would be to either move all the timer information to your timer, including bigService.ExecutedToday and SetAsExecuted OR you move all that logic inside the service. I would go for th...

1
A: Proper naming for Time class

200_successI'd name the class TimeOfDay to be absolutely clear about its purpose. Consider adding validation to the constructor (0 ≤ hour ≤ 23 and 0 ≤ minutes ≤ 59). Because before() and after() are predicates, I'd rename them to isBefore(TimeOfDay t) and isAfter(TimeOfDay t). I prefer getHours() over ho...

4
A: Proper naming for Time class

MrSmith42It is a matter of taste, so there is no 'better'. But more common seams to be time.getHours(); because often the conventions of JavaBean are used. If you work in a team, I would discuss the naming conventions to use with them.

The rest are from before midnight (my time)
 
2:17 PM
@tomdemuyt i know you said that the string is supposed to give numbers even thought that isn't in the question, but you still show no love for my answer?
0
A: Coderbyte SimpleSymbols challenge in Javascript

Malachihow about this logic. if the first character or last character is a letter it's false then go through the array and look for the letters skip it if is a = or a + if it isn't a = or a + then check that the character before and after is a + so something like this. var simpleSymbols = func...

25 more days and it's official, I am a Code Review Fanatic
and for those of you who voted on some of my S&I questions on Area51 here is a discussion for you to join in if you like
-1
Q: are we going to let this site die?

MalachiI heard about the previous site being closed. Is there not enough people that would take the time to answer questions? Is there not enough people willing to ask Questions? Is there not enough people willing to research to find answers? Or is it a Definition thing? Like what are good questions ...

 
0
Q: Feedback for Inventory Script (RPG) C#

EmzI was pointed to this direction by a fellow user on stackoverflow. I am trying my best to read tutorials and study ways of optimizing my code, making sure it is ready for expanding. However, I would prefer if a more experienced user could give pointers of how I can optimize and think better when...

 
2:33 PM
0
A: Grouping a CSV by column

Elias Van OotegemOk, before I set of, there are 2 things to keep in mind here: Code review has to be tough, to be good, so if this hurts your feelings - sorry, but I'm trying to help. The second thing is: Please, please, please try to adhere to the coding standards as defined by PHP-FIG (google them). Most, if no...

1
A: Remove Duplication in Select Statement

Andriy MIf this is SQL Server 2005 or later version, you could use CROSS APPLY: SELECT t.amount, a.A, b.B, c.C, d.D FROM atable AS t CROSS APPLY (SELECT t.amount*.1 AS A) AS a CROSS APPLY (SELECT a.A+3 AS B) AS b CROSS APPLY (SELECT b.B/2 AS C) AS c CROSS APPLY (SELECT c....

0
A: How to improve this current contact form?

MalachiTo obscure your E-mail from a spam bot but not from a user I use Google Captcha's, they are really cool. and you can either put a captcha on your input form, or you can put a captcha on your E-mail address Google Recaptcha is the place to go. if Google can't do it right, who can? it's a simp...

0
A: How to improve this current contact form?

Rob Apodaca Use a framework. As already mentioned Using a framework provides so much for free. It provides everything you've not provided in your code above. For example: error/exception handling, markup generation, logging, filters, validators, security...the list is long. Completely remove the javascri...

0
A: jQuery plugin which will print to a printer an element or a jQueryUI Dialog

tomdemuytFrom a once over: I am not a native English speaker but //Element to print HTML confused me, I thought you meant that element would be printed. Maybe //Print button selectors ? settings should be declared next to defaults, otherwise delete settings; is meaningless in destroy elems=$(settings.e...

 
anyone object to me giving @200_success the bounty on that Brainfuck question?
 
0
Q: Optimizing the performance of html5 video manipulation

apaul34208I've been working on an html5 canvas video player with a lot of fun little extras and ui toys, the main one being a chroma key (green screen) effect that allows the user to key out different colors or ranges of color while the video is playing. I seem to have hit a snag in the recommended chrom...

0
Q: Functional Re-Write in Scala: Rows of Strings with a Max Width

David P.I came across an issue the other day where I really just could not think of a functional solution. So I fell back on my imperative programming skills. Since a functional solution still eludes me, I figured I'd shout out for some help here. Use Case I have a List of Strings with arbitrary length...

 
@Malachi I think he deserves it
 
@retailcoder but he already has so much rep..... can't let him hoard it all..... JK
too late it is done
 
We're too bottom-heavy anyway:
1
A: SEDE is up. What now, Wonderland?

retailcoderOccupy Code R3view A while back I had favorited this query for StackOverflow. Now that CR is on the SEDE, I wondered how we'd compare: http://data.stackexchange.com/code%20review%20stack%20exchange/query/160464/how-rich-are-the-1-active-users With this week's data... SO's breakdown is: 27...

Occupy CR | Top 1% users have 17.3% of the rep
 
2:43 PM
I have a solution...... give me more votes.
 
We need to get it up to ~20%
 
definitely needs points and not an array
 
Vote for me!!! Vote for ME!!!
 
@rolfl you have votes to spend still?
 
@rolfl I only pretend to know Java though, and you are always giving high level answers that I don't always understand. but if i do understand I will vote
besides that I need to bump @retailcoder up, @rolfl your score is double his
@retailcoder remind me SRP Single Responsibility principle???
 
2:49 PM
SRP: A voter votes. Just that, that only. An answerer answers, and an asker asks.
 
@retailcoder so that would be a yes
 
asking a question involves several methods, has a dependency on IWriter and IPostSubmitter, but everything about this object revolves around asking a question.
Voter has a dependency on IPostBrowser which takes an IInterestingPostFinder implementation; everything about this object revolves around voting on a post.
@Malachi did I understand your question correctly?
 
@retailcoder not sure.....
 
0
A: Trying to avoid developing bad habits early on

ChrisWOne thing you should know about exceptions is that you don't need to catch them immediately. The reason why code throws an exception in the exception in the first place is that it doesn't know how to handle the exception. Similarly, the one-higher subroutine (for example, your getIntFromUser me...

^ Would someone who knows Java please check whether my syntax and use of JOptionPane is correct?
 
3:04 PM
@rolfl I was voting on your answers and answered one myself. please tell me if I am making sense or if I should go back to work
0
A: Trying to avoid developing bad habits early on

Malachiwith the playagain boolean variable you should set it to false when you create the variable and then the loop can be a simple while(playagain) a lot of people prefer a while loop over a do while loop because you see what the condition is right out of the gate. EDIT: now that I read through the ...

@ChrisW I am not sure about assigning an error to a boolean......I am a little confused
 
@retailcoder what is it?
 
By making an average of the past 3 years' "indexes", and assuming the 1689 votes of Jan2014 will be like 3000 at the end of the month, we should close 2014 with about 34,750 question upvotes. I have a monthly breakdown "forecast".
 
@Malachi I want to display the exceptions's error message string to the user; ask (in the user dialog) the user whether they want to try/play again; return boolean depending on whether the user wants to playAgain.
 
@ChrisW I see it now I was skimming shame on me
 
3:15 PM
3500 votes in January brings the 2014 total answer upvotes projection to 40,542 votes
@Malachi question upvotes per month, per year.
 
@retailcoder oh i gotcha. did you see what we did in the last 3 months of 2013....lol
 
Yeah, isn't that AMAZING!!
 
@retailcoder yes it is
I am going to try a little less Star Smacking today
 
^ RSA
Question+Answer upvotes / month/year
 
RSA? Remind me again please
 
3:19 PM
real star applied :)
 
And I... nah, gotta keep the edit train chugging along.
 
right
@Jamal lol
 
monthly moderator reviews
 
you should label these and make a full report @retailcoder .... or get a life. JK
 
I spent 10 years of my life making these kinds of reports for retailers.
I just replace Sales$ with votes and I can make projections/forecasts :)
 
3:25 PM
I was just joking @retailcoder. lol
 
Hi :)
Aww, I didn't get the bounty :(
Oh well :)
 
Hi!
 
sorry @tim
 
@Malachi It's fine, his was probably better anyway
I still got some rep there.
I'm getting some from my sinusoidal wave (I fixed it)
 
@Timtech what do you mean you fixed it? link me please
 
3:29 PM
@Malachi Okay
 
I didn't see anything wrong with it. was it broken?
 
Just a sec, I had to get Amplitude to 20 exactly.
AFK
 
I found your answer on another question. it was the only question I had a favorite on
@Timtech I found it, but they say it is still against the rules because of that DrawInv. I think it is kind of on the line. does it draw a graph or is it on the console? can you show screenshots on an emulator that prove you are doing ASCII and not Graphing?
 
user image
2
Total: ~60K votes
Based on average %monthly contribution to total for 2011-2013, assumes January current total is 50% of the month's votes
Now I need to work
Or get a life
:p
 
I'm back
What?
Screenshots are iffy because it's a school calculator.
 
3:39 PM
@Timtech can't you use GTB?
 
Yeah, I think I should
I wanted to make it sound legit and not be like 10 chars though
 
isn't GTB the same as TI-BASIC?
 
Yea
But a lot shorter
And it'll be like <10 chars
 
sorry I was thinking they were the same thing.
I would make that an additional answer i think
 
They are
Kind of not
I will make it now
0
A: Print a sinusoidal wave (vertically)

TimtechGTB, 14 Executed from a TI-84 calculator [i;2.9sin(Xc;] Amplitude = 20, Period = 62, Pause = ~50

 
3:47 PM
0
A: "Guess a number" game

Malachiwith the playagain boolean variable you should set it to false when you create the variable and then the loop can be a simple while(playagain) a lot of people prefer a while loop over a do while loop because you see what the condition is right out of the gate. EDIT: now that I read through the ...

1
A: "Guess a number" game

ChrisWOne thing you should know about exceptions is that you don't need to catch them immediately. The reason why code throws an exception in the exception in the first place is that it doesn't know how to handle the exception. Similarly, the one-higher subroutine (for example, your getIntFromUser me...

0
A: Classical inheritance in JavaScript

Elias Van OotegemHang on a tick... there is a problem here that, weirdly nobody has noticed. I will admit that this is hardly ever used, but still: In a normal JS prototypal inheritance scenario, you would be able to pull stunts like these: var Animal = (function() { function Animal() { this.nam...

4
A: Random number game

jliv902 Remove these the inclusion of <stdlib.h> and <string>. You never use them. Use a consistent naming convention for variables. You have 3 different naming conventions being used: xRan choicei Array If you're working by yourself, pick one and stick to it. If you're working on a larger project, us...

1
A: Improving speed of moving average calculation

svickSkip() is not optimized for IList<T>, it always enumerates the skipped elements. This means that your algorithm is O(n2) for no good reason. What you should do instead is to manually iterate just the required part of the input in each iteration using for. Something like: double sum = 0; for (int...

0
A: "Guess a number" game

TheMathemagicianTo throw you in at the deep end it would be good to start thinking more about an object-oriented design for your classes and interfaces. Think about re-usability of your code and how can encapsulate just enough useful behaviour in a class while keeping it as general as possible. Let's say it bec...

8
A: "Guess a number" game

JosayOn top of the comments already given : Keep things simple : while (playAgain == true) can be written while (playAgain) if (A) variable=false; else variable=true; can be written variable = !A; Do not repeat yourself : if you deal a lot with user input and checking values, make it a function you...

2
A: Display progress bar to show async. request status using JQuery

PlantTheIdeaRealizing that you are trying to make reusable code, I figured I would share my methodology, as I believe it will extend your structure here. I like to wrap everything into an object with functions appropriate to AJAX, and I added in your .overlay components: var ajax = { showProgressBa...

 
OK, what have I missed ?
 
4:19 PM
@Timtech check out my comments on the C# Sinusoidal I can't downvote I don't have any rep
 
What ok?
I'm doing work though I might not be on some minutes
 
@Timtech my first post on Code Golf, please give me some pointers if you have them. especially if you know C#
0
A: Print a sinusoidal wave (vertically)

MalachiC# [152] Characters namespace System{class P{static void Main(){for(var i=0d;;){Console.Write("{0,"+(int)(40+20*Math.Sin(i+=.1))+"}\n",'|');Threading.Thread.Sleep(50);}}}} I could not get the Existing C# answer to Run and I couldn't downvote because I don't have enough Reputation it was miss...

 
@Malachi Okay, I don't but still :)
 
0
Q: Python Hangman feedback

Jeff GohlkeJust looking for some feedback on a hangman script. It works perfectly fine; I'm just trying to master the Python language, and the best place way to get better is to ask the true masters! Thanks in advance for any advice. import random UNKNOWN_CHARACTER = "*" GUESS_LIMIT = 7 words = [] def...

 
i will have to start doing some Python and stuff like that. @retailcoder I didn't see any VB.net answers
 
4:27 PM
0
A: Inventory Script (RPG) in C#

Bruno CostaFirst things first. I don't see a reason for why you didn't include a quantity property in your Item class. That being said I will review the code without that property in Item to be more similar to yours. I also think that you made a mistake in your Constructor. You probably would want to write:...

@Malachi should there have been a VB.NET answer somewhere?
 
@retailcoder too late I am working on one right now
@retailcoder code golf
 
Gtg review stuff. Bye!
IRL review :)
 
@retailcoder how do I make an infinite for loop in VB? like for(var i=0::) but for VB?
Nevermind I figured out I just do a negative number and then step positive
 
4:45 PM
Home sweet home, weekend sweet weekend!
 
@retailcoder, what is this called "Console.Write("{0,3}",'|');" I am trying to translate straight to VB
 
I'm not sure, but I think the string.Format() notation is C#-specific. Are {0} placeholders allowed in VB?
it outputs "'|'" and ensures that's at least 3 characters. In other words, the ",3" part is useless. I think (tested off my VB6 implementation of StringFormat, so that's not C#).
 
I figured it out I was using an apostrophe around the pipe instead of quotes
 
@retailcoder .NET specific, presumably: System.Console.Write is a framework API. Perhaps @Malachi is asking about VB.NET, not VB.NET.
about VB.NET, not VB.NET VB.
 
????
how do I do a "for i as decimal = 0 to infinity step .1"?
 
4:57 PM
or while(true)?
 
I want to step my variable.
this is what I came up with
Dim x As Decimal = 1
For i As Decimal = 0 To (x = x + i) Step 0.1
Console.Write("{0," & (40 + 20 * Math.Sin(i = i + 0.1)) & "}/n", "|")
Threading.Thread.Sleep(50)
Next
doesn't work
 
how about step 1 and divide the counter by 10 inside the loop?
 
I am trying to make it short. I am golfing....lol
 
We're at the very top of the Hot Questions list!!!
I've now just realized something. I think the "not working" close reason should no longer include Stack Overflow. For instance, if a crap question is closed with this, we'll essentially be telling someone to post crap over there. If this sounds good, it can be proposed on Meta.
 
5:18 PM
figured out what I was doing wrong
now the code is
    Module Module1
        Sub Main()
            Dim i
            While True
                Console.WriteLine("{0:" & (40 + 20 * Math.Sin(i = i + 0.1)) & "}", "|")
                Threading.Thread.Sleep(50)
            End While
        End Sub
    End Module
0
A: Print a sinusoidal wave (vertically)

MalachiVB [236] not sure how you would count the tabs, I just took the count from Notepadd++ before I pasted here. newlines are mandatory, probably why no one likes using it for code golfing. Module Module1 Sub Main() Dim i While True Console.WriteLine("{0:" & (40 +...

is indentation mandatory in VB? @retailcoder
 
Some "not working" questions might be "how do I..." or "this API doesn't work..." for which SO May be appropriate.
 
@Malachi Not with such glorious keywords like End While. (It escapes me how anyone could believe that such a language design would be better) .
 
"For questions regarding specific problems encountered while coding, try Stack Overflow." sounds ok for SO.
 
I know that it is best for SO. Then again, I suppose the "crap" issue doesn't quite apply since no migration is involved.
 
Yes, don't migrate it.
 
5:30 PM
so could I do away with some of the new lines in that VB code I posted @amon?
 
No, I'm not migrating it. I meant that closing and migrating, in general, may be different with regards to "crap." But anyway, scratch that idea.
 
@Malachi This is Code Review, not Code Golf. Your assignment-as-expression is bad enough.
 
@amon I know I shouldn't code golf here. but @Timtech Did it to me
 
0
Q: Performance Issue on css and javascript styling

advinerI make some ui custom controls. Typically my controls have themes to them so it can be changed. I dont use css files for each themes. What I do instead is hava a javascript file that contains the different themes for that particular control. Example of my button control (Note i took the rest o...

 
5:56 PM
Just thought I would mention that this answer has been vastly improved .... ;-)
0
A: Is this contact form secure?

t1gorThe form seems to be OK, but mixing all of the code in one file is not a best-practice. UPDATE Some tips on code separation: I would suggest using any template system for html/php code separation. For example Smarty. Also, it would be easier for you to maintain your code if you follow the MV...

 
Done.
 
0
Q: Creating buttons in one class, adding them from another?

Friar BobIs it possible to create buttons in one class, and then add them to another which contains the panel and add action listeners from there? What I would like to do is something like: public class Buttons { private JButton buttonOne; private Graphics g; public ...

 
6:11 PM
@Jamal ^ For questions like this one, do you prefer a flag, or a vote to close, or both?
 
@ChrisW: With close vote privileges, you can only vote to close. A custom flag is also not needed unless something else requires moderator attention.
 
I flagged one earlier today as well as VTC because people were trying to answer it: "better to close it quickly", I thought.
 
0
Q: Music list program

Oliver BakAs the title suggests, I need a little help to improve my first Java program. I have programmed for about a month, so my code is quite messy.. The program is a "Musiclist" program, which you can add songs, edit songs, and remove songs from the list. The program uses 2 arraylists, to store the in...

 
That's understandable. Sometimes either not enough closers are around, or it doesn't seem clear that a question should be closed. If such questions still get answers, that's fine. It can still be migrated if it's not crap.
 
6:30 PM
0
Q: testing to see if tree is BST

LiondancerI found a function online that tests if a tree is a Binary Search Tree code: private boolean isBST(Node node) { if (node==null) return(true); // do the subtrees contain values that do not // agree with the node? if (node.left!=null && maxValue(node.left) > node.data) return(false); ...

 
people don't like my edits over on SO
 
hello, back from lunch. did I miss anything?
1
A: Inventory Script (RPG) in C#

Acaz SouzaWhy use inventory[i].item every time? For performance cache this: var x = inventory[i].item;

^^ comment?
0
A: PDO Login/Register system review

t1gorHere are several tips: Use OOP. This way you could start the session only once. Hash your passwords - this way no-one can steal it from the db. At least the chance is lower. Use MVC - separate your html from the php code. Move your db connect credentails to the .ini file - this way it could b...

2
A: Is this contact form secure?

SilverlightFoxNo, I've noticed several issues. Make sure the stuff in assets/includes/ isn't world readable. e.g. is it possible to view this code by going to www.example.com/assets/includes/second-header.inc (substituting in your domain name of course)? Also, don't use rand() to generate tokens for secure ...

1
A: Using a singleton class to get and set program wide settings

cHaoThere should be something about a Singleton class that requires that it allow and present a single, globally available, instance. Otherwise, the pattern is being misused. The way your class is built, there's not really such a reason. You could have any number of instances, and they'd all work ...

0
A: Efficiently way of having synchronous and asynchronous behavior in an application

PatrickThis looks good. A synchronous call is always an async call plus a wait for the result. To make that clear, execute() should probably call executeAsync() instead of getHandle()

1
A: Is this contact form secure?

t1gorThe form seems to be OK, but mixing all of the code in one file is not a best-practice. UPDATE Some tips on code separation: I would suggest using any template system for html/php code separation. For example Smarty. Also, it would be easier for you to maintain your code if you follow the MV...

0
A: Python Hangman feedback

JosayList comprehension is a very neat way to construct lists in Python. For instance : stripped = [] for word in words: stripped.append(word.strip()) becomes stripped = [word.strip for words in word] (and then you can get rid of the stripped variable altogether in your code). The pythoni...

^^ nice answer
0
A: Review of my PHP Wrapper around Third Party Soap API

t1gorHere are some tips for your class: For the lines like the following, I suggest applying different formatting (to make it more readable). Please see below: $arguments = array_merge(array('UserName' => $this->username, 'Password' => $this->password), $arguments); to this $arguments = array_mer...

1
A: How clean is this mustache template for a listing page?

cimmanonBy using excessive markup for presentational purposes, the template is the exact opposite of clean. <span><i class="fa fa-phone"></i></span><span>{{{telefon}}}</span><br /> vs. <span class="fa fa-phone">{{{telefon}}}</span> <!-- span set to `display: block` with a `:before` pseudo element to ...

1
A: Generating Even Random Numbers

PatrickPerhaps a higher-level approach may get you to a better solution. The random generator methods (generateRandomEvenNumber() and evenNumber()) are mathematical in nature and really not specific to the game. They have no dependencies on the game class (e.g. they don't use fields) and they have no ...

 
i think that we should upvote this question @retailcoder
0
Q: R - function simplification and optimization

crysis405What the function does is finds the primes in list1 and converts them to their equivalent a (i.e. 2 would be a2 which is 1,1). Then it takes the !NULL in list2 and searches if it is present in the converted list1 (converted to a list of two of 1,2,3, or 4). Finally it returns a logical list of tr...

 
Out of ammo
 
it's on SO
it's one that was closed here. they said it was suggested they come here.
 
6:44 PM
@Malachi (re: no love ), I hate to say it, but your code does not do what you say as far as I can tell ( it does not check the last line ) and it is not KISS
 
@tomdemuyt that is supposed to be in the first if statement, I forgot to type it out.....lol it got stuck in the buffer
 
;]
 
I was thinking I could do something like
((s[0] != "+" && s[0] != "=") || (s[s.length] != "+" && s[s.Length] != "="))
@tomdemuyt but I wasn't sure it would work or not in Java or C# for that matter
I fixed it too btw
 
@Malachi it would be s[s.length-1]
@Malachi but, I am not sure why you think the loop checks the first/last character twice ?
 
dang it you are right I have to change a couple of other things.
 
6:50 PM
but, splutter
you are going down the path of premature optimization
already your idea is taking half of the code
you save altogether 4 array element checks, by adding 4 array element checks
2
and doubling the code
 
even if it doesn't check the first and last character twice it will error out when it hits the first character and the last character in the string. index exception
 
ah!
that is why js is awesome
no exceptions, it returns undefined
so js can check s[-1]
 
plus my code won't have to check stuff if it fails right away. so it saves on computations.
even though this is a small program
 
but @Malachi, how many computations does it save really ?
no it does not
return false if the first character is wrong
 
i meant to erase that...lol
 
6:55 PM
too late ;)
 
I am going back and forth right now
the code runs all those if statements that it doesn't have to.
 
which are all those ?
plus your code enforces 2 if's as well
 
2 ifs at the least.
 
4 ifs
because you use and
no, 2 ifs
 
OPs does 10 by that logic
at the least
OP has 4 && in their IF statement.
then 10 on the next character
oh it is Javascript huh
 
6:58 PM
yep ;)
 
bad coding practice.... ;)
 
that is, to code in JavaScript ? ;)
 
to check an index out of range
 
not if you thought about it, if this was production code it could warrant a comment that I did think about out of bounds
hmmm, your code still has something funny : ponder on this : for (var i = 1; i<s.Length; i++) {
 
my code at the least (if it makes it to the inner loop and then fails) processes 14 if statements.
@tomdemuyt thought I changed that
 
7:01 PM
I sent this in an email to the author(s) of the shit code I've spent all week in:
There were millions of issues ranging from very minor to extremely serious with this code:

• XAML markup with nothing but absolute positioning defeated the purpose of WPF and XAML, and prevented any [easy] modification of the UI; positioning of elements made no sense at all.
• Instance-level database connection and other disposable objects are created once and recycled 200+ times, and never closed, never disposed.
• Single Responsibility Principle is taking a serious beating, with all the logic tucked in the control’s code-behind. 70%+ of all this boilerplate code could be eliminated with
Felt like sharing
 
@tomdemuyt I did it now says s.length-1
 
0
A: Music list program

Robert BeltranUI code is usually kinda "messy" you could separate out the ActionListeners to new files if you want. Also I'd probably put Artist and Song Title into a class like public class SongData { private String artist; private String title; public SongData( String title, String artist ) { ...

^^ first post?
 
@retailcoder you trying to change the subjecT?
 
I like this!
42
Q: Tool for peer-reviewed no-bump mass retagging

Mad ScientistCleaning up a bad or ambiguous tag is a very annoying and disruptive process. While there are moderator tools for renaming and merging tags, there is no tool that helps splitting a tag or removing a bad tag and replacing it with useful tags. There are two ways one can currently clean up a tag, p...

 
Me too!
@Malachi a little
but that answer was just sitting there in my outlook RSS feeds, unread.
 
7:14 PM
I have now reached 2000+ edits.
3
 
No more badges for you ....!!!!
 
@rolfl should I have held back from listing these issues (scroll up a bit)?
 
I don't need no more stinkin' badges. I just like seeing clean material. :-) sprays garbage with air-freshener
(but S&W and Copy Editor are still nice)
 
@Jamal sounds like my wife except it's not air freshener it is lysol spray, everything has germs, I am surprised I am still alive and don't have the flu
who knows about unit testing Javascript? can they do it on the my code and OP's code on this question
3
Q: Coderbyte SimpleSymbols challenge in Javascript

jstoneI am working on a CoderByte problem in JavaScript. I have solved the problem below. Although I am trying to figure out if there is an easier way to do it? I am guessing RegEx will come up, although I don't have experience with that yet. From CoderByte: Using the JavaScript language, have t...

there isn't much for testing
 
@Malachi: My apartment room is also a little too clean for a typical college student.
 
7:26 PM
0
Q: follow-up review of a custom Undo Manager

Phil ValloneThis is a follow up review of question 'a custom Undo Manager'. After reviewing all the comments and answers, my code has been revised (completely rewritten) based on the review. Summary The intent of the code is to provide a means to keep track of events in c#. Each Action has an undo and re...

 
0
A: Testing to see if tree is BST

snetchHere's a simple tree that can demonstrate a couple things: 5 / \ 3 7 / \ \ 1 6 8 minValue and maxValue are written so that the algorithm can catch the 6 that is out of place. And it seems like even the original versions of those functions are not doing that right. Your new al...

0
A: "Guess a number" game

Mike HometchkoFor an initial project you have done well. Take advice from those above with a grain of salt. The road ahead of you is long and fraught with peril! You need to keep your chin up and just chug away. The most important thing to take away from the advice below is how little you know and how mu...

0
A: Coderbyte SimpleSymbols challenge in Javascript

Malachihow about this logic. if the first character or last character is a letter it's false then go through the array and look for the letters skip it if is a = or a + if it isn't a = or a + then check that the character before and after is a + so something like this. var simpleSymbols = func...

^^ nice answer
 
@retailcoder I am trying to implement the fact that there could be numbers. i get an error when running that stupid thing
 
@Malachi is that the one you were discussing with @tomdemuyt?
 
@retailcoder yes
 
sorry for interrupting o.O
 
7:33 PM
it's all good. I am getting an unexpected Token error or something
 
@retailcoder Generally it is wise not to ruffle feathers.
 
I figured out what I was doing wrong but now I have another issue
is = or + a number in the isNaN function of Javascript?
 
@rolfl that company isn't a bridge I can't afford to burn.
So that means I should have kept it to myself here.
 
when I give isNaN an 'a' it thinks it is a number
 
0
Q: Game map tiles generation with php

t1gorI am working on a browser strategy game as a hobby and came up with a decision to use a tile-based map for the world map. I have several questions so far: I am using double-cache (file and apc) for performance issues. Isn't it too much? Or should I consider using Redis or anything similar? Wh...

0
Q: Another way to do this

user2956514So I've got this module called risar. And what it does, it draws. But that's not really of importance. I wrote this code which sets 20 flowers on the background. Now they need to move downwards by 5 units. The code works fine but it looks horribly awkward to me. I'd like it to look more "fancy" o...

 
7:49 PM
@retailcoder As a South African, who never learned tact, and then lived in England for 3 years, where I learned to be even harsher, and now, I'm in Canada, where people are 'sensitive'.... I have to recommend that you always should take the path of most flattery... I would have said: "It has been an education maintaining your code, and I have a new appreciation for system design!"
2
 
@Malachi duty called, so I missed out on the conversation, I see you fixed the for loop
 
@tomdemuyt yes
I went to coderbytes. and I am trying to find a quick way to check for a number.
 
well
 
just to be complete. and it is bugging the heck out of me.
 
the ascii of 'a' is larger than all numbers
 
7:53 PM
I found two functions that I could use on Firefox but nowhere else
 
that is why I like my solution ;)
I still dont like your answer , bottom line , part 1 : so does the OP, where is the difference ?
if the first character is a letter, will return false and not loop through the rest of the string.
also, which 2 functions only work in FF, that is interesting
 
0
A: class design improvement - user validation

t1gorFirst of all, as mentioned by @user7212, use php filter_var() for email validation. Please see below for example: /** * Validate email * * @param string $email * * @return bool */ public static function email($email) { return filter_var($email, FILTER_VALIDATE_EMAIL); } Second, why n...

 
0
Q: Optimizing garbage collection for local objects

skiwiI am trying to make a 3D application with OpenGL/LWJGL at the moment, but I am now already hitting some limits on the JVM, most likely due to a configuration that needs to be done. I have the following code in the render loop: @Override protected void render(final double msDelta) { glClearC...

 
@retailcoder you don't have to post this when it shows up in your feed.
 
+1 , you know who you are ;)
 
8:00 PM
@tomdemuyt I added to my answer.
1
A: Coderbyte SimpleSymbols challenge in Javascript

Malachihow about this logic. if the first character or last character is a letter it's false then go through the array and look for the letters skip it if is a = or a + if it isn't a = or a + then check that the character before and after is a + so something like this. var simpleSymbols = func...

 
Question; does anyone know if you have use :first-child followed by another selector?
if you can have**
 
@PhilFromHeck try it
 
like [bleh]:first-child a{}
 
sorry yes you can
 
Hrm, it doesn't work in IE 8 then.
Dangit.
 
8:01 PM
nothing works in IE 8
5
 
Yeah, but I have to support IE 8 :P
 
I don't think any of those ":first.." selectors work in IE 8
 
:first-child does, nth-child does not.
 
google it, or Stack it
2
 
I have been.
 
8:02 PM
you should be able to select something inside of the first child of something else
 
Yeah, it might be a IE 8 quirk though in this instance.
I've tried it already. So. I don't really know. Thanks for your advice though!
 
@tomdemuyt Number.isInteger() and Number.toInteger()
hey @phil
 
Whatsup?
 
@PhilFromHeck hit F12 and see if you are in IE 8 quirks or standards
sometimes if the page opened in quirks once, even if you fix it it will always open in quirks
and vice versa
@tomdemuyt I should have got double the votes because I stole half your answer....lol JK
ok now I can go to the bathroom and pee
 
@Malachi coffee made its way eh!
 
8:13 PM
@retailcoder about time too. I haven't gone yet since I got to work about 6 hours ago
of course I haven't finished my coffee or my mello yello either
 
0
Q: Follow Up Inventory Script (RPG) in C#

EmzI would prefer if more experienced users could give pointers on how I can optimize and think better when writing code. If you are unfamiliar with unity3d, ignore the use of UnityEngine, the heritage from MonoBehaviour as well as the Debug.Log();, Debug.LogWarning();, and Debug.LogError();. Inve...

 
@tomdemuyt my code doesn't work when the letter is in the middle of the string and not surrounded by "+"
 
I think we should light IE 8 on fire.
 
just leave the 8 off of that statement
2
I only use it when I have to
 
I think I may be able to accomplish my goal with sibling selectors, but I so rarely use them.
Time to read :[
 
8:32 PM
lol
anyone want to watch the downvoting begin?
0
Q: Javascript not working on CoderByte

MalachiI wrote this code for a review on CodeReview, but when I tried to plug it into the actual site it wouldn't come back false for letters in the middle of the string Example input: "+d+==e==+c++==3" it would function properly if there was a letter at the beginning or the end. is there something ...

that is SO BTW
 
-1 for not knowing which version of Chrome you're using
 
@Jamal lol I know right..
 
@Jamal - before you mess things up ... ;-)
 
Version 32.0.1700.72 m
 
@rolfl: Mess what up?
 
8:38 PM
close a question, migrate it, or something ;-) isn't that what you do with 'hot' SE questions ? ( you realize this is in jest, right ? )
 
(It's only moderately in jest.)
 
Yeah, I can always migrate our hot question to Pets SE or something. :-)
3
 
@PhilFromHeck - naah, last time Jamal got a bit burned, so I think he's wizened up to the hot-question game.
 
waits for next Hot 18 question to reach top of list
 
@Malachi That excursion into VB seems to have messed up your capitalization skills ;-)
2
 
8:41 PM
@amon ain't that the truth. I have problems with that anyway. only reason why I like Visual studio's intellisense....lol
already had a close vote on it
 
@rolfl: I don't even remember being burned. I'm still getting used to all the extra traffic anyway.
 
ok fixed my errors on the CR question, now where are my votes!!!!
 
I'm all out.
 
I was going to suggest that people go napalm the hot question, but, even I am down to just one vote.
 
@rolfl i already voted on it
@Jamal i will give you some of mine
 
8:46 PM
I'll napalm it as soon as I can. On the bright side, I can moderate more with possible non-answers (which a few of you have already seen not too long ago).
 
@amon ugh. out of stars.
 
 
1
A: Testing to see if tree is BST

rolflYour revised changes to the isBST(Node) method are broken. You only check that all Nodes have a data value that is left < me < right. In other words, you check to make sure that each individual node has appropriate left and right values. As snetch points out though, the tree: 5 / \ 3 ...

 
It sucks being out of votes. I'll keep bookmarking Qs and As that I plan on voting for later.
 

« first day (258 days earlier)      last day (3766 days later) »