unified_texts
stringlengths
32
30.1k
OpenStatus_id
int64
0
4
input_ids
list
token_type_ids
list
attention_mask
list
Drupal 7 programmatic field definition === I need help programmatically setting up a **node reference** field. My module successfully creates a and associates a pair of 'CCK' fields to my nodes. One of these fields is a **node_reference** field. My code is a follows: $field_weight = 'field_custom_weight'; $field = field_info_field($field_weight); if (empty($field)) { $field = array( "field_name"=>$field_weight, "label"=>"Custom Weight", "type"=>"text", "cardinality"=>"1", 'locked' => TRUE, ); field_create_field($field); } $instance = array( "field_name"=>$field_weight, "label"=>"Custom Weight", "type"=>"text", "widget"=>array( "type"=>"integer" ), "description" => "text describing use of this field", ); $instance["entity_type"] = "node"; $instance["bundle"] = 'article'; if( !in_array($type, $field['bundles']['node']) ) field_create_instance($instance); Now, the code works but when I edit a node inputting a valid value into the node reference field and attempt to save, I get the following error: > ...: this post can't be referenced. I realized the reason for the error is because the node reference field settings does not have any selected nodes as "**Content types that can be referenced**". Does anyone know how I can adjust my code to set referenceable content types?
0
[ 2, 15708, 6720, 453, 625, 6732, 575, 5465, 800, 3726, 3726, 31, 376, 448, 625, 6732, 1326, 2697, 71, 21, 13, 1409, 251, 546, 2801, 1409, 575, 9, 51, 12613, 3673, 9695, 21, 17, 9423, 21, 2146, 16, 13, 22, 150, 2601, 22, 2861, 20,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
CodeIgniter Where value IN (Field1,Field2) === I need to set query in my auth script, where in WHERE clause I want to use `'_MY_POST_VALUE' IN (Field1, Field2)` Final query will be something like this: `SELECT * FROM 'myprefix_users' WHERE 'myemail@email.com' IN ('EMAIL','LOGIN') AND PASSWORD=SHA1('mypassword')` I've tried to do this: $this->db->where("'" . mysql_escape_string($_POST['login']) . "' IN (EMAIL,LOGIN)", NULL, FALSE); $this->db->where("PASSWORD=SHA1('" . mysql_real_escape_string($_POST['password']) . "')"); $userdb = $this->db->get('users'); ..but CodeIgniter set prefix to my login/email value and send error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''test@test.com' IN (EMAIL,LOGIN) AND PASSWORD=SHA1('123')' at line 3 SELECT * FROM (`myprefix_users`) WHERE myprefix_'test@test.com' IN (EMAIL,LOGIN) AND PASSWORD=SHA1('123') I need to use db_prefix in table name, but I don't need it in my WHERE clause, even third param (FALSE) in ->where() don't work for me :( How can I solve my problem? Any ideas?
0
[ 2, 1797, 9693, 242, 106, 113, 1923, 19, 13, 5, 1109, 165, 15, 1109, 135, 6, 800, 3726, 3726, 31, 376, 20, 309, 25597, 19, 51, 10343, 96, 3884, 15, 113, 19, 113, 9040, 31, 259, 20, 275, 13, 1, 22, 1, 915, 1, 6962, 1, 15165, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
AVAudioRecorder prepareToRecord fails for a small subset of users === I've got a live app with an estimated 15% of users reporting that the record feature is not working. This isn't happening on our test devices, but the reports show that the problem is that prepareToRecord is returning NO. I've had trouble finding sample settings for AAC format. Are any of my settings off? App requires iOS5 and uses ARC. AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setCategory:AVAudioSessionCategoryRecord error:nil]; NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithInt:kAudioFormatMPEG4AAC], AVFormatIDKey, [NSNumber numberWithFloat:44100.0], AVSampleRateKey, [NSNumber numberWithInt:1], AVNumberOfChannelsKey, [NSNumber numberWithInt:AVAudioQualityHigh], AVSampleRateConverterAudioQualityKey, [NSNumber numberWithInt:128000], AVEncoderBitRateKey, [NSNumber numberWithInt:16], AVEncoderBitDepthHintKey, nil]; NSString *fileName = [NSString stringWithFormat:@"%@%@.caf", verseGUID, bRecordingReference ? @"_ref" : @""]; NSURL *url = [NSURL fileURLWithPath:[NSString stringWithFormat:@"%@/%@", [[Utilities sharedInstance] documentsDirectoryPath], fileName]]; NSError *error = nil; audioRecorder = [[AVAudioRecorder alloc] initWithURL:url settings:recordSettings error:&error]; if([audioRecorder prepareToRecord]){ [audioRecorder record]; }else{ int errorCode = CFSwapInt32HostToBig([error code]); NSLog(@"Error: %@ [%4.4s])", [error localizedDescription], (char*)&errorCode); }
0
[ 2, 13656, 6785, 111, 14953, 106, 5723, 262, 14953, 13614, 26, 21, 284, 16622, 16, 3878, 800, 3726, 3726, 31, 22, 195, 330, 21, 515, 4865, 29, 40, 2744, 13, 15264, 16, 3878, 6670, 30, 14, 571, 1580, 25, 52, 638, 9, 48, 2532, 22, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Error running application on Websphere 7 === When I deploy my application on Websphere 7 I got java.lang.ClassCastException: org.apache.xerces.parsers.XML11Configuration incompatible with org.apache.xerces.xni.parser.XMLParserConfiguration But my application is running fine even after this exception. Any idea?
0
[ 2, 7019, 946, 3010, 27, 2741, 14079, 453, 800, 3726, 3726, 76, 31, 17617, 51, 3010, 27, 2741, 14079, 453, 31, 330, 8247, 9, 9949, 9, 1898, 6146, 10066, 872, 45, 13, 5583, 9, 7738, 2569, 9, 396, 106, 5052, 9, 3574, 18, 445, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What means to be a root device on EC2? === I couldn't find the answer on EC2 documentation. What is it for? If I launched an EBS backed instance, the root device for the instance would be an EBS volume. If I install a few tools/software on the instance, will those be installed on the root instance by default? Still I guess the question really came from the little understanding of the root device. Any detailed info on that? Also if I need to launch another EBS backed instance, and also want to have the same copy of the tools/software installed on the earlier instance, how to do that?
0
[ 2, 98, 1108, 20, 44, 21, 5900, 3646, 27, 6695, 135, 60, 800, 3726, 3726, 31, 711, 22, 38, 477, 14, 1623, 27, 6695, 135, 13945, 9, 98, 25, 32, 26, 60, 100, 31, 1601, 40, 11817, 18, 6334, 4851, 15, 14, 5900, 3646, 26, 14, 4851...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
disable run button codegear === sometime after to make(compile and linked) on soluction the run botton turn to disable and I have to restar codegear in orde to launch my projects. Does anyone know that might be? Thanks you very much.
0
[ 2, 1460, 579, 485, 5167, 1797, 834, 512, 800, 3726, 3726, 8530, 75, 20, 233, 5, 11103, 3599, 17, 4727, 6, 27, 7176, 21263, 14, 485, 11012, 444, 805, 20, 1460, 579, 17, 31, 57, 20, 760, 512, 1797, 834, 512, 19, 54, 546, 20, 339...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
BDD CUDD Package API Support === Could anyone please tell me that is it possible to safely remove variables from the manager in CUDD? For example: I register two variable by v1 = Cudd_bddNewVar(manager); and v2 = Cudd_bddNewVar(manager) . Can I remove v2 from the manager?
0
[ 2, 334, 8096, 22068, 43, 6030, 21, 2159, 555, 800, 3726, 3726, 110, 1276, 2247, 494, 55, 30, 25, 32, 938, 20, 9817, 4681, 12157, 37, 14, 1382, 19, 22068, 43, 60, 26, 823, 45, 31, 2243, 81, 7612, 34, 566, 165, 800, 22068, 43, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Cannot send email to external domains using send-mailmessage in PowerShell 2.0 === I am trying to send emails from a powershell 2.0 script. Messages send to other recipients on my domain are properly delivered, but external domains cannot receive the messages. I have tried passing the external email address to send-mailmessage as a string, as an array, and explicitly as the only argument for that class of recipient, and the message doesn't go out. I am relaying off an SMTP connector I added to my Exchange 2007 server. Any ideas? I get an error message back that says "Unable to send to a recipient' Send-Mailmessage <<<< -To $testto -From $Mailfrom -Cc $testcc -Subject "..." -Body "..." -SmtpServer "x.x.x.x" +CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-Mailmessage], SmtpFailedRecipientsException +FullyQualifiedErrorID : SmtpFailedRecipientsException,Microsoft.PowerShell.Commands.SendMailmessage Is this a resolution error? I am using a gmail account as a test recipient. Thanks!
0
[ 2, 1967, 2660, 8517, 20, 4886, 15544, 568, 2660, 8, 8079, 3845, 18, 1303, 19, 414, 15984, 172, 9, 387, 800, 3726, 3726, 31, 589, 749, 20, 2660, 8517, 18, 37, 21, 414, 15984, 172, 9, 387, 3884, 9, 7561, 2660, 20, 89, 18560, 27, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
render the files of an android phone in web browser? === It is sort of like the airdroid application which you can find in the android, what are the things to consider in making an application similar to that of airdroid? is it using ftp?
1
[ 2, 16535, 14, 6488, 16, 40, 13005, 1132, 19, 2741, 16495, 60, 800, 3726, 3726, 32, 25, 2058, 16, 101, 14, 282, 43, 18524, 3010, 56, 42, 92, 477, 19, 14, 13005, 15, 98, 50, 14, 564, 20, 3563, 19, 544, 40, 3010, 835, 20, 30, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0...
jquery touchmove event and very large content === I have very large conten (a lot of pictures). I want to use css3 transition transform. I bind to touchmove event, and calculate new x position. But I have issue: the position by x does not change smoothly on mobile (on desctop all ok). Event Touch comes with delays. I try hidde don't used content (vissability: hidden) its not help.
0
[ 2, 487, 8190, 93, 1723, 16598, 807, 17, 253, 370, 2331, 800, 3726, 3726, 31, 57, 253, 370, 1065, 1316, 13, 5, 58, 865, 16, 3104, 6, 9, 31, 259, 20, 275, 272, 18, 18, 240, 4513, 8007, 9, 31, 10193, 20, 1723, 16598, 807, 15, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to avoid resetting the whole view after loading an imageview in Android? === I'm working on an Android project with a lot image loading from a remote server. I'm using this utility for downloading the images: http://code.google.com/p/android-imagedownloader/ The main issue is when any image download finishes, the whole Screen would seem to reset. Along with the view reset the position of the animated UI controls resets too.
0
[ 2, 184, 20, 2658, 302, 19831, 14, 979, 1418, 75, 12797, 40, 1961, 4725, 19, 13005, 60, 800, 3726, 3726, 31, 22, 79, 638, 27, 40, 13005, 669, 29, 21, 865, 1961, 12797, 37, 21, 5388, 8128, 9, 31, 22, 79, 568, 48, 10082, 26, 7121...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why is there no "NULL reference" in C++? === I was reading the C++ FAQ - "[8.6 - When should I use references, and when should I use pointers?](http://www.parashift.com/c++-faq-lite/refs-vs-ptrs.html)" and in particular this statement: > Use references when you can, and pointers when you have to. > > ... > > The exception to the above is where a function's parameter or return value needs a "sentinel" reference — a reference that does not refer to an object. This is usually best done by returning/taking a pointer, and giving the NULL pointer this special significance (references must always alias objects, not a dereferenced NULL pointer). From what I've seen, the need for a "sentinel" reference is indeed often the reason to use pointers instead of references. What I'm wondering is: why doesn't C++ have a special "NULL value" for references? It seems it would make pointers almost unnecessary, which would solve many problems, and it's probably not that hard to implement for a compiler. So why wasn't it part of the language specification?
0
[ 2, 483, 25, 80, 90, 13, 7, 4215, 211, 2801, 7, 19, 272, 20512, 60, 800, 3726, 3726, 31, 23, 1876, 14, 272, 20512, 1399, 1251, 13, 8, 13, 7, 2558, 457, 9, 379, 13, 8, 76, 378, 31, 275, 7231, 15, 17, 76, 378, 31, 275, 454, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I create a chat communication channel between 2 users in asp.net === I want to add a chat application in my website. I have developed almost part of chat application.But I am getting problem to create chat communication channel.I an using Web-Service to insert and retrieve messages from data base. When I enter the new message then another user can not read that message until he will reload its chat window.
0
[ 2, 184, 92, 31, 1600, 21, 6615, 3291, 1318, 128, 172, 3878, 19, 28, 306, 9, 2328, 800, 3726, 3726, 31, 259, 20, 3547, 21, 6615, 3010, 19, 51, 2271, 9, 31, 57, 885, 557, 141, 16, 6615, 3010, 9, 811, 31, 589, 1017, 1448, 20, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
No request parameters in rails 3 log files === I used to get request parameters in the log fail when using rails < 3. I have just upgraded to the latest version and now I see only url and db queries. Debug level is warn. Is there some new setting to see the request parameters? BR, Pavel
0
[ 2, 90, 3772, 12905, 19, 2240, 18, 203, 6738, 6488, 800, 3726, 3726, 31, 147, 20, 164, 3772, 12905, 19, 14, 6738, 7476, 76, 568, 2240, 18, 13, 1, 203, 9, 31, 57, 114, 9958, 20, 14, 5736, 615, 17, 130, 31, 196, 104, 287, 6362, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Recruiting a design architect and urban designer === What are the tips to recruit design architect for an architectural engineering consultant; How can i know his taste of design (if he is artistic)?
2
[ 2, 15890, 21, 704, 3338, 17, 1980, 4742, 800, 3726, 3726, 98, 50, 14, 11034, 20, 12595, 704, 3338, 26, 40, 5350, 1552, 7381, 73, 184, 92, 31, 143, 33, 3576, 16, 704, 13, 5, 821, 24, 25, 4917, 6, 60, 3, 0, 0, 0, 0, 0, 0, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
App not coming in ICS market android === I have added these permissions in the android market place. <!-- Camera --> <!-- Required to be able to access the camera device. --> <uses-permission android:name="android.permission.CAMERA"/> <uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera.autofocus" android:required="false" /> and then i have uploaded the app to Android Market. But my is not visible in the Android 4.0.3 tablet market. But visible in Android HoneyComb market place. Minsdkversion: 12 Target : 12 Is any thing that i made mistake???
0
[ 2, 4865, 52, 880, 19, 13, 8354, 1135, 13005, 800, 3726, 3726, 31, 57, 905, 158, 5572, 18, 19, 14, 13005, 1135, 209, 9, 13, 1, 187, 8, 8, 3336, 13, 8, 8, 1, 13, 1, 187, 8, 8, 1390, 20, 44, 777, 20, 1381, 14, 3336, 3646, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to pick data-url´s out of html code with htmlAgilityPack? === (C#.NET) Heyhow, i have a little question: I´m writing a little Download-Roboter, that is searching for links in lower layers for it self. What i need to find are all links in an html-Page (the links to .jpg files as well as the links to .pgn, .pdf, .html,.... - files) I´m using the html-agilitypack to find all a-href links. Sample code: foreach (HtmlNode link in htmlDocument.DocumentNode.SelectNodes("//a[@href]")) { HtmlAttribute attribute = link.Attributes["href"]; links.Add(attribute.Value); } But i want to find the data-urls as well. What XPath-syntax do i have to use to find data-urls. An example data-url in an htmlcode: <div class="cbreplay" data-url="2012\edmonton\partien.pgn"></div> I need the "2012\edmonton\partien.pgn" out of this example. How can i realize this with XPath syntax? Best greetings, if i made some bad mistakes, tell me. This is my first question ever.
0
[ 2, 184, 20, 2036, 1054, 8, 911, 255, 13, 18, 70, 16, 13, 15895, 1797, 29, 13, 15895, 3302, 20901, 8573, 60, 800, 3726, 3726, 13, 5, 150, 5910, 9, 2328, 6, 8409, 1544, 15, 31, 57, 21, 265, 1301, 45, 31, 307, 1174, 21, 265, 71...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Separate web and email host === My client has their domain name (lorem.com) registered with company X which also host their email. I'd like to host their new website with separate hosting company (company Y). I know I need to update the DNS nameservers for their domain name to point to company Y's nameservers. I'm not sure how to handle the email host though. Doing an MX lookup on their domain, currently shows: >Pref Hostname >10 lorem.com >20 mx2.companyX.com Do I need to do any updates to the MX record? Thanks!
0
[ 2, 1725, 2741, 17, 8517, 2015, 800, 3726, 3726, 51, 6819, 63, 66, 4603, 204, 13, 5, 16052, 79, 9, 960, 6, 3801, 29, 237, 993, 56, 67, 2015, 66, 8517, 9, 31, 22, 43, 101, 20, 2015, 66, 78, 2271, 29, 1725, 10637, 237, 13, 5, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to remove missing tags from HTML source in Asp.net === Sometime it has been seen that the HTML source that we receive from some website are not having proper tag ending, and that affect our UI. So , like **<br/> &lt;p&gt; hello the para start here ..&lt;/p&gt; &lt;p&gt; some text and no ending tag** And there is no ending tag . I want to retain the HTML format and want this like **&lt;p&gt; hello the para start here &lt;/p&gt; some text and no ending tag** One more thing is that sometime we get the end tag at the start that should also be resolved by the algorithm .. Abdur Rahman..
0
[ 2, 184, 20, 4681, 2863, 3383, 18, 37, 13, 15895, 1267, 19, 28, 306, 9, 2328, 800, 3726, 3726, 8530, 32, 63, 74, 541, 30, 14, 13, 15895, 1267, 30, 95, 2588, 37, 109, 2271, 50, 52, 452, 4119, 3383, 3119, 15, 17, 30, 6245, 318, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
MVC Routing - Using NGINX to route instead of PHP (or Ruby, etc.) === I'm currently messing around with making a custom MVC framework for educational (and, if it's good, actual practical) use, and I like to investigate different scenarios for possible performance boosts. When it comes to URI routing, I'm familiar with the standard URI format of /controller/action/id And parsing the data out of this to control the routing wouldn't be too difficult. Now, what I'm moreso wondering about is the performance difference between having nginx parse this URI string out into a query string of some type to pass to a controller directly, so that would end up like /foo/bar/12 => /application/foo.php?action=bar&id=12 instead of /foo/bar/12 => /index.php?controller=foo&action=bar&id=12 or even /foo/bar/12 => /index.php?uri=/foo/bar/12 (note that this would be encoded) I'm aware that nginx passes the url, query string, and other things to php-fpm in other variables already, but this is just for illustrative purposes to show what I'm thinking. Is this a stupid thing to do? I know that by defining routes explicitly in nginx would mean me needing to restart nginx every time I alter the routes in the config, which could be a downside. So, to restate the question: When it comes to MVC routing, is there any worthwhile performance gain by having the actual webserver (in this case, nginx) itself handle the routing to the controller OR is using a standard landing script (like index.php in the root of the directory) and passing along the URI to be parsed for routing perfectly fine? Thanks ahead of time. Also, I'm just learning about these things, so I wholeheartedly welcome suggestions on what I should be doing instead.
0
[ 2, 307, 8990, 19880, 13, 8, 568, 13, 2723, 108, 396, 20, 858, 700, 16, 13, 26120, 13, 5, 248, 10811, 15, 2722, 9, 6, 800, 3726, 3726, 31, 22, 79, 871, 3957, 68, 140, 29, 544, 21, 5816, 307, 8990, 6596, 26, 3076, 13, 5, 290, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Open process & paste text within this process === Alright, I can't seem to find anything decent on how I'd go about doing this I basically need to Open a process (easy) and then somehow paste data from my application into this opened application into it's currently active textbox. Does anyone have any clue on how I'd even get started on something like that? Thanks
0
[ 2, 368, 953, 279, 640, 62, 1854, 363, 48, 953, 800, 3726, 3726, 11885, 15, 31, 92, 22, 38, 2260, 20, 477, 602, 12238, 27, 184, 31, 22, 43, 162, 88, 845, 48, 31, 11374, 376, 20, 368, 21, 953, 13, 5, 18385, 6, 17, 94, 3625, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Text on image on hover implementation === I'm using the following code for a slide show in my portfolio. It has a section for a photo, another one for a title, and another one for an accompanying story. They all change with next and prev buttons at the same time. I'm trying to get the story text show up when mouse hovers over the image. I've been trying to implement various codes I found online but couldn't achieve a result so far. When I try, either the images never show up or the stories never show up and I couldn't find a way around. The type of effect I'm looking for would be the one in the middle of the left side of the screen on this link; http://tympanus.net/jCapSlide/ I am wondering if anyone knows how to implement this animation to my code. And I also want to keep the other sections like the title section functioning the same. Here is the code I'm using at the moment; http://jsfiddle.net/elliotgray/64nfP/ And below is the code that is used to create hover text animation on the link above in case it might be useful. This is from the downloaded code from their site. Any help would be appreciated. (function($) { $.fn.capslide = function(options) { var opts = $.extend({}, $.fn.capslide.defaults, options); return this.each(function() { $this = $(this); var o = $.meta ? $.extend({}, opts, $this.data()) : opts; if(!o.showcaption) $this.find('.ic_caption').css('display','none'); else $this.find('.ic_text').css('display','none'); var _img = $this.find('img:first'); var w = _img.css('width'); var h = _img.css('height'); $('.ic_caption',$this).css({'color':o.caption_color,'background-color':o.caption_bgcolor,'bottom':'0px','width':w}); $('.overlay',$this).css('background-color',o.overlay_bgcolor); $this.css({'width':w , 'height':h, 'border':o.border}); $this.hover( function () { if((navigator.appVersion).indexOf('MSIE 7.0') > 0) $('.overlay',$(this)).show(); else $('.overlay',$(this)).fadeIn(); if(!o.showcaption) $(this).find('.ic_caption').slideDown(500); else $('.ic_text',$(this)).slideDown(500); }, function () { if((navigator.appVersion).indexOf('MSIE 7.0') > 0) $('.overlay',$(this)).hide(); else $('.overlay',$(this)).fadeOut(); if(!o.showcaption) $(this).find('.ic_caption').slideUp(200); else $('.ic_text',$(this)).slideUp(200); } ); }); }; $.fn.capslide.defaults = { caption_color : 'white', caption_bgcolor : 'black', overlay_bgcolor : 'blue', border : '1px solid #fff', showcaption : true }; })(jQuery); Thank you!
0
[ 2, 1854, 27, 1961, 27, 21350, 6123, 800, 3726, 3726, 31, 22, 79, 568, 14, 249, 1797, 26, 21, 6464, 298, 19, 51, 10588, 9, 32, 63, 21, 1050, 26, 21, 3056, 15, 226, 53, 26, 21, 581, 15, 17, 226, 53, 26, 40, 11334, 609, 9, 59...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Ruby on Rails : Meaning of this syntax in Ruby === I'm sorry if my question is silly because I just want to ask what does below line meaning in Ruby. (I'm reading a book about Rails as fast as possible for my course, so I don't have firm Ruby language) Here is a piece of code for unit test purpose : class ProductTest < ActiveSupport::TestCase test "product attributes must not be empty" do // this line I don't know product = Product.new assert product.invalid? assert product.errors[:title].any? assert product.errors[:description].any? assert product.errors[:price].any? assert product.errors[:image_url].any? end The thing I want to ask is : At the line I don't know, the syntax `test "...." do `, what does it mean? (it is a function method class ... ?) Thanks :)
0
[ 2, 10811, 27, 2240, 18, 13, 45, 1813, 16, 48, 22649, 19, 10811, 800, 3726, 3726, 31, 22, 79, 1875, 100, 51, 1301, 25, 10752, 185, 31, 114, 259, 20, 1349, 98, 630, 1021, 293, 1813, 19, 10811, 9, 13, 5, 49, 22, 79, 1876, 21, 3...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Mysql: labelled part of query for reuse === I have a query like below that I use to retrieve record not update for a given time (in hours) and order it by elapsed time: SELECT TABLE.Key, TIMESTAMPDIFF(HOUR, TABLE.Date_last_consulted, CURRENT_TIMESTAMP) FROM TABLE WHERE TIMESTAMPDIFF(HOUR, TABLE.Date_last_consulted, CURRENT_TIMESTAMP) <= 7 ORDER BY TIMESTAMPDIFF(HOUR, TABLE.Date_last_consulted, CURRENT_TIMESTAMP); As you can see, this need multiple call to TIMESTAMPDIFF. This is not very good as all those calls are in fact the same and made SQL do calculation that are useless. I'm wondering if there is a way to have a kind of label or shurtcut in order to have the calculation done only one time. Thanks a lot for your help. Florent
0
[ 2, 51, 18, 22402, 45, 21854, 141, 16, 25597, 26, 302, 3699, 800, 3726, 3726, 31, 57, 21, 25597, 101, 1021, 30, 31, 275, 20, 11917, 571, 52, 11100, 26, 21, 504, 85, 13, 5, 108, 974, 6, 17, 389, 32, 34, 13, 62, 17057, 43, 85, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Echo mixed code === I'm trying to echo a mixed string containing html code and PHP code but every possible thing I tried didn't work out. Basically I want to do is looping the following code for 3 times. Giving me 3 divs with number incrementation in the name every time. This code is going to be used in a wordpress template. My normal code without echoing is the following: <div id="gallery <?php $c; ?> "><?php query_posts( 'post_type=portfolio'); ?><?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?><?php if ( has_post_thumbnail()) : ?> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" <?php the_post_thumbnail(); ?></a> <?php endif; ?><h1><?php the_title(); ?></h1> <a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" <h2>View Project</h2></a> <?php the_content() ?> <?php endwhile; ?> <?php endif; ?> </div> I'm fairly new to PHP so I don't know how to echo this the proper way. My for-loop has already been setup. I hope you guys can help me out. Kind regards Dragon54
0
[ 2, 8117, 2198, 1797, 800, 3726, 3726, 31, 22, 79, 749, 20, 8117, 21, 2198, 3724, 3503, 13, 15895, 1797, 17, 13, 26120, 1797, 47, 352, 938, 584, 31, 794, 223, 22, 38, 170, 70, 9, 11374, 31, 259, 20, 107, 25, 5293, 68, 14, 249, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Adobe TLF with Flex/AS3: how to programmatically change \n in text string into paragraph tags and insert into TextFlow? === My Flex/AS3 web application accesses a database and retrieves text containing \n for newline character. Otherwise the text looks like normal text. Is there a way to convert the \n into paragraph tags that I can insert into an spark TextFlow? For example, my only experience with TLF is in writing mxml code such as follows: <s:RichEditableText width="100%" height="100%" textAlign="left" paddingTop="0" paragraphSpaceAfter="0.3" editable="false"> <s:textFlow> <s:TextFlow> <s:p fontWeight="bold" fontSize="15">My Title Text</s:p> <s:p fontSize="2"/> <s:p>{paragraph1_text}</s:p> <s:p>{paragraph2_text}</s:p> <s:p>{paragraph3_text}</s:p> <s:p fontSize="2"/> </s:TextFlow> </s:textFlow> </s:RichEditableText> Suppose I retrieve a string from the database such as: `paragraph1_text = "This is some text.\nThis is some more text.\nThis is even more text."` Even though inserting this into the code above will recognize the new line character, it won't recognize the `paragraphSpaceAfter="0.3"`. My goal is to have the effect of: <s:RichEditableText width="100%" height="100%" textAlign="left" paddingTop="0" paragraphSpaceAfter="0.3" editable="false"> <s:textFlow> <s:TextFlow> <s:p fontWeight="bold" fontSize="15">My Title Text</s:p> <s:p fontSize="2"/> <s:p>This is some text.</s:p> <s:p>This is some more text.</s:p> <s:p>This is even more text.</s:p> <s:p>{paragraph2_text}</s:p> <s:p>{paragraph3_text}</s:p> <s:p fontSize="2"/> </s:TextFlow> </s:textFlow> </s:RichEditableText> Is there any way to achieve something like this programmatically (the database text could be anything)? I tried changing paragraph1_text to: `paragraph1_text="<s:p>This is some text.</s:p><s:p>This is some more text.</s:p><s:p>This is even more text.</s:p>"` and then using this in the first code block above, but it simply printed out all of the `<s:p>` and `</s:p>` tags. Any advice appreciated.
0
[ 2, 20299, 13, 38, 9641, 29, 14409, 118, 472, 240, 45, 184, 20, 625, 6732, 1326, 753, 13, 1, 103, 19, 1854, 3724, 77, 20599, 3383, 18, 17, 14692, 77, 1854, 9990, 60, 800, 3726, 3726, 51, 14409, 118, 472, 240, 2741, 3010, 1381, 16...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
If statement with two condition and file header? === So my goal here is to use an if statement with two conditions to test before writing a header of a file. However for some reason, my if statement with two testing conditions didn't even go though some at some point in the run something should have pass the if statement test. Here is my code below: Thanks in advance. <code>uniprotID ='Q14591' makeList = createRef() for i, (start, end) in enumerate(searchPFAM(fname)): print start, end for item in lookup[uniprotID]: if start <=end: if (start <= item) and (item <=end): with open('newfile-%s.txt' % i,'w') as fileinput: fileinput.write(">"+uniprotID+' | '+ int(item-start)+' at position') text=''.join(makeList[(start-1):(end)]) fileinput.write(text) else: with open('newfile-%s.txt' % i,'w') as fileinput: fileinput.write(">"+uniprotID+' | '+ 'There is no mutation position') text=''.join(makeList[(start-1):(end)]) fileinput.write(text)</code>
3
[ 2, 100, 3331, 29, 81, 2874, 17, 3893, 157, 106, 60, 800, 3726, 3726, 86, 51, 1195, 235, 25, 20, 275, 40, 100, 3331, 29, 81, 2039, 20, 1289, 115, 1174, 21, 157, 106, 16, 21, 3893, 9, 207, 26, 109, 1215, 15, 51, 100, 3331, 29,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Any predefined type for unsigned 96 bit integer? === I am working on a feature which needs to keep track of a bit-map of length 96. I use this map to program asic below. Is there a standard integer type to hold 96 bits. For 64 bits, we have unsigned long long. Anything similar for 96 bits? Any alternate suggestion welcome as well. PS: This is Cisco OS based on linux. Language is C.
0
[ 2, 186, 782, 13439, 1001, 26, 28839, 8659, 1142, 13820, 60, 800, 3726, 3726, 31, 589, 638, 27, 21, 1580, 56, 2274, 20, 643, 792, 16, 21, 1142, 8, 15022, 16, 1476, 8659, 9, 31, 275, 48, 2942, 20, 625, 28, 596, 1021, 9, 25, 80, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Select Date.today from date_select in integration test === I have a form with a date_select which shows 3 selectboxes for day, month and year. I have a rspec integration test where I want to select today's date with capybara. So I have to split Date.today into a day, month and year. What's a good way to do this? I could do some string splits, but maybe there is a more sophisticated way to do? Here you see the capybara code to select the date hard coded: select("13", :from => "visit_visit_date_3i") select("July", :from => "visit_visit_date_2i") select("2012", :from => "visit_visit_date_1i")
0
[ 2, 5407, 1231, 9, 15260, 37, 1231, 1, 18, 16964, 19, 8078, 1289, 800, 3726, 3726, 31, 57, 21, 505, 29, 21, 1231, 1, 18, 16964, 56, 1285, 203, 5407, 5309, 160, 26, 208, 15, 1617, 17, 159, 9, 31, 57, 21, 13, 1224, 12610, 8078, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
C# IEnumerable, IEnumerator Reset Function Not Get Called === I'm basicly trying to make my class able to iterate using `foreach`. I read this tutorial. [MSDN][1]. It seems very straight forward. However, I have a problem when I want to iterate second time. I debugged it; and it turned out that it doesn't call the `Reset()` function. Class A -------- class A : IEnumerable, IEnumerator { int[] data = { 0, 1, 2, 3, 4 }; int position = -1; public object Current { get { return data[position]; } } public bool MoveNext() { position++; return (position < data.Length); } public void Reset() { position = -1; } public IEnumerator GetEnumerator() { return (IEnumerator)this; } } When I run the following main function; it never calls `Reset()` function. So, after one loop I never be able to iterate my class again. Main ---- static void Main(string[] args) { A a = new A(); foreach (var item in a) { Console.WriteLine(item); } Console.WriteLine("--- First foreach finished. ---"); foreach (var item in a) { Console.WriteLine(item); } } Output: ------ 0 1 2 3 4 --- First foreach finished. --- Press any key to continue . . . Any thoughts? [1]: http://support.microsoft.com/kb/322022
0
[ 2, 272, 5910, 13, 660, 6336, 106, 579, 15, 13, 660, 6336, 106, 3457, 23422, 1990, 52, 164, 227, 800, 3726, 3726, 31, 22, 79, 2125, 102, 749, 20, 233, 51, 718, 777, 20, 32, 106, 1373, 568, 13, 1, 1106, 14322, 1, 9, 31, 1302, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Crop PDF using iTextSharp === How can I crop a PDF using iTextsharp in C#?? How do I modify the CropBoxSize parameters to create a new cropped pdf file?
0
[ 2, 9833, 13, 11124, 568, 31, 11969, 23646, 800, 3726, 3726, 184, 92, 31, 9833, 21, 13, 11124, 568, 31, 11969, 23646, 19, 272, 5910, 60, 60, 184, 107, 31, 17579, 14, 9833, 5309, 10454, 12905, 20, 1600, 21, 78, 9833, 3631, 13, 11124...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
How image (or texture) resizing works? === I want to know how image/texture resizing in Android (API 8) works. Consider the image as an array or a matrix. I mean what should be done with the RGB values in case we want to shrink the image. (Great if you could provide some code!). My final goal however is setting up in OpenGL ES. Thanks in advance. 4x4: [x x x x|x x x x|x x x x|x x x x]
0
[ 2, 184, 1961, 13, 5, 248, 12714, 6, 10719, 3335, 693, 60, 800, 3726, 3726, 31, 259, 20, 143, 184, 1961, 118, 11969, 4221, 10719, 3335, 19, 13005, 13, 5, 2552, 49, 469, 6, 693, 9, 3563, 14, 1961, 28, 40, 7718, 54, 21, 8187, 9, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to map entity framework model to columns dynamically? === We are working with a third-party application that allows users to create their own tables with different columns. Each table follows the format "T{ID}" (T12, T23, etc.). I've used the following code to access appropriate table: public class RecordDataContext : System.Data.Entity.DbContext { public RecordDataContext(string nameOrConnectionString, string tableName) : base(nameOrConnectionString) { if (string.IsNullOrEmpty(tableName)) throw new ArgumentNullException("tableName"); TableName = tableName; } public string TableName { get; private set; } public DbSet<Record> Records { get; set; } protected override void OnModelCreating(DbModelBuilder modelBuilder) { modelBuilder.Entity<Record>() .ToTable(TableName); } } Each table has certain columns that are the same (ID, CreateDateTime, ModifyDateTime, etc.). They also allow users to add their own columns, the user friendly column headers are stored in some other table and the columns in the data table follow this format "Index{ID}" (Index20, Index35, etc.). Using Entity Framework I would like to be able to pull in the data into a POCO model like this where the data from the Index columns are stored in the Data property: public class Record { [Key] public int ID { get; set; } public DateTime CreateDateTime { get; set; } public DateTime ModifyDateTime { get; set; } public IDictionary<int, string> Data { get; set; } } If this is not possible, are there other ways to retrieve the Index columns without making a separate SQL request?
0
[ 2, 184, 20, 2942, 9252, 6596, 1061, 20, 7498, 7782, 1326, 60, 800, 3726, 3726, 95, 50, 638, 29, 21, 422, 8, 9635, 3010, 30, 2965, 3878, 20, 1600, 66, 258, 7484, 29, 421, 7498, 9, 206, 859, 2415, 14, 2595, 13, 7, 38, 1, 1340, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
asp Reporting view control and report design === I need to use the rdlc report within my asp website project design the report and view it throw the report view controller Any full working demo or blog useing just only the .net report !
0
[ 2, 28, 306, 6670, 1418, 569, 17, 1330, 704, 800, 3726, 3726, 31, 376, 20, 275, 14, 13, 897, 6109, 1330, 363, 51, 28, 306, 2271, 669, 704, 14, 1330, 17, 1418, 32, 3814, 14, 1330, 1418, 9919, 186, 503, 638, 8376, 54, 8146, 275, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0...
SQL fuzzy search and Google-like improvements === Interesting challenge; my client enters some product information in a SQL database. The product is a painting of a famous old Russian composer called *Rachmaninoff*. So that name is in the description field. Now, only a few of their customers searching for products know exactly how to spell this name, but most of the time it's misspelled. Besides misspelling there are also a lot of international customers who just write this name completely different like, *Rachmaninow*, *Rahmaninov*, *Рахманінаў*. If i put any of these misspellings or translations in Google it (almost) always knows how to correct it and to redirect me straight to the right page. Does anyone know what my possibilities are to get some of this magic in my product search? Are there some API's i can use? Some super free text option that i don't know of? Or ...
0
[ 2, 4444, 255, 20631, 2122, 17, 8144, 8, 1403, 7951, 800, 3726, 3726, 4883, 2404, 73, 51, 6819, 8104, 109, 2374, 676, 19, 21, 4444, 255, 6018, 9, 14, 2374, 25, 21, 2469, 16, 21, 1561, 315, 1154, 3039, 227, 1637, 9676, 177, 108, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Writing and reading a file for parsing after the download === Ok, I thought this would be simpler but I was probably wrong.. My parser works fine (directly with the connection works) so I've some BASIC problems with writing and reading a file on Android (aka Java) or with Input/Output Stream.. The problem is that I don't know what's not working.. I'm missing any permission? I'm missing something while writing or reading the file? Here is the code: URL url = new URL(urlXml); SAXParserFactory spf = SAXParserFactory.newInstance(); SAXParser sp = spf.newSAXParser(); XMLReader reader = sp.getXMLReader(); CustomXmlHandler handler = new CustomXmlHandler(); reader.setContentHandler((ContentHandler) handler); String fileName = getFileName(); File f = getFileStreamPath(fileName); if(!f.exists()) { FileOutputStream fos = openFileOutput(fileName, Context.MODE_PRIVATE); URLConnection conn = url.openConnection(); conn.setConnectTimeout(5000); conn.setReadTimeout(10000); InputStream in = conn.getInputStream(); byte[] buffer = new byte[1024]; int len = 0; while((len = in.read(buffer)) != -1) { fos.write(buffer, 0, len); } fos.close(); in.close(); } FileInputStream fis = openFileInput(fileName); reader.parse(new InputSource(new InputStreamReader(fis))); fis.close(); myObject = handler.getMyObject(); Thanks in advance.. I'm getting crazy..
0
[ 2, 1174, 17, 1876, 21, 3893, 26, 2017, 18, 68, 75, 14, 7121, 800, 3726, 3726, 5854, 15, 31, 289, 48, 83, 44, 19120, 47, 31, 23, 910, 1389, 9, 9, 51, 2017, 4104, 693, 1123, 13, 5, 14706, 102, 29, 14, 2760, 693, 6, 86, 31, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
phantomjs doesn't work in php through browser (but does via command line, and even by running php through command line!!!) === So, I'm trying to get phantomjs to do something, ANYTHING via PHP. At this point I don't care what's called, exec, shell_exec, system, passthru, anything! When I run the javascript file directly through the command line, it works fine. When I run "php render_html.php" in the command line, which just runs an exec(), it works fine. However, when I try opening this php file in the browser, it does nothing. I don't even get anything back to echo. I've done all this testing locally on OS X, and on my EC2 server, and I get the same result. Thanks to all who reply!
0
[ 2, 11771, 728, 18, 1437, 22, 38, 170, 19, 13, 26120, 120, 16495, 13, 5, 811, 630, 1197, 1202, 293, 15, 17, 166, 34, 946, 13, 26120, 120, 1202, 293, 28116, 6, 800, 3726, 3726, 86, 15, 31, 22, 79, 749, 20, 164, 11771, 728, 18, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to understand Process.Threads.Count results? What this variable display? === Lets write simple console application (debug mode): static void Main(string[] args) { Process p = Process.GetCurrentProcess(); IList<Thread> threads = new List<Thread>(); Console.WriteLine(p.Threads.Count); for(int i=0;i<30;i++) { Thread t = new Thread(Test); Console.WriteLine("Before start: {0}", p.Threads.Count); t.Start(); Console.WriteLine("After start: {0}", p.Threads.Count); } Console.WriteLine(Process.GetCurrentProcess().Threads.Count); Console.ReadKey(); } static void Test() { for(int i=0;i<100;i++)Thread.Sleep(1); } What do you think you will see in results? **[Q1] Why p.Threads.Count differ from Process.GetCurrentProcess().Threads.Count ?** Lets do another test: static void Main(string[] args) { IList<Thread> threads = new List<Thread>(); Console.WriteLine(Process.GetCurrentProcess().Threads.Count); for(int i=0;i<30;i++) { Thread t = new Thread(Test); Console.WriteLine("Before start: {0}", Process.GetCurrentProcess().Threads.Count); t.Start(); Console.WriteLine("After start: {0}", Process.GetCurrentProcess().Threads.Count); } Console.WriteLine(Process.GetCurrentProcess().Threads.Count); Console.ReadKey(); } static void Test() { Thread.Sleep(0); } **[Q2] Why waiting threads not calculated?**
0
[ 2, 184, 20, 1369, 953, 9, 96, 10647, 18, 9, 16549, 1736, 60, 98, 48, 7612, 3042, 60, 800, 3726, 3726, 6884, 2757, 1935, 8650, 3010, 13, 5, 546, 16254, 3740, 6, 45, 12038, 11364, 407, 5, 11130, 2558, 500, 13, 10663, 18, 6, 13, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to compare names in MS Excel 2010 with filenames? === My goal: to compare the filenames in a directory with the names in a spreadsheet. If there is a match, then I wish to append the corresponding account number of that name to the filename. I have used the dir command to retrieve all of the filenames in a directory, then pasted the list into a column in the Excel spreadsheet. I now have 4 columns: Account number, LastName, FirstName, and filename. The main problem here is that the filenames are inconsistent. They're in the form of "lastname, firstname date", but they vary in the forms of "Smith, John 010112", "Smith, J. 010112", "Smith J 010112". This means that when it comes to the first name, I'll only be comparing the first letter of the string. So essentially, for each filename I need to check the lastname against the lastname column. If a match is found, then I need to check the first letter of the filename's firstname against the first letter of the firstname in the same row as the matching lastname. If this is also a match, then I need to grab the account number in that row and append it to the filename. How could I do this? I'm pretty new to Excel functions, but I do have a little experience with coding in Java and C from some college classes.
0
[ 2, 184, 20, 11590, 1817, 19, 4235, 20700, 498, 29, 3893, 7259, 18, 60, 800, 3726, 3726, 51, 1195, 45, 20, 11590, 14, 3893, 7259, 18, 19, 21, 16755, 29, 14, 1817, 19, 21, 1789, 17627, 9, 100, 80, 25, 21, 730, 15, 94, 31, 2536, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is there a way to revert a file line by line in P4 === I want to revert part of changes in a file. I know in p4v you can easily revert files line by line. I am wondering how to do that using p4 command.
0
[ 2, 25, 80, 21, 161, 20, 24156, 21, 3893, 293, 34, 293, 19, 351, 300, 800, 3726, 3726, 31, 259, 20, 24156, 141, 16, 1693, 19, 21, 3893, 9, 31, 143, 19, 351, 300, 710, 42, 92, 2351, 24156, 6488, 293, 34, 293, 9, 31, 589, 5712,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0...
Properly lock a multiprocessing.Pool over an iterator without memory overhead === I have a iterable object in python `Z`, which is to large to fit into memory. I would like to perform a parallel calculation over this object and write the results, in order that they appear in `Z`, to a file. Consider this silly example: import numpy as np import multiprocessing as mp import itertools as itr FOUT = open("test",'w') def f(x): val = hash(np.random.random()) FOUT.write("%s\n"%val) N = 10**9 Z = itr.repeat(0,N) P = mp.Pool() P.map(f,Z,chunksize=50) P.close() P.join() FOUT.close() There are two major problems with this: 1. multiple results can be written to the same line 2. a result is returned with `N` objects in it - this will be to big to hold in memory (and we don't need it!). **What I've tried**: - Using a global lock `mp.Lock()` to share the `FOUT` resource: doesn't help, because I think each worker creates it's own namespace. - Use `apply_async` instead of `map`: While having callback fixes 1], 2], it doesn't accept an iterable object. - Use `imap` instead of `map` and iterating over the results: Something like: def f(x): val = hash(np.random.random()) return val P = mp.Pool() C = P.map(f,Z,chunksize=50) for x in C: FOUT.write("%s\n"%x) This still uses inordinate amounts of memory, though I'm not sure why.
0
[ 2, 7428, 3991, 21, 1889, 16835, 68, 9, 13378, 84, 40, 32, 106, 3457, 366, 1912, 8860, 800, 3726, 3726, 31, 57, 21, 32, 106, 579, 3095, 19, 20059, 13, 1, 380, 1, 15, 56, 25, 20, 370, 20, 2742, 77, 1912, 9, 31, 83, 101, 20, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Django directory structure? === I would like to implement a simple queueing service specific to a project. Where should the code go into in the Django directory structure? Currently the structure is: sound/ __init__.py models.py tests.py views.py static
0
[ 2, 3857, 14541, 16755, 1411, 60, 800, 3726, 3726, 31, 83, 101, 20, 8713, 21, 1935, 22521, 68, 365, 1903, 20, 21, 669, 9, 113, 378, 14, 1797, 162, 77, 19, 14, 3857, 14541, 16755, 1411, 60, 871, 14, 1411, 25, 45, 646, 118, 13, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
Need to update date code mm/dd/yyyy in in several webpages without using code === I need to get the date from the server in mm/dd/yyyy without any javascript or asp code. I would prefer to do this as either a link that flows in the current document frame and that also injects the mm/dd/yyyy into the current html web page as css or other non code based solution. I don't want to use any extraneous querying languages like xslt, xquery, or plinq either. example: <h3>Date:<date format="mm/dd/yyyy" src="currentdate.asp" /></h3> output: <h3>Date:06/26/2012</h3>
0
[ 2, 376, 20, 11100, 1231, 1797, 1620, 118, 8096, 118, 93, 93, 93, 93, 19, 19, 238, 2741, 6486, 18, 366, 568, 1797, 800, 3726, 3726, 31, 376, 20, 164, 14, 1231, 37, 14, 8128, 19, 1620, 118, 8096, 118, 93, 93, 93, 93, 366, 186, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
network + ui updates, asynctask vs handler === I have a map that i want to update from a separate thread. Im having some issues when i try to update the UI from my class that extends asynctask. And when i move the code to a handler in the main thread i get `NetworkOnMainThreadException`. Below is my asynctask. Is there any way to modify it to make it work? @Override protected Integer doInBackground(Void... params) { try { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://83.xx.xx:8080/android/service.php"); List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2); nameValuePairs.add(new BasicNameValuePair("action", "getusers")); nameValuePairs.add(new BasicNameValuePair("interval", Integer.toString(interval))); httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs)); HttpResponse response = httpclient.execute(httppost); String jsonString = EntityUtils.toString(response.getEntity()); Gson gson = new GsonBuilder().create(); Type listType = new TypeToken<ArrayList<User>>() {}.getType(); ArrayList<User> userList = gson.fromJson(jsonString, listType); ((GoogleMapsActivity) activity).removeOverlayItems(); for(User user : userList ){ ((GoogleMapsActivity) activity).addOverlayItem(Double.parseDouble(user.last_lat), Double.parseDouble(user.last_lng), user.bluetooth_name, "test desc"); } return 1; } catch (Exception e) { e.printStackTrace(); } return null;
0
[ 2, 982, 2754, 13, 5661, 16779, 15, 21, 9507, 20255, 3656, 4611, 24641, 800, 3726, 3726, 31, 57, 21, 2942, 30, 31, 259, 20, 11100, 37, 21, 1725, 9322, 9, 797, 452, 109, 1549, 76, 31, 1131, 20, 11100, 14, 13, 5661, 37, 51, 718, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to structure an asp.net app to have language in the address bar? === I want to have all addresses in my asp.net(web forms) application contain the selected language to allow search engines to index both language content. So I want it to be something like www.mysite.com/en/items/35 So what should I do to have it like that, I don't want to create page version for each of my language. I can set the page routing but how then I will understand what language to show in my page? should I analyse the address string and search for "/en/", "/ee/" and etc???
0
[ 2, 184, 20, 1411, 40, 28, 306, 9, 2328, 4865, 20, 57, 816, 19, 14, 3218, 748, 60, 800, 3726, 3726, 31, 259, 20, 57, 65, 12636, 19, 51, 28, 306, 9, 2328, 5, 14113, 1997, 6, 3010, 3717, 14, 1704, 816, 20, 1655, 2122, 4016, 20,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Remove item from session (show a remove button) === I have a button on a page, It's a simple input submit button, which sends the page ID to a form on another page to save it in a PHP session. I was wondering how I'd go about showing a remove button instead if that item is all ready in you session? This is the code that the form gets sent too <?php session_start(); if(!in_array($_POST['event_id'], $_SESSION['event_orders'])) { $_SESSION['event_orders'][] = $_POST['event_id']; } ?> The page with the button doesn't actually have any session code, but I guess it would be a simular IF kinda statement, but I am unsure of the exact syntax I should use? And how would it take the ID away from session?
0
[ 2, 4681, 9101, 37, 3723, 13, 5, 9303, 21, 4681, 5167, 6, 800, 3726, 3726, 31, 57, 21, 5167, 27, 21, 2478, 15, 32, 22, 18, 21, 1935, 6367, 12298, 5167, 15, 56, 11350, 14, 2478, 4924, 20, 21, 505, 27, 226, 2478, 20, 2079, 32, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Date Validation fails becouse of Dateformat i guess (regEx) === I have following regex which validating date: //are not both dates if (!methods._isDate(first[0].value) || !methods._isDate(second[0].value)) { return options.allrules[rules[i]].alertText + options.allrules[rules[i]].alertText2; } Regex below : _isDate: function (value) { var dateRegEx = new RegExp(/^\d{4}[\/\-](0?[1-9]|1[012])[\/\-](0?[1-9]|[12][0-9]|3[01])$|^(?:(?:(?:0?[13578]|1[02])(\/|-)31)|(?:(?:0?[1,3-9]|1[0-2])(\/|-)(?:29|30)))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(?:(?:0?[1-9]|1[0-2])(\/|-)(?:0?[1-9]|1\d|2[0-8]))(\/|-)(?:[1-9]\d\d\d|\d[1-9]\d\d|\d\d[1-9]\d|\d\d\d[1-9])$|^(0?2(\/|-)29)(\/|-)(?:(?:0[48]00|[13579][26]00|[2468][048]00)|(?:\d\d)?(?:0[48]|[2468][048]|[13579][26]))$/); return dateRegEx.test(value); }, But this looks like for mmddyy and my date is always ddmmyy Can you rewrite regex ? Please check it
0
[ 2, 1231, 27999, 13614, 44, 716, 3699, 16, 1231, 23588, 31, 2321, 13, 5, 12463, 1706, 6, 800, 3726, 3726, 31, 57, 249, 7953, 1706, 56, 7394, 1880, 1231, 45, 12894, 1509, 52, 156, 4076, 100, 13, 5, 187, 5909, 1807, 43, 18, 9, 1, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Interrupt a thread performing a long running database select === My requirement is quite similar to [this][1] one except that my long running IO operation is a database select. One rather rather creative solution suggested in that thread, involved closing the IO stream in a separate thread. However, I don't really have a reference to the input stream or socket. I can't even close the connection being used as I use spring-jdbc, which does not provide me access to the underlying connection being used. I believe JdbcTemplate.getDataSource().getConnection() will potentially return another connection from the data source. Appreciate any help/suggestions i can get. [1]: http://stackoverflow.com/questions/1024482/stop-interrupt-threads-blocked-on-wainting-input-from-socket
0
[ 2, 15811, 21, 9322, 2955, 21, 175, 946, 6018, 5407, 800, 3726, 3726, 51, 8981, 25, 1450, 835, 20, 636, 1565, 500, 2558, 165, 500, 53, 1613, 30, 51, 175, 946, 13, 1963, 1453, 25, 21, 6018, 5407, 9, 53, 864, 864, 4231, 4295, 2347,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Reprt has no table exception in crystal report in c# === I try to fetch data from my own defined dataset from db and show it to crystal report but i am getting exception "The report has no table " Ialso implement code in which I created document object, lad crstalreport to document setdatasource for documnent,set crystalreportviewer .report source =document help me... **.aspx code:** <CR:CrystalReportViewer ID="CrystalReportViewer3" runat="server" AutoDataBind="true" /> **.aspx .cs** protected void Page_Load(object sender, EventArgs e) { Class1 c = new Class1(); DataSet set = c.show(); CrystalReport4 rpt = new CrystalReport4(); ReportDocument docoment = new ReportDocument(); string path = Server.MapPath("CrystalReport4.rpt"); docoment.Load(path); docoment.SetDataSource(set); CrystalReportViewer3.ReportSource = docoment; CrystalReportViewer3.RefreshReport(); public DataSet show() { SqlConnection conn = dbconnect.GetConnection(); SqlCommand cmd = new SqlCommand("select employeename, address from employee", conn); SqlDataAdapter ad = new SqlDataAdapter(cmd); DataSet set = new DataSet(); ad.Fill(set); DataRow row= set.Tables[0].Rows[1]; return set; } public class dbconnct{ public static SqlConnection GetConnection() { SqlConnection con = new SqlConnection(@"Data Source=ABDULMANAN-PC; Initial Catalog=mydb;integrated security=true"); con.Open(); return con; } } **crystalreport4.rpt* In crystal report ,I only label two coulmn,employeename,address I
0
[ 2, 9411, 5256, 63, 90, 859, 5391, 19, 4282, 1330, 19, 272, 5910, 800, 3726, 3726, 31, 1131, 20, 18312, 1054, 37, 51, 258, 2811, 1054, 3554, 37, 13, 9007, 17, 298, 32, 20, 4282, 1330, 47, 31, 589, 1017, 5391, 13, 7, 124, 1330, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Android: Installing app === I am sorry, my English is bad. I have a problem. I have registered in Google Play and upload my app. But after install, the app don't open and there isn't app in the menu.
0
[ 2, 13005, 45, 25429, 4865, 800, 3726, 3726, 31, 589, 1875, 15, 51, 486, 25, 896, 9, 31, 57, 21, 1448, 9, 31, 57, 3801, 19, 8144, 418, 17, 71, 8294, 51, 4865, 9, 47, 75, 16146, 15, 14, 4865, 221, 22, 38, 368, 17, 80, 2532, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
Android OpenGL works on emulator but not phone === I have the following code for the Renderer: package hello.project; import javax.microedition.khronos.egl.EGLConfig; import javax.microedition.khronos.opengles.GL10; import android.content.Context; import android.opengl.GLSurfaceView.Renderer; import android.opengl.GLU; public class HelloOpenGLES10Renderer implements Renderer { private Square square; private Square2 square2;// the square private Context context; private Context context2; public static int w,h; /** Constructor to set the handed over context */ public HelloOpenGLES10Renderer(Context context) { this.square = new Square(); this.square2 = new Square2(); this.context=context; } public void onDrawFrame(GL10 gl) { /*Square.loadGLTexture(gl, this.context,Square.getSex()); Square2.loadGLTexture(gl, this.context,Square2.getHair()); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); gl.glMatrixMode(GL10.GL_MODELVIEW); gl.glLoadIdentity(); GLU.gluPerspective(gl, 45.0f, (float)w / (float)h, 0.1f, 100.0f); GLU.gluLookAt(gl, 0, 1, 5, 0f, 0f, 0f, 0f, 1.0f, 0.0f); gl.glColor4f(1.0f, 1.0f, 1.0f, 2.0f); square.draw(gl); square2.draw(gl);*/ // clear Screen and Depth Buffer Square.loadGLTexture(gl, this.context,Square.getSex()); Square2.loadGLTexture(gl, this.context,Square2.getHair()); gl.glColor4f(1.0f, 1.0f, 1.0f, 2.0f); gl.glClear(GL10.GL_COLOR_BUFFER_BIT | GL10.GL_DEPTH_BUFFER_BIT); // Reset the Modelview Matrix gl.glLoadIdentity(); // GLU.gluLookAt(gl, 0, 0, 0, 0, 0, 0, 0, 0, 0); // Drawing gl.glTranslatef(0.0f, 0.0f, -5.0f); // move 5 units INTO the screen square.draw(gl); square2.draw(gl); } public void onSurfaceChanged(GL10 gl, int width, int height) { if(height == 0) { //Prevent A Divide By Zero By height = 1; //Making Height Equal One } w=width; h=height; gl.glViewport(0, 0, width, height); //Reset The Current Viewport gl.glMatrixMode(GL10.GL_PROJECTION); //Select The Projection Matrix gl.glLoadIdentity(); //Reset The Projection Matrix //Calculate The Aspect Ratio Of The Window GLU.gluPerspective(gl, 45.0f, (float)width / (float)height, 0.1f, 100.0f); gl.glMatrixMode(GL10.GL_MODELVIEW); //Select The Modelview Matrix gl.glLoadIdentity(); //Reset The Modelview Matrix } public void onSurfaceCreated(GL10 gl, EGLConfig config) { // Load the texture for the square gl.glEnable(GL10.GL_BLEND); gl.glEnable(GL10.GL_TEXTURE_2D); gl.glShadeModel(GL10.GL_FLAT); //Enable Smooth Shading //gl.glEnable(GL10.GL_ALPHA_TEST); gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA); //gl.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); Square.loadGLTexture(gl, this.context,Square.getSex()); // gl.glAlphaFunc(GL10.GL_GREATER, 0.5f); gl.glDisable(GL10.GL_DEPTH_TEST); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); //Black Background gl.glClearDepthf(1.0f); //Depth Buffer Setup gl.glDepthFunc(GL10.GL_NEVER); //The Type Of Depth Testing To Do //Really Nice Perspective Calculations gl.glHint(GL10.GL_PERSPECTIVE_CORRECTION_HINT, GL10.GL_NICEST); } } If i use the current code from the onDrawFrame it works perfect for the emulator, but on the phone the SurfaceView is blank and i get nothing. I found on a post that i should use GLU.gluLookAt(); instead of gl.glLoadIdentity(); If I do that(the code that is commented in the onDrawFrame) it works, i get the background, but my textures are not loaded, neither on the phone or the emulator. What do i have to do so i could load them and the app to work?
0
[ 2, 13005, 368, 8430, 693, 27, 3579, 14868, 47, 52, 1132, 800, 3726, 3726, 31, 57, 14, 249, 1797, 26, 14, 16535, 106, 45, 6030, 10975, 9, 21011, 73, 9010, 8247, 396, 9, 22019, 22056, 9, 4278, 2075, 759, 9, 62, 8430, 9, 62, 8430, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Rails not redirecting after login === I am learning rails via Hartl's tutorial, but I can get chapter 9.2.3 [Link][1] to work Everything before this section was working perfectly before this section, but after getting here, if I access /users/1/edit and login with a different or same user, it redirects back to the user page and not to the edit page. sessions helper: def redirect_back_or(default) redirect_to(session[:return_to] || default) session.delete(:return_to) end def store_location session[:return_to] = request.fullpath end users controller methods for before_filter private def signed_in_user unless signed_in? store_location redirect_to signin_path, notice: "Please sign in." end end def correct_user @user = User.find(params[:id]) redirect_to(root_path) unless current_user?(@user) end before filters in user controller before_filter :signed_in_user,only:[:edit,:update,:index] before_filter :correct_user, only:[:edit,:update] My code so far [Github][2] [1]: http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#top [2]: https://github.com/Ommy/sample_app
0
[ 2, 2240, 18, 52, 302, 14706, 68, 75, 6738, 108, 800, 3726, 3726, 31, 589, 2477, 2240, 18, 1197, 4316, 255, 22, 18, 29724, 15, 47, 31, 92, 164, 1260, 561, 9, 135, 9, 240, 636, 6258, 500, 2558, 165, 500, 20, 170, 796, 115, 48, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
CLEAR_TOP + start new activity. Hierarchy issue === I have a hierarchy consisting of 4 levels of depth. My profile has 2nd level of hieararchy that means that pressing back while being in profile must always return user to the 1st hierarchy level. My problem is that link to the profile is available on all levels; so, for instance, if a user being on the 4th level clicks on the profile link his hierarchy position must be changed to the 2nd level - NOT to the 5th. I suppose there must be an essential way of doing it. So far I've come up with combination of `CLEAR_TOP to the 1st level + if(extra){startActivity(Profile)}` but in this way the 1st level activity will get recreated - right ? and that's why I want you to suggest something better. Thanks guys :)
0
[ 2, 1207, 1, 3880, 2754, 799, 78, 2358, 9, 14417, 1513, 800, 3726, 3726, 31, 57, 21, 14417, 4160, 16, 268, 2216, 16, 5204, 9, 51, 5296, 63, 172, 706, 662, 16, 4148, 10717, 8027, 93, 30, 1108, 30, 7196, 97, 133, 142, 19, 5296, 4...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
inline-level elements vs phrase elements vs block level elements === I am new to Web programming, Can I please know what is the difference between inline level elements vs phrase elements ? em and strong they are phrase elements ? but are they inline too, I don't quite get the difference, Also if you could add what is significance of knowing blocklevel elements in relation to inline, phrase elements, Thanks,
0
[ 2, 19, 1143, 8, 3906, 2065, 4611, 6845, 2065, 4611, 1921, 662, 2065, 800, 3726, 3726, 31, 589, 78, 20, 2741, 3143, 15, 92, 31, 2247, 143, 98, 25, 14, 2841, 128, 19, 1143, 662, 2065, 4611, 6845, 2065, 13, 60, 3579, 17, 966, 59, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
read and writing in tcl === Is there any way to read while it is writing at the same time in **TCL**? I tried to use w + _so_ and it didn't work. set f0 [open out11.tr w+] So I want to read every line that has been done writing at the same time
0
[ 2, 1302, 17, 1174, 19, 13, 38, 5316, 800, 3726, 3726, 25, 80, 186, 161, 20, 1302, 133, 32, 25, 1174, 35, 14, 205, 85, 19, 13, 1409, 38, 5316, 1409, 60, 31, 794, 20, 275, 619, 2754, 13, 1, 656, 1, 17, 32, 223, 22, 38, 170, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Can an iOS static library contain classes/interfaces, that can be used/implemented by iOS code that is using the library? === I apologize if this is a dumb question, or if it does not make sense. I've written some Objective-C code before, but I am not very familiar with writing code for OS X or iOS; I'm pretty much a novice. Currently, I'm trying to port a project from OS X into iOS. The project compiles into a Framework, that other OS X projects can use. I'm trying to do something similar for iOS. I understand that iOS does not support Frameworks and that the solution is to create a static library. However, the OS X Framework has several classes (in `.m` files) that the implementing code uses, extends, or implements. All the examples I've seen for static libraries seem to define a header-file with some functions that can be compiled into a static library. Is it possible to have classes inside the static library, that iOS code can use?
0
[ 2, 92, 40, 13, 7760, 12038, 1248, 3717, 2684, 118, 6280, 6413, 18, 15, 30, 92, 44, 147, 118, 8983, 413, 1130, 69, 34, 13, 7760, 1797, 30, 25, 568, 14, 1248, 60, 800, 3726, 3726, 31, 12059, 100, 48, 25, 21, 9317, 1301, 15, 54, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
sqlalchemy query based on a previous date? === Sorry if this is a strange question, I've been going through the docs/tutorial on the sqlalchemy site but I can't figure out how to do this specific query. I have a bunch of dates of activity on my site that continues until changed. I know I can query specific dates or ranges of dates but what if I query a date(which doesn't exist) can I get the previous match? For example say I have june 25, and june 30, as two dates, I run a query for June 29. Is it possible to get the June 25th data with only one query? I just want the previous match of a date I enter.
0
[ 2, 4444, 10834, 2569, 915, 25597, 432, 27, 21, 1158, 1231, 60, 800, 3726, 3726, 1875, 100, 48, 25, 21, 2578, 1301, 15, 31, 22, 195, 74, 228, 120, 14, 9765, 18, 118, 2473, 9819, 192, 27, 14, 4444, 10834, 2569, 915, 689, 47, 31, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Calculate time of lucene search === How can i get the exact time taken by lucene to search a string. I wanted to show something like this : ![enter image description here][1] About `x` results in `xx` seconds. how can i get exact time ? is their any utility under lucene library for this ? or do i need to calculate this on my own ? [1]: http://i.stack.imgur.com/pP4rZ.jpg
0
[ 2, 18469, 85, 16, 18515, 556, 2122, 800, 3726, 3726, 184, 92, 31, 164, 14, 5340, 85, 658, 34, 18515, 556, 20, 2122, 21, 3724, 9, 31, 417, 20, 298, 301, 101, 48, 13, 45, 13, 187, 2558, 13679, 1961, 5318, 235, 500, 2558, 165, 50...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to pass data from Unity scene to Android Activity === Hello I am currently writing an Android app that uses Unity to display a 3D model. The user is capable of interacting with the model as selecting objects in the scene. What I am having trouble is passing data back to the Android activity. I currently have the Unity scene executing as a subview, can anyone point me in the direction on how to pass data from the scene to Android? Do I have to create a Java plugin, explained here? [link text][1] If this is the case, does anyone have any tutorials on this? The original material is kind of lacking. Thanks in advance. [1]: http://docs.unity3d.com/Documentation/Manual/PluginsForAndroid.html
0
[ 2, 184, 20, 1477, 1054, 37, 8385, 1691, 20, 13005, 2358, 800, 3726, 3726, 10975, 31, 589, 871, 1174, 40, 13005, 4865, 30, 2027, 8385, 20, 3042, 21, 203, 43, 1061, 9, 14, 4155, 25, 3868, 16, 24747, 29, 14, 1061, 28, 20764, 3916, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
removing backslash in a string with Javascript/jQuery === When I query twitter feeds, the returned profile url contains backslashs and looks like: "http:\/\/a0.twimg.com\/profile_images\/2419298032\/image_normal.jpg" how to remove the backslashes to make it look like: "http://a0.twimg.com/profile_images/2419298032/image_normal.jpg" Thanks a lot! P.S. seems x=x.replace(/\/gi, ""); doesn't work...
0
[ 2, 9096, 97, 18, 9545, 19, 21, 3724, 29, 8247, 8741, 118, 728, 8190, 93, 800, 3726, 3726, 76, 31, 25597, 10623, 17058, 15, 14, 587, 5296, 287, 6362, 1588, 97, 18, 9545, 18, 17, 1879, 101, 45, 13, 7, 21127, 45, 1, 118, 1, 118, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Captured variables in lambda functions confusion === I have an application that is creating maps for civilization V. As an interesting design choice I decided to create a couple of functions that would do the looping through the map for me. This way I could pass a function pointer or a lambda function to that function that goes through the whole map doing something to each tile. Reasoning behind this was if I or someone else would change the way the map is stored (from 2D array to a 2D vector or whatever) one would only need to change one function instead of the whole codebase. Now the problem, here is some code first. Error code. case ALL_SNOW: m.loop_through_limit([] (Tile* t) { t = new Snow(t->get_x(), t->get_y()); return t; }, x, y, width, height); break; case PTN_ONE: m.loop_through_limit([&] (Tile* t) { int cur_x = t->get_x(); int cur_y = t->get_y(); t = new Plains(cur_x, cur_y); // if (y <= height/4 || y >= (height*3)/4) { // Top quarter rows and bottom quarter rows // t = new Ocean(cur_x, cur_y); // } else if (cur_x <= width/4) { // Leftmost columns // t = new Ocean(cur_x, cur_y); // } else if (cur_x >= (width*3)/4) { // Rightmost columns // t = new Desert(cur_x, cur_y); // } return t; }, x, y, width, height); break; Definitions from header file. void loop_through(void (*)(Tile* t)); void loop_through_limit(Tile* (*)(Tile* t), int start_x, int start_y, int width, int height); Now the difference in each case isn't much apart from the commented out code. This works fine. When I comment out that if statement block, then this is my output. c++ -c -g -O3 -ffast-math -Wall -Weffc++ -std=c++0x -o tile_block.o tile_block.cpp tile_block.cpp: In static member function ‘static void TileBlock::write(Map&, TileBlock::Patterns, int, int, int, int)’: tile_block.cpp:82:35: error: no matching function for call to ‘Map::loop_through_limit(TileBlock::write(Map&, TileBlock::Patterns, int, int, int, int)::<lambda(Tile*)>, int&, int&, int&, int&)’ tile_block.cpp:82:35: note: candidate is: map.h:26:10: note: void Map::loop_through_limit(Tile* (*)(Tile*), int, int, int, int) map.h:26:10: note: no known conversion for argument 1 from ‘TileBlock::write(Map&, TileBlock::Patterns, int, int, int, int)::<lambda(Tile*)>’ to ‘Tile* (*)(Tile*)’ And I believe the problem comes when I start using the parameters I'm trying to capture by reference. Then it starts to turn into a "lambda" function instead of just a "function pointer", maybe I'm just not getting it. Any suggestions?
0
[ 2, 2411, 12157, 19, 13, 24187, 3719, 5677, 800, 3726, 3726, 31, 57, 40, 3010, 30, 25, 2936, 6867, 26, 9274, 566, 9, 28, 40, 4883, 704, 1837, 31, 868, 20, 1600, 21, 1335, 16, 3719, 30, 83, 107, 14, 5293, 68, 120, 14, 2942, 26, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how do I position a datagridview to the searched text input === Using Windows forms and linq to Sql, I bound a datagridview to Products Table, I added to the form 1 Textbox to input the searched text. I wonder how to position the datagridview according to the text entered to find a given ProductName. Here I do not want to filter rows, I only want to reposition datagrid after each character entered, the used code: private void textBox1_TextChanged(object sender, EventArgs e) { var searchValue = textBox1.Text.Trim().ToUpper(); var qry = (from p in dc.Products where p.ProductName.ToUpper().StartsWith(searchValue) select p).ToList(); int itemFound = productBindingSource.Find("ProductName", searchValue); productBindingSource.Position = itemFound; } The execution of code give the next error: System.NotSupportedException was unhandled at the ligne: int itemFound = productBindingSource.Find("ProductName", searchValue); Any idea please ?
0
[ 2, 184, 107, 31, 649, 21, 1054, 16375, 4725, 20, 14, 9036, 1854, 6367, 800, 3726, 3726, 568, 1936, 1997, 17, 6294, 1251, 20, 4444, 255, 15, 31, 4138, 21, 1054, 16375, 4725, 20, 1985, 859, 15, 31, 905, 20, 14, 505, 137, 1854, 530...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Javascript custom function error === function classChanger(path,changeClass,duration){ $(path).removeClass(changeClass); $(this).addClass(changeClass); )}; $('.flightDetails .option').classChanger('.flightDetails .option','selected',300); Console log: **TypeError: $(".flightDetails .option").classChanger is not a function** Appreciate your help and time :)
0
[ 2, 8247, 8741, 5816, 1990, 7019, 800, 3726, 3726, 1990, 718, 16180, 106, 5, 8353, 15, 16229, 1898, 15, 10852, 857, 6, 1, 5579, 5, 8353, 6, 9, 99, 16598, 1898, 5, 16229, 1898, 6, 73, 5579, 5, 1565, 6, 9, 14854, 1898, 5, 16229, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Save/Load workspace in C++ application === I'm working on adding a new feature to an existing program. It's basically a save/load workspace feature, where a user can save the positions of their windows, and then load said positions whenever they want to by selecting a menu item. In order to implement this, I have created code which extracts the screen coordinates of the window and writes them to a file (below) : void CMainFrame::SaveWorkspace() { RECT ctrlsize; m_pDialog->GetWindowRect((LPRECT)&ctrlsize); //obtains location for window ofstream Workspace("saveone", ios::out); Workspace << ctrlsize.left << "," << ctrlsize.top << "," << ctrlsize.right << "," << ctrlsize.bottom; } And this (is supposed to) loads the workspace: void CMainFrame::LoadWorkspace() { //Read in the data from the file int data[2][3]; int r=0; int a=0; int b=0; ifstream infile; infile.open("saveone"); for(a = 0; a< 3; a++) { for(b = 0;b<4;b++) { infile >> data[a][b]; cout << data[a][b]; } } infile.close(); //Now, assign the extracted values RECT ctrlset; ctrlset.top = data[0][1]; ctrlset.left = data[0][0]; ctrlset.right = data[2][0]; ctrlset.bottom = data[0][3]; // Finally, reassign the window positions m_pDialog->SetWindowPos(NULL, ctrlset.left, ctrlset.top, (ctrlset.right - ctrlset.left), (ctrlset.bottom - ctrlset.top), SWP_SHOWWINDOW); } Problems: 1) the SaveWorkspace function works sporadically; more often than not, it doesn't create a file. 2) the LoadWorkspace function doesn't work. Specifically, only the data[0][0] coordinate gets saved to the array (the first value in the file). This seems like a fairly easy thing to do, I'm a bit embarrassed that it's giving me so much trouble...
0
[ 2, 2079, 118, 8294, 170, 5582, 19, 272, 20512, 3010, 800, 3726, 3726, 31, 22, 79, 638, 27, 4721, 21, 78, 1580, 20, 40, 3149, 625, 9, 32, 22, 18, 11374, 21, 2079, 118, 8294, 170, 5582, 1580, 15, 113, 21, 4155, 92, 2079, 14, 306...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Mac OS X 10.7.4 install helper tool in Qt Application === i am using SMJobBless function for install my helper tool to launch daemons, as it described in this article - http://atnan.com/blog/2012/02/29/modern-privileged-helper-tools-using-smjobbless-plus-xpc/ , and here also - http://developer.apple.com/library/mac/#samplecode/SMJobBless/Listings/ReadMe_txt.html. Few month ago everything with this was well. And new helper tool was installed with success. But last few days (maybe after updating to 10.7.4, but it not work on others versions too) i have strange problem with installation of helper tool. After user typed password to mac auth window helper tool does not intalled. And i can see this syslog text: Jul 27 18:30:28 Illia-Greens-MacBook-Pro authorizationhost[4318] <Error>: SFBuiltinEntitled: MyApp.app is not entitled for com.apple.ServiceManagement.daemons.modify Jul 27 18:30:28 Illia-Greens-MacBook-Pro launchdadd[4313] <Error>: FAILURE: Job com.bsd.OpenVPNHelper is not loaded in launchd. What is wrong? And few days before it work.
0
[ 2, 1572, 13, 759, 993, 332, 9, 465, 9, 300, 16146, 448, 106, 5607, 19, 2593, 38, 3010, 800, 3726, 3726, 31, 589, 568, 7613, 1636, 3490, 923, 1990, 26, 16146, 51, 448, 106, 5607, 20, 3394, 13127, 18, 15, 28, 32, 745, 19, 48, 20...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
how to convert rgba to hex or rgb color code using php === Is it possible to convert rgba color code to hex or rgb equivalent color code in php. I have seared a lot but I found some js functions but not in php. Please help
0
[ 2, 184, 20, 8406, 13, 8911, 969, 20, 24, 396, 54, 761, 11400, 1665, 1797, 568, 13, 26120, 800, 3726, 3726, 25, 32, 938, 20, 8406, 13, 8911, 969, 1665, 1797, 20, 24, 396, 54, 761, 11400, 4602, 1665, 1797, 19, 13, 26120, 9, 31, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
NSCache, does removeAllObjects release the memory usage? I'm using ARC === I'm using ARC and NSCache which is created and stored on my app delegate. Then I call it from the controllers trough the app delegate. The NSCache stores images as they are loaded from an url and the memory usage goes up really quick. When I check the profiler for real memory usage, my app reaches even 320 MB of memory usage but on allocations it says it has just allocated 20-30 MB. I implemented a button to experiment with NSCache and when I click on it it calls: - (IBAction)eraseCache:(id)sender { [[appDelegate cache] removeAllObjects]; } On the profiler, the memory used does not go down, but it actually starts to get the images again, so I know the objects where removed. How can I release this memory usage at will using ARC? How can I get the size of my cache to know when to release it?
0
[ 2, 13, 2172, 793, 2569, 15, 630, 4681, 1233, 23793, 18, 830, 14, 1912, 7514, 60, 31, 22, 79, 568, 4686, 800, 3726, 3726, 31, 22, 79, 568, 4686, 17, 13, 2172, 793, 2569, 56, 25, 679, 17, 8214, 27, 51, 4865, 11300, 9, 94, 31, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Lempel-Ziv 76 complexity === Can someone explain to me Lempel-Ziv 76 complexity? I was under the impression that you initialize with the first letter of the string in your dictionary, and then check subsequent blocks for existence in the previous substring, growing one letter each time a substring is found. If no substring exists in the previous substring, that substring is called a block and the next letter becomes the next substring to be searched. For example, 01011010001101110010 0|1 since 1 is not in 0, we get 0|1|0 since 0 is in 01, we get 0|1|01 since 01 is in 01, we get 0|1|011|0 since 0 is in 01011, we get 0|1|011|01 since 01 is in 01011, we get 0|1|011|010 since 010 is in 01011, we get 0|1|011|0100|0 and so on until, we get 0|1|011|0100|011011|1001|0, where the last letter can be a repeat if necessary. What am I doing wrong? Because I am being told that for a string 1111111, the decomposition is 1|111111. Thanks!
0
[ 2, 10794, 6686, 8, 380, 3757, 6914, 12745, 800, 3726, 3726, 92, 737, 3271, 20, 55, 10794, 6686, 8, 380, 3757, 6914, 12745, 60, 31, 23, 131, 14, 6394, 30, 42, 2104, 2952, 29, 14, 64, 1748, 16, 14, 3724, 19, 154, 9186, 15, 17, 9...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Minified HTML <head> on Magento Product Page? === For some reason my Product Page on a LOCAL Magento installation appears to be minifying? This subsequently breaks that page, mainly jQuery.. All other pages are fine - including catalog & CMS Pages / Home etc.. If you look here at the source for a category page: ![normal looking source code][1] Then this is the source for a product page: ![broken product page html head][2] What is causing this to happen? Any ideas? I am not using compression or minification as this a development environment. Thanks for your help. [1]: http://i.stack.imgur.com/AnL2P.png [2]: http://i.stack.imgur.com/PAfrw.png
0
[ 2, 4232, 4462, 13, 15895, 13, 1, 1743, 1, 27, 4723, 17050, 2374, 2478, 60, 800, 3726, 3726, 26, 109, 1215, 51, 2374, 2478, 27, 21, 375, 4723, 17050, 7758, 1780, 20, 44, 4232, 10874, 60, 48, 1724, 7947, 30, 2478, 15, 2011, 487, 8...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
HTML5 video and image tag === i am creating one application in that i have to stream many videos one after the other using html5.How to do this?Similarly i need to display many images one after other .Please help me out in this situation. Thank you.:)
1
[ 2, 13, 15895, 264, 763, 17, 1961, 3383, 800, 3726, 3726, 31, 589, 2936, 53, 3010, 19, 30, 31, 57, 20, 3766, 151, 6610, 53, 75, 14, 89, 568, 13, 15895, 264, 9, 1544, 20, 107, 48, 60, 19107, 102, 31, 376, 20, 3042, 151, 3502, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Protocol design for ZeroMQ === I am designing a server application that will talk ZeroMQ. Without going into the nitty gritty details, the server will store and serve (from query requests) `(eventid, eventstring)` tuples. My questions concerns design of the wire protocol. I would like to send my tuple from one end to another. I see two options: * Serialize my tuple (using protobuf or whatever) and send it as a single message. * Send my tuple as a multipart message; first part contains eventid and second contains eventstring. **Are any of these two options preferable over the other?** Reading the [The ZeroMQ Guide][1], there's a [chapter on Advanced Request-Reply patterns][2] that uses multipart message envelopes heavily. Does this mean that I, as a user, should try to stick to single message to enable more advanced message patterns in the future? [1]: http://zguide.zeromq.org/page:all [2]: http://zguide.zeromq.org/page:all#toc45
0
[ 2, 8494, 704, 26, 4606, 79, 1251, 800, 3726, 3726, 31, 589, 15026, 21, 8128, 3010, 30, 129, 930, 4606, 79, 1251, 9, 366, 228, 77, 14, 13686, 1084, 18844, 1084, 3289, 15, 14, 8128, 129, 1718, 17, 1884, 13, 5, 2665, 25597, 12279, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Matlab locks the jar file when I try to call Java methods from it === I'm developing a library in Java and need to use it in Matlab. Both Java and Matlab codes are under constant development; therefore whenever I rebuild the Java code and create a new jar file, I need to reload it in the Matlab code and use the fresh jar file there. My problem is that Matlab locks the jar file and I cannot replace the old jar file with the new one, unless I restart the whole Matlab environment. How can I make Matlab unlock my jar file? I access the Java classes and methods through javaaddpath('path/to/jar/file.jar'); Also in the end I call: javarmpath('path/to/jar/file.jar'); but it does not unlock the file either. I use Matlab 7.9.0 (R2009b).
0
[ 2, 4277, 9086, 12941, 14, 5112, 3893, 76, 31, 1131, 20, 645, 8247, 3195, 37, 32, 800, 3726, 3726, 31, 22, 79, 3561, 21, 1248, 19, 8247, 17, 376, 20, 275, 32, 19, 4277, 9086, 9, 156, 8247, 17, 4277, 9086, 11358, 50, 131, 3587, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
jQuery - drag element inside DIV === I'm having a problem with dragging a div inside an other div element. HTML looks like this: <div id="grid"> <div id="el1"></div> <div id="el2"></div> <div id="el3"></div> <div id="el4"></div> </div> All elements are draggable and have the css style `float:left;position:relative;`. When I drag `el1` to the place of `el3` it will work, but of course it will overlap the element `el3`. The draggin `jquery draggable` is working fine but I want to insert div with id `el1`at the HTML code in this position. That it will look like this: <div id...> <div id="el2... <div id="el3... <div id="el1... <div id="el4... </div> Whats the best way to determine this? TIA frgtv10
0
[ 2, 487, 8190, 93, 13, 8, 5501, 4520, 572, 13, 12916, 800, 3726, 3726, 31, 22, 79, 452, 21, 1448, 29, 13052, 21, 13, 12916, 572, 40, 89, 13, 12916, 4520, 9, 13, 15895, 1879, 101, 48, 45, 13, 1, 12916, 4924, 3726, 7, 16375, 7, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Streaming Download while File is Created === I was wondering if anyone knows how to stream a file download while its being created at the same time. I'm generating a huge CSV export and as of right now it takes a couple minutes for the file to be created. Once its created the browser then downloads the file. I want to change this so that the browser starts downloading the file while its being created. Looking at this progress bar users will be more willing to wait. Even though it would tell me there an “Unknown time remaining” I’m less likely to get impatient since I know data is being steadily downloaded. NOTE: Im using Rails version 3.0.9 Here is my code: def users_export File.new("users_export.csv", "w") # creates new file to write to @todays_date = Time.now.strftime("%m-%d-%Y") @outfile = @todays_date + ".csv" @users = User.select('id, login, email, last_login, created_at, updated_at') FasterCSV.open("users_export.csv", "w+") do |csv| csv << [ @todays_date ] csv << [ "id","login","email","last_login", "created_at", "updated_at" ] @users.find_each(:batch_size => 100 ) do |u| csv << [ u.id, u.login, u.email, u.last_login, u.created_at, u.updated_at ] end end send_file "users_export.csv", :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => "attachment; filename=#{@outfile}", :stream => true, end
0
[ 2, 11920, 7121, 133, 3893, 25, 679, 800, 3726, 3726, 31, 23, 5712, 100, 1276, 3620, 184, 20, 3766, 21, 3893, 7121, 133, 82, 142, 679, 35, 14, 205, 85, 9, 31, 22, 79, 13500, 21, 2329, 272, 18, 710, 7487, 17, 28, 16, 193, 130, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Encrypt/decrypt byte array > 256 bytes using AES-128 === The following code encrypts a byte array SOURCE_DATA using AES-128 to another byte array ENCRYPTED_DATA, and then decrypts it again to DECRYPTED_DATA. With a byte array size of <= 256 bytes, the code works just fine, but if the byte array is longer, DECRYPTED_DATA only contains zeros after byte 256 and is not equal to the SOURCE_DATA array. What am I missing? <b>Output:</b> > Source Data: ...fbfcfdfeff0001<br /> > Decrypted Data: ...fbfcfdfeff000<b>0</b> <b>Code:</b> // Create data array with size greater 256 bytes byte[] SOURCE_DATA = new byte[257]; for (int i=0;i<SOURCE_DATA.length; i++) { SOURCE_DATA[i] = (byte)((i+1) & 0xff); } // Init ciphers Cipher encC = Cipher.getInstance("AES/ECB/PKCS5Padding"); Cipher decC = Cipher.getInstance("AES/ECB/PKCS5Padding"); encC.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[] {0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6}, "AES")); decC.init(Cipher.DECRYPT_MODE, new SecretKeySpec(new byte[] {0,1,2,3,4,5,6,7,8,9,1,2,3,4,5,6}, "AES")); // Encrypt ByteArrayOutputStream bos = new ByteArrayOutputStream(); CipherOutputStream cos = new CipherOutputStream(bos, encC); DataOutputStream dos = new DataOutputStream(cos); dos.write(SOURCE_DATA, 0, SOURCE_DATA.length); dos.close(); byte[] ENCRYPTED_DATA = bos.toByteArray(); // Decrypt ByteArrayInputStream bis = new ByteArrayInputStream(ENCRYPTED_DATA); CipherInputStream cis = new CipherInputStream(bis, decC); DataInputStream dis = new DataInputStream(cis); byte[] DECRYPTED_DATA = new byte[SOURCE_DATA.length]; dis.read(DECRYPTED_DATA, 0, DECRYPTED_DATA.length); cis.close(); System.out.println("Source Data: "+toHex(SOURCE_DATA)); System.out.println("Decrypted Data: "+toHex(DECRYPTED_DATA));
0
[ 2, 1957, 11435, 118, 546, 11435, 34, 591, 7718, 13, 1, 13, 16910, 34, 3231, 568, 21, 160, 8, 22545, 800, 3726, 3726, 14, 249, 1797, 1957, 11435, 18, 21, 34, 591, 7718, 1267, 1, 18768, 568, 21, 160, 8, 22545, 20, 226, 34, 591, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
SQL query to return nil for dates not present in the table === I have a table 'my_table'. It has the following data : ID --- Date 1 --- 01/30/2012 2 --- 01/30/2012 3 --- 05/30/2012 I can write a SQL query to return the count of ID's between certain dates, grouped by month, like this : {"01/30/2012" => 2, "05/30/2012" => 1} How can I get a result which has all the missing months between the requested dates with value '0', like this : {"01/30/2012" => 2, "02/30/2012" => 0, "03/30/2012" => 0, "04/30/2012" => 0, "05/30/2012" => 1} Thanks in advance.
0
[ 2, 4444, 255, 25597, 20, 788, 1781, 255, 26, 4076, 52, 734, 19, 14, 859, 800, 3726, 3726, 31, 57, 21, 859, 13, 22, 915, 1, 5924, 22, 9, 32, 63, 14, 249, 1054, 13, 45, 4924, 13, 8, 8, 8, 1231, 137, 13, 8, 8, 8, 13, 3026, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Image uploader previewer JQ/PHP === I am working currently with an image uploader I found in [THIS WEBSITE][1]. The save button is storing the image in my file directory and returning a URL which is how intended it to work but I do not want it to redirect to a save.php but stay in the same page. Is there a way to that? I have tried manipulating the code but no luck. Once again please look at the website were i got the files: [HERE][2]. Here is my code: <?php // includes require_once('./php/configuration.php'); ?> <div class="imageForms"></div> <div class="buttonSave"> <button id="buttonSave">Save</button> </div> <?php $images = explode(',', $_GET['i']); $path = Configuration::getUploadUrlPath('medium', 'target'); ?> [1]: http://dondedeportes.es/uploader-previewer/ [2]: http://dondedeportes.es/uploader-previewer/
0
[ 2, 1961, 71, 8294, 106, 16121, 106, 487, 1251, 118, 26120, 800, 3726, 3726, 31, 589, 638, 871, 29, 40, 1961, 71, 8294, 106, 31, 216, 19, 636, 1565, 2271, 500, 2558, 165, 500, 9, 14, 2079, 5167, 25, 25615, 14, 1961, 19, 51, 3893,...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
design an iPhone app === If I design a new iPhone app, should I do it considering the previous iPhone display (3) or should I design it for Retina Display? And should I also design ir for iPad or is there a wy to convert the designs? thank you
4
[ 2, 704, 40, 21024, 4865, 800, 3726, 3726, 100, 31, 704, 21, 78, 21024, 4865, 15, 378, 31, 107, 32, 5154, 14, 1158, 21024, 3042, 13, 5, 240, 6, 54, 378, 31, 704, 32, 26, 24325, 3042, 60, 17, 378, 31, 67, 704, 13, 1523, 26, 31...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
Python "push server" tcp client === I am developing python service for xbmc and I am hopelessly stuck. XBMC has TCP API that communicates by JSON-RPC. XBMC has server TCP socket that is mainly design to recieve commands and respond, but if something happens in system it sends "Notification" to TCP. The problem is that I need to create TCP client that behaves like server therefore it is able to recieve this "Notification". Wherever I run `socket.recv(4096)` it waits for data and stucks my code, because I need to loop my code. Structure of code is basically like this: import xbmc, xbmcgui, xbmcaddon class XPlayer(xbmc.Player) : def __init__ (self): xbmc.Player.__init__(self) def onPlayBackStarted(self): if xbmc.Player().isPlayingVideo(): doPlayBackStartedStuff() player=XPlayer() doStartupStuff() while (not xbmc.abortRequested): if xbmc.Player().isPlayingVideo(): doPlayingVideoStuff() else: doPlayingEverythingElseStuff() xbmc.sleep(500) # This loop is the most essential part of code if (xbmc.abortRequested): closeEverything() xbmc.log('Aborting...') I tried everything threading, multiprocessing, blocking, non-blocking and nothing helped. Thanks,
0
[ 2, 20059, 13, 7, 26973, 8128, 7, 13, 38, 7439, 6819, 800, 3726, 3726, 31, 589, 3561, 20059, 365, 26, 993, 220, 4829, 17, 31, 589, 18846, 102, 4549, 9, 993, 220, 4829, 63, 13, 38, 7439, 21, 2159, 30, 8709, 18, 34, 487, 528, 8, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
What are Go arrays index by? === I am some 'memory allocator' type code, by using an array and indexes rather than pointers. I'm hoping that the size of the index of the array is smaller than a pointer. I care because I am storing 'pointers' as integer indexes in an array rather than 64-bit pointers. I can't see anything in the Go spec that says what an array is indexed by. Obviously it's some kind of integer. Passing very large values makes the runtime complain that I can't pass negative numbers, so I'm guessing that it's somehow cast to a signed integer. So is it an `int32`? I'm guessing it's not an `int64` because I didn't touch the top bit (which would have been 2's compliment for a negative number).
0
[ 2, 98, 50, 162, 7718, 18, 4348, 34, 60, 800, 3726, 3726, 31, 589, 109, 13, 22, 790, 5171, 93, 65, 2499, 3457, 22, 1001, 1797, 15, 34, 568, 40, 7718, 17, 4348, 160, 864, 119, 454, 445, 9, 31, 22, 79, 3935, 30, 14, 1072, 16, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Socket's state changes from Connected to Disconnected === I have two applications, one connects to another via TCP Socket. I was having an issue and after a long troubleshooting I begun to think the root cause is due to the disconnection of the Socket, aka the Socket.state changes to **Disconnected**. The reasons I came to above conclusion are just purely from reading the codes and analyze them. I need to prove that is the case and therefore my question is have you ever came accross this type of issue that the socket actually keep getting disconnected even after trying to connect to them? Below is my Connect code, I have a loop that constantly check for the socket's state itself, if I detect the state is **"Disconnected"** I call this Connect() function again. Upon each and every time I call Connect() I noticed my socket state is back to **Connected** again. So my questions are: 1. Have you seen this behavior yourself before? 2. Do you see any problem in me calling multiple Connect() again and again? 3. Is there a way to simulate this type of socket disconnections? I tried but I can't set the Socket.Connected flag. public override void Connect() { try { sState = Defs.STATE_CONNECTING; // send message to UI string sMsg = "<Msg SocketStatus=\"" + sState + "\" />"; HandleMessage(sMsg); // Create the socket object sSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp); string sIP = ""; // Define the Server address and port if (Validate.IsIPAddress(sServer.ToString())) { sIP = sServer.ToString(); } else { IPHostEntry iphost = Dns.GetHostEntry(sServer.ToString()); sIP = iphost.AddressList[0].ToString(); } IPEndPoint epServer = new IPEndPoint(IPAddress.Parse(sIP), 1234); // Connect to Server non-Blocking method sSock.Blocking = false; AsyncCallback onconnect = new AsyncCallback(OnConnect); sSock.BeginConnect(epServer, onconnect, sSock); } catch (Exception ex) { LogException(new Object[] { ex }); } }
0
[ 2, 18482, 22, 18, 146, 1693, 37, 2587, 20, 25730, 800, 3726, 3726, 31, 57, 81, 3767, 15, 53, 8534, 20, 226, 1197, 13, 38, 7439, 18482, 9, 31, 23, 452, 40, 1513, 17, 75, 21, 175, 2572, 12511, 68, 31, 4349, 20, 277, 14, 5900, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Threading issue in android === I am working on an application in android. And I am trying to update data to UI from the background thread. However, it doesn't work for some reasons. Can any one splot the error or suggest any better solution? I used Thread to read data from the bluetooth socket and update the UI with RunOntheUI. Here is the code: socket = belt.createRfcommSocketToServiceRecord(UUID_SECURE); socket.connect(); stream = socket.getInputStream(); // final int intch; Thread timer2 = new Thread() { // Threads - do multiple things public void run() { try { // read data from input stream if the end has not been reached while ((intch = stream.read()) != -1) { byte ch = (byte) intch; b1.append(ByteToHexString(ch) +"/"); decoder.Decode(b1.toString()); runOnUiThread(new Runnable() { public void run() { // update the uI hRMonitor.SetHeartRateValue((int) decoder.GetHeartRate()); } }); Thread.sleep(1000); } } catch (Exception e) { e.printStackTrace(); } }}; timer2.start();
0
[ 2, 9322, 68, 1513, 19, 13005, 800, 3726, 3726, 31, 589, 638, 27, 40, 3010, 19, 13005, 9, 17, 31, 589, 749, 20, 11100, 1054, 20, 13, 5661, 37, 14, 2395, 9322, 9, 207, 15, 32, 1437, 22, 38, 170, 26, 109, 2932, 9, 92, 186, 53, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
log4j:WARN No appenders could be found for logger (running jar file, not web app) === First up - yes, I have read the multiple questions & answers on this topic, and can't get any of the solutions within those to help me. I'm not running Tomcat or JBoss and I don't have a web.xml file to change. I'm using Java 6.0 and log4j-1.2.8.jar I am creating a runnable jar file with IDEA IntelliJ with jar libraries packaged separately and linked via the manifest. I am running my code on a linux server thus: me@server:/mydir> java -jar code/myjar.jar log4j:WARN No appenders could be found for logger (FactoredEventsForTrna). log4j:WARN Please initialize the log4j system properly. My log4j configuration file (which I've placed both in mydir and mydir/code, just in case) is: ## Logger configure file for myproject log.dir=log/ datestamp=yyyy-MM-dd/HH:mm:ss.SSS log4j.rootLogger=TRACE, file, proappender, console log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.maxFileSize=1GB log4j.appender.file.maxBackupIndex=5 log4j.appender.file.File=log/mydebug.log log4j.appender.file.threshold=TRACE log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{${datestamp}} %5p: %c{2} - %m%n log4j.appender.proappender=org.apache.log4j.RollingFileAppender log4j.appender.proappender.maxFileSize=5GB log4j.appender.proappender.Threshold=INFO log4j.appender.proappender.File=log/myinfo.log log4j.appender.proappender.layout=org.apache.log4j.PatternLayout log4j.appender.proappender.layout.ConversionPattern=%d{${datestamp}} %5p: %c{2} - %m%n log4j.appender.console=org.apache.log4j.ConsoleAppender log4j.appender.console.Threshold=DEBUG log4j.appender.console.layout=org.apache.log4j.PatternLayout log4j.appender.console.layout.ConversionPattern=%d{${datestamp}} %5p: %c{2} - %m%n And I have created the log/ directory in mydir and mydir/code, again, just in case. Any ideas?
0
[ 2, 6738, 300, 728, 45, 1885, 103, 90, 4865, 13630, 18, 110, 44, 216, 26, 13, 29480, 13, 5, 11325, 5112, 3893, 15, 52, 2741, 4865, 6, 800, 3726, 3726, 64, 71, 13, 8, 1643, 15, 31, 57, 1302, 14, 1886, 2346, 279, 6709, 27, 48, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How can I use the Role Manager in a WCF Service? === How can I use the Role Manager in a WCF Service? In my .NET Application, I can restrict a class or a method with the `[Authorize(Roles=)]` tag. How can I enable this for my WCF Service? I currently have the following binding set for each endpoint: <webHttpBinding> <binding name="TransportSecurity" maxReceivedMessageSize="5242880"> <security mode="Transport"> <transport clientCredentialType="None"/> </security> </binding> </webHttpBinding> Since I want to have the user log in and receive a cookie with the principal, do I need to change this to another sort of `clientCredentialType`?
0
[ 2, 184, 92, 31, 275, 14, 597, 1382, 19, 21, 11801, 410, 365, 60, 800, 3726, 3726, 184, 92, 31, 275, 14, 597, 1382, 19, 21, 11801, 410, 365, 60, 19, 51, 13, 9, 2328, 3010, 15, 31, 92, 15436, 21, 718, 54, 21, 2109, 29, 14, 1...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
How to read the response headers every time using AFNetworking? === While using a 3rd party API, I have the requirement to cancel all traffic when a **custom response header** is set to a certain value. I am trying to find a nice place to do this check only once in my code (and not in every success/failure block, where it works fine). From what I understand, this could be done by overriding `-(void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation` in my custom `AFHTTPClient` subclass, but when I implement it like that: -(void)enqueueHTTPRequestOperation:(AFHTTPRequestOperation *)operation { NSLog(@"[REQUEST URL]\n%@\n", [operation.request.URL description]); NSLog(@"[RESPONSE HEADERS]\n%@\n", [[operation.response allHeaderFields] descriptionInStringsFileFormat]); [super enqueueHTTPRequestOperation:operation]; } the response headers are `nil`. Can anybody help me with that?
0
[ 2, 184, 20, 1302, 14, 1627, 157, 445, 352, 85, 568, 13, 2565, 24106, 68, 60, 800, 3726, 3726, 133, 568, 21, 203, 897, 346, 21, 2159, 15, 31, 57, 14, 8981, 20, 14815, 65, 2227, 76, 21, 13, 1409, 4636, 6015, 1627, 157, 106, 1409...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Solr: Check if a document exists without retrieving the document === I need to find out if a document exists but the documents saved in the Solr server are pretty big so if I do a classic search to retrieve the document with a specified `id` and the document is returned it takes too much time to process. Is there a possibility to return for example the number of matching documents without retrieving the actual documents ?
0
[ 2, 7176, 139, 45, 2631, 100, 21, 4492, 5636, 366, 13, 6239, 3272, 8397, 14, 4492, 800, 3726, 3726, 31, 376, 20, 477, 70, 100, 21, 4492, 5636, 47, 14, 4374, 4377, 19, 14, 7176, 139, 8128, 50, 1772, 580, 86, 100, 31, 107, 21, 27...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Is the getc and putc implementation of K&R right? === In the K&R, chapter 8, it has a custom implementation of the putc and getc functions. In the first definition of getc, if the parameter is stdin, according to the definition of _iob, the function will try to write in the address 0 because this is the value which _iob[0].ptr and _iob[0].base were assigned. Is this legal?
0
[ 2, 25, 14, 164, 150, 17, 442, 150, 6123, 16, 680, 1569, 139, 193, 60, 800, 3726, 3726, 19, 14, 680, 1569, 139, 15, 1260, 469, 15, 32, 63, 21, 5816, 6123, 16, 14, 442, 150, 17, 164, 150, 3719, 9, 19, 14, 64, 5465, 16, 164, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Cool bubble effect using something like CCParticle in Cocos2d (no third party tools) === I would like to achieve a cool particle effect like in [here][1]. The bubble should be similar to an explosion starting from the centre and expanding. I'd like to add an animated wave coming out from the left and right side of the bubble and looking like [this][2]. I guess I could use to two distinct animation and put together as I assume this has never been done in a Cocos2d game. Also, I would like to avoid using non-Cocos2d tools as [particle designer][3]. In chapter 1 of the [Cocos2d cookbook][4] I found some cool particle examples and the code doesn't seem too complex. Instead, using third party tools I need to import their classes and use their file format to create particles and I have to pay. Even more there doesn't seem to be many particle effect files shared (at least not the ones I want). Thanks a lot. [1]: http://www.lifeofandroid.com/wp-content/uploads/2012/02/Bubble_Shoot_main_580.png [2]: http://telepics.net/uploads/pictures/big_images/Animated_Music_Wave.jpg [3]: http://particledesigner.71squared.com/ [4]: http://cocos2dcookbook.com/
0
[ 2, 2700, 10937, 1590, 568, 301, 101, 272, 7439, 20360, 19, 22470, 18, 135, 43, 13, 5, 251, 422, 346, 4672, 6, 800, 3726, 3726, 31, 83, 101, 20, 4689, 21, 2700, 11534, 1590, 101, 19, 636, 6836, 500, 2558, 165, 500, 9, 14, 10937, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Nginx url substring or redirect without arguments === I want to redirect with nginx from this url: my-site/playlist/application/stream.m3u8/**dynamicToken** to new-site/playlist?application=stream.m3u8&token=**dynamicToken**. Base URL must be without parameters and I want to get only dynamic token.
0
[ 2, 13, 2723, 108, 396, 287, 6362, 972, 11130, 54, 302, 14706, 366, 10553, 800, 3726, 3726, 31, 259, 20, 302, 14706, 29, 13, 2723, 108, 396, 37, 48, 287, 6362, 45, 51, 8, 9097, 118, 5438, 5739, 118, 2552, 20669, 118, 11260, 9, 79...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Why Hibernate Search takes so much time to build a Index? === I am trying to build a lucene index through hibernate search`FullTextSession.createIndexer().startAndWait()` but even for very little test data it won't end. Here is my code @Component("hibernateSearchMassIndexerService") public class HibernateSearchMassIndexerServiceImpl implements HibernateSearchMassIndexerService { public static final Logger log = LoggerFactory .getLogger(HibernateSearchMassIndexerServiceImpl.class); @Override @Transactional public void buildSearchIndex(Session session) { log.debug("Indexing entities"); FullTextSession fullTextSession = Search.getFullTextSession(session); try { fullTextSession.createIndexer().startAndWait(); } catch (InterruptedException e) { log.debug("Interrupted indexing process"); } log.debug("Ended indexing of entities"); } } Entities @Entity @Indexed(index = "causa_penal") @Table(name = "causas_penales") public class CausaPenal implements Serializable { private static final long serialVersionUID = 1L; @Basic @Column(name = "anio_causa") @Field private Integer annioCausa; @OneToMany(mappedBy = "causaPenal") @ContainedIn @OrderBy private List<AudienciaOral> audienciasOrales; @ManyToMany(cascade = CascadeType.ALL) private List<DefensorPenal> defensoresPenales; @OneToMany(cascade = CascadeType.ALL) private List<DelitoConfigurado> delitosConfigurados; @Id @GeneratedValue(strategy = GenerationType.TABLE) @Column(name = "id") @DocumentId private Integer id; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "causapenal_imputados") @IndexedEmbedded(depth = 1) private List<ParteMaterial> imputados; @ManyToMany(cascade = CascadeType.ALL) private List<MinisterioPublico> ministeriosPublicos; @Basic @Column(name = "numero_causa") @Field private Integer numeroCausa; @Version @Column(name = "opt_lock") private Integer version; @ManyToMany(cascade = CascadeType.ALL) @JoinTable(name = "causapenal_victimas") @IndexedEmbedded(depth = 1) private List<ParteMaterial> victimas; public CausaPenal() { } public CausaPenal(Integer id, Integer version, Integer numeroCausa, Integer annioCausa, List<DelitoConfigurado> delitosConfigurados, List<ParteMaterial> victimas, List<ParteMaterial> imputados, List<MinisterioPublico> ministeriosPublicos, List<DefensorPenal> defensoresPenales, List<AudienciaOral> audienciasOrales) { super(); this.id = id; this.version = version; this.numeroCausa = numeroCausa; this.annioCausa = annioCausa; this.delitosConfigurados = delitosConfigurados; this.victimas = victimas; this.imputados = imputados; this.ministeriosPublicos = ministeriosPublicos; this.defensoresPenales = defensoresPenales; this.audienciasOrales = audienciasOrales; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof CausaPenal)) { return false; } CausaPenal o = (CausaPenal) obj; return new EqualsBuilder().append(this.numeroCausa, o.numeroCausa) .append(this.annioCausa, o.annioCausa).isEquals(); } public Integer getAnnioCausa() { return this.annioCausa; } public List<AudienciaOral> getAudienciasOrales() { return this.audienciasOrales; } public List<DefensorPenal> getDefensoresPenales() { return this.defensoresPenales; } public List<DelitoConfigurado> getDelitosConfigurados() { return this.delitosConfigurados; } public Integer getId() { return this.id; } public List<ParteMaterial> getImputados() { return this.imputados; } public List<MinisterioPublico> getMinisteriosPublicos() { return this.ministeriosPublicos; } public Integer getNumeroCausa() { return this.numeroCausa; } public Integer getVersion() { return this.version; } public List<ParteMaterial> getVictimas() { return this.victimas; } @Override public int hashCode() { return new HashCodeBuilder(13, 33).append(this.numeroCausa).append(this.annioCausa) .toHashCode(); } public void setAnnioCausa(Integer annioCausa) { this.annioCausa = annioCausa; } public void setAudienciasOrales(List<AudienciaOral> audienciasOrales) { this.audienciasOrales = audienciasOrales; } public void setDefensoresPenales(List<DefensorPenal> defensoresPenales) { this.defensoresPenales = defensoresPenales; } public void setDelitosConfigurados(List<DelitoConfigurado> delitosConfigurados) { this.delitosConfigurados = delitosConfigurados; } public void setId(Integer id) { this.id = id; } public void setImputados(List<ParteMaterial> imputados) { this.imputados = imputados; } public void setMinisteriosPublicos(List<MinisterioPublico> ministeriosPublicos) { this.ministeriosPublicos = ministeriosPublicos; } public void setNumeroCausa(Integer numeroCausa) { this.numeroCausa = numeroCausa; } public void setVersion(Integer version) { this.version = version; } public void setVictimas(List<ParteMaterial> victimas) { this.victimas = victimas; } @Override public String toString() { return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); } } @Entity @Indexed(index = "partes_materiales") @Table(name = "partes_materiales") public class ParteMaterial implements Serializable { private static final long serialVersionUID = 1L; @Basic @Column(name = "alias") private String alias; @Basic @Column(name = "apellido_materno") @Field private String apellidoMaterno; @Basic @Column(name = "apellido_paterno") @Field private String apellidoPaterno; @Basic @Column(name = "descripcion_persona_moral") private String descripcionPersonaMoral; @ElementCollection @JoinTable(name = "partes_materiales_domicilios") private List<Domicilio> domicilios; @Basic @Column(name = "edad") private Integer edad; @Enumerated(EnumType.STRING) @Column(name = "estado_civil") private EstadoCivil estadoCivil; @Temporal(TemporalType.DATE) @Column(name = "fecha_nacimiento") private Date fechaNacimiento; @Enumerated(EnumType.STRING) @Column(name = "genero") private Genero genero; @Id @GeneratedValue(strategy = GenerationType.TABLE) @Column(name = "id") @DocumentId private Integer id; @Basic @Column(name = "identificacion_personal") private String identificacion; @Basic @Column(name = "idioma") private String idioma; @Basic @Column(name = "lugar_nacimiento") private String lugarNacimiento; @Basic @Column(name = "nombres") @Field private String nombres; @Basic @Column(name = "profesion_oficio") private String profesionOrOficio; @Version @Column(name = "opt_lock") private Integer version; public ParteMaterial() { } public ParteMaterial(String alias, String apellidoMaterno, String apellidoPaterno, String descripcionPersonaMoral, List<Domicilio> domicilios, Integer edad, EstadoCivil estadoCivil, Date fechaNacimiento, Genero genero, Integer id, String identificacion, String idioma, String lugarNacimiento, String nombres, String profesionOrOficio, Integer version) { super(); this.alias = alias; this.apellidoMaterno = apellidoMaterno; this.apellidoPaterno = apellidoPaterno; this.descripcionPersonaMoral = descripcionPersonaMoral; this.domicilios = domicilios; this.edad = edad; this.estadoCivil = estadoCivil; this.fechaNacimiento = fechaNacimiento; this.genero = genero; this.id = id; this.identificacion = identificacion; this.idioma = idioma; this.lugarNacimiento = lugarNacimiento; this.nombres = nombres; this.profesionOrOficio = profesionOrOficio; this.version = version; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (obj == this) { return true; } if (!(obj instanceof ParteMaterial)) { return false; } ParteMaterial o = (ParteMaterial) obj; return new EqualsBuilder().append(this.nombres, o.nombres) .append(this.apellidoPaterno, o.apellidoPaterno) .append(this.apellidoMaterno, o.apellidoMaterno) .append(this.descripcionPersonaMoral, o.descripcionPersonaMoral).isEquals(); } public String getAlias() { return this.alias; } public String getApellidoMaterno() { return this.apellidoMaterno; } public String getApellidoPaterno() { return this.apellidoPaterno; } public String getDescripcionPersonaMoral() { return this.descripcionPersonaMoral; } public List<Domicilio> getDomicilios() { return this.domicilios; } public Integer getEdad() { return this.edad; } public EstadoCivil getEstadoCivil() { return this.estadoCivil; } public Date getFechaNacimiento() { return this.fechaNacimiento; } public Genero getGenero() { return this.genero; } public Integer getId() { return this.id; } public String getIdentificacion() { return this.identificacion; } public String getIdioma() { return this.idioma; } public String getLugarNacimiento() { return this.lugarNacimiento; } public String getNombres() { return this.nombres; } public String getProfesionOrOficio() { return this.profesionOrOficio; } public Integer getVersion() { return this.version; } @Override public int hashCode() { return new HashCodeBuilder(31, 147).append(this.nombres).append(this.apellidoPaterno) .append(this.apellidoMaterno).append(this.descripcionPersonaMoral).toHashCode(); } public void setAlias(String alias) { this.alias = alias; } public void setApellidoMaterno(String apellidoMaterno) { this.apellidoMaterno = apellidoMaterno; } public void setApellidoPaterno(String apellidoPaterno) { this.apellidoPaterno = apellidoPaterno; } public void setDescripcionPersonaMoral(String descripcionPersonaMoral) { this.descripcionPersonaMoral = descripcionPersonaMoral; } public void setDomicilios(List<Domicilio> domicilios) { this.domicilios = domicilios; } public void setEdad(Integer edad) { this.edad = edad; } public void setEstadoCivil(EstadoCivil estadoCivil) { this.estadoCivil = estadoCivil; } public void setFechaNacimiento(Date fechaNacimiento) { this.fechaNacimiento = fechaNacimiento; } public void setGenero(Genero genero) { this.genero = genero; } public void setId(Integer id) { this.id = id; } public void setIdentificacion(String identificacion) { this.identificacion = identificacion; } public void setIdioma(String idioma) { this.idioma = idioma; } public void setLugarNacimiento(String lugarNacimiento) { this.lugarNacimiento = lugarNacimiento; } public void setNombres(String nombres) { this.nombres = nombres; } public void setProfesionOrOficio(String profesionOrOficio) { this.profesionOrOficio = profesionOrOficio; } public void setVersion(Integer version) { this.version = version; } @Override public String toString() { return ReflectionToStringBuilder.toString(this, ToStringStyle.SHORT_PREFIX_STYLE); } } Spring config: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:util="http://www.springframework.org/schema/util" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:context="http://www.springframework.org/schema/context" xsi:schemaLocation="http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd"> <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"> <property name="driverClassName" value="${datasource.driverClassName}" /> <property name="url" value="${datasource.url}" /> <property name="username" value="${datasource.username}" /> <property name="password" value="${datasource.password}" /> <property name="initialSize" value="${datasource.poolInitialSize}" /> </bean> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:hibernate.cfg.xml" /> <property name="hibernateProperties"> <props> <prop key="hibernate.current_session_context_class"> mx.gob.jgtjo.apps.schedule.web.conversation.ConversationalCurrentSessionContext </prop> <prop key="hibernate.dialect">${org.hibernate.dialect.dialectmysqlInno}</prop> <prop key="hibernate.hbm2ddl.auto">${org.hibernate.ddl.mode}</prop> <prop key="hibernate.connection.release_mode">${org.hibernate.transaction.release_mode}</prop> <prop key="hibernate.search.default.directory_provider">${org.hibernate.search.directoryprovidr}</prop> <prop key="hibernate.search.default.indexBase"> ${org.hibernate.search.index.base_directory} </prop> </props> </property> </bean> <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory" /> <property name="dataSource" ref="dataSource" /> <property name="hibernateManagedSession" value="true" /> </bean> <tx:annotation-driven order="0" transaction-manager="transactionManager" /> <context:component-scan base-package="mx.gob.jgtjo.apps.schedule.dao.hibernate" /> </beans> Hibernate Config <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory name="jgtjoSessionFactory"> <!--Entity --> <mapping class="mx.gob.jgtjo.apps.schedule.model.AudienciaOral" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.CausaPenal" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.DefensorPenal" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.Delito" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.EventoAudiencia" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.Juez" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.MinisterioPublico" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.ParteMaterial" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.Sala" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.TipoAudiencia" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.User" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.Rol" /> <mapping class="mx.gob.jgtjo.apps.schedule.model.DelitoConfigurado" /> </session-factory> </hibernate-configuration> And a little bit of my logging: 09:33:18,767 [ssIndexerServiceImpl] (tp-bio-8080"-exec-10) DEBUG : Indexing entities 09:33:18,773 [orphicIndexHierarchy] (tp-bio-8080"-exec-10) TRACE : Targeted indexed classes for [class java.lang.Object]: [class mx.gob.jgtjo.apps.schedule.model.CausaPenal, class mx.gob.jgtjo.apps.schedule.model.ParteMaterial] 09:33:18,774 [MassIndexerImpl ] (tp-bio-8080"-exec-10) DEBUG : Targets for indexing job: [class mx.gob.jgtjo.apps.schedule.model.CausaPenal, class mx.gob.jgtjo.apps.schedule.model.ParteMaterial] 09:33:18,819 [orphicIndexHierarchy] (tp-bio-8080"-exec-10) TRACE : Targeted indexed classes for [class mx.gob.jgtjo.apps.schedule.model.CausaPenal, class mx.gob.jgtjo.apps.schedule.model.ParteMaterial]: [class mx.gob.jgtjo.apps.schedule.model.CausaPenal, class mx.gob.jgtjo.apps.schedule.model.ParteMaterial] 09:33:18,869 [Workspace ] (tp-bio-8080"-exec-10) TRACE : IndexWriter opened using batch configuration 09:33:18,869 [PurgeAllWorkDelegate] (tp-bio-8080"-exec-10) TRACE : purgeAll Lucene index using IndexWriter for type: class mx.gob.jgtjo.apps.schedule.model.CausaPenal 09:33:18,889 [Workspace ] (tp-bio-8080"-exec-10) TRACE : IndexWriter opened using batch configuration 09:33:18,890 [PurgeAllWorkDelegate] (tp-bio-8080"-exec-10) TRACE : purgeAll Lucene index using IndexWriter for type: class mx.gob.jgtjo.apps.schedule.model.ParteMaterial 09:33:18,891 [OptimizeWorkDelegate] (tp-bio-8080"-exec-10) TRACE : optimize Lucene index: class mx.gob.jgtjo.apps.schedule.model.CausaPenal 09:33:18,893 [OptimizeWorkDelegate] (tp-bio-8080"-exec-10) TRACE : optimize Lucene index: class mx.gob.jgtjo.apps.schedule.model.ParteMaterial 09:33:18,940 [WrapInJTATransaction] ( collectionsloader-2) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,940 [WrapInJTATransaction] ( collectionsloader-3) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,940 [WrapInJTATransaction] ( collectionsloader-2) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,944 [nsumerEntityProducer] (hIndexingWorkspace-2) TRACE : created 09:33:18,946 [WrapInJTATransaction] ( collectionsloader-4) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,947 [nsumerEntityProducer] (hIndexingWorkspace-2) TRACE : created 09:33:18,948 [WrapInJTATransaction] (arch: entityloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,932 [WrapInJTATransaction] ( collectionsloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,932 [WrapInJTATransaction] ( collectionsloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,950 [WrapInJTATransaction] (arch: entityloader-2) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,951 [WrapInJTATransaction] ( collectionsloader-3) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,974 [IdentifierProducer ] (hIndexingWorkspace-2) TRACE : created 09:33:18,948 [nsumerEntityProducer] (arch: entityloader-1) TRACE : started 09:33:18,973 [WrapInJTATransaction] ( collectionsloader-4) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,951 [nsumerEntityProducer] (hIndexingWorkspace-1) TRACE : created 09:33:18,950 [nsumerEntityProducer] (arch: entityloader-2) TRACE : started 09:33:18,975 [WrapInJTATransaction] (: identifierloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,978 [nsumerEntityProducer] (hIndexingWorkspace-1) TRACE : created 09:33:18,978 [WrapInJTATransaction] (arch: entityloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,979 [nsumerEntityProducer] (arch: entityloader-1) TRACE : started 09:33:18,977 [IdentifierProducer ] (: identifierloader-1) TRACE : started 09:33:18,979 [IdentifierProducer ] (hIndexingWorkspace-1) TRACE : created 09:33:18,988 [WrapInJTATransaction] (arch: entityloader-2) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:18,989 [nsumerEntityProducer] (arch: entityloader-2) TRACE : started 09:33:19,049 [WrapInJTATransaction] (: identifierloader-1) TRACE : TransactionFactory does not require a TransactionManager: don't wrap in a JTA transaction 09:33:19,050 [IdentifierProducer ] (: identifierloader-1) TRACE : started I do not why but it seems to me that hibernate search is somehow entering a infinite loop. Any help is welcome.
0
[ 2, 483, 4148, 2102, 8820, 2122, 1384, 86, 212, 85, 20, 1895, 21, 4348, 60, 800, 3726, 3726, 31, 589, 749, 20, 1895, 21, 18515, 556, 4348, 120, 4148, 2102, 8820, 2122, 1, 13727, 11969, 7202, 5991, 9, 6037, 1373, 25671, 106, 5, 6, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Convert bytes in a c array as longs === I have a byte array in little endian byte order, I want to convert it to a long(4 bytes) array. In layman's terms, I want to merge every 4 bytes.
0
[ 2, 8406, 34, 3231, 19, 21, 272, 7718, 28, 175, 18, 800, 3726, 3726, 31, 57, 21, 34, 591, 7718, 19, 265, 241, 806, 34, 591, 389, 15, 31, 259, 20, 8406, 32, 20, 21, 175, 5, 300, 34, 3231, 6, 7718, 9, 19, 1815, 177, 22, 18, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
Python comprehension: for x in [temp for temp in xlist if temp<=xmax]: === for x in [temp for temp in xlist if temp<=xmax]: This code works, but looks like an unnecessarily foreign stuttering way of starting a for loop. Is there a cleaner syntax?
0
[ 2, 20059, 27300, 45, 26, 993, 19, 636, 9577, 26, 13, 9577, 19, 993, 5739, 100, 13, 9577, 1, 3726, 396, 8304, 500, 45, 800, 3726, 3726, 26, 993, 19, 636, 9577, 26, 13, 9577, 19, 993, 5739, 100, 13, 9577, 1, 3726, 396, 8304, 500...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Managing links and directories === I have recently started a large project that I'm used to, and I'm finding it hard to manage links (such as including files) with all the directories. Is there a way I can define a basepath and then go from there. So something like this: require(BASEPATH.'/folder/file.php'); instead of: require('../../folder/file.php'); So basically a way so that the links won't break if files are moved.
0
[ 2, 5616, 6271, 17, 559, 1596, 800, 3726, 3726, 31, 57, 1989, 373, 21, 370, 669, 30, 31, 22, 79, 147, 20, 15, 17, 31, 22, 79, 3007, 32, 552, 20, 4705, 6271, 13, 5, 4289, 28, 215, 6488, 6, 29, 65, 14, 559, 1596, 9, 25, 80, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
"Find My Friends" reverse engineered === I am wanting to write a little program that tracks my movements throughout the day and saves them off. One possible way of doing this would be to plug into the "Find My Friends" protocol or the "Find My iPhone" protocol. Has anyone reverse engineered these applications yet? I am not trying to hack in any unauthorized fashion, I simply want to be able to connect to my list directly without the use of an iPhone as a client.
2
[ 2, 13, 7, 19811, 51, 954, 7, 7006, 16596, 800, 3726, 3726, 31, 589, 4638, 20, 2757, 21, 265, 625, 30, 1633, 51, 4889, 892, 14, 208, 17, 16815, 105, 168, 9, 53, 938, 161, 16, 845, 48, 83, 44, 20, 10922, 77, 14, 13, 7, 19811, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
rails - rspec - why does this "validates_inclusion_of :role, :in => %w[one, two, three ] }" not work === I'm getting an error that this method does not exist but this seems fairly basic and I'm not sure why I'm getting the error? it { should validate_presence_of :role } # This is OK. Failure/Error: it { should validate_inclusion_of :role, :in => %w[one two three ] } NoMethodError: undefined method `validate_inclusion_of' for #<RSpec::Core::ExampleGroup::Nested_1:0x007fad7474f9b8> For Code: require 'spec_helper' describe User do it { should validate_inclusion_of :role, :in => %w[one two three ] } end http://apidock.com/rails/ActiveModel/Validations/ClassMethods/validates_inclusion_of
0
[ 2, 2240, 18, 13, 8, 13, 1224, 12610, 13, 8, 483, 630, 48, 13, 7, 18506, 8209, 18, 1, 108, 10301, 5991, 1, 1041, 13, 45, 661, 413, 15, 13, 45, 108, 800, 1, 13, 11881, 499, 2558, 849, 15, 81, 15, 132, 13, 500, 13, 1, 7, 52...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Alternative to global variables in PHP === Due to slowness, ( and also for coding reasons ), I know that the use of global variables should be avoided as much as possible. It's twice as slow and it decreases the understanding & tracking of the code flow. But sometimes, you do need them in your functions. Sometimes, they do get very handy. To some degree constants can be used. But as the name says it all, they are constants they cannot be totally substitute the use of global variables. they only share the scope. And this question is all about scope. What other utilities are out there in PHP so that a variable can be tapped into within functions, outside of functions, basically anywhere and everyehere. I'm curious to learn what options are available in PHP to take care of this need. As an example, I can throw in the use of session variables as an alternative for example. you may find it weird but a session variable can easily do the trick. it actually does it better than a global variable; I can initialize my session variable right within my function s and in no time, all other parts of my code is able to work with that session variable and I don;t need to worry about the speed concerns. Wwhereas with the global variables, the global variables must be introduced/defined outside the functions scope ( to be exact, at the top of the page ) before they may get used by other sections. Sessions won't suffer from this limitation. Are there other ways of tackling this matter beside the session variables?
0
[ 2, 2676, 20, 2062, 12157, 19, 13, 26120, 800, 3726, 3726, 397, 20, 2276, 720, 15, 13, 5, 17, 67, 26, 13, 15458, 2932, 13, 6, 15, 31, 143, 30, 14, 275, 16, 2062, 12157, 378, 44, 9460, 28, 212, 28, 938, 9, 32, 22, 18, 2088, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Running WAMP & IIS Together On The Same Server === First question on here! I've been searching through like crazy trying to figure out a solution to my company's web issues. Okay, my company has been using IIS to host their own website and client websites. They write all of their applications in .NET. They wanted a much more robust personal website and agreed that they wanted to go with Wordpress for their new personal site. But they want to be able to serve both sets of content from one server and one domain name. I have successfully installed WAMP and have it running concurrently with IIS. WAMP is currently running on Port 81. Now here's my question: Is there any way to have it where when people visit the main domain - that they see the WAMP server - and then when they direct themselves to other content - that they see the IIS server? Is this possible some-way? Thanks so much!
0
[ 2, 946, 619, 10158, 279, 595, 18, 429, 27, 14, 205, 8128, 800, 3726, 3726, 64, 1301, 27, 235, 187, 31, 22, 195, 74, 5792, 120, 101, 3328, 749, 20, 1465, 70, 21, 4295, 20, 51, 237, 22, 18, 2741, 1549, 9, 1705, 15, 51, 237, 63...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Relative paths from file for img, a and header === I have a dynamic website that can be accessed as domain/categories or domain/categories/article, and it redirects to domain/index.php?category/article. The problem I'm facing is that I want to use relative paths from the files. I managed to do that for includes with dirname(__FILE__), as in ini_set('include_path', dirname(__FILE__) . '/include'); This works fine. Depending on the directory I will change it to, and it also works ini_set('include_path', dirname(__FILE__) . '/../include'); (extra /../) But if I try to do the same with img src, A href or php Header, while I get the correct file path to the images or links, they simply do not work. Nothing happens as if I didn't click at all. Clicking on a link generated through php with: print "<a href='" . dirname(__FILE__) . strtolower(str_replace(" ", "", $row['pageSection'])) . "/" . strtolower(str_replace("", "-", $row['pageTitle'])) . "' alt='' >"; Does not work, even if the html source code is reading as: <a href="C:\validpath\htdocs\domain/category/article> How can I make the path to the img, link (and php header) relative to the file location, and no the url, and make it work? Side note: even my CSS brakes if I acess my site through domain/prettyurl/, but not if I access through domain/prettyurl (no ending slash), pretty weird.
0
[ 2, 4543, 12074, 37, 3893, 26, 797, 263, 15, 21, 17, 157, 106, 800, 3726, 3726, 31, 57, 21, 7782, 2271, 30, 92, 44, 12904, 28, 4603, 118, 14375, 1596, 54, 4603, 118, 14375, 1596, 118, 20360, 15, 17, 32, 302, 14706, 18, 20, 4603, ...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
Android 4.x and Dropbox - does not authenticate === I've implemented a Dropbox interface in my Android app exactly as shown in the example on the dropbox dev guide - https://www.dropbox.com/developers/start/setup#android It works perfectly on my Android 2.3.5 device, and works fine on my 4.x Emulator. However, in testing on real devices, it fails on 4.x devices with a "Not properly authenticated" error. Two separate devices running 4.x have failed in the same way. I realize this is a bit of a stretch to ask a question with out all the tech details, but the plain truth is I don't have them. The two users I was able to convince to help test on their real devices are a) remote and b) completely non-technical, so I have no Logcat data or stacktrace or anything else that might help. I was simply hoping someone else has run into this and might have an answer. Failing that, anyone have a 4.x device they would be willing to run an app on and provide some logcat data?
0
[ 2, 13005, 268, 9, 396, 17, 2804, 5309, 13, 8, 630, 52, 14351, 1373, 800, 3726, 3726, 31, 22, 195, 6807, 21, 2804, 5309, 6573, 19, 51, 13005, 4865, 1890, 28, 1721, 19, 14, 823, 27, 14, 2804, 5309, 9664, 3378, 13, 8, 7775, 18, 6...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
getActivity() returns null when implementing onSaveInstanceState === I want to handle orientation in my android app by implementing onSaveInstanceState. I add all the variables that I need to the bundle in the onSaveInstanceState method and everything is ok and I can restore them in the onCreate method of the same fragment. The problem is although I can restore all the variables, getActivity() has null value. I tried adding setRetainInstance(true) but in this case I couldn't restore the saved variables from bundle. can anyone help me? Thanks,
0
[ 2, 164, 19348, 5, 6, 4815, 16203, 76, 17333, 27, 19863, 108, 384, 2416, 3859, 800, 3726, 3726, 31, 259, 20, 3053, 10245, 19, 51, 13005, 4865, 34, 17333, 27, 19863, 108, 384, 2416, 3859, 9, 31, 3547, 65, 14, 12157, 30, 31, 376, 2...
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...