After some hours of customization, I finally decided to give my ubuntu account some pizzaz.
Unfortunately, I don't know what else to include in my conky sidebar on the right. And I'm also going to replace the Ubuntu icon in the top left in favor of something else. Any other ideas on what else to add? Or things to add to conky?
This theme was somewhat stolen from this guy.
Edit: I also should switch the conky stuff to use Fahrenheit instead of celsius. >.>
If you're reading this from my posterous feed this really doesn't apply to you so you might as well stop. If you're reading this from my LiveJournal feed, however, I have a quick update. I've disabled all comments from LiveJournal because I was somehow attracting a lot of spam. That's rather undesirable, so I've disabled all comments.
However, comments on my posterous blog will remain available, so feel free to leave comments on that one.
So for several years now, I've had this idea. Last night I started putting it into action.
(Phase 1) Scrape all of UALR's class information from their website, including classes, prerequisites, and professors teaching the courses from this year and last year.
(Phase 2) Build an educationally based social networking site (much like blackboard) but run by the students and for the students, so there's no issue of the potential of the site being squandered, simply because teachers don't know how or simply won't use it. [Obviously this phase will have multiple subphases.]
(Phase 3) ??? [Possibly get other schools to implement the idea, and at this point, I no longer have to resort to scraping data, because hopefully they'd just give it to me.]
(Phase 4) Profit.
No, it won't be marketed as a "facebook killer," because it doesn't compete with facebook. The only thing that I expect it will "kill," is the awful existence that is teachers not knowing how to use blackboard. I don't have any problems with the service, in fact I've seen some ways that it can be used very well. I don't think I know any professor that has really taken the time to learn to use the service, though. And why should they? There's no incentive. But if students could use this as a way to rate the professors, find out whether or not they should really be taking a class, get the notes from class that they might've missed, or upload some notes to help out others, I think we might be on to a more powerful method of learning. And while I don't see social networks being particularly useful right now for anything other than, well, being social, I see this as an extension that could come out of it and vastly improve the way that we learn.
Professors and faculty members, I know there's probably the question "What do we do to keep students from posting previous tests or homework assignments and just giving everyone the solutions?" Right now, the answer is nothing. You don't stop it. To be honest, even without this you never would stop it. But I'm sure there will be some methods to prevent this. Heck, I'm only done with Phase 1. Oh yeah, sorry about scraping your data, last night, UALR, but you made it pretty easy.
Now we move on to Phase 2. Which will take a while. Going to start working on that tonight, probably.
... class MainPage(webapp.RequestHandler): def get(self): ... referer = self.request.environ['HTTP_REFERER'] \ if 'HTTP_REFERER' in self.request.environ else None ... ...
People of the internet (and all the cracks in between -- you know who you are):
I have an optimization problem for all of you. Find the best maximum between the following items:
- Graduate programs that I want to go to.
- Graduate programs that I can afford to go to.
- Graduate programs that will accept me.
- And finally, a binary value of whether or not I actually want to attend graduate school right now -- where right now is actually meaning about this time next year.
And for bonus, you can tell me the minimum as well. But that's mostly for hilarity's sake, whoever that is.
Some biographic information for those of you who aren't stalking me (I've boldfaced the keywords for you skim-readers): I am a computer science student attending UALR and I also have a major in mathematics. I am very interested in web development as well as scripting languages but I'm also good with compiled languages. I have some interested in cryptography and security, although it is limited at best. Also, my dream job would be to work for Google as a developer, I think. I will write this last sentenced entirely boldfaced just to be mean to the people the skim-read (and also the people that don't, I suppose).
Thank you for your time in helping me make my college/career choices for me. I appreciate your [lack of?] honesty when answering my questions.
Problem statement. Write a computer program in the language of your choice which reads in a single non-negative integer N as input and produces as output the power set of {1, 2, 3, ..., N}, written one subset per output line. For example, if N=4, your output should look something like:
{ 1 2 3 4 }
{ 1 2 3 }
{ 1 2 4 }
{ 1 2 }
{ 1 3 4 }
{ 1 3 }
{ 1 4 }
{ 1 }
{ 2 3 4 }
{ 2 3 }
{ 2 4 }
{ 2 }
{ 3 4 }
{ 3 }
{ 4 }
{ }
The order of the listing is unimportant; the example above suggests one possible natural ordering but there are other natural orderings too. Hand in a hard-copy of your source code, and hard-copy of the output of your program produces for N=5
Solution: I decided that the nicest and easiest to read way to implement this would be with generator functions in Ruby. Anyways, here’s the following code that I came up with. Tell me what you think. By the way, yes I know that Ruby Arrays have a built in combination function, but I felt like that was cheating for this project. So I implemented it myself.
module Enumerable def choose n if block_given? a = self.to_a yield [] if n > a.length or n < 0 yield [] if n == 0 a.each.with_index { |v,i| a[(i+1)..-1].choose(n-1) { |x| yield [v] + x \ if x.length == n-1 } } self else combinations = [] self.choose(n) do |c| combinations << c end combinations end end def powerset unless block_given? sets = [] 0.upto self.to_a.length do |i| sets += self.choose i end sets else 0.upto self.to_a.length do |i| self.choose(i) do |set| yield set end end end end end if __FILE__ == $0 begin puts "Pick a number to get the power set of (1..n)." print "n=" n = gets.chomp.to_i puts "The powerset of #{(1..n).to_a} is:\n\n" t1 = Time.now (1..n).powerset do |set| puts "#{set}" end t2 = Time.now puts "\n\nSize: #{2**n}\nThis operation took #{(t2 - t1)*1000} "\ "milliseconds\n\n" end until n == 0 end
Not surprisingly, since |P(A)| = 2|P(A)|, This code runs at ~O(2n). Anyways, tell me what you think. Especially if you see ways to improve.
Also, I plan to add comments to my code very soon, so never fear.
Finally, soon I have another interesting project that’s nearing its completion that I plan on open-sourcing (actually I already did, but I’ll mention it later, running late for class)
== EDIT == So I came up with a better solution to my powerset algorithm, and it calculates (1..20).powerset in less than 2 seconds. Anyways, here is the math I based it on.
Consider a set A[0] = {}. Then P(A[0]) = {{}}. Now consider A[1] = {1}. Then P(A[1]) = {{}, {1}}. Then we have that A[1] = A[0] U {1} (where U is a binary operation defined as the union of the two sets). And that P(A[1]) = P(A[0]) U (P(A[0]) + 1) (where + is a binary operation defined as appending the element on the right to each set inside the element on the left). Furthering this example, we can see that A[n] = A[n-1] U {n}. And P(A[n]) = P(A[n-1]) U (P(A[n-1]) + n).
Note that this is not a rigorous definition by any means, and that this is essentially proof by observation. But I can assure that this holds for all n. So using this knowledge we can now form the following code:
def powerset n if block_given? if n <= 0 yield [] else powerset(n-1) do |item| yield item yield item + [n] end end else sets = [] powerset(n) do |item| sets << item end sets end end
And if we wanted to apply this argument to any general array, we could just as easily say
class Array def powerset if block_given? if self.length == 0 yield [] else self[0..-2].powerset do |item| yield item yield item + [self[-1]] end end else sets = [] self.powerset do |item| sets << item end sets end end end
So this is my current solution. And note that I can now calculate (1..20).powerset in approximately 1.6 seconds, instead of the 45 seconds it took before. It’s a lot faster, now that it doesn’t rely on trying to create combinations of arrays.
Problem statement. Write a computer program in the language of your choice which reads in a single non-negative integer N as input and produces as output the power set of {1, 2, 3, ..., N}, written one subset per output line. For example, if N=4, your output should look something like:
{ 1 2 3 4 } { 1 2 3 } { 1 2 4 } { 1 2 } { 1 3 4 } { 1 3 } { 1 4 } { 1 } { 2 3 4 } { 2 3 } { 2 4 } { 2 } { 3 4 } { 3 } { 4 } { }
The order of the listing is unimportant; the example above suggests one possible natural ordering but there are other natural orderings too. Hand in a hard-copy of your source code, and hard-copy of the output of your program produces for N=5
Solution: I decided that the nicest and easiest to read way to implement this would be with generator functions in Ruby. Anyways, here’s the following code that I came up with. Tell me what you think.
module Enumerable def choose n if block_given? a = self.to_a yield [] if n > a.length or n < 0 yield [] if n == 0 a.each.with_index { |v,i| a[(i+1)..-1].choose(n-1) { |x| yield [v] + x \ if x.length == n-1 } } self else combinations = [] self.choose(n) do |c| combinations << c end combinations end end def powerset sets = [] 0.upto self.to_a.length do |i| sets += self.choose i end sets end end if __FILE__ == $0 begin puts "Pick a number to get the power set of (1..n)." print "n=" n = gets.chomp.to_i puts "\nSize: #{2**n}\nThe powerset of #{(1..n).to_a} is:\n\n" (1..n).powerset.each do |set| puts "#{set}" end puts "\n" end until n == 0 end
Anyways, tell me what you think. Especially if you see ways to improve.
Okay, so my dream was something along the lines of Harry Potter with Jack Skellington at the scene of an Orthodox Catholic Cathedral where we all lived and it had the same layout as ASMSA.
Oh, and most of the stairs had lines of electricity that bounced back and forth across each stair that you had to dodge and if you hit them you started over at the top of the stairs.
Now I have a migraine. Stupid dreams.




















