« first day (861 days earlier)      last day (3158 days later) » 

12:00 AM
RELOAD!
There are 1504 unanswered questions (94.4035% answered)
 
@Mat'sMug Hey, I just re-read the chapter, and it mentions Shrek!
 
HA!
 
@Hosch250 Huh? That statement seems very out of context to me right now.
 
Monkevening
 
@EthanBierlein Go read the Nth Monitor.
 
12:07 AM
I got to put together some brand new fun hacks in SQL today :D
 
I'll be building a database over the weekend.
One more chapter, and I build the database, then the next two are on SQL.
 
Oh nice, what DB engine?
 
SQL Server.
I'm glad it isn't MySQL.
 
Good for you, SQL Server is a joy to work with compared to most others
 
@Hosch250 Thanks for the info, Shrek.
yeaaaaaaaaaaaaaaaaaaah
 
12:08 AM
@Phrancis The U picked it. The one thing they got right.
This entire class uses MS tech - SQL Server and Visio.
 
MS has a good tech stack, all things considered. Except VBA ;)
 
Yep.
Unfortunately, they are completely stuck with that.
 
Signed a big bucks contract with MS?
 
@Phrancis No.
 
@Phrancis shhh
 
12:10 AM
The only MS jobs in town are sales jobs.
I have to take my internship in town.
Like, I could be an Azure technical sales sort of person.
 
Does your internship have to be MS tech?
 
@Phrancis Of course not!
I can do anything I please.
I just think it would be fun to work on Office.
 
Then there's nothing particularly "unfortunate" about it :)
 
@Phrancis Unfortunate for their maintainers, and us end users...
Supper time, see you later.
 
Who is "their"?
 
12:12 AM
MS's.
 
Yeah okay, I love NodeJS. I add a package (npm install --save-dev compression), add a line of code (app.use(compression()); and suddenly my XHR requests go down from 12.7KB and 25.1KB to 1.1KB and 3.1KB.
4
 
@JeroenVannevel Please type this by itself: "Yeah okay, I love NodeJS."
 
And make it easier to quote me later on when I swear at it?
2
 
So I can quote you next time you're fussing about JavaScript ;)
 
I'm not falling for that
 
12:14 AM
Aw
 
I'm on to you
YOU'RE AN OPEN BOOK TO ME
 
Not an open workbook, I hope; else you might need VBA to read me
Hey general question; is it possible to script with C#? Or make really small, single-purpose programs, alternatively?
 
Yes
Sort of
But no
 
No to the former but yes to the latter, perhaps?
 
There was a scripting engine in the Roslyn CTP but they removed it in the release version
however
They've put it back in in the nightly Roslyn builds
So the script engine should be available at the next Roslyn release
 
12:17 AM
The what builds? Who is Roslyn?
 
A nightly build is like.. a developer release that gets updated very frequently
Oh. Roslyn is the new C# compiler platform
 
That's a weird name for a compiler.
 
@Phrancis cough what is
 
I agree. Jacky would've been much better
 
I wonder if they'll implement F# for Roslyn
 
12:19 AM
Inserting data through a frequent cron
At least it's getting sexy already
@EthanBierlein I'm not aware of any plans in that direction
 
So in Java I have made really small programs (single file usually) you can do that with C# too right?
 
@JeroenVannevel bah
 
Yeah of course
 
@Phrancis Mhm
 
All you need is a class with a Main method
 
12:20 AM
does Visual Studio Code support C#?
 
OK good. My work machine doesn't allow (very easily) for non-MS tech, as I am not on the mobile team
 
"scripting" refers to just a single line of code, like an expression for example
 
I would have guessed scripting was where you can run code without compiling, like JS or Groovy
 
Or Python
 
(some Groovy)
Or Python yes
Or VBA :D
(I've written a few VBA scripts inside Excel that had nothing to do with Excel, but a convenience rather)
I guess "macros" is the right word, rather than "scripts"
Had to hack at this today:
in Cardshifter TCG, 3 hours ago, by Phrancis
Oh yeah, we also have many dates stored in this garbage format, no idea why... '20150911||||||||||||087-34'
I'm not sure who thought this was a good idea, but somehow SQL is able to store that as a datetime type...
 
12:30 AM
Since this is working code, I recommend you post it on Code Review instead of here. — briantist 9 secs ago
 
Owait no, this was setup as a varchar() column I think on this database only, whereas the field by the same name is a datetime is every other database
 
@Phrancis Are you going to get the DBA to change it?
I suppose that would break absolutely everything, though.
 
The data comes from devices in the field :(
(and not necessarily modern devices)
So yes, your assessment that it would break everything is likely correct
I think that^ is the kind of devices the data comes from
Actually, I'm quite certain that it is
 
0
Q: Speed up R code by rewriting embedded loop with apply

Dirk HauptYes I know about apply, but I'm not sure how to write it so that it works for embedded for-loops with if statements and so forth. It gets messy. I am a novice so if you can show me how to properly rewrite the following efficiently it should help a lot. # Subset between start and end with bin c...

0
Q: Make pixels unique

KyranstarI'm writing a program that takes an input image, and generates a set of unique colors, and repaints the image using only those colors. It takes a long time, and I'm hoping to improve the running time. It's on github, if you want more context. This is an example of the output, running from left t...

 
It also gives out clunky name information...
NAMEFIRST | NAMELAST | MI
---------------------------
FRANCIS^A | VEILLEUX | NULL
(hint: middle initial is A)
Guessing the devices don't support a MI field, so they just put that caret then the MI in the NAMEFIRST field
Probably COBOL or some other evil thing
 
Anyone needing a first post?
 
1
Q: Querying list of servers with PS to report on Scheduled Tasks

user3029809I work in a Windows environment where Scheduled Tasks have never been documented or kept up with, leaving us with about 150 servers that have a random smattering of tasks. I am attempting to construct something that will query specific information about these tasks and output them in a pretty for...

 
Yet another first post.
 
Is PS an extension of the shell, that makes it more... powerful?
 
12:51 AM
@Phrancis I believe PS is PowerShell.
That is like writing "FizzBuzz with Java to Fizzify Foos"
 
But shell is a thing, right?
 
@Phrancis Umm, isn't it an esoteric programming language?
 
In computing, a shell is a user interface for access to an operating system's services. In general, operating system shells use either a command-line interface (CLI) or graphical user interface (GUI), depending on a computer's role and particular operation. The design of a shell is guided by cognitive ergonomics and the goal is to achieve the best workflow possible for the intended tasks; the design can be constricted by the available computing power (for example, of the GPU) or the available amount of graphics memory. The design of a shell is also dictated by the employed computer periphery, such...
 
OK, thinking of something else.
PowerShell is just Windows version of Shell, I believe.
The extension is .ps, I know.
 
Oh, looks like you're right
Windows PowerShell is a task automation and configuration management framework from Microsoft, consisting of a command-line shell and associated scripting language built on the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems as well as WS-Management and CIM enabling management of remote Linux systems and network devices. In PowerShell, administrative tasks are generally performed by cmdlets (pronounced command-lets), which are specialized .NET classes implementing a particular operation...
For some values of right, anyways
Looks like there's more to PS than just command line stuff
 
12:55 AM
@Phrancis The command line is something totally different.
 
The more you know, the more you Kohl's code.
 
Oh, did I tell you I followed you on LinkedIn?
 
Did you? I'll check it, I almost never do
 
I'll probably connect with you, if you don't mind, after I finish my database class.
 
ugh. IRC chat is so unstyled and hard to read compared to SE chat.
 
12:57 AM
@EthanBierlein IRC?
 
internet relay chat
Enter a channel name starting with #
 
@EthanBierlein cough you can userscript the browser renderings of it
or even write your own irc client
 
lol I know
 
@Hosch250 Yeah, I thought I read you sent an invite so I was confused when I didn't see it.
Don't used LinkedIn much
@EthanBierlein IRC is multiplayer notepad.
 
@Phrancis Or single-player FizzBuzz.
We should set up a room where we take turns entering fizzbuzz values.
 
1:03 AM
_*1
 
First person to make a mistake loses.
 
base64 it @Phrancis
much better, maybe
 
Time to close some tabs
I see a few of you Python guys are on... do you know if there's a better way to search than this?
for user in collection.find({'roles': {'$regex': 'Game|game'}}):
    print user
(PyMongo, data is JSON)
 
I'm sure there is.
That looks most un-Pythonic.
 
Well, it's regex ;p
 
1:07 AM
@Hosch250 Really? Not really.
 
I'm pretty sure you don't need that loop.
Unless I'm thinking of list comprehensions or something.
 
Seen this in a tutorial, but might not work with mongo
m = re.search("(vi.*)", value)
if m:
    # This is reached.
    print("search:", m.group(1))
 
You can't print values with list comprehensions.
 
@EthanBierlein I know.
 
I'm more worried about the search than the print, really
 
1:09 AM
Yeah, that looks good.
I love familial fights.
 
I sense a backstory app-roaching
 
0
Q: C++ Linked Lists and Pointer to Pointers

user84309First post but I have been a lurker for some time now :) First, I am attempting to execute this skeleton code in Visual Studio 2015 and it should work as is according to my teacher so I am not sure what else could be wrong client side that may be causing that. The specific error is actually in t...

 
@EthanBierlein No, no other information forthcoming.
 
that's unfortunate @Hosch250
 
I can't really, it isn't my fight.
 
1:11 AM
are you planning to move out once you finish studying?
 
@Hosch250 Ah
 
@Vogel612 trwtf was why replace the word with "group1" instead of "gender"
 
@Quill I can't wait.
Just don't tell my family that.
 
Oh wow, there must be some fight going on in The Renderfarm
someone called someone a "[----]"
This flag handling thing is uncommon, but sometimes interesting.
 
@EthanBierlein If it isn't appropriate there, it isn't appropriate here.
 
1:13 AM
there
 
I've seen worse 4-letter words, but in the end they're usually not appropriate
 
@Phrancis It was spelled wrong.
It should have been 5 letters.
 
I noticed that :)
 
@Hosch250 No, that's the way the flagged message was spelled.
 
I know, I saw it.
The OP spelled it wrong.
There is usually an "e" at the end.
 
1:19 AM
Well, whatever.
I'm done with this.
Movin' on.
 
</pedant>
 
Okay... Wathever
 
The lack of a non-regex find() with PyMongo is unsettling
Can you do regex in Python that's not case-sensitive?
 
I don't think so
You could always just do [a-zA-Z]+
 
Zak
Owwwww. My arm is starting to register pain again.
 
1:26 AM
What happened?
 
1
Q: Fastest C++ code to get common prefix length

PepIn a C++ program, I have the following function to find the length of the longest common prefix between to char arrays a and b. String b is guaranteed to be shorter than string a. Is there a faster char array comparison code than this one (for example with some library function)? I wish to optim...

 
Zak
Ouch
 
This is slightly better...
for user in collection.find({'userName': re.compile('S', re.IGNORECASE)}):
    print user
Thanks @SirPython :)
 
@EthanBierlein You're lucky.
 
1:34 AM
in other news, looks like SO is doing like us and using punny titles in posts
14
Q: Is it time for [static] to be moved?

Matthieu M.I realized today that my next tag badge is [static]: I'll soon be an expert! Choice morsels from the tag excerpt: Static is a term used in some programming languages to define a function or data storage area (field) that is not bound to any specific object instance. Other usage of th...

 
@Mat'sMug The more, the merrier!
 
@EthanBierlein Yup.
 
Could you guys create a room like "Battle wounds" or "Real Life Injuries"?
5
 
Or "Is it time for [static] to be discharged?" — Euro Micelli yesterday
 
Zak
@Phrancis Sorry :)
I need to go to bed anyway
I'll see you guys tomorrow
or Monday
 
1:36 AM
'night!
 

 Horrific Injuries

Talk about your horrible injuries here. Once a week we will wi...
 
See you.
 
How about we don't.
 
Let's see, was that my 16th birthday? I don't remember.
 
1:40 AM
 
@Phrancis ah, I was almost done! thanks anyway :)
 
@Phrancis Thank you.
 
NP
You do that
for user in collection.find({'userName': re.compile('S', re.IGNORECASE)}):
    print user
 
for user in collection.find({'userName': re.compile('S', re.IGNORECASE)}):
    if not user.has_posted_gory_anecdote():
        print user.shame()
 
Anyways, I'm not yet decided which string finding syntax is least worst :\
 
Zak
1:44 AM
Right, 'nite people
 
@Zak Night
More first posts.
 
for user in collection.find({'roles': re.compile('game', re.IGNORECASE)}):
    print user
Maybe it's not so bad
I wonder how deep in JSON you can get before it starts fussing, like if instead of roles which is a node with an array of string, ...
 
@Phrancis I'd assign the result of collection.find to some local, and iterate that instead.
 
Anyone have a JSON multiple nodes deep I could try?
 
crickets
 
1:50 AM
Okay
 
Fine, I'll make one ;p
 
I've set a event for the 20th
For 20 minutes.
Every 7 days.
Until 2020
 
Just delete it dude
 
(your message not the room)
 
1:53 AM
Thanks
 
no problem!
 
Hi @Doorknob!
 
@EthanBierlein I'd suggest you leave it at that ;-)
 
@SirPython o/
 
UGH, broken
 
1:55 AM
hey @Doorknob, how did you dismiss the flag without getting Ethan banned? (I couldn't find the button!)
 
Hi @Doorknob!
 
@Mat'sMug It's kinda hidden—it's the little (x) in the bottom left corner.
 
dang
don't play with fire flags
 
@EthanBierlein Mod flags get broadcast to every single diamond on the entire chat.SE network; probably not a good idea ;)
 
1:56 AM
@Phrancis hi!
 
I see you've figured it out @Mat'sMug. ;-)
 
What got flagged?
 
lol
 
Something about the other room?
I wasn't here for a bit.
 
just a[nother] link to the horrific injuries room.
 
2:00 AM
Why was that flagged?
 
It was noise.
So I flagged it.
 
Oh.
 
And @Phrancis recommended that I get rid of it.
 
You flagged your own message?
 
2:01 AM
@EthanBierlein wait, you flagged... oh gawd
 
Why not just delete?
 
it was too late
 
There's a 5-minute cap on that
 
next time, just ping me
 
@Doorknob 2-minute
 
2:01 AM
^^ yeah that's a better idea
 
(or any other mod)
 
@EthanBierlein Oh, really? Thought it was longer...
 
1
A: Find deep children in MongoDB

Michal GasekWhat you could use here is aggregation framework. You will find lots of nice examples on aggregation framework in MongoDB docs - Aggregation What you could be interested in in particular would be $unwind pipeline operator which peels off the elements of an array individually, and returns a stream...

OMG^
 
@Doorknob signs you've been a mod for too long! ;-)
 
Someone call the police
There's a guy looking for children here
 
2:02 AM
...
 
What definition of looking does that fit in? (also, why are you in a SE chatroom?)
Or did I miss an inside joke again?
 
Is there any easy way to find the first message I posted in here?
 
show me master Jeroen
 
or not
 
2:11 AM
Anyone spot an error? PEP is not complaining, just getting null return
for node in collection.find({"one": {"two": {"three": {"four": {"five": re.compile("five", re.IGNORECASE)}}}}}):
    print node
 
@JeroenVannevel noo
 
manyNodesDeep = {
    "one": {
        "two": {
            "three": {
                "four": {
                    "five": "five"
                }
            }
        }
    }
}
collection.insert(manyNodesDeep)
 
looks fine
 
I thought the same thing
 
are you sure it isn't inserted?
collection.find()
 
2:14 AM
I think I found it
May 1 at 2:53, by Ethan Bierlein
@sᴉɔuɐɹɥԀ Well hello there! :)
 
    collection.insert(phrancis)
    collection.insert(zomis)
    collection.insert(manyNodesDeep)

    collection.find()

    # returns null
    # for node in collection.find({"five": re.compile("five", re.IGNORECASE)}):
    #     print node
    #
    # for node in collection.find({"one": {"two": {"three": {"four": {"five": re.compile("five", re.IGNORECASE)}}}}}):
    #     print node

    for user in collection.find({"userName": "Zomis"}):
        print "userName \"Zomis\": {}".format(user)
That^ works fine :\
Also, collection.find() is null
 
eh? It shouldn't afaik
 
@Phrancis cough None
 
Network question for anyone who can answer...is there a way to distinguish if a user's public IP is IPv4 or IPv6?
 
Are these all synchronous calls? No callback shizzle or anything?
 
2:16 AM
null, None, who's counting :)
 
@Legato parse it as one and see if it fails?
What context are we talking about?
 
So far I've seen nil, Nil, NULL, null, None, and Null
 
You can just look at the packet headers if you have those
 
@JeroenVannevel Maybe I did it horribly, but the whole thing is under a try fail already.

I realized that ipv4 only works if their public ip is ipv4, and same thing for ipv6. My idea was to try ipv4 and if that fails try ipv6, perhaps I just formatted it wrong, but it still only works for whichever I try first in that case.
Context is creating a socket.
 
2:19 AM
TryParse/Error/Catch/TryParse the other/ seems like a solid option then, yes
if it doesn't work, it's an implementation detail
the idea should be fine
language?
 
Java.
I'll try some more.
 
INetAddress.getHostByIp() or something like that
 
# returns the expected object as part of the set with all objects
for node in collection.find():
    print node
# returns null
for node in collection.find({"five": re.compile("five", re.IGNORECASE)}):
    print node
# returns null
for node in collection.find({"one": {"two": {"three": {"four": {"five": re.compile("five", re.IGNORECASE)}}}}}):
    print node
# returns the expected object
for node in collection.find({"one": {"two": {"three": {"four": {"five": "five"}}}}}):
    print node
Anyone got a clue^?
 
-1
Q: Optimizing my python code?

andyADDI picked up python again, and I am proud with what I have without using if/elif statements throughout the whole thing. I have modified this couple of times, since I kept asking how could I make it better or more organized. My biggest complaint is using the if/elif at the bottom, for some reason w...

 
2:22 AM
Afterwards, use if(address instanceOf INet4Address) , do a cast, or cast it to INet6Address
 
I thought of something like that but I thought host would only return the computer it's on rather than the router gateway?
Perhaps I'm mistaken! I'll try it.
Thank you.
 
Oh, I don't think you can view it from that direction
your local computer has no idea of the IP address known from the router
There's this though:
46
Q: Getting the 'external' IP address in Java

JulioI'm not too sure how to go about getting the external IP address of the machine as a computer outside of a network would see it. My following IPAddress class only gets the local IP address of the machine. Any help would be appreciated. Thanks. public class IPAddress { private InetAddress th...

 
Excellent!
 
2:39 AM
0
Q: trying to understand this function encryption(message)

DannyThis is a function that will encrypt a given sentence into International Morse Code, both the input and out puts will be strings. Characters are separated by a single space. Words are separated by a triple space. For example, "HELLO WORLD" should return -> ".... . .-.. .-.. --- .-- --- .-. .-.. -...

 
OK, this is really weird
for node in collection.find({"one": {"two": {"three": {"four": {"five": re.compile("five", re.IGNORECASE)}}}}}):
    if node:
        print "regex: {}".format(node)
    else:
        print "no luck"
Nothing... not a peep
 
@CaptainObvious CR Trivia: what's the correct close reason to use in this case?
 
This is so odd.
 
@Mat'sMug Not OP's code?
 
WhichSite.SE seems like it really should be a thing.
 
2:43 AM
@EthanBierlein yup. hi @Jamal!
 
Yay!
Do I get free CRandies!
 
I want to ask "why" something, is it fitting for SO?
 
@EthanBierlein CRispy CRescents and CRanberry CRumble
 
@Legato Maybe
If it can be reproduced, probably
I'm about to post this nonsense to SO and see what I might be missing
I just need to explain it to a rubber duck first.
3
 
2:58 AM
This is better suited to the code review section. — Rasclatt 34 secs ago
 
The rubber duck agrees this makes no sense.
 
0
Q: Browser shows IPv6, but query returns IPv4 why?

LegatoA bit of context: For study/practice, I'm working on a network application and I noticed that the socket only correctly opens if I provide an IPv4 address to people whose public IP is IPv4 and IPv6 for those whose public IP is IPv6. I thought to select filter the right one by using something ki...

Hopefully, I get some insight.
 
3:13 AM
0
Q: Sanitising contact form input for PHPMailer

Dan JonesI would like some opinions on this this function for sanitising user submitted data into a contact form. No HTML content or anything, just plain text. Are there any vulnerabilities here that I'm missing? Am I ok to use the flag: FILTER_FLAG_NO_ENCODE_QUOTES on the subject line? Not sure if quote...

 
@CaptainObvious HAI!
s/opinions/insight
 
0
Q: PyMongo query with regex returns nothing despite if: elif: else

PhrancisFor some odd reason, I have a Mongo query that returns literally nothing (blank line with no data) despite using what seems like a condition that could not possibly be escaped. To reproduce (assuming you have PyMongo installed): import pymongo import re manyNodesDeep = { "one": { "t...

 
Welcome to Code Review! Feel free to edit and add the not-so-basic PHP, too ;-) — Mat's Mug ♦ 20 secs ago
 
3:33 AM
// Omitted for clarity. - Unlike Stack Overflow, there's no need to omit anything on this site. In fact, the more code, the better the context; it's common to paste the code straight from the IDE. How messy/distracting is the // send email... part? Perhaps that part belongs in its own function? Or does it? Who knows! -- By skipping code, you skip review opportunities ;-) — Mat's Mug ♦ 3 mins ago
 
3:56 AM
@Jamal I didn't get your email til just now. My email client has been acting up some. I did add you and endorsed some of your skills.
 
wat
 
ikr...
It works, that's the crazy thing
4
 
I just posted a mini-answer in...
 
link?
 

« first day (861 days earlier)      last day (3158 days later) »