« first day (449 days earlier)      last day (3560 days later) » 

12:01 AM
There we go.
About 4 years old
 
So basically, you have a Hell Hound
 
0
Q: swing client rests on netty for i/o -- what are the pitfalls?

ThufirWhat are the overall pitfalls with a GUI resting on a netty client? I want to ensure that the netty client which is passed to the GUI doesn't run into or cause any synchronization or multi-threading issues. I'm not exactly sure of the pitfalls. I'm finding my way with netty, and haven't had th...

 
Ah, your's eyes aren't so red
I gotta go program a web app. I'll be back to review some code later
 
Web app... sounds like fun... not
(I hate all web programming with a passion)
Good luck though :)
Just learned about some local Industrial band...
 
 
1 hour later…
1:26 AM
tumble weed
 
1:40 AM
Everyone must be busy playing Destiny...
 
I'm here, but not saying anything since no one else is here.
3
 
I am checking in....
 
using stars...
 
You sure you have them now?
 
2:18 AM
Pretty stormy here, hope power doesn't go out...
 
2:40 AM
0
Q: Structuring Class Objects And Defining The Variables

NichoDiazI am trying to create an outline of what a character is in a game. Then I want to create 10 different characters and compare their stats at different levels. I am creating a class called Character that looks like this, public class Character { String primaryAtribute; double streng...

 
 
2 hours later…
4:39 AM
ah sleeping in on weekends...there is nothing better
 
0
Q: Simple random number generator

DzzsI have been wanting to learn programming for some time now and decided to really give it a shot today. I have edited and read lots of things in Java to fix small issues but never written from scratch. I've tried C and Java but both seemed just a bit too much to teach myself as a first language, s...

 
6:02 AM
0
Q: Create thumbnail in the original ratio w/o empty space

n4nn31355I need to make thumbnails without empty space and in the original ratio. It looks like it works, but please help me check this algorithm, or offer some advice. public function createThumbnail($imagePath, $thumbnailPath, $targetWidth, $targetHeight) { list( $originalWidth, $originalHeight, $...

0
Q: Why this strange infinite loop occurs

cofirazakdoes anybody know why the following code: foreach ($_POST as $new => $new_val) { foreach ($info as $old => $old_val) { if ($new == $old || $new_val !== $old_val) { $change_log[$old] = array("old" => $old_val, "new" => $new_val,); var_dump($change_log); ...

 
6:55 AM
1
Q: Wrapping std::bind call in a function returning std::function

Matt McNabbIs this code correct? It appears to work in g++ 4.8.3 and clang (bcc64), however appearing to work is no guarantee of correctness :) The aim is to be able to replace a call to a member function: void Master::go() { std::string s; func(s); // func is a member function of Master }...

 
 
1 hour later…
8:13 AM
0
Q: JavaScript IBAN Validation

pivovaritI wrote a js function for validation bank account numbers in IBAN format. Please tell me how can I make this better. Cheers! function isIbanValid(value) { var lengthMap = getLengthMap(); //cleanup value = value.toString().toUpperCase().replace(/\s/g, '').replace(/[-]/g, ''); //check if alphanu...

 
 
1 hour later…
9:29 AM
1 hour later
 
9:48 AM
0
Q: Binary search in Java

Arun PrakashI'd like this code to be improved package com.array.demo; public class BinarySearchMethod { public static void main(String[] args) { int[] arr = { 2, 4, 5, 6, 8, 9, 11, 15, 17, 19, 22, 111, 117, 234, 543 }; int search = 2; BinarySearchMethod b = new BinarySearchMethod(); int...

 
10:32 AM
Monking
Wow it's dead here! What the hell happened?! 2d old starred message?
 
Hello @Madara ;)
 
10:49 AM
GOAL!
@Marc-Andre ^^
@MadaraUchiha seems like a busy RL-Weekend for the crowd.
 
Monking
 
11:16 AM
It was, but fair food is amazing.
 
0
Q: Bubble sort code in Java

Arun PrakashI'd like to improve this bubble sort code package com.arun.sort; import java.util.Arrays; public class BubbleSort { public static void main(String[] args) { int[] arr={2,5,1,8,12,3,7}; int n=arr.length; for(int k=0;k<n-1;k++){ for(int i=0;i<n-k-1;i++){ if(...

 
monking @SimonAndréForsberg
 
member for 8 months
visited 248 days, 1 consecutive
 
NOOOO
 
11:26 AM
Yes
 
why
 
Believe it or not, there are more important things in life than code.
5
 
Oh
there are?
 
Also, I will go on vacation on Saturday either way, and I already have the Fanatic badge.
Additionally, I am no monkey.
3
 
Where are you going to?
 
11:31 AM
Someone want to rip apart the bubble sort in a main method?
I took the liberty to call upon indentation and operator freedom.
newlines and method extraction are open.
naming is also an issue.
 
@skiwi France, again. One week.
 
@SimonAndréForsberg Picking up dem girls again?
 
@skiwi Nah, unfortunately not.
Huge thunderstorm incoming here. I'd better shut my computer off.
 
That's some storm
 
12:32 PM
It's just raining quite an amount here. Poor turtle. :/
 
12:49 PM
0
Q: Booths, Robertsons and karatsuba Multiplication Algorithm in python

rvraghav93First off, I am new to codereview. Please let me know if this question and the practice of pasting my code in its entirety is considered a good practice here. I am trying to implement binary multiplication algorithms like Booths, Robertson and Karatsuba. The intermediate results must be binary...

 
1:21 PM
Hot question on Stack Exchange:
17
Q: Carrying Pizza on a Bicycle

user1833028I have a rear rack. However, I don't really have a good way to carry pizza. Cables? Any big enough bags? I can avoid leaning too much, I'll slow on the turns if I have to.. Edit: Delivery? Not in this town. I just want a pizza...

Breakfast time!
Anyone else finding sign-on to be slow today?
 
1:33 PM
0
Q: Android round to one decimal

EPStudiosI im currently working on a tempratur converter app. Everything works but I can get over 5 decimals and I have tried to look it up and search on google but can't find out how do it. Here is where i display the text in the main.java: text = (EditText) findViewById(R.id.editText1); result = (TextV...

 
10
A: Carrying Pizza on a Bicycle

RoboKarenFor the ultimate in pizza carrying, you want a pneumatic air suspension, pendulum-based anti-sway bar equipped carrier. This are/were used by ramen delivery bicylists in Japan, although they are getting rarer (people don't order delivery ramen noodles like they used to) and mostly on motorcycles ...

lolwut, pizza pneumatic suspension system :D Awesome
 
I saw that, it looks immensly useful.
I also recently saw that type of system used for a coffee-cup-holder in your car.....
 
1
A: Are "rants" valid in an answer?

PharapRants are fine as long as the user is addressing the actual question. In the example provided, the 'rant' is not addressing the question. The user does go on to address the question, but the rant is given pride of place when it should be a footnote as it is for the most part not directly address...

The TL;DR version of rofl's answer.
 
I tend to be TL;DR, don't I?
This question:
0
Q: Rounding to one decimal place

EPStudiosI im currently working on a temprature converter app. Everything works but I can get over 5 decimals and I have tried to look it up and search on Google but can't find out how do it. Here is where I display the text in the main.java: text = (EditText) findViewById(R.id.editText1); result = (Text...

hmmm, it's a stack-overflow one.... right? He has a major bug, it does not use his formatter
anyone else having problems with some pages loading slowly?
 
Looks like an SO question to me @rofl.
And no, I'm not having issues with loading times.
 
2:01 PM
0
Q: Singleton Typed Memory Manager

rashmatashFor my resources management, I wanted the objects allocated on the heap to be in a contiguous block of memory. Obviously, each data type then has to have their own chunk of memory. I could have used a vector for this, of course, but the resources need to be aligned properly with a given alignment...

 
2:13 PM
user image
8
 
what a great review! :) Thank you so much. . This community is awesome :) Thanks for your great suggestions :-) — Arun Prakash 1 min ago
> You've earned the "Copy Editor" badge (Edited 500 posts).
 
Well that was quite some thunderstorm...
 
He Lives!!!!
Did the power go out/flicker?
 
Nope, I just turned off and unplugged the computer to be safe.
@rolfl Missed me, huh?
 
Nope.
 
2:38 PM
I must find something to answer, but it's kinda hard :P
 
Someone just posted a re-implementation of a C++ memory management/malloc library.
looks simple, @Undo
 
I don't know C++, though.
 
Me neither .... but, a review saying O, Rly!?
 
@Undo what languages do you use most?
 
Swift, Obj-C, Ruby, PHP, HTML/CSS, some Python
That's about it.
 
2:43 PM
oh, nhgrif probably stole everything you'd want
 
@nhgrif feels like he's the only Objective-C reviewe around .... ;-)
 
yeah and he's quite thorough
 
but, he's (intentionally) answered many questions with partial reviews, there's lots of his recent stuff that could use a second opinion
 
I might go through some old Swift/Obj-C stuff and see if I can spot anything. Is it okay to post a 'that other guy got everything else, but I noticed this' review?
 
that happens all the time
 
2:45 PM
hmmm, looking through, though, a lot of his recent ones have multiple answers (from him)
 
@rolfl Thanks, I guess...
 
Also, posting your own Obj-C questions will keep yuou both happy ;-)
 
true
Heck, I might post some nasty Obj-C I have sitting around ;)
 
there is probably some php stuff that just flew under the radar
I think Alex is the only regular who reviews that
 
@Undo - anything in here: woudl be good: data.stackexchange.com/codereview/query/172449/…
 
2:51 PM
1
Q: Which method is better to check if jQuery has been loaded in bookmarklet

MeysamI am creating a bookmarklet which requires jQuery. So before I execute the main javascript code of the bookmarklet, I have to make sure jQuery has been loaded in the page. So far I have come up with the two following approaches: #1 javascript: if (!window.jQuery) { var script = document.cre...

 
@CaptainObvious something is off about that question but I can't put my finger on it
feels like he just copypasted these two snippets from somewhere else, why would he write the same kind of thing in two different ways and then wonder which one is better
he should at least be able to explain what he was trying to do with each approach and what the differences are
 
0
Q: Red Book (8th edition) Fur Example, not rendering fur (Linux/Nvidia 340.24/GTX675MX)

user3866319I trying to get the Red Book (8th edition) chapter 10 Fur example to work on my Ubuntu 14.04 laptop with Nvidia GTX675MX I've changed the code to use SDL2 and glm but everything else is as it is in the Red Book. The code compiles and runs but the 3d object is not fur shaded. Can anyone spot an...

0
Q: Basic Authentication with C#, XAML and MySQL

marksfI 've been struggling for a couple of days to implement a basic login form in a C# project with no luck at all. The login form consists of two text boxes, the first is for the username and the second for the password. When a user clicks the button, the credentials should be checked against a ta...

0
Q: A flashing exclamation point bar in Objective C, over-complicated?

UndoI have this Objective-C code for use in an iOS app that makes a 'bar' on the screen, with a red exclamation mark that flashes in it at random places. Here's what it looks like: Header file: #import <UIKit/UIKit.h> @interface ESFlashingErrorBar : UIView @property (nonatomic, strong) NSArray *...

 
^ There's an Obj-C one for you
And gtg. cya.
 
Totsiens!
 
3:20 PM
Gratz @Vogel612!!!
 
3:49 PM
@200_success: For the Python random number question, I was going to mention magic numbers (replacing them with constants), but I was afraid to give a syntactically-incorrect answer since I don't really know Python. Perhaps you or someone else could mention that.
 
I am looking for "Simon André Forsberg", does anyone know how to find people on the second monitor?
 
good point @Jamal, taking a look
 
4:04 PM
0
Q: String concatenation utility in C++11

José ManuelI published a concatenation utility lastly and I feel it could be very good help for many people, but before I promote it, I would like to polish the details as much as I can. So I'll like to ask you to review this less than 300 lines of code. #ifndef THEYPSILON_CONCAT #define THEYPSILON_CONCAT ...

 
@Zhuinden Simon is very elusive, you should stick around and see if he shows up
 
@Jamal I wouldn't bother. It's a beginner's toy project with no particular aim.
 
@DaggNabbit I see, thank you
 
I feel like I just wrote a SO answer to a CR question... is this bad?
 
@Zhuinden You could always ping him like this: @SimonAndréForsberg
 
4:10 PM
shhh sy
you are ruining my fun
 
Sorry, my rob0t side has problems parsing jokes :/
 
@200_success I think it's good to be aware of PEP8 and magic numbers early (I already answered)
 
Hey there @Zhuinden
 
Perhaps his sarcasm-detection mechanism is a little...
*puts on sunglasses*
... rusty?
5
 
hey it worked :D @SimonAndréForsberg hello there
@SimonAndréForsberg so you mentioned we should meet here as per this question and its comments codereview.stackexchange.com/questions/57543/…
 
4:16 PM
@Zhuinden Yes, I'll read your comments again quickly now so that I can remember what I wanted to say :)
 
@janos Yet again why I shouldn't review right before going to bed. :-/ I've missed that obvious calculation simplification. +1
 
@Jamal better pointing out 1/2 than 0/2
 
@Zhuinden About this: While it's true that those constructors are implicitly called (same for super()), a Fragment must have a no-parameter default constructor (although the IDE tends to tell you to use fragment.setArguments(Bundle) instead, because Bundles are kept throughout the lifecycle even after destruction and reconstruction, but constructor parameters are lost). The fragments technically have a no-parameter default constructor even if you remove it.
 
I'll just add that yet again on Stack Overflow at stackoverflow.com/questions/24971570/… there was yet another bugfix merely by using reformatting code to Allman style instead of K&R and thus finding an incorrect placement of the ending curly brace of a statement block - which is why I did not go with the Java convention as I dislike it for this reason (this is not the first time I've fixed code by formatting it)
 
As long as there's no other constructor defined, it will have a default no-arg constructor.
 
4:19 PM
Doesn't this still sound off-topic? The code has been included, but the OP has an off-topic request.
 
Indeed that is true. However, if someone were to define a parametrized constructor (which is terrible practice and the IDE warns you about it to use setArguments(Bundle) instead), then if they don't define a default constructor, it'll cause an error. That's why I included it, as it is needed for functioning. But otherwise you are indeed correct, it isn't technically necessary to write it out as long as there is no other constructor (which there shouldn't be).
 
@Jamal I believe it is still off-topic.
 
So I figured providing an explicit no-arg constructor would show that it's required to have one of those, just in case. Much less confusing than the static Fragment newInstance() methods that I'm not sure why they're even there in the auto-generated code.
 
@DaggNabbit looks like a fine answer to me, esp nice touch with the fiddle
2
 
@Zhuinden I think that SO bug could happen no matter which style you were using. I see no one in that question actually recommending the C# style that you use though.
 
4:23 PM
@syb0rg I'll just switch the off-topic reasons, then.
 
@SimonAndréForsberg indeed they don't, as that's against the "Java convention". Doesn't mean I haven't fixed errors like this just by copy pasting code into my IDE and using my format setup for C# style on it. Most people argue that K&R looks better because it uses less lines - which could be true. However, the misalignment of the control statements in if - else if - else if - else tend to mess people up, including that guy, including me, and including others.
 
@Zhuinden Good point about adding the explicit constructor. It's better to add an explicit one than to avoid having it and accidentally adding another constructor. However, I believe that the no-arg constructor is only necessary if you use the Fragment as an XML. i.e. use a <fragment class="com.mypackage.MyFragment"> (don't remember the exact names but you get the picture)
 
@SimonAndréForsberg basically based on experience, the C# style is easier to understand if there are more complicated statement blocks, nested ifs and for loops and such.
@SimonAndréForsberg the System recreates the Fragment using the no-arg constructor if I recall correctly, in case it is destroyed and only its state is preserved, as in for example in a FragmentStatePagerAdapter.
 
@Zhuinden Your example is hardly an argument. Code without indentation and with inconsistent brace placement is crap, period. Please refrain from inciting such debates on Code Review and The 2nd Monitor.
 
@Zhuinden Just to provide another example, I've seen code like this if (someCondition); and then the { on the new line (C# style), such semi-colon bugs are easier to detect if the { was placed like if (someCondition); { (This has appeared in a SO question)
 
@200_success noted
 
@Zhuinden Personally, I use Java coding style when coding Java, and C# style when coding C#.
 
@janos thanks... I still need to get used to the idea of partial reviews; there's some little stuff that isn't addressed like variable names, but someone else can tackle that
 
Also, when having too much nesting, it makes an ideal opportunity for extract method
 
Novel idea =) ^^^
 
4:32 PM
@SimonAndréForsberg I've refactored code by hand but I actually haven't used the extract method feature before, and I guess that's true. Extract method takes a fraction of the code, makes it into its own independent method, and gives the result back as a return value, right?
 
@ckuhn203 And someone still put in a reopen vote.
 
@Zhuinden Yes, that's what it should do. It doesn't matter if you do it manually or automatically by using the IDE though, the principle and the effect is the same.
 
@SimonAndréForsberg I see :) Well if there's one thing that I maybe should have added would have been the setArguments(Bundle) call, considering the reason why you mustn't specify parametrized constructors on a Fragment is because the constructor parameter is lost, but the Arguments bundle is maintained by the system even if the Fragment is destroyed and reconstructed.
 
@Jamal That was me accidentally. I saw the close topic was that he didn't include his code, and in the edit I saw he included his code. I can't retract unfortunately.
 
@Zhuinden That makes sense, yes.
 
4:38 PM
@syb0rg Someone else actually put in a newer reopen vote (I cannot state whom).
 
@Jamal Ahh, I have my methods of finding out anyways. ;) He might have been fooled like I was.
 
Oh yeah... :-P
I mean, mods can still see individual close/reopen votes, even outside of review.
 
@SimonAndréForsberg thanks for the input by the way, it was helpful :)
 
