« first day (420 days earlier)      last day (3598 days later) » 

7:14 AM
Thanks @rolfl I guess old style joins do come in handy sometimes :-)
0
A: How to use left join like right join in Doctrine

PhrancisNot familiar with Doctrine script, but... This old-style JOIN should achieve the same result as a RIGHT JOIN in most SQL scripts: SELECT parent.*, child.* FROM table child, table parent WHERE parent.id = child.parent_id OR child.parent_id IS NULL;

 
@Phrancis i don't think that's gonna work
you need something like
delete from YourTable
where Hash is null and Accno in (
  select Accno from Table1
  group by Accno
  having count(Name) > 1
);
err, YourTable, not Table1 ;)
but yeah the other answers way overcomplicate it
 
0
A: Performance: What's the difference between the two queries

PhrancisIt is generally better for performance (though a bit more code) to explicitly declare the columns and data types instead of SELECT..INTO. This may be faster: CREATE TABLE #t2 ( id INT ); INSERT INTO #t2(id) VALUES ( SELECT MAX(id) FROM t1 WHERE Period <= '01-11-2013' ...

Let me look that one over, you may very well be right
@DaggNabbit fixed and gave you credit :)
I need to remember to use IN when I'm dealing with an array as opposed to a single value
 
7:36 AM
@Phrancis i had never noticed sqlfiddle before, so TIL something :) it's slow as hell with mysql but websql is fast
 
To be fair, pretty much everything is slow with MySQL...
 
it was taking like 20 or 30 seconds to build the schema though xD
not normal mysql slow, really slow
 
Yeah SqlFiddle is pretty freaking bad
 
i kinda like it but only websql seems fast
i assume it doesn't need to send anything to their server for that
 
I guess not...
 
7:40 AM
the nice part was being able to drop his data dump in there and get a DDL
 
Yeah that is pretty cool.
OK, I think my least favorite thing in SQL so far is UNION
 
lol
haven't used that much
 
Whenever I see it I ask myself, why?
 
my sql is really rusty, don't even remember what that does
 
SELECT * FROM Users WHERE DisplayName = 'DaggNabbit' UNION SELECT * FROM Users WHERE DisplayName = 'Phrancis"
 
7:43 AM
oh that thing
 
This does the exact same thing:
 
where displayname in ('dagg', 'phrancis')?
 
SELECT * FROM Users WHERE DisplayName IN ('Daggnabbit', 'Phrancis');
 
yeah
maybe that's why I never used it
 
I think it's been designed for programmers who think SQL is just like Excel... just copy & paste...
 
7:46 AM
whoa
let me try that again
this thing -- i kind of want to review it
but i also want to totally redo it
not sure that really counts as a code review
 
I think it's overkill for a CR to rewrite the whole thing, though I have done it once or twice out of boredom
 
well the thing is
he's sort of doing it in a raster way
and i think a vector approach would be better
 
Seems like A LOT of code though I know nothing about JS, I can recognize a wall of code
 
that it is
i think it would be much cleaner as a vector approach
but also he's doing things that i know he knows better
like this:
var fh //fontHeight
 
I have no opinion in either direction, like I said... SELECT * FROM CodeKnowledge WHERE Language = 'Javascript' AND UserName = 'Phrancis'
 
7:50 AM
he's gotten on me about bad variable names and this is 10x worse
 
(0) rows returned.
 
well i'm just saying any time you're declaring a 2 letter variable and needing to leave a comment after it to explain what it is...
and the comment is just two words...
just name the variable that, you know
 
That, I can agree with
 
and then other stuff he does is just stylistically weird for js, like white space inside function invocation parens
like he's intentionally posting weird stuff to see if someone will bite
 
I'm not a big fan of cryptic aliases (etc.) just to save characters, I've gotten burn on CR once or twice for that
That does sound odd
 
7:54 AM
that and the braces on newline... nobody does that in js, it's all egyptian braces
you need it in languages like C with long ass typed parameter lists
not in weakly typed languages
if i do review it that stuff is probably just going to get ignored, feels almost like trolling
 
WTF:
};
}());
 
hahaha
immediately invoked function expression
"IIFE"
(function (){ ... }())
 
It makes no sense to me either way, but I would hope if I wrote something like this someone would slap me
 
see them a lot in js because there's no block scope, only function scope
so you have functions that you invoke immediately and never call from anywhere else
 
What's the point??
 
7:59 AM
well
say you want to declare some variables
 
ya
 
