Jump to content

Wikipedia:Reference desk/Archives/Computing/2012 June 28

From Wikipedia, the free encyclopedia
Computing desk
< June 27 << May | June | Jul >> June 29 >
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.


June 28

[edit]

Free for use (including commercial) Unicode fonts supporting large numbers of high space symbolic glyphs, OS X

[edit]

Can people recommend free for use (including commercial use) Unicode fonts that support many or most of the non-language based symbols, particularly the more recent additions, that are suitable for use on OS X? Fifelfoo (talk) 03:44, 28 June 2012 (UTC)[reply]

Could you clarify what characters you want to have displayed? It's not really clear from what plane you are interested in. However, there is an article on Wikipedia that might help - Unicode font. - Letsbefiends (talk) 04:02, 28 June 2012 (UTC)[reply]
  • Plane 0:
  • Symbols (2000–2BFF)
  • Supplemental Punctuation (2E00–2E7F)
  • CJK Symbols and Punctuation (3000–303F)
  • Yijing Hexagram Symbols (4DC0–4DFF)
  • Plane 1
  • Ancient Symbols (10190–101CF)
  • Byzantine Musical Symbols (1D000–1D0FF)
  • Musical Symbols (1D100–1D1FF)
  • Ancient Greek Musical Notation (1D200–1D24F)
  • Tai Xuan Jing Symbols (1D300–1D35F)
  • Mahjong Tiles (1F000–1F02F)
  • Domino Tiles (1F030–1F09F)
  • Playing Cards (1F0A0–1F0FF)
  • Emoticons (1F600–1F64F)
  • Transport And Map Symbols (1F680–1F6FF)
  • Alchemical Symbols (1F700–1F77F)
And such forth with symbols maintained for legacy purposes in Plane 0's ASCII mapping equivalents (Basic Latin). Ideally a unified font would be available in the standard roman, bold, black, italic, slant, etc; in sans, serif, semi and mono. But at the moment I'd like to ensure I get fallback support for everything symbolic. Fifelfoo (talk) 04:29, 28 June 2012 (UTC)[reply]
That could be... interesting. Best I can think of is Free UCS Outline Fonts, but even there I think it won't handle everything. If you could edit the font and merge several together, it might work. Never tried it personally! - Letsbefiends (talk) 04:38, 28 June 2012 (UTC)[reply]
I believe that OS X can "fall back" glyph by glyph if required, if not then at least I can make use of random other fonts on a per use basis. Free UCS Outline covers everything except emoji, alchemy and mapping symbols (per our article). Which means I'm really down to coverage of 1F600–1F77F required. Fifelfoo (talk) 04:44, 28 June 2012 (UTC)[reply]
In that case, then try the Symbola font. Emoticons, Transport symbols and Alchemical symbols are all supported. - Letsbefiends (talk) 06:04, 28 June 2012 (UTC)[reply]
Forgot to mention that all the Emoji symbols seem to be covered in the Miscellaneous Symbols And Pictographs Block. - Letsbefiends (talk) 06:08, 28 June 2012 (UTC)[reply]

http://www.alanwood.net/unicode/fonts.html ¦ Reisio (talk) 07:07, 28 June 2012 (UTC)[reply]

Why are there constraints on passwords?

[edit]

Most sites with a user login place constraints on the chosen password (e.g. "contains at least one capital, one lowercase, a digit and a symbol", "longer than x characters", etc.) My thinking was that passwords have so many constraints would be less stronger than these with total freedom. Can someone please explain? thanks. Gil_mo (talk) 06:27, 28 June 2012 (UTC)[reply]

It depends on the constraints. From my POV, I would say that the worst constraint would be to keep the number of characters to a certain length. If you allow for a larger number of characters in the password, and you don't have a ridiculous constraint like "you can only use the letter x as your password, and your password can be only between 100 to 105 characters long" then this would help with password strength. - Letsbefiends (talk) 06:37, 28 June 2012 (UTC)[reply]
Yes, the obvious requirement for "at least one ...." and "at least six characters" is designed to increase password strength (for those people who use "me" or "password" or just a word from the dictionary), but I'm surprised that so many sites (and "Windows"), limit the number of characters. I often have to truncate the longer passwords I use. Dbfirs 06:49, 28 June 2012 (UTC)[reply]
On the plus side (for the individual, but a negative for the world as a whole :p) a lot of the checking for that stuff is in JavaScript alone and has no server-side fallback, so you can frequently simply disable JS and use an unconstrained password. :p ¦ Reisio (talk) 07:11, 28 June 2012 (UTC)[reply]
I'd highly recommend against doing that. How do you know that the backend programmer did not assume, for the entirety of his code, that the password is a valid length, and that a long password would make it behave incorrectly? It's definitely bad code to rely on client-side JS for all input validation, but plenty of people write bad code. --140.180.5.169 (talk) 17:30, 30 June 2012 (UTC)[reply]
Related article: Password strength. Mitch Ames (talk) 11:09, 28 June 2012 (UTC)[reply]
The issue in question is whether the password can be tackled via a brute force attack. What you're really trying to do is add entropy to the system — more possibilities for passwords — to overwhelm a brute force attack. Of all of them, though, length is probably the most important, and it has been noted in many cases that trying to artificially add entropy by requiring numbers, capitals, etc., often ends up with passwords that are hard for the individual user to remember that aren't actually very hard to crack. They also lead to high amounts of password reuse across systems (in which case the weakest link compromises all log-ins) and can lead to other unsafe practices like writing the password down on sticky notes attached to their monitor. I've personally been quite irritated with sites that purport to care a lot about security (a bank I once belonged to, for example) requiring extremely short but unintuitive passwords (maximum length of 8 or something like that), when I personally prefer using passphrases (short sentences usually taken at random from a book I have around here) for their ease of remembering plus length. --Mr.98 (talk) 11:24, 28 June 2012 (UTC)[reply]
I am no expert so forgive my musings on this matter. Restrictions seem to come from an understanding that the more "tricks" included, the less easy it is to crack the code. We all know that this might not actually work, but it's a good place to start. If you allow a user free reign they might just use "password" or "wikipedia123". If you constrain them to 6 characters they might use "passwo" as much as they might use "XyU4*M". doktorb wordsdeeds 11:48, 28 June 2012 (UTC)[reply]
But as soon as you stop them using "passwo", and make them use "XyU4*M", they will write it down. HiLo48 (talk) 11:51, 28 June 2012 (UTC)[reply]
Bruce Schneier, probably the only recognizable name in "security" for most of us on WP:RD/C, advises that you do indeed create gibberish passwords, write them all down on a piece of paper, and stick the piece of paper in your wallet. Comet Tuttle (talk) 16:10, 28 June 2012 (UTC)[reply]
(edit conflict) Though in many cases they just use Password1 or theirName79 where 79 is the year of their birth. Or, as one guy I worked with did, he made almost every password he used "nameofthesite1!" Which isn't such a bad password unless you figure out the system. People have bad security practices. Remember that you're not really trying to fool actual people — you're trying to fool computers by making it so that instead of just having to check aaa, aab, aac, aad, and so on, they also have to check aab1, aab2, aab3. It superficially seems like adding numbers and capitals and symbols would add so much extra effort that it would be impossible, but computers can check thousands and thousands of passwords per seconds on poorly secured systems. (On hash cracking—where a hacker had downloaded a poorly encrypted list of passwords from a website, as occasionally happens even with major sites—clever programs can allow even just off-the-shelf computers to crack billions of hashes per second. Which means that all 6 letter passwords, even with capitals and numbers, can be cracked in under a minute, and 7 letters in about an hour.) Adding length drastically increases the amount of "work" necessary, much more so than requiring capitals and numbers and all that. --Mr.98 (talk) 12:00, 28 June 2012 (UTC)[reply]
Here's a WSJ blog post about the most popular passwords on the Gawker Media websites, a piece of data revealed when somebody simply stole the whole password file (architected by someone who was not a security expert, apparently) and posted it somewhere. The passwords like "12345678" are reflections of the requirement that passwords be at least 8 characters long. People presumably use these easy-to-remember passwords for sites like Gawker, where the user doesn't care at all if someone steals the password, as opposed to their bank passwords. Comet Tuttle (talk) 16:14, 28 June 2012 (UTC)[reply]
Just as an aside, your e-mail password is more important than your bank password... because if you have access to someone's e-mail account, you can usually get their bank password and everything else with a "reset password" option. (And most of the "security questions" are pretty easy to figure out if you can get access to their Facebook etc. accounts — name of elementary school, etc.) Your e-mail is usually the skeleton key to your online identity. --Mr.98 (talk) 17:40, 29 June 2012 (UTC)[reply]
Your e-mail account won't get access to your bank password if your bank's security is any good. I have accounts with two of the big four banks in Australia and with Bankwest, and none of them will e-mail any sensitive information ("forgotten" passwords or any other account information), ever. Anyone silly enough to give real answers to the security questions "deserves" to get hacked. All of my answers to such questions, like my passwords (but not the same values!) are long random sequences stored in Password safe. Mitch Ames (talk) 10:14, 4 July 2012 (UTC)[reply]
Most of the constraints you mention ("contains at least one capital, one lowercase, a digit and a symbol") are totally useless. See this cartoon which sums it all up. Joepnl (talk) 21:42, 1 July 2012 (UTC)[reply]

Sed

[edit]

Can you use the same file as input and output to sed simultaneously?
The standard example used is something like
sed (parameters) < old > new
But I want to do it in place, as in
sed (parameters) < file1 > file1

Thanks, Rojomoke (talk) 14:40, 28 June 2012 (UTC)[reply]

I see from the article that this feature is present in modern versions. I guess I'll just have to try it and see. Rojomoke (talk) 14:43, 28 June 2012 (UTC)[reply]

Filenames with spaces in Linux

[edit]

On my Linux system, I have a directory containing image files with spaces in their names, such as (for the sake of example) image 1.jpg, image 2.jpg, image 3.jpg and so on. I'd like to list them all in a text file, say images.txt and then view them all in a graphics viewer, such as Eye of Gnome, by giving that file as an input with eog `cat images.txt`. However, when I tried to do it with this kind of text file:

image 1.jpg
image 2.jpg
image 3.jpg

it didn't work. Then I tried with this kind of text file:

"image 1.jpg"
"image 2.jpg"
"image 3.jpg"

and it didn't work either. Is there any way to do this? JIP | Talk 19:33, 28 June 2012 (UTC)[reply]

In python:
 python -c "import subprocess; subprocess.call(['eog'] + [x.strip() for x in open('images.txt')])"
-- Finlay McWalterTalk 20:38, 28 June 2012 (UTC)[reply]
cat images.txt | xargs -d \\n eog
Filenames may contain newlines too, so this isn't %100 foolproof. --80.112.182.54 (talk) 00:25, 29 June 2012 (UTC)[reply]
Ah, thankyou. I knew someone would come along with an xargs solution, but I just couldn't get the darn thing working (resorting to perl or python for trivia like this is a defeat). Silly me was doing xargs -d \n eog without the 2nd slash. -- Finlay McWalterTalk 00:30, 29 June 2012 (UTC)[reply]
OK, the xargs command works. Thanks! JIP | Talk 05:00, 29 June 2012 (UTC)[reply]

accidently replaced old image for new, can't find the old

[edit]

Hello, I tried to save a picture from the Internet, but the computer told me that there was aleady a picture with the same name, and asked if I want to replace the existing image with the new image or cancel the operation. Accidentally clicked on OK (image replacement) and now I can not find the old picture, not even in the Recycle Bin. Does anyone know where is the old image or how you can cancel the operation? Thanks in advance, Nadav — Preceding unsigned comment added by 79.181.142.251 (talk) 20:25, 28 June 2012 (UTC)[reply]

If you don't have a backup of your data, then you've lost the first image, fullstop. The old image is not deleted and does not find its way into the recycle bin; rather, you've told the computer to put the contents of the new image into the old image filename, and the computer had dutifully done that. --Tagishsimon 20:30, 28 June 2012 (UTC)[reply]
There is just a chance (but don't rely on it) that if the new image was larger than the older one then the disc operating system might have decided to use new sectors rather than writing over the old ones. In this case, if you haven't written anything else to the disc, then image recovery software might, just possibly, be able to recover your old image. The more you use your disc, the less likely this becomes. I'm not sure whether it is worth the effort of disconnecting the disc drive, connecting it to another computer as a spare drive, and running recovery software. The most probable result is that you will find the image was overwritten, as stated above. Dbfirs 21:59, 28 June 2012 (UTC)[reply]

Mysql query help

[edit]

Hi Wikipedians,

So i have two tables i am using for a customizable survey form I am making, "data" and "meta":

data looks like:

id field1 field2 field .. field N
1 Blaise Pascal Address more values
2 Alan Turing His address Example
3 another first name another last name Example Example

while meta looks like

name display text
field1 First Name
field2 Last Name
field.. whatever
field N more display text

So what I need help on is how do I make it like "Select field1 as whatever_the_display_text_is_on_the_meta_table, field...N from data?". In other words I want the column headers from data to be substituted by their respective equivalent from the meta table.

Thanks in advance PrinzPH (talk) 20:38, 28 June 2012 (UTC)[reply]

There is no way of doing that in standard SQL. - Letsbefiends (talk) 01:21, 29 June 2012 (UTC)[reply]
That is an objectively awful way of structuring your database. Why don't you just set the column names in Table 1 properly and be done with it? If you need a new column, just add one. If you have some vitally important reason to do it this way (I can think of NONE), then your best bet is to swap in the column titles via whatever your page code is after you pull the query data. That's trivially easy using an associative array. Seriously though, cease and desist this madness at once. The Masked Booby (talk) 02:51, 29 June 2012 (UTC)[reply]
I can think of reasons to do it this way (the OP is clearly trying to make some kind of infinitely flexible database system — I might caution that most systems need a lot less flexibility than that, and you can add flexibility by just modifying the tables in SQL themselves, which is probably easier than doing it this way), but I agree it's not ideal. You can't do this with pure SQL, you're going to have to mix a lot of SQL with other languages to get the kind of functionality/flexibility you want. --Mr.98 (talk) 03:25, 29 June 2012 (UTC)[reply]
Considering the OP's approach is stock material for DBA horror stories, I am earnestly interested to hear your reasonable use cases. The Masked Booby (talk) 07:07, 29 June 2012 (UTC)[reply]
They're just trying to allow you to add arbitrary numbers of fields without modifying the database structure itself. Nothing inherently stupid there, but just a pain in the ass to implement. --Mr.98 (talk) 17:37, 29 June 2012 (UTC)[reply]
Certainly that much is clear. But what I thought you were implying is that there are situations where this is a good idea. Personally, I don't know of anything that justifies the pain of this method, and am interested to hear of use-cases that would. The Masked Booby (talk) 22:38, 29 June 2012 (UTC)[reply]
Please, please, please do not use an EAV. That way madness lies. - Letsbefiends (talk) 06:03, 29 June 2012 (UTC)[reply]
Write a procedure to select 'display text' from meta, compose a 'create temporary table' statement with column names as data fetched from meta, execute statement, insert into the temporary table all the records from data table, and select * from temporary table. manya (talk) 03:59, 4 July 2012 (UTC)[reply]
Thanks for are the responses. Mr. 98 was right. Yes, I was trying to make a scalable survey system wherein they could add an arbitrary number of fields which would then display as form elements. I worked around this using php (separate queries). I guess I really should rethink my strategy in the long run too. Your inputs have been helpful. Thanks again wikipedians you are all super! PrinzPH (talk) 05:32, 4 July 2012 (UTC)[reply]

Accent over two letters

[edit]

I'm trying to quote a dictionary definition, and the pronunciation given has an accent mark over two letters. Specifically, it looked like something directly in-between "áa" and "aá." Middle instead of left or right. Is there any way to replicate this in, e.g., a forum post? I can't find anything in Unicode that could permit this. Not a single character for "aa" (like there is for "ae") or an in-between combining diacritic. Obviously, the dictionary writers had to have typeset it somehow, and computers were probably involved... but is there any way for me to replicate it? --Shay Guy (talk) 22:15, 28 June 2012 (UTC)[reply]

A "forum post" makes things a lot more tricky. Kerning and typesetting depend on the font, application, operating system, and loads of other factors; so even if you found an appropriate set of standard unicode letter-spacing marks and an acceptable diacritic mark, it's nearly impossible to guarantee that the glyphs on your screen are similar at all to the glyphs on my screen, let alone anyone else's. Here's a place to start: Unicode phonetic symbols - spacing modifier letters, and combining character marks. Again, let me stress this strongly - there are about 900 million Unicode-standard-compliant ways to exactly specify the kerning you want with combining-characters and diacritics and letter glyphs, but that does not mean that people will see the correct rendering (or anything at all) on their screens. If you must have pixel-accurate glyphs, you need to use a graphical typesetter and rasterize a bitmapped image of the typeset text.
As an example, here's a unicode "a", followed by a combined diacritic, followed by another unicode "a." a̛a (in hex, a four-byte sequence 0x61 0xCC 0x9B 0x61), which renders as two glyphs, plus an accent mark glyph, in Firefox on my operating system, reading those as UTF-8.
Here is a nice reference for many combining marks and precomposed equivalents. Nimur (talk) 23:14, 28 June 2012 (UTC)[reply]
[edit]

When I search Google Books from a non-English speaking country I find it will force that country's domain on me at the Search inside book stage, despite my using a few tricks that work for Google Web search. US-based proxies work, but I do not really want to use them. Has anyone a solution that does not involve too much software (userscript in javascript would be Ok)? I may resort to writing a userscript myself but I am out of practice.

I have already looked at Wikipedia:Reference_desk/Archives/Computing/2011_August_12#Google forces its localized domain on me, but that concerns Google Web Search. I have also looked for clues at [1] but that admits to only dealing with Web search too.

Here is an example: I know there are pages in Great economists since Keynes containing "Harvey Leibenstein"; I clear all cookies and start with http://www.google.com/ncr; I browse to http://books.google.com/bkshp?hl=en&tab=wp&ncr=1 which takes me to http://books.google.com/bkshp?hl=en&tab=wp&ncr=1 ; I enter the book name and click Search and get to http://www.google.com/search?q=Great+economists+since+Keynes&btnG=Search+Books&tbm=bks&tbo=1 ; I add "&ncr=1&hl=en" to that URL and browse to it but when i click the first result I see google has redirected to the local domain and any search results in the local language; I also tried constructing the URL "http://books.google.com/books?id=oKG2AAAAIAAJ&q=Great+economists+since+Keynes&dq=Great+economists+since+Keynes&cd=1&ncr=1&hl=en" but Google still redirected to local.

I have tried both Firefox and Opera and both logged in and out of my Google account. Any help much appreciated. 84user (talk) 23:47, 28 June 2012 (UTC)[reply]

Update I found that using a non ".com" google site, such as books.google.co.uk or books.google.de somehow prevents Google Books from localising (I am not in either of those countries). That is at least a workaround I can use - just avoid using the .com domain. -84user (talk) 00:21, 29 June 2012 (UTC)[reply]
I'm in the Netherlands, using Chrome, and I don't have this issue. Is your browser requesting the correct language? Look for language headers at http://myproxylists.com/my-http-headers to check that. --80.112.182.54 (talk) 00:41, 29 June 2012 (UTC)[reply]