@Zhuinden That's good to hear. Remember that you can mark my answer as accepted. You don't have to do it though.
 
4:50 PM
well it's the best answer so far, and it has been fairly helpful, and I honestly have doubts about that someone would be able to prove that jamming every single bit of application logic AND presentation AND state handling into a single überclass (Activity) as it would occur eventually using the static class Fragment approach. :)
+is better in any way (the end of the sentence was missing, whoops)
@SimonAndréForsberg and so I accepted it
 
Yeah I really don't like the static class Fragment approach, or rather: I don't like überclasses in general.
Thanks for the accept!
 
@bazola is becoming a reviewer!
3
A: A flashing ! exclamation ! point ! bar

bazolaI'm just a beginner myself but I feel like I can point out a few things in this code. First, I would add some white space at the top of the file here: #import "ESFlashingErrorBar.h" #import "ESThemeManager.h" @implementation ESFlashingErrorBar #define kNumOfPoints 7 int lastFlash; Instead ...

 
And it's a pretty good answer IMO^
 
CR turns yet another asker into an answerer!
 
@ckuhn203 He's learning well from @nhgrif
 
4:54 PM
Doesn't it make your cold metal heart all warm and fuzzy @syb0rg?
 
@ckuhn203 Yes. I need to turn the liquid cooling on now :/
 
Man, it is seriously tough to write that first review. There are a lot of great programmers around here. It's intimidating.
 
@Jamal Next up: JavaDeveloper?
 
Hey again
 
Damn right. Had I not been able to squeeze in some reviews amongst the more experienced users, I would still be a peasant on Stack Exchange.
@SimonAndréForsberg Only if he first learns not to post a code-only answer.
 
4:59 PM
If love to see him post some answers.
Hey @Skiwi
 
How can so many high-rep users on SO be so dumb sometimes?
4
@syb0rg - We are in C land. Not C++ — Ed Heal 2 mins ago
@EdHeal A lot of C projects end up implementing a vector-like API. Dynamic arrays are such a common need, that it's nice to abstract away the memory management as much as possible with vectors. — syb0rg 2 mins ago
 
Hmmm I feel like writing some ...
 
I don't
2
 
There are some SO users that is like to see converted to CR. mehow and DavidZemens come to mind.
Speaking of high rep users saying dumb things...
No, it isn't a copy. stackoverflow.com/q/4908692/11683, stackoverflow.com/q/20145564/11683, stackoverflow.com/q/4383167/11683. The "strict scope" bit is also confusing - there isn't one. I believe in any language you can pass your method-local variable to another method as an argument - because you decide what to provide as an argument; no one can steal your private variable unless you permit it. If you don't want the code you're calling to be able to examine recordset's Connection, then populate the recordset in advance and clear the connection before passing it. — GSerg Jul 24 at 12:42
Just remember, if you clear a recordset's connection, you've disconnected it and will no longer be able to use it to write back to the database. — ckuhn203 1 min ago
 
5:19 PM
1
Q: Using a static variable inside a lambda

w.bIs using a static variable in a lambda function ok, or considered a bad practice? The code below works as intended (fills a vector with consecutive numbers). #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { vector<int> vec(100); generate(vec...

 
Howdy @Mat'sMug
 
Huzzah
I see a representant of the silent majority posted on meta (the rants post) - I like.
@ckuhn203 commands work, it's awesome. I went to bed at like 4am, butchering refactoring the whole thing. Not being able to derive an interface from another kinda sucks, I guess I've hit the bottom of the rabbit hole. Will put up for review later today :)
(AFK)
 
5:35 PM
0
Q: Manually terminating my threads is becoming a mess

user3758041I have a problem with my multithreaded application. I have this method in a thread that interrupts all the current threads running. It does this by storing an ArrayList of these threads. Here's the code: public synchronized void foundNumber() { for(int i = 0; i < threads.size(); i++) { ...

 
^^ unfortunately off-topic
(nice title though)
 
Umm, that doesn't look right Yosemite
Unfortunately, I don't even know what caused that to happen. I filed a bug report, but it wasn't that useful.
 
be back later...
 
Woah... monkey earned Copy Editor?!?
 
6:04 PM
Question about C-style: Do you think the asterisk in the pointer should be paired with the type or with the variable name?
Like char* name; or char *name;?
 
@syb0rg I'd say with the type... as to me (not a C expert nor even intermediate) it feels like a type
I absolutely disgust char * name though, that's like eople who don't know where it belongs at all
 
I thought it's done with the variable in C, and the type in C++.
 
@skiwi I hate that too lol.
@skiwi I feel like it should be this too, but then I saw this: c-faq.com/decl/spiral.anderson.html
 
void (*signal(int, void (*fp)(int)))(int); this looks like something I wouldn't want to encounter either way
2
 
@syb0rg The fact that you such a Clockwise/Spiral Rule has been created just tells me how C wasn't created to be readable, apparently.
> ``signal is a function passing an int and a pointer to a function passing an int returning nothing (void) returning a pointer to a function passing an int returning nothing (void)''
That's just crazy.
 
6:12 PM
@SimonAndréForsberg That's a highly complicated "thing" that I hope I never have to use. In fact, I'm not even sure how you would use it...
 
@syb0rg That's what I was thinking. I think that example is overly-complex.
> ``fp is a pointer to a function passing an int and a pointer to float returning a pointer to a char''
Already it became a lot clearer.
 
still complex!
 
6:29 PM
2
Q: Loader animation using Custom View in Android

TejasI created a loader animation for an android app. A simple 3 dots loader. Is this the correct way to animate by using TimerTask ? public class ThreeDotsLoader extends View { Paint dot1; Paint dot2; Paint dot3; int defaultColor; int highlightColor; boolean animationStarted = false; TimerTask ...

 
6:50 PM
Hey there Code Review
 
Hello @AlexL
 
0
Q: Best practices when testing action methods that use a mocked repository?

Caster Troy[Test] public void Post_ReturnsCorrectModel() { var post = new Post { Slug = "continuing-to-an-outer-loop", Title = "Continuing to an outer loop", Summary = "When you have a nested loop, sometimes", Content = "When you have a nested loop, sometimes", ...

0
Q: Binomial Heap in Haskell

InaimathiHere's a partial binomial heap implementation in Haskell (just merge and insert): module BinomialHeap where data BinomialTree a = Tree { key :: a , order :: Integer , subTrees :: [BinomialTree a] } deriving (Show)...

 
7:11 PM
0
Q: Midi sounds unintended hover actions and dynamic focus on two panels

LegatoThis is the newest iteration and follow-up question to Using sounds in Java As it is, the program does what I need it to but there are some issues that I'd like to understand/fix if possible: 1 - I run this on the command prompt I see the following message, but I have no idea why it comes up. ...

 
7:40 PM
0
Q: Haskell - Find the largest prime factor of the number 600851475143

Kevin MeredithI implemented the following for Project 3 in Project Euler: --Problem 3. The prime factors of 13195 are 5, 7, 13 and 29. What is the --largest prime factor of the number 600851475143? prime :: Integer -> Bool prime x = prime' x (x `div` 2) where prime' _ 1 = True prime' x y ...

 
8:03 PM
Very quiet in here....
 
I'm still here.
 
Ditto, just had to do a quick reboot.
 
Okay, so here's a question: We have one tag. Some questions refer to actual animation (games, frame by frame, etc.), and others are "web" animation (fading, little movements, etc.). doesn't have a wiki, so what animation is ?
Is it an all encompassing, "objects move, it's animated" tag?
 
Animation is the process of creating a continuous motion and shape change illusion by means of the rapid display of a sequence of static images that minimally differ from each other. The illusion—as in motion pictures in general—is thought to rely on the phi phenomenon. Animators are artists who specialize in the creation of animation. Animations can be recorded on either analogue media, such as a flip book, motion picture film, video tape, or on digital media, including formats such as animated GIF, Flash animation or digital video. To display it, a digital camera, computer, or projector are...
@AlexL I think so. Why not?
 
I read that... I felt that "rapid display of a sequence of static images" didn't really pertain to "web" animations
i.e CSS animations
 
8:19 PM
I so hate this
Some TV channel is broadcasting a game (of darts) delayed, now I've accidentally already seen the result on some newssite
 
9:13 PM
0
Q: Functionally Typed I/O Streams

Ryoichiro OkaI thought up a function that provides types with InputStream and OutputStream: trait Format[A] { def read(i: TypedInput): A def write(o: TypedOutput, a: A) } trait TypedInput { def i: InputStream def reads[A](implicit f: Format[A]) = f.read(this) } trait TypedOutput { def o: OutputStre...

 
9:52 PM
@Undo - head's up, swift came in
 
0
Q: Usability of this Observable class

drewagI created an Observable class that allows me to subscribe to a wrapped value. The implementation looks like this: class Observable<ValueType> { typealias DidChangeHandler = (oldValue: ValueType?, newValue: ValueType) -> () // MARK: Properties var value : ValueType { didSet ...

 
Hey @rolfl would you mind giving me your opinion on the 2 answers on this question? Being that it's real business code and going with one or the other would make the schema design fundamentally different, I'd like the opinion of someone more experienced
I like cimmanon's shorthand table naming, e.g. product.Id as opposed to product.ProductId
I certainly would like @Mat'sMug input as well ^^
 
0
Q: Controller that uses repository tests

Caster TroyI have a controller called PostsController public class PostsController : Controller { private const int PageSize = 8; private readonly IPostsRepository repository; public PostsController(IPostsRepository repository) { this.repository = repository; } public Vie...

 
@CaptainObvious I like that guy's indent/bracket style!
 
10:09 PM
@rolfl saw it.
thanks
sigh I'm too tired to even understand what that does :P
 
Already voted :(
 
Dito.
Hurrr durrr mobile chat making me mad again..
 
0
Q: How to generate sequence that uses the previous outcome for the current

user2609980In Ruby I do not like to use while-loops. I was wondering how to generate a "squared sequence" (e.g., squares the first input, then squares the outcome, et cetera) in a more idiomatic Ruby way than this one: value = 2 while value < 10000 puts value = value**2 end # => 4 # 16 # 256 # ...

 
10:42 PM
@Phrancis - three things:
1. I tend not to use DBMS_specific features since I write applications that support DB2 SQL Server, Sybase, and Oracle.
2. Cimmanon appears to be speaking from specific experience, and I would value that answer carefully, some experience may be bad, and some may be good, and just because his experience with enums is bad may be because he used them wrong. Still, my instinct is to trust his answer.
3. Apart from the enum content in 200's answer, I would go with that too.
 
@Phrancis He's giving a lot of holy war advice. There are two camps on most of the things he points out. He's not wrong about any of it. You just have to make a decision based on what you think makes sense.
 
My PostgreSQL experience is ..... zero
 
I think he's right about the composite keys for Phone, but I question using text fields as keys.
It's slower than an int key, so it's semantics vs. bleeding edge performance.
 
^^^ that, and, historically I have always used int keys
and he claims int keys and small text keys are ewually fast. He may be right
I have typically used in for storage size.
If you have an 8 character text field, in unicode, that's 4 times larger than an int, so, for 1 billion records, you save ..... 12 gigabytes
 
Although, I wholeheartedly disagree with using just plain "Id" as a key field.
I prefer the way you named those @Phrancis, but I'm obviously on the other side of the holy war on that one.
 
10:48 PM
Id as a field is interesting. I have seen it both ways, and, basically, I tend to prefix all columns I use, so Product.ProductID is redundant
 
It is!
 
But, Invoice.ProdictID is nice.
 
But once you've aliased it, think about the Where clause.
Select *
From tableA a
Inner Join tableB b
    On a.ProductId = b.ProductId
is much nicer than
Inner Join tableB b
    On a.Id = b.ProductId
 
^^^ I would agree with that.
 
It's really a matter of taste. Consistency is the important thing.
 
10:52 PM
^^^ and that too
 
Ah OK thanks for the input. Guess I'll have to just give it some thought. I really wanted to stay away from product_id but had not taken into consideration that pg converts everything to lower case by default (wish there was a setting to disable that) so it's either productid which is ugly, or "ProductId" which is a PITA to write in every query...
When it comes to naming, I really don't mind verbose column/table names, I like that it makes everything unambiguous
The one good thing I see about the underscore method is it makes it easy in Excel to find/replace the underscore with a space and make the report look nicer... for all that's worth
 
777 rep on SO! :D Today is my lucky day.
4
 
Saving myself having to write a bunch of column aliases
But still, I was really hoping to just use PascalCase throughout because it's nice and efficient
 
0
Q: Unit Testing for isPrime function

ckuhn203I've decided that I want to take a stab at test first programming. So, before I tackled writing an isPrime function, I wrote this unit test. It's my first and I'm not sure I'm doing this right. I was thinking that I might want to extract the loops to just two methods that I would pass an array t...

 
@Phrancis - COnsistency is key. I have worked too many places, in too many languages to be clear on what's right
3
 
11:07 PM
^^ Best advice I've heard all day :)
I wonder why my question was downvoted, twice. I normally leave a comment if I downvote for any reason.
Alright, I let an end-user (my wife) make the call, which do you like better:
product_id
"ProductId"
productid
She said, "Underscore." So, underscore it is.
 
11:35 PM
@rolfl the one thing now that really perplexes me is "Instead, you should be dropping the use of serial columns as your PRIMARY KEY in cases where you have a guaranteed unique KEY."
It sure as heck would make joins and queries easier, but at the same time it somehow feels dirty...
The GUI will be written in Java and so pretty much all the user choices will be pre-validated (using things like drop-down menus for Person types and such) so the EU will never be able to pick an invalid selection... My gut feeling is to stick with SERIAL as PK on all tables...
(to translate, SERIAL column definition is same as INT NOT NULL AUTO_INCREMENT)
 
@Phrancis In my experience, a guaranteed unique key is rarely all that guaranteed to be unique.... Which one was he talking about?
 
CREATE TABLE PersonRole(
    -- look, no serial
    PersonRoleName TEXT PRIMARY KEY
);
 
@Phrancis That is very standard
 
(as an example; it would apply across multiple all "outer" tables)
 
I would have the ID columna s int not null primary key, and add a unique constraint to the other anyway.
whether the id col is auto increment or not does not matter.
(from a DB perspective)
(can't type well in bed)
 
11:45 PM
0
Q: Dictionary load function using hash table

AndyBelow loads a dictionary text file into memory to be used as part of a spell checker. #define TABLESIZE 500 #define LENGTH 45 bool load(const char* dictionary) { //initiate hash table node* hashtable[TABLESIZE]; //open dictionary and check FILE* dict = fopen(dictionary, "...

 
What rofl said. That's what I'd do too, but there's really nothing wrong with the other way that suggested to you.
 
Phrancis, if I can say this right .....
I have been exposed to so many databases, so many dialects, so many version changes, so many new features, so many styles, so many languages and API's, that I struggle to see any consistency
4
 
OK... so, I think what I'll go for is this: 1) Name columns and tables with underscore instead of PascalCase; 2) Stick with verbose column names, e.g., no person.id and product.id to eliminate ambiguity during queries; 3) Stick with serial (int) as PK throughout.
 
so, I always use the most specific, well aliased, correclty specified, right case, everything when I write SQL (at least I try).
 
^^ that's what I'm striving for, just getting mixed messages :)
 
11:50 PM
So, in reality, I don't particularly care whethe ryou use ProductID, or ID, or Product_ID or pid, or prodid, or whatever.... just so long as when I am doing one particular task, it is consistent
 
Yup. that^
Consistency across a single database is about all a sql dev can ask for.
 
I want Simon to look at my code and be like, Man, that Phrancis guys is explicit
i.e., no Hungarian/Scottish notation :D
Well - Time to refactor this whole thing
Do you guys think this is overkill?
CREATE TABLE Email_Type(
    Email_Type_Id SERIAL PRIMARY KEY,
    Email_Type TEXT
);
INSERT INTO Email_Type
    (Email_Type)
VALUES
    ('Business'),
    ('Personal')
;
 

« first day (449 days earlier)      last day (3560 days later) »