Is it just a tab-bar controller that loads some UITableViews that has navigation items set? Or is it a tab-bar controller that is loading a navigation controller?
Not so much a question to help my own programming, but I found this page on facebook with a cool illusion and a page that says "to see the real illusion, copy and paste this code into your address bar" and there is a script: http://pastebin.com/LQUVQ8hm
What the hell is this? What would happen if I put it in my address bar, which I assume would be a very unwise idea?
I am confused.
This question already has an answer here:
How do I get rid of malicious spyware, malware, viruses or rootkits from my PC?
15 answers
How to remove trojan PB from windows 7 system? previously i had installed Norton 360 antivirus. the subscription was expired two months back. Recently i have purchased quick heal total security. while installing quick heal antivirus i get the message 'system infected by Trojan PB' Their is an option to remove Trojan PB by restarting computer. However the infection does not get removed. Please advice for removal of Trojan PB
I'm trying to create a WCHAR:
LONG bufferSize = foo.bar() + 1;
WCHAR wszBaz[bufferSize];
The compiler issues an error:
error C2057: expected constant expression
error C2466: cannot allocate an array of constant size 0
error C2133: 'wszBaz' unknown size
What am I doing wrong?
UPDATE: I added const but it still gives the same error:
const LONG bufferSize = foo.bar() + 1;
WCHAR wszBaz[bufferSize];
In Word 2010, how can you create quick style sets that include multilevel lists (include being the operative word)? As background, I have created a set of styles for a long agreement form and assigned them to levels in a certain custom multilevel list. I then also saved those styles as a quick style set called Long Agreement. I have saved those styles in my normal template. That all works fine for assigning styles to a Long Agreement.
What I'd like to do next is create a second style set called Short Agreement. I will assign certain styles to that style set. The issue is that I don't see how to tie a different custom multilevel list to those Short Agreement styles. When I click on Change Styles, Short Agreement [style set], and I apply those styles, how can I get it to automatically use the multilevel list that I assign to short agreements?
Why do you think (or, why is it good that) Microsoft chose not to allow:
public abstract class BaseClass
{
public abstract int Bar { get;}
}
public class ConcreteClass : BaseClass
{
public override int Bar
{
get { return 0; }
set {}
}
}
If I want to split a list of words separated by a delimiter character, I can use
>>> 'abc,foo,bar'.split(',')
['abc', 'foo', 'bar']
But how to easily and quickly do the same thing if I also want to handle quoted-strings which can contain the delimiter character ?
In: 'abc,"a string, with a comma","another, one"'
Out: ['abc', 'a string, with a comma', 'another, one']
Related question: How can i parse a comma delimited string into a list (caveat)?
I'm working on a mock exam paper at the moment, however I have no set of correct answers and I'm not sure what the correct answer of this SQL query is.
Given a table:
foo, bar
a , 1
b , 3
a , 2
c , 1
and the query:
SELECT foo, sum(bar)
FROM table
GROUP BY foo
The two ways I can see this going are either:
a 3
a 3
b 3
c 1
or
a 3
b 3
c 1
Thanks.
Can this be done in 1 line with PHP?
Would be awesome if it could:
$out = array("foo","bar");
echo $out[0];
Something such as:
echo array("foo","bar")[0];
Unfortunately that's not possible. Would it be possible like this?
So I can do this for example in 1 line:
echo array(rand(1,100), rand(1000,2000))[rand(0,1)];
I had been running out of memory on my server lately and I noticed some individuals uploading the same "file" over and over in quick succession which locks up my instance of mini_magick. Eventually the morgify gets stuck in an infinite look. I've taken care of it by having a daemon watch the morgify process if it get's out of control, but was wondering if there was a better solution
You can see the same *.gif being uploading in quick succession. I tried downloading this file too, and it isn't even a gif. I don't know what it is (I can't open it). Anyone experience this kind of exploit before?
At the bottom of this image, you'll see a nice colorbar that matches the colors of the graph correctly:
http://stribog.cc.umanitoba.ca/ceos/20100517_00z_prod/
I couldn't find anything that created a color bar with exactly the colors I wanted, it always seemed to involve a spectrum that included colors I didn't use.
I have a vector of colors I use for my data. Is there I way I can use that vector to create a color bar with only those colors?
First off, I know the title is generic and not fitting. I just couldn't think of a title that could describe my problem.
I have a table Recipients in MySQL structured like this:
id | email | status
1 foo@bar S
2 bar@baz S
3 abc@def R
4 sta@cko B
I need to convert the data into the following XML, depending on the status field. For example:
<Recipients>
<RecipientsSent>
<!-- Have the 'S' status -->
<recipient>foo@bar</recipient>
<recipient>bar@baz</recipient>
</RecipientsSent>
<RecipientsRegexError>
<recipient>abc@def</recipient>
</RecipientsRegexError>
<RecipientsBlocked>
<recipient>sta@cko</recipient>
</RecipientsBlocked>
</Recipients>
I have this PHP code to implement this ($recipients contains an associative array of the db table):
<Recipients>
<RecipientsSent>
<?php
foreach ($recipients as $recipient):
if ($recipient['status'] == 'S'):
echo "<recipient>" . $recipient['email'] . "</recipient>";
endif;
endforeach;
?>
</RecipientsSent>
<RecipientsRegexError>
<?php
foreach ($recipients as $recipient):
if ($recipient['status'] == 'R'):
echo "<recipient>" . $recipient['email'] . "</recipient>";
endif;
endforeach;
?>
</RecipientsRegexError>
<?php /** same loop for the B status */ ?>
</Recipients>
So, this means that if I have 1000 entries in the table and 4 different status' that can be checked, it means that there will be 4 loops, each one executing 1000 times.
How can this be done in a more efficient manner? I thought about fetching four different sets from the database, meaning 4 different queries, would that be more efficient? I'm thinking it could be done with one loop but but I can't come up with a solution.
Any way this could be done with only one loop?
Consider a Python list my_list containing ['foo', 'foo', 'bar'].
What is the most Pythonic way to uniqify:ing and sorting and the list (think cat my_list | sort | uniq)?
This is how I currently do it and while it works I'm sure there are better ways to do it.
my_list = []
...
my_list.append("foo")
my_list.append("foo")
my_list.append("bar")
...
my_list = set(my_list)
my_list = list(my_list)
my_list.sort()
I want to ensure that regardless of what browser a user is in, they all see the EXACT same characters in the URL bar.
Most browsers show the preceding protocol type in the URL bar. However, Chrome for example truncates http:// (not sure about https) and starts with the domain name, ie:
Chrome: stackoverflow.com/questions/ask
Safari: http://stackoverflow.com/questions/ask
So, is there a way to either suppress the http:// in all browsers, or even enforce it in all browsers? Preferably suppress.
Which is preferred ("." indicating whitespace)?
A)
def foo():
x = 1
y = 2
....
if True:
bar()
B)
def foo():
x = 1
y = 2
if True:
bar()
My intuition would be B (that's also what vim does for me), but I see people using A) all the time. Is it just because most of the editors out there are broken?
In Word 2010, how can you create quick style sets that include multilevel lists (include being the operative word)? As background, I have created a set of styles for a long agreement form and assigned them to levels in a certain custom multilevel list. I then also saved those styles as a quick style set called Long Agreement. I have saved those styles in my normal template. That all works fine for assigning styles to a Long Agreement.
What I'd like to do next is create a second style set called Short Agreement. I will assign certain styles to that style set. The issue is that I don't see how to tie a different custom multilevel list to those Short Agreement styles. When I click on Change Styles, Short Agreement [style set], and I apply those styles, how can I get it to automatically use the multilevel list that I assign to short agreements?
What I want to do is pretty simple:
f=Foobar.objects.get(id=1)
foo='somefield'
bar='somevalue'
f.foo=bar
f.save()
This doesn't work as it tries to update the f object's 'foo' field, which of course doesn't exist. How can I accomplish this?
I installed a product called xming, a light weight X11 server product on Windows 7 laptop. From remote RHEL system I redirected display to Win7 laptop then launched X11 GUI app. I was not able to launch X11 apps and have them appear on laptop display as intended. To fix it I added -ac to the properties of xming launch desktop icon. I been searching through Windows and xming docs but can't find explanation. My guess is it is like xhost + on unix that allows connections from anybody. Can anybody explain why this worked?
In Javascript, if an object has lots of properties that are functions:
var obj = { foo: function() { ... },
bar: function() { ... },
...
}
then how can you get an array of names of those functions? That is, an array
["foo", "bar", ... ]
thanks.
If I do something like this in ColdFusion:
<cfoutput>foo="#foo()#"</cfoutput>
The resulting HTML has a space in front of it:
foo=" BAR"
However, if it is not a function call it works fine, i.e.:
<cfset fooOut=foo() />
<cfoutput>foo="#fooOut#"</cfoutput>
Gives this output:
foo="BAR"
Where is this extra space coming from and is there anything I can do about it?
When I run my app, for some reason the view is pushed up too far. The space it is pushed up too far appears to be the height of the status bar. (
I am using a NIB. I have verified that both MainWindow and this view has the simulated status bar checked.
I'm not sure what could be wrong?
Any help appreciated.
I need to run multiple background threads in a thread pool with timeout.
The scheme is something like:
#!/usr/bin/env ruby
require 'thread'
def foo(&block)
bar(block)
end
def bar(block)
Thread.abort_on_exception=true
@main = Thread.new { block.call }
end
foo {
sleep 1
puts 'test'
}
Why if i run that i get no output? (and no sleep wait?)
I often launch applications from the cli via e.g. command & to immediately get back to the prompt back.
The downside of this is, that I still get STDOUT and STDERR.
So I use command &> /dev/null to discard those outputs.
This can get quite a chore, when having to write this often during a day.
So my question is, is there a better (read shorter) way to discard of STDOUT and STDERR when not needed?
What could be done? write a wrapper script to launch applications?
What would be an elegant way to do this?