Wikipedia:Reference desk/Computing
of the Wikipedia reference desk.
Main page: Help searching Wikipedia
How can I get my question answered?
- Select the section of the desk that best fits the general topic of your question (see the navigation column to the right).
- Post your question to only one section, providing a short header that gives the topic of your question.
- Type '~~~~' (that is, four tilde characters) at the end – this signs and dates your contribution so we know who wrote what and when.
- Don't post personal contact information – it will be removed. Any answers will be provided here.
- Please be as specific as possible, and include all relevant context – the usefulness of answers may depend on the context.
- Note:
- We don't answer (and may remove) questions that require medical diagnosis or legal advice.
- We don't answer requests for opinions, predictions or debate.
- We don't do your homework for you, though we'll help you past the stuck point.
- We don't conduct original research or provide a free source of ideas, but we'll help you find information you need.
How do I answer a question?
Main page: Wikipedia:Reference desk/Guidelines
- The best answers address the question directly, and back up facts with wikilinks and links to sources. Do not edit others' comments and do not give any medical or legal advice.
July 16
JAVA,(J2EE),net or php
Which is better among three of these — Preceding unsigned comment added by Ruchibahl18 (talk • contribs) 06:18, 16 July 2011 (UTC)
- Better in what way? --Mr.98 (talk) 13:27, 16 July 2011 (UTC)
- The conventional wisdom regarding programming languages/tools is that it always depends on what you are trying to do. Java is well acknowledged for its platform flexibility, J2EE is good for highly designed (web) software projects, .NET has slightly better performance than java and allows for multiple different languages to be compiled to the same bytecode, php is well known for being good for "quick and dirty" web applications. If you want to know which of those are best to study as a carreer move, Java and .NET represent the majority of paying programming positions, though quality of the job and pay varies. Your question is impossible to answer simply. i kan reed (talk) 16:18, 19 July 2011 (UTC)
Drag and Drop Won't Work in Book Creator Editing Area
Greetings.
I've used the book creator successfully to make a couple of books, but it seems (and I may be completely off, here) that since installing Internet Explorer 9, I can no longer drag and drop chapters or articles within the Book Creator editing area. While hovering the cursor over a topic or chapter name, I get the 4-pointed arrow icon instead of the hand icon.
I've tried switching use from IE9 64-bit to IE9 32-bit. I've lowered security regarding cookies within IE9. I'm running Windows 7 Home Premium, 64-bit.
I would appreciate any assistance in this matter, as the Book Creator is virtually useless to me while the drag and drop function is dysfunctional.
Thanks. — Preceding unsigned comment added by Skyyfaery777 (talk • contribs) 07:01, 16 July 2011 (UTC)
Transferred from Miscellaneous Desk. Richard Avery (talk) 07:15, 16 July 2011 (UTC)
- Have you tried a different browser? General Rommel (talk) 09:54, 16 July 2011 (UTC)
Automatically copy from Firefox cache to a folder
While I am surfing the internet, I would like to be able to continuously save from the Firefox cache to a folder of my choice. Preferably I would like to be able to save only files with a particular extension, and be able to turn this continuous saving on or off. Although I have the add-on CacheViewer installed, you can only save files manually. I have been unable to find any other add-on that can do this.
What would be the easiest way to achieve this? I could probably learn to write something in Autohotkey or another simple BASIC-like language. More modern languages such as VBscript I find almost impossible to use. Would it for example be possible to run some other existing software, even while Firefox is running, which copies all the new files from the cache to my folder every second or so? 92.24.138.48 (talk) 15:43, 16 July 2011 (UTC)
How to copy and insert a "cookie" from a folder into Firefox?
I have various security programs which automatically delete all cookies. Rather than having to set my preferances for Google over and over again (for example turning off the dreaded "instant search"), I would like to save the cookie to a folder, and then when needed copy and insert this cookie into the appropiate place in Firefox. I once tried copying a cookie into Internet Explorer, but the computer would not let me do it. I would rather insert a cookie than adjust the settings of every security program, particularly as I would know what information Google was trying to hide in them, and in my experience several copies accumulate. I use WinXP. 92.28.255.228 (talk) 17:13, 16 July 2011 (UTC)
- CookieCuller and OptimizeGoogle extensions can help some. ¦ Reisio (talk) 08:24, 17 July 2011 (UTC)
Thanks. Optimis/zeGoogle looks useful as it can turn off "Google Suggest" which apparantly stops the irritating habit of Google making wild guesses about what word you are beginning to type, and it can set some preferences without needing to keep a pernament cookie. The other add-on GoogleEnhancer does similar things, so together they give a lot of control. I've already got CookieCuller installed. 92.24.179.33 (talk) 09:38, 17 July 2011 (UTC)
Manually activating an on button
I have an old Dell laptop whose power switch broke that I'd like to turn on. I'd like to do that manually, maybe by soldering leads onto it myself and manually connecting them.
I've stripped back enough to see the circuit board connections. All of what I describe fits into about a 2 cm square so keep that in mind. There are 6 leads on the green board arranged in a rectangle pattern: 1 pair at the top/bottom, and then 2 more pairs on the sides. On top of that once sat (now removed) a small plastic device that has two horizontal wires that are visible. The top/bottom pair of wires were connected to this device. The two horizontal pairs went over this device and were bifurcated with this plastic square that seemed to be connected to the wire. In other words, when you pressed the power button, it would press these two horizontal pairs into the plastic device, which was connected to the vertical pair. That would complete a connection with all 6 leads to the circuit board.
My hunch is that the vertical pair of leads provides some power source, and pressing the power button depresses these two horizontal leads into the plastic thing, which simultaneously completes two connections. I also assume that the need for 2 power switch leads is because one detects a quick press and the other detects a longer "held down" press, for things like a hard shut down.
Incidentally the power switch is of a different style than other switches, like the volume switches, so I can't swap parts. I don't care enough to order new switches (although if I could pick something up from RadioShack I would) and the computer's not worth much, but I'm interested in how this works and would like to get it to turn on. Finally, any magic keyboard shortcuts that could bypass this process would be appreciated too. Thanks. Shadowjams (talk) 22:23, 16 July 2011 (UTC)
- The leads were probably to an LED embedded inside the power button, which would light when the machine was on. Most modern PCB switches consist of a number of solder landing pads arranged in a geometric pattern. The underside of a button consists of a conductive elastomer (a black rubbery stuff) that (when the button is pushed) bridges some of the pads to others. You'll have to experiment to see which ones constitute the "before" and which the "after" pads. A more complex pattern (than just one before and one after) is sometimes used to handle pushes on the switch that aren't strictly vertical. If you were replacing the switch you'd probably need a "momentary" type switch. Note that, unless your laptop is exceedingly old, the power switch isn't anything really to do with the power circuit - it's just an ordinary signal-level circuit that's monitored by special logic in the southbridge. -- Finlay McWalter ☻ Talk 22:47, 16 July 2011 (UTC)
- They're not LED leads... the button had no lights on it nor any nearby. The LEDs are elsewhere. As for age it's not extremely old. It's not a keyboard style rubber button. Its moving part was plastic that would depress the two horizontal leads into the plastic thing that was connected to the vertical leads. I know what kind of button you're talking about because that's basically what the other switches are, but this power switch is different. Shadowjams (talk) 05:07, 17 July 2011 (UTC)
- Check eBay for a new switch. ---— Gadget850 (Ed) talk 14:23, 17 July 2011 (UTC)
July 17
Web site for selling diamonds
I find many web sites for buying diamonds, like this one: [1]. There you pick the parameters you want, then they sort through their DB and list those diamonds (with prices) which match your search criteria.
I want just the reverse, to list my diamonds and get quotes from multiple buyers. Is there such a site ? (I realize I could use a general auction site, like eBay, but would prefer a site specifically designed for diamond sales.) 68.79.93.3 (talk) 02:12, 17 July 2011 (UTC)
- Okay, you've reached the limit here. You're not even sure that you have diamonds, and now you want to sell them on the web? Please take your stuff to somebody who is qualified to evaluate it, and come back when you have a meaningful question to ask. Looie496 (talk) 02:17, 17 July 2011 (UTC)
- Personally I'd be pretty suspicious of any site that allowed you to do that. Who would buy gemstones from some random joe on the Internet? APL (talk) 02:28, 17 July 2011 (UTC)
- I would expect them to be verified, at some point (although if they were certified, then this verification was already done beforehand). The point is to get an agreement that "if the diamond is as you say, then we will pay X for it". Note that there are sites where you describe your diamond and one buyer (who owns the site) will quote you a price. I just want the same thing with multiple buyers. 68.79.93.3 (talk) 02:55, 17 July 2011 (UTC)
- You have many questions (e.g. here) about these diamonds that may after all not be diamonds. And "Give me advice to help me make as much money as possible" is an odd line of questioning for a "reference desk". Simple: donate the whole lot to charity. Then the charity has to figure out what to do with them, it gets the money, and you have the warm feeling that comes from financing something even more worthwhile than your average kickstarter project. You might even get a little tax break. -- Hoary (talk) 03:29, 17 July 2011 (UTC)
- I will have them appraised (or even certified, if required), but would then like the option to sell them online. 68.79.93.3 (talk) 03:46, 17 July 2011 (UTC)
- All right, let's return to your question I want just the reverse, to list my diamonds and get quotes from multiple buyers. Is there such a site ? (emphasis added). That appears to be a googling question, a diamonds question, or a selling stuff question. Try the "Miscellaneous" desk (or google). -- Hoary (talk) 04:45, 17 July 2011 (UTC)
- I tried Google, but kept findings sites wanting to sell me diamonds, or sites wanting to buy diamonds, but only by a single buyer, versus multiple bidders. So, how would I do a Google search to exclude those ? 68.79.93.3 (talk) 08:07, 17 July 2011 (UTC)
- APL, many stupid people have some money. Just think of the market for "generic" or "herbal" varieties of "Viagra", etc etc. Or the nitwits who pay a bit upfront for nonexistent Nigerian millions. -- Hoary (talk) 03:29, 17 July 2011 (UTC)
- Many stupid people might have money at some point, but as you see they will have trouble keeping it, therefore, people with money tend to be those who can deal with it. — Preceding unsigned comment added by 88.8.79.148 (talk) 13:49, 17 July 2011 (UTC)
- APL, many stupid people have some money. Just think of the market for "generic" or "herbal" varieties of "Viagra", etc etc. Or the nitwits who pay a bit upfront for nonexistent Nigerian millions. -- Hoary (talk) 03:29, 17 July 2011 (UTC)
- The answer to the original question is eBay, which because of the network effect contains the maximum number of buyers-of-diamonds-from-random-Joes-on-the-Internet you are likely to find. Comet Tuttle (talk) 04:18, 19 July 2011 (UTC)
Command Prompt problem
This is probably incredibly simple and I'm just missing something. I have three batch files: One "menu.bat" which prints a text file "menu.txt" displaying two options ("1" and "2"), and two other batch files, "1.bat" and "2.bat" (the options printed in menu.bat). Here's my question: I want to run menu.bat, but Command Prompt disappears as soon as I load it. What am I doing wrong? -- 68.0.166.142 (talk) 14:17, 17 July 2011 (UTC)
- Do you open CP and run it or double click to run it? Does it contain an exit command? ---— Gadget850 (Ed) talk 14:21, 17 July 2011 (UTC)
- I don't open CP and then run the command, I just want to be able to doubleclick the batch file and for CP to remain up so I can see menu.txt printed and respond to it ("1" and "2"). It does not contain an exit command. Unless you know of a way to load CP and automatically navigate to menu.bat? -- 68.0.166.142 (talk) 14:39, 17 July 2011 (UTC)
- You can do that in several ways. Probably the most straightforward is to use the start command. You can read documentation by typing start /? in the command prompt, or at the Microsoft help website for Cmd.
- You may also want to use the pause command at the end of your script, to hold a terminal open even if it has completed all its tasks. Nimur (talk) 16:05, 17 July 2011 (UTC)
- The easiest way of achieving what you want is to use the /K switch, which treats the remainder of the line as a command to be executed without terminating the shell. Here's the .bat file:
@cmd /K type c:\yourpath\menu.txt
- This script can be run by clicking its icon. The at-sign before cmd suppresses echoing of the command (so that you just see your menu, and not the command used for printing it). If your 1.bat and 2.bat are located in c:\yourpath, you may want to change to that directory first, like so:
@c: @cd \yourpath @cmd /K type c:\yourpath\menu.txt
- --NorwegianBlue talk 20:33, 18 July 2011 (UTC) In the second example, it's not necessary to state the full path in the third line, @cmd /K type menu.txt is sufficient. --NorwegianBlue talk 20:41, 18 July 2011 (UTC)
Malicious program in my computer
I am only recently having a problem with editing WP (last few days), in that when I edit (hopefully it won't happen here), words like "P u r f u m e", etc. (here I intentionally separated each letter with a space) turn into a hyperlink to ads. They are the same blue color as WPs blue links, with a throbbing, dashed underline. It also tends to delete words such as other instances of the above example that are on the page, hyperlinking only the one remaining. I saved one edit by accident and had to revert myself, because it made these alterations I didn't mean to make. Has anyone had this problem; know how it can be removed from my computer? I have taken the steps of removing any recent software, applications and Windows updates with no effect, and Norton Anti-virus isn't picking it up as a virus. Any feedback would be appreciated, as this hampers my editing substantially here. (by the way, this hyperlinking effect goes on anywhere I go on the web - normally I just ignore it, but it makes editing WP sometimes impossible) This message originally posted at Wikipedia:Help desk#Malicious program in my computer Thanks, Hamamelis (talk) 17:09, 17 July 2011 (UTC)
- You might give your system a Malwarebytes scan, for starters. ¦ Reisio (talk) 17:19, 17 July 2011 (UTC)
- Thanks, I'm trying it now, Hamamelis (talk) 17:45, 17 July 2011 (UTC)
- If that does not work, I would then try SUPERAntiSpyware, and after that Avast! which can do boot-time scans before the malware has loaded up. Then try some of these: http://www.techsupportalert.com/content/probably-best-free-security-list-world.htm In any case, cleaning out the garbage beforehand with Ccleaner should make the scans a little quicker. 2.97.209.26 (talk) 21:21, 17 July 2011 (UTC)
- I appreciate all of your suggestions. Alas, to no avail so far. For some reason, I was not able to download Avast!, but I tried the rest; they certainly cleaned up a lot of junk, but not whatever this little bastard is. Doing some of my own research suggests this is something very new, that attaches itself to your registry (thus apparently cloaking itself from a lot of antivirus-, etc-ware). Manually trying out regedit, I was able to clean it up some (got rid of some old g a m e s and such, listed there but no longer on my PC), but I could not find the evil files I turned up in my research, which were blackice.exe, blackice.ini, etc. (files attached to something called "win32 maleware.gen"), but I think whatever I've caught is something like those/("it"). I'll watch here for a while for suggestions, and also to see if anyone else has a similar experience. Thanks again, Hamamelis (talk) 09:57, 19 July 2011 (UTC)
- The next thing to do would be to create a HijackThis log and post it on one of the several forums that are dedicated to dealing with them, such as this one: http://www.bleepingcomputer.com/forums/forum22.html after following their instructions. I don't know why, but now the HijackThis download link redirects to something else - doubtless the forums can advise on where to get it from now.
- Apart from that you could try running an anti-malware program in safe mode. I don't know if your computer would allow you to install Avast! in safe mode, but in any case you would need to un-install your existing anti-virus. If you want to do that I would download the Avast! instalation file, unplug your modem, uninstall your existing anti-virus, install Avast!, plug in your modem to allow it to update its files, then tell it to do a boot-time scan. I've also just found this http://forums.majorgeeks.com/showthread.php?t=35407 which may be worth looking at. 2.97.220.86 (talk) 18:11, 19 July 2011 (UTC)
- Thanks a lot for the links and advice 2.97.220.86, will report back here sometime later (but I can't say when). Hamamelis (talk) 00:08, 20 July 2011 (UTC)
- I appreciate all of your suggestions. Alas, to no avail so far. For some reason, I was not able to download Avast!, but I tried the rest; they certainly cleaned up a lot of junk, but not whatever this little bastard is. Doing some of my own research suggests this is something very new, that attaches itself to your registry (thus apparently cloaking itself from a lot of antivirus-, etc-ware). Manually trying out regedit, I was able to clean it up some (got rid of some old g a m e s and such, listed there but no longer on my PC), but I could not find the evil files I turned up in my research, which were blackice.exe, blackice.ini, etc. (files attached to something called "win32 maleware.gen"), but I think whatever I've caught is something like those/("it"). I'll watch here for a while for suggestions, and also to see if anyone else has a similar experience. Thanks again, Hamamelis (talk) 09:57, 19 July 2011 (UTC)
Multiplication and addition of arrays using foreach() loop in PHP
I would like to know the PHP code/program for multiplying and adding two 3x3 arrays using the foreach() loop. I've been trying to do it for days, but nothing seems to work. Somebody please help!!!
I've tried the following code for adding the arrays:
<?php
$a=array(1=>array(1,2,3),2=>array(4,5,6));
$b=array(1=>array(9,8,7),2=>array(6,5,4));
$c=array();
foreach($a as $v1)
{ foreach($b as $v2)
{ $c=$v1+$v2;
}}
print_r($c);
?>
There are no errors, but it doesn't work,either. The output is incorrect. I don't know where I'm going wrong. If someone could tell me what to do, how to go about it,instead of giving me the code directly, that would do as well, just as long as I get to know how to do it. Thanks in advance! Zebec 21:12, 17 July 2011 (UTC)
- You're still trying to add two array types together (both $v1 and $v2 are arrays in your loops). You cannot do that in PHP — it doesn't understand, and it just assigns $c to whatever the first array in your equation is. So the result you're getting, in the end, is the final instance of $a, every time, which is 4,5,6. If you are trying to make the internal values of the array add, you have to do another few foreach loops so that you're dealing with the values, and not arrays themselves. --Mr.98 (talk) 21:35, 17 July 2011 (UTC)
- Here, also, is a re-written version of exactly what you have above. Note two things: 1. I've added some formatting which makes it clear what is going on (an absolutely essential programming habit!), and 2. I've added debugging calls so you can see, when you run it, what's going on. Both of these sorts of things are common when trying to figure out how a piece of code does or doesn't work.
<pre>
<?php
$a = Array(
1 => Array(1,2,3),
2 => Array(4,5,6)
);
echo "a = ";
print_r($a);
echo "\n";
$b = Array(
1 => Array(9,8,7),
2 => Array(6,5,4)
);
echo "b = ";
print_r($b);
echo "\n";
$c=array();
foreach($a as $k1 => $v1) {
foreach($b as $k2 => $v2) {
$c = $v1+$v2;
echo "working on $k1:$k2\n";
echo "v1 = ";
print_r($v1);
echo "\n";
echo "v2 = ";
print_r($v2);
echo "\n";
echo "c is currently = ";
print_r($c);
echo "\n";
}
}
echo "c is finally = ";
print_r($c);
?>
</pre>
- You can see pretty clearly what is and isn't happening that way. --Mr.98 (talk) 01:15, 18 July 2011 (UTC)
- Do you realize that $c is going to be rewritten after each rendition of the inner loop?--v/r - TP 01:24, 18 July 2011 (UTC)
- That's another good point! You're just assigning c again and again, rather than doing something like $c = $c + ($v1+$v2), or, in shorter code, $c+=$v1+$v2. Though that still won't work because of the array issue. --Mr.98 (talk) 15:35, 18 July 2011 (UTC)
Thank you very much Mr.98! I added a few more foreach loops so that the values would be used instead of the arrays, and also added the array_push function so that the sum gets stored in the third array, but because each of the two arrays require two foreach() loops, the third array is becoming longer than it should be. The order of nesting matters, I think, and I'm not able to figure it out. I also need to multiply two arrays in another program, which will be even more complicated. I can start work on that once I've finished this.
<?php
$a=array(1=>array(1,2,3),2=>array(4,5,6));
$b=array(1=>array(9,8,7),2=>array(6,5,4));
$c=array();
foreach($a as $v1)
{ foreach($b as $v2)
{ foreach($v1 as $c1)
{ foreach($v2 as $c2)
{ $d=$c1+$c2;
array_push($c,$d);
}}}}
print_r($c)
?>
Zebec 21:11, 18 July 2011 (UTC)
- I'm still sort of unclear what you are trying to actually do with the arrays. Are you trying to do matrix addition? If so, I think you're going about it wrong. You don't need all of those foreachs. What you need, essentially is something like this: take element 1 of $a, element 2 of $b. Then iterate over the three values in them, adding each of them, and using them to create element 1 of $c. Then repeat for element 2 of $a, $b, and thus $c. $c would then be an array with two elements, which correspond to the additions of the two lines of $a and $b. I think your foreachs are causing you to do too many operations (4 when you should be doing 2). --Mr.98 (talk) 00:31, 19 July 2011 (UTC)
Yes,I am trying to do matrix addition. But the number of elements in $c will be the same as that of $a and $b. For example:
$a= 1 2 3
4 5 6
7 8 9
$b=9 8 7
6 5 4
3 2 1
$c=$a+$b= 10 10 10
10 10 10
10 10 10
Hope you understand what I'm trying to do now. But, accessing one element of a 2D array like $a requires two foreach loops. Then how can I do it if I reduce the number of foreach loops? I know how to do it using for, but I need to do it with foreach. Zebec 20:16, 20 July 2011 (UTC)
- What you want to do is think of it not as going through the values of $a and $b, but as a row/column coordinate scheme. Here's one way. Notice I'm really just using the foreachs to walk me through the dimensions of $a, using the keys as coordinates. It of course assumes $a and $b have the same number of elements — in a robust function, you'd check for that first. Note though that because it is a coordinate-based set of foreachs, it is entirely independent of the size of the array (you could do 2x2 or 3x3 or 4x4 or whatever).
foreach($a as $row=>$rowarray) {
foreach($rowarray as $col=>$val) {
$c[$row][$col] = $a[$row][$col]+$b[$row][$col];
}
}
- It's been awhile since I've done matrix multiplication so it's not obvious to me at the moment (after a long day) how you'd adapt that to multiplication, but it works pretty well for addition, and is simple, to boot! --Mr.98 (talk) 22:48, 21 July 2011 (UTC)
- Thanks a ton Mr.98!! The addition logic above is working perfectly. I really appreciate your trying to help me out after a hard day's work. Thanks a lot!
The logic for multiplication using for is as follows:
<?php
$a=array(1=>array(1,2,3),2=>array(4,5,6),3=>array(7,8,9));
$b=array(1=>array(9,5,4),2=>array(8,6,7),3=>array(5,4,7));
$c=array(array());
for($i=0;$i<3;$i++)
{
for($j=0;$j<3;$j++)
{ $c[$i][$j]=0;
for($k=0;$k<$j;$k++)
{
$m=$a[$i][$k]*$b[$k][$j];
$c[$i][$j]+=$m;
}
}
}
echo "$a=";
print_r($a);
echo "<br> $b=";
print_r($b);
echo "<br> Product=";
print_r($c);
?>
I tried converting it into foreach, and have got the basic logic. Here's the program:
<?php
$a=array(0=>array(1,2,3),1=>array(4,5,6),2=>array(7,8,9));
$b=array(0=>array(9,5,4),1=>array(8,6,7),2=>array(5,4,7));
$c=array();
echo "a=";
print_r($a);
echo "<br>b=";
print_r($b);
foreach($a as $row=>$rowarray)
{
foreach($rowarray as $col=>$val)
{
$c[$row][$col]+=($a[$row][$col]*$b[$col][$row]);
}
}
echo "<br> product=";
print_r($c)
?>
There are two problems:
1. The foreach loop runs only once for each row, but I it need to run thrice (as many times as the number of columns in the first array). If I put a for loop just before or after the second foreach loop, the row counter does not get incremented, but I need it to. How do I go about it?
2.The row and col counters keep changing, so how do I store the result for a particular element into the right location? That is, how can I store the product for a[0][1] into c[0][1]?
So you see, it's almost done,only these two problems need to be resolved. Thank you very much once again for telling me the basic way to traverse a 2D array.
Zebec 21:33, 24 July 2011 (UTC)
Java functions
I am writing a function that I want to return an array of elements of different types. For example, I have a class called "cat" and I want to have a function that returns the cats age and whether it is declawed or not. Age is an integer and declawed is a boolean. I want my method to return both age and declawed in one method as an array. Do I use an ArrayList? How is that used?
public String[] getAgeAndClaws() {
String[] myInfo = {Integer.toString(age), declawed };
return myInfo;
}
This is what I have and I havent compiled it yet, but I dont think it'll work.--v/r - TP 23:52, 17 July 2011 (UTC)
- I don't know if it's the best way, but you can do it with an ArrayList of Object, and then after you receive it from the method you cast each element, but you need to use Integer and Boolean since int and boolean are primitives (hence they don't inherit from Object) - frankie (talk) 00:38, 18 July 2011 (UTC)
// at Cat class
Integer age;
Boolean declawed;
public ArrayList<Object> getAgeAndClaws() {
ArrayList<Object> catData = new ArrayList<Object>();
catData.add(age);
catData.add(declawed);
return catData;
}
// then where you call it
ArrayList<Object> catData = cat.getAgeAndClaws();
Integer age = (Integer) catData.get(0);
Boolean declawed = (Boolean) catData.get(1);
- That works (I didn't post the code above; I believe it was frankie). To the OP: Is there some reason why implementing multiple methods, e.g., getAge(), getDeclawed(), getX(), is unacceptable? Using an ArrayList<Object> and then casting every call to its get() method makes me cringe because it throws type safety out the window, and you could easily trigger several
ClassCastException
s if you're not extra careful as you build on this code (I know it would happen to me!). Perhaps you could tell us more what you're planning to do and we could suggest an alternative.--el Aprel (facta-facienda) 03:34, 18 July 2011 (UTC) - The more I think about it, this is really what objects are for: holding values in memory and providing a useful set of methods for those values. You don't need to put the values into an array; just pass the instance of Cat to wherever you need it and call get() methods for whatever values you need.--el Aprel (facta-facienda)
- I suppose, and I ended up doing it that way. The above was a homework assignment, and actually the requested code was not part of the instruction. I've been a programmer for 15 odd years and never bothered learning Java. The assignment used singular methods to get the information but I've done it this way in other languages before that were less type-sensetive. I appreciate all the help though.--v/r - TP 12:20, 18 July 2011 (UTC)
- The problem is not that you have not learnt Java - actually you do not think in object-oriented terms, which is even worse. Give a look at this page, maybe it can help you.
- By the way, I'm quite dubious about you having been a programmer for 15 years. Returning multiple values from a function is quite a bad idea, and it's widely considered bad practice in any language, even in C. --151.75.17.199 (talk) 23:34, 18 July 2011 (UTC)
- Java and C don't support multiple return values, or provide a nice way to take them. This is certainly not universal. Many languages provide nice features to do this kind of thing. Paul (Stansifer) 08:19, 19 July 2011 (UTC)
- Thanks IP. Actually, I have been programming for 7 years as a hobby and 7 years professionally amounting to 14 years or reasonably rounded to 15. PHP, ASP, ASP.NET, SQL (MSSQL, Oracle, and MySQL), VB6, VB.NET, Javascript, ActionScript 3. I've never had a problem returning multiple values from a function in languages that were less type-sensitive and I've never stumbled across anyone who considered it a bad idea. Your comment makes me question your credentials.--v/r - TP 14:34, 19 July 2011 (UTC)
- Java and C don't support multiple return values, or provide a nice way to take them. This is certainly not universal. Many languages provide nice features to do this kind of thing. Paul (Stansifer) 08:19, 19 July 2011 (UTC)
- The problem is not that you have not learnt Java - actually you do not think in object-oriented terms, which is even worse. Give a look at this page, maybe it can help you.
- I suppose, and I ended up doing it that way. The above was a homework assignment, and actually the requested code was not part of the instruction. I've been a programmer for 15 odd years and never bothered learning Java. The assignment used singular methods to get the information but I've done it this way in other languages before that were less type-sensetive. I appreciate all the help though.--v/r - TP 12:20, 18 July 2011 (UTC)
- That works (I didn't post the code above; I believe it was frankie). To the OP: Is there some reason why implementing multiple methods, e.g., getAge(), getDeclawed(), getX(), is unacceptable? Using an ArrayList<Object> and then casting every call to its get() method makes me cringe because it throws type safety out the window, and you could easily trigger several
July 18
Computers and ambient temperatures
Can today's desktop computers and flat-screen monitors operate safely and seamlessly in ambient temperatures between 80 and 100 degrees F? Is it ever dangerous (for the health of the computer and/or screen) to do so? Bielle (talk) 00:35, 18 July 2011 (UTC)
- 100 F is probably around the upper limits of what is advisable - My Acer netbook manual for example gives a maximum operating temperature of 35°C (95°F). I'd check the manual for your particular computer. If you have to routinely use it in these temperatures, I'd check that the cooling is working efficiently - vents not blocked, free of dust inside etc. With a laptop, the surface you put it on can make a difference too - something hard (so vents aren't blocked) that conducts heat well would be ideal. Your lap is ironically probably the worst place for a laptop in these conditions, and it may not be too comfortable either. AndyTheGrump (talk) 00:57, 18 July 2011 (UTC)
- Hard drives will die earlier from excessive heat...unless you have a rugged computer, or custom cooling...you shouldn't run it at 100 degrees.Smallman12q (talk) 01:59, 18 July 2011 (UTC)
- Erm, I ain't no physicist (as is probably obvious), but I think that link illustrates a flawed understanding of thermodynamics. To quote: "They [HD's] only consume around 10 or 12 watts under load, and around 7 watts at idle. But unlike your CPU, they're generating a lot of mechanical movement, which means friction-- and heat disproportionate to the power input". If they are generating more heat output than power input, we have a competitor for Andrea Rossi's Energy Catalyzer, and can build ourselves computers that actually push electricity (I said I wasn't a physicist) back into the mains socket. If they are consuming '10 or 12 watts', I'd hope that most of it is being converted into heat, as all the alternatives wouldn't do the computer and/or the user much good. AndyTheGrump (talk) 02:13, 18 July 2011 (UTC)
- I think you just misunderstand his using of the word "disproportionate". I think what he means is that more energy per watt input is lost as heat by the hard drive than other computer components. -RunningOnBrains(talk) 04:31, 18 July 2011 (UTC)
- I don't think so. The comparison to the CPU suggests that he's very confused. He implies that the CPU is frictionless, or nearly so, and that it emits less heat in proportion to input power than the hard drive, both of which are completely wrong. -- BenRG (talk) 07:10, 18 July 2011 (UTC)
- Neither the CPU nor the hard drive are doing any net work (they're not carrying water uphill or charging a battery), so 100% of the input energy ends up as heat. Also, Watts measure power, not energy. 130.76.64.121 (talk) 17:20, 18 July 2011 (UTC)
- I don't think so. The comparison to the CPU suggests that he's very confused. He implies that the CPU is frictionless, or nearly so, and that it emits less heat in proportion to input power than the hard drive, both of which are completely wrong. -- BenRG (talk) 07:10, 18 July 2011 (UTC)
- I think you just misunderstand his using of the word "disproportionate". I think what he means is that more energy per watt input is lost as heat by the hard drive than other computer components. -RunningOnBrains(talk) 04:31, 18 July 2011 (UTC)
- Actually one of the few relatively recent (2007) large scale public studies has suggested temperature isn't that big a factor within the first 3 or so years and also only at the extreme (e.g. 45 degrees C) [2]. Even the page you linked to talks about 45 degrees C. In other words, 100 degrees F should ambient temperature shouldn't have a massive effect on life span unless you have poor airflow. Decent airflow is obviously important under such ambient temperatures since you ideally want to keep the HDs under 45 degrees C. Incidentally that page seems a bit silly for reasons other then physics, you should always be worried about data loss no matter what your HDD temperature so should keep backups of important data. And BTW, people do use computers in countries where temperatures close to that range aren't uncommon and commonly they aren't rugged. If you're throwing your computer around or exposing it to sandstorms or rain or whatever then you may want one, but there's no reason to recommend it for 37 degrees C. Nil Einne (talk) 03:28, 18 July 2011 (UTC)
- Erm, I ain't no physicist (as is probably obvious), but I think that link illustrates a flawed understanding of thermodynamics. To quote: "They [HD's] only consume around 10 or 12 watts under load, and around 7 watts at idle. But unlike your CPU, they're generating a lot of mechanical movement, which means friction-- and heat disproportionate to the power input". If they are generating more heat output than power input, we have a competitor for Andrea Rossi's Energy Catalyzer, and can build ourselves computers that actually push electricity (I said I wasn't a physicist) back into the mains socket. If they are consuming '10 or 12 watts', I'd hope that most of it is being converted into heat, as all the alternatives wouldn't do the computer and/or the user much good. AndyTheGrump (talk) 02:13, 18 July 2011 (UTC)
Thanks, folks. Well, there goes that argument for getting air conditioning. Sounds like the computer is more at risk from wildly shedding cat. Bielle (talk) 16:34, 18 July 2011 (UTC)
internet speed
hi,
i have always used torrents for downloading and uploading movies and tv shows, and was quite happy with the speed i got (200 kbps), but suddenly, a week back, the speed dropped to, like, 20, or sometimes, even 10. but when i download from megaupload or a normal download through my web browser (chrome), the speed is back at 200.
can anyone explain the drastic difference in speed?
thanx — Preceding unsigned comment added by 117.197.233.58 (talk) 03:47, 18 July 2011 (UTC)
- It sounds like your Internet provider has probably implemented Traffic shaping and they're now limiting the speed of torrents. The only way to be sure is to literally ask them if this is the case, although if you haven't changed any hardware/software your side then it must be them though. ZX81 talk 04:05, 18 July 2011 (UTC)
You might want to randomize the ports you're using, or switch clients. ¦ Reisio (talk) 03:23, 19 July 2011 (UTC)
- Well, there is also the slight possibility that there aren't that many seeders with fast connections for a particular file the OP wants to download. Hence the slowdown. --Ouro (blah blah) 06:26, 19 July 2011 (UTC)
(Advanced networking) Bridging routers with multiple internet connections
Hi all. I saw the above (unanswered at the time of writing, doesn't bode well for getting an answer here!) question on extending a wireless internet connection with two routers. My question is related, but different. Imagine a situation where you have a row of houses, say...5. Every house has an internet connection and a router. Is it possible to bridge these all together, sharing the cumulative internet speed equally to any and all IP addresses given out? Assume for simplicity that each house uses a different provider and therefore aren't hogging the same bandwidth for that street. My limited knowledge of how these things work tells me that one router has to be "master" and all others are clients, so would that preclude the internet connection from the clients from being routed to the overall network? --Rixxin (talk) 16:04, 18 July 2011 (UTC)
- At a theoretical level this is all perfectly possible. Professional network-grade switching and routing equipment has all kinds of high-capacity and high-availability features that allow channel bonding, dynamic trunking, adaptive load balancing and route failover. The path your packets take around your ISP's network, or around a large internet company like Google, or indeed over the public telephone network, can be through a varying network of fused and redundant connections, where switching equipment knowns about its peers and routes traffic intelligently. This kind of stuff is just what you'd expect from mainline equipment from Cisco, Nortel, Juniper, and the like. Whether it's a hierarchical scheme or not, or whether it's a master-slave scheme or not, is just a function of the inter-router protocols used. But things fall apart when people try to do this kind of stuff with the rinky dink home ADSL modem/routers they bought at Fry's for $60; building redundant channel-bonded failover networks isn't a feature that Linksys and Netgear and Belkin see as applicable for this market, so these products don't try to address this. -- Finlay McWalter ☻ Talk 16:39, 18 July 2011 (UTC)
computer makes continuous beeps before loading the bootloader, but my hardware seems fine?
I didn't know if I caught a virus while on spam patrol (I was vetting a known spamming IP's edits and the links they put up).
Basically the system (a Windows Vista) suddenly without warning started the soft shutdown process (i.e. windows closed one by one). When the system rebooted, the BIOS loaded fine and the power self-on test seemed to be okay -- no fatal errors by text, but when it starts time to load the bootloader it starts making very loud beeping noises.
I used a ubuntu flash drive (I also have ubuntu on the system) to try to diagnose the problem. I am going to try to change the default bootloader to Linux to see if it's merely a corrupted boot sector, but I've never had a problem like this before. I tried reinstalling grub (without changing configuration files) on the master boot record. This fixes the beeping problem, which makes me think it's a boot sector virus. However, grub won't load and the screen is blank. I can boot from the ubuntu flash drive successfully though, and it sees everything.
elle vécut heureuse à jamais (be free) 17:46, 18 July 2011 (UTC)
converting mid to mp3 AND editing jpg photograph
I would be grateful if a user could please answer the following two questions. 1) how do I convert a song downloaded as mid to mp3? 2) how can I crop a photograph saved as jpg and also how can I enlarge it? Thank you.Simonschaim (talk) —Preceding undated comment added 18:39, 18 July 2011 (UTC).
- For 2) Irfanview. 92.28.249.93 (talk) 20:22, 18 July 2011 (UTC)
- For 1) use TiMidity++ to render MIDI to WAV, and then Audacity (or lots of other things) to convert the WAV to MP3. For the first part, at the command line, you do something like:
- timidity foo.mid -Ow which will create foo.wav
- -- Finlay McWalter ☻ Talk 21:11, 18 July 2011 (UTC)
Thank you Finlay McWalter. I found your information very helpful. Simonschaim (talk) —Preceding undated comment added 14:35, 19 July 2011 (UTC).
July 19
torrent speed
when i started downloading lost season 3, the speed was like 150 kbps. when it was 25% done, i ended the session. but the next day when i resumed, the speed dropped to 10-20 kbps, or even 5.... and it's still going on... (this is the 3rd day; on my normal speed, the download would have finished by now)
can anyone tell me why? is there something wrong with my torrent or my internet connection? — Preceding unsigned comment added by 117.197.247.76 (talk) 01:21, 19 July 2011 (UTC)
- You already asked this question recently; look a little up the page for the answers to it. --Mr.98 (talk) 01:44, 19 July 2011 (UTC)
Cheat sheet program
What program could be used to create documents such as this or this? I can't get Word to do that, and although I could write a GUI in Java, with all sorts of JPanels, there's hopefully a better way. Any thoughts? KyuubiSeal (talk) 05:39, 19 July 2011 (UTC)
- Doing this in a word processor isn't difficult. Just create a table and merge-cells as needed, and (for one that resembles the HTML cheatsheet) turn off the borders for cells. The only thing that you might not be able to trivially do is the gradient fills in the Jquery sheet (I don't have a recent version of Word; OpenOffice-Write doesn't do gradients for this). Or you could easily do this with HTML+CSS (gradients too). -- Finlay McWalter ☻ Talk 13:28, 19 July 2011 (UTC)
- Oh, darn. I completely forgot about merging cells. The sheet I'm writing is on HTML, so I could do it that way too. Thanks! KyuubiSeal (talk) 14:53, 19 July 2011 (UTC)
Computer attempts to boot, fails, and repeats until unplugged.
Not long ago while plugging in my iPod, I noticed my computer seemed to have electricity running through it (where it's not supposed to run). My hand would feel weird, and start to tingle and then hurt when I touched any metal part on the case, I immediately turned off the computer, unplugged it, took it off the ground, and left it alone for a few days. I came back, opened it up, and made sure my motherboard was properly secured, I determined it was, and that there were no foreign artifacts laying around, closed it up, made sure it was still un-grounded, and attempted to boot it up. It turns on, the fans start spinning, the screen stays black, and then it turns off abruptly. It then, without any user input, attempts to start up again. This repeats until the power cord is unplugged.
I troubleshooted it by taking out parts individually. First the DVD drive, no luck, then the RAM, still no boot, then the Graphics Card, still nothing, finally I removed the heat sink and processor and it finally booted up (as much as it could).
Any ideas as to what could be wrong with it OTHER than the processor? I'm really not looking forward to shelling out a few hundred dollars for a new one.
Regards, EvlD — Preceding unsigned comment added by 76.7.238.176 (talk) 07:18, 19 July 2011 (UTC)
- I have no idea what's happening, but my first instinct is that the case is faulty. General Rommel (talk) 08:28, 19 July 2011 (UTC)
- It sounds very much like a faulty power supply. These are easily replaced by someone who knows what they are doing, but as General Rommel suggests above, you should first check that the incoming connection is not shorting to the case. Dbfirs 09:25, 19 July 2011 (UTC)
- (edit conflict)The "my computer seemed to have electricity running through it" may be the key. If the mains voltage is leaking to the case it could, potentially, be dangerous. ☠ Caution is advised!
- If the power supply is faulty that may well explain the "boot up, boot fail, restart loop" the OP is experiencing. (I recall I had a motherboard that had a BIOS setting that caused it to automatically restart after a power failure.)
- It was a possibilty that a component had failed causing excessive current drain that might cause the power supply to shut down and re-start. N.b. A PC cannot boot while the RAM is removed!
- If possible try another power supply. Or try adding components one by one to see if it causes a failure.
- Here are a few links to tech help forums for "computer constant reboot" as the topic: computing.net, techsupportforum.com, certforums.co.uk, and whirlpool.net.au.
As for the final question, the Motherboard itself could be faulty. In the forums it was found that faulty reset switches and evan a HDD LED cable were the problem. - 220.101 talk\Contribs 09:50, 19 July 2011 (UTC)
Program takes eons to load
I'm trying to use VLC player to stream TV over the local network (that's a whole different set of problems) but it takes upwards of 10 minutes before VLC actually loads/opens from the moment when I click on it. Had a google but no real ideas, thought maybe it was something to do with the new antivirus I just installed, Viper --131.172.80.142 (talk) 09:32, 19 July 2011 (UTC)
- ...well if you disable the A/V temporarily, you'd know. Alternatively, check how much RAM you have. ¦ Reisio (talk) 18:31, 19 July 2011 (UTC)
Can I use PHP to create web-based computer algebra systems? 474,456,499 24,485,729 14,939,942 11:37, 19 July 2011 (UTC) (Please answer on my talk page)
- Yes. You have one page in which a person enters the data. Then, that page sends the data to the server. On the server, PHP is used to do the calculations. Then, the results are sent back as a new page. If you don't include AJAX, you are limited by using an input-response program. With AJAX, you can use an event-reaction based program. -- kainaw™ 16:10, 19 July 2011 (UTC)
Doing it all entirely in JavaScript is also possible. ¦ Reisio (talk) 18:32, 19 July 2011 (UTC)
- Some time ago I created a fairly trivial PHP front-end to the GNU Octave command line. You can download a symbolic algebra system for Octave, and then drive it through a similar web-based PHP interface. All you really need to do is have your PHP program send input and receive output from a command-line.
- If you prefer, you can use PHP to drive another computer-algebra system, or try to design your own symbolic representation system yourself, implemented in PHP. Nimur (talk) 21:33, 19 July 2011 (UTC)
PC to TV with HDMI/DVI-D
Hi, I'm wondering if someone can help, I've just got a new LCD tv and I'm trying to hook the PC up to it. I've connected a HDMI to DVI-D (dual link) cable (hdmi at tv side) and a single 3.5mm audio cable between them & there is a picture, but when I try to watch an avi file (using Nero showtime) both the tv & PC pictures go all blocky. When I unplug the cable the blockyness goes away. When I'm not playing a video file the pc picture displays on the tv clearly. Can anyone give me some advice? I'm thinking it must be an issue with the cable (too long? it's 5m, interference?) rather than the graphics card as video plays ok on the pc itself. Thanks AllanHainey (talk) 18:39, 19 July 2011 (UTC)
- Blocky artifacts are often a symptom of a computer that is too slow. To be more technical, it means that frame output took place before video decompression was completed. If your graphics card (or computer CPU) can only marginally decode the video when one screen is hooked up, the addition of a second screen (your television) may push the system to its capacity - you may be out of video RAM, or may simply not have enough cycles on your GPU or CPU to produce output for both screens and decode the video at a high frame-rate.
- If the issue is visible only with large (high-quality) files, but goes away when you play smaller (low-quality) files, that almost certainly confirms this diagnosis. Consider upgrading to a more powerful graphics card (or CPU) that has better support for dual-display. Nimur (talk) 19:05, 19 July 2011 (UTC)
- Thanks, I'll hunt down a small low quality video file to check if there's the same issue & try it with the computer screen unplugged too. Out of interest is there a way to determine whether its a graphics card or CPU issue? - like knowing GPU of X spec can handle up to Y Mb video files?. I'd hate to get a new graphics card & find out it was a too slow CPU. As a related issue where would I check the spec of the graphics card I have installed? AllanHainey (talk) 20:24, 19 July 2011 (UTC)
- Video codecs are a little bit "voodoo-esque" - so there's not a straightforward mapping of GPU performance to video-playback-capability. But the thing you want to look at is bitrate, not file size directly. You can also consider installing a better or newer version of your codec: I highly recommend the ffmpeg suite, or ffdshow on Windows. Both are free software and are very high-performance, hardware-accelerated implementations of the standard video and audio codecs in use today. If you use the VLC player, you are already using ffmpeg under the hood. (Installing VLC is a pretty easy fix for many users: download it from the official website). If the video plays "fine" in VLC, but not in other video players, consider switching (or consider instructing your existing video-players to use ffmpeg, by installing the DirectShow filters in FFDSHOW).
- The trick is that the performance depends on many many factors. The most important factors are the input (compressed) bitstream bitrate; the output (uncompressed) video size; and the number of encoding features in use (motion vectors, block comparisons, and so on). Each of those parameters were decided by whoever created the video file, and were tuned for file-size, performance, and image quality on the creator's machine. You can use ffmpeg to perform video codestream analysis, but this is a bit more technical than most users want to get. What you really want to determine is (1) whether you can, on average, decode each full frame faster than you need to display it on screen; and (2) what behavior your codec (and video player software) prefer to use if you can't meet that requirement (a dropped frame): the frame can be dropped entirely (all processing on it is stopped, leaving behind the last frame that completed, or a blank screen); or the frame can be rendered before it's ready (resulting in any number of weird-looking images, the least of which include blocky-artifacts).
- You can get some ballpark comparative numbers for different hardware configurations from these video and image-processing benchmarks: CPU Core Performance and Graphics Card Performance benchmarks from last month at Tom's Hardware. In some unusual circumstances, your video playback performance may also be limited by main memory (total amount of RAM on your computer); or by hard-disk speed; but those are not commonly the most serious bottleneck on a modern computer. Nimur (talk) 21:12, 19 July 2011 (UTC)
- What CPU load does Task Manager report? CS Miller (talk) 11:43, 20 July 2011 (UTC)
- Thanks, I'll hunt down a small low quality video file to check if there's the same issue & try it with the computer screen unplugged too. Out of interest is there a way to determine whether its a graphics card or CPU issue? - like knowing GPU of X spec can handle up to Y Mb video files?. I'd hate to get a new graphics card & find out it was a too slow CPU. As a related issue where would I check the spec of the graphics card I have installed? AllanHainey (talk) 20:24, 19 July 2011 (UTC)
Agree if VLC does not "fix" it your computer is too slow, I had same problem using a dual core windows 7 laptop 4GB RAM etc etc pluged into a giant LCD TV; the came-with-it Cyberpathic DVD s/w was a pig but VLC just played those DVD. But nah a dedicated DVD player is almost free and the TV has a USB port for memory sticks, the laptop is now back on my lap!
81.109.247.189 (talk) 22:35, 19 July 2011 (UTC)
Could it be that the TV doesn't support HDCP? If a HDMI source is connected to a DVI-D display, then it is unlikely that HDCP can be established. The program is then informed of this, and can decide not to display the picture, or only display a degraded version of it. CS Miller (talk) 11:43, 20 July 2011 (UTC)
- Thanks for the advice guys,
- Csmiller - when I'm playing a large video file with both screens plugged in the CPU is showing around 36-42%ish, I'm surprised its as low as that frankly.
- I tried running a smaller, less graphics intensive, file and it displays fine, so its not a HDCP thing. I also tried unplugging the computer monitor while playing a large file, but it doesn't make any difference to the picture, still blocky.
- VLC works though, I just played some heavy graphics part of a big file & the picture was perfect. So I take it from that that that the performance issues using Nero as a viewer were down to the codecs. I'll look into the ffmpeg, etc codecs & see if I can get them to work with Nero. I could always use VLC but I prefer the layout on Nero.
- Thanks for allthe help AllanHainey (talk) 19:56, 21 July 2011 (UTC)
Bytes free on a Commodore 64
![](http://upload.wikimedia.org/wikipedia/commons/thumb/4/48/C64_startup_animiert.gif/220px-C64_startup_animiert.gif)
The start-up screen of a Commodore 64 says:
**** COMMODORE 64 BASIC V2 **** 64K RAM SYSTEM 38911 BASIC BYTES FREE READY.
The READY.
message comes from the BASIC interpreter, everything before that is a start-up message text. However, when I have done a thorough memory search of the Commodore 64 (by using a loop that PEEK
s at every single memory location) I have only found the "**** COMMODORE 64 BASIC V2 ****
", "64K RAM SYSTEM
" and "BASIC BYTES FREE
" bits. Therefore the number 38911 has to be dynamically calculated. But on every single Commodore 64 that I have used, it has always been the same. The Commodore 64 doesn't even use the nowadays ubiquitous method of allocating memory dynamically, instead its memory map is fixed. Has there ever been a case where the computer has reported some other number than 38911 as the number of free BASIC bytes on start-up? JIP | Talk 19:03, 19 July 2011 (UTC)
- The number doesn't necessarily have to be dynamically calculated, it could be hard-coded as a constant. The source code for BASIC interpreters in those days was written in assembly language, and disassembled versions can be found here and there, so in principle it would be possible to figure out how it worked. Looie496 (talk) 19:26, 19 July 2011 (UTC)
- (From my very faulty old memory...) When the system loads, it places the main system at the top of RAM. So, the memory pointer begins at the end of the entire 64k. It decrements as memory is filled with all the background operating stuff. When it is done, it shows where the memory pointer is - which happens to be how much memory is available. If you have faulty memory, you will see something different. That was rare, but I saw it happen to one (and only one) C64. It reported 0 basic bytes free. It was possible to change how many bytes were free by using the cartridge, which could be directly mapped to RAM. An example is Simons' BASIC. (cool - there's and article with a screenshot of the altered basic bytes free!) -- kainaw™ 19:35, 19 July 2011 (UTC)
- This may interest you: http://www.pagetable.com/?p=48 2.97.220.86 (talk) 19:49, 19 July 2011 (UTC)
- Here are some more details, sure to be either boring or delightful depending on where the C=64 fits on your nostalgia scale:
- It's done in 2 layers: first, a probe by the kernal to determine the usable RAM area, and second, the BASIC interpreter deciding to all of it, minus one byte. Note that the 38911 byte BASIC program area is just the largest contiguous chunk of free memory. There is another fairly large unused area of 4096 bytes starting at $C000, between the BASIC ROM and the device I/O ports. That's a good place to store stuff that needs to coexist with a BASIC program, since BASIC won't mess with it.
- $FD50 is the early kernal routine that scans memory, starting from $0400 (it scans upward, not downward as Kainaw said). It writes $55 then $AA to each address, reading them back to make sure the write was successful, and stopping when an unwritable address is found. The unwritable address (normally $A000, the first byte of the BASIC ROM) is recorded at $0283, the "top of memory" pointer. There's also a "bottom of memory" pointer at $0281, which gets set to a hardcoded $0800. (The memory from $0400 to $07FF is used as video RAM in the default text mode so it's effectively unusable for other purposes.)
- Later, the BASIC setup routine $E3BF queries the kernal for the top and bottom of memory (by calling $FF9C and $FF99) and copies the "bottom of memory" pointer to $2B and the "top of memory" pointer to $37. It increments $2B, making it $0801, and stores a zero byte at $0800. The single zero byte at $0800 is important somehow... if you change it, BASIC gets confused. I don't know exactly why.
- After the setup is done, the routine at $E422 prints the startup message. To compute the number before "BASIC BYTES FREE" it subtracts the value at $37 from the value at $2B. In the normal situation, that's $A000 - $0801 = $97FF = 38911. 67.162.90.113 (talk) 21:13, 19 July 2011 (UTC)
- A cartridge can contain a ROM which is mapped at $8000-$9FFF, which will overlay (for reads) the RAM normally present there; the write-and-readback on an address confirms that it's not overlaid. There's usable RAM under the BASIC ROM too (and, academically, under KERNAL). The ROM overlays can be switched in or out with pullups on the HIRAM and LORAM lines on the cartridge port. I don't think there's a definitive way to detect (in software) a cartridge (except that, for it to hook the kernal it needs to have a signature at $8004), so kernal needs to check at least the cartridge-rom and basic-rom spaces to see if they're overlaid in the current memory map). But a scan from $0400 is more thorough than that needs (a simple read/invert/write/read at $8000 and again at $A000 would be sufficient). I can't help wonder that, rather than Kainaw's bad-memory theory, it's a holdover from the VIC-20, which could contain a variety of different RAM sizes depending on expansion cards. -- Finlay McWalter ☻ Talk 22:16, 19 July 2011 (UTC)
- Indeed, the scan, and the 64's rather bonkers memory map (all that lovely space at $C000 gone to waste) makes a lot of sense if you imagine that, while they were designing the C=64, maybe they were considering selling a cheaper "Commodore 32" (the same machine but with the two high RAM chips missing). Even in a C=32 the CART-ROM, BASIC-ROM, VIC-IO, SID-IO, CIA-IO, CHAR-ROM, and KERNEL-ROM images would all be at the same place; the only change would be that they would need to move the colour-RAM from $D800 (which is a VIC register setting). I stress I've no evidence that a C=32 was ever countenanced, but back in them days when 32k of RAM cost an appreciable sum, having an option for that would make sense. -- Finlay McWalter ☻ Talk 22:36, 19 July 2011 (UTC)
I want to keep bookmarks, but not have them pop up in Google chrome's autocomplete?
Is there any way? I want them organised in neat folders for research but I don't want them interfering with my search results. elle vécut heureuse à jamais (be free) 22:41, 19 July 2011 (UTC)
- In Firefox, you can use bookmarks but disable the "smart completion" in the URL bar by setting the MaxRichResults parameter to -1. I do not think there is an equivalent option in Chrome, by design: Google intends for Chrome to assist you in finding the page you are looking for. Here is some more information specific to Chrome: Predictions in the address bar, and some information for disabling some parts of the prediction service. Nimur (talk) 00:47, 20 July 2011 (UTC)
- I'll check that out, but it probably won't solve my problem. Thanks anyway! elle vécut heureuse à jamais (be free) 07:28, 20 July 2011 (UTC)
July 20
Programming in MS Visual Basic
Can you do it without buying expensive tools? — Preceding unsigned comment added by 88.8.79.148 (talk) 00:56, 20 July 2011 (UTC)
- Visual Studio Express is available at no cost. Products for all of the Microsoft development infrastructure are available at http://www.microsoft.com/express - including Visual Basic Express. All of the Microsoft Developer Network tutorials, API documentation, and information are available for no charge at http://technet.microsoft.com and at MSDN.microsoft.com. The official Microsoft Visual Basic Developer Center contains a lot of getting-started guides, tutorials, and technical notes. Nimur (talk) 02:49, 20 July 2011 (UTC)
- If you want to try it on linux, you need something called Mono (software) for .NET Framework.[3] I kid you not. 99.2.148.119 (talk) 04:15, 20 July 2011 (UTC)
You'd be better off learning C or Perl and using a free text editor and compiler. ¦ Reisio (talk) 05:20, 20 July 2011 (UTC)
- The OP specifically asked about programming in VB, so why should you assume he'd be "better off" doing something else? AndrewWTaylor (talk) 09:47, 20 July 2011 (UTC)
It's not an assumption. With C or Perl he can do more for less for longer and will be more employable. ¦ Reisio (talk) 21:18, 20 July 2011 (UTC)
- Reisio, it's considered bad form to answer questions in this manner. It's not productive. If someone says, "what flavor of Windows should I get?," answering, "forget Windows, get Linux" is considered out of line for the Ref Desk. Your comment above is similar enough. If the OP asks, "what language should I learn?", feel free to offer suggestions, but if it's a question about VB, you should just let it slide. Anyway, you are making an assumption about what "better" means in the OP's context — assuming that doing "more for less" and being "more employable" (in some vague sense) is the "better" option. It might not be, though — the OP might be asking, for example, because the OP already has a job that requires learning VB, or because the code he or she wants to edit has already been written in VB, or whatever. That's what AndrewWTaylor is no doubt getting at. No language is objectively "better" than any other; it is always relative to the values one has in mind (some people want a language that sounds like an ape — in which case, Perl would be an awful substitute compared to Ook!). --Mr.98 (talk) 02:21, 21 July 2011 (UTC)
- I concur. In addition the claim the OP will be more employable is unsupported by any ref. Do you know what the employment market for VB, C and Perl are in Spain? Nil Einne (talk) 08:58, 21 July 2011 (UTC)
- I am not sure even in the US. My impression is that people developing in VB and other .NET products make up a huge percentage of the programming workforce even in the USA. I was surprised by this since one's experience amongst computer folk on the internet would lead one to think that they all write in Perl and use Linux, but I'm not sure that actually reflects the developer market. (And for the record, I loathe VB.NET, but what can you do.) --Mr.98 (talk) 14:51, 21 July 2011 (UTC)
- Mr 98 has said much of what I was going to add. Other assumptions Reisio has made are (1) that the OP doesn't already know C and Perl; and (2) that he wants work as a software developer using VB: there are other possible reasons for the question. AndrewWTaylor (talk) 09:26, 21 July 2011 (UTC)
- I concur. In addition the claim the OP will be more employable is unsupported by any ref. Do you know what the employment market for VB, C and Perl are in Spain? Nil Einne (talk) 08:58, 21 July 2011 (UTC)
Thanks for the answers. No, I don't want C or Perl or whatever. I myself can program in Java, but I was not asking for me. I wanted to install a VB environment for someone at an entry programming level, in the same way people learned Basic as an entry level language (and then moved to another, more commercial language). 88.8.79.148 (talk) 19:43, 21 July 2011 (UTC)
Is it possible to fool installer programs into thinking you have admin access?
I know some installer programs call for admin access (and will shutdown without it) when their program has no need to be administrator. According to this video [4] by recompiling the installer code I can eliminate this requirement, but are there any other ways? 128.143.175.123 (talk) 04:26, 20 July 2011 (UTC)
- This doesn't answer your question but is relevant to what you're trying to do; you could try using Universal Extractor to simply extract the program from the installer. This should work for programs that do not require registry changes and special drivers to be installed. AvrillirvA (talk) 10:47, 20 July 2011 (UTC)
how does a computer decide to allocate computations to a graphics card?
I've tried googling this (howstuffworks yay) -- but I am still rather confused. Does the main CPU simply say, "oh look here is some information that looks like vector information! I'm sending it over to the GPU?" If I make a graphically intense program, with my draw functions and so forth, I'm guessing I am using libraries that explicitly makes calls to a graphics card? I notice that say if a dedicated graphics card is absent, the CPU can do the task anyway. It's bad at it -- but it can still do it. elle vécut heureuse à jamais (be free) 07:30, 20 July 2011 (UTC)
- A programmer explicitly instructs the program that certain functions will execute on the graphics card. In the case of a modern GPGPU, using a programming environment like CUDA or OpenCL, here's the general process:
- A special set of instructions are written using a specialized programming language (CUDA or OpenCL)
- A special compiler is used to convert that into machine code for the GPU (not for the CPU)
- A specialized linker with knowledge of the graphics device driver is used to cross-link the GPU code with a standard (e.g., x86) program.
- At the lowest level, the way this works is with memory mapped I/O. A programmer who has access to the spec-sheet for your CPU, your motherboard, and your graphics bus writes a special C program that gets compiled using a driver development kit (in other words, a compiler who produces privileged code that has unprotected access to machine IO and memory, in a way specific to your operating system). By writing values to certain memory locations, the graphics bus communicates the GPU program to the graphics memory and triggers a start-of-execution.
- In the case of graphical (non-GPGPU) programming, all of the above is generally true; simply replace "CUDA" or "OpenCL" with "DirectX" or "OpenGL." As before, the programmer writes code in a slightly modified variant of the C language, then compiles it and links it against the device-driver and the host executable that runs on the CPU.
- Today's technology is not able to automatically detect that certain code is vectorizable and "decide" to run it on the GPU automatically. However, at compile-time, certain compilers can auto-vectorize to take advantage of SSE, multiple cores, or other vector instructions if they are built onto your CPU. On many modern CPUs, that type of vectorization can even be determined at runtime, using advanced out of order execution and similar runtime code reorganizations/equivalent-code-substitution. Nimur (talk) 11:33, 20 July 2011 (UTC)
- I guess I should have mentioned: if you use a graphics library function, or a GPGPU library function, then all of the above work was already done for you by another software programmer; but at some level, somebody had to write the code and the commands to explicitly invoke the GPU. For example, every time you write a "draw line" call, or a "rotate and scale texture and render it to screen" function, the library is delegating that to a pre-built graphics routine that manages memory transfer and GPU instructions.
- The onus is on you, the user of a graphical drawing library, to learn whether the library uses the GPU, uses the CPU, or makes an intelligent decision at run-time to select hardware- or software-rendering. Such a detail should be clear from the library's documentation. Nimur (talk) 11:43, 20 July 2011 (UTC)
- Thanks so much! Last question: say a dedicated graphics card is absent, and we have to use that awful onboard integrated video card. I know awful performance is a given, but what exactly happens in that scenario, as far as instruction passing goes? elle vécut heureuse à jamais (be free) 19:58, 20 July 2011 (UTC)
- There's a difference between "integrated GPU" and "no GPU." If your system has no GPU, a few things might happen, depending on exactly what code you executed.
- If the library is smart, it will check the system hardware before executing code. Essentially, think of it as an if-statement that gets executed: if (hardware present) { use_hardware() ; } else { run_a_different_function_on_cpu(); } - and hope that the different function on the CPU produces similar results, albeit slower.
- If the library is crummy, it just assumes hardware is present, writes commands to non-existent memory locations, and potentially crashes your computer. You might see a segfault, or a blue-screen-of-death, or something similar.
- An integrated graphics card usually has fewer capabilities, and less RAM. The software may query those capabilities, and decide (again, with an if-statement) whether to even try to run certain code. For example, in a video game, the software may realize your GPU is "weak" and decide not to animate clouds in the background. For example:
- if (gpu_ram > 10000) { render_clouds(); }
- else { /* don't bother */ }
- You can use your imagination for more specific/realistic cases. Some software may make more dynamic decisions, based on measured performance (i.e., how long did it take to run the last block of code? Consider,
- if (execution_time > 30 ms) { skip_rendering_clouds(); }
- Properly-designed drivers essentially consist of the above pseudo-code "if" statement for each possible hardware-accelerated function. So, when GPU-A supports several functions, and GPU-B does not, and Computer-C doesn't even have a GPU, all three can run the same program with the same driver, who will intelligently decide which parts of code need CPU emulation, and which code needs to be skipped/ignored. In this way, well-designed graphics systems made by competent software-engineers are termed "scalable." Nimur (talk) 21:50, 20 July 2011 (UTC)
- There's a difference between "integrated GPU" and "no GPU." If your system has no GPU, a few things might happen, depending on exactly what code you executed.
- Thanks so much! Last question: say a dedicated graphics card is absent, and we have to use that awful onboard integrated video card. I know awful performance is a given, but what exactly happens in that scenario, as far as instruction passing goes? elle vécut heureuse à jamais (be free) 19:58, 20 July 2011 (UTC)
- As a last note - (sorry to drone on so much) - if you want more realistic scenarios than rendering clouds, consider reading:
- Pay close attention to the OpenGL API version supported. Now, read about different revisions of the OpenGL API for specific features. Presto: you now have a series of real, actual capabilities to fill in for your driver's "if (Installed_GPU supports Feature_X) { run_API_function_X1(); }" pseudo-code. Similarly, investigate the various revision-levels for OpenCL, CUDA, and other GPU APIs; and the capabilities offered by other manufacturers' hardware versions. Sadly, the explanations become more obtuse; after you get past the simple scalers, rotaters, and shaders, further graphics-capabilities become a little bit more esoteric than "render clouds". If you're a GPU engineer, "Texture Crossbar Environment Mode" makes perfect sense - of COURSE you'd want one of those to perform routing between different pipe caches! Imagine the performance boost due to reduced bus occupancy in scenarios where a pipe will be re-rendering a texture that was already rendered by a previous pipe! But it's hard to explain such features without giving you a dissertation, and I've already rambled. Nimur (talk) 22:19, 20 July 2011 (UTC)
Missing burner registry entries
I believe after I installed Nero 6, my iTunes started complaining of missing registry entries for burning, and said I should reinstall. I held off on it because iTunes takes an eternity to install these days, but a week or two later when I did reinstall, it didn't help. No burner programs are working. Is there any advice from the help desk on how to fix this? Mxvxnyxvxn (talk) 13:06, 20 July 2011 (UTC)
- It sounds a lot like a problem with the filters settings in the registry, take a look at the Microsoft article here for more information and the changes you need to make to the registry to fix it (Make sure you reboot after changing them). Hope this helps! ZX81 talk 13:29, 20 July 2011 (UTC)
- Tried it, it's still not working. Mxvxnyxvxn (talk) 13:45, 20 July 2011 (UTC)
"what was the last city you logged in from???"
When I tried to log into Google's gmail, it asked me for either the answer to my security question, or WHAT THE LAST CITY WAS THAT I LOGGED IN FROM! Can anyone find any evidence of Google asking specifically the latter question, or was this a phishing (or man in the middle) attack, where it wasn't really Google? I've fallen for a fake paypal message in the past and had my account cleared. This time I just gave the "last city" answer, if it wasn't Google, I can't imagine how anyone could misuse that... Did I do wrong? Thanks... 14:11, 20 July 2011 (UTC) — Preceding unsigned comment added by 188.36.85.63 (talk)
- Have you been logging into gmail from lots of different computers? I once tried to log into gmail from a library computer and it asked me for a mobile phone number to send a text message to "verify" my account. Since I don't have a mobile phone that was pretty much the end of that account and all the messages in it. My advice; don't trust google. Have a backup account, have accounts with other providers like yahoo and aol, and keep local copies of your important emails 82.43.90.27 (talk) 14:14, 20 July 2011 (UTC)
- Yeah I know about "send to mobile", but my quesiton is about the cities - is there any evidence in any forum online that Google actually does that?? Or was it a phisher?? Yeah, I did log in from different cities in different countries, but in order for it to be real, it has to actually be something Google does - which would have evidence on the net or in forums! So, can anyone find anything like that? Does Google do this?--188.36.85.63 (talk) 14:45, 20 July 2011 (UTC)
- I've had it before although it also gave the option to answer the secret question which I chose instead. The best way to avoid phising is to be careful what you visit as a smart phiser (most not bothering) will just replicate what the site actual does meaning knowing what the site actual does and does not do is often not very useful. In particular if you want to visit Google or Paypal or whatever, type in the address yourself and make sure you visit the secure (https) site and check the certificate when it's likely to be needed (although realisticly your browser should warn you). Doesn't trust other sites and particularly not links in email or IM to take you to Google or Paypal. Nil Einne (talk) 18:35, 20 July 2011 (UTC)
- I should add I sometimes use Tor. IIRC I've never received the message before but received it a couple of days ago or so and received it again today suggesting it's a new thing, which may explain why there's not much discussion of it. I can't remember the first time but the one I just got says:
- It looks like you’re signing in to your account from a new location. Just so we know this is you — and not someone trying to hijack your account — please complete this quick verification. Learn more about this additional security measure.
- With the link to the page as shown so there is obviously a Google explanation and it is in fact linked from current verification request itself.
- Nil Einne (talk) 07:45, 21 July 2011 (UTC)
- I should add I sometimes use Tor. IIRC I've never received the message before but received it a couple of days ago or so and received it again today suggesting it's a new thing, which may explain why there's not much discussion of it. I can't remember the first time but the one I just got says:
- I've had it before although it also gave the option to answer the secret question which I chose instead. The best way to avoid phising is to be careful what you visit as a smart phiser (most not bothering) will just replicate what the site actual does meaning knowing what the site actual does and does not do is often not very useful. In particular if you want to visit Google or Paypal or whatever, type in the address yourself and make sure you visit the secure (https) site and check the certificate when it's likely to be needed (although realisticly your browser should warn you). Doesn't trust other sites and particularly not links in email or IM to take you to Google or Paypal. Nil Einne (talk) 18:35, 20 July 2011 (UTC)
- Yeah I know about "send to mobile", but my quesiton is about the cities - is there any evidence in any forum online that Google actually does that?? Or was it a phisher?? Yeah, I did log in from different cities in different countries, but in order for it to be real, it has to actually be something Google does - which would have evidence on the net or in forums! So, can anyone find anything like that? Does Google do this?--188.36.85.63 (talk) 14:45, 20 July 2011 (UTC)
Question about a certain kind of URL
Sometimes, I get URLs with very long strings of characters. For example, the CASSI result for Journal of Biological Chemistry is hosted at
Now there's just no way this has been decided manually, so what exactly am I looking at here? How was it built? Is there a way to "decode" the url? Headbomb {talk / contribs / physics / books} 16:35, 20 July 2011 (UTC)
- They just took whatever info you submitted and encoded it as a string. This is usually called serializing. You deserialize or unserialize to get the original information back. There are many methods for serializing, so it is rather difficult to know exactly what method was used. However, you can see that it contains some repetition that may expose the method. -- kainaw™ 16:58, 20 July 2011 (UTC)
- To try to determine the type of encoding, I did some simple differential analysis. Comparing the results when one searches for 'aaa' vs 'aab' one sees the two strings are almost identical, except for 11 characters after "WXf". As this single bit change in the input changes all 11 output characters (an avalanche effect) it's likely that these 11 characters are a diffuse function of "aaa" etc. I don't know what this function will be, but it's likely something like an md5-hash, truncated, and encoded with something like radix64. -- Finlay McWalter ☻ Talk 17:30, 20 July 2011 (UTC)
- A hash function is a one-way function. That is useless for this purpose. This is a serialization function because it must be two-way. You go one way to turn the user input into a string of characters. You go the other way to turn those characters into the original data. -- kainaw™ 19:25, 20 July 2011 (UTC)
- Hmm.... well alternatively, is there a way to somehow crack the CASSI search engine? I'm selecting "CODEN" and search for "JBCHA3" to get the above string. (The end goal is to have a template that links to the CODEN result from CASSI, based on the CODEN itself, similar to ISSN 0123-4567 Parameter error in {{issn}}: Invalid ISSN. generated from
{{ISSN|0123-4567}}
.) Headbomb {talk / contribs / physics / books} 17:22, 20 July 2011 (UTC)
User-friendly tools to change MAC addresses?
With the recent political prosecution of Aaron Swartz falling close on the heels of the prosecution of a number of luckless teenagers who Wi-Fied to the LOIC website and pressed the button for Anonymous, it sounds like the abuse of MAC addresses for Big Brother purposes has hit the big time. And some years ago I remember reading that IPv6 was going to make them public on every packet of data transmitted anywhere on the Internet! So it seems like the general public needs a lot better tools than the semi-literate instructions in "MAC spoofing" (note: I'm not discussing actual spoofing; merely reliable randomization to protect privacy). Has anyone developed user friendly tools, for example for the typical PC user to ensure that a fresh MAC address is automatically generated each time it is powered up? Wnt (talk) 19:01, 20 July 2011 (UTC)
- What exactly do you want? On most POSIX computers that have an ifconfig utility mechanism, setting the hardware's reported MAC address is trivial: simply edit the network interface configuration file /etc/network/interfaces/ and add a line, hwaddress ether 01:02:03:04:05:06. To do so from a GUI application is trivial; I can write a Java application in about three or ten lines that will display a "GO" button and run a script to do so. But, this only works if your network interface supports software-specified MAC addresses.
- On a Windows computer, there is already a graphical utility, called the Control Panel, that allows you to graphically edit your network interface MAC address. As before, this only works if your network interface supports software-specified MAC addresses. (Here are detailed instructions from Microsoft to configure your network adapter's settings).
- I think you are pre-supposing that a GUI will make this technical-process easy for non-technical users. While it may turn the operation into a one-click "GO" button, it has not simplified the decision-making stages: the user must still know how, why, and when to alter their MAC address; and the user must also profess the level of competence to verify the change, and establish whether the change was sufficient to anonymize their network-transactions, without breaking it. It is these followup steps that require technical proficiency, not the simple act of resetting the MAC address.
- As a last note, you can not change your MAC address "any time you feel like it" and expect zero network side-effects. If you control your own ethernet link, you may be able to get by without any noticeable problem, but you seem to be misunderstanding the purpose of a MAC Address. It is part of the routing stack; it merely resides below the IP layer. Changing the MAC address at random will cause difficulty in the assignment and persistence of a DHCP address, for example. If you are connected to a link with a high volume of systems, all who randomize their MAC addresses very often, you will quickly be unable to receive an IP address, and will be unable to connect.
- All that was rather long. Let me summarize this in one line: randomizing your MAC does not guarantee anonymity, so providing a trivially-simple user-interface would only serve to mislead non-technical users about the complexity of computer-networking. Nimur (talk) 19:44, 20 July 2011 (UTC)
- I went through Device Manager and I don't see any obvious six-byte numbers. There are a tremendous number of 'details' and a whole lot of numbers but not those that I can see. The article suggested it was necessary to do other things like edit the registry to change this, which strikes me as a less than desirable alternative.
- I understand that it's part of the routing, but my assumption (am I wrong?) is that if you change a MAC address, then connect the computer to a new Ethernet plug or Wi-Fi network it's never been on before, there will be no ill effects. What I'm not clear about is whether there are other numbers being released that compromise anonymity - but the goal of any user friendly app would not be to guarantee anonymity overall, but just to guarantee the MAC address was no longer a useful tool to any attacker. Wnt (talk) 20:14, 20 July 2011 (UTC)
- If Windows' Device Manager for your network adapter does not show you a configuration for MAC address, it means that your device (hardware or driver) does not support software-configured MAC address. You can try to customize your network-driver or switch hardware. Nimur (talk) 21:26, 20 July 2011 (UTC)
- Whether there's no ill effects will depend on what it's connected to. For example, if it's connected to a router which rejects any unknown MAC addresses then there will be ill effects. In the unlikely event you have a MAC collision there will obviously be ill effects. And of course even if there's no direct ill effects to your computer, don't be surprised if whoever own the device you are connecting to is not so happy with the negative effects you may cause by continually randomising your MAC address and chooses to ban you (or perhaps banning any MAC addresses they don't know or implenting other measures like a captive portal thereby making problems for others because of your selfishness and paranoia). BTW if you are concerned about your MAC address being exposed via IPv6 just enable privacy extensions or use an OS like Windows which has it enabled by default rather then fooling around with changing your MAC address for no reason. As Nimur has said this isn't going to mean your are anonmymous. Nil Einne (talk) 08:09, 21 July 2011 (UTC)
- I would also note free online games have been using MAC addresses as one of the methods of blocking users for a very long time. And I'm quite sure so have any other competent network admin for tracking and blocked when it's available and needed. In other words, there's nothing new here except perhaps your knowledge of it.
- And I think many people will call in to question whether an attempt to block someone from a network by the owners/administrators because said person's activity was unwanted by said owners/administrators (whether people agree with their view seems moot) is really 'big-brother abuse'. (Note that although the person involved was a fellow at the university involved, it sounds like their access did not come out of that as they used guest accounts to make tracking/blocking difficult.) Even more so when the person involved then goes as far as to secretly install hidden equipment, hiding their face when doing so. Even more so when the reason why they had to go to such lengths is not clear, since their intentions with what they were attempting to obtain are unspecified. And more importantly it doesn't appear as if any actual attempt was made to talk with the people involved, who presuming the intentions weren't to release copyrighted material may have then allowed rather then blocked access. So such ridicilous rigmarole wouldn't be needed to get around the attempts at blocking. This of course is largely distinct from whether or not that warranted prosecution. [5] [6]
- Because of the high data charges in NZ I'm unlikely to be running any wifis which I allow public access any time soon. But if I did and despite being far from a libertarian or a strong believer in the sanctity of property rights, I would definitely do so with the proviso I'm entitled to block whoever I want, for whatever reason I want, and think other people who also choose to make a network available are entitled to do likewise. (And in fact I would be quite angry at those who treat someone else's public network as something they are allowed to do whatever they want with, including carrying out activity that is clearly unwanted. Because of the aforementioned reason that it's liable to lead to restrictions on those of us who respect the right of the people running the network to control what people may do with it, particularly when there is no commercial arragement between the network owners and the person using the network. )
- Nil Einne (talk) 08:09, 21 July 2011 (UTC)
- Perhaps I've been too general here.
- First off, you're telling me that Windows by default will not release MAC address information when connected by IPv6, period? This is good to hear; maybe a sourced statement about this in the right article would alleviate certain paranoia for many.
- Next comes Wi-Fi and MAC addresses. I'm not talking about random users on your company network - just people who drive up to a Wi-Fi hotspot, turn on the wireless network, think they're anonymous, but they're not.
- Then there are the free online games. Is the MAC tracking in that case occurring because the game software is running on the user's computer and prowls around for numbers to send (which is obviously hard to block)? Or are you saying that even over the Internet IPv4 there is some way the MAC address is being released (I hope not!) Wnt (talk) 14:53, 21 July 2011 (UTC)
- 1) GIYF, 2) Wifi "drifters" are anonymous to the extent that their computer doesnt give them away (such as tossing out easily identified cookies or logging into facebook) and that they aren't literally observed by someone looking around the area, and 3) Online gaming systems use the Mac address as a semi-indelible serial number by looking at the local network connection, where it is trivial to identify. IPv4 doesn't embed the MAC data anywhere. And for what it's worth, I agree with those that think "how do i change my mac address to become anonymous?" is begging the question; your mac address is semi-indelible but also essentially local and untraceable to the extent that if you don't willfully identify it (by connecting to a network with it and proceeding to do something that can be traced back to you anyway) you can't be tracked by using it. The Swartz incident was obviously not made any better/worse for anyone by the ability of the perpetrator to change his/her mac address. If you want to be anonymous online, don't go breaking into monitored areas to do things that generate a lot of visibility! --144.191.148.3 (talk) 20:00, 21 July 2011 (UTC)
- The host part of the IPV6 address can be automatically filled using the machine's MAC address. That in no means that it must be filled with the machine's MAC address. It doesn't even mean that it is common to do so (or that anyone at all is doing it). There is a huge difference between what can happen and what is happening.
- You are not anonymous when using the Internet - especially if you use anything that is popular. There is far too much money in tracking users to allow people to be anonymous. Just look at the AOL search dump fiasco and you can see how easy it is to identify people by usage instead of things like MAC addresses and IP addresses.
- It is possible to use MAC address as an identifier. It is more common to let people identify themselves through Facebook or Google+. They sign into the service and then they are tracked on nearly every page they visit. No MAC address or IP address is needed - just the fact that they logged into some social tracking service. -- kainaw™ 20:11, 21 July 2011 (UTC)
Windows thinks my hardware has changed, but it has not.
I have WinXP sp3. I do not have Windows Update running automatically, but go to its website from time to time. The last time I did that, yesterday, it downloaded quite a lot, about eight or nine updates. I also installed two or three programs since then. I used the Windows Clean Up option, and it compressed about twenty times as much material as it usually does. When I went to a computer forum (not sure if I did this before or after the Clean Up), I had difficulty closing the Firefox page and a lot seemed to be being downloaded, so I right-clicked on the "two computers" icon on the bottom right of the screen and chose disable. The icon disapeared.
I restarted my computer to restore this icon, but I got something coming up saying that a lot of hardware on my computer had changed and I needed to re-activate Windows. But no hardware has changed, apart from my changing a DVD drive around a year ago. I restarted my computer, same thing. I used a System Restore point from two days ago, same problem.
Windows says I've got THREE days to re-activate my computer - not the THIRTY days I've seen mentioned on the internet for this problem. I went to Windows Update again to see if this was a known problem. Something about "Windows genuine advantage" came up and I ran it - I remember running it long ago without any problem. It told me to buy Windows 7, which I don't want. It would not let me check for any updates.
I have an old 2nd hand computer. It does not have any disks. I have found the MS sticker on it with a OEM product code on it. It has been working happily without these problems for one or two years. I recall I did the verification for "Windows Genuine Advantage" succesfully in the past.
What has gone wrong? What can I do to fix this? I'd rather get WinXP running again rather than having a sudden forced switch to Ubuntu. 92.24.187.93 (talk) 19:23, 20 July 2011 (UTC)
- Sorry that'll this sound a bit obvious, but have you just tried reactivating it? (you didn't actually say). The same thing that's telling you to reactivate will also give you instructions on how to do this. The easiest way to do this is just to let it do it automatically via the Internet, but there's an phone option as well. However, you said about you found the sticker with the OEM code on it, so is it not stuck to the computer? OEM licence codes SHOULD be stuck to the computer as they aren't transferrable to another machine so I have to ask was it originally from another computer? (or just simply that the original person who built and initially installed the computer neglected to stick it to the machine?). ZX81 talk 20:09, 20 July 2011 (UTC)
- The sticker was stuck to the machine, I did not notice it at first as my scanner was on top of it. I'm puzzled why it says I only have three days to activate, not the thirty days that seems to be standard. I'm wondering if some malware is the cause of this. 92.23.36.253 (talk) 20:17, 20 July 2011 (UTC)
I restarted my computer and chose the "reactivate" option, or whatever its called. After a long pause and getting past the page where MS asks if it can send me lots of spam, it simply said my computer had been reactivated. It did not ask for the product code or anything. What was the point of that, Mr. Gates? Two hours of worrying that my computer was about to become unusable just so that you can try to get me to sign up to spam? That experience was an excellent advert for Linux. 92.23.36.253 (talk) 20:39, 20 July 2011 (UTC)
- The Windows Genuine Advantage update probably forced a reactivation to make sure the software was legitimate (it likely found something that flagged up an alert, but wasn't sure and hence forced re-activation so the Microsoft server would confirm yes/no). That's basically the whole purpose of the WGA updates, to check/attempt to stop piracy of the operating system. It doesn't need your product code because it's already in the registry, it's only stuck to the PC for your purposes incase you need to reinstall it or there's a query. Also, it won't reactivate automatically because people complain about it sending information across the Internet without checking, hence it stopped to confirm with you. Hope this helps to explain what probably happened and glad to hear it's working again now! ZX81 talk 20:51, 20 July 2011 (UTC)
Linux here I come. 92.23.36.253 (talk) 21:09, 20 July 2011 (UTC)
Wiping clean an iPhone
![](http://upload.wikimedia.org/wikipedia/en/thumb/f/fb/Yes_check.svg/20px-Yes_check.svg.png)
My wife has just sold her old iPhone but she wants to wipe clean its memory before handing it over. Any thoughts on how to do that? AndyJones (talk) 19:28, 20 July 2011 (UTC)
- Here is detailed information from the official Apple help site: iOS: Understanding 'Erase All Content and Settings' . You can also take the device to an Apple retail store for assistance. If you don't currently have the device in your possession, but you set up the Find My iPhone application, you can also cleanly wipe the entire device using Find My iPhone's remote-wipe tool. Nimur (talk) 19:37, 20 July 2011 (UTC)
- Hello, you can try this: On your iPhone, go to "Settings", then go to "General", and there should be an option that says "Erase All Contents and Settings". You can try looking here or go to Apple's Support Page for more information on wiping your iPhone before re-selling it. -- Luke Talk 19:39, 20 July 2011 (UTC)
- Great advice, thank you! AndyJones (talk) 19:57, 20 July 2011 (UTC)
- Hello, you can try this: On your iPhone, go to "Settings", then go to "General", and there should be an option that says "Erase All Contents and Settings". You can try looking here or go to Apple's Support Page for more information on wiping your iPhone before re-selling it. -- Luke Talk 19:39, 20 July 2011 (UTC)
iPad app, for only one system
Could a museum develop a very bare bones iPad app for its display, and have it on the tablet for the public to access, without being connected to the internet, without offering it in the app marketplace, without joining the Apple iPhone Developer Program... basically it would be there and there only. Is this possible? -- Zanimum (talk) 20:48, 20 July 2011 (UTC)
- With a wireless routing system you could offer a local web app. ¦ Reisio (talk) 21:22, 20 July 2011 (UTC)
- Really? That's great! -- Zanimum (talk) 15:50, 21 July 2011 (UTC)
- If it's for a public-facing kiosk use, you probably want to disable the general iPad user-interface (both from a security and a ease-of-use-and-support perspective) - that's true either if your interface is an app or, as Reisio suggests, a web-app. Some Google searching suggests this and this; I've no personal experience of either; the latter one also offers some other museum-kiosk type features that you might want. The advantage of a well-written web-app is that it should work much the same on an iPad, an Android tablet, or on a regular Windows, Mac, or Linux PC. -- Finlay McWalter ☻ Talk 16:16, 21 July 2011 (UTC)
- If you really needed it to be an app then you can join Apple's Developer Enterprise Program, which allows you to load apps yourself (without using the app store) - but it costs $300/yr. If you're talking about delivering content to only one, or a handful, of iPads then this isn't a very cost-effective way of doing things. -- Finlay McWalter ☻ Talk 16:36, 21 July 2011 (UTC)
July 21
Backup autocorrect spelling Word 2010
Hi, I'm doing a clean install of Win 7 and was wondering if there is a way to backup the autocorrect spelling entries in Word 2010?
Thanks, --58.175.33.226 (talk) 02:33, 21 July 2011 (UTC)
- If it hasn't changed since word 2007 then this might help.. Vespine (talk) 08:47, 21 July 2011 (UTC)
Sort files into date folders
Hi, I have a bunch of home video files that are just sitting in a loose mass. I was wondering if anyone knew of a program which could automatically sort the files into date folders (the date would be that of creation of the file -> ie when I took the movie).
Cheers, --58.175.33.226 (talk) 06:54, 21 July 2011 (UTC)
- I wrote it as a bash script for my photos. The specific syntax depends on the scripting language you like, but it isn't complicated:
- Set the source folder as SOURCE
- Set the destination folder as DEST
- For each FILE in SOURCE
- Set CTIME to be the file's creation time
- Split CTIME into YEAR, MONTH, and DAY
- If DEST/YEAR does not exist, create it
- If DEST/YEAR/MONTH does not exist, create it
- If DEST/YEAR/MONTH/DAY does not exist, create it.
- Set DFILE to be the same name as FILE
- While DEST/YEAR/MONTH/DAY/DFILE exists
- Append "c" to the front of FILE
- Move SOURCE/FILE to DEST/YEAR/MONTH/DAY/DFILE
- Now, when you run this, it will copy all of the files in the SOURCE folder to the DEST folder in subdirectories for year, month, and day. -- kainaw™ 14:47, 21 July 2011 (UTC)
Python: sum of sets
In Python, if X is a list of sets, what's the customary way to say X[0] | X[1] | ... | X[-1] ? —Tamfang (talk) 07:46, 21 July 2011 (UTC)
- If you had a = [ set([1,2]), set([3,4]), set([5,6,7,8]) ]
- then you could take the union of them with reduce (set.union, a)
- In Python3 you'd need to import reduce from functools -- Finlay McWalter ☻ Talk 09:54, 21 July 2011 (UTC)
- Or, being rather contrarian, set(itertools.chain(*[list(x) for x in a])) -- Finlay McWalter ☻ Talk 12:10, 21 July 2011 (UTC)
- Better set(itertools.chain(*a)) -- Finlay McWalter ☻ Talk 12:22, 21 July 2011 (UTC)
- Or
{x for s in a for x in s}
. But the method below is better, I think. -- BenRG (talk) 18:24, 21 July 2011 (UTC)
- Or
- Better set(itertools.chain(*a)) -- Finlay McWalter ☻ Talk 12:22, 21 July 2011 (UTC)
set.union(*X)
works since Python 2.6. -- BenRG (talk) 18:24, 21 July 2011 (UTC)
How to recover deleted SMS
Is it possible to recover recently deleted SMS from mobile phone that has no blue tooth connectivity say for example an old Samsung SGH X160.If possible will some one give brief idea about the process involved.Ichgab (talk) 11:16, 21 July 2011 (UTC)
- This is the area of digital forensics, obtaining the contents of a digital device including deleted files and data.
- If the messages are stored on a SIM card, you may be able to use a sim card reader (search Amazon or another hardware supplier) to take a dump of the SIM card contents, which may include the text of the deleted message. Various software is available for analysing SIM cards.
- If the messages are in the phone memory, then you need to make a copy of the phone's memory and then search that for possible deleted messages. If the phone has a USB or similar connection, the low-tech way of doing this would be with a bootloader or similar software, which can read and write the phone's flash memory over USB. Such software is available for many phones, though some use encryption. You could then use a hex editor or similar software to study the memory dump. A mobile phone shop that specialises in jailbreaking and unlocking phones would probably have such a tool and might be able to help.
- There are experts in mobile phone forensics who specialise in reading data from mobile phones, which can be important in law enforcement, security, private investigations, and civil legal cases. They use a variety of sophisticated and very expensive equipment e.g.[7] If it was really important you may be able to find a private investigator or digital forensics expert. --Colapeninsula (talk) 12:07, 21 July 2011 (UTC)
General Programming and access times
I just had a question about programming in general, with regard to the speed to access/display information. I am asking this not of any language in particular, so i am looking at almost any language whether it is able to be compiled into executable code or if it is more like scripting and is interpreted on run-time.
The question is, is there a general ranking to the speed of different types of data access and retrieval? For instance... can i say that from shortest to longest, it is faster to....
1. Store data to memory/read it from memory (variables, arrays, etc)
2. Read/Write that data to a file
3. Output information to a screen
I am asking in the interest in learning to code a little more efficiently. I was told by a programming professor that output to the screen generally takes more time, so i should alert the user to something only when necessary. Wouldn't it be more efficient, regardless of language, to make an algorithm that works by storing data in memory to use, instead of in files? etc
Thanks
216.173.144.164 (talk) 14:04, 21 July 2011 (UTC)
- Storing in memory is faster than storing in a file, until memory is full. At that point the operating system moves the information to a file, and retrieves it when it is needed. On average then, memory is much faster, but a specific store or retrieve may be no better than a file access. Jc3s5h (talk) 14:08, 21 July 2011 (UTC)
- Most programming languages store memory in RAM by default; to store memory in a file requires opening a file stream or something along those lines. So I think that's your answer to your last question. --Mr.98 (talk) 14:23, 21 July 2011 (UTC)
- Input/Output to memory is much faster than input/output to a disk. The issue is size. A computer usually has far more space on a disk than it has in memory - so you cannot place everything in memory. Output to a screen is a complicated issue. If it is a text-only system, output is not overly complicated. If it is a GUI, output to the screen may required building a window, adding widgets to it, drawing the borders, adding a text widget, filling it with text, adding listeners for mouse clicks, updating the whole GUI, etc... In general, a text-based system will send a lot more information to the user than a GUI system. -- kainaw™ 14:41, 21 July 2011 (UTC)
- Depends how you want to define "information" sent to the user. A graphical output of 1024x768 pixels at 60 frames per second at 24 bits-per-pixel is delivering over a gigabit of information to the user each second. You will not find any text-I/O system on the planet that can transmit or receive a gigabit per second with a human in a serial character-stream. On the other hand, the "information density" may be higher in a character-stream, if you abstract semantic meanings from the character-stream in ways that the graphical interface cannot. But, purely from the technical standpoint, no command-line interface on any modern computer is nearly as fast as a graphics bus.
- However, most programmers are unable or unwilling to directly program the graphics output; so they rely on windowing toolkits and software abstraction layers. The result is that the maximum information throughput is limited to many orders of magnitude lower than the hardware can support. If you build a window, and print an 80-character string to it, your graphics bus still delivered a gigabit of data each second - but only 80 bytes was "useful" information from the program I/O! The information-density is, by this metric, very very low; and you could have made better use of resources with a serial-port or console emulator. Nimur (talk) 19:34, 21 July 2011 (UTC)
Issue with flash security and a CD im using..........
I am running some training software which is essentially HTML pages with embedded flash videos etc. I get an error when i run the main page from the CD.
It says...
Adobe Flash player has stopped a potentially unsafe operation...
The following application on your computer or network: (swf file path) is trying to communicate with this internet enabled location: (html file path)
it says i have to change the settings to allow it to work. However, flash thinks that this is on the internet, so i cant specify a url to allow. allowing all sites doesnt work either. I also tried the loopback address (127.0.0.1) to no avail. how do i allow the content to communicate so i can view it properly? I have current version of internet explorer and flash on win 7.
216.173.144.164 (talk) 15:26, 21 July 2011 (UTC)
- If you hunt around on the disk with Windows Explorer you should be able to find the Flash Video files (probably .flv files) and if so you can play them directly with VLC media player. Hopefully the authors of the disk will have chosen sensible names, or sensible locations, for these, so you can know which file corresponds with which training lesson. -- Finlay McWalter ☻ Talk 15:30, 21 July 2011 (UTC)
The problem is that the swf files control navigation to the different pages etc. I fixed it however, by adding my cd drive to trusted locations for development rofl. Thanks anyway!
216.173.144.164 (talk) 15:32, 21 July 2011 (UTC)
802.11n technical question
Quick technical question on 802.11n. Am I right that MIMO is independent for how many transmit and receive channels an adapter has? In other words, a 1T1R adapter (including ones in APs of course) can still have MIMO, although obviously it's limited to 150mbps? I've seen some things which suggest yes but they're not entirely trustworthy (although our article on MIMO also suggests yes to me) and I did read one thing suggesting no. If MIMO requires multiple channels (in other words a 1T1R can't be MIMO), how are two antenna used on a 1T1R adapter? Does one transmit and one receive? Nil Einne (talk) 18:44, 21 July 2011 (UTC)
- 1T1R refers to number of RF output stages. You can connect one output to arbitrarily many antennas, constructing a passive antenna array. You can have multiple inputs received or transmitted through the same physical antenna using separate frequencies (channels), if your RF input/output PHY supports that broad RF bandwidth. Consider MIMO to be synonymous with FDMA in that case. Nimur (talk) 19:26, 21 July 2011 (UTC)
Firefox sync
I logged into my account for the first time in months, I've changed computers, and I can't find the option to sync up my data to my browser on my new computer. Anyone know where it is? 173.2.165.251 (talk) 18:48, 21 July 2011 (UTC)
Updating information on the Memorial Sloan-Kettering Cancer Center Wikipedia site.
1. I would like to know if the Memorial Sloan-Kettering Cancer Center Wiki page is protected from being updated?
2. Is there a way to find out who submitted the Memorial Sloan-Kettering Cancer Center Wiki page in case we need permission to update the information?
Davidthelion2 (talk) 20:22, 21 July 2011 (UTC)David
- It isn't locked at present (there's no padlock on the top-right of the page, the second tab is 'Edit', not 'View Source', and the edit link works). To see who's edited the page, click on 'History' on the page. CS Miller (talk) 20:27, 21 July 2011 (UTC)
- The Memorial Sloan–Kettering Cancer Center article is not protected
- You can edit it, or you can discuss your changes on the article's talk page talk:Memorial Sloan–Kettering Cancer Center
- In general the best place for questions about Wikipedia is a specific article's talk page, or at wikipedia:help desk: -- Finlay McWalter ☻ Talk 20:28, 21 July 2011 (UTC)
Slow startup of PC
I have a PC with 2.25GB RAM, 1.38 GHz processor and 160GB hard disk. The OS is Windows XP SP3. Recently, it has started taking a lot of time to start, as compared to a few days back. I even uninstalled a few programs, but it was of no use. The C drive has 26GB free space. Could someone please tell me the reason for this sudden slow startup and how I can get it to start up faster? Zebec 21:41, 21 July 2011 (UTC)