Search Results

Search found 5155 results on 207 pages for 'max hazard'.

Page 51/207 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • How to prepare a codebase for compiling on both Windows and Unix-based systems

    - by Max
    Hi! I am wondering about different solutions to easily compile my cross-platform application for both windows and unix. Right now I am using a makefile on Ubuntu, but before my codebase grows larger I'd like to perform the steps necessary to compile it on Windows, and then continue doing so regularly to see that it still works. I'd preferably not contaminate my SVN codebase repository with multiple "makefile" solutions, such as VC++ solutions and so on, I'd like a more automatic way. I tried using mingw with make for windows, but it seems my secondexpansion awesomeness doesn't work on the Windows version (or something like that). It wouldn't compile, and also complained about _winNT or something like that not being defined. How should I prepare my codebase for cross-platform easy compiling? Things like buildtools, perhaps autogenerate VS file from makefile, or something similar. Some preprocessor magic in a stdinc file perhaps? Thanks!

    Read the article

  • How to determine which cells in a grid intersect with a given triangle?

    - by Ray Dey
    I'm currently writing a 2D AI simulation, but I'm not completely certain how to check whether the position of an agent is within the field of view of another. Currently, my world partitioning is simple cell-space partitioning (a grid). I want to use a triangle to represent the field of view, but how can I calculate the cells that intersect with the triangle? Similar to this picture: The red areas are the cells I want to calculate, by checking whether the triangle intersects those cells. Thanks in advance. EDIT: Just to add to the confusion (or perhaps even make it easier). Each cell has a min and max vector where the min is the bottom left corner and the max is the top right corner.

    Read the article

  • ios App Disclaimer

    - by Max
    I am writing an application for iPhone and had some questions regarding eula :- If I do not include any disclaimer/ eula in my app, then would Apple's standard EULA http://www.apple.com/legal/internet-services/itunes/appstore/dev/stdeula/ automatically apply to my app ? If I include a small disclaimer inside my application (as a popup on initial screen), then would Apple's EULA still cover my app ? I tried downloading few apps on my ipad and did not see Apple's standard EULA. So, where can I actually see the EULA before downloading something ?

    Read the article

  • POSIX Threads and signal masks

    - by Max
    Is there a way to change the signal mask of a thread from another thread? I am supposed to write a multithreaded C application that doesn't use mutex, semaphores and condition variables, only signals. So it would look like something like this: The main Thread sends SIGUSR1 to its process and and one of the 2 threads (not including the main thread), will respond to the signal and block SIGUSR1 from the sigmask and sleep. Then the main thread sends SIGUSR1 again, the other thread will respond, block SIGUSR1 from its sigmask, unblock SIGUSR1 from the other threads sigmask, so it will respond to SIGUSR1 again. So essentially whenever the main thread sends SIGUSR1 the two other threads swap between each other. Can somebody help?

    Read the article

  • C#/WebService/ExactTarget - send email to single subscriber without TriggeredSend

    - by Max Gontar
    Hi! There is an email service ExactTarget with web service API. There are samples (in php though) for sending email to whole list instantly, or to single subscriber by triggered action. It's pretty hard to get in it's documentation, and I couldn't find explanation how to send email to a single subscriber instantly without having some triggering actions. Any help or advice will be great. Thanks.

    Read the article

  • Ubuntu 12.10 Laptop temperature

    - by romi
    I'm using a laptop having dedicated graphics card with Ubuntu and Windows 7 dual boot. The windows 7 idle temperature for cpu is 51C average and gpu is 46-48.5C, and when in load Cpu temp varies between 55-61C, and GPU 49-51 MAX. But in ubuntu idle temp CPU: 54c Gpu(ati radeon,proprietary driver installed): 50C and on load cpu: 58-69C gpu:53C max. Is it normal? If not is there any solution? Note that i'm using jupiter,latest graphics driver, grub tweaks etc.

    Read the article

  • Can't get flat QToolButton with border on hover stylesheet

    - by Max
    Hi, all! I need to implement textbox with inplace button (for search or filter purposes). So, I need to get Qtoolbutton, that is flat and rendered as icon, and obtain the border when hovered by mouse or pressed. And maybe I'd add some almost transparent background on hover too. I tried to set the following stylesheet: 'border: none; hover {border: 1px} pressed {border: 1px}' , but it seems that only border set. I tried to set autoRaise() to True and False, I mean, maybe some intersection occured, but haven't succeed.

    Read the article

  • How do I generate a custom SID?

    - by Max Schmeling
    I need to generate custom SIDs for users in my web application for use with Microsoft AzMan. What is the best way to do this? What do I need to know before doing this? This is what I'm thinking, but I'm not sure if I'm missing something: S-1-9-1234-{user_id + 1000} S-{first revision}-{resource manager authority}-{domain (unique number for the specific app)}-{unique id for user} UPDATE: Changed to resource manager authority because of David Crawford's blog entry: http://blogs.msdn.com/dc995/archive/2006/08/23/715021.aspx

    Read the article

  • tk: how to invoke it just to display something, and return to the main program?

    - by max
    Sorry for the noob question but I really don't understand this. I'm using python / tkinter and I want to display something (say, a canvas with a few shapes on it), and keep it displayed until the program quits. I understand that no widgets would be displayed until I call tkinter.tk.mainloop(). However, if I call tkinter.tk.mainloop(), I won't be able to do anything else until the user closes the main window. I don't need to monitor any user input events, just display some stuff. What's a good way to do this without giving up control to mainloop? EDIT: Is this sample code reasonable: class App(tk.Tk): def __init__(self, sim): self.sim = sim # link to the simulation instance self.loop() def loop(): self.redraw() # update all the GUI to reflect new simulation state sim.next_step() # advance simulation another step self.after(0, self.loop) def redraw(): # get whatever we need from self.sim, and put it on the screen EDIT2 (added after_idle): class App(tk.Tk): def __init__(self, sim): self.sim = sim # link to the simulation instance self.after_idle(self.preloop) def preloop(): self.after(0, self.loop) def loop(): self.redraw() # update all the GUI to reflect new simulation state sim.next_step() # advance simulation another step self.after_idle(self.preloop) def redraw(): # get whatever we need from self.sim, and put it on the screen

    Read the article

  • undefined reference to static member variable

    - by Max
    Hi. I have this class that has a static member. it is also a base class for several other classes in my program. Here's its header file: #ifndef YARL_OBJECT_HPP #define YARL_OBJECT_HPP namespace yarlObject { class YarlObject { // Member Variables private: static int nextID; // keeps track of the next ID number to be used int ID; // the identifier for a specific object // Member Functions public: YarlObject(): ID(++nextID) {} virtual ~YarlObject() {} int getID() const {return ID;} }; } #endif and here's its implementation file. #include "YarlObject.hpp" namespace yarlObject { int YarlObject::nextID = 0; } I'm using g++, and it returns three undefined reference to 'yarlObject::YarlObject::nextID linker errors. If I change the ++nextID phrase in the constructor to just nextID, then I only get one error, and if I change it to 1, then it links correctly. I imagine it's something simple, but what's going on?

    Read the article

  • Using a class with const data members in a vector

    - by Max
    Given a class like this: class Foo { const int a; }; Is it possible to put that class in a vector? When I try, my compiler tells me it can't use the default assignment operator. I try to write my own, but googling around tells me that it's impossible to write an assignment operator for a class with const data members. One post I found said that "if you made [the data member] const that means you don't want assignment to happen in the first place." This makes sense. I've written a class with const data members, and I never intended on using assignment on it, but apparently I need assignment to put it in a vector. Is there a way around this that still preserves const-correctness?

    Read the article

  • Books on string algorithms

    - by Max
    There have been numerous posts on string algorithms: http://stackoverflow.com/questions/246961/algorithm-to-find-similar-text, http://stackoverflow.com/questions/451884/similar-string-algorithm, http://stackoverflow.com/questions/613133/efficient-string-matching-algorithm However, no general literature was mentioned. Could anyone recommend a book(s) that would thoroughly explore various string algorithms? The topic which is of special interest is approximate string matching [things like google-offered corrected search string variants :) ]. Thanks a lot for advice.

    Read the article

  • Free server solution for strict content photos with geotags

    - by Max Gontar
    Hi! I would like to create some kind of open free "group" posting of photos with geotags First I thought about Panoramio, but seems there is no API for photos upload. By now I can see only two ways: Flickr - there are groups but you have to approve group membership anyway, or use tags for grouping which is bad for maintenance Custom server solution which will cost efforts and hosting Can you suggest other free photo services with geotags functionality, or opensource solutions? Thank you!

    Read the article

  • MS Exam 70-536 - How to throw and handle exception from thread?

    - by Max Gontar
    Hello! In MS Exam 70-536 .Net Foundation, Chapter 7 "Threading" in Lesson 1 Creating Threads there is a text: Be aware that because the WorkWithParameter method takes an object, Thread.Start could be called with any object instead of the string it expects. Being careful in choosing your starting method for a thread to deal with unknown types is crucial to good threading code. Instead of blindly casting the method parameter into our string, it is a better practice to test the type of the object, as shown in the following example: ' VB Dim info As String = o as String If info Is Nothing Then Throw InvalidProgramException("Parameter for thread must be a string") End If // C# string info = o as string; if (info == null) { throw InvalidProgramException("Parameter for thread must be a string"); } So, I've tried this but exception is not handled properly (no console exception entry, program is terminated), what is wrong with my code (below)? class Program { static void Main(string[] args) { Thread thread = new Thread(SomeWork); try { thread.Start(null); thread.Join(); } catch (InvalidProgramException ex) { Console.WriteLine(ex.Message); } finally { Console.ReadKey(); } } private static void SomeWork(Object o) { String value = (String)o; if (value == null) { throw new InvalidProgramException("Parameter for "+ "thread must be a string"); } } } Thanks for your time!

    Read the article

  • Why does fb:fan control disappear after login with requireSession on external page?

    - by Max
    Hi, Reqs: I want to make an external page with a 'Become a Fan'-button. I want users to login to facebook once they open the page (this is because of other features in the site) So I call FB.Connect.requireSession once the page loads, and put a <fb:fan></fb:fan> control on the page. Then when I open the page I see the 'Connect with Facebook to Continue' pop-up and a small 'Become a fan' button. This seems right. When I log in to Facebook using the pop-up the 'Become a fan button' disappears!! Can anyone explain this weird behaviour or does someone know a way to reach my requirements in a different way. Below you can see my code. Thanks in advance! <!-- Head --> <script src="http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php/nl_NL" type="text/javascript"></script> <script type="text/javascript"> var fbApiKey = "MY_KEY"; var fbXdReceiver = "xd_receiver.htm"; function fbLoad() { FB.init(fbApiKey, fbXdReceiver); FB.ensureInit(function() { FB.Connect.requireSession(null, null, false); }); } </script> <!-- Body onload="fbLoad();" --> <fb:fan profile_id="24932281961" name="Nutella" id="fanButton" stream="0" connections="0" logobar="0" width="250"></fb:fan>

    Read the article

  • display image and run script for fifteen seconds

    - by Ryan Max
    This is very similar to a question I asked the other day but my page code has become significantly more complicated and I need to revisit it. I've been using the following code: $('#myLink').click(function() { $('#myImg').attr('src', 'newImg.jpg'); setTimeout(function() { $('#myImg').attr('src', 'oldImg.jpg'); }, 15000); }); To replace an image for a set period of time (15 seconds) when the link is clicked, then after 15 seconds, revert to the original image. However now, I'd like to run a snippet of javascript as well when the link is clicked (in addition to replacing the image), and only when the link is clicked (it's related to the 15 second image) and then have the js code disappear as well after the 15 seconds...however I'm not sure how to have jquery send js code into the page...Basically I just want jQuery to "echo" this code onto the page underneath the 15 second while I am there, but I don't know how jquery formats this "echo". Does this question make sense? interval = 500; imgsrc = "webcam/image.jpg"; function Refresh() { tmp = new Date(); tmp = "?" + tmp.getTime(); document.images["image1"].src = imgsrc + tmp; setTimeout("Refresh()", interval); } Refresh(); It's script for a webcam. Basically it takes a new picture every half a second and replaces it on the page. You must forgive me, I'm new to jquery, I don't know how to make this script work in a jquery context. i'm sorry, I'm explaining badly. This is what I need to happen, step by step: 1) User comes to the page and there is a static image that says "Click here to view webcam" 2) User clicks image 3) Image is replaced by live webcam image, which is refreshed every .5 seconds by the second script in my question. 4) After 15 seconds the live webcam reverts back to the static image saying "click here to view webcam" It is ONLY during that 15 second interval that I wan the webcam refresh script running, otherwise it's wasting bandwidth on an element that isn't even shown. Sorry for the confusion.

    Read the article

  • Port a Rails App from Windows to Mac

    - by Ryan Max
    Hello I've been a Rails developer on Windows for quite some time now, but I recently completed my biggest project yet (it's quite extensive, took me over a year to build) but I am having trouble deploying it. The combination of it's size, complexity and a windows environment is making it needlessly complex to deploy. I am thinking about getting an old mac mini and using it just for rails development. Is there any way I can port my app to this mac, without having to start over? I can't find any resources on the internets about this.

    Read the article

  • Automatically decorating every instance method in a class

    - by max
    I want to apply the same decorator to every method in a given class, other than those that start and end with __. It seems to me it should be doable using a class decorator. Are there any pitfalls to be aware of? Ideally, I'd also like to be able to: disable this mechanism for some methods by marking them with a special decorator enable this mechanism for subclasses as well enable this mechanism even for methods that are added to this class in runtime [Note: I'm using Python 3.2, so I'm fine if this relies on features added recently.] Here's my attempt: _methods_to_skip = {} def apply(decorator): def apply_decorator(cls): for method_name, method in get_all_instance_methods(cls): if (cls, method) in _methods_to_skip: continue if method_name[:2] == `__` and method_name[-2:] == `__`: continue cls.method_name = decorator(method) return apply_decorator def dont_decorate(method): _methods_to_skip.add((get_class_from_method(method), method)) return method Here are things I have problems with: how to implement get_all_instance_methods function not sure if my cls.method_name = decorator(method) line is correct how to do the same to any methods added to a class in runtime how to apply this to subclasses how to implement get_class_from_method

    Read the article

  • list all likes to a certain post coming from my friends

    - by Max Favilli
    I know I can get posts (paginated, 25 at times) of a certain user with this: https://graph.facebook.com/575128756/posts And the likes of a certain post (paginated, 25 at times) with this GRAPH api call (I omit the first part of the url): /575128756_176517292390301/likes But if I want to get the likes from friends of the post user only? FQL could be an alternative (from table like and subqueries for friend and stream), but FQL seems so buggy in my tests I don't feel comfortable using it in a productive system. Is there anyway to achieve my target using the GRAPH api?

    Read the article

  • 400 bad request when calling a WCF service via jQuery/Ajax in a IIS7 server

    - by Max
    This is what the IIS log says: 2012-12-12 16:35:44 W3SVC1 server001 76.229.32.109 POST /Dashboard/svc/RunJob.svc/RunJob/ExecuteJob - 80 - 76.229.32.109 HTTP/1.1 Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.0;+WOW64;+Trident/4.0;+SLCC1;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.30729;+.NET+CLR+3.5.30729) ASP.NET_SessionId=poxpqp45rv2m3tuflzckix45 http ://server001/Dashboard/RunJob.aspx server001 400 0 0 2444 1423 1934 I have maxReceivedMessageSize set to a very high number. The weird thing is that the same code works in the lab but it wont work in production. Both environments (lab and production) are using the same web.config file. Any ideas? Thank you

    Read the article

  • Cocos 2D v1.0.1 : Crash at changing CCMenuItemImage normal image

    - by Max
    I retrieve a crash log file, which, after XCode analysis on my archive show the problematic line of code : Date/Time: 2012-12-08 23:48:08.930 +0100 OS Version: iPhone OS 5.1.1 (9B206) Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Crashed Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x31a4088f __exceptionPreprocess + 163 1 libobjc.A.dylib 0x3188b259 objc_exception_throw + 33 2 CoreFoundation 0x31a40789 +[NSException raise:format:] + 1 3 Foundation 0x374c73a3 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 91 4 Killer 0x0017ed35 -[CCSprite initWithFile:] (CCSprite.m:201) 5 Killer 0x0017e419 +[CCSprite spriteWithFile:] (CCSprite.m:93) 6 Killer 0x00123101 -[Player makeZombie] (Player.m:1363) 7 Killer 0x00105a51 -[PlayScene endOfKilling:] (PlayScene.m:1438) Which clearly indicates the second of the two following lines is crashing: NSLog(@"images %@ %@",self.zombieImage,self.zombieImageDown); [self.characterSprite setNormalImage:[CCSprite spriteWithFile:self.zombieImage]]; I know that the crash seem to happend when the user is touching the corresponding CCMeanuItemImage, is there a problem if the user is touching it, while we change the normal et selected images of it ? Is this the right manner to change its image (i do it several times during the game) ? Thanks for your ideas

    Read the article

  • Set text equal to string and pass to receipt printer at a different size on iOS

    - by Max Roper
    I am using the StarIO SDK to print text to a receipt printer and I am trying to get a certain line of text larger than the rest. I have some help from their support but I can't really get it to go. -(void)print{ NSMutableString *final=[NSMutableString stringWithFormat:@"-----"]; [final appendFormat:@"\n\nLevel:%@ Section:%@ Row:%@ Seat:%@", [response_dict objectForKey:@"level"], [response_dict objectForKey:@"section"],[response_dict objectForKey:@"row"],[response_dict objectForKey:@"seat"]]; There is a bunch of other stuff that is printing, but that is the line that I would like to be a different size than the rest. The StarIO support said that I should try and pass that to this... -(IBAction)PrintText { NSString *portName = [IOS_SDKViewController getPortName]; NSString *portSettings = [IOS_SDKViewController getPortSettings]; [PrinterFunctions PrintTextWithPortname:portName portSettings:portSettings heightExpansion:heightExpansion widthExpansion:widthExpansion textData:textData textDataSize:[textNSData length]]; free(textData); } Would love some help if possible. :) Thanks so much. This is the main bit I think I would need from the StarIO Text formatting doc... - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { array_hieghtExpansion = [[NSMutableArray alloc] init]; [array_hieghtExpansion addObject:@"1"]; [array_hieghtExpansion addObject:@"2"]; [array_hieghtExpansion addObject:@"3"]; [array_hieghtExpansion addObject:@"4"]; [array_hieghtExpansion addObject:@"5"]; [array_hieghtExpansion addObject:@"6"]; array_widthExpansion = [[NSMutableArray alloc] init]; [array_widthExpansion addObject:@"1"]; [array_widthExpansion addObject:@"2"]; [array_widthExpansion addObject:@"3"]; [array_widthExpansion addObject:@"4"]; [array_widthExpansion addObject:@"5"]; [array_widthExpansion addObject:@"6"]; array_alignment = [[NSMutableArray alloc] init]; [array_alignment addObject:@"Left"]; [array_alignment addObject:@"Center"]; [array_alignment addObject:@"Right"]; } return self; } and int heightExpansion = [pickerpopup_heightExpansion getSelectedIndex]; int widthExpansion = [pickerpopup_widthExpansion getSelectedIndex];

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >