« first day (466 days earlier)      last day (3534 days later) » 
00:00 - 15:0015:00 - 00:00

3:00 PM
@Phrancis lots of goodness on that question.
 
Agreed
 
0
Q: Optimization of program (for the Online Community-Even Groups ques) to reduce the time taken for execution?

keerthisantI have a coding problem for which I have attempted to solve with the below coding. However, my program is assessed as too slow in its execution and thus needs to be optimized to reduce the execution time. Please help me in optimizing my program and reducing the execution time. Problem definition...

 
@ckuhn203 and then a bunch of Questions show up all over the place that need flagging along with some comments, I think I placed like 4 flags or something like that
 
It's like yawning. The second you mention it.....
 
No my answer still shows at the top... Someone downvote it please?
(it's because I have a little more rep...)
 
3:10 PM
@Phrancis : If your answer is valid why downvote it for sake of the humanity ?
 
@Bhathiya-JaDogg-Perera Agreed
 
Well, I guess it's no big deal
I just hate for a formatting answer to be the top answer while function-related answers sit below it
4
 
I don't care @Phrancis so should you.
 
@Malachi it is TCS Code-Vita 2014. — invincible 2 mins ago
 
OK I'll stop caring right now :)
 
3:13 PM
someone mentioned 200 and I see his Fishy Figure hanging around in the shadows!
 
And some idiot has blown up the server.....
Again.
 
@Malachi as a matter of fact I also see Pops around in the shadows..
 
@200_success : Are you here ?
 
TTGH bye
 
3:25 PM
Bye @Heslacher!
 
So many emails, so little motivation...
 
3:42 PM
0
Q: Advice on Boost Accumulator typedefs

pbibleI have a few classes that use boost accumulators. I am currently typedef'ing them anew everywhere they are needed like so: typedef boost::accumulators::accumulator_set< double, boost::accumulators::stats< boost::accumulators::tag::mean> > MeanAccumulator; What would be a good way to pa...

 
@CaptainObvious DV
 
@Bhathiya-JaDogg-Perera What's up?
 
Nice
 
@Jamal Looks nice huh
 
The chat room has shadows?
 
4:16 PM
0
Q: Mathematical boundaries (audio meter)

gratzJust been putting together an audio meter by stacking bootstrap progress bars - http://getbootstrap.com/components/#progress-stacked and thought there is probably a better way, mathematically / logically, of achieving this? levels = (vumeter) -> green = if vumeter % 50 < vumeter then 50 else v...

 
@CaptainObvious nice, audio and code all at once... too bad I don't know any coffeescript :)
 
@Jamal whose profile?
 
Mine
 
What happens, is that he edits every question, and the asker thinks: who's so special that they think they know what I mean better than me...? so they click to look, and Jamal profits ;-)
4
 
I only have 825 views....
yeah @Jamal, Who do you think you are Editing everyone's well written questions?
 
4:24 PM
Oh, I don't edit well-written posts. ;-) I can turn (most) near-turd into gold. But I try not to polish genuine turd.
2
 
posted on August 13, 2014 by user51111

Alice and Bob are playing a game called "Stone Game". Stone game is a two-player game. Let N be the total number of stones. In each turn, a player can remove 1, 2 or 3 stones. The player, who picks the last stone, wins. They follow the "Ladies First" norm. Hence Alice is always the one to make the first move. Your task is to find out whether Alice can win, if both pla

 
@CaptainObvious Too late; already deleted. We're not gonna let these gimmetehcodez flood the front page.
 
^^ (a.k.a. Pimping my answer)
 
Hm. Who is that?
Oh, no... Is that you @Jamal ?
 
4:40 PM
Nah, it's someone else.
 
Phew, OK. I saw new profile, nothing but edits so far, I'm like... SO now? lol
 
@Jamal I saw those Dr. Who episodes.
 
Greetings & salutations!
 
Hey
 
Hello, World Hello, @syb0rg
Oh, forget it, you get the idea
 
4:50 PM
lol
2
 
no space after the ---
 
There we go :D
 
lol
"Please give me the answer NOW"
 
Conference call with the vendor. So looking forward to getting my hands on the new software.
Gimme gimme gimee.
 
... a man after midnight...
Catchy tune
 
5:04 PM
@200_success : on euler2
you there ?
 
@Phrancis They're my nostalgia favorite musical group.
 
@200_success are you there ?
 
You have a question?
 
on euler2, My problem
6
Q: Project Euler #2

Bhathiya-JaDogg-PereraProblem: 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 Fibonacci sequence whose values do not exceed four milli...

doesn't assert(b & 1 == 0); fail on bigger b values ?
 
5:20 PM
b could overflow, if that's what you mean.
 
hmm
No I meant for some inputs assert(b & 1 == 0); can throw an assertion error
and abort the program
 
I don't often post non-programming related questions on SE. But when I do, I don't get answers.
5
 
I don't often start a new increment, but when I do I often spend days updating all of my libraries.
2
 
@200_success : It still gives an invalid answer to the input 4000000
Sum of the even-valued fibbonaci below 4000000
Answer = 19544084, Steps Taken = 12
 
@Donald.McLean Better hope they are backwards compatible... Or at least that they claim it
 
5:34 PM
^^ It should be


Sum of the even-valued fibbonaci below 4000000

answer = 4613732, steps taken = 11
 
@skiwi Sometimes updating the code to match the new APIs is the most... fun? exciting? part of the update.
 
@Donald.McLean Well, unit and integration tests will catch bugs anyway
 
@skiwi : I've Updated the dashboard question
sorry answer
1
A: Dashboard for running programs in JavaFX 8

Bhathiya-JaDogg-PereraJavaFX Related main() method : in Dashboard.java You do not need it. It's an IDE bug, It's only required for old IDEs. (I recommend using the latest NetBeans, version 8) Use Toggle Buttons : in DashboardController.java you are doing switch (generalButton.getText()) I suggest using ToggleButton...

 
Ah cool, taking a look now
 
You're right, it adds one extra term that exceeds the limit. Answer withdrawn. I should have checked it more carefully first.
 
5:45 PM
k
It's not bad, You can fix it easily. btw I forgot (m & n-1) == (m % n)
& works too
 
I'd rather not leave an answer that consists purely of nitpicks.
 
Hmm, not living in the USA or Canada, so haven't noticed this at all, rather interesting though: reddit.com/r/talesfromtechsupport/comments/2deb04/…
 
0
Q: Please review my first attempt at mock classes

user3265472I've just created my first tests using mock classes. So far my tests are running much faster and now I guess I'm solely focusing on a single class (in this case I'm testing UserTable and mocking the DatabaseAdapter instance I inject into it) I haven't proceeded to do the write tests for the othe...

 
And I'm being extra brave - I'm trying the new IDEA 14 EAP.
 
5:53 PM
hello
 
hi
@janos : good night, How are you ?
 
hey @Bhathiya-JaDogg-Perera a bit tired after work, but ok. And you?
 
I'm watching a tv show with a cousin
 
Late answer posted, and a much-needed one at that.
 
0
Q: Readers-writers problem using wait notify

barn.gumblDescription of the Readers–writers problem. It looks like it works, but I have some doubts: class ReadWriteBuffer<T> { private static final Object writeLock = new Object(); private static final Object readWriteLock = new Object(); private int numberReaders = 0; private int n...

 
6:28 PM
Thanks Santa
 
Wow, that was fast, +1 and accept.
 
whoa
 
ah semaphores
 
Necromancer!
 
:-)
 
I am sort of trying to move away from bulletpoint reviews, although not entirely. I still prefer to avoid a massive wall of text, though.
 
That last one I did, was a choice between a close-vote, and a "it's broke" review.
probably worth a meta question at some point.
 
@Jamal One of the things that I find annoying on some sites is that if you haven't written at least 1,000 words, your answer must not be very good.
2
 
Code is supposed to be thread safe.... if it is not, is it off-topic?
 
@rolfl No. Thread safe is an optional requirement.
 
6:52 PM
> Readers-writers problem using wait notify
^^^ implies the purpose of the code is to have read and read/write locks for the express purpose of concurrent usage, that is what the class is obviously supposed to do.... but it does not.
Just because testing for failure is hard, does not make it less broken.
2
I have a 'thing' with people who have code that works fine, in multi-threaded Java, but on a single memory controller, or even more, a single core.
 
a lot of garbage tonight
-1
Q: How create alphabet M using * in JAVA

Harish NarayanHow to create Alphabet M using astricks using java by using nested for loop

 
@rolfl True story there
 
when I use that code on a P750 with 4 sockets, 64 cores, 8 memory controllers, then the NUMA, and cache-line cleaning and other effects, things fall apart.
 
its like the 5th over the past 1 hour
 
-1
Q: How create alphabet M using * in JAVA

Harish NarayanHow to create Alphabet M using astricks using java by using nested for loop

 
6:57 PM
@CaptainObvious U what?
 
JAVA?!?
 
Actually, I think this guy may be earnest.
I am going to get him inhere.
 
Maybe, but it's still off-topic. If I have deleted it prematurely, then go ahead and undelete if you think it can be salvaged.
 
I am giving him the enefit of the doubt... like he posted the working code as an answer to a question.....
He does not have the rep for chat....
speaking of which....
 
Well, I have been deleting other gimmetehcodez contest questions today, so my trigger finger is quite attentive.
 
7:10 PM
Jun 30 at 20:35, by Jamal
@Mat'sMug brb synonymizing [JAVA] and
4
 
UberFox now has enough rep not to need explicit write access...
 
@rolfl 2k?
 
I gave explicit write access to the 2nd Monitor, because he had 1 rep, he now has 34, and can chat here.
 
Wow, Thanks Santas
 
What did we do now?
 
ho-ho-ho
 
@Bhathiya - you're a santa too: codereview.stackexchange.com/users?tab=voters
 
that reminds me, I proposed a new meme:
1
A: What's a Zombie? And what are the many other memes of Code Review?

janosMeme: ho-ho-ho-napalm Originator: Janos Cultural Height: The 2nd Monitor Background: Santa + Napalm Strike combo: you have upvoted (justifiably!) a question and all the answers on it. Declaring ho-ho-ho-napalm in chat indicates that you've just done this, on a question that's being discussed,...

taking a walk now, brb
 
I just surpassed my super user account, Thanks Santas
 
7:42 PM
-1
Q: Storing social media profile URLs versus handles

Srikanth ADLet's say that a website allows users to create profiles wherein, they can enter their social media links like - pinterest, YouTube, facebook etc., Are there any drawbacks for asking users just the enter the "handle" as opposed to the entire URL? For example: http://www.youtube.com/ [enter hand...

 
I need more REP! my job keeps getting in the way of me doing reviews!!!
 
@CaptainObvious more bad questions?
 
@Phrancis how's the music business ?
 
Writing piano and orchestral parts for local pop singers, these times... Haven't had a very challenging/inspiring project for a while.
 
I will get superb female vocals in the next week or two, doing a cool remix of House of the Rising Sun and will then release a digital single, that's going to be exciting :D
 
Interesting
 
^^ Gotta love music in the public domain that's still very popular
 
Thank you!
I'll get it on Spotify, Amazon, iTunes and all that stuff
That will be a nice milestone
 
7:59 PM
:+1:
 
> I will get superb female vocals in the next week or two
^^^ hormone therapy?
4
 
LMAO
 
@rolfl Good catch
 
Hey Nate.
 
8:02 PM
Thank you santa's
 
-1
Q: Phython GUI to search a words

menanaimport Tkinter as tk import re import nltk import threading from nltk.tokenize import RegexpTokenizer corpus_root = 'C:\\nltk_data\\corpora\\muet' w = nltk.corpus.PlaintextCorpusReader(corpus_root, '.*.txt') WORD_OR_TAG = '[^/ ]+' BOUNDARY = r'\b' CORPUS_LOADED_EVENT = '<<CL_EVENT>>' SEARCH_TER...

 
@rolfi Hey! I was not on line last night - child transportation
 
Javascript FTW
0
A: Locking viewport to the top element on window resize

MalachiI just saw this this.viewportOffset = { //offsets before and after resizing may be different in a responsive website // (thinner <p> increases its height due to word-wrap, etc.) oldTop: 0, oldBottom: 0, top: function () { this.oldTop = that.documentOffset.top() ...

 
No problem. I took your problem-space and mocked up a remote camera, and then built a datagram comms unit to talk to it... ;-)
It's been a while since I worked with UDP.
I put together what I believe is an as-reliable-as-reasonable solution that allows you to get good timeout processing, without leaving hanging threads.
 
6
Q: Single class unit test framework in Java

Bhathiya-JaDogg-PereraThis is a single class and dependency free unit test framework for Java. The only assertion available is assertTrue (this can be used for all test cases). What it does Execute all methods with annotation Test. should fail if any arguments are needed. Calculate elapsed time using a given repea...

 
8:05 PM
I made some assumptions about the command, and the response format.
I think some things will improve what I think you are doing, but, also some of my assumptions will be wrong.
 
Thanks to your insight I'm working on a new method that replaces all of the above code with more generalized code. Did I mention that our cameras all have at least 12 bit digitized resolution? I have not been able to talk to our engineer but think that if a command times out there's a serious problem and a hot reset is in order.
 
^^ Should I accept an answer now, 2 is enough right, I think I gave the question enough time to breathe
 
I think the hot-reset functionality is important.
but, it will be slightly mitigated if there's a way to ensure that you know what the state of the camera is.
also, if you can discard all pending data on the wire, and get a clean start.
 
I provide one of two nio bytebuffers for responses. One for the image data 480 x 640 pixels as shorts and a shared 16 byte for all else. I've accepted your answer, BTW.
 
I saw that, thanks ;-)
id id not realize the pixel depth was 12 bit, I assumed the 480/640 was 8-bit...
do you do a 2-byte-per-pixel or do you shift the data?
 
8:09 PM
0
Q: Code Kata My Interface Is Incorrect

heyya99To improve my programming style, I have been writing solutions for popular code katas. I have a written a partial solution for the Berlin Clock kata. I've been trying to follow the SOLID Principles. I have found an issue with the solution because ordering of the returned lamps is incorrect. Can a...

 
I had problems when the datagram on the channel was larger than the buffer.
 
That's one of the things that make the cameras expen$ive ($12,000 to $250,000 each)
 
OK, but the resolution is relatively small ;-)
I also had a problem when the camera dumps the image faster than it is read....
 
Do you mean the input buffer or the channel receive buffer?
 
8:11 PM
The nio buffer allows me to get the image complete without a loop.
 
I thought the image was transferred as 480 datagrams?
when I got the camera to dump all 480 datagrams, it would flood the receive buffer.
 
That's correct
 
maybe my 'camera' is faster than yours ;-)
If I put a 2-frame-per-millisecond rate limit on the datagrams the socket was able to cope.
this was using localhost as a network.... so I expect that a wired network may be OK.
 
Well it probably is, and the embedded computer only supports 100 baseT.
My engineer's transfer time for a whole image using his code is 600 ms.
 
OK, with the localhost, I am getting 78ms.
 
8:22 PM
There's a gap between the receipt of the image and requesting the next. The image data need to be copied to a form that ImageJ can use. i plan that the rest of the processing will be in a different thread. What will happen is that as soon as the image has been received i'll give a command to position the next filter (unless only one filter is being used) that can take nearly 800 ms.
As soon as that comand has been issued the image data are transferred to an ImageJ buffer and processing ensues. I can then reset the buffer and wait until the filter is positioned and ask for another image etc.
We don't know the timing on that yet. I need to request position and attitude data from the INS and create two real images: an annotated TIFF with raw data and one or two JPEGS
 
anyone with a better knowledge of Javascript want to roll back my edit if I am wrong?
 
