Jump to content

Wikipedia:Reference desk/Archives/Computing/2013 May 29

From Wikipedia, the free encyclopedia
Computing desk
< May 28 << Apr | May | Jun >> May 30 >
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.


May 29

[edit]

Switch to external monitor upon startup

[edit]

Have an old Acer that works great except that its monitor is broken, is there a shortcut key that I can use to use an external monitor on it? Thanks. Market St.⧏ ⧐ Diamond Way 10:16, 29 May 2013 (UTC)[reply]

If it's a laptop, it's usually Fn/F5. --TrogWoolley (talk) 12:51, 29 May 2013 (UTC)[reply]
Not 100% sure about the Acer but on hp laptops there is a special function key "Fn" bottom left corner of the keyboard. Pressing this and the "F4" key switches the laptop between the built in LCD and and external display. I think the Acer uses "Fn"+"F5". At any rate you should see various symbols on your function keys - such as brightness up/down, volume up/down. Varies from model to model but there should be a symbol the looks like a screen. Give it a few seconds to switch - if nothing happens, toggle it again.196.214.78.114 (talk) 12:56, 29 May 2013 (UTC)[reply]
Yes, "Fn"+"F5" on an Acer toggles between internal screen, external monitor, and both. It works only when auto-detect finds an external monitor connected. Dbfirs 22:27, 29 May 2013 (UTC)[reply]
Thanks all! Market St.⧏ ⧐ Diamond Way 04:11, 30 May 2013 (UTC)[reply]

QBASIC Decompiler

[edit]

Can anyone recommend a good QBASIC decompiler? Also, is it a little naive of me to expect to get usable source code from such a process? I'm trying to rewrite an ancient piece of software that runs a custom-built (scientific) instrument. Essentially, I'm wondering if it's worth the effort of locating the original floppy disc that the source code is on. Thanks (+)H3N-Protein\Chemist-CO2(-) 10:51, 29 May 2013 (UTC)[reply]

Also, ideally once I had the important bits from the original source I'd basically (no pun intended) rewrite it in a different language, because.. you know, this isn't the early 1990s and having a scientific instrument being run by QBASIC is less than desirable. (+)H3N-Protein\Chemist-CO2(-) 10:56, 29 May 2013 (UTC)[reply]
Decompiling code is highly non-trivial, especially if the original compiler is not instrumented to support this. So no, I would not expect you to get useful code from a decompiler (if one even exists). If the code has a symbol table (probably not ;-) you could try to get a good disassembler, and try to figure the logic out on the assembly level. This also works without a symbol table, but would probably be much more tedious. But if you can find the original source, that would be by far the best option. --Stephan Schulz 14:07, 29 May 2013 (UTC)[reply]
BASIC is an interpreted language, so most versions are not compiled at all. According to our article, QBasic is compiled to an intermediate form before being interpreted at runtime, so we are not facing the general problem of decompiling machine code here. Looie496 (talk) 14:07, 29 May 2013 (UTC)[reply]
Googling around suggests that compilation was introduced, or reintroduced, to QBasic with version 4.5, and Wikipedia's article is incomplete. (See for instance "How to Compile a QBasic Program" on eHow; BC.exe seems to be the name of the compiler and linker.) Perhaps the predecessor QuickBASIC (last release version 4.5) is intended, or QBasic used in combination with one of several related compilers (as the article says is possible).  Card Zero  (talk) 17:15, 29 May 2013 (UTC)[reply]
The cynic in me wants to say "at least the machine code of the processor is well-documented". I don't know how true this is for any intermediate formats (if applicable in this case). --Stephan Schulz (talk) 22:07, 29 May 2013 (UTC)[reply]
This [1] might help. Seemingly there is a decompiler around. Dmcq (talk) 14:13, 29 May 2013 (UTC)[reply]
Thanks for the answers. I think I actually may have located a printout of the original source code. So, problem solved most likely. (+)H3N-Protein\Chemist-CO2(-) 21:12, 31 May 2013 (UTC)[reply]

MASM615/Irvine32 Pains

[edit]

I am trying to set up a masm615 assembler to compile some code. The code relies on the Irvine32 libraries. I used to be able to get all of this from a university class i was in, but it is no longer available. Because of this, i have had to search the internet for some of the Irvine files, such as Irvine32.inc. Although my search for this specific file was successful, i could not find a working proper copy of SmallWin.inc anywhere. Does anyone have a resource where i can get this from? This is very frustrating.

Update: it may be my Irvine32.inc which is broken, not the smallwin. These are the errors i get:

Hw 2_1.obj(Hw 2_1.asm) : error L2029: '_RandomRange@0' : unresolved external

Hw 2_1.obj(Hw 2_1.asm) : error L2029: '_Crlf@0' : unresolved external

Hw 2_1.obj(Hw 2_1.asm) : error L2029: '_ExitProcess@4' : unresolved external

Hw 2_1.obj(Hw 2_1.asm) : error L2029: '_WriteInt@0' : unresolved external

216.173.145.47 (talk) 14:25, 29 May 2013 (UTC)[reply]

irvine32.inc is part of the library of stuff Florida International University professor Kip Irvine distributes for his book Assembly Language for x86 Processors. He has the support files for the book available for free download from his website here; pick the version you need for the toolchain version you're using. I checked one zip archive and it did indeed contain irvine32.inc. -- Finlay McWalterTalk 14:55, 29 May 2013 (UTC)[reply]

I am not using Visual studio at the moment. I'm JUST using MASM615 (whereby to compile you go to the directory and type "ml example.asm" ..... but i will try this resource anyway, thanks!


UPDATE: I have tried the libraries from this resource, and i still get the above 4 unresolved externals. 216.173.145.47 (talk) 14:58, 29 May 2013 (UTC)[reply]

That website also has a link to a forum where people discuss the book and the associated software; you'd be best advised to raise your specific issue there, as people will be intimately familiar with these specific problems. -- Finlay McWalterTalk 15:43, 29 May 2013 (UTC)[reply]
These errors are from the linker, not the assembler. I rarely use MASM, but you probably need to specify additional .lib or .obj files on the command line for the linker. ExitProcess is a Windows API call and will probably be in kernel32.lib. I don't recognize the other three; they may be part of the Irvine32 library. The leading underscore and trailing @ and number are a name mangling scheme used with the stdcall convention. It's possible that the linker does have the correct library but the names are mangled differently or not at all, which would be more of a hassle to fix. -- BenRG 02:07, 30 May 2013 (UTC)

Mislabelled SPAM.

[edit]

I have a new website set-up - we ask people to create an account there, they supply an email address and password - and we email a message asking then to click on a link to confirm that they are "real".

Out of a few hundred people who subscribed in the first week or so, about 20% of them claim that they didn't get the confirmation email. I told them to check their "junk" folders - and about half of them found the email there. Some users (notably people who use Time Warner RoadRunner "@rr.com" email addresses - but others too) were not getting the emails at all. It seems that by default, RoadRunner deletes spam without putting it in a "junk" folder (eeekk!) - and perhaps other ISP's do the same.

So for some reason, my perfectly legitimate email seems "spammy" to 20% of my customers email systems.

I've checked with several online services that let you submit your IP address to all of the 50 or so email blacklists - and my server doesn't show up on any of them. These are plain-text emails, no attachments, no rich text, no HTML - so they can't be infected with malware...and I've examined what I'm sending myself and I can't see any problems.

Here is an example of the entire message that we send (I've changed the http link address in the message body and hidden my true destination email with XXX's):

 Return-Path: <sjbaker@randall.dreamhost.com>
 X-Original-To: steve@XXX.org
 Delivered-To: x12164791@homiemail-mx20.g.dreamhost.com
 Received: from alc-shared-relay1.dreamhost.com (alc-shared-relay1.dreamhost.com [208.113.189.5])
    by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTP id 6C2BE401D751A
    for <steve@XXX.org>; Wed, 29 May 2013 06:53:51 -0700 (PDT)
 Received: from randall.dreamhost.com (randall.dreamhost.com [173.236.128.103])
    by alc-shared-relay1.dreamhost.com (Postfix) with ESMTP id 8E8F17800DD
    for <steve@XXX.org>; Wed, 29 May 2013 07:00:39 -0700 (PDT)
 Received: by randall.dreamhost.com (Postfix, from userid 944589)
    id 2807B10C524; Wed, 29 May 2013 07:08:03 -0700 (PDT)
 To: steve@XXX.org
 Subject: Activate your Renaissance Miniatures Account!
 Message-Id: <20130529140803.2807B10C524@randall.dreamhost.com>
 Date: Wed, 29 May 2013 07:08:03 -0700 (PDT)
 From: sjbaker@randall.dreamhost.com (Stephen Baker)
 Hello Steve,
 Welcome to Renaissance Miniatures! Use the link below to activate your account!
 http://www.renaissanceminiatures.com/webstore/login.php?request=activate&user=e0a7d530012357&email=steve@XXX.org   

