Wikipedia:Reference desk/Archives/Computing/2012 October 11#Text in php/html

{{#ifeq:{{PAGENAME}}|Special:Undelete| |{{#if:|

}} {{#ifeq:{{NAMESPACE}}|Wikipedia|{{#switch:{{NAMESPACE}}|= |
}}|{{error:not substituted|Archive header}}
}}}} {{#if:|
}}
width = "100%"
colspan="3" align="center" | Computing desk
width="20%" align="left" | < October 10

! width="25%" align="center"|<< Sep | Oct | Nov >>

! width="20%" align="right" |{{#ifexist:Wikipedia:Reference desk/Archives/Computing/2012 October 12|October 12|Current desk}} >

align=center width=95% style="background: #FFFFFF; border: 1px solid #003EBA;" cellpadding="8" cellspacing="0"
style="background: #5D7CBA; text-align: center; font-family:Arial; color:#FFFFFF;" | Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is {{#ifexist:Wikipedia:Reference desk/Archives/Computing/2012 October 21|an archive page|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.

__TOC__

= October 11 =

Organisation history visualisation

I wanted to make a chart showing the history of far-left organisations in my area. Anyone remotely familiar with the subject will know that such groups quite frequently undergo repeated splits and mergers (for those not familiar, think the People's Front of Judea and its associated splinter groups in Monty Python's Life of Brian) .Is there any kind of software that would be particularly suited to creating this sort of visualisation? I wanted to end up with [http://www.cyberciti.biz/tips/linux-kernel-history-and-distribution-time-line.html something looking like this]. Obviously it would be possible to do in any basic image editing program, but I was wondering if there was specialised software for this sort of thing. --149.135.146.88 (talk) 09:33, 11 October 2012 (UTC)

{{collapse top|irrelevant discussion}}

:Clicking on your link pretty much took down my computer, so I assume it's some type of video. This seems unnecessary, to me. A simple slide show presentation would be less CPU intensive, and would make it easier for users to step through it, to whatever point they want. StuRat(talk) 15:17, 11 October 2012 (UTC)

::Uh? Mine or the OP's? The OP's is a blog post with a click-to-enlarge PNG file. Mine is a collection of 30+ thumbnails. Neither page did anything like taking down my computer. I'd suggest the problem's on your end, Stu. - Cucumber Mike (talk) 16:16, 11 October 2012 (UTC)

:::I placed my comment so as to make it obvious I'm talking about the OP's link. Yes, it was at my end, and I've since rebooted.StuRat (talk) 16:57, 11 October 2012 (UTC)

::::It remains impressive to me that you can blame the OP for your computer's problems, state quite baldly that you didn't see the page, make an assumption about what must have been on the page, criticize the page and/or OP (who can tell?) for doing it wrong (in your assumption), and offer up a non-sequitur of a suggestion for how to do it better based on your own misunderstanding of what the OP wants (an understand based, as you acknowledge, on your own computer's inability to let you see what they are linking to). What an utterly pointless exercise in foolishness, even by your standards.--Mr.98 (talk) 02:50, 14 October 2012 (UTC)

:::::This comment does not belong on the Ref Desk. StuRat (talk) 03:01, 14 October 2012 (UTC)

{{collapse bottom}}

:Maybe Graphviz could be what you're looking for. I've never used it myself, but [http://www.graphviz.org/Gallery.php here] are some examples of what it can do. - Cucumber Mike (talk) 15:08, 11 October 2012 (UTC)

Accumulated Double Declining Depreciation in Excel

The formula for computing double declining depreciation in Excel is relatively straightforward:

DDB(Cost, Salvage Value, Useful Life, Current Period)

So, for example, DDB(80000,8000,5,3) gives you 11520, the depreciation in year 3.

However, I cannot find a function that will give me accumulated depreciation (ie, the total amount of depreciation in previous periods, and the current one). In the above example, the answer would be 62720, which is basically DDB(80000,8000,5,1)+DDB(80000,8000,5,2)+DDB(80000,8000,5,3). Is there any way I can easily and automatically compute total accumulated double declining depreciation to date? ΣΑΠΦ (Sapph)Talk 12:11, 11 October 2012 (UTC)

:You can use VDB to calculate over an arbitrary period, so you can set the start period to 1 and the end period to the period you want total depreciation on. [http://office.microsoft.com/en-us/excel-help/vdb-HP005209334.aspx?CTT=3 VDB Documentation]209.131.76.183 (talk) 12:27, 11 October 2012 (UTC)

Problems burning a CD-R: On The Fly error

I'm trying to create a backup copy of a software CD and I keep getting the error message "Could not complete the On-The-Fly disc copy process.". Here's the log data:

User Name : Windows User

Company Name : CyberLink

CDKey : REDACTED

OS Version : Windows 7 Home PremiumService Pack 1

C:\Program Files (x86)\CyberLink\Power2Go\Power2Go.exe : Version 6.1.0.3802

CBS.dll : Version 7.7.4810

:==================================================================

Total physical memory : 3563MB (3649400KB)

Free physical memory : 2181MB (2233952KB)

Memory load : 38 percent

Number of CPU : 4

CPU Name : AMD A6-3420M APU with Radeon(tm) HD Graphics

CPU Speed : 1497 MHz

:==================================================================

11.10.2012

Task Type : Copy Disc

09:31:50, File(cl_DiscCopyCD.cpp), Line(90)

-> Begin burning process

Current drive:

Current writing speed(x): 32.0

====== Disc Info =======

Disc Type: CD-R

Disc Status: Blank, Appendable

Num. of Sessions: 1 Num. of Tracks: 1

Disc Capacity: 336223LBs

Free Size: 336223LBs Used Size: 0LBs

========================

->Burn on the fly

Current reading speed(x): 16.0

Burn option: w/ buffer underrun protection

Burn option: w/o simulation

Burn option: w/o overburn

Burn option: w/ verify disc

Burn option: w/o extra long disc

09:31:55, File(cl_Cdwrite.cpp), Line(2697)

-> Setup drive

Sessn: 1, Sessn type: Disc At Once

Disc physical format: CDROM_MODE1

Trk: 1, Trk mode: MODE1

09:31:55, File(cl_Cdwrite.cpp), Line(1966)

-> Start session

Sessn: 1, Start trk: 1, Last trk: 1

09:31:55, File(cl_Cdwrite.cpp), Line(1992)

-> Start track

Trk: 1, Track start addr(LBA): 0, Trk size(sectors): 303348, Sector size(bytes): 2048

09:32:27, File(cl_Cdwrite.cpp), Line(2430)

-> Write end/Close disc

Burn option: w/ close disc

Burn mode: DAO

09:32:27, File(cl_DiscCopyCD.cpp), Line(935)

-> Burning Fail, ErrCode: 0xeb020b88

:==================================================================

Error Code : 0xeb020baf

Any clue why it's doing this? 199.241.185.195 (talk) 13:48, 11 October 2012 (UTC)

:Usually the best way to solve problems like this is to Google for the error message. When I do so, I quickly see the following on a site called TechBlog: "If you ever see the error 'Burning Fail, ErrCode: 0xeb020b88' then I've found the solution today; Turn down the write speed of the CD-R / DVD-R drive to a lower setting and this seems to do the trick.". Looie496 (talk) 14:52, 11 October 2012 (UTC)

::Of course that's basically how you fix any error at all with burning. ¦ Reisio (talk) 02:56, 12 October 2012 (UTC)

A simpler solution is to dd the existing CD to a file as a backup, and read it in future with something like [http://www.ltr-data.se/opencode.html/#ImDisk ImDisk] or otherwise mounting as a loop device. ¦ Reisio (talk) 02:56, 12 October 2012 (UTC)

Thumbs.db

I've copied content from computer to computer for the last seven years, and whenever I backup my Windows 7 computer's hard drive, I notice the existence of multiple thumbs.db files. I've read Windows thumbnail cache, but just to be sure, I wanted to ask — do I understand rightly that deleting these images should have absolutely no effect on my system? I'm not going to waste time finding them to delete them, but I've always been mildly concerned when I get a note warning me that a thumbs.db file won't properly copy from place to place. Nyttend (talk) 16:00, 11 October 2012 (UTC)

:Yes, it's fine to delete them. If there is a Thumbs.db file, Windows will display thumbnails from its cache. If there isn't, it will regenerate the cache. — cdwn 16:46, 11 October 2012 (UTC)

::"Absolutely no effect" is a very strong term. By removing the thumbnail cache, you're incurring a non-zero amount of extra work for the system'sexplorer.exe process, who will re-generate the cache at some point in the future. Now, I'll be the first to admit that this is usually pretty trivial, and in most normal cases, this extra processing load should be, in practice, indistinguishable from zero extra work; but computers are very precise machines, and for the sake of precision, it's usually best to refrain from "absolute" statements. Nimur (talk) 16:58, 11 October 2012 (UTC)

:::Actually, it won't be anywhere close to "indistinguishable from zero extra work" in practise. Image processing is a fairly involved business. —cdwn 17:07, 11 October 2012 (UTC)

::::Oh, I see; the article's comments about other forms of image thumbnailing in Windows Vista and Seven made me think that thumbs.db wasn't even used by my operating system. Nyttend (talk) 17:19, 11 October 2012 (UTC)

:::::Sorry, you are correct; if you are deleting Thumbs.db files from disks originally mounted in Windows XP, and then if you're only using them on Windows Vista or Windows 7 (or newer), the thumbs.db files need not be re-created in each directory. (Recent Windows versions use a centralized database for the thumbnails, as explained in our article and elsewhere on the web). I apologize if I've confused the issue, I mis-read your problem-statement. Nimur (talk) 03:02, 12 October 2012 (UTC)

ls -d in linux

Shouldn't ls -d show me the directories in a directory? (it shows .) Why is it like that? OsmanRF34 (talk) 17:05, 11 October 2012 (UTC)

:I think you misunderstand how ls operates at a low level. You can see what it is supposed to do here:

$ cd "$(mktemp -d)"

$ mkdir foo bar baz

$ tee foo/a bar/b baz/c < /dev/null

$ ls *

bar:

b

baz:

c

foo:

a

$ ls -d *

bar baz foo

:If you truly want to list the directories, you want ls -d *, or something like the following:

( shopt -s nullglob dotglob ; for dir in *; do -d "$dir" && printf '%s\n' "$dir"; done )

:As for why it is like that, it seems expected to me. ls with no files in its arguments runs ls on the current directory. ls -d with no files in its arguments does the same with .. cdwn 17:13, 11 October 2012 (UTC)

::ls -d * lists all files in the current directory, not just directories. ls -d */ is better.—Emil J. 14:15, 12 October 2012 (UTC)

:::That's not true, it will only list directories (and */ is not defined by POSIX). — cdwn 04:23, 15 October 2012 (UTC)

::::Did you actually try it? -d means "if a directory is listed on the commandline, print its name rather than recursing into it." It has no effect on the behaviour for non-directories. Try it and see. Marnanel (talk) 04:25, 15 October 2012 (UTC)

:::::Sorry, I misread the comment. Either way, as far as I know */ is only defined in POSIX as a symlink dereference. — cdwn 12:51, 15 October 2012 (UTC)

An alternative might be find . -maxdepth 1 -type d ¦ Reisio (talk) 07:20, 12 October 2012 (UTC)

:Does this not work in linux? (sorry I can only test in Solaris): ls -l|grep ^d Sandman30s (talk) 13:36, 12 October 2012 (UTC)

::It works, though my shell insists that I quote the ^.—Emil J. 14:15, 12 October 2012 (UTC)

Text in php/html

I have a website (php/html) and would like to translate it with poedit. In order to do so I need to write all texts (which are displayed on the site) as: . Are there any tools/scripts that help me to find all such "text" in an html file or that find any non-replaced text?bamse (talk) 19:33, 11 October 2012 (UTC)

:There are a variety of Linux tools that claim to do that. Would that be helpful to you? If so, try googling for "html2po". I'm not sure what will happen to your php code, though. Looie496 (talk) 23:45, 11 October 2012 (UTC)

::Thank you. bamse (talk) 06:27, 12 October 2012 (UTC)

:I would just note that in your case, it looks like the script may already be trying to be internationalized and has some of that already built in. The _('Text') formatting often means, "I have created a function named underscore, which checks this text against a localization table, and then returns whatever the equivalent is for whatever the language settings are." (This is how Wordpress, among other platforms, does localization.) You might poke around to see if there's an easier way than the way you are approaching it — the text may already be in a file, somewhere, either translated or in a format that's easy to translate without modifying the original. --Mr.98 (talk) 12:29, 12 October 2012 (UTC)

::Not sure I understand what you mean. I don't have that _('Text') formatting yet in my html files. I am looking for an automatic way to add this formatting. After that, gettext will do the rest. bamse (talk) 20:38, 12 October 2012 (UTC)

:::Ah, I understand now. I misunderstood before. I thought you were trying to modify code that was already gettext'd. --Mr.98 (talk) 00:31, 13 October 2012 (UTC)