Wikipedia:Reference desk/Archives/Computing/2014 March 12
Computing desk | ||
---|---|---|
< March 11 | << Feb | March | Apr >> | March 13 > |
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. |
March 12
[edit]What's the issue between UTF8 or Unicode in PHP
[edit]Does PHP have unique problems with UTF8 or Unicode? Is string handling in PHP basically different compared to other mainstream languages like Java, JS, or Ruby? OsmanRF34 (talk) 01:50, 12 March 2014 (UTC)
- Only ASCII will reliably work in PHP, really. There is the http://www.php.net/manual/en/book.mbstring.php mbstring] extension, but its problem is that it focuses on being "multi-byte" rather than charsets. →Σσς. (Sigma) 05:29, 12 March 2014 (UTC)
How do I use WinRAR or something else to send 2MB files to a student whose email won't accept more than 900K?
[edit]I have downloaded WinRAR-64 for my Windows 7 running ASUS laptop. It will let me make archives and even email compressed files. The latter doesn't seem to work. I have a 953KB file that gets returned as over the 911K limit when I mail it. When I have tried "compress and email" it has said it is 654KB, but still comes back as over the 911KB limit. This is for a student overseas. Can someone suggest what I am doing wrong, how to break the original file (a PDF) into smaller bits, or link to better instructions than those the publisher provides?
Or suggest a better way to make a real ZIP file or the like? Thanks. μηδείς (talk) 04:47, 12 March 2014 (UTC)
- This is just a wild idea, but maybe it doesn't like zip files. You could try renaming the extension to simply "txt" and see if it goes. ←Baseball Bugs What's up, Doc? carrots→ 05:11, 12 March 2014 (UTC)
- It seems to imply that I am going from a PDFD to an RAR file just over half the size. The student who requested I send he such files implied I could picar them into varios little pedazos with the WinRAR program. But the best I have been able to do is send Watership Down at 953 KB PDF as a 654 KB RAR file to her and bcc'ed to myself. On my end it said the file I was opening was 654KB and it did open, but it was sent back to me from her address undeliverable as over 922KB. What I assume I nee to know is how to break the files into separate smaller subfiles. It is a shame because this is a productive longtime WP user who has valid interests, but limited access. μηδείς (talk) 05:25, 12 March 2014 (UTC)
- Use /bin/split. split -b 899K file.pdf should do it. →Σσς. (Sigma) 05:26, 12 March 2014 (UTC)
- I am using a shell. Are you giving a root command? You seem to speak CO-5 while I have only mastered CO-3 / 2.5 . I basically need to be told what to install, what to click on, what to select, what to click on, and how to attach that to an email. (Again, thanks.) μηδείς (talk) 05:30, 12 March 2014 (UTC)
- At this point I have WinRAR installed. I activated the WIN email program. I can select a standard large pdf and then click on "compress and email" or "compress and email as RAR archive" but it still won't be accepted at the arriving end for being too big (even though it syas it has been compressed smaller.) μηδείς (talk) 05:34, 12 March 2014 (UTC)
- 2MB is not big at all, so I would suggest just transferring the file by a different method. If you use Dropbox, Skydrive, Google Drive, or similar, it will take mere seconds to upload your PDF there. Then you can use the 'share' option to give you a private link which you can email to your student. Alternatively, there are lots of free websites specifically designed for sending large files. The basic principle is you upload a file, it gives you a link and a limited time window where your recipient can use the link to download the file. I can't recommend any particular such site since I've never used one. —Noiratsi (talk) 07:54, 12 March 2014 (UTC)
- If email attachments really are the only way, here is a tutorial telling you both how to split WinRar files and how so split and join other files using a tool called HJSplit. Point-and-click instructions. http://www.addictivetips.com/windows-tips/how-to-split-a-large-file-into-several-small-files-using-winrar-and-hjsplit-and-how-to-merge-them-back/ —Noiratsi (talk) 08:02, 12 March 2014 (UTC)
- This looks like a case for WinRar option 'Split to volumes' which can be found under 'archive name and parameters' when creating a new archive. You can split your archive into volumes and choose the size of each part (maybe choose 800k to be safe). When extracting, it merely looks for the next volume or part. Send each part to the person as a separate email. Sandman1142 (talk) 11:22, 12 March 2014 (UTC)
- I would suggest using a considerably smaller file size. Binary files are encoded when sent by email, and this makes the attachment larger. I'd suggest a maximum file size of 500k to be safe.--Phil Holmes (talk) 15:35, 12 March 2014 (UTC)
MS Flight Simulator
[edit]Do both Flight Simulator 2004 and Flight Simulator X run on Windows 8? Also, will both of them run using an Intel Ivy Bridge integrated graphics card? 24.5.122.13 (talk) 09:04, 12 March 2014 (UTC)
- I don't know about you graphics card, but Microsoft's Compatibility Center says yes. Mingmingla (talk) 19:55, 12 March 2014 (UTC)
Displaying folder size
[edit]I'm sure this has been asked before, but the search terms are too generic to find anything. Is there a way to get Win7 to display folder sizes, rather than just the sizes of individual files? Windows has been slowly filling up my boot drive, to the point where I'm starting to have trouble running my computer, so I either need to uninstall things or reinstall them on other drives. It would be nice if I could just look at my folder list and see what's taking up so much space. — kwami (talk) 11:22, 12 March 2014 (UTC)
- Right-clicking on a folder and choosing 'properties' will show you an estimate of the size of the folder. You can also use a free tool like Space Sniffer to give you a visual breakdown of what's taking up the most space. —Noiratsi (talk) 11:47, 12 March 2014 (UTC)
- I didn't want to have to click on 'properties' for each of hundreds of folders, as I have been doing. I'll try Space Sniffer. Thanks! — kwami (talk) 18:20, 12 March 2014 (UTC)
- You might have better luck using Windows' Command Prompt and doing "dir /s" with a print to file (e.g., "> example.txt"). That will display all of the subfolders, their sizes, and all files within. You could also use Windows' search function (e.g., "size:>50MB") to find individual large files. -- 140.202.10.134 (talk) 23:10, 12 March 2014 (UTC)
- Windows really should do that, but it doesn't. I use two utilities for that WinDirStat and TreeSize. By default they show you the whole drive, which takes a while. But you can select an individual folder (at least with the former). But Windows really should that. Bubba73 You talkin' to me? 01:08, 13 March 2014 (UTC)
Wiring 7 pin socket to microcontroller
[edit]I have a 7 pin socket for a Nintendo Entertainment System controller, and I'd like to wire it to my Basic Stamp microcontroller. I have the pinouts, but I'm not sure how to actually wire the connection; that is, how to physically connect the socket pins to the Stamp. I'm not good with solder; I've looked into wire wrapping, but I'm not sure if that will work or not. Any help would be appreciated; thanks! OldTimeNESter (talk) 12:48, 12 March 2014 (UTC)
- You mean like the "socket" shown here [1]? (It's confusing terminology, because the Gender_of_connectors_and_fasteners doesn't really apply here-- the "socket" has male pins, while the "plug" has female sockets...) If so, I'm not sure, but I think that something along these lines [2] might work. You may have to sand/whittle/shape the square heads to fit into the round holes surrounding the male pins on the socket. I wouldn't think you'd have to solder. See also here [3] for a NES socket that has breadboard pins. P.S. It probably doesn't matter much, but I'm curious, what is your goal? SemanticMantis (talk) 13:24, 12 March 2014 (UTC)
- I'm just trying to live out my childhood fantasy of playing with NES hardware :) I think the jumpers at [5] are what I'm looking for. I have something similar, but they are a bit too small, and I didn't know what they were called (I browsed the connectors at Jameco, and it was overwhelming). Thanks for your quick reply! — Preceding unsigned comment added by OldTimeNESter (talk • contribs) 15:48, 12 March 2014 (UTC)
- I must confess I don't know much about this, but I was also excited by the idea of NES hardware modding. You could potentially even work towards Tool-assisted_speedruns, though AFAIK those are usually accomplished in emulation. Btw, your original post is rather "eponysterical", as some of the kids might say :) SemanticMantis (talk) 19:06, 12 March 2014 (UTC)
- I'm just trying to live out my childhood fantasy of playing with NES hardware :) I think the jumpers at [5] are what I'm looking for. I have something similar, but they are a bit too small, and I didn't know what they were called (I browsed the connectors at Jameco, and it was overwhelming). Thanks for your quick reply! — Preceding unsigned comment added by OldTimeNESter (talk • contribs) 15:48, 12 March 2014 (UTC)
- You could get an NES cable with the right plug on one end. Then cut off the end you don't need and strip back the wires. Then get 7 pieces of thin solid core wire (paper clips will do) and attach them to the individual wires in the cables. You could solder these and it won't need to be a particularly neat job. Alternatively you could just twist them together. Warp everything up on insulating tape. Next use a multimeter or circuit tester to check connections and work out which pins go to which wire.
- Next you need to get a breadboard. You can plug you stamp into that and push the solid core wires into the corresponding places. Breadboard will make any circuits you need to build very easy.--Salix alba (talk): 14:45, 12 March 2014 (UTC)
Linux: Samba & Shared File Privileges
[edit]I have a Raspberry Pi that I recently got and am using as a server to display media on my TV. It has an external hard drive connected to it by USB which I am using to store the media on. Using Samba, I am in the process of transferring my media from my main Windows PC to the Pi's external drive. I have Samba set up fine and working, but I have a permissions problem. Whenever I copy over a file to the Pi, the file has no permissions which makes me unable to do anything with the file or display it on the TV until I chmod the permissions manually. I've tried creating a file mask in my smb.conf but either I'm doing it wrong or there is some other problem and I am not sure what it is. Here are my smb.conf settings for the share:
[Share]
path=/media/Media/Share
writeable = yes
browseable = yes
guest ok = yes
create mask = 111
What I'd like is for all the files and directories within the share to have read/write privileges to all users. It's just for my home network so I'm not really worried about anyone screwing with it. Thanks in advance for the help. -Amordea (talk) 17:47, 12 March 2014 (UTC)
- Is the problem that the pi-local player (XBMC?) can't access the file? If so, make sure that the files and the folder are owned by a group that the xbmc (or whatever) process is a member of. On my raspbmc install, that user is called "pi"; and it may be that the user the samba account is mapping your windows login to is "guest". Personally I use WinSCP for this job rather than samba. -- Finlay McWalterჷTalk 18:00, 12 March 2014 (UTC)
- Yes, the Windows machine has guest access to the samba share. Running ls -al on a transferred file, the default permission seems to only have execute permission for the user and no other permissions for anyone else. The user is set to 'nobody' and the group is 'nogroup'. I am using Raspbian, by the way, if that makes any difference. I had never heard of WinSCP before. May I ask why you prefer it over Samba? Maybe I'll switch. -Amordea (talk) 18:13, 12 March 2014 (UTC)
- It's really SCP/SFTP (secure file transfer over an SSH connection) rather than FTP (which is ancient, naff, and insecure). For many (but not all) uses I prefer it precisely because it doesn't involve setting up a samba server and client, and dealing with the inevitable weirdnesses of mapping windows users and their permissions to unix users and theirs. It's also much safer and easier to use across an insecure network like the Internet. -- Finlay McWalterჷTalk 19:59, 12 March 2014 (UTC)
- You know, I do already use SSH for most of my remote computer management tasks within the network. I'd never used the SCP portion of that, but that isn't a bad idea. And I can use that client you mentioned to handle Windows' support of it. That's actually sounding pretty good. I will give that a try. Thanks for the tip! -Amordea (talk) 20:16, 12 March 2014 (UTC)
- For the home media serving thing, I have a linux box with an ssh server (so you already have that on your little raspian) and watch media using XBMC on various Linux, Windows, and Android devices, all getting the media on via ssh/sftp. So I don't need samba for anything. Unlike you my linux file server is a beefer machine and I use the Raspberry Pi to run XBMC, which allows an ordinary TV to become another networked media player (but there's no reason why I couldn't have it be both server and XBMC too). All of this turned out to be extremely easy and I'm super happy with the results. -- Finlay McWalterჷTalk 20:52, 12 March 2014 (UTC)
- I haven't tried XBMC yet. Figured I'd go with a Debian-based distribution for starters since that is what I'm most familiar with (my other Linux device is a netbook upon which I've installed Lubuntu). I've heard good things about it so I when I'm feeling more experimental, I'll probably give it a try to compare to how I like it as a media server.
- But I do have a question for you: I have an Android device too and I would like the freedom I've had with samba to pull files from the network with it as well. What do you use on your Android device to make that work in lieu of samba? -Amordea (talk) 21:08, 12 March 2014 (UTC)
- XMBC is (in this case) a player (and browser) not a server. You can install it on Windows, Linux, and Android, and you wouldn't need to change the existing Raspbian install you have now. I believe there are some programs that allow samba mount on Android, but I've never used one. The Linux->ssh->xbmc combination solves all my problems already. -- Finlay McWalterჷTalk 21:33, 12 March 2014 (UTC)
- Oh, I meant without samba. I don't use samba on the phone (I suspect it would cause a wakelock issue if I did), but I take advantage of the fact that my other computers have samba/shared folders that I can yank content out of using a file manager to put on the phone if I prefer to take some media files with me to watch/listen/read on the go. I could use Google Drive for this purpose, I guess, but that seems to me a workaround at best and would require me to first upload to Drive, then download to my device. I'd rather be able to pull the media off the networked drive in one step. Can I do that with SCP/SFTP? -Amordea (talk) 21:52, 12 March 2014 (UTC)
- I've only streamed media over ssh to android. I haven't copied other kinds of files to android that way. You can get SCP/SFTP clients for android too, allowing you to copy a file from an SSH server and store it on the Android device - but I've no experience of doing that. Incidentally XBMC (I don't have shares in it, honest) will also stream from an SMB share too, as well as a ludicrous range of other protocols (NFS, UPnP, AFP, http, webdav). -- Finlay McWalterჷTalk 22:14, 12 March 2014 (UTC)
- I will look into this. Just knowing it is possible is good. Pretty sure I can figure it out. Thanks so much for all the answers there! -Amordea (talk) 22:25, 12 March 2014 (UTC)
- I've only streamed media over ssh to android. I haven't copied other kinds of files to android that way. You can get SCP/SFTP clients for android too, allowing you to copy a file from an SSH server and store it on the Android device - but I've no experience of doing that. Incidentally XBMC (I don't have shares in it, honest) will also stream from an SMB share too, as well as a ludicrous range of other protocols (NFS, UPnP, AFP, http, webdav). -- Finlay McWalterჷTalk 22:14, 12 March 2014 (UTC)
- Oh, when I bothered to look it up, I see that it's an FTP client. I hadn't considered using FTP for this before, though I am also not terribly familiar with FTP either.
- I'm also just curious about how Linux permissions work in general. It bothers me that I don't know the reason why this is occuring. Although based on what you've said, perhaps it's just using the default mask for the 'nobody' user to set permissions? In which case, guest access is going to be a problem.
- But I would prefer not to have to enter a password every time I want to use my share. How could I set this up so that everyone can access this share freely and with read/write permission be the default for all users accessing that shared folder? -Amordea (talk) 18:46, 12 March 2014 (UTC)
- Normally you wouldn't have the samba guest account be able to write (the idea is that it's just reading media files), which is why its "nobody". You could:
- set guest account = pi (or some other real account) rather than nobody in smb.conf. I've never done this, and I honestly don't know whether that will insist on a password
- use a named account (e.g. pi) when making the samba connection to write (which is a much rarer event than playback) and the guest just to read
- set a cronjob to periodically chown and chmod (both recursively) the media folders (but this is a hack)
- -- Finlay McWalterჷTalk 21:27, 12 March 2014 (UTC)
- Normally you wouldn't have the samba guest account be able to write (the idea is that it's just reading media files), which is why its "nobody". You could:
- So I tried inserting guest account = pi into the smb.conf but it seemed to have no effect. But I did notice a curious thing. First I tried it without the mask and so I was initially led to believe that it was doing something since the permissions changed, however the user/group remained nobody/nogroup. So I realized it was the create mask code that was having an effect...just not the effect I anticipated. To my knowledge, a mask of 111 should yield r/w permissions to all users.
- I suspect this is clashing with another mask and producing some weird results. Without the mask, the permissions are r/w for the owner and read-only for everyone else. So I guess the initial mask must be 133? Probably for the nobody user if I'm guessing this right?
- I am still leaning towards not using samba for this purpose anymore, but this is very curious and I'd like to know why this is happening. -Amordea (talk) 22:11, 12 March 2014 (UTC)
- force create mask = 666 in the smb.conf ends up doing what I originally wanted it turns out (which I assume just ignores whatever other mask is causing the issue). I didn't really know how to phrase my original question into a Google Search since there were a lot of parts to the problem and I didn't know what was going wrong exactly. But I'm glad I asked here anyway. Thanks for all the help, Finlay! -Amordea (talk) 23:08, 12 March 2014 (UTC)
Making a keyboard key not function (intentionally)
[edit]The keyboard I use for my macmini at work has a "help" button – it's the key just below the F13 button. I constantly hit it by accident and when I do and I'm in word, or in excel it pops up this "word help" or "excel help" window and asks me if I want to "stay offline" or "go online" (I have no use for this and it's intrusive). I know I can pop the button off the keyboard, but I would much rather find a software solution – a way to turn that button off; make it non-functional. I went into system preferences, keyboard, and explored but did not see a way. Anyone know of a way?--71.167.166.18 (talk) 17:57, 12 March 2014 (UTC)
- This is the kind of thing that is usually accomplished with 3rd party tools, since there isn't a ton of native support. I haven't used it, but it looks like this product should do what you want [4]. SemanticMantis (talk) 19:10, 12 March 2014 (UTC)
- Fix. 70.174.141.142 (talk) 21:46, 12 March 2014 (UTC)
- Some users hate the looks of keys popped off. (I don't; I remove the Sleep / Power keys of many modern keyboards and the caps lock key regularly) This fix doesn't involve software but you might find it visually appealing:
- Get a plastic dust cover, and cut the cover of a single key, or a row (Windows example: the 3 Sleep / Power / Wake up keys) you want to disable. Cut a cover which is slightly bigger than the key(s) so you can tape it to the keyboard.
- Scotch-tape that to the individual key(s) or the keyboard itself so that it covers the key(s) in question.
- Unfortunately, some keys are hard to cover, and not every dust cover is a tight fit. It won't work well with keyboards if the keys don't stand out much, either. Still, I use this if certain keys become "dangerous" and I want to disable them temporarily, like the ESC key in StarCraft, which cancels production. - ¡Ouch! (hurt me / more pain) 06:37, 17 March 2014 (UTC)
- Some users hate the looks of keys popped off. (I don't; I remove the Sleep / Power keys of many modern keyboards and the caps lock key regularly) This fix doesn't involve software but you might find it visually appealing:
- There are keyboard remapping programs that will either give a key another function or no function at all. I used one of these programs to turn off my kaps lock key, which I hate. Look in the archives from Feb 2013 or before and youl find the thread. I no longer user the computer I have that prorgam on, but can find it in return for a barnstar if necessary. μηδείς (talk) 07:16, 17 March 2014 (UTC)