« first day (465 days earlier)      last day (2393 days later) » 

12:04 AM
A: Loading and Using Lua Scripts

nhgrifI am not even remotely familiar with lua or how it works with Objective-C, so I can't really comment on any of these aspects of your code. What I can do of course, is comment on the Objective-C bits, starting with your header file. Why is there anything in your header file at all? #import <UIK...

A: Attempting to optimize (or rewrite) a PL/SQL query

nhgrifcte1, besides needing a better name, needs to just be a fully-fledged table. With 63 combinations, it takes a while to process how to get all these in correctly. Putting this in a view doesn't speed up that CTE at all. So, just create a permanent table in the database preloaded with these valu...

My god...
cte2 is...
Two questions from people writing their own programming language in the same evening.
Only one on topic.
Q: I'm making a programming language and help would be nice

UberFoXHello everybody I have been making a programming language for some time now as a good learning experience etc and improving my programming skills. It can use a lot of improvements and I'm sure somebody might be willing to find things that I can improve or help make it better. My programming lan...

@nhgrif @DanLyons watch this:
drop table test;
create table test(
	number int
insert into test
select *
from test as ID_100
cross join test as ID_200
cross join test as ID_300;
@CaptainObvious Basing a new programming language of Javascript and PHP
oh the humanity
Total query runtime: 21 ms.
64 rows retrieved.
Q: Why do the Teenage Mutant Ninja Turtles wear masks?

GoozoThis is something I don't understand. Are they trying to hide their identities? How many turtles are there that can stand on their feet? Is it because they are ninjas? Again the shell is a big give away.

12:14 AM
This replaces his WHOLE 63-64 UNION ALL SELECT
(note, this is pgSQL but should be close enough)
Well not the whole thing but the rest should be pretty simple
Okay. Now that that's out of the way, maybe I can fix up that Enumerable class.
Q: Implementing DAO Factory

user3590149I"m trying to do three different type of DAOs with 4 subtypes of each. I have RAM, SQL and Serial with each one have four subtypes. Is a singleton necessary with my implementation within the factory and more specifically with each DAO? Should I use static methods instead? Also I have two factori...

Or I could post another answer......
People on the Internet are dumb.
> Code is all over the wiki, code comes with the download the entire rar file is filled with code but whateva there is no code you say i will go somewhere less hostile. --Someone Butthurt
Q: Validating Single Responsibility with DAO and Observable in the same class

user3590149I have a DAO that will update observers when a new information gets inserted or updated. I think notifying them at this point makes sense but I think I might be validating a OOP principle. Is this okay or is there better way? private volatile static GenericDAO<Trade, String, Boolean> tradeDAO ...

Q: Java future - Is this an appropriate solution to my intent

Nate LockwoodI'm writing a Java application to control a custom IR research camera that will be installed on an aircraft. The camera connects to the the computer using UDP sockets via a direct LAN cable. The camera does not initiate any communications; it just replies to commands, 5-character strings, sent t...

Q: Singleton necessary in DAO

user3590149I using a singleton in my DAO. Would I be better with static methods? Also should I worried about synchronization the singleton and my data statures? public class RAMUserDAO implements GenericDAO { private static RAMUserDAO userDAO = null; private Map<String, User> userList; private Map<Str...

12:32 AM
@nhgrif you mean, "People on the internet are the dumb"
How does synchronized work in Java?
Sort of like a lock on a method, I think
other threads can't use that method while it's already being executed
Does my answer here work relative to the code in question:
A: Singleton necessary in DAO

nhgrifYour spacing is all over the place, and the double null check against userDAO seems redundant. I'm not making a comment on the big picture on whether or not the singleton is necessary, but I'd certainly fix getRAMUserDAO() up to look more like this: public static RAMUserDAO getRAMUserDAO() { ...

I'm not very comfortable around multithreading so I can't really say
with regards to those nested statements: I believe there are reasons for that
I've seen implementations that go 5 levels deep to avoid race conditions
I think the main difference with your code is that you now always execute the synchronized statement
even when it might not be needed because it is already instantiated
Yeah, we also only check for null once.
12:39 AM
At least I think that's what it's supposed to do
Let's take this conversation to the Code Review chat room but you may want to read this Code Review meta question firstrolfl 2 mins ago
Hey UberFox
so you will always do the locking and stuff when you need the userDAO although it should only be done once when you actually create it (aka: userDAO == null)
and the reason you do that nested null, sync, null statement is to re-check it in case it got instantiated by another thread before your lock caught on
That presumes it's never reset to null.
I understand why you have to check within the synchronized.
@UberFoX - you should be able to chat now.
(in this room)
true, but I figured that was a given since he doesn't check for it in his code either
12:41 AM
@rolfl Does he have the rep?
but yeah, that might be a source of improvement
I'd clarify that in the answer though
I just gave him write access here.
@uberfox - superping?
i see :)
OK, good
There he is ;)
12:43 AM
had to F5
+ (id)sharedInstance {
    static SomeClass *sharedInstance;
    @synchronized(self) {
    	if (!sharedInstance) {
            sharedInstance = [[SomeClass alloc] init];
        return sharedInstance;
That's exactly how we do it in Objective-C
I'm going to undelete your question, UberFox, so others here can see it.
I've seen it.
i dont like { on row ^^
It had no code embedded.
12:44 AM
High enough rep users could see it regardless, but why not?
why not what?
Undelete it and fix it up
Q: I'm making a programming language and help would be nice

UberFoXHello everybody I have been making a programming language for some time now as a good learning experience etc and improving my programming skills. It can use a lot of improvements and I'm sure somebody might be willing to find things that I can improve or help make it better. My programming lan...

SO, if you have a massive code base, it will be a problem.
Fix it up how exactly?
You will have to break it down in to logical components, each of which fits within the 30K limit
12:45 AM
^^^ That @UberFoX
And actually, far smaller than that would be better.
If this is hard to do, it probably means your code is not modular enough anyway
The more specific the code in your question, the better and more specific the answers will be.
its easy to do
12:46 AM
and my code is very modular
OK, we are strict about a few things on Code Review.
@Yuushi And to you too :)
The one thing is that the code in thw question is not allowed to change after it has been reviewed.
@syb0rg How's everything going?
Also, given you're creating your own programming language, and you're going to break your code up and post multiple questions about it, we can create a tag for your language potentially.
12:47 AM
This helps make any answers stay meaningful
Well its not just the language but also its libraries and games made with it
@Yuushi Pretty good! Very busy though...
and tired
Which is the main reason we require the code to be embedded in the question
Also read:
Q: Review for large chunks of code

Paul92I am migrating from small pieces of code to larger applications. All my code is public on github or simillar. As I am in the middle of this transition, I am not very intrested in reviewing chunks of code (altough I know I have mistakes and will be nice to know them), but I am more intrested in re...

And additionally, there is some human psychology involved when asking questions here.
If you ask big questions, yoyu will likely get higher-level answers.
@syb0rg Sounds familiar :/
if you ask smaller questions, you will likely get more in-depth answers.
12:49 AM
@Yuushi Yeah, I would take a nap. But they waste too much of my time :/
For those that don't understand the phrase "Egyptian-style braces":
user image
Do I post code I need help with or code that should just be checked to see if people can find ways to improve it or post something that marginally explains what I want to do then ask for that?
Or just post everything in chunks
@UberFoX Code that works
In what way do you mean "need help with"?
You should post working code to be reviewed for improvements.
12:50 AM
Code has to work to be on-topic.
If it works but needs improvements in some way, that can be on-topic.
Could use some improvements in my AI for Pengo (game I made in Sputnik)
Best way to have code in a question (minus the "example"): sscce.org
I'm trying to make the Red ghost bitchy to kill
12:51 AM
CodeReview isn't a code writing service.
@UberFoX When I was brand new here, I found it useful to look to past questions that were well received by the community. Then I based my questions off of those.
@UberFoX how did you find out about Code Review if you don't mind my asking?
Q: How to improve my programming language?

UberFoXHello everybody I have been making a programming language for some time now as a good learning experience etc and improving my programming skills. It can use a lot of improvements and I'm sure somebody might be willing to find things that I can improve or help make it better. My programming lan...

He posted a question to CR before that comment.
New bounty.
Q: SQLConnect - A library for connecting Objective-C/Swift applications to Microsoft SQL Server

nhgrifThe complete SQLConnect library can be found here. The file from which the following method belongs can be found here. At some point I may or may not open questions for reviewing other aspects of this library, but I intend to keep the questions relatively small. This is the largest method in t...

@DavidFrye Hello!
12:56 AM
Pretty much all my upvotes will be converted into bounty on that question until I get a really good answer.
Hello :)
@DavidFrye You are brand new to Code Review! Welcome to the site!
Thank you! I'm not currently chatting with a bot, am I?
Oh no haha, that would be my @rob0t side
Nope... just the syb0rg
12:58 AM
Edited the post
I was serious too ^^^
<--- Plus, bots don't usually obtain 18.4k rep
OK, just making sure!
@UberFoX - that's a completely different question, right?
I have reopened it, I expect the folk here will look after you for a bit.
Well I need to post what I can post
Q: Python code for processing Excel files of a predefined template to generate output CSV files of another predefined template

AnanthI'm a freelancer and I recently wrote a python script that processes input xlsx files that contain data in a particular format and output a csv file in another format as required. The code works well and fulfills the requirements, but I am looking for a code review with suggestions on performanc...

Q: Refactor if value return else do something in ruby

nXqdHi guys I have a lot of code appeared like these value = TopicLinkClick.create_from(new_params) return value unless value.nil? # do something else I find this code is not so good because : Naming temporary variable is troublesome because it just doesn't fit the workflow, and sometimes it co...

1:00 AM
I need to go.... things IRL happening here.
@DavidFrye Ohh, a fellow C user! We could always use more of your kind here!
Pengo is part of the Sputnik project (game made with it) and needs as much looking at as the language itself
Yeah? I'll do the best I can, but I still consider myself pretty inexperienced. I'm trying to learn more all the time though.
Fortunately the game isn't that big and is easy to post
@DavidFrye Post a question or two, I'll try to get to reviewing them: codereview.stackexchange.com/tags/c/topusers
1:01 AM
I may do that in the future. For the moment, I'm just a lurker :)
@UberFoX codereview.stackexchange.com/questions/tagged/sputnik Click the "help us create it" please.
@DavidFrye Well we certainly hope you can stick around, you'll learn a lot by doing so. For example: I'm learning more Objective-C by the day.
I'll certainly check the place out. I know that code review is a great way to learn. Maybe I'll throw up a project or something of mine at some point, just to get the ball rolling.
@Jamal Dang it, I was totally fixing that up ;)
@UberFoX Why didn't you just post one AI at a time?
1:07 AM
I did?
@syb0rg By the way, I bumped this after finally tagging it as C. ;-)
You want each file in its own reply?
@UberFoX Well... Idk.
I can do that
It does advise me that answering my own question is a bit lolzy
"Selfies" are what we call those
@Jamal Not too much I can see to review in that one right now
1:10 AM
There's nothing wrong with self-answering.
I'm not sure if people really saw this answer of mine: codereview.stackexchange.com/a/59548/27623
And in fact, given the fact that this is your own programming language, it'd probably be a decent idea of post a handful of self-answered questions so you can demonstrate to us a few things that are good/bad practice.
Brilliant idea ^^^
I made a lot of rep today:
lol, wut happend?
1:14 AM
It is very similar to PHP similar rules apply
one obvious difference is you use $Class->$Variable instead of $Class->Variable and Global variables are useable as $Variable directly
there is also local scope variables with My
everything is case insensitive
I'm gonna be honest, I won't be very interested in a language for which "is very similar to PHP" applies.
That is the game MAP class
it handles the entire world and all monsters , players on it
1:15 AM
This isn't a forum...
The answers should be answering the question.
Similar in terms of syntax
@UberFoX Edit it into the question, don't post it as an answer
thats where it ends
i just got told not to edit it into question
Syntax might be my least favorite part about PHP.
and rather post each one seperately
1:16 AM
As a whole new question
Not as an answer to the question
Sorry, I didn't mention that part when I said separately... my bad.
@nhgrif You would get my upvote... if you didn't already have it.
Only 55 views. :/
@UberFoX Is that part of the code that should be reviewed?
1:18 AM
which part?
The part you posted as an answer.
there is no part that shouldnt be reviewed
I was referring to the code that was posted as an answer, which was now deleted.
well im not sure what to do with it
delete or not
i cant post it in first post
its too big
(30k limit)
1:19 AM
Make separate questions.
Then it'll have to be posted as a separate question, if possible.
You shouldn't be anywhere NEAR 30k realistically.
its a big file
You won't get any good answers at all if you just dump 30k characters of code at us.
1:20 AM
Find chunks of code you want reviewed and post those. If more code is necessary for context, provide a link to a plain-text version of the context-code.
Take this question for example: codereview.stackexchange.com/questions/59308/…
Let's review ONE AI at a time. Then take it from there.
I'm asking for a review of a 200 line method. That's a huge chunk of code.
I added the map since it explains how every AI feature works
like how to interact with stuff
But it is from a file with 565 lines, and out of a library with several more lines (multiple files)
1:22 AM
Q: Pengo Map.spk Part 2

UberFoXThe second half of the Map.spk the file was 48,000 chars so it did not fit into one post [Args("false")] Function SpawnRainbow($DoX = null, $DoY = null) { if(IsArray($DoX)) @{ $DoX = $DoX[1]; $DoY = $DoX[0]; } my $RainbowName = ...

thats the rest of the map.spk
Eventually I might want the entire library reviewed, but I wouldn't get any good reviews at all if I just smashed the entire library into a question.
AI is always the most intricate one
I'd be surprised if you get any good reviews in the way you're posting your questions @UberFoX.
if you are unsure of what any syntax means i can explain it in C or any language you may know
i posted the rest in a new question just like you said to
You're posting an extraordinarily massive wall of code in a language you've created yourself (and therefore no one will know it better than you anyway) and you've provided very little in the way of a plain-English explanation of what the code does or what your primary concerns are.
1:25 AM
my concern is the AI
@UberFoX Please look at the way some past projects were posted
Like such:
Q: File Browser GUI

Andrew ThompsonFileBro is a basic GUI based File Browser. FileBro Functionality Directory tree - shows the file system roots at start-up, but is otherwise built lazily as the user browses around the file system. FileBro displays a progress bar as it is loading new entries. The file list (a table) display...

maybe its best to delete all posts and start again with small code?
1 post baby-step at a time
sounds like a plan
1:26 AM
Please. One class at a time perhaps.
Even less than that, I'd argue.
Some of his functions are several hundred lines.
It is a nice game
I put a lot of effort into it
Yeah. It looks like you've put a lot of effort into it.
@UberFoX And we would love to review it. Help us help you!
But if you want good reviews, you have to post the code in easily digestable chunks.
And again, given that this is a language you've created on your own and none of us are familiar with it, an easily digestable chunk for you is probably slightly smaller than an average CR question, I'd say.
1:30 AM
Yea i will do that
Actually, I'd say put AI and Yellow AI in one question. AI and Blue AI in one question.
Duplicate AI just because the other AI are subclasses so it's useful to have AI there for context but the main review is for the subclass.
@nhgrif Long time no see.
@EnricoSusatyo Hiya
all the AIs arent that big
13 KB for every AI
1:32 AM
They're a good size for a single question though
@EnricoSusatyo u can haz mai bounty? codereview.stackexchange.com/questions/59308/…
I will go for just one AI
@nhgrif I'm already working on recruiting people for that ;)
How do you think he found his way in here?
@UberFoX If you want comments on the language itself too, you should make it clear in your questions that this is a language you've created yourself and you're open to opinions on how to improve the language itself--not just the code.
When we graduate, I nominate @nhgrif for mod.
@EnricoSusatyo An unused CR account? Heresy!
1:35 AM
Blasphemy even!
There is a lot of things I could post on that but for the moment I want to finish this game and get the AI all correct
When we graduate, I'm imagining all of the regulars in this chatroom running for election. And chaos ensuing.
A: Attempting to optimize (or rewrite) a PL/SQL query

PhrancisI'll compliment in saying that formatting, capitalization, etc. are consistent. Nitpicking cte1 and cte2 are not very good names. Variable names should reflect what they actually represent. UNION To me the gorilla in the room is that UNION is used 64 times to explicitly spell out every poss...

@syb0rg I would actually be fine with the mods we have if they chose to run.
Keeping myself in business.
I disagree @L42. I spend a lot of time there, and we welcome questions such as this. Short questions are on-topic on Code Review. — ckuhn203 56 secs ago
@UberFoX Like for example, I'd make curly braces non-optional on if and else and loops
1:43 AM
They are optional in Sputty
@L42 To expand on ckuhn203's comment, we even prefer shorter snippets of code to larger and more complex projects. — syb0rg 25 secs ago
also you will notice some curly braces have a @{ }
the differance is { } causes a push and pop on stack where as @{ } does not
(useful if you want an IF statement but dont want to push and pop the stack)
I know they're optional. I'd recommend that they become non-optional.
Well thats subject to change the grammar is not finalized yet
There are other programming languages on CR that have optional curly braces. In all of these languages, when a question gets posted and a user has omitted them, without fail, someone answers recommending they add the braces.
1:45 AM
technically the grammar can change radically and it wouldnt matter
There really isn't a point to omit them in Sputnik since you can avoid the push/pop anyway
I would say that the family emergency you're going to have on that day will make it difficult to attend, so the question is rather moot. — Kaz 3 hours ago
as a side note [Args("false")] is not needed but it does cause @Args to not be created similar to Perls @_ by not creating the variable there is a very very tiny speed boost I suppose when making a game I decided the boost was worth it
This code is asking for an explanation:
Q: Uses of barriers for one main thread controlling n threads

JaryReferring to this post, my problem (summarized): One main thread waits for connections, on accept() spawns a new thread for each connection. After we received n connections, the main thread dictates all threads what command to run, and must wait for all threads to finish, until issuing a new com...

oh nevermind
2:07 AM
Uploading a video to youtube of the game im making
Very retro :)
The videos shows the AIs etc
and shows the A* pathfinder of the pink ghost
@UberFoX Might be something to link to in your question
The entire game and path finder is made in Sputnik
Yea i will do when its online
One thing you will notice is the red ghost does nothing
since we dont currently have an AI for it but ive stated in my post that is the focus
The focus of the CR post?
If you try to focus the CR post on writing the unwritten/broken AI for the red ghost, we'll have to close it as off-topic. CR is for reviewing code that is working as intended.
A: Does Swift Automatically Clone Arguments?

nhgrifIn Swift, some variables are value types, others are reference types. Objects are reference types. Pretty much everything else including structs, enums, and in the case of this question, ints, are value types. By default, value type variables are passed to methods and functions not just by val...

2:42 AM
My professor for Intro to OO looks like a cool guy (my schedule has been updated recently). His research is in machine-learning and some other things.
Ohhh, machine-learning!
I don't go to UTA; he's coming to Texas State for the first time.
1 hour later…
3:45 AM
@h.j.k. - got a second to figure out the rollbacks needed?
can anyone make sense of this codereview.stackexchange.com/a/59758/44723 ?
Q: Looking for clean way to accumulate amounts within a input dataset with Java

BillI am looking for clean way to accumulate amounts within a input dataset. In this example, there are 18 rows of data, and the output is a 3 rows of data, accumulated by Key, by ExpenseType. My biggest concern is whether hashMap is the correct utility for this, or if there is an easier/cleaner wa...

4:22 AM
Q: Python feedback on learning project: A program to display, update and save a dictionary as .csv

mattkaeoI'd like some feedback about my code. What bad habits do I have? What advice could help me write more Pythonic? I'm trying to write a console application and want a tool to display, update and save settings in a dictionary. def file_as_string(file_name): with open(file_name, 'r') as opened_...

5:00 AM
sys.columns.tags.count -- int 4
can you create a column where the value is populated by a calculation, like count(tags.id) ??
If so... why have I not been told about it? If not so... why does this column work???
Either way... WHY...
5:24 AM
monking @Heslacher
5:44 AM
Q: nodejs async to read multiple files

Sachin DoiphodeI want to read multiple files simultaneously and want to apply same function on data. Right now, here the code which I'm using function fileread(path,stats,callback){ var buffer = new Buffer(stats.size); fs.readFile(path, buffer, function(err, data){ if(err){ throw err; ...

6:36 AM
Q: Suggestion for Approach used ELIXIR

NewBeeI have one module to capture messages coming in my module externally from gateway sever. For now news users can send the names for registration and i add them to ets. But, seems that approach following is not right as i dont have any PID from handle_info to be stored along with name in ETS. Can y...

Monking @skiwi
I could fall asleep any time, unfortuntaely I'm at work, so that might not b e a wise decision
Monking @Heslacher
@skiwi But sometimes we are also coding when we are sleeping !
I haven't had that yet ;)
Though had some interesting dreams last night, but cannot really remember them
6:50 AM
Q: Quality testing of application. Is this code is Lengthy? Is it Can be shortened?

newbie2222 This is the Application i created for my Personal Use. I need some quality testings of this Application. If You see some Error or Any Lengthy coding(already its lengthy: ), and It need to be shortened please tell me, I would love to learn new things, As I m a newbie, I have made lots of mistake...

@skiwi Sometimes, when I am really under time pressure to reach the deadline, I think that much about the code, that I also do it while sleeping.
That sounds horribly fun
Not, when in the morning after waking up you remember this cool piece of code what you need.
ugh :)
7:06 AM
Most efficient code ever
public E next() {
    if (listIterator.hasNext()) {
        return listIterator.next();
    while (listIterator.hasPrevious()) {
    return listIterator.next();
Lists will not have more than 10 elements either way
What the hell is it for?
So what happens if ListIterator has neither next nor previous?
I want a kind of circular list, but cannot handcraft one
If not under special conditions, it will probably break in various ways.
so how about reinitializing the iterator at front or back
Morning is when it takes ten tries to type your classnames correctly.
I have no front or back reference
iteration is still amortized O(1), even though it's a bad excuse
What I made doesn't even do what I want :)
I'm giving it a new try ;)
7:23 AM
@skiwi you don't have the list itself?
I have, but didn't want to store it
welp... night all
I might as well put it up for review later
morning @all
7:31 AM
Is this clear enough?
public E next() {
    return list.get((index++ == list.size()) ? 0 : index);
or is that cryptic?
It might actually need to be ++index
morning @chillworld
skiwi => java?
isn't it ++index yo uhave to do?
yea it is
7:34 AM
now you add 1 to index after
but clear enough for me ;)
or actually, don't you have to put index also at 0?
index = (++index == list.size())?0:index;
return list.get(index);
good point
It is bork indeed
but chillworld fixt it
If all mine problems where of that level I would be happy
mine problems currently consist of getting FFmpeg into android
and that means fiddling about with JNI
@Pimgd I was reffering to personal problems, not coding problems :)
7:40 AM
JNI is always fun
except when it's not
which is most of the time
oh yeah
did I mention the half-hour compile time
sounds even more fun!
nah it's horrible, even more so when you are using an experimental library using JNI
no offense to that library, it's helped me loads
7:58 AM
Monking @all..
340 360 rep in 20 hours, damn that was fast..
Monking @Vogel612
cuz I ain't got better sh*t to do..
do my work for me

« first day (465 days earlier)      last day (2393 days later) »