Wikipedia:Reference desk/Archives/Computing/2008 July 22

= July 22 =

Installing .deb with dependencies
Hi people, I was trying to install a .deb file in ubuntu, with "dpkg- i somefile.deb" but it won't install because it has dependencies not installed, now my question is: Are there any other parameters for dpkg that will automatically download and install all dependencies required for a deb file? PS: Sure doing this the graphical way would be easy, but I need it to be in command line mode... SF007 (talk) 01:03, 22 July 2008 (UTC)
 * You can use the "gdebi" command on the command line, which is the text version of the graphical gdebi program that usually runs when you double-click on a .deb in the GUI. --Spoon! (talk) 02:05, 22 July 2008 (UTC)
 * Worked exactly like I wanted! many thanks! SF007 (talk) 04:17, 22 July 2008 (UTC)

linear and nonlinear Quantization?
I wat to know about the Linear and nonLinear Quantization in digital Audio?please give me the answer... —Preceding unsigned comment added by Lakshmanpagolu (talk • contribs) 03:53, 22 July 2008 (UTC)


 * see Digital audio, Quantization (sound processing) and dictionary definitions of 'linear' and 'non-linear' may be useful too.
 * An an example CD audio is linear quantised - if you can get an understanding of linear quantisation, it should be easy to work out what non-linear quantisation is. —Preceding unsigned comment added by 87.102.86.73 (talk) 08:49, 22 July 2008 (UTC)
 * Was there something very specific you wanted to know?87.102.86.73 (talk) 07:10, 22 July 2008 (UTC)
 * An example of non-linear quantization is the μ-law algorithm. -- Coneslayer (talk) 16:08, 22 July 2008 (UTC)

Graphical applications in chrooted terminal
I am trying to run Synaptic on a chrooted environment, in ubuntu (I am working with reconstructor), but I can't open any graphical application, I always get errors like: "(synaptic:6805): Gtk-WARNING **: cannot open display: :0.0", I tried running "xhost +" and lots of other stuff, but with no success. I am doing this in VMware Workstation with internet in NAT mode, (in case that matters...) Does anyone have any ideas? SF007 (talk) 07:17, 22 July 2008 (UTC)


 * The DISPLAY string ":0.0" refers to the UNIX-domain socket in /tmp/.X11-unix so you'll need to either make that available under the chroot (by bind-mounting /tmp, perhaps) or use TCP instead (DISPLAY=localhost:0.0 and make sure TCP is enabled on the server, not running with "-nolisten tcp"). --tcsetattr (talk / contribs) 07:58, 22 July 2008 (UTC)


 * Could you provide me que specific commands and tell me where to run them? (inside or outside the chroot), this is a bit complicated to me... I tried running DISPLAY=localhost:0.0 both inside and outside chroot, and with no success... also, "-nolisten tcp" does not work either... (command not found) SF007 (talk) 14:22, 22 July 2008 (UTC)


 * I seem to recall that after you define the DISPLAY variable you also need to export it. So, something like "export $DISPLAY", I think. StuRat (talk) 07:27, 23 July 2008 (UTC)


 * For the bind-mount solution, try " ". Obviously you need to be root and outside the chroot.  —Ilmari Karonen (talk) 08:02, 23 July 2008 (UTC)


 * Nothing worked... also because I'm still kinda a noob is this matters... I quit for now... Anyway, thanks to you all who tried to help. SF007 (talk) 01:04, 24 July 2008 (UTC)

Automagically crop GIF files to remove blank pixels?
Is there a script or command I can use in Win XP or Ubuntu to automagically crop many .gif files, such that it only keeps where there are pixels? It will crop the top, sides and bottom as much as possible if they are only transparent pixels with no colour.--206.248.172.247 (talk) 13:22, 22 July 2008 (UTC)


 * As long as the corner pixels are transparent, Imagemagick's "trim" command should do it. Imagemagick is fairly easy to automate from a bash script or the like. -- Finlay McWalter | Talk 13:36, 22 July 2008 (UTC)

