Showing posts with label Computer Science. Show all posts
Showing posts with label Computer Science. Show all posts

Sunday, August 10, 2008

Robo Bobo and the Complaint

Well, people, such as myself and Mathimoto, have been insanely busy of late. Yet, occasionally time and space conspire that posting might be made.

So let me share with you one of the reasons I've been with the busy-ness, the web and its various technologies. Now while this sounds like a simple matter, it's actually insanely complicated. But I can give you a preview:

Now the essence of the web is run on servers, most notably Apache. There are other servers with various specialties, like Jaxer's Javascript-specialized server, and Microsoft, in its fierce insistence not to be compatible with anything else has its own server, Microsoft Server. However, all of these servers in the end run on your standard compiled languages, such as Java, C++, C, or Microsoft's C# (I mean there are other possibilities like Delphi (a variant of Object-Oriented Pascal) or something along those lines, but why would you do such a thing?)).

However, not everyone actually has a server, due to expense, complexity of set-up (the #1 limiting factor on web serving in my mind), and so there are alternatives, such as serving by the domain name company that gave you the domain name, or using a web app service such as Google App Engine. The upside is usually this is less money (usually), the downside is usually this is more complex (usually), and your choice of technologies is often limited, for example Google App Engine relies on Python.

Taking a step up from the server, you got the pages. This is what comes back after a request by a user. There's a variety of technologies out there, which fall into a couple categories. Mainly, the big two are CGI, where a http request (ie, a page URL) runs a script, in theory written in anything, but usually written in a scripting language, like Javascript, VBScript, Actionscript, Perl, or Python, XML/HTML pages, with possibly embedded scripts (like the first three of the CGI languages, PHP (although that can also be run for CGI)) (in a variety of forms like ASP (Active Server Pages), ASP.Net (a variant with more Microsoft-specialty tech), JSP (Java Server Pages), or JSF (Java Server Faces)). There's also a variety of media that could come back with the page, but that's a bit more than I care to get into, although I should note that Media and such is often best caught up with Actionscript in a whole Adobe Flash mesh-up, but that tech is proprietary and may cost the money.

And once you get the pages, sometimes there's more stuff going on, like client-side scripting languages, such as Javascript and Actionscript, sometimes there's Flash Players and stuff playing the media or something, and more there's also Java applet tech, Java web start up, and the like.

I'm sure there's more and more with more combinations. I mean some people like throwing in Groovy and Common Lisp into there, because they're insane. But the web's a complicated place, with complicated people and no one understands him but his woman...

A summary of a brief overview of web tech:

Sever-program: Apache, Jaxer, Microsoft Server, etc.
Written-in: C, C++, Java, C#, etc.

Returned Page: HTML, XML, media, image, PDF, txt, etc.
Produced-by: Javascript, Actionscript, VBScript, PHP, Python, etc.

Client-side: Browser-processing, Client-side script, Media
Produced-by:
Browsers written in C, C++, Java, C#, etc., primarily with the Geko (Mozilla) engine, Internet Explorer engine, or Opera engine
Client-side scripts in Javascript, Actionscript, etc. (based on DOM events, DOM model, SAX events, ah, my mind hurts too many techs!)

And the web keeps on trucking.

Wednesday, July 23, 2008

Or do it the sensible way: Top 5 tips

Since the last post was all about the potential madness of computer cleaning, I thought I might give some saner tips, indeed, here are the top 5 (as ranked by Robo-Bobo) more safe tips for cleaning your computer, chosen for the cleaner who wants a lighter touch:

1. GET A SPYWARE SCANNER!

(And don't just download the one that comes in a pop-up ad, those usually have spyware attached to them, there a couple legitimate free ones (most famously Spybot Search and Destroy), although they tend to be less effective than the more expensive ones (although they are free), but whenever you download free software GO TO THE COMPANY OR FOUNDATION'S HOMEPAGE. Many times malware will be bundled with free-ware, but well-respected foundations and companies tend to avoid that (with some exceptions like some music companies (cough, cough, Sony BMG), it's best also to search the web for info about anything you download before you put it on your computer.)

I personally use Webroot's Spyware Sweeper

2. GET A VIRUS SCANNER!

(Same warnings as with the spyware scanner, although the truth is virus scanners often have limited effectiveness once the virus is on your computer (especially since the scanner is usually the first target of the virus). However, the best virus scanners also give you warnings about when you're about to download, open, install or transfer virus-infected items (one of the reasons I like my current sweeper).)

I personally use Eset's Nod32

3. USE THE SCANNERS!

The scanners sometimes have some automatic warnings even without being used, but not scanning is just a waste of good software! And also your computer will get infected, oh yeah, that too. Doesn't matter if you think your safe or you think you have good computer practices, spyware (and to a lesser extent viruses), happen (in fact, if your spyware sweeper is turning up nothing constantly, that probably means that the sweeper is infected).

4. Clear privacy info off your browsers.

Companies, even ones that pledge to do no evil (I have mixed feelings about Google, especially now that a friend works there (shout-out to Jean Hsu!) and especially since I use a lot of google tech which alternately impresses and frustrates me, but that's another session), will attempt to track your web-habits. This is a fact of life. Moreover, sometimes companies (a more rare happening, but sometimes, especially with some of the more unscrupulous background checkers for employment) will go a little further and try to actually connect your real-world identity to what you do on the web and what you have on your computer. It sucks, but that's how the internet is. So go to Tools or Options or whatever, and clear your privacy data, including (actually, although by default this usually isn't selected, it is the most vulnerable area) cookies.

5. Clear out your "temp" and "temporary internet files" folders.

Most of this ought to have been cleaned out by clearing privacy data, but it usually isn't. Finding these folders is a bit tricky for newbies (I've been assuming Windows throughout, especially since most spyware and viruses are designed for Windows, but this particular matter is Windows-specific. I'm a newbie at Linux, and while I'm capable in Mac OS (and actually have a certain preference for it), it has been a while since I've cracked into the nitty-gritty of how to clean Macs (beyond the previous steps)).

Essentially this is what you must do:

First, you need to enable viewing hidden folders:
1. Open "My Computer" from the "Start" menu
2. Go to "Tools" (in the top menu bar)
3. Click on "Folder Options"
4. Click on "View"
5. Find the "Hidden Folders" folder in the scroll bar, click on it to open it, if it isn't opened already.
6. Click on "Show hidden files and folders"
7. Click "Apply" in the bottom right corner
8. Close the the "Folder Options" menu, now you should be able to see all your folders and files

Second, you need to go to the user profiles:
1. Open the "Local Disk (C:)" folder (I'm assuming your still in the "My Computer" window, if not, get back to it)
2. Open "Documents and Settings"

Third, for each of the profile folders, you need to do the temp file cleaning, but here's the essential pattern:
1. Open the profile folder (ie, the folder with the name of one of the profiles on your computer)
2. Open "Local Settings" (you may notice that this folder is semi-faded, that's because usually it's hidden)
3. Open "Temp"
4. Delete all the files in that folder (though do not delete the folder itself, it is a natural part of your computer, however if you mess up and do delete it, the folder should regenerate naturally)

(note sometimes you might not be able to delete some of these temp files, usually it will say file is being used. You should then try closing some applications and trying again, or trying again on a different day, but sometimes there will be files you just can't delete. Sometimes that is just a harmless fact of how your applications work, but often it signals that there are processes that you didn't start in the background which might be problematic)

5. Go back to "Local Settings"
6. Open "Temporary Internet Files"
7. Delete everything in that folder (same warnings as with the "Temp" folder
8. Repeat for each of the profiles

Now deleting these temp files can sometimes free up a huge amount of disk space, but even if it doesn't it makes your computer more secure. However, the files will naturally regenerate with time, so continue to get rid of them.

6. Don't accumulate junk it the first place

I know this was supposed to be top 5 cleaning tips, but here's a bonus tip, practice safe internet! Avoid downloads from sites you don't know or which have suspicious reputations (cough, cough Download.com). Don't accumulate excess software (and if you do, remove some via your control panel's Add/Remove Programs). Do not open emails from people you don't know (even if it says charity this, or job offer that). Do not click on links to sites you don't know or if you're in a suspicious site to start with.

(actually avoid suspicious sites in general, that means you free porn sites (if you must have porn, go to a legitimate porn company with a respectable (relatively) reputation (and no I'm not going to list any of those companies)

(the less reputable ones also have the ugly habit of taking over your browser, if this happens, go to the task manager (Ctrl-Alt-Del) and click on the process that matches your browser (say firefox.exe) and end it (actually this might not in Internet Explorer (I don't usually use it so I haven't tried), since IE is hard-wired into the Windows Operating System (in a rather monopolistic move, which if not illegal, is at least supremely a douche-move)))

(this is where I feel Apple's Safari Browser, despite its easy-of-use and speed, falls short of the Firefox Browser, since Firefox allows you to see where a link leads by just leaving the mouse over the link, whereas Safari (at least, last time I checked it out, which to be truthful was sometime ago, so updates may have changed things), does not. Internet Explorer also has this feature, but IE is so bug-ridden, so security-problematic, so violating-of-all-sensible-web-standards (although IE is getting better in this respect), that I don't even consider it as an alternative in web browser choices. However, Opera Browser is always a reliable second in my book to Firefox, although it is a bit feature-heavy with some unfamiliar-quirks for my taste, but it is a nice browser indeed.)

Anywho, the basic law of preventing junk from cluttering up and undermining the security of your computer is... be cautious and use common sense. There are a lot of tricky and hidden ways to attack a computer, but most malware goes through the front door, so shut it. Or in less-metaphorical terms, if there's some action which seems like it would make your computer vulnerable, DON'T DO IT!

And if you do do it anyways, well, don't blame a certain robotic koala for not warning you.

Cleaning out with Robo-Bobo

Now a little advice from Robo-Bobo: cleaning and maintaining your computer is the route of all madness. So easily can you delete some essential file. So easily can you completely and utterly ruin your perfectly good machine. That said, I periodically like to clean out my machine of all suspicious files and processes to kill any potential viruses and spyware. Why? Because I can.

But I'll admit I do so with care. The biggest guideline for cleaning with care is whenever you have a file or process (if you don't know what I'm talking about what I say process, press Ctrl - Alt - Del to get your task manager up and running and click on the processes tab. Basically this will show you all the stuff, the good, the bad, the necessary, that is running on your computer) you don't recognize DO NOT IMMEDIATELY DELETE IT!!! Just because you don't recognize it doesn't mean it's not supposed to be there, especially since many software vendors, including old Billy Gates's Microsoft, set up new processes and files in new versions.

So how to handle the cleaning then?

Search the web.

The beauty of the internet is that it can harness all the previous frustrations of computer users around the world. You search the web with just the name of the file and process and you should be able to get someone, somewhere, who was also wondering what that item was, and who probably posted that question on an internet forum or asked an expert or something like that, and then got an answer. (although there are some processes and items that still end up being mysterious)

But sometimes it's nice to avoid slogging through tons of forum results, and luckily there are a number of organized process and file identification databases, which usually have readable and search-friendly reports. My favorite is The Process Library, which gets high marks for presentation and understandability, however I'll admit it's not the most extensive of the databases out there. I've found Neuber Software has perhaps a broader selection of information, however, you're best off going directly to its Window Processes Index, since navigating between its product-centric main-pages is a bit unwieldy.

But sometimes you're going to have to search.

And sometimes you're going to have to call Dell, or HP, or some other company that you notice comes up a lot in the unanswered questions about a process or item and demand they explain what this process does (and be forewarned they will resist telling you and likely will try to get you to purchase their expensive customer-care packages).

But as I said before, cleaning a computer is the way of all madness, doing it with care does not change that fact.

Yet, fear of viruses, malware, spyware, and other unpleasantries, combined with an almost compulsive cheapness, compels some, like a certain robotic koala bear you know, to press onward nonetheless. And to those brave and foolhardy individuals, I have but two words:

Good Hunting.

Monday, July 7, 2008

Welcome now to the Robo-Bobo report

As said before, due to Mathimoto's insane busy-ness. I'm adding my two cents to things around here.

And as a robotic-kola bear, it's about time for me to get some talking time. Of course I'll make sure not to overstep on Mathimoto's property, but Robo-Bobo's in the house now and he's about to add a little razz-ma-tazz.

But first of all, as things go, since this is Mathimoto's Complaint, I'd like to add my own complaint.

How come we're using XML for everything nowadays. Now I'm not saying XML isn't great, I actually like it a lot. I'm not so crazy about XSL, but I think ideally you could use XSLT to turn XML to HTML and then pop in some CSS to cap things off (now XSL and XSLT might do things alone, but for real formatting you'd have to throw in XFO or whatever and that's just annoying and Robo-Bobo don't do annoying).

XML's a beautiful concept for data-display and manipulation, basically you mark-up everything with the category or purpose it has, and then you use different transformation and formatting technologies to set things up into a full display, but since the transformation and formatting are separate from the data you can write data down and then decide all that, or you can take data and use several different ways to display things.

However, at the core of it all, XML's a data mark-up language and all the technologies associated with it are data display tech.s. Even if you throw in scripting languages like PHP or Javascript you still have essentially a matter of data display, and currently that's all the web is set up for.

The data display could be dynamic or static, but data display is what the internet was designed for.

And that's not enough.

Because already we have word-processors, games, and all sorts of applications that are used on the web. However, since things are used to data-displays, all the applications must be bastardized into dynamic data collection and display sets. Now overall, GUI's can be pigeon-holed into data-displays (in fact, GUI's are essentially data-collection and displays, and especially if you added a few more features, basically all GUI's come easily be easily created through a XML/XSL/XSLT/HTML/CSS-like technology), but applications? Applications in the most abstract sense can be said to be data collection and display, but to really do things like that is really, really, really asinine.

It's time to say no more! I will not make applications in XML!

But of course I will, because honestly, I'm a bit of a moderate with internet-tech (despite my robotic kola-ness), and I have not the yet the skill or prestige to revolutionize the internet world by myself.

But I shouldn't have to!

Applications should be written in an application-manner, and they should exchange data in an application way. Java Server Pages and such are a little better since there we're actually using application tech, and XUL is a step in the right direction, but it is not enough!

There must be a revolution!

We must!

We must!

We must revolutionize the internet by making it application-friendly!

To me, nerds of Silicon-valley!

To me, Indian sweat-shop engineers!

To me, other people who do other stuff!

Come, let's change the internet, under the grand banner of...

ROBO-BOBO!!!

And so on...

Thursday, July 3, 2008

lots of change = good, net-wise at least

So good old Mathimoto has been going through some changes, and with these changes has come much busy-ness, but do not fret! The math continues, and indeed will improve...

For example, soon this blog will utilize the very useful technology of math markup languages. Which exactly, I'm not sure at the moment, but it will be done! And then you'll have nice little graphics here with all the equations and such.

But perhaps most dramatically, joining the crew will be segments by Mathimoto's good friend, a robot-man whose name escapes me at the moment (if he was a kill-bot I would be much scared by this development but fortunately he is not).

Now this blog was initially envisioned as a math blog above and beyond CS, but this is also a blog on the internet so it is natural that CS developments be of some concern. Yet do not fear, the math will not be enveloped, and to protect the math, Mathimoto's posts and his robot friend's will be kept separate. The math will go on!

Because Math rules!

Sunday, February 24, 2008

That's what I get for all that Scheming

So I know that I have sang the praises of Scheme in several posts now, but let me get to some of the downsides:

First of all, it's insane. No control structures. No local variables. THE MADNESS!!!

But more importantly for me, because it uses exact numbers (ie fractions), the numbers can quickly become to large for the interpreter to handle within reasonable amounts of time. In many cases having exact numbers is ideal for math, but when your using mathematical estimates based on numerical analysis that is iterated many, many times, well, things get ugly.

So I'm putting out this question: Does anyone know of a way to turn off exact numbers in Scheme. I realize that you can just use the function (inexact->exact num), but that only turns it off for one instance, what I'm looking for is a more general purpose off switch.

Because of this difficulty, for some of the more advanced numerical methods I'm handling I'm switching to OpenOffice Spreadsheet. It's not a perfect system, but if properly used the spreadsheet can be a mighty powerful tool of data manipulation.

And I shall also see if I can design functions that get around the inexact/exact difficulty even if it is with the inexact->exact function, because I dream, I dream of the day when once more I can Scheme.

Wednesday, February 13, 2008

Time keeps on Schemin'

So one thing I'm a little bit worried about with this blog is the temptation to turn it into a semi-computer science blog. I want to keep things well rooted in math here, because math is awesome. I mean computer science is cool and all, but math is awesome, and also I think there are more computer science blogs out there than math blogs.

Still, I'm dealing with a lot of numerical analysis stuff now, the line between math and computer science is a little bit blurry. Still, because this blog is mine, I'll walk that line.

And so in the interest of math, I will now reveal to you some really cool Scheme code (just to refresh your memories, I'm using Dr. Scheme, a free Scheme interpreter, and I've been consulting The Scheme Programming Language by R. Kent Dybvig for reference) I wrote to deal with numerical analysis problems. Many people have said that Scheme should not be used for numerical analysis hw, and they are right, but that's why it's ultra-cool when you get it right.

So here's some functions:

General method applier for numerical methods requiring iteration (for generating a list of the value at several different iterations, largely for hw purposes but also so you can look at how it is converging).

(define (applymthd method fun initx tol)
(
map (lambda (iter) (method fun initx tol iter)) '(1 5 10 20 50 100 1000)
)
)

So this obviously is a pretty rough function, but I can tweak it into shape and if I do, I'll pass it along.

Here's a cheeky little function for forward distance:

(define (fordist fun n)
(
(- (fun (+ n 1)) (fun n))
)
)

Here's a less cheeky function for Aiken's terms given a function:

(define (Aitkens fun n)

(- (fun n) (/ (expt (- (fun (+ n 1)) (fun n)) 2) (+ (fun (+ n 2)) (* -2 (fun (+ n 1))) (fun n))))

)

But moving on to more sizable methods, here's an implementation of Steffensen's method:

(define (Steffensens fun initx tol iter)
(if (< iter 1)
initx
(
if

(< (abs (/ (expt (- (fun initx) initx) 2) (+ (fun (fun initx)) (* -2 (fun initx)) initx))) tol)

(- initx (/ (expt (- (fun initx) initx) 2) (+ (fun (fun initx)) (* -2 (fun initx)) initx)))

(Steffensens fun
(- initx (/ (expt (- (fun initx) initx) 2) (+ (fun (fun initx)) (* -2 (fun initx)) initx)))
tol (- iter 1))
)
)
)

More stuff: An implementation of Fixed Point Iteration:

(define (fixedpnt fun initx tol iter)
(if (< iter 1)
initx
(if (< (abs (- (fun initx) initx)) tol)
(fun initx)
(fixedpnt fun (fun initx) tol (- iter 1))
)
)
)

So that's that for now. And I'd say that's a good chunk of stuff, so that's some Scheme, but really, it's all about how to deal with numerical analysis in a quick and painless fashion made slightly more insane by using Scheme instead of any number of more saner tools.