Wikipedia:Reference desk/Archives/Computing/2012 March 29

From Wikipedia, the free encyclopedia
Computing desk
< March 28 << Feb | March | Apr >> March 30 >
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 29[edit]

Digital TV question[edit]

I finally have propelled myself out of the Stone Age and bought a DTV-compatible television. Right now, I'm using regular rabbit ears (ones I used back in the '90s) to catch a signal. It looks good, but I can't tell whether or not it's HD. So, must an antenna be "HDTV-compatible" to catch an HD signal? Or will any antenna do? 75.162.160.104 (talk) 01:30, 29 March 2012 (UTC)[reply]

Pretty much any antenna will work, to some extent. However, normal TV antennae have both a loop for UHF and rabbit ears for VHF. Most digital stations are on UHF, so that loop is the more important, but your really should have both. If you tell me where you live, I can tell you if you have UHF or VHF stations there (you can't just go off the channel numbers anymore).
The biggest clue that you are watching digital TV is that the channels are now like 7.1 or 7-1, instead of just 7. Also, when you get a weak signal, the behavior is quite different. Instead of getting "snow" on the screen, it freezes up, forms big blocks, goes black, and says "No signal". Another way to tell the difference is when reading text, like the credits at the end of a movie. If they are fuzzy, it's probably analog. If they are sharp, it's digital. StuRat (talk) 01:33, 29 March 2012 (UTC)[reply]
I live in Salt Lake City. I know I'm receiving digital channels—I just don't know if they're showing up in HD (because of the age of my antenna). The aspect ratio is what one would expect with HD, but I can't tell if picture quality is to that level (I believe it is, but you know how we can all start second guessing sometimes). 75.162.160.104 (talk) 01:40, 29 March 2012 (UTC)[reply]
In Salt Lake City, it looks like all the stations are on UHF now, so you can toss out the rabbit ears and just use the loop (unless it's an integrated unit with both). You seem to be lucky, living in a flat city surrounded by mountains, which is about ideal for broadcasting. You should get the following stations there:
 2-1 CBS
 4-1 ABC
 5-1 NBC
 7-1 PBS
 9-1 PBS
11-1 PBS
13-1 FOX
14-1 MyTV
16-1 ION
20-1 Independent
24-1 Independent
30-1 CW
32-1 Univision
This lists the first sub-channel for each station, but there might be others, like 2-2, 2-3, 2-4, 2-5. With digital TV, you can have up to 5 sub-channels for each station. Some stations may elect to show programming from other networks, such as RTN, on some of their subchannels. Others may offer duplicate programming at either different times, or in different formats (1080i vs. 720p).
As for the picture quality, I still suggest trying to read the tiny credits at the end of a movie.
I'm also curious, since analog TV has been shut off for quite some time now, does this mean you've gone without a TV since then ? StuRat (talk) 01:50, 29 March 2012 (UTC)[reply]
Also, if you do have reception problems, you might consider a directional antenna, since all stations seem to originate from the same area, SWS of the city (with the exception of Univision, which is almost due south). StuRat (talk) 02:13, 29 March 2012 (UTC)[reply]
Thanks for the response. For whatever reason, I'm not receiving KSL-TV (NBC) at all. All other channels work except that one. Hmm. Perhaps I might consider getting a directional antenna.
To answer your question, I was using a digital-to-analog converter box to view television (on a non-HD-compatible television).
And I switched between an HD and non-HD newscast, and I'm almost positive I'm viewing true HD. Thanks for your help! 67.2.250.140 (talk) 04:20, 29 March 2012 (UTC)[reply]
Regarding the missing station: This should be a strong signal, as it's from the same location as the rest, the highest power level of any of them, and at the frequency of old UHF channel 38, which is right in the middle of the group. (Here's where I got that info, just enter your city in the upper, left corner, then click on the call letters for more info: [1].) So, a directional antenna probably won't help. Did you get this station with your digital-to-analog converter box ? If your TV works by initially building a list of available channels during a scan, then just flips between those on the list, this system has a major flaw: any station not broadcasting during the scan is then permanently blocked. So, if they were doing maintenance or otherwise down when the scan occurred, your TV will never find it. Better TVs have an "EZ add" option which will rescan, and just add any new channels found, or allow you to type in the broadcast channel (38, in this case), and add it that way. You might also be able to type in 38 on the remote and see it jump to the virtual channel 5-1 without changing the list. Some TVs, unfortunately, make you rescan the entire list, meaning you might add the missing channels, but lose any others which are down for maintenance now. If none of this helps, you can report the problem to the station, here: [2]. StuRat (talk) 05:37, 29 March 2012 (UTC)[reply]
Age of antenna or quality of signal has nothing to do with resolution in DTV. A bad signal makes pictures freeze and go blocky, not fuzzy. Many 21st Century TV sets have a "Menu" button whose menu shows technical information about the signal you're watching including such numbers as "1080i" for resolution. Jim.henderson (talk) 04:55, 29 March 2012 (UTC)[reply]
Are there still any over-the-air that aren't HD? I assumed that the DTV switchover would have coincided with an HD shift as well. (I know they aren't the same thing). Mingmingla (talk) 23:58, 29 March 2012 (UTC)[reply]
In the US, major network channels are HD, and sometimes have one or two SD subchannels. Other channels sometimes choose to fit 4, 5, or 6 SD subchannels (and no HD channels) into their channel stream. --Bavi H (talk) 05:24, 30 March 2012 (UTC)[reply]
No, there are still over-the-air networks that aren't HD. Two that I can think of off the top of my head are my local ION and TBN stations. Heck, I even still get two analog channels (SkyTrak weather and an analog version of ION). - Purplewowies (talk) 14:55, 30 March 2012 (UTC)[reply]
> I can't tell whether or not it's HD.
As Jim.henderson said, most digital TVs will have an Info button on the remote that will show information about the current program. This information might include the format currently being broadcast (like 480i, 720p, or 1080i), or maybe just an HD icon (if the resolution is 720p or 1080i).
You can also find resolution information for over-the-air digital channels at SiliconDust channel list or RabbitEars.Info lists. For RabbitEars, click on the city name (NOT the rank number), then click on the channel call letters. Or type a channel call sign in the search box at the top. --Bavi H (talk) 05:37, 30 March 2012 (UTC)[reply]


> Must an antenna be "HDTV-compatible" to catch an HD signal? Or will any antenna do?
As Jim.henderson said, the antenna has no effect on if you get an SD or HD resolution. As a rough analogy, imagine viewing an image on a website over your home wireless network. The image resolution might be small or large, but the quality of the wireless signal doesn't affect the resolution of the image. In a similar way, your TV antenna and the quality of the TV signal doesn't affect the channel resolution format. The resolution is just a format flag encoded in the channel's digital data.
The same kinds of antennas are used for analog and digital TV signals because they're transmitted on the same channel frequencies. However, when digital TV signals get weaker, the picture will get blocky or go out completely, whereas analog TV signals remain visible with much weaker signals. If you can't get a certain digital channel, try repositioning your antenna then rescanning. For example, you might move the antenna higher, rotate it 90 degrees, or move it further away from any appliances. Instead of rescanning every time, you can try a process like StuRat mentioned. For KSL, try entering 38.1 on the remote and see if you get a black screen with a "no signal" message. If you do, you can also try turning on the signal meter, if your TV has one. Change the antenna position, then wait a few seconds to see if the signal meter or picture improves.
If that still doesn't help, you might look for a higher quality antenna. Some antennas marked as HD or digital are designed to pick up weaker signals or have amplifiers to help improve the signal. But in general, "HD" or "digital" marks on an antenna are misleading, because an antenna can't tell if it's getting analog or digital, HD or SD. An antenna just receives signals in the frequency range it was designed for, and it's up to the TV to tune/filter to a single channel frequency and decode if the signal is analog or digital, SD or HD. --Bavi H (talk) 05:37, 30 March 2012 (UTC)[reply]
It still doesn't sound like an antenna issue, for the reasons I mentioned previously. If that station was farther away, broadcasting at a reduced power, at a different frequency distant from the rest, or in another direction, then I might agree. Similarly if the symptoms were macro-blocking, freezing, and a periodic "No signal" message. But none of this applies in this case. StuRat (talk) 20:20, 30 March 2012 (UTC)[reply]

Remembering logins in Firefox[edit]

Here is the landing page for a web-based financial application called MoneyGuide Pro. In their latest rework of the website, the login ID/PW are now behind/under the green oval dropdown box on the right side.

Can I make Firefox remember this login? I've been unsuccessful with my limited efforts...

--DaHorsesMouth (talk) 02:50, 29 March 2012 (UTC)[reply]

That form has the autocomplete=off attribute set. This Greasemonkey will fix it for you. --Sean 14:18, 30 March 2012 (UTC)[reply]

Cannot access Google groups when logged in[edit]

When I try to view any google group I get a box saying "An error occurred while communicating with the server. Reload". Reloading just gives the same message again. If I log out or use an incognito window I can see public groups. This happens at work and at home, on Windows and Linux so it is not a problem with my local system. Any ideas what's wrong or where to report it? -- Q Chris (talk) 15:04, 29 March 2012 (UTC)[reply]

Do you have a Google Apps account? This page (sorry, but it's a Google Groups page!) has a collection of people having problems with viewing Google Groups from a Google Apps account. It sounds unlike what you're experiencing, but I haven't been able to find anyone else with the problem you're having. - Cucumber Mike (talk) 19:34, 29 March 2012 (UTC)[reply]
No I have an ordinary google account. On the web I have found other people report the same thing, but no solution. here is one group I cannot access when logged in.

Packet[edit]

What are packets?? exatcly?? I mean on thewikipedia article of packet it says that packets are bits transfered from 1 computer to another, so an HTTP get request can be considered a packet??? Let's say I somehow got 1 raw packet, if I open it with notepad, would I see gibberish?(binary) or would I see something human readable, or both?? 190.60.93.218 (talk) 17:38, 29 March 2012 (UTC)[reply]

I'd expect a mixture, unless it's encoded for security, then it would all be gibberish. StuRat (talk) 17:40, 29 March 2012 (UTC)[reply]
My question is kinda.. How computers understand them? — Preceding unsigned comment added by 190.60.93.218 (talk) 18:07, 29 March 2012 (UTC)[reply]
Because computers can understand binary? One of the reasons certain files look like gibberish is that they're encoding numbers as binary numbers, rather than the ASCII code for the symbolic representation. For example, say a computer wants to store a value of "nine". If it's storing it as just a binary number, it would be as 00001001. On the other hand, if it wants to store the character "9", that would be 00111001 in ASCII. But if it tried to interpret 00001001 as an ASCII character, it would be as the horizontal tab control character, and if it tried to interpret 00111001 as a binary number, it would be as the quantity fifty-seven. That's why binary files look like gibberish when you open them with a text editors. The file is storing numbers as binary numbers, but the text editor is trying to interpret them as ASCII codes, resulting in undecipherable noise. -- 140.142.20.101 (talk) 18:53, 29 March 2012 (UTC)[reply]
Binary files are compiled in such a way that they tell the processor (or the os) what to do, they're made with compilers. etc...

They also have information about IP and stuff, Where is it stored? For example when you are downloading a file, they're divided in packets. I suppose they got a header, and a piece of the file you are currently downloaders, (like HTTP requests) Are HTTP requests packets too? for example

GET /w/Packet_sniffer /HTTP/1.1
Host: http://en.wikipedia.org/
User-Agent: None lol
Accept-Language: en-US
Accept-Encoding: gzip,deflate,sdch
Connection: keep-alive

Well, that's an http request. It would be like a packet??? 190.60.93.218 (talk) 19:09, 29 March 2012 (UTC)[reply]

A packet is like a postcard with an addressee, a return address, and a "payload" (the message written on it). On the Internet all data is sent in packets. However, almost all data, including HTTP requests and downloaded files, is sent using TCP, which treats the data as a continuous stream (breaking it into packets internally, but not in a way that's visible to the program that uses TCP). So that HTTP request might be sent as a single packet, or split into several packets, or bundled with other data (such as POST data) in a single packet. -- BenRG (talk) 19:28, 29 March 2012 (UTC)[reply]
Exactly. What you define as a packet depends on which layer of abstraction you're talking about. TCP packets may not be the same as Ethernet packets. You should think of packets as a way of breaking up data into chunks, and then to apply certain things to those chunks... things like destination address, checksums, maybe other flags. Each protocol that deals with the underlying data will do this itself. You might investigate Wireshark as this will show you the actual packets themselves. Shadowjams (talk) 00:44, 30 March 2012 (UTC)[reply]
One issue is that there isn't a single thing as a packet - at least for network communication, there's typically several layers. See the figure in Internet Protocol for an example. In a typical web request, the network card on your computer will emit an Ethernet packet which wraps an Internet Protocol packet which wraps a Transmission Control Protocol packet which wraps Hypertext Transfer Protocol data. Your IP address is technically part of the Internet Protocol layer. For IPv4 (the dotted quad addresses), the form of the packet header is detailed at IPv4#Packet_structure. As you can see from that section, the information is positionally encoded in binary form in the header of the packet. For example, the IP address of where you're sending it to is bits 192 to 159 (effectively bytes 16 to 19, inclusive) of the header. As you can see from the size, it's not sent as a text representation, but as four binary encoded bytes (that's why each part of the quad always falls between 0 & 255). So, you may ask, how do you know which bit is the starting bit? Well, for IP, that's determined by the surrounding link layer. For example, on ethernet, there is an Ethernet frame specification which specifies where the inner packet starts. On DSL, there's a different encoding. These are all typically binary encoded, so if you looked at the raw captured bit stream with a text editor, it'd all be gibberish. If you have a program that's intended for inspecting packets, it may be able to do the decoding and can display the information in human-readable form - but the packets themselves as they exist on the wire aren't transmitted as text. -- 140.142.20.101 (talk) 19:41, 30 March 2012 (UTC)[reply]

Odd compiler warnings.[edit]

GCC gives me the following warning, repeated a couple dozen times (with variations for other functions), every time I compile my latest project. I can't make heads or tails of what's causing it.

main.c:63:7: warning: passing argument 2 of 'addNode' from incompatible pointer type [enabled by default]

main.c:53:5: note: expected 'struct node *' but argument is of type 'struct node *'

The program seems to run fine despite the warnings. What's causing it, and am I safe if I ignore it? Horselover Frost (talk · edits) 19:53, 29 March 2012 (UTC)[reply]

If you can cook it down to the minimal example that generates this (surely a handful of lines) it'd be much easier for us to comment. GCC can be picky, but doesn't generate warnings out of spite, and if you don't understand what the warning means for your code, it means you don't really understand your code. Most C warnings can be ignored, but a tiny handful signify catastrophic errors that kill people; it's easier to fix the problems that the warning indicates than to find the evil ones amid the trivial crowd. -- Finlay McWalterTalk 20:17, 29 March 2012 (UTC)[reply]

All right, how's this?

#include <stdlib.h>

typedef struct {
  struct node * next;
} node;

void addNode (node * top, node * new);

int main()
{
  node * node1=(node *)calloc(1, sizeof(node));
  node1->next=NULL;
  node * node2=(node *)calloc(1, sizeof(node));
  node2->next=NULL;
  addNode(node1, node2);
}

void addNode (node * top, node * new)
{
  if (top->next==NULL)
    top->next=new;
  else
    addNode(top->next, new);
}

This code is similar to what I'm using, and causes the same warnings I'm getting. If it matters, I'm using gcc 4.6.3, and targeting x86-64. Horselover Frost (talk · edits) 21:25, 29 March 2012 (UTC)[reply]

Try this:
typedef struct n {
  struct n * next;
} node;
Which is probably what you mean. Tangentially (and not the cause of your warnings) you don't need to cast the returns from calloc -- Finlay McWalterTalk 21:40, 29 March 2012 (UTC)[reply]

I recommend getting clang, at least for when gcc messages fail to be sane. --145.94.77.43 (talk) 06:52, 30 March 2012 (UTC)[reply]

I think it's worthwhile to know why this gets warnings. Your
typedef struct {
  struct node * next;
} node;
uses struct node without any such struct type having been declared. (Even after the typedef, there's still no struct node, just node. That's why you use typedef this way, to save the word struct in later use.) This means that struct node implicitly declares an incomplete type that (is never completed and) is forever distinct from node. When you use top->next (which is a struct node*) as an argument to a function expecting node*, you get the warning. It's confusing because, I think, GCC is trying to be helpful: it's interpreting the typedef idiom so that it can describe the expected type more usefully and ends up producing the same name as you gave to the incomplete type. You can trivially write
typedef struct node {
  struct node * next;
} node;
and have struct node (declared before its use, even) and node as a synonym. This sort of thing is common for self-referential structures like linked lists. --Tardis (talk) 15:22, 1 April 2012 (UTC)[reply]

sketchup modelling[edit]

So, I'm trying to make a simple 3D model in sketchup, which it turns out is pretty much the worst modelling program ever, but it's what I've been told I have to use. I have a larger block and a smaller block, and I need to make a shallow indentation in the larger block the exact same shape as the smaller, so I coped the smaller block and moved it into position on the larger, and tried to drag the shape down, but it refuses to work. Anyone know any other way I can get it to do what I want?

148.197.81.179 (talk) 20:02, 29 March 2012 (UTC)[reply]

I don't know how to use Sketchup, but what you are trying to do is a shape "subtraction" operation (where you subtract the area of one shape from another). This page discusses how to do it. --Mr.98 (talk) 23:18, 29 March 2012 (UTC)[reply]

Pretty sure I tried that, but I can give it another go. 148.197.81.179 (talk) 00:46, 30 March 2012 (UTC)[reply]

It appears that subtraction is a "pro only" feature. If you aren't using sketchup pro you can get a free trial just for this assignment (it gives you eight hours of use), or if you are a student you could buy an educational licence for US $50. Otherwise it might get expensive! The way to do this in the free version (or at least it was several years ago when I last used it) is to draw a 2D projection of the smaller block on the surface of the larger block (e.g. draw a rectangle if the smaller block is a cuboid) and then use the push-pull tool to do the indentation (you can click on the shape and then type in a displacement if you want to be precise). If you need a more complex shape you need to build it up in this way (e.g. by drawing lines and using the move tool to create angled surfaces etc.). If you need a curved e.g. spherical indentation I think you are pretty much out of luck in the free version. If you give some more indication about the geometry of both blocks and how you want it to look in the end I can try to give you some more specific ideas. I agree this is an awkward way to work for anything more than the simplest shapes but that's exactly the point - they want people who need it for more than messing about to get fed up with it and buy the pro version! Equisetum (talk | contributions) 10:06, 30 March 2012 (UTC)[reply]

Oh, it just suddenly started working. That's computers for you. Had a bit of trouble with a shape in the middle that was supposed to be left at the original height, but randomly drawing just one line on the edge of that put it back. strange program, I hope I never have to use it again. 148.197.81.179 (talk) 18:35, 30 March 2012 (UTC)[reply]

SQL - Multiple joins[edit]

I've got some tables which have the following columns (and others which aren't important for what I'm asking):

  • Employee (Id, Name)
  • Tool (Id, ToolType_Id, Code)
  • ToolType (Id, Key)
  • ToolLoan (Id, Tool_Id, Employee_Id, LoanDate, ReturnDate)

As part of a sort of PHP/MySQL application I'm creating I want to be able to show all Tools currently on loan (so ReturnDate would be NULL) in the following format:

Tool Code | Tool Type | Employee Name | Loan Date

I believe this is done using an SQL JOIN but I don't know what the structure is for multiple JOINs --TuringMachine17 (talk) 21:46, 29 March 2012 (UTC)[reply]

While we wait for a sql-wallah to suggest some syntax, what is *ToolType (Id, Key) all about? I'd have imagined tooltype.id would itself be a key; and if it is not, then the foreign key tool.tooltype_id is in big trouble :(. --Tagishsimon (talk) 22:44, 29 March 2012 (UTC)[reply]
This sounds like a homework problem. Per our WP:HW guidelines, I will not give you a full answer, but I will help get you started. I assume that Employee, Tool, ToolType, and ToolLoad are the table names, and that the names in parentheses are the column names within each table.
You are correct that the SQL JOIN is the mechanism for combining information from multiple tables. Our JOIN article much detail, but for your problem, you can review the section on INNER JOIN. The "explicit join notation" is preferred over the older-style (but still valid) implicit notation, so I recommend that you follow that explicit join form. Using the explicit join notation, a query with a single join between two hypothetical tables AAA and BBB might take the form: "SELECT * FROM AAA INNER JOIN BBB ON BBB.id = AAA.bbb_id". Additional joins may be included by simply following one join with another. The ON condition for each join normally defined the required relationship between a column in the newly joined table and a column any of the preceding tables. For example "SELECT * FROM AAA INNER JOIN BBB ON BBB.id = AAA.bbb_id INNER JOIN CCC ON CCC.id = BBB.ccc_id". You can keep adding joins until you have all the data you need. You will also need a WHERE clause to limit the results to the tools still on loan and will need to replace the "SELECT *" with a result formatted specifically to your needs. SQL statements are more readable when split across multiple lines, like
SELECT CONCAT(B.partno, ' - ', C.descriptiuon) 
FROM AAA A 
JOIN BBB B ON B.id = A.bbb_id
JOIN CCC C ON C.id = B.ccc_id
WHERE A.category = 1
Note that the above example defines aliases (A, B, and C) after each table reference, so that the shorter table alias names may be used in place of the full table names in the ON conditions, WHERE clause, and SELECT expressions. I expect your solution can be patterned after the above.
If you have problems or some follow-up questions after giving the problem a try, please include your work-in-progress with your post. -- Tom N (tcncv) talk/contrib 01:06, 30 March 2012 (UTC)[reply]

older special effects graphics software[edit]

Hi, I remember someone using a graphics software for the Mac that offered a range of flames, shiny balls or bubbles (& their transparency/size could be adjusted), and other effects in or across an image. Don't know the name & it was expensive at the time - about 2002? In any case if it's not around now, is there an equivalent? Thanks in advance, Manytexts (talk) 22:35, 29 March 2012 (UTC)[reply]

Photoshop or Adobe After Effects would be my guess. RudolfRed (talk) 00:30, 30 March 2012 (UTC)[reply]
GIMP Can do the trick. 190.84.182.165 (talk) 01:39, 30 March 2012 (UTC)[reply]
Thanks so much for your help, you guys are so prompt! It would have been an add-on to Photoshop for sure so I think that's it. And if GIMP can do it, I'll go there too. Much appreciated, Manytexts (talk) 08:16, 30 March 2012 (UTC)[reply]