Jump to content

Wikipedia:Reference desk/Archives/Computing/2015 July 29

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


July 29

[edit]

Extracting tagged text

[edit]

What algorithm can I use to, for example, extract "abc" from "xxx<abc>yyy" if I give it "<" and "> as delimiters (or another, extracting mediawiki style templates)? What is the most efficient way to do this? 24.255.17.182 (talk) 01:33, 29 July 2015 (UTC)[reply]

The usual way of completing this sort of task is to use a Regular expression.--Phil Holmes (talk) 07:04, 29 July 2015 (UTC)[reply]
Right, that's sed, available by default on Unix (including OS X), and Linux systems, Windows users commonly access it via cygwin. Some text editors also have built-in regular expression support. SemanticMantis (talk) 13:12, 29 July 2015 (UTC)[reply]
The "algorithm" is very simple. Given a value START as the start character and END as the end character, then a STRING as the string of text:
  1. Make an empty string DEST.
  2. Set a flag TAG to false (or zero).
  3. Set a pointer to the first position of STRING.
  4. Set CHR to be the character in STRING at the pointer.
  5. If TAG is true:
    1. If CHR equals END, set TAG to false
  6. Otherwise (else):
    1. If CHR equals START, set TAG to true
    2. Otherwise (else), append CHR to the end of DEST
  7. If the pointer is not at the end of STRING, increment the pointer to the next character in STRING and go to 4.
  8. DEST contains all chracters in STRING, omitting everything found from START to END.
This algorithm does not handle escape characters. It is not better than a regex as it is the algorithm used by regex. 209.149.113.45 (talk) 13:36, 29 July 2015 (UTC)[reply]

Release data of Raspberry Pi 2 Windows 10 ARM port?

[edit]

Hello everyone. Does anyone know when the free ARM port of Windows 10 for the Raspberry Pi 2 will be released? I would imagine it wpuld have been released when Windows 10 it self was released right? Thanks for your help in advance. —SGA314 I am not available on weekends (talk) 14:33, 29 July 2015 (UTC)[reply]

Information about this Microsoft port is available through their developer program: Windows for IoT, as announced in Windows 10 Coming to Raspberry Pi 2, a February 2015 blog update. Here are instructions: Setting up Raspberry Pi. Here are downloadable files. If you aren't already in the developer program, consider joining; they'll give you first-hand news and information long before it hits a wider audience. Nimur (talk) 14:45, 29 July 2015 (UTC)[reply]
Ok cool. so it has released already. Here is question 2. I have only 1 32gb sd card. So how would I setup the pi to dual boot off the sd card? For instance, on a pc you can set it up to boot into Linux or Windows on the same hard drive. How would I do this with Raspbian and Windows 10 n the Pi's sd card? —SGA314 I am not available on weekends (talk) 15:57, 29 July 2015 (UTC)[reply]

Glympse or alternative

[edit]

Background: I will be an adjunct at another university this fall. It is a little over 1 hour's drive away. I will be giving myself 1.5 hours to drive there, but in that long of a trip, there is a high possibility of traffic issues. The class period is 1.5 hours. I don't want the students to walk out after 10 minutes if I am just 5 minutes away. But, how do I let them know if I am close or still very far away? Question: Is there an application that will share my location for a certain period of time with anyone and everyone in the world? I don't want to deal with having students sign up for a service and then become "friends" in the service and then install apps on their phones and then lose their passwords and have to reset them every class... I want to turn on an application on my phone and then anyone who knows something, such as my user ID, can see where I am until I turn the application off. I looked into the following:

  • Google Maps: I don't see how to share a "here I am" pin automatically.
  • Life360: I can only share with my "family" or "circle". So, everyone has to have an account and install Life360 to see me.
  • Glympse: This looks promising, but they have almost no documentation on their website. There is a video, but I don't watch videos. I am not illiterate and I don't have time to waste when I could quickly scan text (if there was text) ... trying to avoid a rant about the general shift of the Internet to publishing all information in videos instead of text.

So, any suggestions? On my end, I have a lot of resources. I own multiple web servers. I have an Android phone with GPS and I doubled the battery (screw the warranty). I have handheld GPS device that has WiFi. I can write my own Android app, but I would like to avoid doing so if someone else already wrote something that does this. 209.149.113.45 (talk) 15:13, 29 July 2015 (UTC)[reply]

For a decidedly "old school" approach, you might consider walkie-talkies. Although they claim ranges up to 30 miles, the longest you are likely to get is about 2 miles: [1]. Still, if you are pulling into the parking lot 5 minutes after the class starts, you should be able to use the walkie-talkie to tell everyone you are almost there. The advantage: You wouldn't have to rely on anyone checking anything, just leave the other unit plugged into it's charger and turned on in the classroom, and it will speak when you speak on your unit, without anyone having to answer it or check anything. If theft is a concern, I suppose you could lock it up in such a way that it can still be heard (in a metal cage ?).
I also agree that video sucks for giving info. When somebody asks or "answers" a Q here with a 2 hour video and no time index, I rarely bother to watch it. StuRat (talk) 17:08, 29 July 2015 (UTC) [reply]
I don't own the classroom. So, I would be dependent on one student to always be in the class with the other handset. Optimally, I would like to find something that I can embed in a web page. I own my web servers and I can ask that the first student in the class direct the overhead projector to my website, which would then have a map showing where I am - along with notes that I can update every day, indicating what they can do while I'm stuck in traffic. 209.149.113.45 (talk) 17:14, 29 July 2015 (UTC)[reply]
Set up a webpage someplace - write yourself a tiny Android app that sends the amount of time until your arrival to the server. All you have to tell your students is the URL. Doing this without the app is plausible - but if you're driving, you'll want something that's as close to one tap on the screen as possible. (Four big buttons: On time/5mins late/10mins late/Lecture cancelled ought to cover it). SteveBaker (talk) 02:25, 30 July 2015 (UTC)[reply]

More general suggestions

[edit]
( I don't know, but I advise discussing the situation with your new superiors, dept. chair, etc. When I've been a lecturer, being more than 10 minutes late to class more than once or twice a semester would be grounds for dismissal. The way you write your example, you're actually running at least 15 minutes late for a 90 minute course, and many institutions would consider that inexcusable outside of rare emergency circumstances. Most universities will not consider traffic to be an emergency circumstance. The university may or may not have explicit policies on this. Some universities explicitly say the students are allowed to leave after 10 minutes of no instructor. Maybe the simplest thing to do is allot 2 hours for the drive. Sorry to give a non-answer but no amount of tech will save your job if you are consistently late to scheduled class meetings. ) SemanticMantis (talk) 17:18, 29 July 2015 (UTC)[reply]
I agree and understand. We have discussed this - which was a reason I was very reluctant to agree to take the class. We discussed doing it remotely and moving the time. There are no good solutions to the problem. Having me race from one city to another, past two large factories during shift change, in a car that will likely not survive the semester, is the best solution they could find. Last year, they simply canceled the course, which happens to be a required course for the program. 209.149.113.45 (talk) 17:41, 29 July 2015 (UTC)[reply]
Suggestion: Have an activity at the beginning of the class that doesn't actually require your presence. A written quiz is one idea. I'd make it not graded, just so they can gauge their progress, and you would have to rely on an assistant (pick a student) to deliver it on days when you are late (give them copies the previous session), if there's no place you can leave it, that's accessible to the students. It can have answers on the back, and you can then answer questions about it when you arrive. You can also write on the quiz "feel free to ask other students for help, if you need it".
I'd also explain the situation to the students in advance, so it's not a surprise to them when you are late. And have alternate routes planned out and listen to traffic advisories, so you have the best chance of bypassing any traffic problems. Also monitor construction zones. StuRat (talk) 17:50, 29 July 2015 (UTC)[reply]
I actually do little quizzes at the beginning of every class - it replaces the concept of taking roll. If you did the quiz, you were there. My fear is that the traffic is simply going to be hellish. As mentioned before, I have to drive past two factories during shift change. So, no matter what path I choose, I have to deal with a thousand people leaving and a thousand people arriving all at the same time - twice. Also, they just started major development projects at the start and end point. So, no way to get around either one since I start in the middle of one and end in the middle of the other. All around, this semester is going to be terrible. I'd be forceful with my "no" if I didn't really need the money. 209.149.113.45 (talk) 18:30, 29 July 2015 (UTC)[reply]

The satellite navigation app Waze can let you share your drive with your friends who use the app. This shows your approximate position and ETA to them. I'm not sure if it would be possible to rig up something to let anyone in your class see this (short of adding them all as freinds on the app), but it might be a potential solution. (It will also route you along the best route it can find, given it's traffic reports, which tend to be fairly good). MChesterMC (talk) 08:42, 30 July 2015 (UTC)[reply]

I'm curious about how accurate and current traffic reports get loaded into it. Let's say a TV news reporter in a helicopter says "it looks like there's an accident in the right lane, the right lane is blocked. Traffic is proceeding slowly in the center lane, but moving at near normal speed in the left lane. Police are on the scene, but no tow truck is present." How does this app get that info in a usable form ? StuRat (talk) 17:45, 30 July 2015 (UTC) [reply]
Most of those apps are driver-based. Drivers see an accident and then rush to grab their phone, start the app, and report it (and then create another accident). 209.149.113.45 (talk) 12:45, 31 July 2015 (UTC)[reply]
I can't comment on any of the mentions apps but for Google in NZ, while they connect to a few sources of road closures etc primarily from the government, and may also rely on user reports, AFAIK their most useful info probably comes not from intentional reports but simple data sharing. Given the relative popularity of Android phones and people using Google Maps or otherwise choosing to share their data with Google and with a data service and GPS on, they can see when major roads appear to be slow based on current travelling patterns. Nil Einne (talk) 22:59, 31 July 2015 (UTC)[reply]
I like Glympse. My friends and relatives can see me moving, stopping, resuming. I use their Email address when they are home, SMS when they're out, or both. I can send it to one or two or ten, whatever. Since it isn't part of some other navigation or social network, they don't need to install the app. They don't need to know there is such an app. The message just appears, and says to tap or click to see the Web map of where I am. Yes, they do need Web, which most cellphones have nowadays. The author seems to assume it's so simple, it needs no documentation. This is correct. Jim.henderson (talk) 18:12, 31 July 2015 (UTC)[reply]

Networking switch query

[edit]

I have 2 computers connected to powerline ethernet adapters, and a 3rd connecting to my router. This can be a little slow sometimes (at least for game streaming and stuff). To speed things up would I be able to connect the 2 PCs via a switch, and then route that switch to the router via a powerline adapter? If I send traffic from 1 PC to another does the traffic have to go all the way to my router then back (presumably what is happening now), or will it go via the switch, which should be much much faster, as both PCs have Gigabit ethernet? 81.138.15.171 (talk) 15:42, 29 July 2015 (UTC)[reply]

What I would first do is get a crossover cable (very cheap) and plug both computers into one another. You will need to hard-set the IP of each one to something like 192.168.0.1 and 192.168.0.2. Then, you will have the absolute maximum speed of data transfer between the two computers. If there is lag, it isn't the network. Next, if you think you can make your network better, a hub will do. Two computers on a switch is a bit of a waste - especially when you are combining both signals into one upstream. 209.149.113.45 (talk) 16:07, 29 July 2015 (UTC)[reply]

How to do a dual boot of Windows 8 and 10: no USB drive or DVD?

[edit]

I have already created the hard-drive partition.

Currently running Windows 8.1, with a 1 TB laptop. —24.228.117.156 (talk) 16:30, 29 July 2015 (UTC)[reply]

There's not a single USB port on there? What input options are there? Ian.thomson (talk) 16:41, 29 July 2015 (UTC)[reply]
Considering that upgrading from Windows 8.1 to Windows 10 is done through windows update, using a USB drive or a DVD is most likely not necessary. —SGA314 I am not available on weekends (talk) 17:05, 29 July 2015 (UTC)[reply]
First you must create a botable image of the partition that contains Windows 8.1. Next, you must 'extract' that image onto the other partition. you will need a special program to do this. do a Google search for something like 'hard drive image creator' or 'bootable hard disk image creator.' when you find the right program, use it to create an image of your partition that contains 8.1. This file should be roughly the same size as the size of the windows 8.1 partition. You should store this file on a SEPARATE hard drive or if you have enough space, on the 8.1 partition. This will allow you to extract the image onto the other partition. It would be helpful if you gave the amount of space taken up on the 8.1 partition as well as the size of both partitions. —SGA314 I am not available on weekends (talk) 17:02, 29 July 2015 (UTC)[reply]
This is actually the exact same thing I am going to do as well except that I will use a separate hard drive instead of dual booting. —SGA314 I am not available on weekends (talk) 17:07, 29 July 2015 (UTC)[reply]
Not an answer, but I agree with your plan for a dual boot, noting that Windows 10 is for suckers. So, committing to Windows 10 now as your only O/S would be foolish. StuRat (talk) 17:40, 29 July 2015 (UTC) [reply]
I run alot of VST and audio production software on Windows 7. Thus it would be wise for me to make a copy of all me software and try and run it on Win 10. I am also not very confident in the upgrade process's ability to keep all my files intact. I was able to setup a dual boot nce with XP and Win 7 but I don't remember what software I used. —SGA314 I am not available on weekends (talk) 18:57, 29 July 2015 (UTC)[reply]

Downloading NTSB hearing video

[edit]

Hello Wikipedia! I am trying to download the video of yesterday's National Transportation Safety Board meeting on the SpaceShipTwo crash last October. Their video archives are at http://ntsb.capitolconnection.org/ and I'm able to play it using the Flash Media player running in Iceweasel (rebranded Firefox) on Debian GNU/Linux, but I don't see how to download it. I installed the "Flash and Video Download 1.74" add-on, but while it seems to work on other sites such as YouTube where it lists the various formats and resolutions of video files available for download, it doesn't seem to recognize any videos to download at the NTSB video's page http://ntsb.capitolconnection.org/072815/ntsb_archive_flv.htm . Can you suggest a Linux friendly method for doing this? I am also open to Windows only methods, but would have to borrow a friend's computer.

PS Copyright is not an issue here as the recording of this board meeting is a work of the US government. 2602:306:C4D5:C340:C8FB:D7A2:D78C:2586 (talk) 18:38, 29 July 2015 (UTC)[reply]

The player used on that site is JWPlayer. This video shows a Firefox extension which, it says, will process web pages which host JWPlayer and will download the flash videos embedded in them. I've not personally tried the specific extension it recommends (I'm running too many already), so I can't personally vouch for it - but if you opt for this approach, I'd be interested to know of that method works for you. -- Finlay McWalterTalk 19:11, 29 July 2015 (UTC)[reply]
note: I did try other flash download tools, which are often successful - youtube-dl and VideoDownloadHelper (a Firefox addon) and neither worked for this video. -- Finlay McWalterTalk 19:13, 29 July 2015 (UTC)[reply]
Thank Finlay, but it (the "Flash Video Downloader" extension shown in the video you linked) doesn't seem to work on this NTSB video. The download arrow never turns blue but stays gray with a red x (even after the video starts playing), though it does work for the video on the http://jwplayer.com/ page which is using JWPlayer.
Any other suggestions welcome.
I am also trying the rtmpdump utility, but it isn't working yet, with:
$ rtmpdump  -r "rtmp://fms.0172.edgecastcdn.net/000172/flv/ntsb/ntsb082712a.flv" -o ntsb20150728.flv
RTMPDump v2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
Connecting ...
WARNING: HandShake: client signature does not match!
INFO: Connected...
ERROR: rtmp server sent error
ERROR: rtmp server requested close
$
I got the URL by looking inside the source of the video's page, but I think that it may need more command line options, and I'm still trying to figure out how to run rtmpsuck. 2602:306:C4D5:C340:2DE3:2DBF:6157:E5DD (talk) 20:02, 29 July 2015 (UTC)[reply]
Well, the issue is still not resolved, but someone else must have managed to download it and put it up on YouTube: https://www.youtube.com/watch?v=QnMIfY_Wbrc .
So while I no longer have an immediate need, I'd still appreciate any pointers if someone here knows how to download from the NTSB site. Thanks! 2602:306:C4D5:C340:2DE3:2DBF:6157:E5DD (talk) 18:08, 30 July 2015 (UTC)[reply]

Windows update on Windows 10

[edit]

Where is Windows update on Windows 10? It is no longer in the control panel and if I try to go to it from IE, it says that it can't find wuapp.exe. I want to make sure that it doesn't reboot without me telling it to. Bubba73 You talkin' to me? 21:02, 29 July 2015 (UTC)[reply]

Does this article address your question? http://www.cnet.com/how-to/windows-10-lets-you-schedule-windows-update-restarts/ 2602:306:C4D5:C340:2DE3:2DBF:6157:E5DD (talk) 21:12, 29 July 2015 (UTC)[reply]
That is what I'm talking about, but it says to open "settings". Where is "settings" on Windows 10 desktop? Bubba73 You talkin' to me? 21:21, 29 July 2015 (UTC)[reply]
OK, I found settings. Bubba73 You talkin' to me? 21:31, 29 July 2015 (UTC)[reply]
What do you think of the options it gives? I understand that W 10 keeps updates on automatic. Are the update restart options rich enough? 2602:306:C4D5:C340:2DE3:2DBF:6157:E5DD (talk) 23:14, 29 July 2015 (UTC)[reply]
The options seem to be more limited. I don't really want to schedule a reboot because sometimes I'm running something that is going to take a long time and a reboot will lose all of the work up to that point. Bubba73 You talkin' to me? 23:27, 29 July 2015 (UTC)[reply]

Running a PC with one single application (or not much more than that)

[edit]

If I wanted to run just one single application like Vi/m or emacs on a PC (an x86) what else would I need? Would I need an OS at all or can I compile it to run without one? Could a PC be run without OS like an embedded computer can?--Yppieyei (talk) 21:10, 29 July 2015 (UTC)[reply]

You would need a kernel and whatever libraries the program needs, at which point you now have an operating system. "Operating system" is really a vague concept. It's more of a marketing term than a well-defined technical term. Now, to clarify, you could sit down and start adding code to vim to do all the things that a kernel and libraries do, but then you will just have written your own little embedded operating system that's only designed to run vim. A lot of embedded systems run operating systems. The only computers that don't have operating systems are really basic chips that you find in things like the proverbial elevator controllers and toasters. --108.38.204.15 (talk) 23:30, 29 July 2015 (UTC)[reply]
You can certainly work without an OS. That's actually how Linus Torvalds started writing Linux - he wanted a 'dumb terminal' program that could run on his PC with a modem without having to boot up DOS first...features were gradually added to it until it kinda accidentally became close enough to an operating system to actually become one! (For some reason, our articles on Linux and Linus don't discuss this very formative stage - but it's described in Linus' autobiography "Just for Fun").
I've also used PC's in things like Disney rides where we got rid of the OS entirely and ran our code on the bare metal. You don't necessarily need either a kernel or libraries or even device drivers - it's perfectly possible to write code that directly reads device registers and such...it's really no different when you're using something like an Arduino (which has no OS) or a PC. The biggest issue with running stand-alone programs on a PC is getting them loaded into memory in the first place. In my work, we replaced the BIOS ROM with our own EPROM chip...but it's been a while since that trick became impossible.
For something like Vim, which is probably single-threaded - only has to write to the screen and to save files to a disk drive - and only reads from the keyboard and loads files from the disk drive - that might not be too difficult. But if you wanted Vim to be able to read and write files on the disk drive that also needs to be used by (say) Windows - then you'd have to add a ton of code to handle how directories are formatted, where to find free space on the disk and mark that it's been used or freed. The code to do that might easily get bigger than Vim itself! Writing to the screen might not be difficult if you used your awesomely powerful graphics card to run in very-mundane VGA mode - but if you wanted a nice high-res screen with full color, you'd need some insanely complicated emulation of (say) an nVidia card's device driver - which would probably be impossible to write because those cards aren't documented to the degree that would allow that - and which would need a total re-write to run on an Intel graphics chip.
What tends to happen when you do this is that your stand-alone program tends to absorb more and more of the functions of an operating system (like handling files and directories on a hard drive - loading proprietary device drivers, handling interrupts, creating threads - dealing with memory management, etc) - until...just like Linus' dumb terminal program...you have actually written most of an entire operating system yourself.
Incidentally, when Linus needed disk operations for his growing dumb terminal project, he use the code from the pre-existing 'Minix' operating system - and thereby avoided the need to write his own until the project was already quite clearly an operating system in it's own right.
But for VERY simple situations, particularly if your I/O needs are very simple - you can indeed write programs without an operating system quite easily. Debugging them tends to be a bit of a challenge though - when you're running on the bare metal, you have no debugger to help you out - and even getting a "printf" to work might be a major problem!
SteveBaker (talk) 00:05, 30 July 2015 (UTC)[reply]
One interesting alternative is Tiny Core Linux. With Tiny core you just get the Linux kernel, BusyBox and (optionally if you want to run a GUI, FLTK). 9MB without a GUI, 15MB with. Add your application and you are done. --Guy Macon (talk) 00:18, 30 July 2015 (UTC)[reply]
If all you want is ultra lightweight cheapness - buy a "Pogoplug" for around $7 [2]. It's sold as a network backup box - but you can install Linux on it. With a USB port, ethernet and SD card slot and nothing else, it'll happily run Vim...if you have a way to SSH into it because it has no way to hook up a display.
This comes down to why our OP wants to do this. The cost of hardware that'll run an actual OS has fallen to essentially zero...so NOT running an OS has to be done for a reason. I can think of lots of reasons - security, for example. The less software that you didn't personally write, the easier it is to be secure. Maybe you want to be able to write poetry on your toaster - in which case Vim might be needed. But a $7 Linux box is hard to beat. The best advice here would come from understanding the true nature of the problem.
SteveBaker (talk) 02:41, 30 July 2015 (UTC)[reply]
Historical CPUs were much simpler than today's systems, too. It might have been possible to write code to the bare metal of an Intel 8051 or even an actual Intel 80386. Today, even trying to boot the CPU on a modern Intel Core Architecture programmable computer requires profound familiarity with a seven hundred page manual. A lot has changed: simple architectures gave way to complex systems tuned for higher performance. Even your main memory on a modern computer - say, one that uses DDR4 SDRAM - needs a software driver to initialize and calibrate it! Heck, even to retrieve a word of data from SDRAM is complicated: you need an elaborate control command sequence. Unlike SRAM, you can't just push an address into a register and read back data! You literally need to write an algorithm to retrieve a byte from an address. This is the sort of work that you don't even realize your operating system is doing for you. The hardware designs have evolved so that their feature-sets are well-matched to sophisticated operating systems, not to make life easy for bare-metal assembly code writers.
In the absence of an operating system, you cannot take advantage of such modern hardware. The job of the operating system is to relieve programmer pressure. You don't have to engage in the gritty details of the hardware in order to use it. You could pursue ancient computing machinery with simpler hardware interfaces, but you have to go back a long way to find machines that are architecturally "simple." Nimur (talk) 13:26, 30 July 2015 (UTC)[reply]
There are boot disks (or USB drives) that will boot up a PC and run a single program. They use some operating system, but don't have all the overhead of running full Windows, for example. They seem to avoid the periodic pausing that Windows seems to do when it checks for updates or whatever the heck it's doing. For example, if the program doesn't require Internet access, it can skip connecting to the Internet. One application is utility programs, like a disk reformat program, since you really don't want to reformat a disk while it's being written to. StuRat (talk) 13:45, 30 July 2015 (UTC)[reply]

Add User in Windows 8

[edit]

How do I add a user account using Windows 8 on a laptop? I know how to get to the Control Panel to add a user in Windows 7, but I can't seem to navigate to a user accounts interface in Windows 8. Robert McClenon (talk) 22:11, 29 July 2015 (UTC)[reply]

Is what you are looking for under "PC Settings > Accounts"? I reached PC settings by just hitting the windows key and typing PC. Vespine (talk) 06:51, 30 July 2015 (UTC)[reply]