Search found 678 matches

by OmenPigeon
Tue Sep 16, 2014 2:34 pm UTC
Forum: Computer Science
Topic: Need help refactoring/optimizing
Replies: 4
Views: 3253

Re: Need help refactoring/optimizing

So the problem is that it's taking too long? I don't really know what your requirements are, so here's a handful of random oblique strategies -esque ideas: If you have n*m pieces of data (days * hours, I guess?) and you really do have to do BigSlowTask for each of them, then tough. I'm not sure ther...
by OmenPigeon
Tue Sep 16, 2014 3:20 am UTC
Forum: Computer Science
Topic: Need help refactoring/optimizing
Replies: 4
Views: 3253

Re: Need help refactoring/optimizing

What do you not like about it? (Aside from the variable names, which I assume are garbage on purpose?) I agree that the code doesn't particularly thrill me, but if it's the biggest problem you have, I'd say you're doing pretty well. Would it make you happier to break it up into functions: function p...
by OmenPigeon
Sat Jun 30, 2012 2:44 am UTC
Forum: Coding
Topic: Is the Right Tool a Matter of Preference?
Replies: 123
Views: 33854

Re: Is the Right Tool a Matter of Preference?

1) Suppose we only care about one aspect: code length. The a language that minimizes code length is one that compiles an empty source file into your program by default. Granted, it's not very useful since any change in program requirements will involve massive changes to the program code. Sure. If ...
by OmenPigeon
Fri Jun 29, 2012 1:21 am UTC
Forum: Coding
Topic: Is the Right Tool a Matter of Preference?
Replies: 123
Views: 33854

Re: Is the Right Tool a Matter of Preference?

Suppose all possible languages exist. Then for any given problem X there is a language that minimizes code length / development time / maintenance costs / etc. Call this language Y, which is objectively the right tool for the job. You can only assume that Y is unique if you ignore the fact that pro...
by OmenPigeon
Tue May 01, 2012 12:31 pm UTC
Forum: Coding
Topic: noob python and C questions
Replies: 42
Views: 8867

Re: noob python questions

Guido controls CPython, not PyPy etc. Sure, but it's not entirely that simple. As he mentioned in that blog post, tail calls are a feature, not an optimization. Adding them to a python implementation means that you can now write programs in one implementation of Python that won't execute correctly ...
by OmenPigeon
Tue May 01, 2012 12:41 am UTC
Forum: Coding
Topic: noob python and C questions
Replies: 42
Views: 8867

Re: noob python questions

That's basically it, except as far as I can tell it isn't guaranteed by the language, it's guaranteed by Guido . As I recall there was rather a kerfuffle in Python land around this point so I'm going to avoid wading into whether or not he's is in the right here, but the takeaway is that if you're wa...
by OmenPigeon
Fri Mar 30, 2012 2:39 am UTC
Forum: Computer Science
Topic: Computer forensics question - Microsoft Word - School Threat
Replies: 8
Views: 4618

Re: Computer forensics question - Microsoft Word - School Th

.docx files are basically zip files with xml files inside. If you rename the document to varoitus.zip you'll be able to open it and read the data directly. One of the top level folders should be named, if memory serves, "docProps", or if not that then something similar. There should be two...
by OmenPigeon
Tue Feb 21, 2012 10:48 pm UTC
Forum: Coding
Topic: Web Typography: How much leading do browsers add?
Replies: 12
Views: 3061

Re: Web Typography: How much leading do browsers add?

http://www.cssreset.com/

All the CSS rules in there are designed to reset the browser's defaults to something more basic so that you can start fresh without worrying about each platform's quirks. You probably don't want to take them wholesale, but they should be a good source of inspiration.
by OmenPigeon
Sat Jan 21, 2012 3:18 am UTC
Forum: Computer Science
Topic: Ugh... fiendish CS proffs...
Replies: 26
Views: 4286

Re: Ugh... fiendish CS proffs...

I'm leaning on Yakk's side with this one, for a number of reasons. In a purely mathematical sense, you didn't submit a correct program. You were asked (perhaps not in these words, but in this spirit) to provide a function f such that for all x, where x is a member of the set of finite sequences of r...
by OmenPigeon
Wed Jan 11, 2012 3:27 am UTC
Forum: Coding
Topic: Oracle Java Certification
Replies: 6
Views: 5262

Re: Oracle Java Certification

In all the hiring I've been involved in 1 , it'd be much more helpful to show something that you've built, in whatever language, than to show a certification. A github account featuring actual working code is better in two ways. First, it's much closer to what someone actually wants to hire you to d...
by OmenPigeon
Tue Dec 20, 2011 4:02 am UTC
Forum: Coding
Topic: Why should I use get and set for my class methods?
Replies: 14
Views: 3498

Re: Why should I use get and set for my class methods?

I don't know what's useful . I mean I want it to flow properly, be modular, and not hard to maintain. But I HATE examples which use bike There's a good heuristic that you should refactor code so it's shared once you've written the same code three times. 1 There's a really strong temptation to start...
by OmenPigeon
Sun Dec 18, 2011 3:59 am UTC
Forum: Coding
Topic: Game engine physics
Replies: 6
Views: 1386

Re: Game engine physics

So then what's wrong with interfaces? class Skellington implements Ragdoll, Blowable, Droppable { ... } class Physics { void update(Ragdoll doll) { ... } void update(Blowable actor, Windiness wind) { ... } void update(Droppable actor, Gravity gravity) { ... } } Or something in that arena.
by OmenPigeon
Sun Dec 18, 2011 1:14 am UTC
Forum: Coding
Topic: Game engine physics
Replies: 6
Views: 1386

Re: Game engine physics

Can you put all the skeleton handling code in a superclass? In C#: abstract class Skeleton { public void Update() { ... } } class DancingSkeleton : Skeleton { } class RunningSkeleton : Skeleton { } SRP-wise, it may be better to break out the physics code from the skeleton code anyway, so that if you...
by OmenPigeon
Wed Dec 07, 2011 4:13 am UTC
Forum: Coding
Topic: C# Data Grid problems
Replies: 1
Views: 802

Re: C# Data Grid problems

Are you getting this error at compile time or run time? The only use of 'protection level' that I know off the top of my head in C# refers to access modifiers (public, private, etc), which would throw compile time errors. But it's not out of the realm of possibility for ASP.NET (MVC?) to use that ph...
by OmenPigeon
Tue Oct 11, 2011 3:00 am UTC
Forum: Coding
Topic: How can Object Oriented code use functional principles?
Replies: 7
Views: 1970

Re: How can Object Oriented code use functional principles?

If you push the idea of 'minimize state' a little farther, you end up at immutable objects. They're pretty common in functional languages (I think Haskell and most/all of the ML family treat variables as immutable by default), but they can be super useful in OO code too. Most OO languages have immut...
by OmenPigeon
Sat Aug 27, 2011 2:01 pm UTC
Forum: Coding
Topic: Powerful visual language / ide?
Replies: 16
Views: 2922

Re: Powerful visual language / ide?

Well, if you had a statically typed language, you could represent types with coloured bands. Empty space that's a valid position for arguments can be pre-coloured with the the type colours it will accept. It seems to me that that would actually be very useful. Really? How many distinguishable color...
by OmenPigeon
Tue Apr 26, 2011 11:20 pm UTC
Forum: Coding
Topic: C# auto-implemented properties
Replies: 5
Views: 1039

Re: C# auto-implemented properties

You can also have separate access modifiers for the getter and setter:

Code: Select all

class Foo
{
    public int Bar { get; private set; }

    public void Quux(int x)
    {
        Bar = x;  // Compiles fine.
    }
}

Foo f = new Foo();
f.Bar = 7;   // Fails to compile.
by OmenPigeon
Wed Mar 23, 2011 3:32 am UTC
Forum: Computer Science
Topic: Computer Science at University
Replies: 18
Views: 3284

Re: Computer Science at University

It would be difficult, though not impossible, to get a computer programming job without a degree. This varies a lot by employer. Where I work we have a number of keyboard jockeys with CS degrees, and ones who majored in physics, geography or some flavors of the arts. There are a lot of good compani...
by OmenPigeon
Fri Mar 11, 2011 3:58 am UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

It looks like Methods of Rationality has Quirrell trying to dispel that social penalty. He managed to get Dumbledore's permission to teach it after all. Sure, but there's a vast gulf between convincing the headmaster that everyone knows is insane to let you teach kids how to protect themselves and ...
by OmenPigeon
Thu Mar 10, 2011 2:40 am UTC
Forum: Coding
Topic: "Repro testing" - Do any automated test suites do this?
Replies: 6
Views: 1442

Re: "Repro testing" - Do any automated test suites do this?

It seems like a lot of work to solve a problem that I, at least, don't actually have. I can't recall a single time that I or anyone I've worked with has accidentally fixed a bug while working on a different one. Occasionally an issue will get reported against a released build that's been fixed in a ...
by OmenPigeon
Thu Mar 03, 2011 3:23 am UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

I was just thinking--wouldn't an Avada Kedavra be the perfect way to break through defensive enchantments? It's clear that wherever it says that they can't be stopped is wrong. Harry does it with the twin core thing, and it seems to be stopped by physical objects. I can't remember if Dumbledore's s...
by OmenPigeon
Tue Mar 01, 2011 5:31 am UTC
Forum: Coding
Topic: Why is R different?
Replies: 25
Views: 6669

Re: Why is R different?

Unlike Java and Python, which are targeted at programmers, R is targeted more at mathematicians. While programmers have borrowed many mathematician's symbols, we've tended to play a little fast and loose with their semantics. For example, consider the '*' operator in python: >>> 4 * 5 20 >>> [1,2] *...
by OmenPigeon
Wed Feb 16, 2011 1:25 am UTC
Forum: Coding
Topic: C#: FizzBuzz with a twist [Homework]
Replies: 19
Views: 2614

Re: C#: FizzBuzz with a twist [Homework]

The problem with the recursive function is it is harder to add stuff like this to the beginning of the function: if (digit > 9 || digit <0) throw new ArgumentOutOfRangeException("digit","Digit must be between 0 and 9"); if (input < 0) input *= -1; And expect the optimizer to act...
by OmenPigeon
Wed Feb 09, 2011 5:56 am UTC
Forum: Coding
Topic: What should be defined before starting a new job?
Replies: 6
Views: 1091

Re: What should be defined before starting a new job?

One of the hard parts of programming (right along with naming things) is figuring out what your customers want, which may or may not be similar to what they say they want. You said at the top that there's no money changing hands for this project, so your risk is pretty limited; you aren't going to f...
by OmenPigeon
Tue Nov 09, 2010 4:58 am UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

I suspect harry knew about simple solid fuel rockets. Even so, taking an existing rocket design and modifying it on the fly to work with a broom carry 2 (and a half? How much does QuirrelSnake weigh?) passengers is something that even Harry-under-stress should recognize as foolhardy at best...
by OmenPigeon
Thu Nov 04, 2010 4:18 am UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

A few new episodes have shown up. So, when did Harry notice that touching his teacher caused pain? And why isn't he being really weirded out by it again? I think that this is the first time Harry's felt actual *pain* while around Quirrel. There have been repeated mentions of a "sense o...
by OmenPigeon
Sat Oct 30, 2010 2:01 pm UTC
Forum: Coding
Topic: C# Memory Increase Issue
Replies: 11
Views: 2488

Re: C# Memory Increase Issue

If you want to test what happens to your app during garbage collection, you can use the System.GC class to force a collect. It'll also tell you the current amount of memory that it thinks is allocated, which may (or may not, I have no idea how accurate the .NET runtime's reporting of this number is)...
by OmenPigeon
Fri Oct 29, 2010 12:12 am UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

Why do we know that Sirius was evil, again? Bellatrix could have been this same being in the original books, but nobody would have noticed... I don't recall, exactly, but I thought that it was either stated or implied in an earlier chapter that Sirius was actually evil. At the very least the ep...
by OmenPigeon
Wed Oct 27, 2010 2:06 am UTC
Forum: Gaming
Topic: Fallout: New Vegas : It's Anti-Materiel. Not Material.
Replies: 613
Views: 74933

Re: Fallout: New Vegas

Image
Image

Oh, bother.

(Even better: in game he was walking, but not moving, so it was a very convincing approximation to kicking in frustration.)
by OmenPigeon
Sun Oct 24, 2010 5:01 pm UTC
Forum: Books
Topic: Harry Potter and the Methods of Rationality
Replies: 1035
Views: 338552

Re: Harry Potter and the Methods of Rationality

I did not see that coming (chapter 51). I'd kind of half-guessed it. It makes narrative sense if you keep in mind Eliezer's First Law of Fanfiction: " every change which strengthens the protagonists requires a corresponding worsening of their challengess. Or in plainer language: You ca...
by OmenPigeon
Sat Oct 23, 2010 5:53 am UTC
Forum: Coding
Topic: Coding Careers and the path to get there
Replies: 17
Views: 2072

Re: Coding Careers and the path to get there

As far as I can tell, hiring good programmers is right up there with P=NP as far as unsolved problems go. The hiring process is even further removed from day to day programming than schoolwork is. That said, here are the few things I've learned about finding jobs (with all my worldly experience of l...
by OmenPigeon
Sat Oct 09, 2010 9:29 pm UTC
Forum: Gaming
Topic: Civilization 5!!!
Replies: 481
Views: 102682

Re: Civilization 5!!!

Yeah, city defense is kind of wonky. When you have a unit in a city and someone attacks the city, they actually attack the city itself, not the unit. And when they defeat the city, the unit is automatically destroyed as well. This means that the only units worth garrisoning in cites are ranged/siege...
by OmenPigeon
Sat Oct 02, 2010 3:14 pm UTC
Forum: Coding
Topic: Checkboxes, WPF app in Visual Studio 2010
Replies: 10
Views: 1605

Re: Checkboxes, WPF app in Visual Studio 2010

Also, I use checkboxes in windows forms all the time, I don't know why they're classified as web, when the only thing I add to my precompiled header list is "using System.Windows.Forms" and it's right there. Again, check your namespaces. WPF's checkbox is in System.Windows.Controls. Winfo...
by OmenPigeon
Sat Oct 02, 2010 2:08 am UTC
Forum: Coding
Topic: Checkboxes, WPF app in Visual Studio 2010
Replies: 10
Views: 1605

Re: Checkboxes, WPF app in Visual Studio 2010

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.checkbox.aspx Checked is a property, so says the all-knowing MSDN. Check your namespaces. That link is to System.Web; WPF lives in System.Windows. That aside, I agree that a null reference exception is an odd thing to be getting here...
by OmenPigeon
Fri Oct 01, 2010 3:01 am UTC
Forum: Coding
Topic: First Big Program
Replies: 17
Views: 2570

Re: First Big Program

If you have access to it, setup source control, it helps merge files from multiple users as well as reverting back to working builds ( we all know people will commit broken code ). This is exactly right, except that the first clause should read "You have access to it; set up source control.&qu...
by OmenPigeon
Fri Oct 01, 2010 1:07 am UTC
Forum: Coding
Topic: Checkboxes, WPF app in Visual Studio 2010
Replies: 10
Views: 1605

Re: Checkboxes, WPF app in Visual Studio 2010

Can you use databinding to tie the checked state of CheckBoxLogAutosave to CheckBoxLoggingEnabled? I don't recall how to do it at the moment, but you should be able to use element databinding to connect them directly without any callback.
by OmenPigeon
Wed Sep 22, 2010 12:25 pm UTC
Forum: Gaming
Topic: Civilization 5!!!
Replies: 481
Views: 102682

Re: Civilization 5!!!

The city-states I mostly ignored. If you don't specialize in dealing with them, it seems like a very expensive way to get food or culture- particularly if they're hostile, as the three city-states I started out near were. I can see a maritime friendship being very useful (food for the food god) but...
by OmenPigeon
Thu Sep 16, 2010 3:26 am UTC
Forum: Coding
Topic: Question about generic types in Java
Replies: 9
Views: 2043

Re: Question about generic types in Java

It's been ages since I did Java work, but you can add type constraints to your generic declarations so that it'll be a compiler error if you try to instantiate a generic object with a type that doesn't satisfy the constraints. I've never used them in Java myself, but it looks like they're similar to...
by OmenPigeon
Fri Jun 25, 2010 1:22 am UTC
Forum: Coding
Topic: Python Multiple File String Replace
Replies: 3
Views: 1100

Re: Python Multiple File String Replace

glob will definitely work. If you get turned around with that, though (you sound like you're kind of new to regexes/wildcards) os.walk is a great way to manually walk through a directory tree to find the files you want. That plus the endswith method should get you most of where you want to be.
by OmenPigeon
Thu Jun 24, 2010 2:41 am UTC
Forum: Coding
Topic: History tracking in an OOP manner with C#?
Replies: 7
Views: 1960

Re: History tracking in an OOP manner with C#?

Have you looked into using a mock object library? I don't have enough experience to say for sure that they'll be able to do what you want, but their general purpose is to make assertions about how the methods of an object are being called, how many times, in what order and that sort of thing. I've o...

Go to advanced search