Daily Archives

Articles indexed Tuesday March 30 2010

Page 18/126 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • importing content into drupal.

    - by anru
    I have a wordpress site with 5k post and each post has average 25 comments. so 125k total nodes have to be added. I need import those posts and comments into drupal 6 . I have written a script to import those post/comments into drupal by drupal's cron service. but the cron service keeps time out. because import 125k nodes one by one is very slow. what can i do to imporve drupal importing speed? i am use drupal built in node_save(), comment_save() method to do it. I have not find out a way to use customized SQL query to increase importing speed yet. I am execute my script through drupals's cron.php, that mean even i have set 'max_execute_time' to unlimited, but that only affects PHP , apache server has it own time out setting.

    Read the article

  • SQL Grouping with multiple joins combining results incorrectly

    - by Matt
    Hi I'm having trouble with my query combining records when it shouldn't. I have two tables Authors and Publications, they are related by Publication ID in a many to many relationship. As each author can have many publications and each publication has many Authors. I want my query to return every publication for a set of authors and include the ID of each of the other authors that have contributed to the publication grouped into one field. (I am working with mySQL) I have tried to picture it graphically below Table: authors Table:publications AuthorID | PublicationID PublicationID | PublicationName 1 | 123 123 | A 1 | 456 456 | B 2 | 123 789 | C 2 | 789 3 | 123 3 | 456 I want my result set to be the following AuthorID | PublicationID | PublicationName | AllAuthors 1 | 123 | A | 1,2,3 1 | 456 | B | 1,3 2 | 123 | A | 1,2,3 2 | 789 | C | 2 3 | 123 | A | 1,2,3 3 | 456 | B | 1,3 This is my query Select Author1.AuthorID, Publications.PublicationID, Publications.PubName, GROUP_CONCAT(TRIM(Author2.AuthorID)ORDER BY Author2.AuthorID ASC)AS 'AuthorsAll' FROM Authors AS Author1 LEFT JOIN Authors AS Author2 ON Author1.PublicationID = Author2.PublicationID INNER JOIN Publications ON Author1.PublicationID = Publications.PublicationID WHERE Author1.AuthorID ="1" OR Author1.AuthorID ="2" OR Author1.AuthorID ="3" GROUP BY Author2.PublicationID But it returns the following instead AuthorID | PublicationID | PublicationName | AllAuthors 1 | 123 | A | 1,1,1,2,2,2,3,3,3 1 | 456 | B | 1,1,3,3 2 | 789 | C | 2 It does deliver the desired output when there is only one AuhorID in the where statement. I have not been able to figure it out, does anyone know where i'm going wrong?

    Read the article

  • Debian: Adding new user?

    - by Marco
    How can I create a new user then SSH into the box under that user? I ran: useradd marco -d /home/marco -p WuUfhRdt4B Then I added to /etc/ssh/sshd_config: AllowUsers root marco Then restarted ssh: /etc/init.d/ssh restart I can't login. What did I miss? ** Running Debian.

    Read the article

  • Design crowd sourcing

    - by CVertex
    I'm looking to get a logo designed, but all my designer friends/colleagues are pretty busy. Since I've never done it before, I thought it would be interesting to crowd source the design. Does anyone know of any good design crowd sourcing sites?

    Read the article

  • Algorithm for Search page

    - by Geetha
    Hi All, I am creating a search page where we can find the product by entering the text. ex: Brings on the night. My query bring the records which contain atleast word from this. Needs: 1. First row should contains the record with the given sentence. 2. Second most matching....etc How to achieve this. Is there any algorithm for this. It will be more helpful if anyone share your idea. Geetha

    Read the article

  • php question regarding arrays

    - by Martin
    Hi there, I'm a (complete) php noob and need a little help with something. I'm working on a project whereby a user can select up to 6 categories via a form (I'm using ExpressionEngine). The output is like this: "Cat1","Cat2","Cat3" ...and so on. The user can select up to 6 categories on that form. What I need: even if my result is 3 categories I need to have 6 'cells' - for want of a better word - even if they're empty: "Cat1","Cat2","Cat3","","","" I've tried this: <?php $str = '(output goes here)'; print_r(explode(',', $str, 6)); ?> ...but the output give me: Array ( [0] => Cat1 [1] => Cat2 [2] => Cat3 [3] => [4] => [5] => ) How do I get from that to this: "Cat1","Cat2","Cat3","","","" Does this make sense? Thanks Martin

    Read the article

  • inflate vs findViewById

    - by Cedric
    Hi all, Suppose I have a simple layout xml like the following: button.xml: Are there any differences in the following calls? and which one should i use? button = (Button) getLayoutInflater().inflate(R.layout.button, null); and View v = getLayoutInflater().inflate(R.layout.button, null); button = (Button) v.findViewById(R.id.button01);

    Read the article

  • return char1 + char2? Isn't it possible?

    - by pocoa
    I'm trying to return a string from a function. Which basically adds some chars together and return the string representation. string toString() { char c1, c2, c3; // some code here return c1 + c2; // Error: invalid conversion from `char' to `const char*' } it is possible to return boolean values like return c1 == 'x'. Isn't it possible to return string values? I know that it is possible to it like this: string result; result.append(c1, c2); return result; I'm new to C++ so I thought that there must be more elegant solution around.

    Read the article

  • SSH Tunneling from Windows to Linux/Ubuntu

    - by Mike
    My question is for my girlfriend basicly.... She works at a mall and doesn't do much so she likes to get on myspace and facebook as most girls do and yahoo to check her email. Well she uses her laptop to connect to a wireless network that doesn't allow it.... so I did some research and got putty and connected to my linux box I have here at home and it worked somewhat. My problem is it only views my webpages I have created here on this box it won't go outside of the linux host. I did it like this in putty... port is 1000 and hostname:80 is what I got outa my research then connected after seting up the tunnel bam worked for all webpages on my box but when she puts in www.myspace.com it redirects to my index.php in my var/www and won't travel outside that as I said.. Any help would be much obliged.

    Read the article

  • Perl "Day too big" - root cause

    - by azp74
    I have been helping someone debug some code where the error message was "Day too big". I know that this springs from localtime and the Y2038 bug (most google results appear to be people dealing with cookies expiring well into the future). We appear to have 'fixed' the problem by using time to get the current date. However, given that none of our original dates should have hit the 2038 issue I'm sceptical that we've actually fixed the problem ... Are there other instances that anyone knows of where one would hit "day too big"?

    Read the article

  • Zend Framework Modules can't find/load Models..

    - by user284503
    For some frustrating reason, I configured some Modules, which seemed to work fine, However I cannot load a Modules Models. If I move the Models to the Default they load, but I just can't get the Framework to find them locally.. Example: My Modules Directory is: application\modules\books\models\books.php (books is my Model) class Application_Module_Books_Model_Books extends Zend_Db_Table_Abstract {} I also tried.. Books_Model_Books, Model_Books, books, Modules_.. you name it I tried it :) My controller is in the Books Module, and is an Index Controller, and it can never find the Local Model. I'm using Application.ini and it is configured this way: resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers" resources.frontController.params.displayExceptions = 1 resources.frontController.moduleDirectory = APPLICATION_PATH "/modules" I have a BootStrap in the Modules Directory: class Admin_Bootstrap extends Zend_Application_Module_Bootstrap { } I'm on Zend Framework 1.10, and ideas.. ?

    Read the article

  • Picker view wont rotate- iPhone

    - by lotuseater
    hi, I am making a booking page. I have included 3 pickers in it. I have included all the delegates required for the pickers to work but it wont rotate. I have enabled user interaction and multitouch in the nib file. Here is my code. Please help me. :( @interface ChooseContactsFrom : UIViewController { IBOutlet UIPickerView *statePickup; IBOutlet UIPickerView *paymentMethodPickup; IBOutlet UIDatePicker *expiryDatePickup; IBOutlet UIView *statePickupView; IBOutlet UIView *paymentMethodPickupView; IBOutlet UIView *expiryDatePickupView; } (void)viewDidLoad { self.title = @"Choose Contacts"; //Fill in the states name/ stateArray = [[NSArray alloc]initWithObjects:@"",nil]; paymentModeArray = [[NSArray alloc] initWithObjects:@"Credit Card", @"Cash",@"Account",@"Voucher",@"Debit Card", nil]; paymentMethodPickup.frame = CGRectMake(0.0, 44.0, paymentMethodPickup.frame.size.width, paymentMethodPickup.frame.size.height); paymentMethodPickup.userInteractionEnabled = YES; paymentMethodPickup.multipleTouchEnabled = YES; paymentMethodPickupView.frame = CGRectMake(0.0, 210.0, paymentMethodPickupView.frame.size.width, paymentMethodPickupView.frame.size.height); statePickup.frame = CGRectMake(0.0, 44.0,statePickup.frame.size.width, statePickup.frame.size.height); statePickupView.frame = CGRectMake(0.0, 210.0, statePickupView.frame.size.width, statePickupView.frame.size.height); stateArray = [[NSArray alloc] initWithObjects:@"state1", @"state2", @"state3", @"state4", @"state5", @"state6", @"state7", @"state8", @"state9", @"state10", nil]; expiryDatePickup.frame = CGRectMake(0.0, 44.0, expiryDatePickup.frame.size.width, expiryDatePickup.frame.size.height); expiryDatePickupView.frame = CGRectMake(0.0, 210.0, expiryDatePickupView.frame.size.width, expiryDatePickupView.frame.size.height); [super viewDidLoad]; } -(IBAction)back:(id)sender { [self dismissModalViewControllerAnimated:YES]; } pragma mark pickerView delegates (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView { return 1; } (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component { if( thePickerView == statePickup) { return [stateArray count]; } else if(thePickerView == paymentMethodPickup) { return [paymentModeArray count]; } else { return 0; } } (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component { if(thePickerView == statePickup) { return [stateArray objectAtIndex:row]; } else if(thePickerView == paymentMethodPickup) { return [paymentModeArray objectAtIndex:row]; } else { return @" "; } } (CGFloat)pickerView:(UIPickerView *)pickerView rowHeightForComponent:(NSInteger)component{ return 50; } (CGFloat)pickerView:(UIPickerView *)pickerView widthForComponent:(NSInteger)component { return 250; } (void)pickerView:(UIPickerView *)thepickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component { if(thepickerView == statePickup) { state.text=[stateArray objectAtIndex:row]; } if(thepickerView == paymentMethodPickup) { payment.text=[paymentModeArray objectAtIndex:row]; } } (void)ClearSubviews { //[firstName resignFirstResponder]; // [lastName resignFirstResponder]; // [email resignFirstResponder]; // [address1 resignFirstResponder]; // [address2 resignFirstResponder]; // [city resignFirstResponder]; // //[state resignFirstResponder]; // [payment resignFirstResponder]; // [creditCard resignFirstResponder]; // [expirydate removeFromSuperview]; // [statePickup removeFromSuperview]; // [paymentMethodPickup removeFromSuperview]; } (BOOL)textFieldShouldBeginEditing:(UITextField *)textField { // [self showPicker:textField]; //[self setViewMovedUp]; if(textField == firstName || textField == lastName || textField == email || textField == address1 || textField == address2 ||textField == city) { [self ClearSubviews]; //pickerToolbar.hidden = TRUE; return YES; } else if(textField == payment) { [self ClearSubviews]; [self setViewMovedUp]; [payment setText:[paymentModeArray objectAtIndex:0]]; [self.view insertSubview:paymentMethodPickupView aboveSubview:self.view]; return NO; } else if(textField == state) { [self ClearSubviews]; [self setViewMovedUp]; [state setText:[stateArray objectAtIndex:0]]; [self.view insertSubview:statePickupView aboveSubview:self.view]; return NO; } else if(textField == expirydate) { [self setViewMovedUp]; expiryDatePickup.date = [NSDate date]; NSDate *date1 = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSString *strDate=[dateFormatter stringFromDate:date1]; NSString *str=[[NSString alloc] initWithString: strDate]; [expirydate setText:str]; [self.view insertSubview:expiryDatePickupView aboveSubview:self.view]; return NO; } else if(textField == creditCard) { [self ClearSubviews]; [self setViewMovedUp]; return YES; } else { [self ClearSubviews]; return YES; } } -(BOOL)textFieldShouldEndEditing:(UITextField *)textField { return YES; } (void)textFieldDidEndEditing:(UITextField *)textField { if(textField == creditCard) { [self moveDown]; } } (BOOL)textFieldShouldReturn:(UITextField *)textField { [firstName resignFirstResponder]; [lastName resignFirstResponder]; [email resignFirstResponder]; [address1 resignFirstResponder]; [address2 resignFirstResponder]; [city resignFirstResponder]; [creditCard resignFirstResponder]; return YES; } -(IBAction)textFieldDoneEditing:(id)sender { [sender resignFirstResponder]; } ////////----------------------------------------------------------------------- pragma mark move screen (void)setViewMovedUp { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; // Make changes to the view's frame inside the animation block. They will be animated instead // of taking place immediately. CGRect rect = [self.view frame]; // If moving up, not only decrease the origin but increase the height so the view // covers the entire screen behind the keyboard. rect.origin.y -= 50.0f; rect.size.height -= 80.0f; [self.view setFrame:rect]; [UIView commitAnimations]; } -(void)moveDown { [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.3]; // Make changes to the view's frame inside the animation block. They will be animated instead // of taking place immediately. CGRect rect = [self.view frame]; rect.origin.y += 50.0f; rect.size.height += 80.0f; [self.view setFrame:rect]; // [UIView setBackgroundColor:[UIColor darkGrayColor]]; [UIView commitAnimations]; } pragma mark Method to show pickers -(void)showPicker:(UITextField *)textField { if(textField == expirydate) { expiryDatePickup .date = [NSDate date]; NSDate *date1 = [NSDate date]; NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSString *strDate=[dateFormatter stringFromDate:date1]; NSString *str=[[NSString alloc] initWithString: strDate]; [expirydate setText:str]; [self.view insertSubview:expiryDatePickup aboveSubview:self.view]; } else if(textField == payment) { [payment setText:[paymentModeArray objectAtIndex:0]]; [self.view insertSubview:paymentMethodPickupView aboveSubview:self.view]; } else if(textField == state) { [state setText:[stateArray objectAtIndex:0]]; [self.view insertSubview:statePickupView aboveSubview:self.view]; } } (IBAction)datePickerChanged:(id)sender { NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateStyle:NSDateFormatterMediumStyle]; NSDate *date=expiryDatePickup.date; formattedDateString1 = [dateFormatter stringFromDate:date]; [expirydate setText:formattedDateString1]; NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; unsigned int unitFlags = NSMonthCalendarUnit | NSDayCalendarUnit; components = [gregorian components:unitFlags fromDate:date]; [gregorian release]; } pragma mark done and cancel methods -(IBAction) btnCancelExpiryDate:(id)sender { [self moveDown]; [expirydate setText:@" "]; [expiryDatePickupView removeFromSuperview]; } -(IBAction) btnDoneExpiryDate:(id)sender { [self moveDown]; [expiryDatePickupView removeFromSuperview]; expiryDatePickup .date = [NSDate date]; } -(IBAction)cancelPaymentType:(id)sender { [self moveDown]; [payment setText:@" "]; [paymentMethodPickupView removeFromSuperview]; } -(IBAction)donePaymentType:(id)sender { [self moveDown]; [paymentMethodPickupView removeFromSuperview]; } -(IBAction)doneState:(id)sender { [self moveDown]; [statePickupView removeFromSuperview]; } (IBAction)cancelState:(id)sender; { [self moveDown]; [state setText:@" "]; [statePickupView removeFromSuperview]; }

    Read the article

  • Sound File editing in Objective C

    - by Biranchi
    Hi All, I am able to record and create audio files using AudioFileCreateWithURL in the AudioToolbox Framework. I want to figure out if there is any way to edit the .caf sound files. I want to insert another recoreded audio inside the main audio file. Any thoughts or suggestions how to proceed ?? Thanks.

    Read the article

  • Casting in MVVM Light CommandParameterValue

    - by user275561
    here is my Problem, I want to pass the integer 1 when this canvas is pressed. Every time I click the canvas, I get a An unhandled exception of type 'System.InvalidCastException' occurred in GalaSoft.MvvmLight.dll. Now I could make my life easier and just do the RelayCommand to accept a String instead of int but for the sake of learning. How would i go about doing it this way, <i:Interaction.Triggers> <i:EventTrigger EventName="MouseLeftButtonDown"> <cmd:EventToCommand Command="{Binding ButtonPress}" CommandParameterValue="1" </i:EventTrigger> </i:Interaction.Triggers>

    Read the article

  • Globally disabling FxCop errors in TeamCity

    - by Dave
    Ok, another FxCop question for today. I've read the arguments regarding the IdentifiersShouldBeCasedCorrectly rule, and whether or not it should be "XML" or "Xml". Well, I'm an "XML" guy and I want to stay that way. Therefore, I do not want FxCop to correct me all of the time. I have been using the SuppressMessage attribute only for specific cases. I have also used FxCop to mark a ton of errors and copied them as "module" level SuppressMessage statements into assemblyinfo.cs. That works pretty well. However, now I really want to globally disable this annoying IdentifiersShouldBeCasedCorrectly rule. I'm using TeamCity 5.0.3, and am not using an FxCop project file (however, I could do this). I was hoping that I could pass a parameter to FxCopCmd to tell it to ignore this error, but it doesn't look that way from the documentation. So... is there anything I can do short of creating an FxCop project file on the TeamCity build server and using it for the FxCop build runner?

    Read the article

  • How do I set ORDER BY params using prepared PDO statement?

    - by Marlorn
    I'm having problems using params in the ORDER BY section of my SQL. It doesn't issue any warnings, but prints out nothing. $order = 'columnName'; $direction = 'ASC'; $stmt = $db->prepare("SELECT field from table WHERE column = :my_param ORDER BY :order :direction"); $stmt->bindParam(':my_param', $is_live, PDO::PARAM_STR); $stmt->bindParam(':order', $order, PDO::PARAM_STR); $stmt->bindParam(':direction', $direction, PDO::PARAM_STR); $stmt->execute(); The :my_param works, but not :order or :direction. Is it not being internally escaped correctly? Am I stuck inserting it directly in the SQL? Like so: $order = 'columnName'; $direction = 'ASC'; $stmt = $db->prepare("SELECT * from table WHERE is_live = :is_live ORDER BY $order $direction"); Is there a PDO::PARAM_COLUMN_NAME constant or some equivalent? Thanks!

    Read the article

  • Group Policy: Not working after few days

    - by Kabir Rao
    Hi, I have implemented a group policy as per the suggestion http://serverfault.com/questions/121065/change-local-computer-policy-on-windows-2003-terminal-server . it worked fine when i tested..but after two days it is not working...can somebody help. Thanks, Kabir

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >