Posted tagged ‘python’

Python to get a speed boost by Google

March 27, 2009

If this is true this is awesome news by Google. Python is a scripting language, and as such usually has poorer performance on intensive programming projects. For me, though, I like Python because of its ease of use and flexibility. Google obviously uses Python extensively and effectively. If this new interpreter can really bring about a 5x speed boost than I say it is a win win. It also looks like this new interpreter will help utilize multi-processor and thread hardware.

From the article:

The goal of the Unladen Swallow project is to use LLVM, the Low Level Virtual Machine compiler infrastructure, to build a just-in-time (JIT) compilation engine that can replace Python’s own specialized virtual machine. This approach offers a number of significant advantages. As the developers describe in the project plan, the project will make it possible to transition Python to a register-based virtual machine and will pave the way for future optimizations.

Good luck Google. May you bring it to pass.

O’Reilly’s state of the book market programming languages

February 25, 2009

O’Reilly is releasing their numbers on the book market via programming languages. It is pretty interesting to see where growth was and what languages are more popular than others. For instance they saw the most growth in Python, and saw a pretty significant drop in Ruby and C++, while C# is the most purchased programming language book.

Of course O’Reilly isn’t the end all be all of computer book sales (as in there are other players who may have totally different results) and this is totally just by number units sold, but it is interesting to see what the numbers casually tell you.

Open Source ‘LoggedOn2’ finds usernames for a domain PC

January 26, 2009

As the person essentially in charge of desktop support for a field office of about 100 users, I occasionally receive a phone call from a corporate network administrator who wants to know who’s using all the bandwidth, or who is downloading viruses, or the like.  Usually, they give me a NetBIOS name, and I take care of checking the user’s internet history and talking with them about their particular issue. 

More frequently that that, I have to track down a user who is using a particular resource.  For instance, this morning all of our available admin licenses for Alchemy (a document database) were in use, some by people who were idle for over an hour, and the person who really needed the license couldn’t get it.  But Alchemy only gives you IP addresses, not computer names or user IDs.  So I can use nbtstat to find the computer name from the IP address, but that’s still cumbersome.  In the past, I have had to make a spreadsheet (and keep it up to date) of which user has which computer.  It’s a good thing to have anyway, but I don’t need it for this process anymore.

Enter LoggedOn2.  It’s a simple (and incredibly fast) Delphi program that will grab the logged on user on any given box, either via NetBIOS name or IP address.  I tried a couple other alternatives, but this one was fastest and free.  The others either didn’t work (as in a VBScript someone posted), were too slow (one was trying to scan the whole domain for computers), or were shareware.  I don’t mind buying the shareware (and getting a 1.7 billion dollar company to drop 50 bucks for software isn’t hard) but this one works too well.  No installation needed, either. 

It is open source, so I did have a look at the source code.  I don’t write any Delphi, but I have enough knowledge to try to guess what it’s doing.  It looks like it checks the registry of the PC (under the HKEY_CURRENT_USER hive) for the domain ID of the user.  You do need administrative privileges on the remote machine (which you should have, if you’re an administrator).  It’s fast, simple, effective, and free.  Here’s a few screenshots:

main

 The main screen.  Click Scan Machine to continue…

 

main2

 

 

 

 

 

 

 

 

Input the PC name or IP address, or select a computer from the list of domain PCs (which I conveniently blotted out)

 

main32

 Output is the domain\username for the computer you entered (just like this screen, except instead of saying “domain\username” it would say “YourCompany\t_collins” or somethinglike that).  You can also click “Scan Domain” (if you have a small domain) and get the logged on user for every box.  This would make asset tracking especially easy as you could develop a list easily. 

Other features that would be great would be a comma-delimited or Excel report of all domain PCs and logged on users.  Especially great would be the ability to search by IP range so that I can grab only a few VLANs from our rather incredibly large domain.  At some point I would like to port this to Python, just for fun and to help my understanding of Python programming.

One minor annoyance (it’s a help too, but it’s annoying) is that the program is (in Windows terminology) “always on top.”  This is nice because I might be logged on to a server via RDP and need to grab an IP address from the server while switching back and forth between LoggedIn2 and the RDP session.  On the other hand, you have to minimize the window to get your screen back (it conveniently minimizes to the system tray).

This program is a great example of what old-school “hacking” was.  Make your own tool and use it to access the information you need.  Ah, makes me feel all nostalgic.

You can download LoggedOn2 here.  Does anyone have a similar program for Mac or *nix?

A first programming language?

October 14, 2008

I’m well aware that this post could start a flame war (if any programmers actually read it).  But I haven’t written in ages because of my attention being divided between writing, work, and school.  I did some writing for The Daily Yonder, and Julie Ardery was terrific to work with and is an awesome editor.  If you’re interested in that, see my post regarding rural broadband from a few months ago or go to the Daily Yonder site and read the article.

So, I have recently come to the realization that, though my degree is in IT with an emphasis in software development, I really am not learning what I need to about computer science.  So I’ve decided to educate myself more fully.  I am almost finished going through John Zelle’s very excellent Python Programming: An Introduction to Computer ScienceI have also begun reading Programming in C by Stephen Kochan.  But my real first language was JavaScript.  It was the language for my first introductory programming class.

I won’t even  discuss the merits first languages – ask Joel Spolsky if you want someone’s opinion about it.  I would, however, say that Javascript prepared me for Python, and Python prepared me for C (as far as I can tell – I’m not that far into C).  There isn’t a divinely ordained order.  But I’m curious if some readers might offer their insight into which language they started with.