So I'm left wondering whether some baysian filter is being tickled by the content of my messages?

It seems unlikely that other sites that use this means for having people create accounts (like Wikipedia!) have 20% of their account-creators unable to confirm like this. What the heck am I doing wrong?

TIA SteveBaker (talk) 14:50, 29 May 2013 (UTC)[reply]

For one thing it looks like you don't have Sender Policy Framework configured on your domain; see Dreamhost's SPF guide. -- Finlay McWalterTalk 15:01, 29 May 2013 (UTC)[reply]
Also I would get rid of those exclamation marks. (My internal cognitive spam filter is strongly triggered by them.) Looie496 (talk) 15:03, 29 May 2013 (UTC)[reply]
Joking aside, there is a Spam Assassin ruleset called CHICKENPOX which l.ooks f|or th.is kind of garb+age ; a couple of exclamation marks shouldn't irk it overly (as its looking for text that has significantly more punctuation than a rational English text should), but it is a salutary reminder not to get! too! excited! with! punctuation!! -- Finlay McWalterTalk 15:23, 29 May 2013 (UTC)[reply]
(EC) For starters, I'd suggest you look in to whether your mailhost provider supports Sender Policy Framework and if they do set it up. If they don't consider moving to a provider who does. Also while I'm not sure that it will make a difference, you may want to investigate setting up mail under your domain, and then change the from etc to be this email. Finally it may be easier to help if you can get the headers for an email sent to a service that marks the message as spam, or at least one that is sent somewhere other than dreamhost so the path of it leaving dreamhost is shown. Nil Einne (talk) 15:04, 29 May 2013 (UTC)[reply]
In general, Jeff Atwood has some things to remember in this 2010 post. -- Finlay McWalterTalk 15:05, 29 May 2013 (UTC)[reply]
The verifier service that Atwood talks about is discussed more, with some options, here. -- Finlay McWalterTalk 15:26, 29 May 2013 (UTC)[reply]

Javascript: storing a reference to data or popups that lasts while you browse Wikipedia

[edit]

Suppose I want to create a pop-up debug window that displays the values of certain variables on a page in the DOM model as you browse through Wikipedia. I can do this easily as long as I have a new pop-up window for every Wikipedia page I go to --- but that gets annoying.

What I'd like to do is set xxx=window.open(etc) and be able to access that value again and again no matter what window I go to. Likewise I want to be able to set up an object of carefully sorted data keys that I can look things up in on every page. But xxx doesn't stay the same from one window to the next, nor does window.xxx. I had the notion to look up window.parent.xxx - but it turns out that window.parent seems to be the window itself for any given article when I try. I even tried a this.xxx assignment, thinking at least my script might be the same, but that doesn't work either. And I don't see any kind of "getWindowByTitle()" to magic up where my window went.

Now, I know I could try writing a cookie, or using the localStorage construct, but the former is often disabled and the latter isn't in all browsers. Besides... these store text, and what kind of text is going to hold a magic password to find me the window I made before I clicked a Wikilink to a new page?

So how do you do it? Wnt (talk) 19:17, 29 May 2013 (UTC)[reply]

I believe the relevant variable (for the popup) would be window.opener. 64.201.173.145 (talk) 12:06, 30 May 2013 (UTC)[reply]
Can you explain a bit further? I suppose you could insert a script into the popup window when you make it, which would continue to be active, but ... how does it then know how to interact with the new page's main window? Wnt (talk) 22:44, 30 May 2013 (UTC)[reply]

Is there any tool that only runs on Linux?

[edit]

Excluding those that are meant to deal with the OS itself obviously. OsmanRF34 (talk) 20:23, 29 May 2013 (UTC)[reply]

To me the most important Linux-only tools are shells such as bash. Actually there are Windows versions, but they are inferior, as I understand it. Looie496 (talk) 21:12, 29 May 2013 (UTC)[reply]
Bash also runs on Mac OS X (and presumably BSD). RudolfRed (talk) 21:20, 29 May 2013 (UTC)[reply]
Yes, many. But it's fairly trivial to install a virtual machine to run Linux from within windows - so many will claim that everything in Linux runs under windows *somehow*! Also, there are a good number that are Linux and Mac only. There are far too many to list - but check out (for example) Comparison of video editing software - you'll see that if you want something FOSS that does graphical video editing, you pretty much can't get anything very capable for Windows.
I disagree about bash - I use the Cygwin package for Windows and when you use bash within cygwin it's quite hard to tell that you're not using bash under Linux. SteveBaker (talk) 21:21, 29 May 2013 (UTC)[reply]
Can't you compile any FOSS programs for running under Windows? OsmanRF34 (talk) 21:29, 29 May 2013 (UTC)[reply]
Sure, the same way you can empty Lake Tahoe with a spoon. --Trovatore (talk) 21:32, 29 May 2013 (UTC)[reply]
Define "only on Linux". Most Linux tools are open source, and developed with portability in mind. Thus, they usually run on most modern Unixes, like OpenBSD, FreeBSD, OS-X, and even Solaris. Some have also been ported to Windows. But there are many tools for which the primary platform is Linux, and which are not available for Windows. My own E theorem prover is only ported to Windows by third parties, it's native to Linux and OS-X (developed primarily on the later, deployed and tested mostly on the former). --Stephan Schulz (talk) 21:44, 29 May 2013 (UTC)[reply]
OK, but if someone would like to run one of these tools, which were developed for and used within the *nix family, in Windows, and it had the options of FOSS + compile it, or a VM. What would be his drawback? OsmanRF34 (talk) 22:32, 29 May 2013 (UTC)[reply]
The main drawback with that, is, well, Microsoft Windows. (Excuse me, couldn't help it.) 95.112.182.165 (talk) 22:16, 31 May 2013 (UTC)[reply]
Compiling code on a different platform is not universally trivial. Libraries, build systems, compilers, tool chains, are often not compatible, even if the source code is available. This is less a problem for console applications, but becomes more and more difficult when programs use higher-level OS services, like GUI frameworks, network, database access, and so on. Using a VM can overcome this problem, but a) you inherit the weaknesses of both the host and the guest OS, b) integration is not so good and c) there typically is a significant overhead in memory and a noticeable overhead in CPU. --Stephan Schulz (talk) 22:48, 29 May 2013 (UTC)[reply]
I find it odd that there isn't a site (at least that I could find) that lists all linux-exclusive tools... --Yellow1996 (talk) 23:31, 30 May 2013 (UTC)[reply]
Why? Is there one that lists OS-X-exclusive tools or Windows-exclusive tools? --Stephan Schulz (talk) 20:26, 31 May 2013 (UTC)[reply]
No and no; you have a point! --Yellow1996 (talk) 01:04, 1 June 2013 (UTC)[reply]

Desktop subtractive "3d printing"

[edit]

I'm aware that "3d printing" actually means an additive process. But is there a home machine that would subtract from a block of plastic (or whatever), and generate 3d figures? OsmanRF34 (talk) 20:39, 29 May 2013 (UTC)[reply]

There is, or is going to be (or is never going to be, I haven't checked their Kickstarter status) a device called "othermill".  Card Zero  (talk) 20:56, 29 May 2013 (UTC)[reply]
Othermill isn't very special though - and $999 is kinda expensive for such a tiny machine. If you don't mind doing a bit of assembly work yourself, the link I posted below for a sub-$100 machine is about as capable as othermill. There are MANY such machines out there are a wide variety of price points and capabilities. SteveBaker (talk) 21:12, 29 May 2013 (UTC)[reply]
Subtractive printing is just old-school milling - but with a computer driving the machine. A computerized milling machine can take a solid block of material and cut holes in it where needed. These come in two main varieties: 3 DOF and 6 DOF - a 3 DOF machine can move the drill bit in X,Y and Z and can carve vertical relief - but can't manage undercuts of any kind. There are plenty of things you can make with additive 3D printing that you can't make with a 3DOF milling machine. A 6 DOF machine is more like a robot arm with a router bit - it can rotate the bit around all six axes and get underneath and inside things. There are STILL limits on what it can make though - because you can't always fit the tool into the hole you're trying to cut inside. In the end, only additive printing provides the complete generality to make absolutely any shape you can imagine. However, subtractive machining has many other advantages - for example, you can cut any material that a drill bit can chew through...you don't get the layer "delamination" problems you have with most 3D printer technologies. However, you have lots of other annoyingly practical problems - like that the diameter of the router bit limits how square you can make an interior corner - and you have to consider how the material that you're "subtracting" is being removed from the hole that you're making.
More expensive subtractive machines use high powered water jets to do the cutting - or lasers. But they all have limitations of one sort or another.
As for a "home machine" - it depends on how big your budget and workshop is - and how good you need the machine to be. But in principle, a subtractive 3DOF CNC machine can be very cheap indeed. Here is one you can build yourself for around $100! I've seen some pretty reasonable subtractive machines built from Lego robotics parts and a Dremel drill.
SteveBaker (talk) 21:09, 29 May 2013 (UTC)[reply]