The JPEGS will be 32 bit images with false color to show landscape fire heat levels and retardant drops if any. Other software needs images from a particular band but the operatior may want to look at any one of the 4 bands.
 
> This message was flagged as spam/offensive by 1 user:
C# < Java
I just saw that one, LOL
 
My computer has an intel i7 CPU, 4 cores and two hardware threads per core. It's completely solid state and designed for aircraft (or ship, or vehicle) use.
I'm using Ubuntu 14.04 server, The newest Eclipse, and Java 8.
On the aircraft the computer will be 'headless' and all communications via a web page.
 
@NateLockwood I think I really like you now
For using Java 8
 
8:35 PM
@skiwi I needed the unsigned int ! :-)
 
It's just a helper library though ;) But Java 8 is cool either way
 
sorry, preoccupied for a bit.
 
Yes, I learned about lambda expressions from Dart and liked them.
 
I think Java Project Valhalla (scheduled Java 10 I guess), can have real unsigned ints though... If implemented as a Value Type, you could perhaps do the conversion at construction time
 
I have data that are from C and are unsigned shorts (mainly) and some unsigned ints. it takes a lot of care (and cost CPU clycles) to do arithmetic on the shorts.
 
8:39 PM
0
Q: Delete duplicates from unsorted linkedlist

JavaDeveloper Eg: if a linkedlist contains 2->3->1->3->4 then the result should be 2->3->1->4. Notice that 3 has been eliminated This code is attributed to geeksforgeeks. Looking for code-review, optimizations and best practices. public class EliminateDuplicateUnsortedLL<T> { private Node<T> first; ...

 
We should just refer the gimmetehcodez people here.
2
 
@rolfi - I'm going to look at your code now and need to get off the chat in case a supervisor (that cares) comes by.
 
No problem. I think you will see some things in there that will interest you, and hopefully help.
 
yes, thanks. I'll be back -
 
@200_success And someone else is posting turd on another question. I'll wait for Community to protect the post, or for the answer ban to be triggered.
What an amazing site! Had I known about it before, I would've posted all of my math problems. :P
 
8:47 PM
Where I want to protect!
 
And someone plagiardized this from Wikipedia...
 
that is a horrible website!
 
And I thought Yahoo! Answers was bad.
3
 
The PCG people could make it worse by posting some answers.
 
@Konijn am I missing something with javascript ternary?
 
8:55 PM
Oh wait... you do have to pay to receive an answer on there. Funny thing is, some of the answered code looks like crap.
4
 
but others can see the answer that you paid for?
 
I guess so.
Or maybe they're free versions, hence the crap. I'm not entirely sure.
 
Something fishy is happening.
One of my old question has suddenly received a lot of up-votes.

http://codereview.stackexchange.com/a/31992/507

Not sure what is happening but it is an old question and I am not expecting any major shifts. Just thought sombody may want to look.
 
@LokiAstari Jamal answered the question today.
And people thought your answer was better.
5
 
I bumped that question with my answer, so yours became visible. It must've been from multiple people, so it's not serial upvoting.
@Morwenn Well, his answer was there before, and it also received six votes afterwards.
 
9:03 PM
@Jamal That's because you came here fishing for votes :o
</bad-morwenn>
 
Nah, I just happened to find it in the recent badges page, and decided to answer. :-)
 
