rss feed blog search engine
 
Search rss blog search engine
 
Zuf's Blog : Zufolek's Blog on Computers, Politics, and Life  
Released:  11/4/2009 1:20:13 PM
RSS Link:  http://zufolek.sosblog.com/Zuf-s-Blog-b1/RSS-b1-rss2-posts.h ..
Last View 11/20/2009 9:52:19 PM
Last Refresh 11/21/2009 1:45:40 AM
Page Views 45
Comments:  Read user comments (0)
Share



Description:



A mad computer programmer ranting


Contents:

Zuf's Inter-universal Communicator
A few years ago, I started designing and building a device that could have  hypothetically allowed me to communicate with other universes.



I was inspired by the idea that gravity can probably travel between universes, which could mean that information can travel between universes via gravity.



I intended to use a small lead ball and some optical devices from a junk VCR as my receiver. The lead ball would be suspended by a hair or string, and would move slightly under the influence of changes in the local gravitational field, interrupting, or more accurately occluding to a varying degree, an infrared beam. I chose lead because it has the highest density of common substances, which would help maximize signal-to-noise ratio. The sensitivity could be further improved by reflecting a laser off a mirror on a suspended weight.



For my transmitter, I intended to intermittently swing bottles full of water, simply stand in certain locations, or move a vehicle periodically. These actions would cause minute changes in the gravitational forces on objects in other "nearby" universes.



I suspected that another universe, if one is nearby, would probably be radically different from our own, but imagine if it were very similar to ours. The Zufs in both universes might be transmitting at the same time, and the masses could be moving at the same time, so no signal would ever be communicated.



However, there would probably be at least subtle differences between the universes, which I could use to modify my behavior. If I determine whether to transmit or receive based on the flip of a coin, for instance, it would probably be a litttle more likely that the two Zufoleks would be able to communicate.



Believe it or not, I gave up on this project as too unlikely to be worth the effort!



Code Optimization
Code optimization is something we super-nerdy programmers do to improve our programs. Optimization usually doesn't add any features, it just makes the exisiting features work better if you're lucky, although it might allow the program to have the capability for more features. Optimization often introduces bugs, and writing or maintaining optimized code is often more difficult to some degree.



For most programs, creating working code is more important than creating optimized code, and optimization is simply a fun way to reduce productivity. You probably shouldn't think much about optimization unless you know that you need to.



Usually, people optimize for speed, and this allows the program to finish working faster, so you don't have to wait too long for all the features you don't use in your word processor for instance. In addition, many PC and console games have required optimization in order to be able to display and implement the behavior of all of the enemies and objects in the game at a decent frame rate.



Most simple utility programs don't really require optimization for speed because they finish woring in a fraction of a second, but I still like to optimize them for efficiency.



There are various methods to get more speed. The first consideration for speed should be the design of your algorithm. For example, if you're using a slow sorting algorithm like bubble sort on a large, unsorted array, no amount of optimization is ever going to make it as fast as an unoptimized quick sort.



Then, we have a bevy of deviant little tricks to potentially increase speed, such as loop unrolling.



Code :


/* This C program demonstrates a loop */



#include<stdio.h>



int main(){

 int x;

 for(x=0;x<10;x++){

  printf("x=%dn",x);

 }

 return 0;

}







Code :


/* This C program demonstrates loop-unrolling */



#include<stdio.h>



int main(){

 int x;

 for(x=0;x<10;x+=2){

  printf("x=%dn",x);

  printf("x=%dn",x+1);

 }

 return 0;

}







Loop unrolling is one of my least favorite speed optimizations, because it makes the code bigger and could even make it slower if the loop is larger than the CPU cache.



In addition to optimizing for speed, you can also optimize for size. This is an attempt to reduce the size of the program or parts thereof. A smaller program is usually easier to distribute and store, and might load and run faster.



To optimize for size, you usually just want to reduce sequences of duplicated code by using functions or subroutines, and eliminate unused code, which are good practices anyway.



Some compilers, such as my favorite, MinGW (a minimalist port of GNU GCC), are great at optimizing by themselves without you having to change your code at all. You can simply use the command line option -O2 for speed or -Os for size. -O3 will optimize even more for speed, but usually increases program size. There are some other optimization options that might or might not help. You should definitely use strip.exe to strip out the unneeded crap, and you could use UPX to further reduce size, but UPX might make the zip-archived program larger. Optimizing slows down compiling, so you might want to only use optimization options for a release or a final product.



Optimization is not just for size and speed. You can manually optimize your code for many other factors, such as memory usage, ease of maintenance, or safety. When you optimize for one aspect, you might reduce the optimization of the other aspects. For example, some optimizations for speed make a program larger, and some optimizations for size make a program slower. However, some optimizations make code both smaller and faster.



I was recently reading about "Immunity Aware Programming," i.e. how to make software for embedded systems that is safer from glitches caused by EM noise, power fluctuations, and other unexpected events. This is important for software running in medical equipment, aircraft, spacecraft, satellites, weapons, and any other "important" system where failure is intolerable.



I wonder if there are any software optimizers for safety optimzations. I'll have to attempt a web search sometime. This could be my next project, but I'd have to code it really well to make sure it can't introduce bugs, otherwise the safety optimizations would obviously be pointless.



People have been killed by software bugs. There was a big radiation treatment device used in some hospitals in the 1980s called the Therac-25, and there was a wee bug in the software that caused it to emit lethal doses of radiation into the patient if the operator simply switched between the X-ray mode and the electron beam mode within 8 seconds. Oops!



Most software used today for such purposes is probably safer. There are supposedly regulations and guidelines, and no one wants to risk bad publicity or lawsuits, but the US FDA certainly lets some businesses get away with a lot, apparently letting them "regulate" themselves and kill people for profit.



Well holy balls, I guess I could just go ahead and make this the longest blog post in the Multiverse, but if the Large Hadron Collder is going to kill us all or whatever it is this week, I may as well forget about this crap I'm talking about and go do something really fun and/or perverted if it is at all possible. :)



LHC Sabotaged by Bird


A passing bird dropping a piece of bread has apparently sabotaged the Large Hadron Collider
. Maybe it really is creating some kind of Star Trek TNG-style spacetime anomaly, as I mentioned in a previous post. If the working collider destroyed its timelines, the only timelines that would remain are the ones wherein the collider failed due to random accidents, however unlikely they may seem. At least that's my interpretation of the theory.



Have you noticed how they say it will create conditions that haven't existed since shortly after the Big Bang, but when someone suggests this could have unforeseen risks, they say it's really just doing the same thing that's happening in the atmosphere a zillion times per second? So which is it? If the latter, might it not be easier to study the atmosphere or cosmic rays than to build a gigantic collider? I know a controlled lab environment has advantages over random events, but let's think outside the box.



For the record, my favorite page about the collider is this one.





Why Is the USA So Hated?
"We are not hated because we practice democracy, freedom, and human rights. We are hated because our government denies these things to people in third world countries whose resources are coveted by our multinational corporations. And that hatred we have sown has come back to haunt us in the form of terrorism..."



"We are the target of terrorists because we stand for dictatorship, bondage, and human exploitation in the world. We are the target of terrorists because we are hated. And we are hated because our government has done hateful things. In how many countries have we deposed popularly elected leaders and replaced them with puppet military dictators who were willing to sell out their own people to American multinational corporations?"



"We did it in Iran when we deposed Mossadegh because he wanted to nationalize the oil industry. We replaced him with the Shah, and trained, armed, and paid his hated Savak national guard, which enslaved and brutalized the people of Iran. All to protect the financial interests of our oil companies. Is it any wonder there are people in Iran who hate us?"



Dr. Robert M. Bowman, retired Lieutenant Colonel of the US Air Force.



For more information, see this site



Who Are the Real Terrorists?
Are the terrorists al-Qaeda, which supposedly struck at the U.S. government and global capitalism, or are the terrorists the U.S. government and global capitalism, which are apparently at war with all that is good?



Please examine this site if you are ignorant of how the USA really works. It's been the same dirty game since the land was stolen from the Native Americans.



Learn also about the terrorist training camp in Fort Benning, Georgia, in the USA. Are you aware of the atrocities committed by those who have attended it?



The Internet Is Boring
Just wanted to mention that the Internet is extremely boring, and I may not be able to tolerate it often in the future unless I start hacking everyone, so please be patient when seeking my attention.







Do you feel liberated?
I was reading this article about the "Spiral of Silence" and it made me wonder: Is the Internet really all that liberating? Between the censorship, regulation, monitoring, spam, and countless terms of service for all the sites I've visited, I'm not sure. In fact, one could argue that we are freer offline than online. When you watch television, you don't need to worry about the government busting down your door because of something you viewed, whether you viewed it intentionally or accidentally. When I look out my window, I don't need to enter a password, and there are no cookies tracking everything I look at. When a friend shares a song with me in person, we don't have to clear it with the RIAA, and when I'm offline, I don't have to enter into a legally binding agreement in order to simply chat with a friend.



There are things like TOR and Freenet that allow anonymity online. The nearest equivalent to using those things "in real life" would perhaps be sending snail mail from a public mailbox without a return address, which was never an extremely popular activity.



Do you feel liberated? If the Internet were so liberating, wouldn't the world be quite a different place by now? Could it be that some people, who probably spend too much time on the Internet, are simply clinging to a fantasy of it being liberating, and perhaps those who are making it less and less free would also want you to think it's freer than really it is?



Squish65 Now on Sourceforge
Squish65 v0.5 is now on Sourceforge.net (go to squish65.sourceforge.net). I had to get a SFTP client due to the fact that the SF web interface fails for both of the browsers in my computer.



I've been playing with Commodore emulators to make sure Squish will work with 650x systems besides Atari 2600 with its 6507.



I recently made a subroutine optimizer using genetic programming, but it is very slow for all but the shortest code sequences, which makes it virtually useless, so I probably won't even publish that anywhere.



I've also just started on a 6502 assembly interpreter like the old BASIC interpreters. It seems like a really cool idea to me right now.



The Quest for a Decent Text Editor
I normally use notepad for editing and reading text files on my old clunker, but it doesn't handle files over 32KB well, and there are a few annoying bugs. So I'm stuck with wordpad, which shows everything in a tiny, unreadable font and takes forever to scroll. That is unless I use edit.com, which races my cpu every time I press a key in addition to making clipboard operations a hassle. So I decide to search the web for a free notepad replacement.



I found a few, most of which I've tried before and didn't care much for. Most were buggy and had too many features. Many of the "notepad replacements" I've seen have tabs, syntax highlighting, etc., which are unnecessary and symptoms of severe bloating.



I finally found one that sounded like what I was looking for. I was a bit taken aback when the guy said on the site it was his first Delphi program after programming VB, but I decided to give it a try. Right away, I'm severely disturbed by the fact that it's around 600KB. OMGWTF. It's bigger than many editors that actually have features. I think it's pretty good for a first project in any language, but I want something well under 600,000 bytes in size for daily use, preferably crafted by an expert with many years of experience in his language.



So my quest for a decent notepad replacement on the information superhighway continues.



FBI Warnings
One reason I stopped watching Hollywood movies is that I don't have time for all the FBI warnings. It's my view that FBI warnings are not conducive to having a good time, and I'm certainly not going to pay for something that repeatedly forces me to look at them.



Why is it that all Hollywood films have long, repetitive warnings and threats, but nothing else does? When I start a car, I'm not forced to sit through lengthy threats about the legal implications of using it to commit a crime, nor do I receive any warning about the millions of people who have died in car wrecks.



And just imagine what the world would be like if computer programmers were as haughty as Hollywood producers: You'd have to look at an FBI threat for two minutes whenever you start your computer or any software! Come to think of it, I'm actually surprised Bill Gates hasn't done that! Yet even that guy gave us some pretty clouds to look at instead of FBI threats. Could Hollywood learn something from Bill Gates?



Could the Large Hadron Collider be sabotaging itself from the future?
Read here.



Didn't this happen in an episode of Star Trek?



Squish65
I've made an optimizer for 6507 assembly for use with batari Basic (bB) in making Atari 2600 games. I originally called it Squeeze, but changed it to Squish65 for version 0.5. Last time I checked, there didn't appear to be much interest in it on the bB forum, but I felt this was a useful program for bB and easily for other 650x assembly uses, and I thought of more and more optimizations to add. It still doesn't perform as well as I'd like for some code, but the latest version (0.5) is actually quite good except for code that uses bankswitching.



I tried for a while earlier today to get it hosted someplace like Sourceforge, but it was too problematic. If you're interested, the package can be found here.



Welcome
Congratulations, your blog is created !
To access the different options of your Blog, click on « Connection » : Connect yourself with the username : Admin and your password (the one you chose at the blog creation).
Once you're connected, a toolbar will be placed automatically at the top of the page, managing you to access the administration panel.

(This text is an example of an article, you can delete it as soon as you wish)






Home  
 



Link to us




RSS Feed of new blogs                                                   Home        Feed Map        Submit Feed      Link to Us       Contact