Jump to content

  • Log In with Google      Sign In   
  • Create Account

valderman

Member Since 02 Aug 2002
Offline Last Active Feb 27 2014 07:19 AM

Topics I've Started

"Scripting languages"

03 September 2011 - 09:08 AM

The local IT press has recently taken a break from evangelizing cloud computing and "noSQL" as the second coming of Christ to push their new favorite fad: "scripting languages." Allegedly, "scripting languages" are "easier to work with" than "other languages" and are generally awesome in a generic, not-quite-specified way. Of course, I got intrigued about these "scripting languages" - what are they, and why are they so awesome?

Evangelists of "scripting languages" tend to name Javascript, PHP and Python as examples of new, awesome scripting languages, relegating Java and the .NET languages to the status as old, boring and "hard to work with." So, what exactly is a scripting languages?

At first glance, could it be an interpreted language? Apparently not, because compilers exist for both PHP and Python, and all of the three "scripting language" poster children also have implementations using JIT compilation. Meanwhile, both Java and the .NET languages is commonly executed through bytecode interpretation, and REPL interpreters are integral to working with F# or Haskell.

Perhaps it's dynamic typing? After all, dynamic typing is supposed to totally awesome for increasing productivity. Turns out, C# supports dynamic types and Erlang, which I doubt anyone would call a "scripting language," is completely dynamically typed. Weak typing doesn't seem to be it either, as Python employs strong typing.

So what I'm trying to say here is that the term "scripting language" annoys me because it seems to be synonymous with "a language I think is cool and modern." Can anyone else come up with a good, consistent definition of "scripting language?"

Can I get Windows 7 to overcommit memory?

26 March 2011 - 04:32 AM

So I have this beefy machine with four gigs of RAM running 64-bit Windows 7. Unfortunately, I don't have the disk space to match, so I figure that, with that much RAM I should be able to run without page file, to conserve a bit. Also, having a program die because of a failed allocation tends to be preferrable to having the system go into 15 minutes of frantic paging activity, which usually doesn't end until the memory hog is killed anyway.

This has worked out beautifully on Linux, which I used to use as my primary OS until my other disk died and took my Linux partition with it. Unfortunately, no such luck in Windows 7. I get constant nag screens about the system being low on memory, and occasionally programs commit suicide because of failed allocations. Turning on the page file solves the problem, but the file is barely used at all. This is of course due to the difference in memory handling between W7 and Linux; W7 requires that every allocated page of memory actually exists. Linux, on the other hand, allows programs to allocate quite a bit more than what's actually available (and then goes on a killing spree if programs actually touch more memory than what's available,) the rationale being that programs quite frequently allocate huge chunks of memory without using anywhere near all of it. Java is a great example of this, and pretty much every program that uses a custom memory allocator, I would presume.

Now, I think it's pretty silly to have to give up six gigs of HD space just because some programs like to lie about how much memory they're going to use, so I was wondering if there's any way to get Windows 7 to overcommit memory the way Linux does?

Functional programming thread

05 March 2011 - 06:55 PM

Is anyone on GDNet into functional programming? If so, is anyone using it for anything interesting?

I first came into contact with FP by way of Haskell, which my university uses in its introductory programming course, and took a liking to it right away.

At the moment I'm working from time to time on an IRC bot written in Erlang and, a bit less intermittently, a non-strict, pure functional language for web development (known problems: no tail call elimination yet, the syntax is far too C-like and the error messages horrible, out of which I'm blaming the last two on my poor initial choice of the BNF Converter for parser generation,) in Haskell, for my bachelor's thesis. I wrote a small Tetris clone to try it out; better use Chrome if you want to test it though, since I'm being extremely inefficient about redrawing the background and Firefox is pretty slow with canvas drawing. I'm also currently toying a bit with F#, but the way they've complicated monads is putting me off.

Is anyone else doing something interesting with FP, or even interested at all?

Math: self-assessment help

16 January 2011 - 06:19 PM

I'm taking a course on machine learning this semester, and a short prerequisites self-assessment test was posted to the course web page; it's pretty much about maths. Now, I'm not stupid, but I don't have much faith in my math skills and the test doesn't come with correct answers, so I thought I'd ask the sharp minds of GDNet about my answers. I know the questions are supposed to be simple, but when you find something simple you're either usually completely right or completely wrong.

The test with questions is here (very short), if any kind soul wants to help.

1. There are kn different assignments; there are k possibilities for the first variable, then for each of those valuations there are k possibilities for the second variable, etc. This assumes that the variables are distinguishable; that is, {x1 = 0, x2 = 1} =/= {x1 = 1, x2 = 0}.

2. There are 2n subsets, including the empty set. We can view each subset as a binary string of length n, where the nth binary digit denotes whether the nth element in the set is in the subset or not.

3. Half of the possible subsets contain a fixed element a, so 2n-1; to use the binary string reasoning from #2, it's all binary strings where the ath bit is 1.

4. We can create 22n set families. The set of set families is just the set of all subsets of the set of all subsets of the original set. Perhaps easier to read in pseudocode:
$set := a set with n elements
$subsets := all subsets of $set
set_families := all subsets of $subsets

5. The statements are different; a) says that no matter which element a we pick, there will be a set in F that contains it whereas b ) says that there is a set in F that holds every element a.

6. There are 2n+1 boolean functions with n variables. There are 2n possible inputs, and each input has two possible outputs.

7. log2 k bits. No motivation necessary.

8. k2 leaves; each right/left choice takes you one step away from the root and removes half of your remaining choices.

9. I don't completely understand this question; am I just supposed to write any linear inequality for which the boolean function is true? If so, then wouldn't 1*x1 >= 1 suffice? (False if x1 is 0, true if it's 1.) That sounds too easy, so I must have misunderstood the question.

10. I don't understand this either; what exactly is meant by characterize here? If I'm just supposed to explain what quadratic functions fulfill the conditions, then it's those where c = 0 (since q(0) = 0) and a + b = 1.

11. I don't understand this question completely either, but if I'm just supposed to explain my strategy then I would choose my xs such that if pi is the largest of all the ps, then xi = 1, otherwise xi = 0. Since we the sum of my factors can't exceed 1, wasting any part of that 1 on an element that's smaller than the maximum p will result in a value that's less than the maximum p.

Does P imply Q where P is for Parenthood and Q is for completely batshit insane?

31 October 2010 - 02:06 PM

I'm getting closer and closer to the age where having kids is the appropriate, respectable thing to do (even though the very idea still horrifies me,) which has caused me to observe parents and their kids a lot lately, and my observations leave me wondering: are most people completely insane from the get-go, or is that something you automatically acquire when becoming a parent? Regardless of which, I've observed the following.

1. Parents have a complete lack of respect for everyone else around them.
Is your kid shouting at the top of his lungs just for attention? Fuck that, you're on the phone/reading/texting! Is he running up and down the aisle at the mall screaming and kicking people? How cute, he's expressing himself! Is he walking up to people on the bus just to scream in their ear because he's unhappy with his seat and wants theirs? Why, of course the kid should have whatever seat he wishes; anyone already sitting there only have themselves to blame! Going to a fancy restaurant? Let's bring the infant along, I'm sure everyone will love having dinner at 130 decibels!

2. Parents give their kids whatever they point at.
God forbid you actually teach your kid to eat healthy or that you don't always get what you want; that'd require actual work!

3. Parents treat their kids as though they were made of glass.
This problem seems especially prevalent in the US (see comments to this for example) but happens everywhere that I've seen. Going to the park is dangerous! Climbing trees can kill you! Walking to school alone carries a 210% risk of getting abducted and raped to hell and back again! The internets are full of evil things, we have to make sure you don't accidentally glimpse them! Don't talk to strangers, that's even worse than walking to school! (This one has actually caused kids lost in the woods to hide from search parties, though I can't find a link to the story ATM.) As if most accidents didn't happen within the home, most abductions weren't committed by relatives and most cases of molestation didn't involve family members or close friends.

4. Parents back their kids up for just about anything.
Oh, your classmate's dad told you to stop bullying his son? Better call the police because the bastard had the audacity to talk to you!

Basically, everything I've seen indicates that having kids seriously impairs people's ability to think rationally and show respect for anyone outside the family. People who "think of the children" generally don't think at all, and this seems to apply tenfold to parents.

I suspect there are quite a few GDNet members who have kids of their own; have you recognized a shift like this in your behavioral or mental patterns in association with important events (most significantly birth) in your kids' lives?

EDIT: forum software ate -> in topic.
EDIT2: ate → as well. I give up.

PARTNERS