Search Results

Search found 9082 results on 364 pages for 'c functions'.

Page 158/364 | < Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >

  • Where to go from PHP?

    - by dabito
    I'm a seasoned PHP programmer and I really like the way it works and find it very fun to work with (performance could be improved and some functions renamed, but nothing too serious). However, I took a java seminar and now Im very interested in using GWT for upcomming projects, although I think the learning curve can be steep. Should I really go through with this change (PHP JAVA)? Where to begin?

    Read the article

  • Making a Game Without Graphics?

    - by cam
    Is it possible or even constructive to make a game without any graphics (but is intended to become graphical) I'm not good with graphics at all, so I'd like to write the skeleton for the game then have a graphics programmer/artist fill in the rest. I could write up all the major classes, and their interactions, and all the major functions/parts of the game. If so, what should I do to make it easier to integrate graphics into the game later on (every drawn object should have a Draw, Rotate, Collide, etc method) ?

    Read the article

  • CFPreferences for another (or all) users

    - by James Turner
    I'm working on a background service which needs to ask several users' iTunes settings (the users will opt-in via a helper application which they run from their login). Is there an easy way to read the preferences for another user, than the current one, using CFPreferences? The docs, for example for CFPreferencesCopyValue, explicitly state: 'Do not use arbitrary user and host names, instead pass the pre-defined domain qualifier constants.', when passing the 'userName' argument to the various functions.

    Read the article

  • Passing JSON through the URI

    - by Leaf
    I'm trying to create a REST based web service with data encapsulated using JSON. My problem is when I pass the string version of JSON in the URI it turns to something like this: %7B%22coal%22:100,%22ele%22:1500.1%7D. I'm wondering if there are any functions Java for converting between the escaped and unescaped versions so I can parse the string.

    Read the article

  • What is a de-compiler how does it work?

    - by thyrgle
    So is a decompiler really a thing that gives gives the source of a compiled/interpreted piece of code? Because to me that sounds impossible. How would you get the names of the functions, variables, classes, etc if it is compiled. Or am I misinterpreting the definition? How does it work? And what is the general principal behind making one?

    Read the article

  • RTTI and Portability in C++

    - by Joshua
    If a compiler doesn't "support" RTTI, does that mean that the compiler can not handle class hierarchies that have virtual functions in them? Or have I been misunderstanding the literature about how RTTI isn't portable, and the issues lie elsewhere?

    Read the article

  • Mod_rewrite and redirects with training forward slash not working

    - by john williams
    I'm using the following lines of code in my .htaccess file to create redirects. The problem is, whenever I go to example.com/register/ it cant find the css files because it's looking for example.com/register/mycss.css instead of example.com/mycss.css. Redirect 301 register.php http://example.com/register RewriteRule ^register/?$ register.php How can I correct this? I'm new to any kind of htaccess/mod_rewrite functions so feel free to point me in the right direction if there are any other flaws.

    Read the article

  • C++ - Breaking code implementation into different parts

    - by Kotti
    Hi! The question plot (a bit abstract, but answering this question will help me in my real app): So, I have some abstract superclass for objects that can be rendered on the screen. Let's call it IRenderable. struct IRenderable { // (...) virtual void Render(RenderingInterface& ri) = 0; virtual ~IRenderable() { } }; And suppose I also have some other objects that derive from IRenderable, e.g. Cat and Dog. So far so good. I add some Cat and Dog specific methods, like SeekForWhiskas(...) and Bark(...). After that I add specific Render(...) method for them, so my code looks this way: class Cat : public IRenderable { public: void SeekForWhiskas(...) { // Implementation could be here or moved // to a source file (depends on me wanting // to inline it or not) } virtual void Render(...) { // Here comes the rendering routine, that // is specific for cats SomehowDrawAppropriateCat(...); } }; class Dog : public IRenderable { public: void Bark(...) { // Same as for 'SeekForWhiskas(...)' } virtual void Render(...) { // Here comes the rendering routine, that // is specific for dogs DrawMadDog(...); } }; And then somewhere else I can do drawing the way that an appropriate rendering routine is called: IRenderable* dog = new Dog(); dog->Render(...); My question is about logical wrapping of such kind of code. I want to break apart the code, that corresponds to rendering of the current object and it's own methods (Render and Bark in this example), so that my class implementation doesn't turn into a mess (imagine that I have 10 methods like Bark and of course my Render method doesn't fit in their company and would be hard to find). Two ways of making what I want to (as far as I know) are: Making appropriate routines that look like RenderCat(Cat& cat, RenderInterface* ri), joining them to render namespace and then the functions inside a class would look like virtual void Render(...) { RenderCat(*this, ...); }, but this is plain stupid, because I'll lose access to Cat's private members and friending these functions looks like a total design disaster. Using visitor pattern, but this would also mean I have to rebuild my app's design and looks like an inadequate way to make my code complicated from the very beginning. Any brilliant ideas? :)

    Read the article

  • Determining when or when not to escape output

    - by Ygam
    I have a page, where I have approximately 90 items I need to output. Most of them are object properties (I am using ORM so these objects map to my database tables). But the question is, do I have to escape each of those 90 outputs by applying functions to each (in my case, the htmlspecialchars)? Wouldn't that add a bit of an overhead (calling a single function 90 times)?

    Read the article

  • How to Convert Boolean to String

    - by tag
    I have a boolean variable which I want to convert to a string $res = true; I need it the converted value to also be in the format "true" "false" not "0" "1" $converted_res = "true"; $converted_res = "false"; I've tried: $converted_res = string($res); $converted_res = String($res); but it tells me string and String are not recognized functions. How do I convert this boolean to a string in the format "true" or "false" in php?

    Read the article

  • triggering an event with jQuery live or delegate

    - by patrick
    I'd like to attach a handler to an element using either jQuery live() or delegate(). Looking at the docs I see I can attach the handler for a custom event. Is this possible for either of these jQuery functions to also trigger the handler? Basically I want to attach the handler function and run call it once. Thank you for any help.

    Read the article

  • Getting rid of "static" references in C#

    - by DevEight
    Hello. I've recently begun learning C# but have encountered an annoying problem. Every variable I want available to all functions in my program I have to put a "static" in front of and also every function. What I'd like to know is how to avoid this, if possible? Also, small side question: creating public variables inside functions? This is what my program looks like right now, and I want to basically keep it like that, without having to add "static" everywhere: using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Threading; using System.Net.Sockets; namespace NetworkExercise { class Client { public IPAddress addr; public int port; public string name; public Thread thread; public TcpClient tcp; public NetworkStream stream; public Client(IPAddress addr, int port, string name, NetworkStream stream) { } } class Program { //NETWORK TcpListener tcpListener; Thread listenThread; ASCIIEncoding encoder = new ASCIIEncoding(); //DATA byte[] buffer = new byte[4096]; string servIp; int servPort; //CLIENT MANAGEMENT int clientNum; static void Main(string[] args) { beginConnect(); } public void beginConnect() { Console.Write("Server IP (leave blank if you're the host): "); servIp = Console.ReadLine(); Console.Write("Port: "); servPort = Console.Read(); tcpListener = new TcpListener(IPAddress.Any, servPort); listenThread = new Thread(new ThreadStart(listenForClients)); listenThread.Start(); } public void listenForClients() { tcpListener.Start(); Console.WriteLine("Listening for clients..."); while (true) { Client cl = new Client(null, servPort, null, null); cl.tcp = tcpListener.AcceptTcpClient(); ThreadStart pts = delegate { handleClientCom(cl); }; cl.thread = new Thread(pts); cl.thread.Start(); } } public void handleClientCom(Client cl) { cl.stream = cl.tcp.GetStream(); } } }

    Read the article

  • actionscript 3 array question

    - by Naro
    var arr1:Array = new Array(); arr1.push(item1); arr1.push(item2); arr1.push(item3); then arr1 and its elements get passed to other functions is there a way to know the index of an item in the array? GetParentArrayIndex(item2) would give me 1;

    Read the article

  • Dynamic memory managment under Linux

    - by petersohn
    I know that under Windows, there are API functions like global_alloc() and such, which allocate memory, and return a handle, then this handle can be locked and a pointer returned, then unlocked again. When unlocked, the system can move this piece of memory around when it runs low on space, optimising memory usage. My question is that is there something similar under Linux, and if not, how does Linux optimize its memory usage?

    Read the article

  • On iPhone, what does EPERM (errno == 1) mean in reponse to send() of UDP data?

    - by Chris Markle
    We sending data over UDP from the iPhone, sometimes, but not always, in response to our first send() of UDP data, we are getting back a -1 return code and errno set to 1 (EPERM / operation not permitted). The EPERM result for send(), sendto() and sendmsg() is not documented in the man pages as a return result from those functions. Has anyone out there encountered this and might be able to shed some light on what this errno value means in this context?

    Read the article

  • Profiling a Java Spring application

    - by niklassaers
    Hi guys, I have a Spring application that I believe has some bottlenecks, so I'd like to run it with a profiler to measure what functions take how much time. Any recommendations to how I should do that? I'm running STS, the project is a maven project, and I'm running Spring 3.0.1 Cheers Nik

    Read the article

  • How to add Google Calendar Dynamically to jQuery FullCalendar?

    - by crosenblum
    I have seen how to add google calendar, but when I run it, it create's a new calendar, even though the selector I am using, refer's to an existing calendar. $calendar.fullCalendar({ events: $.fullCalendar.gcalFeed($feed_url.val()) }); I have other functions, that use renderEvents, but I am not sure how to use that with google calendars... Any thoughts or suggestions? Thank You.

    Read the article

  • Convert.ToSingle() for float data Type

    - by Asim Sajjad
    I have used many of the Convert.To..... functions for conversion , but I didn't understand one thing that for every datatype they have provide a Convert.To function but not for float datatype, in order to convert to float you need to use Convert.ToSingle() , why is this so ?

    Read the article

  • iPhone: Create a single UIView from multiple clicks

    - by Cuzog
    I'm making a partial overlay modal in my app with the code from “Semi-Modal (Transparent) Dialogs on the iPhone” at ramin.firoozye.com. In doing so, the button that calls the modal is still visible and clickable. I will hide this button when the modal spawns, but I want to be sure if the user clicks very quickly twice, a new modal doesn't come up for each click. What is the best way to check that the modal doesn't already exist when calling it from the button click? You can download the test project here. For those that don't have xcode, the relevant functions are below: I call forth the modal on button click with this: - (IBAction)displayModal:(id)sender { ModalViewController *modalController = [[ModalViewController alloc] initWithNibName:@"ModalViewController" bundle:nil]; modalController.view.frame = CGRectOffset(modalController.view.frame, 0, 230); [self showModal:modalController.view]; } Then use this function to animate the custom modal over the current view: - (void)showModal:(UIView*) modalView { UIWindow* mainWindow = (((TestAppDelegate*) [UIApplication sharedApplication].delegate).window); CGPoint middleCenter = modalView.center; CGSize offSize = [UIScreen mainScreen].bounds.size; CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5); modalView.center = offScreenCenter; // we start off-screen [mainWindow addSubview:modalView]; // Show it with a transition effect [UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.4]; // animation duration in seconds modalView.center = middleCenter; [UIView commitAnimations]; } Then I dismiss the modal on button click with this: - (IBAction)dismissModal:(id)sender { [self hideModal:self.view]; } And then use these functions to animate the modal offscreen and clean itself up: - (void)hideModal:(UIView*) modalView { CGSize offSize = [UIScreen mainScreen].bounds.size; CGPoint offScreenCenter = CGPointMake(offSize.width / 2.0, offSize.height * 1.5); [UIView beginAnimations:nil context:modalView]; [UIView setAnimationDuration:0.7]; [UIView setAnimationDelegate:self]; [UIView setAnimationDidStopSelector:@selector(hideModalEnded:finished:context:)]; modalView.center = offScreenCenter; [UIView commitAnimations]; } - (void)hideModalEnded:(NSString *)animationID finished:(NSNumber *)finished context:(void *)context { UIView* modalView = (UIView *)context; [modalView removeFromSuperview]; [self release]; } Any help is greatly appreciated!

    Read the article

  • Execute something on application startup?

    - by Nick Brooks
    I have a class in my application which handles all the controls and all the functions and variables are stored in it. How can I add a function which handles the application startup to it? So basically I need to handle 'applicationDidFinishLaunching' in my class as well as in the application delegate. How do I do that?

    Read the article

< Previous Page | 154 155 156 157 158 159 160 161 162 163 164 165  | Next Page >