9:19 PM
0
A: Architecture in Obj-C

nhgrifJonah's answer really doesn't address the architectural issue with your code. Yes, he makes valid points about your presumptive casts, but honestly, if this is what your company is talking about when they say your code has "architecture issues", I'd be a little amazed. The primary problem that ...

 
9:39 PM
thanks @Morwenn, I'll check out those tips +1
once again, this guy is posting great answers for me:
1
A: Splitting plain text dictionary data to multiple files, round 2

jcolladoThe code looks good and it's been improved in multiple ways (argparse, index file opened just once, dry-run flag instead of debug one, ...). Hence, this review is going to focus in small details: Please add docstrings to document the code. This will make the code more readable and make easier t...

 
@janos No problem. I just downloaded Python 3.4 yesterday, so there may be some errors in the rewritten code. Be careful :)
 
Santas, can you show him some love?
 
My fingers slipped on the button
 
@LokiAstari There's a new answer to the question
 
9:54 PM
@Phrancis That would make a nice StackApps project.
@Jamal Could you clean the last comments on this answer?
7
A: Clean code attempt on codechef.com FCTRL

Loki AstariCode Review int requestNumInts(); bool validateInputSize(const int totalNumInts); std::vector<int>* createVector(int totalNumInputs); void loadVector(std::vector<int>* numbersEntered); void printNumTrailingZeros(const std::vector<int>* numbersEntered); int findTrailingZeros(int numberToCalculate...

The last two comments were answers to some comments of mine that weren't relevant anymore.
 
Done
 
Thanks :)
I am going to sleep now. See you tomorrow or later!
 
Later!
 
TTQW
 
bye
I'm going too, 3AM here
 
10:08 PM
@Jamal should this question realistically be migrated to Programmers? He's asking an architecture-level question:
2
Q: Architecture in Obj-C

Hitesh NalamwarI am new to iOS development. I wrote this code, but the company said that this is bad architecture and is not acceptable. I want to improve this code. UITabBarController * tab = (UITabBarController *) self.window.rootViewController; UINavigationController * nav = (UINavigationController *) [[t...

 
It seems like it, also judging my the code given. However, they may not want the answers since they're mostly critiques. I think it could just be closed here if anything.
 
Well, my answer addressed the architecture answer... and then I realized... "this is probably a Programmers answer" so I added the critique
 
1
A: Locking viewport to the top element on window resize

MalachiI just saw this this.viewportOffset = { //offsets before and after resizing may be different in a responsive website // (thinner <p> increases its height due to word-wrap, etc.) oldTop: 0, oldBottom: 0, top: function () { this.oldTop = that.documentOffset.top() ...

 
this morning, I had left the comment requesting more context so that a better answer could be given... and then someone else posted an answer anyway.
The posted answer is actually on-topic (as an answer, doesn't make the question on-topic), but the posted answer misleadingly suggests that it is making architecture level recommendations, despite doing nothing of the sort.
 
ah, [tag:Jamalized] ...
hard to get it perfect
 
10:15 PM
@nhgrif Should I close it anyway? It can always be discussed on Meta if necessary.
 
What close reason would you use?
 
and thank you Santas for earlier
 
@nhgrif A custom one, referring to architecture.
 
Ok.
 
Done
 
10:21 PM
I think what bothers me the most is that he came here asking about architecture because his company said his code had architecture problems. He clearly doesn't understand what they mean and want some help. That's fine. But the currently accepted answer doesn't address architecture at all, despite claiming to, and it was so quickly marked as accepted.
Now this guy will go to work and change his code based on the accepted answer, and his boss will go "Okay, that's slightly better, but you didn't address the architecture at all," unless his boss is an idiot and completely misused the word architecture in the first place.
 
The OP could be told about that, though it may not sway his opinion. I probably should've closed it right away, but I suppose I wasn't sure if that was enough code to review otherwise.
 
But the fact that there actually is an architectural problem, and the fact that Jonah's answer isn't something you'd really worry a WHOLE lot about typically (unless his boss is being extremely pedantic) makes me think his boss probably isn't an idiot and he really probably needs to address the issue my answer points out.
 
Maybe he somehow didn't understand yours, or he was just willing to accept the first answer.
 
No, the other answer was accepted before mine was posted.
The question was posted 18 hours ago. I posted a comment asking for some more information 10 hours ago.
Jonah's answer was posted 5 hours ago, and was accepted at least 3-4 hours ago (there's no time stamp on the accept, but I looked at it earlier today and I never saw Jonah's answer posted and unaccepted).
Then I posted my answer an hour ago. And the only reason I posted an answer at all was because I felt that Jonah's answer completely missed the mark on what was actually being asked about and was concerned that the OP already accepted it.
 
The OP also hasn't been around for four hours, so he may change his mind after seeing it.
 
10:31 PM
I know he can change the accepted answer, and I'm not actually concerned with whether or not mine is marked as accepted. It's mostly just a little bothersome to me that someone thinks they could answer the question in the state it was in.
 
Hello there I am looking for improvements and better AI design etc for a game I'm making I also included the game in the article with a youtube video of it etc codereview.stackexchange.com/questions/59737/…
 
Can you explain to me some of your syntax?
This is a complete function, correct:
[Args("false")]
Function Update()
{
    if($Disposed)
        return;
    foreach($AIList as my $AICls)
        if($AICls->DoUpdate())
            return;
}
What's the [Args("false")] mean?
 
it is not really needed but it cause @Args to not be made similar to @_ in perl
 
I don't know perl.
 
bascially it speeds up the script by microseconds
 
10:36 PM
Unless you can tell me what it is in Objective-C or Swift, don't try comparing it to another language. Just tell it to me in a language-agnostic way.
 
not really enough to care about
I thought when making a game very microsecond of speed would be wise
 
I'm not asking you from the perspective of a computer engineer, a language author, a compiler, an optimizer, etc. I'm asking you from the perspective of a programmer who is trying to learn a new language.
 
0
Q: Better organized code and a small loop trouble

user3221454i'm trying to make a simple console application game. the code is a bit messy and i hope anyone can point out if there's something not right. Alternatively, i'm also looking for a way to sum up users' input and add them up separately. For example, round 1: player1 got x points, player2 got y poin...

 
As I said it is simply to speed up the execution of functions a tiny bit
 
You clearly have no idea what I'm asking.
 
10:38 PM
Since it will cause the @ARGS variable to not be created I will get you the information on it
this is the full information on what it does and how it does it
Read from "Unlimited Function Parameters"
 
10:52 PM
Why can't the compiler/preprocessor optimize omitted [Args("false")]?
Since if it's omitted, it's assumed to be [Args("false")] right?
 
It does omit it after the script is read and by default it is [Args("true")] which would mean you have to set it to false if you don't wish to use it.

However if you mean it should set it to "true" if you don't use the @Args variable then I would say that will be done eventually but right now this minute that is not done.
But as I stated it is not needed you can simply forget about ever using it and you will never have a problem
It is best if you act like it is not even there
 
Seems like if it is more optimal for it to be false, then that's how it should default and the preprocessor should optimize it in if it's omitted.
 
Yea I will of course make it flip it based on if you use the @Args or not but that is not the way it works right now in the current beta.
Also it is debatable if it can ever truly be detected.... Since Sputnik is extremely dynamic and people can spawn source code at runtime
So omitting it could be disastrous but that remains to be seen.
The reason I haven't looked into flipping the [Args("true/false")] switch automatically yet is because the user can do Eval() and other statements where strings or files can be loaded into the function as if it was physical code in the function and if that spawned code uses the @args when the preprocessor has disabled it since it couldn't see it being used.... You get the idea?
I will find an optimal solution for it eventually though.
But again the effect of it is so small it doesn't exactly matter in the grand scheme of things and can be left out permanently with no problem.
 
You should probably create a language that is better for the lowest common denominator user. A language that is easier for inexperienced users to write good code with is far more valuable than a language that makes it easier for highly knowledgeable computer engineers to write fast, memory-efficient code...
 
It does both
 
11:03 PM
This Args thing though is just confusing to me...
 
It is not something a normal user would encounter
None of the examples even use it
 
Right... so the default should be false.
 
That is just on my personal code
 
And writing [Args("false")] should be unnecessary.
 
The default is TRUE
TRUE = yes create the @Args
 
11:04 PM
Writing [Args("true")] should be for the advanced user.
Because as you said: "It is not something a normal user would encounter"
 
Exactly
 
Things that the normal user won't encounter should be off and optimized by default.
 
I have friends who code and they never use that
 
Then why is it not off by default?
I've never even seen this sort of language construct.
 
because it provides Infinite Parameters to functions
and that is something people DO use
 
11:05 PM
Some people use
But not the normal people.
 
I suppose
 
I'm fine with you providing a useful option for an advanced user who knows what they're doing to turn it on
But if it's not what the normal user uses, it should be off unless it is explicitly told to be on.
 
Sounds like a good idea
Then if a user wishes infinite parameters they can enable it
 
For example, in basically any IDE with an interface builder, when you drag a button onto the interface, by default the button is enabled, because 99.9% of all users who use a button want it to be enabled.
 
Yea my IDE is like that ;p
 
11:07 PM
However, that button has a property that lets you disable it. But the default is enabled because, well, most people want it enabled.
So your [Args("false")] should be default if that's how most people will use it.
 
In next version it will be
making the change :)
 
And I should certainly be able to completely omit it and still get the optimal result from my code because there's a good chance I'm coming from a language that has nothing like that at all, so I'm not going to use it and I don't know I need to do something special to make my code run faster.
 
Yea it is completely an advanced feature only
not something a normal user would need and you wont find it anywhere but on my code etc
as you can see in the code I posted it is completely optional and not required to be there
like a normal example on wiki does not feature the function rule statements at all
a function is defined as

Function NAME ()
{
}
nothing else is needed for it
There are a ton of things you can add to it though but thats all optional
All examples will not use anything but the most basic
 
if($Cord ~~ Array && count($Cord) == 2) <--- what's the ~~
 
~~ checks if $Cord is a datatype ARRAY
it could also be written as $Cord is Array
 
11:19 PM
Ah, I see.
Does !~ work?
 
Yes
!~ or IsNot can be used
 
What does it return if $Cord is a subclass of Array?
 
Yes
 
Then I'd suggest something like ~~~ to check if the left is exactly the same type and not a subclass
And !~~ to do the opposite
 
Good idea
 
11:21 PM
Like == vs ===
 
Yup
Although ARRAY cant be inherited but classes can
So I will add ~~~ and !~~ for them
Finished adding ~~~ and !~~ :)
 
private int throwOne;
private int throwTwo;
private int throwThree;
A pretty good sign that an Array is what you're looking for: numbered variables.
 
I probably should have used a struct of some kind but I thought a simple array would suffice [0] = X and [1] = Y
 
11:36 PM
0
A: Full clone of the game Pengo

nhgrifI am not familiar with this language (no one is), but I will make some comments about the readability of your code. These are sort of general blanket statements that could be applied to any language, and definitely can be applied here. The only time you ever wrap an if, else, or loop's body i...

It Utils.spk part of the language?
 
No
It is a class in Pengo source
I posted it on the topic
I also posted a rar file of the entire source
just to prevent any more problems like that
it uses :: because it is a static class
 
11:59 PM
You know that the odds of a random number between 0 and 100 lands betweens 0 and 20 is the same as the odds of it landing between 20 and 40, right?
 
00:00 - 15:0015:00 - 00:00

« first day (466 days earlier)      last day (3534 days later) »