set<int> s;
s.insert(1);
s.insert(2);
...
s.insert(n);
I wonder how much time it takes for s.find(k) where k is a number from 1..n?
I assume it is log(n). Is it correct?
Hi all,
I have downloaded the PHP class from github which is the wrapper for their Open Graph API. I can log in and list freinds and images etc. But what I am really struggling with is allowing for extended permissions to allow posting to a users wall.
I know somewhere I need to add "scope=publish_stream" to allow this option and can only assume it is on the getLoginUrl method but I am having next to know joy with it.
Can anyone help me.
Steve
I cannot SSH into my instance - Operation timed out. What could be the reasons why, and what can I do to resolve it? Rebooting normally takes a long time to take effect, and might just makes things worst
UPDATE: It is not about permissions - i can log in normally just fine. I suspect it might be because of memory issues
I use the DAO method Execute to delete some records. If this fails this is clear by checking RecordsAffected (it will be 0). But is it possible to get the error message (for instance, to log or to show to the user)? I've try to delete the records by hand in the Table grid I get a clear dialog message, e.g. "The record cannot be deleted or changed because tabel x includes related records".
I have the following code:
function wp_logout_url($redirect = '') {
$args = array( 'action' => 'logout' );
if ( !empty($redirect) ) {
$args['redirect_to'] = urlencode( $redirect );
}
$logout_url = add_query_arg($args, site_url(wp-login.php', 'login'));
$logout_url = wp_nonce_url( $logout_url, 'log-out' );
return apply_filters('logout_url', $logout_url, $redirect);
}
But I get the following error:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING
How can I fix this?
Hi
I need to know if it is possible the current execution node? Ej:
..html
<script id="x"> //
console.log(document.currentNode.id); // << this must return "x"
</script>
..html
thanx
When doing a git tag, I'm not always great at remembering if HEAD~6 (for example) is inclusive or exclusive.
Given that most of my commits are prefixed with an issue number, I wondered if there is some magic command for searching for the commit SHA from part of its message.
I know it's easy to do a git log and work from there, but I want more easy :)
Hi
http://msdn.microsoft.com/en-us/library/aa479314.aspx
You have a user who successfully log in from a machine in Cybercafe, Hacker H able to sniffer the network and get the sessionID of the user, Can H use the sessionId and act as the user from another machine? Can H enter http://folder/(session id)/CreditCardInformation.aspx to know the credit card number of the user.
Thanks
I've got a string:
public://imageifarm/3600.jpg
How can I extract the
imageifarm/3600.jpg
Part out using android?
What I've tried so far:
URL drupalQuestionNodeImageURI = new URL("public://imageifarm/3600.jpg");
Log.d("TAG", drupalQuestionNodeImageURI.getPath());
but it throws this exception:
09-16 17:24:39.992: W/System.err(3763): java.net.MalformedURLException: Unknown protocol: public
How can I solve this?
I know I can use regular expressions but that seems to defeat the purpose of URL(URI) in this case.
I have an NSString and fail to apply the following statement:
NSString *myString = @"some text";
[myNSString stringByAppendingFormat:@"some text = %d", 3];
no log or error, the string just doesn't get changed. I already tried with NSString (as documented) and NSMutableString.
any clues most welcome.
If i try nltxt = nllen.toString(); with nllen being int nllen = nl.getLength(); i get the error Cannot invoke toString() on the primitive type int.
I want to convert the int to string so i can display the number of entries with Log...
Why doesnt it work?
for (var i = 0; i < somearray.length; i++)
{
myclass.foo({'arg1':somearray[i][0]}, function()
{
console.log(somearray[i][0]);
});
}
How do I pass somearray or one of its indexes into the anonymous function ?
somearray is already in the global scope, but I still get somearray[i] is undefined
Hi,
I want to translate LINQ expression tree to SQL statement and I don't want to write my own code for this.
Example:
var query = from c in Customers
where c.Country == "UK" &&
c.City == "London"
select c);
To
SELECT ... FROM Customers AS c WHERE c.Country = "UK" AND c.City = "London"
I know DataContext.Log, but I want to use:
query.ToSqlStatementString()
Thanks
Hi, can anyone help me out.
i have a apllication where i want to log exception in files and dont want to change code.just acomponet which i can add in my code and it will start logging exceptions.
Thanks in advance.
I was wondering if somebody use syslog to log his web application errors/warning/info ? It could be quite useful in a deployment environment with a lot of servers.
If yes, what kind of client visualisation you can get to watch errors and grouping the same errors into batch?
Do you use other techniques than syslog to achieve this kind of logging functionality?
hi
function liveUpdate(fld,value,id) {
$.ajax({
type: 'POST',
url: 'myurl.html',
data: { fld:value, 'id': id },
success: function(data){//console.log(data);
}
});
}
i want fld to be posted as fld's value not the variable name fld? i've tried to wrap around with eval but no luck
any ideas?
thanks
When getopt or getopt_long encounters an illegal option, it stores the offending option character in optopt. When the illegal option is a long option, where can I find out what the option was? And does anything meaningful get stored in optopt then?
I've set opterr = 0 to suppress the automatically printed error message. I want to create my own message that I can print or log where I'd like, but I want to include the name of the unrecognized option.
I'm trying to do the following:
User can vote for an item (controller: item, action: vote)
2a. If the user is logged in, then vote action goes through.
2b. If user is not logged in, then user needs to log in/creates an account (handled by user controller), then vote action goes through.
How do I do 2b such that once the user logs in/creates account, the vote action automatically goes through without having the user vote for the item again?
Here is what I have:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^users/(\d+)/post$ post.php [L]
RewriteRule ^users/(\d+)$ user.php?id=$1 [L]
The first rule doesn't work. The second one does.
All I get when I enter .../users/1/post is a 404 error.
What am I doing wrong?
Edit: The error log doesn't have anything in it relating to this.
Hey.
I have a large amount of log data that I need to get some relevant information out of.
The syntax is:
WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2 WORD1 some text KEYWORD some text WORD2
Would it be possible to use regex to get a certain block out of it - so that when I queried some keyword it would return WORD1 some text THIS_KEYWORD some text WORD2
PS: There could be multiple instances of one keyword, it should return all of the blocks (preg_match_all, PREG_SET_ORDER?).
I'd like to store emails in a separate table and allow users to save multiple emails and log in with any of them. I'd also like to store passwords in a different table.
How can I configure Devise to store authentication info elsewhere?
Worst case scenario, if I just have to hack into it, is there a generator to just port everything over to the app? I noticed there was a generator for the views.
Thanks.
How do you reload an application's configuration? Or, what are good strategies for managing dynamic application configuration?
For example, let's say I had log levels and I wanted to change them at runtime. Also, let's assume this is one of many such options. Does it make sense to have a "configuration server" that holds configuration state for other parts of the application to query? Do people do that or did I just make it up?
Hi,
I was wonder if you can delete a cookie at the beginning of the next day.
Lets say I log in to a website at 1:30pm and use it again throughout the day but at midnight or 1 minute past, in the new day, the cookie is removed.
Many thanks for any help,
C
I am having trouble getting the value() injected into the app.config(). Here's the code (coffeescript)
window.app = angular.module("app", [])
app.value("template_path", "assets/angular/templates/users")
app.config(["$routeProvider","template_path" ($routeProvider, template_path) ->
console.log template_path
it is throwing an "Unknown provider: template_path from app" error
Could it be that the config() method cannot be injected with value() set values?
I am using 1.0.2
Thank you!