This worked!! for f in `ls -1 *.gif`; do convert $f -trim trimmed/$f; done

--206.248.172.247 (talk) 15:41, 22 July 2008 (UTC)


 * As a side note, you should put the $fs after the do in quotes. Otherwise filenames with spaces will cause problems. Morana (talk) 16:59, 22 July 2008 (UTC)

Creating an XML-driven flash website
A friend of mine asked me to create a website for his band. He said it doesn't need to be anything too fancy, although he'd like to have a flash site with it (I've already created an HTML alternative... or should it be XHTML?). My question is, how would I go about using XML files for the flash site? As in, how would I use a SWF "container" to display the content of various XML files? For example, if I had a button called "About" in flash, when clicked upon, it would call and parse the content from a corresponding external XML file, whereas it displays the members of the band, while clicking another button, say "Gigs", would load another XML file containing information about upcoming performances. How would I go about doing this? Thanks,  Valens Impérial Császár  93  15:47, 22 July 2008 (UTC)
 * Do you have Adobe Flash Professional? If you have Adobe Flash CS3 Professional, then I can help you. The following code is in ActionScript 3.0, so it won't work in Macromedia Flash 8 since that only does ActionScript 2.0. ActionScript 3.0 is very different from version 2.0. I'm sure that you can do it in ActionScript 2.0, but I wouldn't know how. If you're not familiar with ActionScript, it's a lot like JavaScript. ActionScript is compiled into SWF files. First, create a new ActionScript 3.0 Flash file. Then create a text field and give it an instance name (external_txt in the example below). Then, create a new layer called actions. Then click on the first frame of actions and press F9. Then type this code:

var textLoader:URLLoader = new URLLoader; var textReq:URLRequest = new URLRequest("html.txt");

function textLoaded(event:Event):void {	external_txt.htmlText = textLoader.data; } textLoader.load(textReq); textLoader.addEventListener(Event.COMPLETE, textLoaded);


 * The HTML above is contained in the html.txt file. Also, HTML and XHTML are almost identical and both will look the same in a browser. XHTML is XML-based but use whichever you want since it doesn't matter at all.--Hello. I&#39;m new here, but I&#39;m sure I can help out. (talk) 08:27, 23 July 2008 (UTC)
 * Hi, thanks for the response. Yes, I have Flash CS3 Professional, but unfortunately I'm not very proficient at ActionScript. Your script works great, thank you! However, would there be a way to also include formatting such as colors, sizes, etc. from the text file, or would I have to manually do that in the text field? Also, I'm assuming that I'd be able to call a new file when a button is clicked? Thanks,  Valens Impérial Császár  93  23:17, 23 July 2008 (UTC)
 * Hi. You're welcome. The text file you reference can contain HTML tags, but Flash will only render some of them (e.g., links, lists, etc.), and not others (e.g., text coloring). If you're using CSS for formatting, then you can reference a CSS file (style.css below) in addition to the HTML like so:

var textLoader:URLLoader = new URLLoader; var textReq:URLRequest = new URLRequest("html.txt"); var cssLoader:URLLoader = new URLLoader; var cssRequest:URLRequest = new URLRequest("style.css"); var style:StyleSheet = new StyleSheet;

function textLoaded(event:Event):void {	cssLoader.load(cssRequest); cssLoader.addEventListener(Event.COMPLETE, cssLoaded); }

function cssLoaded(event:Event):void {	style.parseCSS(cssLoader.data); external_txt.styleSheet = style; external_txt.htmlText = textLoader.data; }

textLoader.load(textReq); textLoader.addEventListener(Event.COMPLETE, textLoaded);
 * Also, I forgot to mention that the text field has to be dynamic in order to be given an instance name.--Hello. I&#39;m new here, but I&#39;m sure I can help out. (talk) 04:36, 24 July 2008 (UTC)