Search Results

Search found 43110 results on 1725 pages for 'noob question'.

Page 5/1725 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • NOOB Memory Problem - EXC_BAD_ACCESS

    - by Michael Bordelon
    I have been banging my head against the wall for a couple days and need some help. I have a feeling that I am doing something really silly here, but I cannot find the issue. This is the controller for a table view. I put the SQL in line to simplify it as part of the troubleshooting of this error. Normally, it would be in an accessor method in a model class. It gets through the SQL read just fine. Finds the two objects, loads them into the todaysWorkout array and then builds the cells for the table view. The table view actually comes up on the scree and then it throws the EXC_BAD_ACCESS. I ran instruments and it shows the following: 0 CFString Malloc 1 00:03.765 0x3946470 176 Foundation -[NSPlaceholderString initWithFormat:locale:arguments:] 1 CFString Autorelease 00:03.765 0x3946470 0 Foundation NSRecordAllocationEvent 2 CFString CFRelease 0 00:03.767 0x3946470 0 Bring It -[WorkoutViewController viewDidLoad] 3 CFString Zombie -1 00:03.917 0x3946470 0 Foundation NSPopAutoreleasePool Here is the source code for the controller. I left it all in there just in case there is something extraneous causing the problem. I sincerely appreciate any help I can get: #import "WorkoutViewController.h" #import "MoveListViewController.h" #import "Profile.h" static sqlite3 *database = nil; @implementation WorkoutViewController @synthesize todaysWorkouts; @synthesize woNoteCell; @synthesize bi; //@synthesize woSwitchCell; - (void)viewDidLoad { [super viewDidLoad]; bi = [[BIUtility alloc] init]; todaysWorkouts = [[NSMutableArray alloc] init]; NSString *query; sqlite3_stmt *statement; //open the database if (sqlite3_open([[BIUtility getDBPath] UTF8String], &database) != SQLITE_OK) { sqlite3_close(database); NSAssert(0, @"Failed to opendatabase"); } query = [NSString stringWithFormat:@"SELECT IWORKOUT.WOINSTANCEID, IWORKOUT.WORKOUTID, CWORKOUTS.WORKOUTNAME FROM CWORKOUTS JOIN IWORKOUT ON IWORKOUT.WORKOUTID = CWORKOUTS.WORKOUTID AND DATE = '%@'", [BIUtility todayDateString]]; if (sqlite3_prepare_v2(database, [query UTF8String], -1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) { Workout *wo = [[Workout alloc] init]; wo.woInstanceID = sqlite3_column_int(statement, 0); wo.workoutID = sqlite3_column_int(statement, 1); wo.workoutName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 2)]; [todaysWorkouts addObject:wo]; [wo release]; } sqlite3_finalize(statement); } if(database) sqlite3_close(database); [query release]; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { //todaysWorkouts = [BIUtility todaysScheduledWorkouts]; static NSString *noteCellIdentifier = @"NoteCellIdentifier"; UITableViewCell *cell; if (indexPath.section < ([todaysWorkouts count])) { cell = [tableView dequeueReusableCellWithIdentifier:@"OtherCell"]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier: @"OtherCell"] autorelease]; cell.accessoryType = UITableViewCellAccessoryNone; } if (indexPath.row == 0) { Workout *wo = [todaysWorkouts objectAtIndex:indexPath.section]; [cell.textLabel setText:wo.workoutName]; } else { [cell.textLabel setText:@"Completed?"]; [cell.textLabel setFont:[UIFont fontWithName:@"Arial" size:15]]; [cell.textLabel setTextColor:[UIColor blueColor]]; } } else { cell = (NoteCell *)[tableView dequeueReusableCellWithIdentifier:noteCellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"NoteCell" owner:self options:nil]; cell = [nib objectAtIndex:0]; } } return cell; //[cell release]; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; if (indexPath.section < ([todaysWorkouts count]) && (row == 0)) { MoveListViewController *moveListController = [[MoveListViewController alloc] initWithStyle:UITableViewStylePlain]; moveListController.workoutID = [[todaysWorkouts objectAtIndex:indexPath.section] workoutID]; moveListController.workoutName = [[todaysWorkouts objectAtIndex:indexPath.section] workoutName]; moveListController.woInstanceID = [[todaysWorkouts objectAtIndex:indexPath.section] woInstanceID]; NSLog(@"Workout Selected: %@", [[todaysWorkouts objectAtIndex:indexPath.section] workoutName]); Bring_ItAppDelegate *delegate = [[UIApplication sharedApplication] delegate]; [delegate.workoutNavController pushViewController:moveListController animated:YES]; } else { UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; if (indexPath.section < ([todaysWorkouts count]) && (row == 1)) { if (cell.accessoryType == UITableViewCellAccessoryNone) { cell.accessoryType = UITableViewCellAccessoryCheckmark; } else { cell.accessoryType = UITableViewCellAccessoryNone; } } } [tableView deselectRowAtIndexPath:indexPath animated:YES]; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger h = 35; return h; } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return ([todaysWorkouts count] + 1); //return ([todaysWorkouts count]); } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section < ([todaysWorkouts count])) { return 2; } else { return 1; } } - (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if (section < ([todaysWorkouts count])) { return @"Workout"; } else { return @"How Was Your Workout?"; } } - (void)didReceiveMemoryWarning { // Releases the view if it doesn't have a superview. [super didReceiveMemoryWarning]; // Release any cached data, images, etc that aren't in use. } - (void)viewDidUnload { [super viewDidUnload]; // Release any retained subviews of the main view. // e.g. self.myOutlet = nil; } - (void)dealloc { [todaysWorkouts release]; [bi release]; [super dealloc]; } @end

    Read the article

  • php run function on all images from one dir in recursive mode (noob)

    - by Steve
    hey guyz i have a function $result = create_watermark( 'input_file_name' ,'output_file_name'); i have dir called /images n have 500 images in it and all images are link images_(some_unknown_numbers).png (all png) now i want run them thru function in loop and want out put like /markedimage/images_1.png images_2.png images_3.png i need help how can i run them in loop and how out put name can change want run script on Ubuntu so we can use shell too if any body want check function it is here http://paste2.org/p/789149 plz provide me code because i m newbie thanks in advance

    Read the article

  • Noob Question: Wordpress Looping

    - by dclowd9901
    Can someone give me an essential Wordpress Loop and explain to me what's happening with it? I'd like to put together some templates, but I don't do well with blackboxing. In other words, I'm fully capable of writing my own CMS, but when it comes to using someone else's and its arbitrary rules, I'm completely at a loss, and I just can't get my head around the standard loop Wordpress uses. Thanks for your patient guidance.

    Read the article

  • jquery noob problem with variables (scope?)

    - by aharon
    I'm trying to retrieve data from a php file named return that just contains <?php echo 'here is a string'; ?> I'm doing this through an html file containing <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-latest.min.js"></script> <script> var x; $.get("return.php", function(data){ x = data; }) function showAlert() {alert(x);} $(document).ready(function(){ alert(x); }); </script> </head> <body> <input type = "button" value = "Click here" onClick="showAlert();"> </body> </html> When the button is clicked it retrieves and displays the code fine, but on the $(document).ready thing, it displays "undefined" instead of the data in return.php. Any solutions? Thanks.

    Read the article

  • Hibernate noob fetch join problem

    - by Bruce
    Hi all I have two classes, Test2 and Test3. Test2 has an attribute test3 that is an instance of Test3. In other words, I have a unidirectional OneToOne association, with test2 having a reference to test3. When I select Test2 from the db, I can see that a separate select is being made to get the details of the associated test3 class. This is the famous 1+N selects problem. To fix this to use a single select, I am trying to use the fetch=join annotation, which I understand to be @Fetch(FetchMode.JOIN) However, with fetch set to join, I still see separate selects. Here are the relevant portions of my setup.. hibernate.cfg.xml: <property name="max_fetch_depth">2</property> Test2: public class Test2 { @OneToOne (cascade=CascadeType.ALL , fetch=FetchType.EAGER) @JoinColumn (name="test3_id") @Fetch(FetchMode.JOIN) public Test3 getTest3() { return test3; } NB I set the FetchType to EAGER out of desperation, even though it defaults to EAGER anyway for OneToOne mappings, but it made no difference. Thanks for any help! Edit: I've pretty much given up on trying to use FetchMode.JOIN - can anyone confirm that they have got it to work ie produce a left outer join? In the docs I see that "Usually, the mapping document is not used to customize fetching. Instead, we keep the default behavior, and override it for a particular transaction, using left join fetch in HQL" If I do a left join fetch instead: query = session.createQuery("from Test2 t2 left join fetch t2.test3"); then I do indeed get the results I want - ie a left outer join in the query.

    Read the article

  • Super Noob C++ variable help

    - by julian
    Ok, I must preface this by stating that I know so so little about c++ and am hoping someone can just help me out... I have the below code: string GoogleMapControl::CreatePolyLine(RideItem *ride) { std::vector<RideFilePoint> intervalPoints; ostringstream oss; int cp; int intervalTime = 30; // 30 seconds int zone =ride->zoneRange(); if(zone >= 0) { cp = 300; // default cp to 300 watts } else { cp = ride->zones->getCP(zone); } foreach(RideFilePoint* rfp, ride->ride()->dataPoints()) { intervalPoints.push_back(*rfp); if((intervalPoints.back().secs - intervalPoints.front().secs) > intervalTime) { // find the avg power and color code it and create a polyline... AvgPower avgPower = for_each(intervalPoints.begin(), intervalPoints.end(), AvgPower()); // find the color QColor color = GetColor(cp,avgPower); // create the polyline CreateSubPolyLine(intervalPoints,oss,color); intervalPoints.clear(); intervalPoints.push_back(*rfp); } } return oss.str(); } void GoogleMapControl::CreateSubPolyLine(const std::vector<RideFilePoint> &points, std::ostringstream &oss, QColor color) { oss.precision(6); QString colorstr = color.name(); oss.setf(ios::fixed,ios::floatfield); oss << "var polyline = new GPolyline(["; BOOST_FOREACH(RideFilePoint rfp, points) { if (ceil(rfp.lat) != 180 && ceil(rfp.lon) != 180) { oss << "new GLatLng(" << rfp.lat << "," << rfp.lon << ")," << endl; } } oss << "],\"" << colorstr.toStdString() << "\",4);"; oss << "GEvent.addListener(polyline, 'mouseover', function() {" << endl << "var tooltip_text = 'Avg watts:" << avgPower <<" <br> Avg Speed: <br> Color: "<< colorstr.toStdString() <<"';" << endl << "var ss={'weight':8};" << endl << "this.setStrokeStyle(ss);" << endl << "this.overlay = new MapTooltip(this,tooltip_text);" << endl << "map.addOverlay(this.overlay);" << endl << "});" << endl << "GEvent.addListener(polyline, 'mouseout', function() {" << endl << "map.removeOverlay(this.overlay);" << endl << "var ss={'weight':5};" << endl << "this.setStrokeStyle(ss);" << endl << "});" << endl; oss << "map.addOverlay (polyline);" << endl; } And I'm trying to get the avgPower from this part: AvgPower avgPower = for_each(intervalPoints.begin(), intervalPoints.end(), AvgPower()); the first part to cary over to the second part: << "var tooltip_text = 'Avg watts:" << avgPower <<" <br> Avg Speed: <br> Color: "<< colorstr.toStdString() <<"';" << endl But of course I haven't the slightest clue how to do it... anyone feeling generous today? Thanks in advance

    Read the article

  • Noob Droid Question regarding random number

    - by Pete Herbert Penito
    Brand new to droid programming, but would love to learn as much as possible, so I finally got my emulator working correctly, I even got a hello world button to work, I'm attempting to make this button display a random number, I've googled this and came up with this code: Random generator = new Random(); int n = generator.nextInt(n); I fixed the Random function by including some Random java utility. I'm assuming this code above goes in the .java file of the project, so my button code looks as follows (tested and works): PopUpText.makeText(v.getContext(), "Hello World", PopUpText.LENGTH_LONG).show(); I figured I could replace "Hello World" with n to display the number in the box, however the following error is stopping the compile: The local variable n may not have been initialized Any ideas why this is happening? Any advice would be hugely appreciated.

    Read the article

  • Flex noob questions

    - by Jerry
    Hi all I was wondering how to copy files (like my images files) into my flex 4 src folder from windows explorer. There is no such folder called src when I look at my project folder. Thanks.

    Read the article

  • C#- Console Program Ideas for Noob

    - by user335932
    So, Im a beginning C# programmer. I know basic syntax and simple things like if statements and loops(methods and classes too). I've only used console apps right now havent bothered with windows forms yet. So any simple app ideas that introduce new things important for C# programming. Also, NO tutorials. I want to make all by myself.

    Read the article

  • relative path issue (noob)

    - by tim roberts
    I am using the following code to check existence of a file before publishing an image in my erb file. <% @imagename = @place.name + ".jpg" %> <% if FileTest.exist?( "/Users/Tim/projects/game/public/" + @imagename ) %> <p><img src= '<%= @imagename %>' width="400" height="300" /> </p> <% end %> And when I publish this to Heroku, it obviously wont work. I tried using a relative path, but not able to get it to work. <% if FileTest.exist?( "/" + @imagename ) % any help appreciated.

    Read the article

  • noob iPhone "count" frustrations!?!?!

    - by codemonkey
    Okay, I know I must be doing something incredibly stupid here. Here's the sample code (which, when executed within a viewDidLoad block silently crashes... no error output to debug console). NSMutableArray *bs = [NSMutableArray arrayWithCapacity:10]; [bs addObject:[NSNumber numberWithInteger: 2]]; NSLog(@"%@", [bs count]); [bs release]; What am I missing? Oh... and in case anyone is wondering, this code is just me trying to figure out why I can't get the count of an NSMutableArray that actually matters somewhere else in the program.

    Read the article

  • Multi table Triggers ms sql noob

    - by Chin
    I have a load of tables all with the same 2 datetime columns (lastModDate, dateAdded). I am wondering if I can set up global Insert Update trigger for these tables to set the datetime values. Or if not, what approaches are there? Any pointers much appreciated

    Read the article

  • jQuery noob: transfer not transferring..

    - by Kyle Sevenoaks
    I made an example, I copied it straight from the jQuery website yet, it doesn't transfer.. HTML: <div class="addToCart"> BLAHHHH </div> <br> <br> <br> <br> <div class="handelv"> MORE BLAAAHH </div>? jQuery: $(document).ready(function() { $(".addToCart").click(function () { var i = 1 - $(".addToCart").index(this); $(this).effect("transfer", { to: $(".handelv").eq(i) }, 1000); }); });? What have I gotten wrong?

    Read the article

  • Am I writing this right? [noob]

    - by Aaron
    private final int NUM_SOUND_FILES = 4; private Random rnd = new Random(4); private int mfile[] = new mfile[NUM_SOUND_FILES]; //the second mfile //reports error everytime mfile[0] = R.raw.sound1; mfile[1] = R.raw.sound2; mfile[2] = R.raw.sound3; mfile[3] = R.raw.sound4; int sndToPlay = rnd.nextInt(NUM_SOUND_FILES); I keep getting syntax errors no matter how I write it. And when I get the syntax right, it forcecloses. Here's with the alleged "correct" syntax but forcecloses: private final int NUM_SOUND_FILES = 4; private Random rnd = new Random(4); private int mfile[] = new int[NUM_SOUND_FILES];{ mfile[0] = R.raw.sound1; mfile[1] = R.raw.sound2; mfile[2] = R.raw.sound3; mfile[3] = R.raw.sound4;}

    Read the article

  • Noob Capistrano question on preserving upload directories

    - by jaycode
    Hi all, In response to this blog post: http://www.simonecarletti.com/blog/2009/02/capistrano-uploads-folder/ I have three questions: Can anyone confirm if the recipe there works? Where and how do I put that recipe? I have two folders to be retained: /products and /public/images what do I need to change in the recipe? Thank you

    Read the article

  • Multi table Triggers SQL Server noob

    - by Chin
    I have a load of tables all with the same 2 datetime columns (lastModDate, dateAdded). I am wondering if I can set up global Insert Update trigger for these tables to set the datetime values. Or if not, what approaches are there? Any pointers much appreciated

    Read the article

  • Noob tab widget example not running

    - by michbeck
    hey all, i'm trying to reproduce the tabwidget example (http://developer.android.com/resources/tutorials/views/hello-tabwidget.html). i'm not really sure what's the problem, i've git no errors while compiling, but i cannot see the application on emulators screen :-/ would be excellent if maybe anyone could have a look at my classes and tell me what's my mistake? I've packed my project here: http://etanto.com/TabTest.zip thanx a lot in advance, folks! michbeck here's the console dump while the run: [2010-06-10 09:18:34 - TabTest] Launching a new emulator with Virtual Device 'Virtual1' [2010-06-10 09:18:35 - TabTest] New emulator found: emulator-5554 [2010-06-10 09:18:35 - TabTest] Waiting for HOME ('android.process.acore') to be launched... [2010-06-10 09:19:05 - TabTest] WARNING: Application does not specify an API level requirement! [2010-06-10 09:19:05 - TabTest] Device API version is 8 (Android 2.2) [2010-06-10 09:19:05 - TabTest] HOME is up on device 'emulator-5554' [2010-06-10 09:19:05 - TabTest] Uploading TabTest.apk onto device 'emulator-5554' [2010-06-10 09:19:05 - TabTest] Installing TabTest.apk... [2010-06-10 09:19:22 - TabTest] Success! [2010-06-10 09:19:22 - TabTest] \TabTest\bin\TabTest.apk installed on device [2010-06-10 09:19:22 - TabTest] Done!

    Read the article

  • Please help me understand this PHP script.Noob here

    - by NissGTR
    I'm learning PHP,MySQL and came across this function today function get_director($director_id) { global $db; $query = 'SELECT people_fullname FROM people WHERE people_id = ' . $director_id; $result = mysql_query($query, $db) or die(mysql_error($db)); $row = mysql_fetch_assoc($result); extract($row); return $people_fullname; } I understand what functions are and I've created a few while learning PHP.But this one is a bit more complicated.I can't understand the WHERE people_id = ' . $director_id I'm new to MySQL.I guess the single quote ends the MySQL statement?And then it is concatenated with the argument? Please help me out.

    Read the article

  • Noob question about hibernate criteria

    - by Dimitri
    Hello, I have a class called User which has 2 properties : login/password. I am trying to authenticate a user in my application using hibernate criteria but my request doesn't work. [EDIT] The returned value is NULL. I have two users in my database for testing. Here is my code : @Override public User authenticate(String login, String password) throws NullPointerException { Session session = this.getSession(); User user = (User) session .createCriteria(User.class) .add( Restrictions.and( Property.forName("login").eq(login), Property.forName("password").eq(password) )).uniqueResult(); if (user == null){ throw new NullPointerException("User not found"); } return user; } Can someone tells me what is wrong with my code? Happy new Year 2011 !!

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >