Search Results

Search found 1332 results on 54 pages for 'rob chartier'.

Page 30/54 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Setting UITableViewCell button image values during scrolling

    - by Rob
    I am having an issue where I am trying to save whether a repeat image will show selected or not (it is created as a UIButton on a UITableViewCell created in IB). The issue is that since the cell gets re-used randomly, the image gets reset or set somewhere else after you start scrolling. I've looked all over and the advice was to setup an NSMutableArray to store the button's selection state and I am doing that in an array called checkRepeatState My question is: where do I put the if-then-else statement in the code to where it will actually change the button image based on if the checkRepeatState is set to 0 or 1 for the given cell that is coming back into view? Right now, the if-then-else statement I am using has absolutely no effect on the button image when it comes into view. I'm very confused at this point. Thank you ahead of time for any insight you can give!!! My code is as follows: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { // set up the cell static NSString *CellIdentifier = @"PlayerCell"; PlayerCell *cell = (PlayerCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (!cell) { [[NSBundle mainBundle] loadNibNamed:@"PlayerNibCells" owner:self options:nil]; cell = tmpCell; self.tmpCell = nil; NSLog(@"Creating a new cell"); } // Display dark and light background in alternate rows -- see tableView:willDisplayCell:forRowAtIndexPath:. cell.useDarkBackground = (indexPath.row % 2 == 0); // Configure the data for the cell. NSDictionary *dataItem = [soundCategories objectAtIndex:indexPath.row]; UILabel *label; label = (UILabel *)[cell viewWithTag:1]; label.text = [dataItem objectForKey:@"AnimalName"]; label = (UILabel *)[cell viewWithTag:2]; label.text = [dataItem objectForKey:@"Description"]; UIImageView *img; img = (UIImageView *)[cell viewWithTag:3]; img.image = [UIImage imageNamed:[dataItem objectForKey:@"Icon"]]; NSInteger row = indexPath.row; NSNumber *checkValue = [checkRepeatState objectAtIndex:row]; NSLog(@"checkValue is %d", [checkValue intValue]); // Reusing cell; make sure it has correct image based on checkRepeatState value UIButton *repeatbutton = (UIButton *)[cell viewWithTag:4]; if ([checkValue intValue] == 1) { NSLog(@"repeatbutton is selected"); [repeatbutton setImage:[UIImage imageNamed:@"repeatselected.png"] forState:UIControlStateSelected]; [repeatbutton setNeedsDisplay]; } else { NSLog(@"repeatbutton is NOT selected"); [repeatbutton setImage:[UIImage imageNamed:@"repeat.png"] forState:UIControlStateNormal]; [repeatbutton setNeedsDisplay]; } cell.accessoryType = UITableViewCellAccessoryNone; return cell; }

    Read the article

  • Custom drop down

    - by Rob
    I'm trying to create a custom drop down and using the code below it works pretty well - only one problem is if i have more than one drop down, all the links will only activate the first drop down. Any ideas on how I would fix that? (and yes I know about Suckerfish I just need to get this to work) function toggle() { var ele = document.getElementById("dropdown-items"); var text = document.getElementById("dropdown-menu"); if(ele.style.display == "block") { ele.style.display = "none"; } else { ele.style.display = "block"; } }

    Read the article

  • Why do C# automatic properties not support default values like VB 2010?

    - by Rob van Groenewoud
    Looking at the new VB 2010 features, I stumbled upon support for Auto-Implemented Properties. Since I'm working with C#, this seemed quite familiar, but I noticed that VB did add a feature I would love to have in C#: setting a arbitrary default value for the auto-implemented property: I really like the clean usage of auto-properties in C#. This would save us the effort of introducing a backing field and hooking it up to the property everytime we simply need a default value, thereby cluttering up the code unnecessarily. I was wondering why this wasn't introduced in C# as well? What could be the rationale for not doing this? Is a syntax discussion going on, or are there technical limitations to implementing this?

    Read the article

  • PHP Bz2 extension question

    - by Rob
    Hi, I wanted to ask: when I am using php.net/bzopen, does I need to bzwrite() already compressed by bzcompress() string or it being compressed automatically while writing?

    Read the article

  • VS2010 always relinks the project

    - by Rob Walker
    I am migrating a complex mixed C++/.NET solution from VS2008 to VS2010. The upgraded solution works in VS2010, but the build system is always refereshing one C++/CLI assembly. It doesn't recompile anything, but the linker touches the file. The causes a ripple effect downstream in the build as a whole bunch of dependent then get rebuilt. Any ideas on how to find out why it thinks it needs to relink the file? I've turned on verbose build logging, but nothing stands out.

    Read the article

  • jQuery error when aborting an ajax call only in Internet Explorer

    - by Rob Crowell
    When mousing over an image in a jcarousel, my site displays a popup whose contents are loaded via ajax. I'm doing what I thought was fairly straightforward; keeping a handle to the xhrRequest object, and aborting the existing one before making a new request. It works great in all browsers except IE, where I receive an error "Object doesn't support this property or method" Here's the code that is triggering it: function showPopup { // ... code snipped ... // cancel the existing xhr request if (showPopup.xhrRequest != null) { showPopup.xhrRequest.abort(); showPopup.xhrRequest = null; } showPopup.xhrRequest = $.ajax({url: url, type: "GET", success:function(data) { $("#popup-content").html(data); } }); // ... code snipped ... } showPopup.xhrRequest = null; Works great in Firefox and Chrome. I traced the error down to this bit of code in jquery.js inside the ajax function (line 5233 in my copy of jQuery): // Override the abort handler, if we can (IE doesn't allow it, but that's OK) // Opera doesn't fire onreadystatechange at all on abort try { var oldAbort = xhr.abort; xhr.abort = function() { if (xhr ) { oldAbort.call( xhr ); } onreadystatechange( "abort" ); } catch(e) { } The specific error occurs on the oldAbort.call( xhr ) line. Any ideas?

    Read the article

  • How to pull data from a MySQL column and put it into a single array

    - by Rob
    Basically, this is what I currently use in an included file: $sites[0]['url'] = "http://example0.com"; $sites[1]['url'] = "http://example1.com"; $sites[2]['url'] = "http://example2.com"; $sites[3]['url'] = "http://example3.com"; $sites[4]['url'] = "http://example4.com"; $sites[5]['url'] = "http://example5.com"; And so I output it like so: foreach($sites as $s) But I want to make it easier to manage via a MySQL database. So my question is, how can I make it automatically add additional "$sites[x]['url'] = "http://examplex.com";" and output it appropriately from my MySQL table?

    Read the article

  • HTML/Javascript change div content

    - by Rob
    HI, I have simple HTML code with some javascript, it looks like: <html> <head><script type="text/javascript">...</script></head> <body> <input type="radio" name="radiobutton" value="A" onClick="changeDivContent()"> <input type="radio" name="radiobutton" value="B" onClick="changeDivContent()"> <div id="content"></div> </body> </html> I just wanted to be able change div's content (it's inner html) with selecting one of "A" or "B" radio buttons, but div#content does not have javascript attribute "value", so I am asking how it can be done. Thank you!

    Read the article

  • Alternative to Microsoft Agent / Fix for color issue?

    - by Rob P.
    I've got an app that does Text-To-Speech; but I wanted to show an animated face/character to go with it. I found a tutorial on Microsoft Agent and I implemented it in my vb.net app. The problem is with the transparency color. Unless I run application in compatibility mode/256 colors, the characters will appear with a purplish-pink background image instead of a transparent back-color. But running the app in 256 colors the rest of the app looks awfully out of place. First - is there something that works similar to MS Agent I can use that would be more appropriate? Second - if I'm still MS Agent - can I get the transparent color to work correctly without limiting myself to 256 colors?

    Read the article

  • xval get message from resource file

    - by Rob
    I'm working on a CMS system which uses a resource file to get information and errormessages from. The client side validation is working without problems, only it's not getting the errormessage from the resource file. While debugging i figured out xval seems to get the errormessages from a javascript file where the messages are set hard-coded. Is there some way to override this? Below the code which should make the relation to the resourcefile en specify the error when the field is left empty. [Property] [Required(ErrorMessageResourceType = typeof(CMSMessages), ErrorMessageResourceName = "EnterValidMoney")] public virtual Double ShippingCost { get; set; }

    Read the article

  • Is there an OData Server Library for Java or PHP to EXPOSE OData?

    - by Rob
    Hi, I am wondering if there is or why there isn't a ADO.NET Data Services Server Library for Java? I need to expose a database from a Java Server but i only see Microsot providing clients for java not server parts. How is that an open standard when you need .NET/Windows to expose it? Thanks for any pointers to that. Same interesting for PHP as well.

    Read the article

  • ASP.NET UpdatePanel > Get selected value from checbox list outside of panel

    - by Rob
    Hi, I have a listing in an UpdatePanel I have some filters for that list in the form a checkboxList control. The checkboxList is created dynamically on page load During the Ajax update (postback), the checkbox list is not populated form the viewstate, so I cannot get the listing to filter. Note: If I put the checkbox list items directly in the markup, it all works, just not if the listing is populated on-postback. protected override void OnLoad(EventArgs e) { if (!Page.IsPostBack) { foreach (var p in global.Product) CheckListManufacurer.Items.Add(new ListItem(p, p)); } base.OnLoad(e); } <form id="ProductListForm" runat="server"> <asp:ScriptManager ID="ScriptManager" runat="server" EnablePartialRendering="true"></asp:ScriptManager> <asp:CheckBoxList ID="CheckListManufacurer" runat="server" EnableViewState="true"> <asp:ListItem Value="" Text="(All)"></asp:ListItem> </asp:CheckBoxList> <asp:Button id="btnTestAjax" runat="server" Text="Test" /> <asp:UpdatePanel ID="ProductsPanel" runat="server" UpdateMode="Conditional"> <Triggers> <asp:AsyncPostBackTrigger ControlID="btnTestAjax" /> <asp:AsyncPostBackTrigger ControlID="CheckListManufacurer" /> </Triggers> <ContentTemplate> <sr:ProductList ID="Products" runat="server" /> </ContentTemplate> </asp:UpdatePanel> </form>

    Read the article

  • CSS opacity and child elements

    - by Rob
    <style type="text/css"> div#foo { background: #0000ff; width: 200px; height: 200px; opacity: 0.30; filter: alpha(opacity = 30); } div#foo>div { color: black; opacity:1; filter: alpha(opacity = 100); } </style> <div id="foo"> <div>Lorem</div> <div>ipsum</div> <div>dolor</div> </div> In the above example, the opacity of div#foo is inherited by child elements, causing the text to become nearly unreadable. I suppose it's wrong to say it is inherited, the opacity is applied to the parent div and the children are part of that, so attempting to override it for the child elements doesn't work because technically they are opaque. I typically just use an alpha png background image in such cases, but today i'm wondering if there's a better way to make a background of a div semi-transparent without affecting the contents.

    Read the article

  • C# compiler error CS0006: metadata file is not found

    - by Rob
    I've built a c# compiler using the tutorial on MSDN and a few other resources including here, and I've gotten it to work until I add additional reference assemblies. My errors stem from adding "System.dll" and "System.Windows.Forms.dll" to the ReferenceAssemblies list. here's my code: private void SetUpCompilingParameters() { string ver = string.Format("{0}.{1}.{2}", Environment.Version.Major, Environment.Version.MajorRevision, Environment.Version.Build); string libDir = string.Format(@"{0}", Environment.CurrentDirectory); string raDir = @"C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0"; string exWpfDir = string.Format(@"C:\WINDOWS\Microsoft.NET\Framework\v{0}\WPF", ver); string exDir = string.Format(@"C:\WINDOWS\Microsoft.NET\Framework\v{0}", ver); MyCompiler = new CSharpCodeProvider(); CompilingParam = new CompilerParameters(); CompilingParam.GenerateExecutable = false; CompilingParam.GenerateInMemory = true; CompilingParam.IncludeDebugInformation = false; CompilingParam.TreatWarningsAsErrors = false; CompilingParam.CompilerOptions = string.Format("/lib:{0}", libDir); CompilingParam.CompilerOptions = string.Format("/lib:{0}", raDir); CompilingParam.CompilerOptions = string.Format("/lib:{0}", exDir); //CompilingParam.CompilerOptions = string.Format("/lib:{0}", exWpfDir); CompilingParam.ReferencedAssemblies.Add("System.dll"); CompilingParam.ReferencedAssemblies.Add("System.Windows.Forms.dll"); } As you can see, I've explicitly referenced directories in CompilerOptions but its not helping. I'd like to test the solution on here on stackoverflow that utilizes: CompilingParam.ReferencedAssemblies.Add(typeof(System.Xml.Linq.Extensions).Assembly.Location); but I'm having trouble using it for the general System.dll etc...

    Read the article

  • UIPickerView issues - iphone

    - by Rob J
    I have the following: - (NSInteger) numberOfComponentsInPickerView:(UIPickerView *)pickerView { return 2; } - (NSInteger) pickerView:(UIPickerView *) pickerView numberOfRowsInComponent:(NSInteger) component { return [genderPickerData count]; return [agePickerData count]; } When I do this, the UIPicker is split into 2 components, but the PickerData is only being represented for gender on both pickers. I am trying to figure out through Apple's confusing documentation on how I reference each individual component but can't seem to figure it out.

    Read the article

  • Django Image Upload: IOErrno2 Could not find path -- and yet it's saving the image there anyway?

    - by Rob
    I have an issue where the local version of django is handling image upload as expected but my server is not. Note: I am using a Django Container on MediaTemple.net (grid server) Here is my code. def view_settings(request): <snip> if request.POST: success_msgs = () mForm = MainProfileForm(request.POST, request.FILES, instance = mProfile) pForm = ChangePasswordForm(request.POST) eForm = ChangeEmailForm(request.POST) if mForm.is_valid(): m = mForm.save(commit = False) if mForm.cleaned_data['avatar']: m.avatar = upload_photo(request.FILES['avatar'], settings.AVATAR_SAVE_LOCATION) m.save() success_msgs += ('profile pictured updated',) <snip> def upload_photo(data,saveLocation): savePath = os.path.join(settings.MEDIA_ROOT, saveLocation, data.name) destination = open(savePath, 'wb+') for chunk in data.chunks(): destination.write(chunk) destination.close() return os.path.join(saveLocation, data.name) Here's where it gets whacky and I was hoping someone could shed a light on this error, because either a) it's the wrong error code, or b) something is happening with the file before it's completely handled. To recap, the file was actually uploaded to the server in the intended directory - and yet this err msg continues to persist. IOError at /user/settings [Errno 2] No such file or directory: u'/home/user66666/domains/example.com/html/media/images/avatars/DSC03852.JPG' Environment: Request Method: POST Request URL: http://111.111.111.111:2011/user/settings Django Version: 1.0.2 final Python Version: 2.4.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'ctrlme', 'usertools', 'easy_thumbnails'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "/home/user6666/containers/django/leonidas/usertools/views.py" in view_settings m.avatar = upload_photo(request.FILES['avatar'], settings.AVATAR_SAVE_LOCATION) File "/home/user666666/containers/django/leonidas/usertools/functions.py" in upload_photo destination = open(savePath, 'wb+')

    Read the article

  • iphone not displaying array variables correctly

    - by Rob
    I was reading a tutorial on how to do a UIPicker and found this code: - (IBAction)buttonPressed { NSInteger row = [userPicker selectedRowInComponent:0]; NSString *selected = [userPickerData objectAtIndex:row]; NSString *title = [[NSString alloc] initWithFormat:@"You selected %a", selected]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:title message:@"Thank you for Choosing." delegate:nil cancelButtonTitle:@"You're Welcome" otherButtonTitles:nil]; [alert show]; [alert release]; [title release]; } - (void)viewDidLoad { // [super viewDidLoad]; NSArray *array = [[NSArray alloc] initWithObjects:@"New", @"Frank", @"Bob", @"Thor", nil]; self.userPickerData = array; [array release]; } The UIPicker displays correctly and the variables in the picker also display correctly. When the button is pressed then the alert message does come up but it says, "You selected.." and then it's a bunch of gibberish. Why aren't the array variables being passed correctly?

    Read the article

  • PostgreSQL - Error: SQL state: XX000.

    - by rob
    I have a table in Postgres that looks like this: CREATE TABLE "Population" ( "Id" bigint NOT NULL DEFAULT nextval('"population_Id_seq"'::regclass), "Name" character varying(255) NOT NULL, "Description" character varying(1024), "IsVisible" boolean NOT NULL CONSTRAINT "pk_Population" PRIMARY KEY ("Id") ) WITH ( OIDS=FALSE ); And a select function that looks like this: CREATE OR REPLACE FUNCTION "Population_SelectAll"() RETURNS SETOF "Population" AS $BODY$select "Id", "Name", "Description", "IsVisible" from "Population"; $BODY$ LANGUAGE 'sql' STABLE COST 100 Calling the select function returns all the rows in the table as expected. I have a need to add a couple of columns to the table (both of which are foreign keys to other tables in the database). This gives me a new table def as follows: CREATE TABLE "Population" ( "Id" bigint NOT NULL DEFAULT nextval('"population_Id_seq"'::regclass), "Name" character varying(255) NOT NULL, "Description" character varying(1024), "IsVisible" boolean NOT NULL, "DefaultSpeciesId" bigint NOT NULL, "DefaultEcotypeId" bigint NOT NULL, CONSTRAINT "pk_Population" PRIMARY KEY ("Id"), CONSTRAINT "fk_Population_DefaultEcotypeId" FOREIGN KEY ("DefaultEcotypeId") REFERENCES "Ecotype" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT "fk_Population_DefaultSpeciesId" FOREIGN KEY ("DefaultSpeciesId") REFERENCES "Species" ("Id") MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION ) WITH ( OIDS=FALSE ); and function: CREATE OR REPLACE FUNCTION "Population_SelectAll"() RETURNS SETOF "Population" AS $BODY$select "Id", "Name", "Description", "IsVisible", "DefaultSpeciesId", "DefaultEcotypeId" from "Population"; $BODY$ LANGUAGE 'sql' STABLE COST 100 ROWS 1000; Calling the function after these changes results in the following error message: ERROR: could not find attribute 11 in subquery targetlist SQL state: XX000 What is causing this error and how do I fix it? I have tried to drop and recreate the columns and function - but the same error occurs. Platform is PostgreSQL 8.4 running on Windows Server. Thanks.

    Read the article

  • switch to mysqli a good idea?

    - by Rob
    I'm considering switching to mysqli for all my php projects. The way my code is written (I run very simple websites and built my own basic framework which I use across all of them) I shouldn't have too many problems modifying the functions and classes. However, i've only heard positive things about prepared statements, bar a few grumblings about the php functions available, most notably the lack of a simple replacement for using mysql_fetch_array in a while. This sounds a bit too good to be true, so I wondered if anyone could highlight some of the issues with using prepared statements, such as speed and resource usage.

    Read the article

  • Using ViewModels in ASP.NET MVC 2 - multiple forms

    - by Rob Ellis
    I couldn't find any documentation around using multiple forms in an ASP.NET MVC 2 ViewModel approach. i.e. In the built in application when you select New MVC2 web app, the register page uses a ViewPage which inherits like this:- Inherits="System.Web.Mvc.ViewPage" I wanted to use that approach on a page with multiple forms, but that RegisterModel only supported one form.

    Read the article

  • problem running system.net.webclient and process.start off a control event

    - by Rob
    The following code causes my vs 2008 wpf project to hang, I'm not sure why. Both Part 1 and Part 2 work perfectly fine independently, but when I run them together on an control event (click a button for example) the program hangs. I've also tried shell execute for part 2 - same results. However, this code when run within the form loaded event works fine. Any insights would be truly appreciated. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click 'Part 1 Dim myWebClient As System.Net.WebClient = New System.Net.WebClient Dim CurrentDataFileContents As String = myWebClient.DownloadString("http://www.xyz.com") myWebClient.Dispose() 'Part 2 System.Diagnostics.Process.Start("http://www.test.com") End Sub

    Read the article

  • Apache - Reverse Proxy and HTTP 302 status messsage

    - by Rob
    My team is trying to setup an Apache reverse proxy from a customer's site into one of our web applications. http://www.example.com/app1/some-path maps to http://internal1.example.com/some-path Inside our application we use struts and have redirect = true set on certain actions in order to provide certain functionality. The 302 status messages from these re-directs cause the user to break out of the proxy resulting in an error page for the end user. HTTP/1.1 302 Found Location: http://internal.example.com/some-path/redirect Is there any way to setup the reverse proxy in apache so that the redirects work correctly? http://www.example.com/app1/some-path/redirect

    Read the article

  • Do you have any tips for comments to keep them in step with the code? [closed]

    - by Rob Wells
    Possible Duplicate: How do you like your comments? G'day, I've read both of Steve McConnell's excellent Code Complete books "Code Complete" and "Code Complete 2" and was wondering if people have any other suggestions for commenting code. My commenting mantra could be summed up by the basic idea of expressing "what the code below cannot say". While enjoying this interesting blog post by Jeff about commenting I was still left wondering "When coding, when do you feel a comment is required?" Edit: Oops. Seems to be a duplicate of this question http://stackoverflow.com/questions/121945/how-do-you-like-your-comments so sorry for the noise. Thanks to my, seemingly, SO shadow for pointing it out - wouldn't have thought I was that interesting. Now off to read the original post and see if it is relevant. Edit: I meant to emphasise the best appraoch to ensure that your comments will stay in step with the code. Maybe expressing an intent rather than the mechansim for instance.

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >