Search Results

Search found 3299 results on 132 pages for 'mr cool'.

Page 26/132 | < Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >

  • Access custom label property at didSelectRowAtIndexPath.

    - by Mr. McPepperNuts
    I have a UILabel for each cell at cellForRowAtIndexPath. UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; I want to access that string "myString" at didSelectRowAtIndexPath using indexpath. NSString *anotherString = cell.textLabel.text; returns null. Now if at cellForRowAtIndexPath, I did something like cell.textLabel.text = theString; then the didSelectRowAtIndexPath returns the appropriate cell. My question is, how can I access the text in the UILabel I apply to the cell, at didSelectRowAtIndexPath? Also, logging the cell in didSelectRowAtIndexPath returns cell: <UITableViewCell: 0x5dcb9d0; frame = (0 44; 320 44); autoresize = W; layer = <CALayer: 0x5dbe670>> Edit: NSString *myString = [[results objectAtIndex:indexPath.row] valueForKey:@"name"]; //cell.textLabel.text = myString; CGFloat width = [UIScreen mainScreen].bounds.size.width - 50; CGFloat height = 20; CGRect frame = CGRectMake(10.0f, 10.0f, width, height); UILabel *cellLabel = [[UILabel alloc] initWithFrame:frame]; cellLabel.text = myString; cellLabel.textColor = [UIColor blackColor]; cellLabel.backgroundColor = [UIColor whiteColor]; cellLabel.textAlignment = UITextAlignmentLeft; cellLabel.font = [UIFont systemFontOfSize:14.0f]; [cell.contentView addSubview:cellLabel]; [cellLabel release]; return cell;

    Read the article

  • How to: WCF XML-RPC client?

    - by mr.b
    I have built my own little custom XML-RPC server, and since I'd like to keep things simple, on both server and client side, what I would like to accomplish is to create a simplest possible client (in C# preferably) using WCF. Let's say that Contract for service exposed via XML-RPC is as follows: [ServiceContract] public interface IContract { [OperationContract(Action="Ping")] string Ping(); // server returns back string "Pong" [OperationContract(Action="Echo")] string Echo(string message); // server echoes back whatever message is } So, there are two example methods, one without any arguments, and another with simple string argument, both returning strings (just for sake of example). Service is exposed via http. Aaand, what's next? :) P.S. I have tried googling around for samples and similar, but all that I could come up with are some blog-related samples that use existing (and very big/numerous) classes, which implement appropriate IContract (or IBlogger) interfaces, so that most of what I am interested is hidden below several layers of abstraction...

    Read the article

  • How to attach a sample grabber to the playcap sdk sample

    - by Mr Bell
    I want to get access to a webcam's frame image data so I can composite it with some other data. The playcap sample in the windows sdk directshow folder can show you a window streaming the webcam, but doesn't demonstrate access to the bytes. Someone mentioned that I could use a samplegrabber filter attached to a null rendered to gain access to the frame data. Unfortunately I haven't the first clue how to do this. How can I modify the playcap sample to attach a sample grabber and access the frame bytes? visual studio 2008 c++

    Read the article

  • Getting the first result from a LINQ query - why does ElementAt<T>(0) fails when First<T>() succeeds

    - by Mr Roys
    I have a method AddStudent() which looks for a student with the same name and returns an existing student from the database if there is a student with the same name, otherwise it creates a new student and adds it to the database. I'm curious why se = students.First<StudentEntity>(); succeeds when se = students.ElementAt<StudentEntity>(0); fails when I try to get the first result from the LINQ query. Aren't the two methods the same? The full code for the method is shown below. public Student AddStudent(string name) { using (SchoolEntities db = new SchoolEntities()) { // find student with same name via LINQ var students = from s in db.StudentEntitySet where s.name == name select s; StudentEntity se = default(StudentEntity); // if student with the same name is already present, return // that student if (students.Count<StudentEntity>() > 0) { // if i use ElementAt, if fails with a "LINQ to Entities does not // recognize the method 'StudentEntity ElementAt[StudentEntity] // (System.Linq.IQueryable`1[StudentEntity], Int32)' method, // and this method cannot be translated into a store expression.", // but not when I use First. Why? // se = students.ElementAt<StudentEntity>(0); se = students.First<StudentEntity>(); } else { // passing 0 for first parameter (id) since it's represented by // a BigInt IDENTITY field in the database so any value // doesn't matter. se = StudentEntity.CreateStudentEntity(0, name); db.AddToStudentEntitySet(se); db.SaveChanges(); } // create a Student object from the Entity object return new Student(se); } } Thanks!

    Read the article

  • Several appdomains calling the same unmanged dll

    - by Mr. T.
    Our .NET 3.5 C# application creates multiple appdomains. Each appdomain loads the same unmanaged 3rd party dll. This dll reads a configuration file upon initialization. If the configuration changes during runtime, the dll must be unloaded and loaded again. This dll is not in our scope to rewrite correctly. Does each appdomain have access to a separtate copy of this unmanaged dll, or does Windows keep one copy of the dll and maintain a usage count? If the latter is is the case, how do we get each instance of the unmanaged dll to reflect its unique configuration?

    Read the article

  • Goodbye my beloved Nexus One, hello Windows Phone 7

    - by George Clingerman
    Last night my wife’s Nexus One finally bit the dust. You may not know but I’ve been nursing her Nexus One one along for quite a while after her screen shattered. I was able to replace it on my own (go me!) but little quirks have been popping up and the phone was quickly deteriorating. Lately it’s been the power button. Wifey would often have to press the power button several times to get her phone to turn on and last night it just wouldn’t wake up again. I took it apart and tried my best to see if I could somehow make it live once again but no luck this time. It was finally ready to retire. We looked at first for a replacement phone for her but she wasn’t really seeing anything she liked. So I decided to make the ultimate sacrifice and offer up my much loved Nexus One and I would then get a new Windows Phone 7 device. I love T-Mobile for my service so my choices were immediately limited to basically just a single phone. The HTC HD7. I read reviews and they were all over the board from people loving to people hating the phone but I decided, hey, why not, let’s take this plunge. And I did. I’ve only had the phone for about two days now so below is my list of first reaction pros/cons. These are basically things I’ve missed or things I’ve noticed that I really like about my new Windows Phone. Cons: * No Google Talk – I used this a LOT on my Nexus. I’ve found an application called “Flory” but it’s just an ok substitute, not the same as the full featured GTalk I had on my Nexus. * Seesmic is limited– I loved the way Seesmic worked on my Nexus. It was my mobile twitter client of choice. Everything about it worked really well. On Windows Phone 7 it’s just ok. I don’t get notification of new tweets, it’s several clicks to even see a new tweet. It’s definitely got some more development before it has the same features as it did on my Nexus. * Buttons don’t give great feedback – I’d read this on the reviews about the HTC HD7 and I’m finding it true myself. Pressing the buttons on the side of the phone and the power button on the top is finicky and I have to be looking at my phone to make sure I actually got them to press. * Web browsing is slow – I’m not sure what’s up with this, I’m connected to my wireless network at my house but it’s noticeably slower on my WP7 device than my Nexus. I even switched back to verify and it’s definitely true. Retrieving tweets, hitting up the XNA forums and just general web activities are all much slower on my WP7. I can’t think of any reason this would be true but it almost seems like it’s not using my wireless for everything.   Pros: * It’s pretty – the phone is really gorgeous. I loved the form of my Nexus One by the HTC HD7 is just as pretty, maybe even prettier! It’s got a nice large, bright screen. It feels good in my hand. And it even has a little kickstand to set the phone up for movie watching. Definitely a gorgeous phone. * LIVE integration – I lost a lot of nice integration with Google services but I gained a lot of integration with LIVE services that I also use. Now I can see when I get new GMail messages AND Hotmail messages. And having the Xbox LIVE integration is admittedly cool as well. * Tile notification rock – The Windows Phone 7 commercials are TRYING to get this message out but they’re doing a really poor job of this. Tile notifications really do save you from your phone. I have a whole little mini-informational dashboard at a glance. I unlock my phone and at a glace I can see new IMs, new mail messages, software updates etc. All just letting me know in the tiles I have arranged. That’s pretty cool. * The interface works really well – I feel super hip and cool swiping and sliding things around on my Windows Phone 7. Everything works that way and it’s great and fast and really good looking. I’m all about me feeling cool. * I’m gaming more – I had gotten a few games on my Nexus One but there really weren’t a lot of good developers flocking to the service. Just browsing through the Windows Phone 7 marketplace I’m already seeing a ton of games I want to try and buy. And I sat down and bet Pixel Man 0 just yesterday on my phone. I’m already gaming more than I did on my Nexus One. * Netflix integration is fantastic - It works just like it does on my Xbox 360 and I love having this feature on my phone. * It’s basically a Zune – I’ve been taking my Zune to work and listening to music off of that while I code. I no longer need to take it with me, now I just sync songs onto my phone and it’s my new Zune. I freaking love that. One less device to carry around.   All in all my cons have really little to do with the phone (just the buttons and the web browsing) and more to do with the applications needing to catch up a bit to what I’m used to. And the Pros are things that ARE phone specific so I’m seeing that as a good sign that I’m going to be very happy with my Windows Phone 7. So Wifey is happy having her Nexus One again, I’m happy with my new Windows Phone 7. Life is good. Now I just need to make a game to pay for it….

    Read the article

  • .net difference between right shift and left shift keys

    - by Mr AH
    I am currently working on an application which requires different behaviour based on whether the user presses the right or left shift key (RShiftKey, LShiftKey), however when either of these keys is pressed I only see ShiftKey | Shift. Is there something wrong with my keyboard? (laptop) do I need a new keyboard driver/keyboard in order to send the different key commands maybe... This is a pretty massive problem at the moment, as there is no way of testing that the code works (apart from unit tests). Anyone had any experience of the different shift/alt/ctrl keys?

    Read the article

  • How to implement "circular side-scrolling" in my game?

    - by Mr.Gando
    I'm developing a game, a big part of this game, is about scrolling a "circular" background ( the right end of the Background Image can connect with the left start of the Background image ). Should be something like this: ( Entity moving and arrow to show where the background should start to repeat ) This happens in order to allow to have an Entity walking, and the background repeating itself over and over again. I'm not working with tile-maps, the background is a simple Texture (400x300 px). Could anyone point me to a link , or tell me the best way I could accomplish this ? Thanks a lot.

    Read the article

  • Adjust size of MPMediaPickerController's view ?

    - by Mr.Gando
    In my application I don't use the upper bar that displays Wi-Fi/Date/Time because it's a game. However I need to be able to let my user to pick his music, so I'm using a MPMediaPickerController. The problem is, that when I present my controller, the controller ends up leaving a 10 pixels ( aprox ) bar at the top of the screen, just in the place the Wi-Fi/Date/Time bar, should be present. Is there a way I could make my MPMediaPickerController bigger ? or to be presented upper in the screen ? // Configures and displays the media item picker. - (void) showMediaPicker: (id) sender { MPMediaPickerController *picker = [[MPMediaPickerController alloc] initWithMediaTypes: MPMediaTypeAnyAudio]; [[picker view] setFrame:CGRectMake(0, 0, 320, 480)]; picker.delegate = self; picker.allowsPickingMultipleItems = YES; picker.prompt = NSLocalizedString (@"AddSongsPrompt", @"Prompt to user to choose some songs to play"); [self presentModalViewController:picker animated: YES]; [picker release]; } There I tried to set the size to 320x480 but no luck, the picker is still presented and leaves a space in the upper part of the screen, could anyone help me ? Btw, here's how it looks: I have asked a bit, and people told me this could indeed be a bug, what do you guys think ?

    Read the article

  • Can I split system.serviceModel into a separate .config file?

    - by Mr Bell
    I want to separate my system.serviceModel section of the web.config into a separate file to facilitate some environment settings. My efforts have been fruitless. When I attempt it using this method. The wcf code throws an exception: "The type initializer for 'System.ServiceModel.ClientBase 1 threw an exception. Can anyone tell me what I am doing wrong? Web.config: <configuration> <system.serviceModel configSource="MyWCF.config" /> .... MyWCF.config: <system.serviceModel> <extensions> ... </extensions> <bindings> ... </bindings> <behaviors> ... </behaviors> <client> ... </client> </system.serviceModel>

    Read the article

  • How should Application.Run() be called for the main presenter of a MVP WinForms app?

    - by Mr Roys
    I'm learning to apply MVP to a simple WinForms app (only one form) in C# and encountered an issue while creating the main presenter in static void Main(). Is it a good idea to expose a View from the Presenter in order to supply it as a parameter to Application.Run()? Currently, I've implemented an approach which allows me to not expose the View as a property of Presenter: static void Main() { IView view = new View(); Model model = new Model(); Presenter presenter = new Presenter(view, model); presenter.Start(); Application.Run(); } The Start and Stop methods in Presenter: public void Start() { view.Start(); } public void Stop() { view.Stop(); } The Start and Stop methods in View (a Windows Form): public void Start() { this.Show(); } public void Stop() { // only way to close a message loop called // via Application.Run(); without a Form parameter Application.Exit(); } The Application.Exit() call seems like an inelegant way to close the Form (and the application). The other alternative would be to expose the View as a public property of the Presenter in order to call Application.Run() with a Form parameter. static void Main() { IView view = new View(); Model model = new Model(); Presenter presenter = new Presenter(view, model); Application.Run(presenter.View); } The Start and Stop methods in Presenter remain the same. An additional property is added to return the View as a Form: public void Start() { view.Start(); } public void Stop() { view.Stop(); } // New property to return view as a Form for Application.Run(Form form); public System.Windows.Form View { get { return view as Form(); } } The Start and Stop methods in View (a Windows Form) would then be written as below: public void Start() { this.Show(); } public void Stop() { this.Close(); } Could anyone suggest which is the better approach and why? Or there even better ways to resolve this issue?

    Read the article

  • using sqlite3 with lua

    - by mr calendar
    I'm trying to use sqlite3 with lua (am already using c++, but I'm a n00b with lua- I read this) but I'm getting the following when trying to build the library or whatever: C:\lib\lsqlite3-7>mingw32-make process_begin: CreateProcess(NULL, pkg-config --version, ...) failed. makefile:53: *** windows32. Stop. I'm not at all surprised at a makefile failing but I can't do them (is it spaces or tabs? where is it they have to go?), I would have thought there was a binary for windows? Any simple answers appreciated. I haven't got the time to learn make or install cygwin or whatever.

    Read the article

  • How do I set a VB.Net ComboBox default value

    - by Mr Ed
    I can not locate the correct method to make the first item in a combo box visible. The app starts with an empty combo box. The user makes a radio box selection then clicks Go! (how original). The combo box is loaded via an LDAP query. All this is working just fine. The problem is the combo box still appears to the user to be empty. They must click the arrow to see the options. How do I make the first option 'visible' after the users clicks Go!? I thought it would be simple... Thanks, Ed

    Read the article

  • Change bgcolor param value on mouse over?

    - by mr.matthewdavis
    I have a .SWF email submit form. The background color is set via: `<param name="bgcolor" value="#000000" />` and in the embed: `<embed src="FILE.swf" flashvars="STUFF" quality="high" **bgcolor="#000000"** width="260" height="32" name="WidgetMailBlack" align="middle" swLiveConnect="true" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />` Is it possible either on mouse over of the Object or a containing div to change those values? i.e. to #ffffff many thanks!

    Read the article

  • .NET: Avoidance of custom exceptions by utilising existing types, but which?

    - by Mr. Disappointment
    Consider the following code (ASP.NET/C#): private void Application_Start(object sender, EventArgs e) { if (!SetupHelper.SetUp()) { throw new ShitHitFanException(); } } I've never been too hesitant to simply roll my own exception type, basically because I have found (bad practice, or not) that mostly a reasonable descriptive type name gives us enough as developers to go by in order to know what happened and why something might have happened. Sometimes the existing .NET exception types even accommodate these needs - regardless of the message. In this particular scenario, for demonstration purposes only, the application should die a horrible, disgraceful death should SetUp not complete properly (as dictated by its return value), but I can't find an already existing exception type in .NET which would seem to suffice; though, I'm sure one will be there and I simply don't know about it. Brad Abrams posted this article that lists some of the available exception types. I say some because the article is from 2005, and, although I try to keep up to date, it's a more than plausible assumption that more have been added to future framework versions that I am still unaware of. Of course, Visual Studio gives you a nicely formatted, scrollable list of exceptions via Intellisense - but even on analysing those, I find none which would seem to suffice for this situation... ApplicationException: ...when a non-fatal application error occurs The name seems reasonable, but the error is very definitely fatal - the app is dead. ExecutionEngineException: ...when there is an internal error in the execution engine of the CLR Again, sounds reasonable, superficially; but this has a very definite purpose and to help me out here certainly isn't it. HttpApplicationException: ...when there is an error processing an HTTP request Well, we're running an ASP.NET application! But we're also just pulling at straws here. InvalidOperationException: ...when a call is invalid for the current state of an instance This isn't right but I'm adding it to the list of 'possible should you put a gun to my head, yes'. OperationCanceledException: ...upon cancellation of an operation the thread was executing Maybe I wouldn't feel so bad using this one, but I'd still be hijacking the damn thing with little right. You might even ask why on earth I would want to raise an exception here but the idea is to find out that if I were to do so then do you know of an appropriate exception for such a scenario? And basically, to what extent can we piggy-back on .NET while keeping in line with rationality?

    Read the article

  • Problem when trying to use simple Shaders + VBOs

    - by Mr.Gando
    Hello I'm trying to convert the following functions to a VBO based function for learning purposes, it displays a static texture on screen. I'm using OpenGL ES 2.0 with shaders on the iPhone (should be almost the same than regular OpenGL in this case), this is what I got working: //Works! - (void) drawAtPoint:(CGPoint)point depth:(CGFloat)depth { GLfloat coordinates[] = { 0, 1, 1, 1, 0, 0, 1, 0 }; GLfloat width = (GLfloat)_width * _maxS, height = (GLfloat)_height * _maxT; GLfloat vertices[] = { -width / 2 + point.x, -height / 2 + point.y, width / 2 + point.x, -height / 2 + point.y, -width / 2 + point.x, height / 2 + point.y, width / 2 + point.x, height / 2 + point.y, }; glBindTexture(GL_TEXTURE_2D, _name); //Attrib position and attrib_tex coord are handles for the shader attributes glVertexAttribPointer(ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, vertices); glEnableVertexAttribArray(ATTRIB_POSITION); glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, coordinates); glEnableVertexAttribArray(ATTRIB_TEXCOORD); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } I tried to do this to convert to a VBO however I don't see anything displaying on-screen with this version: //Doesn't display anything - (void) drawAtPoint:(CGPoint)point depth:(CGFloat)depth { GLfloat width = (GLfloat)_width * _maxS, height = (GLfloat)_height * _maxT; GLfloat position[] = { -width / 2 + point.x, -height / 2 + point.y, width / 2 + point.x, -height / 2 + point.y, -width / 2 + point.x, height / 2 + point.y, width / 2 + point.x, height / 2 + point.y, }; //Texture on-screen position ( each vertex is x,y in on-screen coords ) GLfloat coordinates[] = { 0, 1, 1, 1, 0, 0, 1, 0 }; // Texture coords from 0 to 1 glBindVertexArrayOES(vao); glGenVertexArraysOES(1, &vao); glGenBuffers(2, vbo); //Buffer 1 glBindBuffer(GL_ARRAY_BUFFER, vbo[0]); glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), position, GL_STATIC_DRAW); glEnableVertexAttribArray(ATTRIB_POSITION); glVertexAttribPointer(ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, 0, position); //Buffer 2 glBindBuffer(GL_ARRAY_BUFFER, vbo[1]); glBufferData(GL_ARRAY_BUFFER, 8 * sizeof(GLfloat), coordinates, GL_DYNAMIC_DRAW); glEnableVertexAttribArray(ATTRIB_TEXCOORD); glVertexAttribPointer(ATTRIB_TEXCOORD, 2, GL_FLOAT, GL_FALSE, 0, coordinates); //Draw glBindVertexArrayOES(vao); glBindTexture(GL_TEXTURE_2D, _name); glDrawArrays(GL_TRIANGLE_STRIP, 0, 4); } In both cases I'm using this simple Vertex Shader //Vertex Shader attribute vec2 position;//Bound to ATTRIB_POSITION attribute vec4 color; attribute vec2 texcoord;//Bound to ATTRIB_TEXCOORD varying vec2 texcoordVarying; uniform mat4 mvp; void main() { //You CAN'T use transpose before in glUniformMatrix4fv so... here it goes. gl_Position = mvp * vec4(position.x, position.y, 0.0, 1.0); texcoordVarying = texcoord; } The gl_Position is equal to product of mvp * vec4 because I'm simulating glOrthof in 2D with that mvp And this Fragment Shader //Fragment Shader uniform sampler2D sampler; varying mediump vec2 texcoordVarying; void main() { gl_FragColor = texture2D(sampler, texcoordVarying); } I really need help with this, maybe my shaders are wrong for the second case ? thanks in advance.

    Read the article

< Previous Page | 22 23 24 25 26 27 28 29 30 31 32 33  | Next Page >