« first day (813 days earlier)      last day (3502 days later) » 

00:00
RELOAD!
There are 1371 unanswered questions (94.6583% answered)
According to Duga, it is.
00:13
0
Q: Method for downloading a PDF from a website in Android

FarazHow is this? Any ways to improve? public void DownloadPDF(Uri uri) { downloadProgress.setVisibility(View.VISIBLE); downloadComplete.setVisibility(View.INVISIBLE); openFile.setText("Wait..."); // My button openFile.setEnabled(false); if (uri != null) { DownloadManager....

lol forget it.
The captain will post it anyways
@Duga Interrupt
0
Q: Simple inventory system - Part 2

Ethan BierleinI've refactored my previous inventory system, and added a few features like removing items from the Inventory class, easily obtaining the current selected item through Inventory.GetSelectedItem, and some things have been renamed as well. My concerns are once again: Is this the correct usage of ...

There we go ^^
00:37
@CaptainObvious @EthanBierlein doesn't use return?
@Mast Nope, the last expression in a function is the return
It sounds like you're looking for code review: codereview.stackexchange.comJerry Dodge 53 secs ago
@EthanBierlein You might want to talk to Reed Copsey in the WPF room at SO.
He is really into F#.
(I personally think it has some good ideas, but I don't care for it a whole lot.)
Maybe once people really start accepting whitespace as more than a delimiter... (beyond Python and Whitespace devs, that is).
Oh god, is whitespace an actual serious language?
Dead serious.
00:42
shivers
Whitespace is an esoteric programming language developed by Edwin Brady and Chris Morris at the University of Durham (also developers of the Kaya and Idris programming languages). It was released on 1 April 2003 (April Fool's Day). Its name is a reference to whitespace characters. Unlike most programming languages, which ignore or assign little meaning to most whitespace characters, the Whitespace interpreter ignores any non-whitespace characters. Only spaces, tabs and linefeeds have meaning. An interesting consequence of this property is that a Whitespace program can easily be contained within...
00:52
@EthanBierlein Hang around on PPCG and you'll see it every once in a while.
Are any JS experts still awake?
Is this answer idiomatic JS?
1
A: How to call a javascript function from a JSON string?

Ben AlpertThis should work: function(data) { if(data.HasCallback) { eval(data.Callback); } } Edit: Didn't look quite carefully enough. If you're indeed getting the function() { ... } text, then you need to eval(data.Callback + "()").

"How to improve it" questions generally go on codereview.stackexchange.com — Ray Toal just now
What exactly does eval do, and where would I find that documentation? — smartcaveman Mar 31 '11 at 0:43
@Mat'sMug eval does everything ^^
I need to dynamically add a list of instructions to execute. If I can put the instructions in a JSON, this should be able to execute it.
01:07
I'd question the idiomatic-ness of the question more than that of the answer. Why would you pass JavaScript code through JSON from the server to the client?
Totally unsafe though, since the original input comes from outside the server.
Well, I'm doing it the other way around.
The client sends data to the server, a Node.JS server
the client sends JSON
the server should somehow figure out what to do with it and execute a bunch of commands, a dynamically created list based on the settings stored inside the server
eval is a quick fix, but it smells
@Mat'sMug So the client can execute it?
@nhgrif uh, well, yeah. isn't that what the server does when it serves just about any page? the client already has the code, why ask the server for some more? of course I don't have all the context (and I don't do web dev), but it seems odd to not serve that JS from the start.
01:17
UIKit's web view can be passed a javascript string to execute whenever.
A server could pass me a javascript string that I'm going to save and then execute later.
I mean, I guess anything that knows how to load web stuff could be passed a javascript string... but...
I could design an app that needs to be able to update the code it executes for certain parts
a heavy client then
Well
A client that wants to be able to do things offline
interesting
I mean, it depends.
I've not had to do anything even remotely like this
0
Q: Listing every date between two dates in input fields

Maximilian FuchsUsed following HTML: <input type="date" value="2015-07-26" name="startdate"> <input type="date" value="2015-07-29" name="enddate"> First, the JS calculates the number of days between two dates: var oneDay = 24*60*60*1000; // hours*minutes*seconds*milliseconds var start = document.querySelecto...

0
Q: Combine a set of “ranges” to find least number of ranges

RKodakandlaGiven a set of ranges with lower bound and upper bound, I need to combine these ranges to produce minimum number of ranges which will cover all the values in the original set and nothing else. Example 1: Input: [100, 200], [120-170],[210 - 230] Output: [100-200], [210-230] Example 2: In...

01:20
And I'm not sure how great of an idea it is... but I can imagine a use for it...
I just don't know what people use JavaScript for in iOS apps exactly.
But I know it's used.
In my case the client is as thin as possible. The server does the thinking, connects the dots, etc.
And if I knew what for exactly, I could imagine the scenario better.
@Mast Then why are you sending JavaScript in JSON...?
Basically the server runs on an embedded module (yes, embedded Node.JS...). The module controls a hardware bus. Basically a set of commands which need parameters.
The server needs to decide what stuff to executed based on the JSON coming in from the client.
01:23
The client is sending JavaScript?
In the server a piece of translation accepts this input and converts it to executable whatever (probably JSON).
The client is sending data.
I'm completely confused.
Key1=Val&Key2=Foo&Key3=Bar
The client sends HTTP (or HTTPS, depending on settings, but let's say HTTP)
It has a target IP/Port/Path, a method and a query
That query is formatted like JSON, like the key/values above
...
"It"?
So, ignoring the path... what exactly is the client sending to the server? (Slow down... tell me like I'm 5
You know curl?
01:27
I had to tell someone on electrical engineering that the other day.
I sort of know curl. I know how to make HTTP requests by other means though...
curl -v -L -G -d "Key1=Foo&Key2=Bar" http://x.x.x.x:xxxx/path/more/path
okay...
So now what's the "method" and "query" you're talking about?
The query is between " "
When you say "query"... what are you querying?
01:31
I'm not query'ing, but Node.JS thinks it's called a query.
Don't ask me why, ask the inventor.
What's it actually doing when it thinks it's querying?
The server accepts the url and parses it.
That's some black-magic done by the url library.
well it does look like a querystring
if you take the url part and add a "?" and append the "query" part, I mean
If you'd send it in your browser, that's what it would look like, yea
http://x.x.x.x:xxxx/path/more/path?Key1=Foo&Key2=Bar
There may or may not be a / between path and ?
No...
That's for a GET.
That won't work for a POST though.
01:35
Yea
HTTP is perfectly capable of sending data with a GET
Technically it isn't posting.
It's making a request and this request just so happens to carry data.
^^ isn't that what happens.... .... all the time??
I dunno, I'm not a web dev
I think it does
...
Of course HTTP is capable of sending data with a GET...
A GET is just putting the data in the address basically
as plain text for all the world to see
I'm not a web dev, but I know our web devs never use GET
01:37
Yea, that's where HTTPS comes in, so the world doesn't see
It doesn't make a difference if you're using GET.
Not?
I'm going to kill the dev who told me otherwise...
I mean, HTTPS might make some difference.
But not enough.
That's good to know.
Gosh I ♥ this place.
4
01:39
If you make a GET request in a browser, you can see the arguments that were passed in the URL.
If you make any other of the numerous types of URL requests, the arguments don't end up in your address bar.
If it doesn't end up in the address bar, in what part of the request does it end up?
GET requests can be cached
GET requests remain in the browser history
GET requests can be bookmarked
GET requests should never be used when dealing with sensitive data
GET requests have length restrictions
GET requests should be used only to retrieve data
yikes
POST requests are never cached
POST requests do not remain in the browser history
POST requests cannot be bookmarked
POST requests have no restrictions on data length
Oops.
01:41
@Mast There's other data transferred in HTTP requests besides just the address.
I know, I just have no idea how that part of HTTP works (yet)
That's a big part of the reason why curl even exists so you can manually test these other sorts of requests
http://www.somebank.com/login.php?cardnumber=123456789&clientid=23788&password=correct-battery-horse-staple
imagine...
That's a GET request
I know
01:44
And now I know your password.
And I can bookmark it even.
I've seen sites do stuff like that.
Not my bank luckily.
Actually, the worst part is, your users can book mark it.
Then they change their password, and their bookmark is broken.
the red flag was login.php...
mwahahaha
@Mast in the late 90's, yeah... still?
@Mat'sMug I'm not good with chronology. My mind thinks 9/11 was only a couple of years ago.
wait, ..wasn't it?
01:48
So, basically in a POST you got the address and the body.
@Mat'sMug no
The address does not contain any data, just the target.
The body contains the data and gets processed.
This doesn't change how the server respond though, does it?
has to re-write 2 months of work in a week
@Mast The server has to have a post method. I don't know enough about how the server side of it works.
You can't just post to an endpoint that the server has a get for. The server has to be expecting the post...
@nhgrif Yea, I'll build a POST handler so the server won't balk.
I built it so every method not implemented throws a 405, not much room for error there.
Basically the server checks the method of the request.
@nhgrif in ASP.NET MVC that's done with just decorating a controller method with a [HttpPost] attribute.
01:53
@Mat'sMug Yeah, it may be simple. Like I said, I don't know enough about it to know how it works... but I somewhat know the difference between the different HTTP request types.
If I want a browser to send data to a server with a GET, I can just put it in the address. Making a browser send a POST is probably more difficult, right?
Yes. But I'm sure Chrome & FireFox both have plugins probably.
Ain't web fun?
Yes, they do. But I kind of promised them it could be sent from any client.
@RubberDuck No
320
Q: How do I manually fire HTTP POST requests with Firefox or Chrome?

Pascal KleinI want do test some URLs on the web application I'm working on. For that I would like to manually create HTTP POST requests (meaning I can add whatever parameters I like). Is there any extension or functionality in Chrome and/or Firefox that I'm missing?

01:56
Lol.
@nhgrif I saw, but it's supposed to work vanilla and I don't think that's possible with POST
@Mast Oh, it's no trouble to programmatically make the browser make the request. You can do it with HTML...
Was totally kidding. Been learning it at work. Struggling a bit myself.
50
Q: Make a link use POST instead of GET

ElliotI'm not sure if this is even possible. But I was wondering if anyone knows how to make a hyperlink pass some variables and use POST (like a form) as opposed to GET.

So I'd need to set-up a basic UI.
I'm doomed.
Oh well, if that solves the problem it seems do-able.
02:00
Who are your end-users?
There are no end-users.
It's a proof-of-concept.
wouldn't server-side unit test work?
If it's proof-of-concept, why does it need to work on all browsers now?
No, it must be user activated.
1 min ago, by Mast
There are no end-users.
color me confused
02:02
Allright, I'm the end user.
so...
1 min ago, by Mat's Mug
wouldn't server-side unit test work?
No.
If you're the end user... use curl or a Chrome/FF plugin..
The demonstration clearly asks for a user activated sequence.
nice answer @RubberDuck BTW.. made me trash my draft :)
02:04
@nhgrif I wrote a Bash script which accepts arguments to send. Problem solved. It just would be nice if I could show a less-techy environment like a webbrowser could be used as well.
There will be management in the room.
incoming off-topic
So.. @Mast... the question "Who is the end-user?" isn't asking who is going to do the demonstrate. The question is... "Assuming this thing makes it to a complete full real release, who will be using it?"
@Mast that's always exactly when things go wrong isn't it
@nhgrif My conclusion explicitly states it's unfit for release in it's current stage.
That's fine.
02:06
True, people will release it anyway, but that's not my concern.
But when I ask you who the end-user is, that's always who I'm asking about.
I'll probably be gone by then.
What's the end-game
Here's the curl command, by the way:
curl --data "param1=value1&param2=value2" hostname/resource
In theory, there is no end-user except me as demonstration giver. In practice, they should be able to get it working without too much trouble.
@Mast You are fundamentally misunderstanding the question.
02:09
It's a fundamentally complex situation I'm in.
Why does it have to look nice if there isn't a human end-user at the end of the development of this product?
Because managers.
Not at the end of your involvement. At the total end of the development.
Ah.
You shouldn't be designing for the end of your involvement. You should always keep the product's total end goal in mind.
02:09
Well, because in the end it will be used by other people. By 'normal' non-techy people.
Okay, so you have to keep them in mind.
If you're not, you're probably creating technical debts.
-2
Q: Would you use this logger?

Michael LafayetteI recently wrote my own logger for undergraduate coding to address some inconveniences I was having and would like to make it into library-grade code - something that other people could use. Would you give it a try, take a look, or give me your opinions? It might need your code reviewing expertis...

@nhgrif In a perfect world, yes. In this case, we ran out of time to make good stuff happen.
Well, then one of two things...
Oh wait, I can just put all 1000 lines in the question. — Michael Lafayette 4 mins ago
@nhgrif I completely agree with you I shouldn't be creating technical debt.
It's bad, simple as that.
02:12
Either you work in a crummy environment and when you refer to "being gone" soon, I hope you mean you are going to working at another company
Thanks @Mat'sMug. I almost VTC'd that one, then decided there was some meat to that 3 LoC.
or you have a questionable work ethic and are afraid to challenge managers
However, I strongly believe my company should not be doing what it wants to do. They lack the dedication to the project and part of the required knowledge.
@RubberDuck technically I don't think it's working code though. where's the Distinct logic in the OP?
@nhgrif Challenging managers is no longer an option. Keep in mind the company and I agreed to terminate my work after this project because we're having difficulty working with each other.
It's better for all parties I'm moving on.
02:14
Are you going to a different work environment?
(different company)
A different company, yes.
Thanks everyone for the advice! I cleaned it up a bit more according to your suggestions and went over to CodeReview to make it even better. I really appreciate your time and explanations! It's invaluable as I'm starting to learn. — mmrtre18 18 secs ago
I can definitely understand that some companies give managers too much authority.
And the answer is to just not work for those sorts of companies.
It works for them, it just doesn't work for me.
There's nothing more to it.
02:17
It works for the companies because they're betting on keeping developers that don't realize there are better places to work.
It doesn't work for the developers. You're forced into releasing crappy code.
The developers don't seem to mind. They get paid by the hour and quite well.
But there's more to life than money.
@Mat'sMug it's in the HashSet ctor.
I want to be proud about what I write.
Well, a developer who doesn't mind cashing in on paid-by-the-hour work and not caring that it all sucks has a questionable work ethic.
@RubberDuck so, if any child exists twice, OP's code goes boom. right?
Keep talking and I may find myself migrating to Texas :P
@RubberDuck huh, #LearnEveryDay
Why?
No. HashSet makes it distinct upon creation.
I know there are good companies still around, but they are hard to find here.
At least I have difficulty locating them.
02:20
Yeah. I thought the same thing till I looked it up.
I'm not in Texas.
Nor is the company I work for...
Jamal is in Texas.
@nhgrif Misunderstanding. Dallas?
Anyway, you seem to have found a decent company.
The company I work for is based out of Franklin, TN (Nashville area). I'm located in Conway, AR (Little Rock area).
I told Jamal it's about 5.5 hours from here to Dallas to give him an idea of how far it is
Darn.
Darn what?
02:23
That's longer than the Netherlands is long.
Dokkum to Maastricht is 350km.
@Mast that's just a bit longer than from Montreal to Quebec City
last year I went to a cottage in the north of the province, a 12-hour drive.
@Mat'sMug Canada is referred to here as the Great Plains. You got a whole lot of nothingness up there.
Metova only hires U.S. citizens. :/
Getting citizenship isn't the hard part for a European.
@Mast lol, indeed. beautiful nothingness though
02:26
Anyway, I'll find something decent here. Just haven't found it yet.
Well, there's one place but they aren't hiring at the moment. Everyone there sticks till they die, almost literally.
0
Q: Trying to exit out of the program after certain print statements without using sys.exit()

mmrtre18I bring this code review plea over from suggestions from SO. I've made the suggested edits from that thread, but is there anything else I can improve on below? I'm looking for a nice way to exit the program entirely after certain print statements (e.g., "You should probably just give up now.") Fr...

Oh @nhgrif I'd love for you to be a fly on the wall at my new employer for a day. You would share the WTFs with me.
@Mat'sMug I wish I could see it. Can't see anything here without getting a powerline or a house or a face in my field of view :(
I had to explain to someone the other day that if you're not making the code better, you're making it worse.
5
@RubberDuck That should be pinned.
02:28
1
Q: Simple inventory system - Part 2

Ethan BierleinI've refactored my previous inventory system, and added a few features like removing items from the Inventory class, easily obtaining the current selected item through Inventory.GetSelectedItem, and some things have been renamed as well. My concerns are once again: Is this the correct usage of ...

@Hosch250 no, framed at @RubberDuck's work station
Sure.
Anybody want to take a crack at my f# question?
I wish I was kidding about that, but I just got blank stares.
@RubberDuck Sounds like I'm not the only one who needs to get out.
02:29
@RubberDuck sounds an awful lot like my old job...
I just got here. I plan on turning it around.
In fact, I'm pretty sure that's part of why they hired me.
you got a red cape and blue tights?
No. Black cape.
Just saw that GET/POST discussion. There are some very good uses for GET, like a search result.
Close enough.
02:30
> Cuz I'm bat duckman!
2
@Hosch250 I'm not searching, I want the server to execute a bunch of instructions based on my data.
Wait a minute.
Certain settings (like light/dark theme) are also perfectly fine to be passed with GET.
Searching is basically that.
@Mast Are you ... programming?
Sounds like every other program to me...
@Hosch250 Yea, well, it has a few layers here and there.
But yes, it's basically one big function.
So is life.
Input, return, stuff happening in between.
02:34
@Mast The standard definition of a program: input, calculations, output.
try wikipedia
Yea, like that should be trusted.
A computer program, or just a program, is a sequence of instructions, written to perform a specified task on a computer. A computer requires programs to function, typically executing the program's instructions in a central processor. The program has an executable form that the computer can use directly to execute the instructions. The same program in its human-readable source code form, from which executable programs are derived (e.g., compiled), enables a programmer to study and develop its algorithms. A collection of computer programs and related data is referred to as the software. Computer...
I had a lab partner duing my study who defaced one of the Dutch Wikis. It's still there after years.
02:36
Try your beginner programming book, or DK's books.
@Mast try defacing a page that gets views.
@Mat'sMug Details...
If the majority agrees, the majority isn't necessarily right.
@Mast as long as one-liners are on-topic, I agree with that statement :)
Like my philosophy professor said, just because nobody believes there is gravity means you can survive jumping off the roof.
Wikipedia is more reliable than the major news networks at least.
3
02:39
^^^^^^^^^ x 1000
In economics, the majority is always wrong. ~ John Kenneth Galbraith
@RubberDuck That must be an American thing. Here, at least the state television is usually right.
The more popular shows, well, you don't get popular by telling the truth.
State TV? I wouldn't trust them past the first point of their pinky finger.
You get popular by telling what people want to hear.
@Mast I specifically had CNN in mind...
The news is entertainment here.
02:43
@Mat'sMug Oh god, why is that code snippet picture VBA...
What snippet?
@EthanBierlein Because it's more readable than Brainfuck?
@EthanBierlein it's not VBA.
@Mat'sMug Oh, it looks similar at least.
Image not found? Meh.
02:44
some kind of BASIC, probably.. but not VBA or any version of VB I know
No. Definitely not VBA. I see /* ... */ and Returns
> A source code example that shows classes, methods, and inheritance. This is NOT THE Mint Programming Language because Mint absolutely cannot perform a "return this" implicitly at the end of a particular function.
There aren't many languages still using sub and end constructs. In Pascal it's begin and end.
Fix your indentation, Wiki:
using System;

    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
        }
    }
02:45
@Hosch250 it's wiki, fix it! ;-)
2
I don't have an account.
@Hosch250 You don't need one.
And I don't want my IP publicly visible.
It will happen anyway.
What will?
02:46
That ^^
You're on the internet. If we want to see where you are, we will see where you are.
I know any page I visit can have it.
Where am I?
It was easier 15 years ago, but yeah.
According to your user statistics somewhere in the USA.
it's pretty damn easy from where I sit, lol
02:48
Today, your IP isn't even the most sensitive thing to find.
You're a mod. That's cheating.
Yeah, if you had my IP, you could track me down pretty much to my block.
There are no rules on the internet. There is no such thing as cheating.
(for the record I didn't even look)
@Hosch250 Lol I already (sort of) know where you live.
02:49
@EthanBierlein I told you, that's why...
@Mast well there's this thing called the moderator agreement
@Mast Oh yeah? What about the DCMA? What about the protocols that let the internet work?
If those aren't rules, I don't know what are.
@Hosch250 DMCA isn't really working, is it?
I mean, sure, it's a nice mechanic to keep people busy.
Google's DCMA
Afar from that, everyone can still get everything they want.
People can share whatever they want.
02:50
And there are laws about certain adult+ content.
In the end, the Internet is still just a bunch of computers connected with each other.
@Hosch250 Local laws, not internet-wide laws.
hey, Internet could work off...
> Deleware Veterinary Association
In computer networking, IP over Avian Carriers (IPoAC) is a humorously-intended proposal to carry Internet Protocol (IP) traffic by birds such as homing pigeons. IP over Avian Carriers was initially described in RFC 1149, a Request for Comments (RFC) issued by the Internet Engineering Task Force (IETF) written by D. Waitzman and released on April 1, 1990. It is one of several April Fools' Day RFCs. Waitzman described an improvement of his protocol in RFC 2549, IP over Avian Carriers with Quality of Service (1 April 1999). Later, in RFC 6214 released on 1 April 2011, and 13 years after the i...
Most IP's block child porn, for example (good for them, although I hope they don't go much beyond this).
02:51
@Hosch250 You hope, and you'll never now for certain.
Again, local laws. Not internet-wide
I don't think this guy gets it, and I'm too tired to be nice.
-2
Q: Logging/Debugging code

Michael LafayettePlease review my logging/debugging code from LogAppTester package Utilities; import java.io.* import java.text.* import java.util.* /** * Use this for various testing/debugging purposes including multi-threaded * print statements with built in stack trace, assertions that stop the entire * ...

Reviewing a 29.2K-character post isn't something that's done instantly. Please read how to get the best value out of Code Review on meta; keep in mind that reviewers volunteer their time - you might want to remove the quite extensive Javadocs to buy you some characters to include a decent description of what the code does; you can remove fluff and mention the full code is on github for those who want the full context. The more effort you put into your post, the more effort reviewers will likely spend reviewing your code. — Mat's Mug ♦ 6 mins ago
@RubberDuck ^^ nice?
I suppose
03:13
Close enough I guess.
However, if he removes the Javadocs, people will tell him to use Javadocs.
The real problem is either
1) he shouldn't be posting such a large file in the first place
or
2) SE should give us more characters per post
I looked at that code, it's all one enourmous class with a ton of small methods
To be honest, that's probably how I'd have written a logger as well.
There is no need for multiple classes.
9
Q: Inspector Rubberduck - Take Two

Mat's MugRelease 1.1 of Rubberduck only had a handful of implemented code inspections, more as a proof of concept than anything else. For release 1.2, we now have 19 implementations of our IInspection interface - here is what happens when the user clicks the refresh button on the Code Inspections toolwin...

^^ 27,933 characters
@Mat'sMug Your code-to-English ratio is much better.
longest question is 39K characters.. .... ..how?
@Mast the plain-English part could mention the Javadoc is extensive and can be found in the code on GitHub, that Javadoc was removed for brevety, blablabla
03:32
@Mat'sMug Doing a check on things, comparing the markdown to the body, the markdown has the code using tabs. The SEDE body has the output using spaces.
So, about 3300 tabs were expanded from 1 character to 4.
makes sense
I put the markdown in to Notepad++ and the body too. Out of interest, the markdown came in at 28656 chars, and the body came in at 40329
Why does your body have 1002 more than SEDE sees?
@Mast because I copied/pasted the text from SEDE to Notepad++ and the process converted the \n line endings to \r\n in notepad++
03:48
Figures.

« first day (813 days earlier)      last day (3502 days later) »