and they only belong to the stuff in the file you're working with
you don't want them to be global
so you wrap the whole thing in a big IIFE
 
Ah.
 
(function(){
  // a bunch of code
}());
that's one example
but also
since there is no block scope, things don't always work the way you think they will
 
I may need to Google what a block scope is, sounds completely foreign to me
 
8:02 AM
well in languages like C, any time you have some braces, like in a for loop or whatever, all variables declared inside are local to the "block" formed by the braces
 
Makes sense
 
in js it doesn't work like that, the variable is scoped to the function
 
They are nested within the block in other words?
 
yes, and not visible outside it
since you don't have that in js you end up using an IIFE when you need something like that
 
You're the first person that explained some of this stuff to me that I could actually understand
 
8:04 AM
:)
 
Alas, I think the insomnia is wearing off (finally)
SELECT 'World' AS [Goodbye, ];
Bye @DaggNabbit
 
@Jamal: Well, one of those questions you edited now has a second (and IMO, better) answer:
0
A: Product of all ints in array besides that an index i

Jerry CoffinAt least IMO, this can be solved quite a bit more cleanly than the examples above show. The "trick" to solving the problem efficiently is to produce running products, starting from both the left and the right side of the input array. To keep some of the later code simple, it's easiest to append a...

 
8:33 AM
monking @all
 
9:15 AM
Is this off topic:
2
Q: Do I need to delete a vector?

NapalidonI want to make a graph from input from a text file in the format: vertex1 vertex2 cost time where vertex1 and vertex2 are strings that form an edge and cost and time are the properties of that edge. This information will be used to construct the Graph based on cost. I want to plan out the pro...

 
9:55 AM
0
Q: Uploading a video in Future in S3

Govind Singh NagarkotiI post a similar code previously, but i do some major modifications in code so i am posting it again by deleting the previous question. I am not too familiar with threads and blocking, so can you please review this code for me? Using of Future is enough or not? This code come from here. Note: ...

 
10:05 AM
Monking
 
Monking @skiwi
 
Anyone here watching Moto3 / Moto2 / MotoGP?
 
Anyone here watching this chat?
 
@Nobody maybe
 
Schrödingerchat?
 
10:18 AM
100$ for a Xamarin student license is doable. Now only to find a billion dollar app idea..
 
@JeroenVannevel Make a better Xamarin! And put it in their app store... go balls deep.
 
Can anyone recommend a decent PHP PDO wrapper class to get me started in PDO coding?
 
10:51 AM
Are you looking for a DBAL or ORM? Either way, I would suggest Doctrine
Whoa... the header bar on mobile got a major update
 
11:18 AM
Yeah. Threw me off too.
 
@Corbin thanks, researching the different types and looking at Doctrine
 
11:32 AM
Hello, everyone!
Is anyone active?
 
Hello @HassanAlthaf
 
Can you do PHP, as I want some advice for my code.
 
My PHP skills are very limited/old so better ask someone else
Maybe @Corbin or @MadaraUchiha can help?
 
I need help with logic, @Nobody
 
then php might be the wrong language for you :)
 
11:36 AM
No, no.
 
just kidding :)
what is your question?
 
In a few minutes
 
@Nobody pastebin.com/ppM7Hhun instead of having a function for each and every shit to update, cant I have one function to update display name, rank, email, etc?
Omg Madara is on!! :D
 
well you could try to write a generic "update" function that takes the name of the field to update
but then you would open up your prepared query to variable input which is a security risk
 
What do you mean?
 
11:40 AM
update('Rank', 3, 'username')
and inside the function
update($field, $value, $username)
 
wah?
What is the value thingy?
oh ya.
 
but as $field would go into the prepare it would have to be strongly fortified
to prevent unwanted content from getting into the query
so you are basically trading security against convenience
 
Can you tell me a proper secure way to do it?
No man, I want elegance and efficiency, along with security.
 
well I am no regular user/expert in php so take this with a grain of salt:
I would set up the update function as explained but make it private and offer all those updateRank/updateDisplayName functions that then call the update function with very controlled input
that way you can make sure the function does not get misused
and you minimize the amount of writing that has to be done
 
Watcha mean
 
11:46 AM
for example:
public function updateRanke($newRank, $username) { $this->update('rank', $newRank, $username); }
 
My idea was.
public function handleUpdate {
Wait, I'll write a pastebin
 
Just use public function update { } bind your input like this maybe.. public function bind($param, $value, $type = null){
if (is_null($type)) {
switch (true) {
case is_int($value):
$type = PDO::PARAM_INT;
break;
case is_bool($value):
$type = PDO::PARAM_BOOL;
break;
case is_null($value):
$type = PDO::PARAM_NULL;
break;
default:
$type = PDO::PARAM_STR;
}
}
$this->stmt->bindValue($param, $value, $type);
}`
 
Bind your inputs like this
$database->bind(':username', $username);
 
I use MySQLI
Rate my code?
Mostly a review will be good.
 
11:55 AM
if you have working code, why not post a question?
 
Yeah i agree with Nobody, post a question and ill answer it
 
While using bind to sanitize user input when using PDO is great, what if i need to transfer a users input into a variable, for comparisons for example
 
ok time to put it up on review
 
monking.
 
12:15 PM
0
Q: A more elegant and efficient way to update data

Hassan AlthafMy objective is to update necessary data using one function instead of having different functions to update different fields. So, I've created one and I think this is not really elegant, efficient or secure. I would seriously like a review if possible. Key. $data is an array. $data[0] =...

@MadaraUchiha @Nobody @CodeX
 
Monking @Vogel612
 
and @Nobody answered.
 
0
Q: A more elegant and efficient way to update data

Hassan AlthafMy objective is to update necessary data using one function instead of having different functions to update different fields. So, I've created one and I think this is not really elegant, efficient or secure. I would seriously like a review if possible. Key. $data is an array. $data[0] =...

 
@Vogel612: What was that bit about lame name puns? :P
 
@CaptainObvious I've already linked my question here.
 
12:20 PM
I don't give stars for that.
 
Guys, criticize my code, hurry up! :D
 
So making them is okay?
 
@Nobody sure
 
@HassanAlthaf: It is bad. Feel better now? ^^
 
@Nobody nope, I require high description.
 
12:22 PM
> It's highly bad, because it's OOPPHP
Feel better now?
 
@Vogel612 nope. I need even higher description.
 
@HassanAlthaf: I have a look at it but higher descriptions take some time and hurrying will not make it better
 
@Nobody I know, I was just having fun.
@MadaraUchiha
 
@MadaraUchiha review pls
2
A: A more elegant and efficient way to update data

Vogel612You are vulnerable to SQL Injections. Even when you are using Prepared statements, doing It wrong will kill you. $sql = "UPDATE users SET " . $data[0] . "=? WHERE username=?"; This makes you exposed to SQL injections because your function is not private. You should not allow "user" access to...

 
12:34 PM
@MadaraUchiha Hello :)
 
12:47 PM
PDO and me..
 
0
Q: Login system, PDO and me

CodeXSo on the advice of the SO GODS i have decided to start using PDO. I have run into a bit of a dilemma, binding user input and building a prepared statement is all well and good but what if i need the user input as a variable for a compare? Can i just create a function to clean the input? This ...

 
1:13 PM
Somehow I missed yesterday...... No fanatic badge for me... grumbles
5
 
1:30 PM
@Malachi Unacceptable.
:o
 
1:41 PM
@Malachi How's the election coming along?
 
125
Q: Is there a benefit of compiling your code as you go along?

CaptainCodemanI recently had a job interview in which they gave me an hour to write some real code. It wasn't a huge amount, probably less than 100 lines. After about 45 minutes, I compiled, ran it, and got it to work. I may have spent 5-10 minutes working out compile errors and a couple minor bugs, but ove...

^^ That is why I love Java.
(Or any other language properly supported by an IDE for that sake)
 
Just resigned
 
Ahh, OK.
 
eThere is a ghost 'e' hanging around
I couldn't delete it.....
There may be a riot though, I know I was the favorite to win it.
I was on my phone and my tablet yesterday and probably didn't refresh the page on my browser.....
 
2:02 PM
Sorry, mistakenly posted here.
 
2:23 PM
@govindsinghnagarkoti Hi, and welcome to the 2nd monitor.
 
@rolfl my two questions are locked. i want to to it is permanent locked?
*I want to know it is permanently locked?
 
I have locked those questions.
 
"This post has been locked while disputes about its content are being resolved. "
 
I know, it was mention there
 
They were both modified to re-add tags to them, despite the discussion that was not complete in meta.
I can unlock them again, if you can assure me that you will follow the meta discussions about this process.
 
2:37 PM
follow the meta discussions about this process, what does it means?
what to follow on meta ?
 
4
A: How to add new tags to Code Review?

rolflCreating tags is a privilege that comes with 150 rep. We have found, through experience, that an explosion of tags is a bad thing on Code Review. Just because you can create a tag, does not mean you should. Creating tags should be done with significant fore-thought, and probably discussion too:...

 
A secure is_logged_in function, if you have any links to information you could supply for me to research this please share, thanks
 
i think, i will not create any tag in future ;)
so headache!
ufff
 
I don't want to you to feel that we are trying yto stop you from creating tags.... we are trying to stop you from creating bad tags.
Stack Overflow and Code Review are very different places.
 
i understand @rolfl , am just kidding
 
2:40 PM
Just because a tag is useful on SO, does not mean it is useful here.
Stick around, figure out the system, understand the reasoning.
 
i have a question , may be stupid
 
Ask away.
 
did stackExchange pay the moderators? for those effort they made for the sites
 
No. Site moderators are volunteers.
 
2:43 PM
On the 'beta sites' the moderators are 'asked' to be moderators.
on the graduated sites, they volunteer, and are elected
There are Stack Exchange employees as well, and they moderate the moderators.
3
 
ohh! moderate the moderators.
 
I have unlocked those two questions as well.
 
thank you @rolfl
 
3:18 PM
@GovindSinghNagarkoti Each moderator receives a diamond as payment.
 
and a blue name
 
3:53 PM
Heyaa everyone. :)
 
Hey kleinfreund
 
0
Q: I'd like advice regarding my brute force Caesar Cipher decrypter (Haskell)

CarcigenicateI wrote the following that tries to crack a message that was encrypted via a simple caesar cipher through brute force. I'm fairly new to Haskell, so any and all input is appreciated. Because there are infinite ways that something could have been encrypted, it assumes very simple "offset" encrypti...

 
Hi @rolfl
How is it going?
 
@JerryCoffin Nice one! :D As of now, my zombie from yesterday is one-away.
 
Good, actually. I sort of have a 4-day weekend....
though I will have to do a bunch of work.
 
4:00 PM
That is nice. Well, my weekends are one half doing not too much productive things and one half doing self-educational stuff.
 
Tell us about yourself ... ;-) ?
 
Actually, I currently have internship. The last thing in my apprenticeship. Everything's done.
 
4:37 PM
Monking!
@Malachi I even posted you-know-which-video in chat yesterday!
 
Hey, @RobertHarvey!
 
0
Q: Parsing sections from a log file using F#

Sean KearonAfter reading a lot about F#, I am today cutting my very first real life F# code and I'd appreciate any feedback on my approach. I'm writing a simple utility to analyse a log file. The code below represents my approach for identifying sections of the log and representing them in a structure. T...

 
We don't have any ex-famous dictators today, do we?
 
Okay, who flagged something?
 
Just came in to see the second discussion from Eric Lippert's "best practices of threading" post, but I see there is none, so.
At least there's no cats in here.
But @JimmyHoffa is everywhere.
[waves to the guy with the cement shoes]
Cool post of the day:
77
Q: Can I compute the mass of a coin based on the sound of its fall?

Vinicius L. BeserraOther day, I bumped my bookshelf and a coin fell down. This gave me an idea. Is it possible to compute the mass of a coin, based on the sound emitted when it falls? I think that there should be a way to do it. But how?

3
 
4:48 PM
That sounds definately interesting :)
The best is that someone will be so crazy to actually try it :)
 
Hey Robert, yeah, the post comment never inspired anyone to come and chat ;-)
 
That thread definitely deserves my upvotes.
@rolfl is closing in to 100K sidewide rep!
 
5:17 PM
0
Q: Inventory - how to handle items?

user3123545Hello I've been designing a game server, where player has inventory, bank, and other features with items. There are some definitions of what item can be in my game: Item is either stackable or not stackable. If item is stackable, item's amount can be up to 100 per stack. So since each item c...

 
5:55 PM
Yay for self answers!
Ran into the same problem. Thanks for sharing. I had other problems, though. I had to ignore the interface block that carries the colour data around and hard-code a value in the fragment shader for it to display anything at all. I hope I'll understand why further down the line. — broncoAbierto 29 mins ago
 
 
1 hour later…
6:57 PM
0
Q: J: Initializing array of relative coordinates of all 2D matrix cells, that have common side or point

Capture_A_LagThe program should output this: _1 _1 _1 0 _1 1 0 _1 0 1 1 _1 1 0 1 1 Currently I have this code: (4 ~: i.9) # (3 # i:1) ,. 9 $ i:1 But I think it can be better. It would be interesting to see any other variants.

 
 
1 hour later…
8:06 PM
Hi everyone
 
8:21 PM
0
Q: Preventing session hijacking

TartarI'm implementing a login script and I want it to be more secure: function sec_session_start() { $session_name = 'sec_session_id'; // Set a custom session name $secure = SECURE; // This stops JavaScript being able to access the session id. $httponly = true; ...

 
@Phrancis Hi!
 
What is going on today over in your part of the world, @SimonAndréForsberg?
 
Raining here in the UK too..
 
Ah, bummer. Here in central US beautiful sunny but HOT day... 29 C with 61% hum, pretty sticky
Today I'm packing up my music studio room to move it to the new house... fun stuff, especially the vdrums
 
8:30 PM
Here in San Diego, it's clear, the temperature's nice, and there's just a hint of a breeze.
 
Ah lucky
 
@Phrancis In my experience, there is no luck. There is only...accidental good fortune.
3
 
I'd like to visit California. Especially Salinas area, where the Laguna Seca is
That's well said.
 
Anyone had experience with codeigniter?
 
@Phrancis I've driven by there, but never been around at the right time to see any races there. I've also driven by Sonoma Raceway a number of times (on the way to Napa Valley), but (again) never been around at the right time to catch a race.
@CodeX No (but even if I had, I probably wouldn't admit it).
 
8:42 PM
@JerryCoffin haha, im thinking of switching to a framework but really reluctant as i like to know that the code i have is all i need and when you code something yourself its your baby, you know?
 
@CodeX I can sympathize with the idea, but not the use of PHP.
2
 
@anirudh - Regarding this post, your answer was deleted because it was nothing more than updated code (no actual review). The other user's answer contained some review, but it wasn't entirely a review.
 
Ew, PHP...
I just found by can cushy that says:
ARTIFICIAL INTELLIGENCE is no match for NATURAL STUPIDITY.
Exactly in that font too!
 
PHP is fun!
I am alone in my php darkness..
 
@CodeX I can see the attraction of many languages, even ones I don't care for. PHP, I really can't even understand the attraction. If you really want dollar signs in your variable names, you can use Applesoft.
 
8:57 PM
This is one of multiple examples showing why I don't like PHP, or specifically, how many PHP programmers don't use PHP and SQL together properly
2
A: How is my injection protection?

PhrancisLet me offer at least a partial answer in regards to MySQL and prepared statements. Someone else can address PHP once your code is cleaner. You would exec the following code within your MySQL instance. This needs done only once. -- start creating procs DELIMITER // -- username check proc ...

Look at Simon's great answer though.
Someone once said to me, "99% of MySQL users are PHP programmers that don't know what they're doing" and I can't agree more ;-)
4
 
@Phrancis I thought it was the other way around (99% of PHP programmers were MySQL users who didn't know what they were doing). I guess those don't contradict though. 99% of them use both and don't know how to program in either one (or anything else).
 
@Phrancis Amazing bit of coding :/
Ive been here a few days and learnt so much
4
 
Obligatory interjection:
Her daughter is named Help I'm trapped in a driver's license factory.
2
 
9:23 PM
@JerryCoffin I was going to say that "Bobby Tables is probably one of the most frequent visitors in this room", but apparently that is not the case
 
@CodeX I find this place to be a meeting of the minds of sorts, I love it! (plus it's a good way to pass time when the job is boring)
4
@JerryCoffin That is HILARIOUS.
 
9:40 PM
@SimonAndréForsberg He just drops by once in a while.
 
9:53 PM
I just thought I would start a little coding project for my music business... Would any application programmer here be interested in helping? Mostly in creating an interface to interact with a DB
 
10:14 PM
Any volunteers? We would of course post everything on CR potentially earn tons of rep wink wink nod nod
 
0
Q: Better PHP Autentication Class

XTimeforKillsAuthentication and keeping information secure is my goal with writing my Authentication class while making sure it is extendable completely as possible over making it usable for anything over just hashing passwords. I believe I have made it simple as possible to allow it to hold its own as a cla...

 
@Phrancis Unfortunately I feel that I have plenty of other stuff to focus on at the moment
 
All good friend
 
10:35 PM
Do you think I could post on Programmers with scope of project and ask if someone wants to help? I don't know if that's off-topic or not, nobody seems to know what Programmers is for anyways lol...
 
@Phrancis No, "does someone want to help me a lot with this project?" is not on-topic on any SE site. Chat is your best bet for that.
 
Cool, I'll do that, thanks as always @SimonAndréForsberg
 

« first day (420 days earlier)      last day (3598 days later) »