Wikipedia:Reference desk/Archives/Computing/2010 January 2

Computing desk
< January 1 << Dec | January | Feb >> January 3 >
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.


January 2

edit

Facebook and private friends lists, how?

edit

I've noticed some people on Facebook have their friend list only available to people they know. How is this done? In the profile and privacy settings there's many things you can make public or private, but the friends list isn't listed as one of them. There must be some way to do this. Squidfryerchef (talk) 00:22, 2 January 2010 (UTC)[reply]

Go to your facebook public page by clicking your name at the top of the facebook website, click on the pencil icon on your friend box and use the options there to restrict its display. Nanonic (talk) 02:59, 2 January 2010 (UTC)[reply]
Thanks. That pencil icon's the sort of thing one might look at a thousand times without wondering what it does. Squidfryerchef (talk) 03:44, 2 January 2010 (UTC)[reply]

web hosting?

edit

I'm afraid I don't understand what Web hosting is from the article, and it isn't referenced, so whatever that says might not even be accurate. I'm wondering if someone can please explain what its qualifications are, or perhaps direct me to a better source? Thank you.--Neptunerover (talk) 00:25, 2 January 2010 (UTC)[reply]

I'm not exactly sure what you mean. A "web hosting service" is a service that runs a web server that is connected to the internet. Every site you visit on the internet is "hosted" somewhere. Is there a more specific piece that maybe you're referring to? Shadowjams (talk) 00:29, 2 January 2010 (UTC)[reply]
Whenever you load a web site in your browser, your computer sends a signal that says, "hey, send me this web page." In amazing quickness, it makes its way across the country or globe or whatever to another computer that says, "okay, here it is," and sends the data along. That computer that sends you the page is the server, and it hosts the page. Now, you can host a website from your own computer—your computer can be the one that other computers talk to when they want websites—but it requires you to have the computer running 24/7, and can use up a lot of bandwidth, and can be a pain to manage. But you can do it—you can be your own "web host". But more often people rent space on dedicated computers that are set up to do nothing other than host websites. This is a web hosting service. You pay them money (though some are free), and they make sure that when someone says, "hey, I want your web page," they get it. Does that make sense? If not, please specify what is confusing for you. --Mr.98 (talk) 02:48, 2 January 2010 (UTC)[reply]
Actually, it just occurred to me why you're asking this—you've been told that Wikipedia is not your web host and are trying to come up with a way to argue against that. All the rule means is that you don't have any claim to using Wikipedia is an arbitrary way—it isn't a place for you to just post whatever you want. Your user page is not really "yours"—you don't own it, and you don't have unlimited freedom in what goes on it. (If you want something like that, get your own web host.) --Mr.98 (talk) 20:28, 2 January 2010 (UTC)[reply]
That's right. If you want to publish your theories about the universe, then the best place for this will be your own web-pages that need to be hosted somewhere. You can do this without cost (but with some disadvantages such as advertising) on various servers (just google "free web hosting"), or you can pay for a better service. Dbfirs 09:08, 3 January 2010 (UTC)[reply]
You could even just set up a blog. It wouldn't allow the versatility of a fairly full featured web host but may be enough if you just want to publish your theories. There are plenty of people with, er, similar ideas, who may even comment on your theories and tell you how right you are Nil Einne (talk) 16:32, 3 January 2010 (UTC)[reply]

Working with JLabels

edit

Hello! In Java, I want to display a vertical list of JLabels in a JScrollPane. All the JLabels contain different amounts of text (from a few characters to several sentences). I want to set all the JLabels to have the same width, but variable height, so that they are just tall enough to fit in their rows of text. Could someone please give me some tips or some example code for how to do this? I've been trying BoxLayout, but what's problematic is for the JLabel's setPreferredSize() method, I can't just specify a width, and I can't be sure of the height. Thank you!--el Aprel (facta-facienda) 02:04, 2 January 2010 (UTC)[reply]

I don't really know that toolkit, but couldn't you do something like this?
Dimension d = widget.getPreferredSize();
d.width = whatever;
widget.setPreferredSize(d);
--Sean 15:04, 4 January 2010 (UTC)[reply]
The problem is that the label's preferred height should depend on its width (because it changes how many lines into which it must break its text). But the [gs]et{Minimum,Maximum,Preferred}Size() interface provides no mechanism for communicating such a complication. The calculation in getPreferredSize() can't even usefully take its current width into account, because having a component's desired size(s) depend on its current sizes would turn layout into a clumsy iteration scheme that might never converge.
It's a problem with the Java layout system that I've thought about before (I even went so far as to design an interface for conveying such contingent sizing information), but that doesn't help you with your present problem. If you're lucky, some sort of finagling with the various size settings will cause your labels to "get it" and return a useful getPreferredSize().height, but I'm not optimistic: how would it be sure that you didn't want it to give a useful getPreferredSize().width value based on your specified height(s) instead? --Tardis (talk) 23:47, 4 January 2010 (UTC)[reply]
Thank you for both of your comments. With some playing around and reading the Swing API, I found that JTextArea and some other text components have line-wrapping methods, so I'll use them instead. I also found out that the Scrollable interface lets you force a desirable width or height, or both, and that was helpful for dealing with multiple JTextArea instances in a single JScrollPane. Still, as Tardis mentions, it would have been a lot more convenient if you could just ask for a preferred width or height, instead of a Dimension.--el Aprel (facta-facienda) 20:00, 5 January 2010 (UTC)[reply]

World's Sillest CSS question

edit

Hello!

I'm trying to write a simple table in CSS for my girlfriend's blogger page. But its driving me nuts! It keeps randomly "stepping down" certain div elements, especially in the first row.

The code itself seems to work independently if i test it in IE or firefox, but when I put into blogger it goes all nuts. The first row of elements will "step down" as if there's an imaginary line break after each element. Then, after the first row, everything is in perfect alignment.

If I put in a Clear:both command on the second element, it will shift everybox after the first one down a full-sized row and then the table will be perfectly aligned (Except the first box will be alone on the top). Display inline doesnt do anything.

Honestly, I'm going nuts doing this. Please help.

Here is the code:


  <div style="width:495px; " align="center">
    <div style="float:left; width:144px;height:250px;background-color:green;"></div>
    <div style="float:left;width:144px;height:250px;background-color:yellow;"></div>
    <div style="float:left; width:144px;height:250px;background-color:green;"></div>
    <div style="float:left;width:144px;height:250px;background-color:yellow;"></div>
    <div style="float:left; width:144px;height:250px;background-color:green;"></div>
    <div style="float:left;width:144px;height:250px;background-color:yellow;"></div>
    <div style="float:left; width:144px;height:250px;background-color:green;"></div>
    <div style="float:left;width:144px;height:250px;background-color:yellow;"></div>
  </div>

Thanks for your help.... I'm desperate!!! —Preceding unsigned comment added by Cacofonie (talk) 04:12, 2 January 2010 (UTC)) 03:43, 2 January 2010 (UTC)[reply]

I've actually uploaded a picture of what it renders as here.
--Cacofonie (talk) 04:12, 2 January 2010 (UTC)[reply]
It's difficult to see what you're trying to achieve - are you trying to get a table with two columns, or four, or what? Anyway, you're putting eight objects that are each 144 pixels wide into a container that's 495 pixels wide. So it's reflowing them, and I guess the different you're seeing when on blogger is that it's applying an additional style that adds padding, which changes how things reflow. Relying on flowing like this makes for markup thats harder to read, change, and debug. Instead, have a DIV for each row, with the cells within it, and clear the floats for each of those row DIVs. 217.43.149.157 (talk) 12:57, 2 January 2010 (UTC)[reply]
Thanks for your help... I wanted a simple, three column table. So, if i understand your advice, I should make an encapsulating "row" div, appropriately sized to hold three of the divs in my code, and then each row should have the clear:both property?? Is that right?

Thanks again, --Cacofonie (talk) 13:33, 2 January 2010 (UTC)[reply]

Three column layouts are actually really hard to do with CSS. (It's one of the reasons I continue to use HTML tables for things of this nature... they are a million times easier to set up and "just work", unlike CSS tables). If you Google "three column CSS" you'll find about a million different ways to do it... none of which are straightforward, all of which are a pain to implement, none of which work on all browsers, at least not the last time I checked. It can be done, more or less.. but be aware that it is a non-trivial problem for CSS, and all "solutions" have their disadvantages (and this is not the sort of thing that you'll probably want to try and re-invent on your own, on the fly). Personally... as I said, I still just use the HTML table for this. It takes five seconds to set up a decent three-column HTML layout and you know it'll work on any browsers that look at it. The CSS purists will recoil but such is their job, and real-life web design requires more than (not-necessarily-great-anyway) ideals. --Mr.98 (talk) 15:48, 2 January 2010 (UTC)[reply]
I still don't follow the line of reasoning against HTML tables. If your data is tabular, it should be presented in a table and described in metadata as a table. The browser will render it as a table. You can use CSS to configure the way that the table appears, such as its colors, borders, and so forth. But I'm unconvinced that CSS can beat the simplicity of an HTML table. WikiBooks has a chapter HTML Tables in the HTML Programming book. Numerous criticisms of HTML tables, e.g. [1] [2], leave me unconvinced. Clean design and proper appearance is far more important than today's faddish, pedantic preferences for CSS or HTML. Nimur (talk) 22:15, 2 January 2010 (UTC)[reply]
The CSS purists would hold that in theory, you should be able to totally separate the design from the content. Tables do inhibit that when used purely for organizing data visually. But I do agree with you—in real-life web design, jettisoning the simplicity of tables seems really quite silly, especially when done for purist reasons. I'm also somewhat dubious of the whole data/design separation anyway. In some circumstances it seems desirable to have data extractable from the design, obviously. But on most web sites, it doesn't matter (because no one is going to try and extract the data independent of the design), and in practice, you have to assign every element on the page an ID and a class and etc. to be able to "totally" separate the data from the design in a real sense (as anyone who has had to re-skin a whole website knows, even if you DO try to separate data and design, there is a lot less separation than you think). And even then, I am very dubious that one should necessarily strive to make a data/design separation to the degree the purists want it. Is our design really meant to be divorced from the content? What graphic designer would defend such a proposal? It's the kind of philosophy a computer programmer would come up with—the idea that meaning and form could be and should be so swiftly detached. (smallified because this is fairly tangential to the question) --Mr.98 (talk) 22:57, 2 January 2010 (UTC)[reply]

To Break LAN Connection

edit

Hello To all of you.

If you know How to Break a LAN connection than tell me.

i want to knw if LAN connection is there in Computer Lab And User want to transfer a File To one computer to another COmputer.

Than thing is how is Possible ? Tell me if u are know. . .

I m waiting for answer. . .

thank you —Preceding unsigned comment added by Dj Keval (talkcontribs) 09:43, 2 January 2010 (UTC)[reply]

Um... Your question makes no sense. If you want to break a lan connection then you can cut the cord with a pair of scissors. that usually works. But that could be a problem if you don't own the network, so don't do that.
Do you want to transfer files? Then you probably don't want to break any connections. Why do you ask about that. That's weird.
What kind of computers are you and your file-transferring friend using? That could help. How big is the data you're trying to transfer? Tell us what operating system you're dealing with. Shadowjams (talk) 10:00, 2 January 2010 (UTC)[reply]
The question does not have enough information about the computer setup and what is desired. I think the question is, "If another machine in the computer lab is downloading a large file, is there a way for a second computer to stop that download?" If that's indeed the question, the answer is: Not if the network is properly configured. Comet Tuttle (talk) 15:34, 2 January 2010 (UTC)[reply]
You could send RST packets too. That would break a connection. Shadowjams (talk) 22:51, 2 January 2010 (UTC)[reply]

APNG in GIMP

edit

How to add APNG support to GIMP? --84.62.205.233 (talk) 19:16, 2 January 2010 (UTC)[reply]

There isn't support for it currently, but this link may be of use to you. I hope this helps. JW..[ T..C ] 07:11, 3 January 2010 (UTC)[reply]

remote start up

edit

Is it possible to make a computer that's turned off, start up via ethernet cable? —Preceding unsigned comment added by 82.44.54.145 (talk) 20:01, 2 January 2010 (UTC)[reply]

If the computer supports Wake-on-LAN, you can configure this setting in the BIOS. Nimur (talk) 20:16, 2 January 2010 (UTC)[reply]
Ok, so I have one computer that's turned off connected via ethernet cable to the computer that I'm using. What exactly do I do to turn the other computer on? —Preceding unsigned comment added by 82.44.54.145 (talk) 21:17, 2 January 2010 (UTC)[reply]
This is a fairly technical procedure. From your description, it sounds like you have directly connected the two computers with an ethernet cable. That is technically possible, but it will require additional, "nonstandard" configuration on the part of your active computer. I would recommend you use a router or a switch, instead of a direct ethernet connection between the machines.
I'll refer to the "off" computer as the "server" - this is the one you want to remotely wake up. The "on" computer will be the "client".
Now, you need to make sure your server BIOS supports and has been properly configured for Wake-on-LAN. You need to check your motherboard or machine type to verify that this is possible; if you have a separate Network Interface Card (NIC), you need to check that manual for the configuration as well. (Most modern computers have the NIC built in to the motherboard). The motherboard manual is your best resource to check for Wake-on-LAN setup instructions. If you don't know how to boot to BIOS configuration, you may want to stop here and read about BIOS.
Once that is set up, you need to know the server MAC address and IP address. Your client computer now needs to send a magic packet to that IP. There are several wake-on-LAN programs that generate these packets for you (like etherwake for Ubuntu; if you are running Windows on the client, see Overview of Wake On LAN from Microsoft TechNet). Or you can write your own program following the instructions in the Wikipedia article. This is a simple program that simply sends a UDP or other packet to the server that is loaded with the appropriate data (the format is described in magic packet).
As you can see, the procedure is fairly technical, but you can do it if you follow the instructions step-by-step. If you don't have a router, you will need to configure your client to send packets out the ethernet interface in raw mode to the MAC address of the server; or set up the client to act as a router. Nimur (talk) 21:35, 2 January 2010 (UTC)[reply]
As Nimur says, but the PC has to be in a 'soft-off' state. If it's turned off at a switch on the power supply, then it won't turn on as the mains power is off. I am speaking 'Wintel' here, not Apple Mac. --220.101.28.25 (talk) 21:45, 2 January 2010 (UTC)[reply]
Hm, we don't have an article on soft shutdown or soft power-off state? Nimur (talk) 21:49, 2 January 2010 (UTC)[reply]
Booting#Soft reboot, but technically WoL is a notch farther towards total system power-down than that description. As 220 mentions, if there is absolutely no power to the system, then nothing is alive to monitor for WoL wakeup packets and nothing could be done to boot if one were received. Nimur (talk) 21:56, 2 January 2010 (UTC)[reply]
Not that I could find under those terms. This is a passing reference Here--220.101.28.25 (talk) 22:00, 2 January 2010 (UTC)[reply]
I use wake on lan all the time. I execute it from Linux using ether-wake -b -D 00:00:00:00:00:00 where you replace the 00:00... with the ethernet address of the device you want to start up. As said above, the device has to support that, but most modern machines will. I'm pretty certain this won't work on wireless though; you'll need a wired ethernet machine. I assume ether-wake is available for mac. The actual wake on lan packet it sends out is pretty simple. You could quickly write a script to send it out so long as you can send out your own tcp packet. Shadowjams (talk) 07:56, 4 January 2010 (UTC)[reply]
There is a variant called "Wake on Wireless LAN" (WoWLAN) which is less commonly supported. It is described in our Wake-on-LAN article. Nimur (talk) 12:06, 4 January 2010 (UTC)[reply]