« first day (818 days earlier)      last day (3496 days later) » 

12:00
An half-duplex is still a two-way channel, but you can only send or receive a message, but not at the same time
That's a very important point.
Sockets are slightly below eval on my love-hate list.
How?
@Mast Why's that? Is is the clunky API? Or eval is really that evil for you?
I'm currently evalling around by lack of a better alternative.
Sockets have a very good use, but you never want to work with the sockets themselves unless you have time dedicated to doing so.
Why's that?
12:11
I've done some low-level socket handling in the past and it's awesome. It's also very hard to debug and to implement quickly and efficient.
By low-level, you mean Assembly?
Not necessarily.
hehe, sockets in Assembly, now I think that would be a very bad idea :P
Indeed, although I did something in VHDL once which is about as low as it gets.
But you are talking about sockets, sockets != websockets
12:16
Exactly.
I'm not sure what you are talking about now
monking
A socket is basically any connection to the outside.
Whether it's to the web, to a bus, to whatever.
And back inside of-course.
But that's not what we are talking about
A goldfish is still a fish.
12:22
But a catfish, now that's another story...
0
Q: Best way to work with async

PabloI'm searching for a better way to work with async functions avoiding callback hell. Here's what I have (http://codepen.io/rochapablo/pen/xGQvWq): DB = { get: function(params, callback) { setTimeout(function() { return callback([ { id: 1, name: 'Tony' }, ...

pimping C#
3
A: Make the Mexican Wave

BenVlodgiC#, 140 139 135 bytes void f(){var d=1;var s="abcdefghijklmnopqrstuvwxyz\n";for(int i=0;i>=0;i+=d=i==25?-1:d)Console.Write(s.Replace(s[i],(char)(s[i]-32)));} Expanded void f() { var d = 1; var s = "abcdefghijklmnopqrstuvwxyz\n"; for (int i = 0; i >= 0; i += d = i == 25 ? -1 : d) ...

@Mast What about a silverfish?
@nhgrif That's a shark, right?
@skiwi Why would it be a bad idea? You can't get any faster than that!
12:30
@Mast It's an arthropod.
Lepisma saccharina, commonly known as a silverfish or fishmoth, is a small, wingless insect in the order Thysanura. Its common name derives from the animal's silvery light grey and blue colour, combined with the fish-like appearance of its movements, while the scientific name (L. saccharina) indicates the silverfish's diet of carbohydrates such as sugar or starches. == Description == Silverfish are nocturnal insects typically 13–25 mm (0.5–1 in) long. Their abdomens taper at the end, giving them a fish-like appearance. The newly hatched are whitish, but develop a greyish hue and metallic shine...
@IsmaelMiguel That's not true.
@Edward Yea, I meant nhgrif's little beasty.
Anyway, since a websocket is just a specific type of socket, it's applicable.
I don't like websockets though. Let the webdevs handle that. I'm not a webdev.
@Mast Also, what about a starfish?
That escalated quickly.
Or a tarfish for what it's worth.
Anybody here adept with stochastic differential equations?
I'm writing a simulation and need some help understanding one.
12:35
@Edward Not at all. Good luck with that :)
@Edward I haven't used those in a while, but you can try.
@Mast I'm not sure if that's entirely correct, a WebSocket is something that can replace the HTTP protocol, that's all it is
@Edward I have passed Probability Theory and Statistics a month ago
@Edward What?
(That does not directly imply that I know something about it though)
What do you need, some heat or airflow simulator?
12:38
Short version of question is that I have a Langevin equation.
P(t+1) - P(t) = -v_0[P(t) - Pavg] + sigma * xi(t)
Where v_0 and sigma are constants, and xi(t) is a normal distribution.
Question is how to step through time, one increment by increment, and generate P(t) values.
Should Pavg be the overall average value of the function or a running average?
This seems to be way over my head
@Edward I'd say the running average, since you're using it to calculate the next value.
But today isn't friday
Or is it?
yes, it is.
12:41
-.- Nevermind, proceed
There's no point in the total average since you don't have all the points yet.
I need to sleep
@Mast Yes, I think you're right. I tried it using the expected value and the distribution didn't turn out looking right.
13:41 UTC Summer Time
12:42
@Edward Basically you need to store all calculated values and calculate the average every time again or use some weighing factor on the last known average.
The first is the dirty, easy way. The second is the one preferred if the amount of calculations get out of hand.
I have to go. See you later everybody :)
Storing them all might be ugly. I might try an IIR.
@Morwenn See you!
IIR sounds good, should prevent some rounding errors.
// prone to rounding errors, but minimizes required storage space
current average = ((current average * number of previous entries) + new entry) / (number of previous entries + 1);
++(number of previous entries);
SELECT 'Monking!' AS Greeting;
12:47
My database says hello.
@Edward What language should it be in anyway?
I'm writing it in C++
@Phrancis You don't need the AS, at least in MySQL
@IsmaelMiguel Looks like some dynamic variant.
@Mast I don't know, but all I know is that SELECT 'Monking!' Greeting; will work in MySQL
And guess what is burnt today AGAIN?
12:51
@IsmaelMiguel Your pants pizza?
My lunch
I burned it yesterday
And today
How do you burn your food so often?
I forgot I was making toasts
@IsmaelMiguel Using an acetylene torch?
12:54
@Edward Nah, using a normal toast thingy
@Phrancis I can't ask there "How to make the perfect toast?" otherwise I would
Besides, It's the only thing I can "cook"
Besides pizza
Just because you don't need something doesn't mean you should necessarily omit it.
You should try "toast in a can." It hasn't been invented yet, but it's much safer.
You don't need braces in lots of places either.
Or parenthesis.
Or greetings
Or white space.
12:56
"Please review the following piece of code" -- I'm sorry, you seem to have confused StackOverflow with CodeReview.SE. Do you have a specific bug you need help with? — dcsohl 40 secs ago
@Edward How does it taste?
@nhgrif But that site is for people who cook
In fact, in most languages, almost all white space is completely unnecessary.
I can't get near a stove without fearing for my life
@nhgrif Except Whitespace and Python and Spin
@Phrancis linked the site. I'm talking about your suggestion of omitting AS for column aliases.
Oh
Sorry then
In that case, I shall explain that I was just saying it and not implying that he should use it
No one sane will emit the AS there
12:58
In general, MySQL can be omitted altogether ;)
2
That would result in fewer bugs.
@Phrancis SQLite is a good alternative, or MariaBD or Postgre(?)
@IsmaelMiguel what you want to do with the db
I use Postgres for myself
I know
I use MySQL and SQLite
SQLite is not an alternative to MySQL.
13:02
My first DB was MySQL - Have to say I don't miss it much. I keep it around in case I need it for a PHP question or whatever but that's about it :)
@nhgrif apparently the DB structure at my new workplace will be even more messed up than that of my current workplace lol
Yeah.
Man, there's nothing better than greenfield projects...
@Mast Looks like this is close. I am getting a better looking distribution. Thanks!
@Phrancis It's MSSSQL though, right?
Bloated Obama Delivers Press Conference From Couch Behind Podium http://onion.com/1Jz7fXy http://t.co/jAjJm8nupc
Does it do the job you want it to do? If so, Code Review might be a better site to ask on. — Damien_The_Unbeliever 43 secs ago
@Edward Make sure you look at the different parts in the distribution to see whether it goes off, at the start/middle/end. It will tell you what part lacks the required accuracy.
@nhgrif What's that?
13:08
@nhgrif Yes, thankfully
What's what? A "greenfield project"?
It means you get to create all the bugs from scratch.
2
In many disciplines a greenfield is a project that lacks any constraints imposed by prior work. The analogy is to that of construction on greenfield land where there is no need to work within the constraints of existing buildings or infrastructure. == Cellular networks == In wireless engineering jargon, a greenfield is a project that lacks any constraints imposed by prior networks. An example of a greenfield network is the second generation of cell phone networks. The first cellular telephone networks were built primarily on tall existing tower structures or on high ground in an effort to cover...
Creating bugs from scratch is the best way to deal with bugs.
Troubleshooting should be fun; I have it from good sources that they have some very complicated routines, like triggers that fire cursors which then fire sprocs nested multiple levels
That way future generations of programmers can mutter dark curses about you as they try to fix the unmaintainable morass of abominable code that you left as your legacy.
13:11
Which is better than me muttering dark curses about my predecessors as I try to fix the unmaintainable morass of abominable code that they left as their legacy.
Predecessor: "Hey, it was elegant, beautiful and bugfree code until you started mucking with it!"
TTGTW
see ya
0
Q: A scheme macro that defines the "where“ syntax

Earth EngineA new scheme user trying to use syntax-rules to define something like the Haskell where keyword. Sometimes this is useful since when we do programming, we first design in the high level, where all the names left undefined. In later steps, we define those names and complete the program. where key...

@IsmaelMiguel Sounds like you need one of those microwaves with WiFi D:
13:14
@skiwi How would it turn on?
Just as normal?
It only notifies you when something is ready
Oh
That would be awesome!
@nhgrif That seems inappropriate, though.
Also, it's Friday.
What's in appropriate?
Creating bugs from scratch is...morally...wrong. Lol
13:21
Well, you're going to create bugs.
Period.
So don't kid yourself on that point.
I'd much rather have a fresh project that's not full of a bunch of people's crappy code that has bugs no one has found yet.
Because half the bugs you "create" in those projects aren't created but merely exposed.
I never said you wouldn't, but going out of your way to create them...that's despicable. Lol
No one is talking about going out of the way to create them.
So using @Heslacher's answer, and adding some other code, I cleaned my colour class up right quick.
It seems (less?) ugly.
Is it still called "Color"?
Yes.
13:28
:(
But now it only actually represents a color.
Still needs work then.
There's nothing else I can call it...lol
I told you several times yesterday.
Why would I change the name, when the root data it represents is a colour? I changed how map data is stored, that's a different class now.
13:30
k
Why do you need a color class? Versus what's provided?
I can't refer to System.Drawing for one of the projects.
Why not?
Because it's not allowed.
Part of the requirements.
That's not a reason.
I have a meeting
All I know is that one of the business requirements is that I am not allowed to refer to System.Drawing or any sub-namespaces.
Nor can I use System.Windows.
13:33
Have you asked why?
IIRC, it has to be easily deployed as a unix server with the Open Source version of .NET, which omits many of these namespaces.
Please ask one question per post. Some of these questions belong on Code Review SE, because you have already solved the problem and just want feedback about the "acceptability" (can you be more specific?) of your design. Some of the questions, such as the question about synchronized blocks, do belong here, because you have an actual problem that needs to be solved. — Rainbolt 11 secs ago
0
Q: Upload a photo with a unique name using PHP

kexxcreamI have written a script for basic uploading of a single image to a web server using PHP. This is an example that is intended for educational purposes in a basic PHP course. It does not take extensive consideration to security as it is not the focus. Key points to focus on the review: If the co...

0
Q: How to deal with callbacks in code?

Ryan-Neal MesI have written some code to suspend someones enrolment to a course. A course may have multiple presentations. module Enrolments class Suspend attr_reader :enrolment, :responses, :comment, :user_id attr_writer :event_service, :suspend_enrolment_presentation_service def initialize ...

@nhgrif with MSSQL is there a way to declare the datetime field's formatting without using CONVERT? (e.g., at declaration time of the column, or variable)
13:49
DateTime fields don't have formatting, that's a display property.
Afaik, at least.
I don't know @Phrancis
OK
All those conversions are tiresome
I hate Dates
Well... why are you converting them?
13:51
Store the DateTime fields in a DateTime object.
That's not what's being asked @EBrown
I know how to handle them, they are just a pain in the ... hey look a squirrel
@nhgrif Because people here get confused when they see 2015-07-31 13:46:49.380 instead of 07/31/2015 1:46PM
I love dates. A restaurant near us makes this super yummy date bread.
2
They get confused with the most clear representation of the date?
13:52
I don't think I have actually ever had dates
I'd tell them to deal with it.
Otherwise, use convert.
And make a convenient wrapper function if you're always using the same format
I always use a date format of yyyymmdd at the beginning of certain filenames, so that they are automagically sorted for me. I love it
Not a bad idea, @Malachi
13:53
like my finances spreadsheets.
@Malachi Yeah, I put the timestamp or date in all of my log files.
I didn't try to put static with virtual.. I was trying to see if there is a way for this to be null in any way, because I saw that in some code review and I wanted to comment on that but not sure if C# has some crazy feature to bind methods to objects on the fly or something like that — Michail Michailidis 17 secs ago
So in C# structs + auto-implemented properties are a little hinky.
    public Color(byte r, byte g, byte b, byte a)
    {
        R = r;
        G = g;
        B = b;
        A = a;
    }
That's a compiler error.
Adding : this() after the first line fixes it.
someone vote for my answer please! stackoverflow.com/a/31748170/1214743
FGITW FTW
the first answer didn't use a for each. and it's VBA
FGITW FTW?
14:08
Fastest Gun In The West For The Win
Ah.
Well I voted yours up.
@Malachi I thought it was a crappy answer, than I realized it was on SO and it's pretty much average.
4
Stargreed.
It's Friday.
14:13
Thank you, Captain Obvious.
I was hoping someone would finish the song.
There are so many Friday songs...
Well I was thinking the Rebecca Black one, but you ruined the moment. :(
That one's better.
14:15
One slightly worse, but still better than Black's:
Anything Ice Cube is good.
And ofcourse there's Black Friday
> @99moorem - What if there one or many sheets between 1-10 is deleted?
That's funny.
Someone commented that on Malachi's answer, in response to that 99moorem guy being pedantic.
3
A: For loop with nested 'with...end with'

Malachiyou should try this answer http://stackoverflow.com/a/21918281/1214743 Dim WS As Worksheet For Each WS In ThisWorkbook.Worksheets ResizeColumns WS Next WS You could create an array of the worksheet names and then foreach through them, if you don't want to select every Worksheet in the W...

14:18
Which is a pretty idiotic comment.
-.-
@IsmaelMiguel That ain't music.
I'm not sure how VBA/Excel handle it, I am assuming that if Sheet 8 was deleted, then 9 becomes 8, 10 becomes 9, etc?
@99moorem was saying that if they went sheet by sheet with a for loop instead of this foreach loop, what would happen if one was removed?
@IsmaelMiguel Indeed.
14:21
@Malachi I know, but what would happen?
@EBrown depending on how the code was written it would probably break
@EBrown Division by 0
I would assume NullRefExcep.
He posted the exact same comment on all the answers that were posted:
"This will loop around all sheets, not sheet1 to sheet10? what happens if there is another sheet not meant to be processed?"
I never liked Steely Dan.
Trying to be a smart-ass.
14:23
@EBrown It's SO, what else did you expect?
2
Aye, that is true.
@Donald.McLean Does one of your iTunes lists consist solely of Friday tunes?
Correct. It will loop all sheets. If you want to target sheets you will have to do For iIndex = 3 To 5 or whatever your range is. The user stated "I have 10 sheets" and how to "loop through all these sheets". — MatthewD 13 mins ago
gave him the same answer
How did 'Indeed' get starred? It wasn't like I was saying 'lol' or anything.
@Mast Only if that Friday tune is "The Cure" or "Ice Cube".
14:24
@Mast No. I don't have that many.
@Mast is my answer any better now? did you upvote my answer anyway?
I upvoted because "pimp".
@Malachi It's better than the original question (which I downvoted by the way), so well, have an upvote.
Also, if anyone hasn't, can you guys upvote the answer Heslacher posted to my Color struct question: codereview.stackexchange.com/questions/98605/…
14:27
And about best practices: if you want a peer review of your code, please post a question at SE code review. But just quickly, about your code I would tell you that you don't usually do commit or flush to your session everytime you do a modification. You could maybe read thislrnzcig 10 secs ago
It works and it's pretty much the best option available.
@Mast oh thank you!
1
Q: Is this the correct way of writing my Haskell function

DaniqueRecently I started to learn Haskell. I did this by making exercises on the Internet. The problem of making these exercises is that I never know if I solved it the correct way. I currently wrote a function which I think looks really ugly, but I don't know how to improve it. I hope that someone cou...

@Donald.McLean Great :)
14:29
And, of course, The Cure, which was already posted.
@Donald.McLean Thank God indeed!
But The Cure is the only one that I give four stars to.
3
@Donald.McLean Stars? What are those?
@Phrancis He has over 10k songs in his library, ALL starred.
@Mast That means he uses Windows Media Player?
14:33
@IsmaelMiguel iTunes.
@IsmaelMiguel WMP didn't invent stars...
@IsmaelMiguel I use iTunes. (On a Windows device. The blasphemy!)
EWWWWWWWWWWWW iTunes!!!
I've found that with my 40K+ song library that WMP falls on it's face.
In fact, Microsoft didn't invent much at all, they usually grab their ideas from someone else.
@EBrown WinAMP
14:34
I have 10,377 songs in my library.
@Mast I used to love it, then it got all weird.
@EBrown If I had 40k, I would use foobar2000
118 get one star
I don't actually star any songs in my library.
4,119 get two stars
14:35
@Mast WinAMP was discontinued, I think
I reserve stars for CR only.
2,466 get three stars
3,541 get four stars
Also, can anyone assist me with a quick Markdown question?
39 get five stars
Another reason for your nickname Stargazer ^^
14:36
Is there a way to do tables in markdown?
Or do I have to use HTML for that?
@EBrown If you like ASCII tables.
Though technically, that's tracks, since 10 of the five star tracks are Beethoven's sixth and ninth symphonies.
@Mast Damnit, alright. Thanks.
===========================================
   |                      |        |
   |                      |        |
   |                      |        |
   |                      |        |
@EBrown In an answer or question?
14:37
Answer.
Technically a table.
In a quote in an answer. D:
There's a website to draw ASCII tables
Yea, put it behind four spaces.
14:39
Apparently SO blocks the <table> tag?
@EBrown Use this: asciiflow.com
@Mast I see what you did there
there are many SO questions that talk about abstraction and encapsulation. But after writing this code, I felt that the meaning of abstraction and encapsulation is overlapping. I want to understand, what is the difference between abstraction and encapsulation here?
0
Q: Is asking a question that you want to present as a learning experience/challenge acceptable?

scunliffeAs seasoned programmers we're always aware that we can end up with some crazy code scenarios that take some time to pick apart and really grasp what is going on. I recently came across a single line of code that at a very quick glance looks fine, upon closer inspection appears to have a fixable ...

@overexchange If it's a question about SO, ask it in a SO chat room. This is CR.
14:43
You not liking advice on better naming and such isn't a good reason for allowing hypothetical code. — Jamal ♦ 1 min ago
Agreed.
Anyone have a good example of a public SOAP-based service?
I cannot, for the life of me, think of anything off the top of my head.
0
Q: Basic JavaScript quiz app

mtmoranI struggled my way through the first quiz and here are the results. Since I have some experience in jQuery I really wanted to use only vanilla JavaScript. I know the code is pretty choppy and there is most likely a lot of room for improvement. How can I make this code more succinct? What are ...

@EBrown No clue, I try to stay away from XML whenever possible.
I think I found one. I need one for an SO answer as an example, actually.
14:54
Oh my, I love my PHP file so much!
It's a PHP file to handle AJAX requests, and that answers in JSON
It handles things like debug code and SQL errors and all sorts of errors, and keeps it all to send to me in a perfect JSON, no matter how bad things go on the server
@Donald.McLean How many get 5 stars and a heart?

« first day (818 days earlier)      last day (3496 days later) »