Daily Archives

Articles indexed Friday April 23 2010

Page 13/115 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • How do I send the mutable string to the NSTextField properly?

    - by Merle
    So I have all this code that I have debugged and it seems to be fine. I made a mutable string and for some reason I can not get it to be displayed on my label. the debugger says "2010-04-22 22:50:26.126 Fibonacci[24836:10b] * -[NSTextField setString:]: unrecognized selector sent to instance 0x130150" What is wrong with this? When I just send the string to NSLog, it comes out fine. here's all my code, any help would be appreciated. "elementNum" is a comboBox and "display" is a Label. Thanks #import "Controller.h" @implementation Controller - (IBAction)computeNumber:(id)sender { int x = 1; int y = 1; NSMutableString *numbers = [[NSMutableString alloc] init]; [numbers setString:@"1, 1,"]; int num = [[elementNum objectValueOfSelectedItem]intValue]; int count = 1; while (count<=num) { int z = y; y+=x; x=z; [numbers appendString:[NSString stringWithFormat:@" %d,", y]]; count++; } [display setString:numbers]; NSLog(numbers); } @end `

    Read the article

  • Rocksclusters reinstalling nodes partitioning error.

    - by Antiarchitect
    I have a HPC based on rocksclusters So when I've added new roll (torque) I send a kickstart command to all nodes to reinstall them. But after loading X installer on nodes all of them showed me an error: Could not allocate requested partitions: Partitioning failed: Could not allocate partitions as primary partitions. Cannot allocate partition for /boot

    Read the article

  • How can I open Outlook Calendar to a 2-3 week view by default?

    - by Simon
    I use Outlook 2007, and I like to view my calendar 2 (or sometimes 3) weeks at a time. Its relatively easy to do, by dragging my mouse across several weeks in the mini calendar. BUT... it never stays that way. As soon as I change to Contacts and back to Calendar, the view resets to showing a whole month. Any ideas about how to change to default view?

    Read the article

  • phpbb specific forum page styles

    - by Ryan Max
    I am using phpbb on a site for a client, and the client has requested that each different forum page have a different background color. Such functionality is not built into phpbb (from what I can tell), so how should I go about doing this? Can I modify the code of phpbb directly? My other thought was to use a js conditional statement, but seeing as the only difference on the forums page would be the page title, I don't know how I could format this.

    Read the article

  • How to generate msdn documentation from javascript? preferably using sandcastle

    - by melaos
    hi is there a tool that i can use to generated msdn type documentation? i recently just started playing with sandcastle and i found that there used to a tool called scriptdoc but it has been absorbed into aptana and i don't really want to use aptana studio. what i could find so far is jsdoc which is a perl script which extracts comments from javascript files but i'm still looking for a better fit. from my initial testing it seems that the xml generated from jsdoc doesn't match completed with sandcastle or maybe i'm missing something there... any help?

    Read the article

  • Help understanding some OpenGL stuff

    - by shinjuo
    I am working with some code to create a triangle that moves with arrow keys. I want to create a second object that moves independently. This is where I am having trouble, I have created the second actor, but cannot get it to move. There is too much code to post it all so I will just post a little and see if anyone can help at all. ogl_test.cpp #include "platform.h" #include "srt/scheduler.h" #include "model.h" #include "controller.h" #include "model_module.h" #include "graphics_module.h" class blob : public actor { public: blob(float x, float y) : actor(math::vector2f(x, y)) { } void render() { transform(); glBegin(GL_TRIANGLES); glVertex3f(0.25f, 0.0f, -5.0f); glVertex3f(-.5f, 0.25f, -5.0f); glVertex3f(-.5f, -0.25f, -5.0f); glEnd(); end_transform(); } void update(controller& c, float dt) { if (c.left_key) { rho += pi / 9.0f * dt; c.left_key = false; } if (c.right_key) { rho -= pi / 9.0f * dt; c.right_key = false; } if (c.up_key) { v += .1f * dt; c.up_key = false; } if (c.down_key) { v -= .1f * dt; if (v < 0.0) { v = 0.0; } c.down_key = false; } actor::update(c, dt); } }; class enemyOne : public actor { public: enemyOne(float x, float y) : actor(math::vector2f(x, y)) { } void render() { transform(); glBegin(GL_TRIANGLES); glVertex3f(0.25f, 0.0f, -5.0f); glVertex3f(-.5f, 0.25f, -5.0f); glVertex3f(-.5f, -0.25f, -5.0f); glEnd(); end_transform(); } void update(controller& c, float dt) { if (c.left_key) { rho += pi / 9.0f * dt; c.left_key = false; } if (c.right_key) { rho -= pi / 9.0f * dt; c.right_key = false; } if (c.up_key) { v += .1f * dt; c.up_key = false; } if (c.down_key) { v -= .1f * dt; if (v < 0.0) { v = 0.0; } c.down_key = false; } actor::update(c, dt); } }; int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, char* lpCmdLine, int nCmdShow ) { model m; controller control(m); srt::scheduler scheduler(33); srt::frame* model_frame = new srt::frame(scheduler.timer(), 0, 1, 2); srt::frame* render_frame = new srt::frame(scheduler.timer(), 1, 1, 2); model_frame->add(new model_module(m, control)); render_frame->add(new graphics_module(m)); scheduler.add(model_frame); scheduler.add(render_frame); blob* prime = new blob(0.0f, 0.0f); m.add(prime); m.set_prime(prime); enemyOne* primeTwo = new enemyOne(2.0f, 0.0f); m.add(primeTwo); m.set_prime(primeTwo); scheduler.start(); control.start(); return 0; } model.h #include <vector> #include "vec.h" const double pi = 3.14159265358979323; class controller; using math::vector2f; class actor { public: vector2f P; float theta; float v; float rho; actor(const vector2f& init_location) : P(init_location), rho(0.0), v(0.0), theta(0.0) { } virtual void render() = 0; virtual void update(controller&, float dt) { float v1 = v; float theta1 = theta + rho * dt; vector2f P1 = P + v1 * vector2f(cos(theta1), sin(theta1)); if (P1.x < -4.5f || P1.x > 4.5f) { P1.x = -P1.x; } if (P1.y < -4.5f || P1.y > 4.5f) { P1.y = -P1.y; } v = v1; theta = theta1; P = P1; } protected: void transform() { glPushMatrix(); glTranslatef(P.x, P.y, 0.0f); glRotatef(theta * 180.0f / pi, 0.0f, 0.0f, 1.0f); //Rotate about the z-axis } void end_transform() { glPopMatrix(); } }; class model { private: typedef std::vector<actor*> actor_vector; actor_vector actors; public: actor* _prime; model() { } void add(actor* a) { actors.push_back(a); } void set_prime(actor* a) { _prime = a; } void update(controller& control, float dt) { for (actor_vector::iterator i = actors.begin(); i != actors.end(); ++i) { (*i)->update(control, dt); } } void render() { for (actor_vector::iterator i = actors.begin(); i != actors.end(); ++i) { (*i)->render(); } } };

    Read the article

  • How Do I Detect A WordPress Admin Panel in my Plugin?

    - by Volomike
    I've got two events in my plugin. One is run for the front-end. The other is run for the admin panel. Both call the same function in one particular situation, and this echoes stuff to the screen. How do I make it such that the function is smart, calls something in WordPress, and detects whether it's being loaded in the front-end versus the admin panel? I don't want it to echo stuff to the screen on the front-end, but do want it to do so on the admin panel. Right now, it's echoing on both, which is not what I want. Background For the front end (the side of the site that the visitor sees), I'm intercepting the 'wp' event and checking for: ( is_single() || is_page() || is_home() || is_archive() || is_category() || is_tag()) For the admin panel, I'm intercepting the 'admin_menu' event. I tried intercepting the is_*() stuff above, but it seems to somehow answer TRUE or something, not giving me a difference between front-end and admin panel.

    Read the article

  • varchar(255) to varchar(MAX)

    - by JD
    Is it possible to change a column type in a MS SQL 2008 database from varchar(255) to varchar(MAX) without having to drop the table and recreate? SQL Server Management Studio throws me an error every time I try to do it using that - but to save myself a headache would be nice to know if I can change the type without having to DROP and CREATE. Thanks

    Read the article

  • Add querystring parameters to link_to

    - by Craig
    I'm having difficultly adding querystring parameters to link_to UrlHelper. I have an Index view, for example, that has UI elements for sorting, filtering, and pagination (via will_paginate). The will_paginate plugin manages the intra-page persistence of querystring parameters correctly. Is there an automatic mechanism to add the querystring parameters to a give named route, or do I need to do so manually? A great deal of research on this seemingly simple construct has left me clueless.

    Read the article

  • Moq broken? Not working with .net 4.0

    - by vdh_ant
    Hi guys I am receiving the following exception when trying to run my unit tests using .net 4.0 under VS2010 with moq 3.1. Attempt by security transparent method 'SPPD.Backend.DataAccess.Test.Specs_for_Core.When_using_base.Can_create_mapper()' to access security critical method 'Microsoft.VisualStudio.TestTools.UnitTesting.Assert.IsNotNull(System.Object)' failed. Assembly 'SPPD.Backend.DataAccess.Test, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception. The test I am running is really straight forward and looks something like the following: [TestMethod] public void Can_create_mapper() { this.SetupTest(); var mockMapper = new Moq.Mock<IMapper>().Object; this._Resolver.Setup(x => x.Resolve<IMapper>()).Returns(mockMapper).Verifiable(); var testBaseDa = new TestBaseDa(); var result = testBaseDa.TestCreateMapper<IMapper>(); Assert.IsNotNull(result); //<<< THROWS EXCEPTION HERE Assert.AreSame(mockMapper, result); this._Resolver.Verify(); } I have no idea what this means and I have been looking around and have found very little on the topic. The closest reference I have found is this http://dotnetzip.codeplex.com/Thread/View.aspx?ThreadId=80274 but its not very clear on what they did to fix it... Anyone got any ideas?

    Read the article

  • Cocoa UI Elements Not Updating

    - by spamguy
    I have a few Cocoa UI elements with outlet connexions to an object instantiated within an NSView object, which is in turn put there by an NSViewController. These elements, a definite progress bar and a text label, are not updating: the progress bar is dead and empty despite having its value change constantly, the text label does not unhide through [textLabel setHidden:NO], the text label does not change its string. What I know: There's no difference between binding values and setting them in code. Nothing changes either way. I've checked outlet connections. They're all there. I've tried [X displayIfNeeded], where X has been the UI objects themselves, the containing NSView, and the main window. No difference. [progressBar setUsesThreadedAnimation:YES] makes no difference. Interestingly, if I look at progressBar mid-program, _threadedAnimation is still NO. The object holding all these outlets and performing an import operation is in an NSOperationQueue owned by the NSViewController object. Thanks! EDIT: As suggested, I called [self performSelectorOnMainThread:@selector(updateProgress:) withObject:[NSNumber numberWithInt:myObject] waitUntilDone:NO]. (I've also tried waitUntilDone:YES.) It's still not updating. The debugger clearly shows updateProgress: taking place in the main thread, so I don't know what's missing.

    Read the article

  • simple obj-c naming question

    - by Highstead
    This question is more to figure out how to look up classes and objects in objective-c but i lack the knowledge to figure out how to look this up so i pose the question here. In .Net if i had a MyObject.MyValue the MyValue would be called a property, and I could look this up in MSDN. In java i would check the javadocs online (and that property would have to be a value). With objective-c that is called a ? and if i wanted to look it up i would look where? Example: //Object.??? UIImage.backgroundColor = [UIColor blueColor];

    Read the article

  • PHP Get random paragraph

    - by Jack
    Anyone know how to get a random set of lines from a text file? I want to get a set of 3 lines with <br> on the front of each and display them through html. example: set 1 <br>Hi <br>what's your name <br>goodbye set 2 <br>stack <br>overflow <br>hi there set 3,4,5.... Choose one random set and display it. The sets of lines would be stored in a text file. Thanks a lot!

    Read the article

  • BASH Expression to replace beginning and ending of a string in one operation?

    - by swestrup
    Here's a simple problem that's been bugging me for some time. I often find I have a number of input files in some directory, and I want to construct output file names by replacing beginning and ending portions. For example, given this: source/foo.c source/bar.c source/foo_bar.c I often end up writing BASH expressions like: for f in source/*.c; do a="obj/${f##*/}" b="${a%.*}.obj" process "$f" "$b" done to generate the commands process "source/foo.c" "obj/foo.obj" process "source/bar.c "obj/bar.obj" process "source/foo_bar.c "obj/foo_bar.obj" The above works, but its a lot wordier than I like, and I would prefer to avoid the temporary variables. Ideally there would be some command that could replace the beginning and ends of a string in one shot, so that I could just write something like: for f in source/*.c; do process "$f" "obj/${f##*/%.*}.obj"; done Of course, the above doesn't work. Does anyone know something that will? I'm just trying to save myself some typing here.

    Read the article

  • A Warning to Those Using sys.dm_exec_query_stats

    - by Adam Machanic
    The sys.dm_exec_query_stats view is one of my favorite DMVs. It has replaced a large chunk of what I used to use SQL Trace for--pulling metrics about what queries are running and how often--and it makes this kind of data collection painless and automatic. What's not to love? But use cases for the view are a topic for another post. Today I want to quickly point out an inconsistency. If you're using this view heavily, as I am, you should know that in some cases your queries will not get a row. One...(read more)

    Read the article

  • I wanna run an android emulator with disk images

    - by Kyungmin
    hi i'd like to run an android emulator with disk image. so I tried this ./emulator -kernel kernel-qemu -system system.img -ramdisk ramdisk.img -initdata userdata.img -partition-size 512 then error massage is : if you really want to NOT run an AVD, consider using '-data ' to specify a data partition image file (I hope you know what you're doing). so I found userdata-qemu.img from /out/ but i can't find that file. someone help me

    Read the article

  • Add Ajax Support to Spring MVC

    - by Mark
    Hi, I would like to add ajax to an existing spring mvc 2.5 webapps. But i dont know where to start. I think spring does not support ajax integration. Does someone know how can I accomplish this? I was thinking that my ajaxrequest should be catch by the controller interface but I dont know where to start. I dont want to use any ajax library at this point but just plain old ajax approach Kindly send me links or tutorials if what I am thinking is possible please

    Read the article

  • Ideas for student parallel programming project

    - by chi42
    I'm looking to do a parallel programming project in C (probably using pthreads or maybe OpenMP) for a class. It will done by a group of about four students, and should take about 4 weeks. I was thinking it would be interesting to attack some NP-complete problem with a more complex algorithm like a genetic algo with simulated annealing, but I'm not sure if it would be a big enough project. Anyone knew of any cool problems that could benefit from a parallel approach?

    Read the article

  • Diffie-Hellman in Silverlight

    - by cmaduro
    I am trying to devise a security scheme for encrypting the application level data between a silverlight client, and a php webservice that I created. Since I am dealing with a public website the information I am pulling from the service is public, but the information I'm submitting to the webservice is not public. There is also a back end to the website for administration, so naturally all application data being pushed and pulled from the webservice to the silverlight administration back end must also be encrypted. Silverlight does not support asymmetric encryption, which would work for the public website. Symmetric encryption would only work on the back end because users do not log in to the public website, so no password based keys could be derived. Still symmetric encryption would be great, but I cannot securely save the private key in the silverlight client. Because it would either have to be hardcoded or read from some kind of config file. None of that is considered secure. So... plan B. My final alternative would be then to implement the Diffie-Hellman algorithm, which supports symmetric encryption by means of key agreement. However Diffie-Hellman is vulnerable to man-in-the-middle attacks. In other words, there is no guarantee that either side is sure of each others identity, making it possible for communication to be intercepted and altered without the receiving party knowing about it. It is thus recommended to use a private shared key to encrypt the key agreement handshaking, so that the identity of either party is confirmed. This brings me back to my initial problem that resulted in me needing to use Diffie-Hellman, how can I use a private key in a silverlight client without hardcoding it either in the code or an xml file. I'm all out of love on this one... is there any answer to this?

    Read the article

  • itunes connect rejection: "The binary you uploaded was invalid. A pre-release beta version of the SD

    - by Adam
    I'm having trouble submitting apps on Apple's app store. I was using a beta version of xcode- 3.2.3/iphone sdk 4.0- and I assumed that if I set the base sdk and deployment target to an acceptable version it would work, but it didn't. I deleted the beta version of xcode/sdk using "sudo /Developer/Library/uninstall-devtools --mode=all" and did a fresh install of the old release version- xcode 3.2.2/iphone sdk 3.2- but I still have the same problem. Has anyone run into this before? Is there something left over from the beta version that could still be hanging around causing problems?

    Read the article

  • Accelerometer Values from Android/iPhone device

    - by mrlinx
    I'm trying to map my movements with a android device into an OpenGL scene. I've recorded accelerometer values for a simples movement: Moving the phone (lies flat on a table) 10cm forward (+x), and then 10cm backward (-x). The problem is that this values when used to calculate velocity and position, makes only the opengl cube go forward. Seems like the negative acceleration recorded was not enough to reduce the speed and invert its movement. What can be the problem? This is my function that updates the velocity and position every time new data comes in: void updatePosition(double T2) { double T = 0.005; Vec3 old_pos = position.clone(), old_vel = velocity.clone(); velocity = old_vel.plus(acceleration.times(T)); position = old_pos.plus(old_vel.times(T).plus(acceleration.times(0.5 * Math.pow(T, 2)))); } This is the X,Y,Z accelerometer values over the entire captured time:

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >