Jump to content

Wikipedia:Reference desk/Archives/Computing/2009 September 20

From Wikipedia, the free encyclopedia
Computing desk
< September 19 << Aug | September | Oct >> September 21 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


September 20

[edit]

Visual basic express edition coundown program

[edit]

My friend is making a countdown for me in visual basic, so how would he make the countdown work when the computer is off?Accdude92 (talk) (sign) 01:43, 20 September 2009 (UTC)[reply]

And btw, I would like the countdown to NOT use the internet in any way.Accdude92 (talk) (sign) 01:48, 20 September 2009 (UTC)[reply]
You'll have to check the system time, save the end time to a file, and have the program check the file against the system time on startup. NeonMerlin[1] 02:18, 20 September 2009 (UTC)[reply]
But he dosn't don't know how to compare that to the text and update it.Accdude92 (talk) (sign) 02:25, 20 September 2009 (UTC)[reply]
It sounds like you friend needs a VB crash course! He'll have to read KB304427, which deals with read and write operations (plus some others). Xenon54 / talk / 02:33, 20 September 2009 (UTC)[reply]

Problem with external hard drive

[edit]

I have a Hitachi Easy Drive that I've been using with my MacBook. Now I want to use it with a PC (running Windows XP) to transfer some files, but when I plug it in and turn it on, it doesn't appear anywhere. There's a little icon on the task bar to safely remove the external hardware, but it doesn't show up as an available drive. I've tried using the "add hardware" button in the Control Panel, but when I try to add the external hard drive, it says, "Windows cannot use this hardware device because it has been prepared for "safe removal", but it has not been removed from the computer. (Code 47) To fix this problem, unplug this device from your computer and then plug it in again." I do so, and no luck. What do I need to do? --68.239.11.74 (talk) 02:16, 20 September 2009 (UTC)[reply]

It's plausible that the hard drive is formatted as HFS Plus, which cannot be natively read by Windows. The linked article contains links to software that enables Windows to read those hard drives. Xenon54 / talk / 02:40, 20 September 2009 (UTC)[reply]

Interet keeps crashing...

[edit]

Why does my wireless internet keep crashing?Accdude92 (talk) (sign) 03:26, 20 September 2009 (UTC)[reply]

If you want a serious answer, you must provide a lot more information. What kind of wireless? What kind of computer? What operating system? What do you mean by "crashing"? If you just want people to poke fun at your inability to provide even the slightest hint of information required to answer your question, then leave it be for a few hours and the jokesters will be here shortly. -- kainaw 03:39, 20 September 2009 (UTC)[reply]
What kind of wireless?
WiFi, I have a router, and a usb stick to get the signal
What kind of computer?
Compaq Presairo SR1150NX
What operating system?
Windows XP home edition
What do you mean by "crashing"?
It just randomly disconnects. Like I am typing on here and it randomly stops sending me data. Oddly, the icon says its still connected...

Accdude92 (talk) (sign) 03:46, 20 September 2009 (UTC)[reply]

Sounds like a problem I had with one of my computers...but that was under Ubuntu. I fixed it by taking out the stick and then plugging it back in, and then restarting the computer if that didn't work. (That was 2 years ago. It's much more stable now.) But, as Kainaw said, you really need to work on providing more information - we're not mindreaders. If you want this problem to really be fixed, you still need to tell us the manufacturer and model number of your stick. Also, go into Device Manager (Start -> Run -> devmgmt.msc) and check and see if the device is listed, and then see if it lists any errors. Errors are indicated by a small ! in a yellow circle on top of the device's icon. Posting at least the OS and specifics about the problem is a must for any question (and with the amount of similarly-worded questions you post on here, I'm surprised you haven't learned that yet). Xenon54 / talk / 12:03, 20 September 2009 (UTC)[reply]
I have a similar problem. Sometimes it is caused by the attenuation of WiFi signal passing through thick stone walls, sometimes it is the wireless transmitter of my router that is having a hiccup, and (just occasionally) the problem is at my laptop. You can try pinging your router to see if it is still responding. (I have the additional problem of an internet connection delivered by microwave, and often the problem is there). Dbfirs 03:33, 21 September 2009 (UTC)[reply]
Perhaps your PC's power management keep turning off the USB when the network goes quiet for a while? Astronaut (talk) 10:55, 21 September 2009 (UTC)[reply]

Java hacking book?

[edit]

Anyone got a favorite book about how to hack Java code? I.e. not a book about the Java language itself (I've programmed enough other languages that Java is pretty straightforward), but about how to use the surrounding infrastructure, libraries, tools, etc. My immediate task is to add some features to a big existing Java program, and in order to do that I want to run it under a debugger (Netbeans or Eclipse) to see what it's doing. And in order to do that (per the Netbeans docs) I have to modify the Ant build.xml to include a debugging flag for javac, so I'm off to look at the Ant docs for how to do that, and then I have to get all the code (currently spread across dozens of directories and several library jars that I also want to debug through) loaded into Netbeans, etc. You get the idea, there's just this ton of stuff to get on top of before reaching the equivalent of "hello world".

Is there a short cut through all this? Is there a particular book or url that I should look at? Thanks. 70.90.174.101 (talk) 07:19, 20 September 2009 (UTC)[reply]

Java class files can usually be easily decompiled. Decompilers include JAD, JODE, JReversePro, Java Decompiler, Mocha, Jdec, just to name a few. --Spoon! (talk) 07:41, 20 September 2009 (UTC)[reply]
Thanks, I'm not trying to reverse engineer the program. I have all the source code or can download it. I'm just trying to run it under a debugger so I can step through it and understand better what it does so I can modify it. It's a fairly standard problem of getting a bunch of unfamiliar tools to work together causing a lot of farting around even though the high-level task is straightforward. 70.90.174.101 (talk) 07:53, 20 September 2009 (UTC)[reply]
Not sure what the problem is? If you can load the source code into the IDE you should be able to debug - step in/over etc.
Was there a particular bit that was a problem. Isn't the source provided as a single package, or in a single directory?83.100.251.196 (talk) 10:23, 20 September 2009 (UTC)[reply]
The source is a bunch of different packages including some downloaded libraries. There are maybe 1000 or so classes. I haven't been able so far to load the source into either Netbeans or Eclipse (requires adjusting the build scripts to compile with debugging info, figuring out how to tell the debugger where to find the dozens of directories of sources, getting versions of the debuggers that don't hang or crash with specific JVM's, etc.) It's one of those situations like when you want to click something to print a document, and you end up spending days screwing around with printer drivers, installing fonts, etc. There seems to just be a lot of java infrastructure that java developers have to get used to, in addition to learning the actual language. That's what I'm asking for advice about 70.90.174.101 (talk) 17:37, 20 September 2009 (UTC)[reply]
I assume you are new to both IDEs then? There are introductory tutorials for them eg http://java.sun.com/developer/onlineTraining/tools/netbeans_part1/ , and probably something similar for eclipse if you look. I'm not sure if there is an quick way to get started - I think you would at least need to read some of the tutorial first. As a first guess to get started quickly - have you tried creating a new project, downloading all the files, and dumping them into the project folder? (and finding the 'refresh project button')
Also, do you need previous build version info? or just the current build? If the second you just need the source code text files I think (might be missing something) - once inside a project you should be able to select the project, press build, and then be able to debug. Apologies if I'm oversimplifying the process - I don't know just how complex this project is.83.100.251.196 (talk) 18:26, 20 September 2009 (UTC)[reply]
(unindent) Thanks, yes, I'm pretty new to both IDE's, and also to the general culture of Java development. In C development I'd get debugging info from the compiler by putting "CFLAGS=-g" into the makefile, and I'd have a few directories where all the source code was and I'd point gdb at those directories. So I'm trying to figure out how to do the equivalent in Java, which uses build.xml (for Apache Ant) instead of a makefile. The source files are scattered across several dozen directories that are separated from the jar files where the class files are. It would be great if I could just tell Netbeans to recursively crawl a directory structure and find all the java files but that doesn't seem possible. There doesn't seem to be a way to build the whole program completely from source with one command, rather than building a bunch of jar's with separate scripts. I don't care about previous build version info, at least for now. I just want to run the program under debugging, so I can see how a few specific inputs get treated as they make their way through the program. I see the netbeans tutorial mentions a compilation classpath so I guess I should figure out how to set that up. Maybe I'm just being lazy and the classpath really does have to have dozens (maybe even 100's) of nested directories. Is that reasonably normal when using Netbeans? This program is nowhere near as big as, say, the Linux kernel, but its source tree seems almost as complicated. 70.90.174.101 (talk) 21:15, 20 September 2009 (UTC)[reply]

Add a new application

[edit]

How can i add a new application in orkuts application dictionary?

What exactly does the BoE use Mumps for? And similarly, why do other financial organisations use MUMPS in preferance to more modern languages? 84.13.198.33 (talk) 10:47, 20 September 2009 (UTC)[reply]

I don't know the former, but as for the latter: here is an article about COBOL, and why aging infrastructures use it. (Looks to be similar as the MUMPS example.) The short answer is that to revise their systems at this point would be a massive investment—these systems are decades old and have millions of lines of code and if they seem to be working, nobody wants to dare touch them, for risk of screwing up massively important businesses, health facilities, governments, etc. Working on projects of that size and magnitude is difficult and expensive—it's easier and cheaper for them to just keep patching it up as time goes by than to risk screwing it up majorly in an overhaul. --98.217.14.211 (talk) 14:14, 20 September 2009 (UTC)[reply]
MUMPS combined the database with the programming language. It isn't like writing a program in C++ and using an Oracle database. The variables in the program are the data in the database. Therefore, it was seen as a huge leap forward in data-driven computer programming. Unfortunately, it turned out to be a huge mistake in most areas. Where it has worked, it works well. If you want to be cynical, you can claim that it also has built-in programmer retention. Once you become a MUMPS programmer, you have no ability to go elsewhere. So, you are stuck in your job. -- kainaw 01:00, 21 September 2009 (UTC)[reply]
Doesn't it go in the reverse too though. Their can't be that many MUMPS programmers so they must be hard to replace Nil Einne (talk) 15:15, 24 September 2009 (UTC)[reply]
Most Mumps programmers that I know were hired out of high school and trained on the job. So, they have a double-hit on job transferrability. They have no college education and they only know Mumps. -- kainaw 03:15, 25 September 2009 (UTC)[reply]
Does that mean they're easy to replace (since they only need to be high school educated)? Their training and experience must be worth something though (to the small number who need MUMPS programmers) I can't imagine any bank would be willing to have say 3/4 of their programmers be people fresh out of high school. Nil Einne (talk) 17:06, 27 September 2009 (UTC)[reply]

Very easy to learn english-like and other computer languages

[edit]

I'm thinking of things like COBOL, MUMPS, SQL, and so on. I can program in BASIC, and years ago I used Logo as well. I'm interested in doing things like writing a simulation of a growing property (UK-eng) or real-estate (US-eng) rental portfolio, and downloading information from databases off the internet, and so on. What very easy to learn languages would people recommend learning? Because I do not do much programming, it is not worth spending the time learning a more difficult language. Thanks 84.13.198.33 (talk) 10:56, 20 September 2009 (UTC)[reply]

If you go to read COBOL or SQL you'll find they really aren't easier. So if english-likeness is not an requirement I would recommend python or perl. --194.197.235.240 (talk) 11:18, 20 September 2009 (UTC)[reply]
Yeah, COBOL and SQL are actually NOT easy. You'd be better off just taking the plunge and learning a more flexible language. 90% of a language is just understanding the syntax—the grammar, as it is. Once you do that, many are quite straightforward. A scripting language (like python, perl, PHP, etc.) is going to be probably what you want. --98.217.14.211 (talk) 13:59, 20 September 2009 (UTC)[reply]
With long function and variable names, an object-oriented language like Java or C++ can sound almost like a pidgin English. Most of the control-flow is direct use of the English equivalent, e.g. "if", "else", "try", "catch", "finally", "do", "while", ... etc. Nimur (talk) 15:36, 20 September 2009 (UTC)[reply]
For a project like the one you describe some variant of SQL is unavoidable. You will work on a large enough data set that some database manager is needed, and those "talk" in SQL. Most of the difficulty in learning to program is the proper mindset, not really the language you use. I speak Norwegian natively, but find that trying to use the norwegian translation of Excel is a pain. Whenever I need a function I must first figure out what it should be called in English, then have to guess how the translator have translated this into Norwegian. So having a programing language with an easy to understand structure is more important than having one that mimics english closely. Taemyr (talk) 07:41, 21 September 2009 (UTC)[reply]

I love COBOL! I've used Visual Basic.NET, ActionScript, JavaScript, C++, Assembly, HTML, CSS, COBOL, and PostScript. COBOL is my favorite of them all. COBOL is the most proper language grammatically. I'm an English-grammar Nazi, so I appreciate being able to hyphenate my variable names (e.g., TOTAL-COST vs. totalCost). Programming in other languages teaches you bad grammar. Larry Wall, a supposed linguist, should have known better when he invented Perl. Here's another example: Statements end in a period in COBOL -- not a semi-colon. AppleScript and Lingo are other languages that closely-resemble English, but they have very few applications. I also like that you can put line numbers into your code. I write programs in Notepad, so that helps. It's also self documenting. You need very few comments in COBOL, as the code speaks for itself. Further, the programs are well organized, with clearly-labeled sections for your variables (which go at the top of the program -- which is good form), your name, etc. You can use Eclipse for writing COBOL, if you like. You can also use OpenCobol, which works nicely with Visual Studio to compile COBOL into machine code. NetCOBOL is probably the easiest COBOL development tool, as it allows you to create forms inside Visual Studio in COBOL. But it isn't free.

I also like Visual Basic.NET (or VB.NET for short). It's a little more similar to English than languages like Perl, C++, and Java, but not as similar to English as COBOL. VB.NET is also easier to learn and it works very well with databases (using ASP.NET). Visual Studio also makes developing with VB.NET very easy. There's also Pascal, which is beginner friendly. The most popular version of Pascal is called Delphi and has a nice development environment made by Borland.--Drknkn (talk) 08:12, 21 September 2009 (UTC)[reply]


Which version of Lingo (programming language) do you mean please? Is it possible to get AppleScript or something like it to run in Windows Xp or Linux please?

I thought in the past that very high level languages were being developed that would make programming fast and easy - do any of these languages actually exist?

Can the R (programming language) do anything useful apart from statistics, as I've decided to put the effort in and learn that?

I see that the usual "Hallo World!" code is missing from the Python (programming language) pages as far as I can see - out of curiosity, how would you write it? 78.144.198.168 (talk) 15:10, 21 September 2009 (UTC)[reply]

It is, quite literally, print "hello world" -- Finlay McWalterTalk 15:40, 21 September 2009 (UTC)[reply]
R can be used for other tasks, but would be a poor choice. It's designed for doing statistics, processing large data sets, and plotting pretty graphs. It comes with a Tcl/Tk library, but then, to do anything gui-like and useful/interactive, you'll have to learn yet another language. I've read that it's possible to use R as a dll directly from C/C++, and have thought about trying it out (for incorporating some graphics output in an application), have but never gotten around to it. It both cases, you'd have to learn a second language. --NorwegianBlue talk 21:27, 21 September 2009 (UTC)[reply]
Lingo is used by Adobe Director, which can export executables (or "projectors" as Director calls them). Many people don't realize how many programs they use are actually Director projectors. I don't know much about the different versions of Lingo or about AppleScript, though.
The first generation of computer language is binary. The second is assembly. The third are procedural languages such as C, Pascal, and so on. The fourth includes SQL. A fifth generation was never necessary. GUIs came into being that are now used to create programs for us. For example, if you type an RTF document in Word Pad, you don't need to know RTF. The RTF is generated automatically by Word Pad. But I think that computers will soon understand human language with little difficulty. You might call a language like English a "fifth-generation" language. The biggest obstacle -- surprisingly -- is computing power. Our brains are far more powerful than the most advanced computers today. Microsoft is working on an interpreter for human language, but right now it only runs on a super-computer with two quad-core CPUs. But, given Moore's law, I suppose it will be only a few more years before it will be available to the public.--Drknkn (talk) 22:22, 22 September 2009 (UTC)[reply]
Once a program that understands human languages is made and it's put the parse the internet, interesting stuff will happen. --194.197.235.240 (talk) 00:26, 23 September 2009 (UTC)[reply]

Programming Lanuage Selection

[edit]
Resolved

I know php/html and do simple CLI programming with it, but lately need something that will allow me to do GUI exe's. I have considered php compilers (such as bamcompile) but they either don't do GUI (php-gtk) or support php5. I think C will be too low-level for me. Microsoft Visual Studio Express seems promising, but I'm not sure what to choose. Thank you for your suggestions. Waqqasd (talk) 14:39, 20 September 2009 (UTC)[reply]

Visual Studio Express is a great programming environment, IMHO. You will obviously need to learn C# or Visual Basic .Net, and the ins and outs of programming .Net, but there's a lot of books and material on the web that will help. --Phil Holmes (talk) 17:32, 20 September 2009 (UTC)[reply]
A friend of mine found Qt] a good way to jump from CLI to GUI programming as a Perl programmer; there are apparently PHP bindings for that as well. If it were me, I'd probably look into that first. VB.NET is a whole other kettle of fish, and not very fun or intuitive for the most part. (VB itself was more straightforward, for all of its problems.) --98.217.14.211 (talk) 19:06, 20 September 2009 (UTC)[reply]
I'm going with C#. [2] gave me a good syntax comparison, C# is much more like php, and has a compact syntax. Thank you, Phil and 98.217... .

Using the speed of USB 2.0 to record several audio tracks separately

[edit]

I was inspired by the alesis multimix 16, as it can record 16 audio tracks separately. A few problems though - I already have a decent mixer, and the alesis one is super-expensive. I would like to build a device which takes 16 mono inputs and records them separately through a USB port. I have never used USB or computer interfaces in my electronics and need some help. Problems i foresee are:

figuring out how to make the computer know that the device has 16 audio ins

making a timing device to send samples from each of the 16 ins one at a time i.e. send the first sample of all 16 ins in order, then the seconds, then the thirds and so on... so that the computer can determine which of the 16 ins it is reading by what time it was sent at

Are there any other problems that I will encounter? Anything i've missed?

Any help is appreciated! 89.241.28.24 (talk) 18:23, 20 September 2009 (UTC)[reply]

Computers can have multiple sound adapters right now - be they soundcards inside the case (connected to the PCI bus) or outside (on USB cables). So what you'd typically do is just add a bunch of these to a given machine; if the driver software is half decent then all these will appear in the OS as audio input devices, and you need only configure your audio recording software to match track1 to adapterA, track2 to adapterB, etc. If you didn't need studio quality audio (just half decent) you could do that today with off the shelf soundcards/usb-boxes. Now I guess you do want studio quality. I don't know if genuine studio-quality soundcards/usb-boxes are available; if they aren't, or if you really want to build them yourself, you'd typically take the reference design supplied by the audio-chip manufacturer and use higher-quality analog-side components. Actually building high-quality USB audio components like this is a serious project (a business, really), as you'd need a good analog/signal electronics person, a half-decent digital-design person, and (if you can't rely on the audio drivers supplied by the chip company) a windows (mac, linux, whatever) device-driver software person. -- Finlay McWalterTalk 18:54, 20 September 2009 (UTC)[reply]
If you're designing and building the hardware yourself - I would add in a "USB engineer" to the mix of required skills, which is an elite specialist who understands the USB protocol details very well. For stability and performance, you may need a full-time engineering or programming professional just for that aspect of the system. The Specification is hardly a user-friendly document. Nimur (talk) 20:36, 20 September 2009 (UTC)[reply]


Okay, thanks, it does seem like building a multi-input USB interface might be out of my depth - but you mentioned adding several USB interfaces and "linking" them together somehow. I have 4 USB inputs, could I (in theory) attach 4 2-input USB devices and in my computer (somehow) treat them as one device? I know macs can do this, but I am running Vista. The recording software i'm using is audacity, which will only accept one input device, but upto 16 tracks from that input. As audacity is open-source, would it be easier to write some code for audacity to read from several sources? Or would that be even harder than my USB idea?

Thanks in advance

There really isn't a meaningful way to "unify" several disparate USB audio devices and make them appear as channels on one device (hmm, maybe you could wire things with Pulseaudio, I don't know). It's disappointing that Audacity won't allow you to simultaneously record from multiple audio devices, and some Google searching shows others want to do the same as you (even to record from two USB microphones simultaneously). I'd certainly be possible to rearchitect Audacity to this, but I think it'd be quite a piece of work. Still, if it was done then that would benefit lots of other people too. See this forum discussion. If you're up for this, I'd approach the Audacity team on that forum. -- Finlay McWalterTalk 12:29, 21 September 2009 (UTC)[reply]

Is my University using a NAT network

[edit]

My reasons for believing that is IS are:

  1. The University is a large organization.
  2. I cannot access (or even ping) university machines from outside of the network (unless I'm using VPN).

and my reasons for believing that it ISN'T are:

  1. Tools such as this give different IP addresses on different university computers - these addresses correspond to those registered by tools like ifconfig.
  2. To my knowledge, local networks using NAT have certain conventions for IP addresses - the campus network, if it's functioning as a NAT, breaks these.

So, from this, is it possible to tell? Thanks.--Leon (talk) 20:16, 20 September 2009 (UTC)[reply]

It may be using a firewall without network address translation. In many home routers, the firewall and the NAT are provided by the same piece of hardware/software ("the router"); but in a large network, they are usually separate - both conceptually, in the service that they provide; and in implementation - in that they are managed by separate hardware. It is very common to block certain ports and firewall certain network traffic patterns, without performing NAT. Nimur (talk) 20:33, 20 September 2009 (UTC)[reply]
(edit conflict) Neither of your "for" reasons is really valid (the latter one just shows that a firewall is blocking ICMP, which is common). Both of your "against" reasons are valid; if public addresses==actual addresses, then (by definition) they're not being translated (which is the essence of what a NAT is). So they're not using NAT, they've just got a firewall (probably a pretty smart stateful firewall). -- Finlay McWalterTalk 20:38, 20 September 2009 (UTC)[reply]
The true test is to find out whether the IP address shown to the world is the same as the one on the PC. There are lots of sites that will tell you your public address, but Steve Gibson's site is one http://www.grc.com/default.htm and follow the link for Shield's Up. You can find your own IP address if on a PC by running a command window and typing IPConfig. If they're the same - no NAT. Otherwise - NAT. --Phil Holmes (talk) 13:11, 21 September 2009 (UTC)[reply]
Leon already did that in "reason for believing it isn't" number 1 above: He noted that an address from www.myipaddress.com is the same as one given by ifconfig, the Linux / Unix equivalent to ipconfig in Windows. So Phil's answer agrees with Nimur's and Finlay's: no NAT. --70.253.157.59 (talk) 00:43, 22 September 2009 (UTC)[reply]
Additionally, a good NAT implementation will use only private network IP address space for internal addresses. If your computer reports an IP address outside those ranges, it's probably not NAT. — Lomn 16:56, 21 September 2009 (UTC)[reply]