Wikipedia:Reference desk/Archives/Computing/2011 April 5

Computing desk
< April 4 << Mar | April | May >> April 6 >
Welcome to the Wikipedia Computing Reference Desk Archives
The page you are currently viewing is an archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages.


April 5 edit

GNU Octave - GUI with Autocompletion & Tooltips edit

Good Morning RefDesk!

  In the MATLAB GUI, when the first few letters of a command are typed in, a box pops up with suggestions of possible matches, and provides (upon mouseover) a description of the function of each possible match. Does an equally functional GUI exist for the GNU Octave platform?

  Thanks as always. Rocketshiporion 00:32, 5 April 2011 (UTC)[reply]

If you haven't found QTOctave yet, here it is: QTOctave. My experience with it has been so-so; it's a Spanish program that the developer internationalized to an English version (and there's a few rough edges still). On the whole, if I must use Octave on Windows, I use QTOctave (because it's better than Cygwin); but when I'm on *nix, I've found the command-line version works smoothly and integrates with the plotting and other features really well. I use KATE (a KDE text editor) for editing my .m files on *nix; it's totally un-connected to Octave project, but it has syntax-highlighting support and can run a command-line and powerful macros. You can set up more custom features using plugins (though I don't know any for hot-linking function-names; in C, some people use CTAG to analyze source-code and generate hot-linkable meta-documents; CTAGS supports MATLAB and has a KATE plugin). Overall, KATE is a versatile lightweight IDE for MATLAB-style interactions with Octave and other programs; the command-line in the dock is very MATLAB-esque and handy for all kinds of programming jobs. Nimur (talk) 14:30, 5 April 2011 (UTC)[reply]

Stopping retweets flooding my feed edit

I've tried blocking retweets from some of the people I follow on Twitter, but my feed is still flooded with retweets by them. Anyone know a way of actually stopping them? DuncanHill (talk) 10:25, 5 April 2011 (UTC)[reply]

What do you use to access twitter (twitter.com, third-party app etc)? Darigan (talk) 11:52, 5 April 2011 (UTC)[reply]
I just go to the website from time to time. DuncanHill (talk) 12:44, 5 April 2011 (UTC)[reply]
I found this: http://tj.luo.ma/post/1215741762/turn-off-twitter-retweets - It offers instructions for turning off retweets, although, it appears that you have to turn off the retweets one user at a time. I'm using the new twitter interface at the moment, to turn off the retweets in that:
1. Click on the profile of a user you are following so that it shows on the right of your screen
2. Beside the green follow button, there should be a phone symbol, and a little green retweet symbol - Hit the green retweet symbol so that it turns a white/grey colour. Now, retweets from that user will not show up in your timeline.
Hope that makes sense, if not let me know, and I'll try to find a better way to describe it. Darigan (talk) 13:40, 5 April 2011 (UTC)[reply]
That's what I did but it didn't stop them :( DuncanHill (talk) 13:51, 5 April 2011 (UTC)[reply]
You aren't alone in despising "re-tweets." Twitter hates them too: accounts who re-tweet will be blocked from search and are subject to total account shut-down. The official policy from Twitter is that "re-tweeting" wastes computer and human time. Nimur (talk) 14:36, 5 April 2011 (UTC)[reply]
As we talking about the same thing? I doubt twitter has that policy otherwise they wouldn't provide a button [1]. The ref you link to appears to be about people who repost twitter stuff, I guess you could call it a re-tweet but it doesn't appear to be what twitter means. It's not clear if people who just re-tweet (with the button) and do it a lot will also be blocked, from the ref and common sense I presume it may happen but it seems unlikely just doing it occasionally is going to lead to a block since as I said they provided a button. I presume if people use the re-tweet button, then what DH is going will work. I suspect these people aren't actually re-tweeting but posting the same message themselves hence blocking re-tweets probably isn't going to work. Note I rarely use twitter. Nil Einne (talk) 15:53, 5 April 2011 (UTC)[reply]
No, they are retweets, as they are labelled as retweets in the feed with a link to the original person who tweeted them. Blocking retweets doesn't seem to actually work. DuncanHill (talk) 15:58, 5 April 2011 (UTC)[reply]
The first page I linked to said that following the instructions would not cause already re-tweeted tweets to disappear, but would stop new retweets from showing up - Are you still getting new retweets after following those instructions? Also, not a direct solution to your problem, but when I access twitter from a computer, I use tweetdeck - I find it far more useful when it comes to finding tweets I might be interested in. There are a few other popular apps as well... hootsuite springs to mind. Would it be worth your while trying one of these apps for twitter? Darigan (talk) 20:03, 5 April 2011 (UTC)[reply]
Yes, I'm still getting new ones. DuncanHill (talk) 20:36, 5 April 2011 (UTC)[reply]
....hmmmmmm, as the tree said to the lumberjack, 'I'm Stumped' (ba-dum cish). Unless somebody else responds with a better response, I would suggest giving one of the apps a go. Mashable has a comparison of 19 different apps here: http://mashable.com/2009/06/27/twitter-desktop-apps/ - Sorry my earlier suggestions turned out to be duds. Darigan (talk) 22:18, 5 April 2011 (UTC)[reply]

are these 2 queries equivalent? edit

select * from a inner join b on a.id=b.id

select * from a left join b on a.id=b.id where a.id is not null

t.i.a. --83.103.117.254 (talk) 13:36, 5 April 2011 (UTC)[reply]

No. The first query would not return rows where the a.id is invalid but not null (that is, the a.id is not null but there is no b.id matching that a.id), where the second query would. 118.96.164.80 (talk) 15:39, 5 April 2011 (UTC)[reply]
I suspect a typo: they would be the same if the second query was select * from a left join b on a.id=b.id where b.id is not null. AndrewWTaylor (talk) 17:33, 5 April 2011 (UTC)[reply]
"The same" as in "returning the same results", that is. They might differ in how the SQL server executes them. AndrewWTaylor (talk) 17:36, 5 April 2011 (UTC)[reply]
  Resolved

In php, is there a way to make a script go back to the start and run again, like the "goto" command in .bat files? —Preceding unsigned comment added by 82.43.90.38 (talk) 15:48, 5 April 2011 (UTC)[reply]

Place the script in a loop:
$do_it_again=true;
while($do_it_again)
{
// do a bunch of stuff here.
// If you want it to stop, set $do_it_again=false;
}
There are many many many other ways to do this. IE: Place the whole script in a function and call the function over and over. Basically, the concept of a "GOTO" is not used in normal C-style programming, so it isn't reflected in all the code that derives from that style (almost all of professional programming). -- kainaw 15:58, 5 April 2011 (UTC)[reply]
I checked - because I know that PHP tries to cater to every bad programming style imaginable, and PHP does have labels. So, you can do this:
begin:
//Do some code here.
goto begin;
This has been implemented with limited functionality. So, using the goto may fail, depending on exactly how you use it. -- kainaw 16:02, 5 April 2011 (UTC)[reply]
As Kainaw notes, "Goto" is considered pretty bad form in modern programming — it's a recipe for spaghetti code. You're better off figuring out how to control your program flow so that you don't need it — either with functions, or do/while loops, or what have you. It should be a very, very rare instance where you should need to use goto. --Mr.98 (talk) 16:08, 5 April 2011 (UTC)[reply]
Though putting the whole thing inside one goto is hardly spaghetti, and Donald Knuth's "Structured Programming with go to Statements" defends their use in some cases: "... what I am really doing is striving for a reasonably well balanced viewpoint about the proper role of go to statements. I argue for the elimination of go to's in certain cases, and for their introduction in others." In this particular case, a goto has the advantage that at the start you can name the label "repeat_everything:" and at the end you can say "goto repeat_everything". If you use a while loop, all you see at the bottom of the code is an uninformative closing brace. Also it has to check every time round to see whether 1 still equals 1, which is silly. 81.131.0.73 (talk) 17:08, 5 April 2011 (UTC)[reply]
Obviously goto's are not a universal evil. But they are often misused and can go very awry. Even Knuth agrees that they ought to be relatively uncommon. PHP in particular is not really designed to use them very effectively. --Mr.98 (talk) 20:52, 5 April 2011 (UTC)[reply]
I agree with Knuth and you, but I want to point out that most language implementations will optimize away a test on a compile-time constant expression like "true" or "1==1". I don't know whether PHP does, but CPython does, for example, despite doing very little other optimization. -- BenRG (talk) 05:38, 6 April 2011 (UTC)[reply]
Even Knuth's example from back in 1973 (if I remember the year correctly) of a problem that required a goto is no longer applicable in most languages because of optimization. The non-goto solution has one more comparison check than the goto solution, but in optimization the extra comparison is omitted. It isn't a knock against Knuth. Computer languages have evolved a great deal since the early 70s. Everything we claim right now will likely be defunct in another 20 years. -- kainaw 12:14, 6 April 2011 (UTC)[reply]
Knuth's example is as relevant as it ever was because he was talking about source code clarity, not speed. -- BenRG (talk) 22:16, 6 April 2011 (UTC)[reply]
Knuth's argument in 1974 was "[The non-goto version] is slightly less readable, in my option, as well as slightly slower; so it isn't clear what we have gained." By 1992, when he wrote "Literate Programming," he dropped his argument of runtime speed and focused solely on the argument that use of goto is "...easier to read and to write." I feel that he was making an argument for clarity and speed in 1974, but has dropped the speed argument since then. -- kainaw 17:57, 7 April 2011 (UTC)[reply]

Thanks! 82.43.90.38 (talk) 16:30, 5 April 2011 (UTC)[reply]

Firefox 4 - how to prevent the white dot appearing edit

In Firefox 4, when I scroll a page a white button often appears. This button has a dot in the middle and an arrow above and below. It makes my scrolling unpredictable and often scrolls the page at top speed to one end or the other.

Is there any way to prevent this thing appearing please? Thanks 92.24.184.244 (talk) 17:44, 5 April 2011 (UTC)[reply]

I haven't used FF4 yet, but in previous versions of firefox, what you describe appears when you press your middle mouse button. It's for people who don't have or don't like scroll wheels, You press the middle mouse button and then 'drag' the page at an accelerated rate. (Even if you have a scroll wheel, it's still useful because few mice also have a horizontal scroll wheel.)
If you're doing this by accident when you're scrolling, you may be pressing too hard on your scroll wheel.
In any case, here's how you turn it off in older version of firefox, I imagine FF4 has a similar option if you just look around for it. APL (talk) 18:00, 5 April 2011 (UTC)[reply]
Go to Tools -> Options -> Advanced -> General, and under the Browsing section, uncheck "Use Autoscrolling" You may have to turn on the menubar (right click near the top, you should get a box that has checkmarks with Menu Bar, Navigation Toolbar, etc) 206.131.39.6 (talk) 18:04, 5 April 2011 (UTC)[reply]
Comment: this scrolling might not be the fault of Firefox. Some mouse drivers override basic scrolling with a customized version. Check your Mouse settings in Control Panel, too - you might find some advanced options there, especially if a vendor driver has been installed. Nimur (talk) 22:32, 5 April 2011 (UTC)[reply]