I'm trying to use a custom compare method (for use with sortedArrayusingSelector) and on another website I got that the format is:
-(NSComparisonResult) orderByName:(id)otherobject {
That's all bery well and good except how do I compare the otherObject to anything as there's only one thing passed to the method?
Like how does the NSString method of compare: compare 2 strings when only one string is passed?
I have many params making up an insert form for example:
x.Parameters.AddWithValue("@city", City.Text)
I had a failed xss attack on the site this morning, so I am trying to beef up security measures anyway....
Should I be adding my input params like this?
x.Parameters.AddWithValue("@city", HttpUtility.HtmlEncode(City.Text))
Is there anything else I should consider to avoid attacks?
Thanks
R has a useful function pairs that provides nice matrix of plots of pairwise connections between variables in a data set. The resulting plot looks similar to the following figure, copied from this blog post:
Is there any ready to use function based on python's matplolib? I have searched its gallery, but couldn't find anything that resembles what I need. Technically, this should be a simple task, but proper handling of all the possible cases, labels, titles, etc is very tedious.
I'm contemplating a single SQL trigger to handle INSERT, UPDATE and DELETE operations as part of an auditing process.
Is there any statement, function or @@ variable I can interrogate to find out which operation type launched the trigger?
I've seen the following pattern:
declare @type char(1)
if exists (select * from inserted)
if exists (select * from deleted)
select @Type = 'U'
else
select @Type = 'I'
else
select @Type = 'D'
but is there anything else a little more direct or explicit?
Thanks,
Neil.
Wierd....
Late nite I installed Office 2010 Professional Plus.
Here I am, the next morning, and Visual Studio 2008 is freezing, like there "was some invisible dialog window", because it doesn't allow me to click on any IDE element.
In brief, after I open a ASP.MVC form, suddenly I'm not allowed to click on anything, icon, dock panel, toolbox, nothing...
Anyone has this kind of problem?
I'm reading through this computer science book and throughout the book I see a number of things written like so:
and then there's this:
and then this:
What kind of notation is the "Boolean Expression" in example 1 written in? I've never seen anything like it before and I'm tempted to assume that whoever wrote and/or scanned this book in fell asleep at the keyboard, and assuming that it's even valid, what about the 3rd example? I'm pretty sure that's not C++ or VB.NET they're showing there.
I do:
git commit .
git push
error: Entry 'file.php' not uptodate. Cannot merge.
Then I do
git pull
Already up-to-date.
What do I do? I just want to get the latest version from the remote copy, and overwrite anything on my local copy.
I've googled and googled, and I've not found anything useful. How can I send output to the console, and accept user input from the console with assembly?
I'm using MASM32
I'm using construction like this:
doc = parse(url).getroot()
links = doc.xpath("//a[text()='some text']")
But I need to select all links which have text beginning with "some text", so I'm wondering is there any way to use regexp here? Didn't find anything in lxml documentation
Hello everyone,
I found an awesome tags plugin on cakedc site. This plugin makes your tagging concerns very easy and is able to make anything taggable.
Has anyone used it? I find it a bit difficult to understand few things listed below:
difference between the name and keyname columns of the tags table.
the use of columns 'identifier', 'weight' in tags table
Thanks
I am trying to scrape a wiktionary entry:
uri = URI.parse("http://en.wiktionary.org/wiki/" + CGI.escape('abjure'))
doc = Nokogiri::HTML(open(uri, 'User-Agent' => 'ruby'))
but the doc shows no elements for this word. The other words work fine and this word used to work. I have no idea what changed. Anyone see anything wrong with this?
I'm currently making an iPhone app that has PDF viewing a crucial part of its functionality.
However many of the PDFs aren't iPhone friendly and require zooming and panning to read them.
Is there anything I can do to make them better whether with the PDF itself or programmatically? (I'm currently using a UIWebView PDF viewer by the way.)
Hi,
I would like to create a simple XMPP client in java that shares his location (XEP-0080) with other clients.
I already know I can use the smack library for XMPP and that it supports PEP, which is needed for XEP-0080.
Does anyone have an example how to implement this or any pointers, i don't find anything using google.
thanks in advance.
Is it possible to inherit permissions from an abstract model in Django?
I can not really find anything about that. For me this doesn't work!
class PublishBase(models.Model):
class Meta:
abstract = True
get_latest_by = 'created'
permissions = (('change_foreign_items',
"Can change other user's items"),)
EDIT: Not working means it fails silently. Permission is not created, as it wouldn't exist on the models inheriting from this class.
Hi,
When you develop a Java application that talks to oracle DBs, there are 2 options right? One is oracle thin driver, and the other is OCI driver that requires its own installation (please correct if I'm misunderstanding).
Now, what are the pros and cons? Obviously thin driver sounds much better in terms of installation, but is there anything that OCI can and the thin one can't?
Develop environment is Tomcat6 + Spring 3.0 + JPA(Hibernate) + appache-DBCP
Thanks in advance.
Is it possible to disallow free text entry in the JQuery UI autocomplete widget?
eg I only want the user to be allowed to select from the list of items that are presented in the autocomplete list, and dont want them to be able to write some random text.
I didn't see anything in the demos/docs describing how to do this.
http://jqueryui.com/demos/autocomplete/
I'm using autocomplete like this
$('#selector').autocomplete({
source: url,
minlength: 2,
select: function (event, ui) {
// etc
}
I simply need to have a notification post when a valid IP address is assigned. I have tried polling via SCReachability, but that seems to be inefficient.
Any suggestions? This seems like it should be simple, but I've been struggling for several hours to get anything working.
I want to define a generator from a list that will output the elements one at a time, then use this generator object in an appropriate manner.
a = ["Hello", "world", "!"]
b = (x for x in a)
c = next(b, None)
while c != None:
print c,
c = next(b, None)
Is there anything wrong or improvable with the while approach here? Is there a way to avoid having to assign 'c' before the loop?
Thanks!
I'm pulling my hair out on this and Google results are skewed since it thinks I want to find out how to code something.
My problem is that when trying to search my code with the String Matching box it finds nothing, even if I enter something that is on the screen below.
Is it Spotlight that is delivering these results? I'm not excluding anything in my Spotlight index so should I just rebuild the index?
Thanks for any help you can offer.
I have a model name called StoreEntry. Django admin changes it to look like 'Store Entrys'. This is weird. If anything it should be Store entries. Any idea what's going on here and how to change it?
I realise it is possible to create a crosstab within sqlite, but is it possible to dynamically determine the relevant categories/columns at runtime rather than hardcoding them?
Given the following example, it can get rather tedious ...
SELECT
shop_id,
sum(CASE WHEN product = 'Fiesta' THEN units END) as Fiesta,
sum(CASE WHEN product = 'Focus' THEN units END) as Focus,
sum(CASE WHEN product = 'Puma' THEN units END) as Puma,
sum(units) AS total
FROM sales
GROUP BY shop_id
I managed to do this in SQLServer in a stored proceedure before and wondered if there was anything equivalent.
We're just moving from VSS to ClearCase and it's nearly impossible to find out how to do anything :-(
I need to script (using ClearTool?) a sort of VSS-GetLatest, i.e copy a folder and all its contents to a windows folder
Any clues (in short words please as I'm new to this!)
I've written an app that allows me to start multiple PowerPoint presentations, each on its own monitor (this particular config has 4 monitors). The problem I have now is that only the presentation that has focus has any animation. The other 3 pause until they receive focus via mouse click.
Is there any way to keep this pause behavior from happening? (trick PowerPoint into thinking that all 4 retain focus, or anything else to accomplish 4 simultaneously animated presentations...)