Search found 198 matches

by Dr. Willpower
Sat Apr 23, 2016 1:08 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Had an interesting bug in JavaScript that was a sign there was too much magic going on. We were returning our own status codes in requests (the request would return 200 OK, but would contain an error). This allowed us to fail softly. The problem arose when we hooked an application level failure onto...
by Dr. Willpower
Mon Nov 16, 2015 3:16 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

y =! x; This makes me want to draft a language where it is syntactically impossible to typo valid code. Or, at the very least, create a syntax checker that can spot the most common typo/errors. I've been tutoring students in Java for some time now, and I can't tell you how many times I've seen the ...
by Dr. Willpower
Thu Nov 05, 2015 2:38 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

I've been trying out z from rupa for a few weeks now, and it's nice. It builds a history of directories you've visited, and lets you type shortened versions to cd directly into a directory.
by Dr. Willpower
Thu Nov 05, 2015 2:25 pm UTC
Forum: Coding
Topic: CSS + checkboxes = lololol
Replies: 5
Views: 3877

Re: CSS + checkboxes = lololol

I've seen checkboxes indicating state in other code, and I've used it in production to get Hamburger menus to work. What really interests me is that it adds stately behavior to CSS. My question- if it was possible to toggle checkboxes with CSS, would CSS be turing complete? My intuition says yes, bu...
by Dr. Willpower
Fri Oct 23, 2015 5:04 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

I can't speak to the goal that you're trying to accomplish, but referring to the __eq__ operator: People will generally assume that __eq__ means that objects are equal (whatever that means, I'm not exactly a python guru). If you're not worried about anyone else ever using or modifying this code, it ...
by Dr. Willpower
Tue Sep 22, 2015 11:40 pm UTC
Forum: Coding
Topic: Best password improver
Replies: 62
Views: 11191

Re: Best password improver

I don't know how secure it is.. I can't believe it would be any more secure than using a password (and hopefully not less secure). I would think that security questions are, in most cases, way less secure than passwords because they tend to be thing like 'what is your mother's maiden name?'. That's...
by Dr. Willpower
Tue Sep 22, 2015 4:54 pm UTC
Forum: Coding
Topic: Best password improver
Replies: 62
Views: 11191

Re: Best password improver

Just ask them a security question instead of a password. Something like "What was the first charge you got arrested for?" You could even allow them to create the questions themselves, and keep them mostly hashed (i.e. "What w... hashed bit ...ested for?"). The hashing of the que...
by Dr. Willpower
Tue Sep 22, 2015 4:35 pm UTC
Forum: Coding
Topic: Best password improver
Replies: 62
Views: 11191

Re: Best password improver

Just ask them a security question instead of a password. Something like "What was the first charge you got arrested for?" You could even allow them to create the questions themselves, and keep them mostly hashed (i.e. "What w... hashed bit ...ested for?"). The hashing of the ques...
by Dr. Willpower
Fri Aug 21, 2015 4:00 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Everything that checks exceptions should include the type "oh_I_give_up". I have been known to do this in production code: if(first_possible_outcome){ //... } else if (second){ //... } else if (last_possible_outcome){ //... } else { //Shouldn't be possible~ printf("Something terrible...
by Dr. Willpower
Wed Aug 19, 2015 4:34 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Everything that checks exceptions should include the type "oh_I_give_up". I have been known to do this in production code: if(first_possible_outcome){ //... } else if (second){ //... } else if (last_possible_outcome){ //... } else { //Shouldn't be possible~ printf("Something terrible...
by Dr. Willpower
Fri Jul 31, 2015 1:01 pm UTC
Forum: Coding
Topic: DrBoolean's Mostly Adequate Guide to Functional Programming
Replies: 11
Views: 6456

Re: DrBoolean's Mostly Adequate Guide to Functional Programm

Hey thanks for this. I've been looking for a good place to learn functional programming for a while now.
by Dr. Willpower
Mon Jul 13, 2015 4:11 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Some languages provide a sortBy function which takes a two argument function to use for comparisons. For some reason I remember reading a very in depth consideration into different ways to implement a generic search. The article was all about C++ implementations, while discussing the best way to-- ...
by Dr. Willpower
Fri Jun 19, 2015 4:33 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Did you maybe intend to say the converse of what you said? No. It was something along the line of: O(1) space => there is a finite bound on the memory space => there is a finite bound on the state space => there is a fine bound on the length of a path through that space before repeating => repeats ...
by Dr. Willpower
Wed Dec 18, 2013 1:33 am UTC
Forum: Coding
Topic: how does trading software work?
Replies: 8
Views: 4746

Re: how does trading software work?

Isn't this because BTC has crappy liquidity ? As its availability is increasingly limited (by design), it's always more difficult to sell BTC than it is to buy it (because people are buying smaller quantities as less becomes available / its price goes up). Without a significant and constant influx ...
by Dr. Willpower
Fri Dec 13, 2013 9:17 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Thesh wrote:This would still be for relational data,...


I find this idea really fascinating. All you'd have to do is write a parser that would compile the code into SQL statements. It definitely seems doable at least.
by Dr. Willpower
Tue Aug 06, 2013 3:18 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

bittyx wrote:...


I appreciate your help. This file is not part of a big project. Nor will anyone else ever lay eyes on the PHP.

Xeio wrote:Yes, it is pretty horrible to save 2 characters by abbreviating button to butt.


Yeah, the abbreviation is just to include the word butt on the page.
by Dr. Willpower
Mon Aug 05, 2013 8:55 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

In reference to PHP woes from the previous page. Sometimes PHP can get murky. When I wrote this code it made sense to me, but when I look at it while editing this file I cringe. <?php echo '<a href="index.php'; if ($CS->N < 1) echo '?comic=1'; else if (!$CS->isComic($CS->N + 1)); else echo '?co...
by Dr. Willpower
Tue Jul 02, 2013 5:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Xeio wrote:I don't know what the point of this cast is.

Code: Select all

string name = "@BRANCHID" + (object) index;


If this is Java, it seems like they wanted to force a call to the object.toString() method. This is supposed to be a unique identifier of some sort?
by Dr. Willpower
Thu Jun 13, 2013 7:37 pm UTC
Forum: Science
Topic: Worst thing you've seen in a lab
Replies: 256
Views: 233224

Re: Worst thing you've seen in a lab

=Any gas capable of damaging contact lenses would have to be a)pretty damn nasty - see previous point about it damaging your eyes (skin/lungs etc etc) anyway, lenses or not. and b)in quite high concentration - breathing at all may be the issue there. Agreed. Eye tissue is soft and vulnerable, conta...
by Dr. Willpower
Thu Jun 13, 2013 6:47 pm UTC
Forum: Coding
Topic: Question about Chrome extensions
Replies: 6
Views: 3606

Re: Question about Chrome extensions

This is not exactly a solution, but it might be close enough. You open one tab for each window, and in that tab you open a html file (on your computer). Would look exactly like this: <!DOCTYPE html> <html> <head> <title>Tab title here</title> </head> </html> Then switch to that tab before switching ...
by Dr. Willpower
Wed Jun 05, 2013 6:31 pm UTC
Forum: Science
Topic: Global Warming Mitigation
Replies: 15
Views: 5511

Re: Global Warming Mitigation

rising air will cool from adiabatic expansion, whether it's in a pipe or not. That's why the upper troposphere is colder than the lower troposphere. The air that come out if the top of such a pipe has cooled just as much as air rising by itself (and slightly more, if we put a turbine in) The air in...
by Dr. Willpower
Wed Jun 05, 2013 4:59 pm UTC
Forum: Science
Topic: Telephone poles and nuclear bombs.
Replies: 26
Views: 7709

Re: Telephone poles and nuclear bombs.

Dr. Willpower, that's interesting - I didn't realize that the Outer Space Treaty banned all weapons testing in space, rather than just nuclear testing. That's the bit we mostly hear about. Please do not confuse my ability to wiki, with me being an expert on the subject (har har). Upon rereading, it...
by Dr. Willpower
Tue Jun 04, 2013 9:03 pm UTC
Forum: Science
Topic: Telephone poles and nuclear bombs.
Replies: 26
Views: 7709

Re: Telephone poles and nuclear bombs.

So I could probably do it if I win the lottery. ...brings up an interesting question. Would I be liable for damages to the moon? I mean....I don't think there are any vandalism laws for space. We DID draw a penis on Mars afterall..Doubtful it's still there but we did do it. Liable to whom? Nobody o...
by Dr. Willpower
Fri May 17, 2013 9:30 pm UTC
Forum: Coding
Topic: 6 Second JavaScript Lessons
Replies: 9
Views: 8162

Re: 6 Second JavaScript Lessons

It seems to me that the videos are somewhat hurried. I had to watch them several times to completely understand what was going on, and I use JavaScript on a semi-regular basis. If I already have to watch the video five times to learn your lesson, why not just look up a thirty second video and watch ...
by Dr. Willpower
Thu May 09, 2013 6:10 pm UTC
Forum: Science
Topic: Evolution question: Why DON'T niches get filled
Replies: 61
Views: 9857

Re: Evolution question: Why DON'T niches get filled

Not many predators appeared to prey on the Kakapo because either nothing happened to the other animal's food supplies, which would force some of them to search alternative sources, or when something did happen, the entire population of that/those species was/were unfit for whatever reason and they ...
by Dr. Willpower
Wed May 01, 2013 7:38 pm UTC
Forum: Science
Topic: Reality Sharing aka Lifecasting Extreme
Replies: 15
Views: 2290

Re: Reality Sharing aka Lifecasting Extreme

So, the question I ask is: How could this be done? Would it be easier to capture and compile individual senses somehow or is there a certain part of the brain that would actually supply access to every sense? What do y'all think? Well I am very far from informed on this topic. But here goes some re...
by Dr. Willpower
Wed Apr 10, 2013 1:29 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Silly thought: I just tried to read a piece of legislation from my home country (though I suspect it wouldn't be so different somewhere else) and got really pissed at how badly structured the text is. I know how bad this sounds, but... would it be too arrogant to suggest that legislation would grea...
by Dr. Willpower
Fri Apr 05, 2013 1:21 pm UTC
Forum: Science
Topic: Understanding the speed of light
Replies: 17
Views: 2853

Re: Understanding the speed of light

But of course, for various story reasons I'd like travel to other worlds (in a reasonable timeframe both subjectively and from earth's reference frame) to be a "thing". You can also attack the problem from the other end. If your characters happen to have made their home on say, an asteroi...
by Dr. Willpower
Wed Apr 03, 2013 6:29 pm UTC
Forum: Coding
Topic: Nesting enums in C++
Replies: 5
Views: 7635

Re: Nesting enums in C++

I've enclosed my code so far here. Fortunately the assignment is due in three or four weeks, so no rush, so yeah...it gives me an error when I compile it: genetic-algorithm.h:5:2: error: expected identifier before ‘enum’ What am I doing wrong? You mean what are you doing wrong, besides posting a wh...
by Dr. Willpower
Fri Mar 29, 2013 2:11 pm UTC
Forum: Science
Topic: A proper scientific name for zero gravity.
Replies: 2
Views: 1724

Re: A proper scientific name for zero gravity.

Why not call it "free fall"? Agreed. According to Einstein there is no distinguishable difference between acceleration due to a curved path, and gravity. In other words items in free fall can be treated as though they are under a net gravity of zero (or very small, as the ships velocity i...
by Dr. Willpower
Fri Mar 29, 2013 1:47 pm UTC
Forum: Science
Topic: 4th Dimensional Species (time travel)
Replies: 9
Views: 2638

Re: 4th Dimensional Species (time travel)

The issue that a lot of people have with time travel is the idea of reversed-time causality. Time only flows forwards, and causality only works forwards (although it would appear to work in reverse according to physics, this is not the observed effect, we describe this lack of mirroring as the direc...
by Dr. Willpower
Fri Mar 08, 2013 6:28 pm UTC
Forum: Coding
Topic: CSS inline or no?
Replies: 23
Views: 7230

Re: CSS inline or no?

remove that useless div. use "margin" in your css. removing it shouldn't require you to write any more markup. I think this might be the best response yet. So, this is what I've gathered. In order of good to bad. 0. No markup 1. *{} 2. tag specific rules 3. class rules 4. Ids (Use with di...
by Dr. Willpower
Fri Mar 08, 2013 3:23 am UTC
Forum: Coding
Topic: CSS inline or no?
Replies: 23
Views: 7230

Re: CSS inline or no?

Steax wrote:There's a lot to read on the subject online.

Also, do remember to keep your class names and tags descriptive.


Thanks, that helped.
by Dr. Willpower
Fri Mar 08, 2013 2:23 am UTC
Forum: Coding
Topic: CSS inline or no?
Replies: 23
Views: 7230

Re: CSS inline or no?

I'm getting confused as the thread becomes longer. Several people are instructing me not to use ids. I see the value in generalizing wherever possible with classes or selectors. But I can't imagine writing markup without specifying the sizes of divs on the page. The implication I'm getting here is t...
by Dr. Willpower
Sun Mar 03, 2013 8:27 am UTC
Forum: Coding
Topic: CSS inline or no?
Replies: 23
Views: 7230

Re: CSS inline or no?

class should be used when you want multiple items to use that particular style. For one-off variations, use an id. Yes, I see the value in doing things this way. Part of the inline style markup was to overwrite one of the class stylings. I didn't know id did this as well. Edit: Also Remember that y...
by Dr. Willpower
Sat Mar 02, 2013 9:31 pm UTC
Forum: Coding
Topic: CSS inline or no?
Replies: 23
Views: 7230

CSS inline or no?

So, I've been coding for some time and I've just begun to write markup in the last year or so. I tend to write my markup like this. <div class="commonprop1 commonprop2" style="propsonlythisdivhas"></div> But the internet seems to think this is better: <div class="uniquenamef...
by Dr. Willpower
Sun Feb 24, 2013 6:30 pm UTC
Forum: Coding
Topic: Dear Coders *user request*
Replies: 8
Views: 3356

Re: Dear Coders *user request*

Please learn from Google. Indeed, so why blame coders? Google was created by coders to get quick, relevant results. Other "web portals" were designed by corporations to keep you on their site. Google was created the way it was because the founders didn't know html, if they did I'm sure it...
by Dr. Willpower
Wed Feb 13, 2013 6:18 pm UTC
Forum: Coding
Topic: What's the point of HTML
Replies: 21
Views: 10403

Re: What's the point of HTML

In response to your question, open a text editor (notepad.exe/gedit) and start writing HTML. That is how hardcore HTML writing is done. You are definitely going to want to look up CSS, and if you get really serious you'll probably want to look up JavaScript, and a serverside coding language like PER...
by Dr. Willpower
Sat Jul 07, 2012 12:18 am UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

Unknown Exception YOU'RE NOT HELPFUL AT ALL! This is why I always put helpful messages in my ex.what() function. Even if I just have a catch (std::exception &ex) block, calling ex.what() will tell me what the problem is. I don't need to know exactly what function was thrown. The good old fashio...
by Dr. Willpower
Tue Jun 26, 2012 7:39 pm UTC
Forum: Coding
Topic: Coding: Fleeting Thoughts
Replies: 10016
Views: 2033715

Re: Coding: Fleeting Thoughts

I'm finding this dynamic typing stuff to be very liberating. Kind of like living with your mother for years and then finally moving out. Of course, someone has to do all the housework and it will still probably be me...

Go to advanced search