Search Results

Search found 8389 results on 336 pages for 'shared calendar'.

Page 80/336 | < Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >

  • Cocos2d: is it good practice to use a shared GameScene when having various levels?

    - by mm24
    In my code (based on the ShootEmUp example in this book, which I highly reccomend, source code in chapter 8 available here) I often use the trick of accessing the GameScene via: +(GameScene*) sharedGameScene; which returns a reference to the static instance of GameScene. Is a static instance of GameScene as in the book still a valid pattern in case I want a MainMenu calling GameScene initialized with different level data each time (e.g. different enemies)? (I have created a sceneWithId:(int) method where I load different level data each time. Or should I pheraps create a GameScene class and then sublcass it? E.g. FirstGameScene : GameScene

    Read the article

  • Ok to implement backend/shared functionality for iPhone in JavaScript?

    - by John Wright
    Is it ok to use the Webkit Javascript engine to implement cross-platform, non-GUI backend functionality on the iPhone, iPad? In my case, I was interested in re-using Javascript code that I have that works on top of SQLite. I thought I would need to re-implement the logic in Obj-C but perhaps I could just share it and expose some hooks into Obj-C using JSCocoa or straight through JavaScript core. Is this legal per Apple guidelines?

    Read the article

  • PHP max_execution_time ignored (no safe mode, no shared host, just localhost/windows7/php 5.3.1 and

    - by Felix
    This problem drives me nuts, because the max_execution_time in the php.ini and in the htaccess and reported from php is definitely higher, than reportet in the warning message. <?php echo "Max execution time: ".ini_get("max_execution_time")."<br />"; while(true) { sleep(1); } ?> Output: Max execution time: 240 Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\timetest.php on line 5

    Read the article

  • Are memory barriers necessary for atomic reference counting shared immutable data?

    - by Dietrich Epp
    I have some immutable data structures that I would like to manage using reference counts, sharing them across threads on an SMP system. Here's what the release code looks like: void avocado_release(struct avocado *p) { if (atomic_dec(p->refcount) == 0) { free(p->pit); free(p->juicy_innards); free(p); } } Does atomic_dec need a memory barrier in it? If so, what kind of memory barrier? Additional notes: The application must run on PowerPC and x86, so any processor-specific information is welcomed. I already know about the GCC atomic builtins. As for immutability, the refcount is the only field that changes over the duration of the object.

    Read the article

  • Shared WCF client code between .NET and Silverlight apps?

    - by Eduardo Scoz
    I'm developing a .NET application that will have both a WinForms and a Silverlight client. Although the majority of code will be in the server, I'll need to have quite a bit of logic in the clients as well, and I would like to keep the client library code the same. From what I could figure out so far, I need to have two different project types, a class library and a Silverlight class library, and link the files from one project to the other. This seems kind of lame, but it works for simple code. My problem, though, is that the code generated by the SVCUtil.exe to access WCF services is different from the code generated by the slsvcutil.exe, and the silverlight code is actually incompatible with the .NET one: I get a bunch of problems with the System.ServiceModel.Channel classes when I try to import the class into .NET. Has anybody done anything similar to this before? What am I doing wrong?

    Read the article

  • are runtime linking library globals shared among plugins loaded with dlopen?

    - by conejoroy
    I've a C++ program that links at runtime with, lets say, mylib.so. then, the same program uses dlopen()/dlsym() to load a function from myplugin.so, dynamic library that in turn has dependencies to mylib.so. My question is: will the program AND the function in the plugin access the same globals defined in mydlib.so in the same memory area reserved for the program, or each will be assigned different, unrelated copies in its own memory space? if the latter is the default behaviour, is it possible to change that? Thanks in advance =)!

    Read the article

  • How to properly recreate BITMAP, that was previously shared by CreateFileMapping()?

    - by zim22
    Dear friends, I need your help. I need to send .bmp file to another process (dialog box) and display it there, using MMF(Memory Mapped File) But the problem is that image displays in reversed colors and upside down. In first application I open picture from HDD and link it to the named MMF "Gigabyte_picture" HANDLE hFile = CreateFile("123.bmp", GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, "Gigabyte_picture"); In second application I open mapped bmp file and at the end I display m_HBitmap on the static component, using SendMessage function. HANDLE hMappedFile = OpenFileMapping(FILE_MAP_READ, FALSE, "Gigabyte_picture"); PBYTE pbData = (PBYTE) MapViewOfFile(hMappedFile, FILE_MAP_READ, 0, 0, 0); BITMAPINFO bmpInfo = { 0 }; LONG lBmpSize = 60608; // size of the bmp file in bytes bmpInfo.bmiHeader.biBitCount = 32; bmpInfo.bmiHeader.biHeight = 174; bmpInfo.bmiHeader.biWidth = 87; bmpInfo.bmiHeader.biPlanes = 1; bmpInfo.bmiHeader.biSizeImage = lBmpSize; bmpInfo.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); UINT * pPixels = 0; HDC hDC = CreateCompatibleDC(NULL); HBITMAP m_HBitmap = CreateDIBSection(hDC, &bmpInfo, DIB_RGB_COLORS, (void **)& pPixels, NULL, 0); SetBitmapBits(m_HBitmap, lBmpSize, pbData); SendMessage(gStaticBox, STM_SETIMAGE, (WPARAM)IMAGE_BITMAP,(LPARAM)m_HBitmap); ///////////// HWND gStaticBox = CreateWindowEx(0, "STATIC","", SS_CENTERIMAGE | SS_REALSIZEIMAGE | SS_BITMAP | WS_CHILD | WS_VISIBLE, 10,10,380, 380, myDialog, (HMENU)-1,NULL,NULL);

    Read the article

  • What is the best way to secure a shared git repo for a small distributed team ?

    - by ashy_32bit
    We have a Scala project and we decided to use git. The problem is we are a very small distributed team and we want nobody outside of the team to have even the read only access to our git server (which has a valid IP and is world-accessible in the IP level). I have heard the git-daemon has no authentication mechanism by itself and you should somehow integrate it with ssh or something. What is the best (and easiest) way to make the git server respond only to authorized users ? Or perhaps git-daemon is not for this task ? I may add that I am looking for a simple and straightforward approach. I don't want to compete with github ;-)

    Read the article

  • How do I define the default background color for window instances in a shared ResourceDictionary?

    - by Nicholas
    I can't seem to set a default background color for all of my windows in my application. Does anyone know how to do this? Currently I'm setting a theme in my App.xaml file like this. <Application> <Application.Resources> <ResourceDictionary Source="Themes/SomeTheme.xaml" /> This basically styles my entire application. Inside of SomeTheme.xaml I am trying to set a default color for all of my windows like this. <Style TargetType="{x:Type Window}"> <Setter Property="Background" Value="{DynamicResource MainColor}" /> </Style> This syntax works on a type of Button, but is completely ignored for Window. What am I doing wrong? Is there something special I have to do for a Window type.

    Read the article

  • Do Managers in Python Multiprocessing module lock the shared data?

    - by AnonProcess
    This Question has been asked before: http://stackoverflow.com/questions/2936626/how-to-share-a-dictionary-between-multiple-processes-in-python-without-locking However I have several doubts regarding the program given in the answer: The issue is that the following step isn't atomic d['blah'] += 1 Even with locking the answer provided in that question would lead to random results. Since Process 1 read value of d['blah'] saves it on the stack increments it and again writes it. In Between a Process 2 can read the d['blah'] as well. Locking means that while d['blah'] is being written or read no other process can access it. Can someone clarify my doubts?

    Read the article

  • how to have two controller actions, one shared view for Zend_Controller_Action Class?

    - by arendn
    Hi Guys, How do you specify a custom view script for a given Controller Action method? For example: Class UserGalleryController extends Zend_Controller_Action { public function fooAction() { $this->view->actionMsg = 'foo'; // (uses foo.phtml automagically) } public function barAction() { $this->view->actionMsg = 'bar'; //use foo's view script ????? } } I basically want to have one view script (foo.phtml) Thanks :-)

    Read the article

  • Web services or shared database for (game) server communication?

    - by jaaronfarr
    We have 2 server clusters: the first is made up of typical web applications backed by SQL databases. The second are highly optimized multiplayer game servers which keep all data in memory. Both clusters communicate with clients via HTTP (Ajax with JSON). There are a few cases in which we need to share data between the two server types, for example, reporting back and storing the results of a game (should ultimately end up in the database). We're considering several approaches for inter-server communication: Just share the MySQL databases between clusters (introduce SQL to the game servers) Sharing data in a distributed key-value store like Memcache, Redis, etc. Use an RPC technology like Google ProtoBufs or Apache Thrift Using RESTful web services (the game server would POST back to the web servers, for example) At the moment, we're leaning towards web services or just sharing the database. Sharing the database seems easy, but we're concerned this adds extra memory and a new dependency into the game servers. Web services provide good separation of concerns and fit with the existing Ajax we use, but add complexity, overhead and many more ways for communication to fail. Are there any other good reasons not to use one or the other approach? Which would be easier to scale?

    Read the article

  • Best way to have common class shared by both C++ and Ruby?

    - by shuttle87
    I am currently working on a project where a team of us are designing a game, all of us are proficient in ruby and some (but not all) of us are proficient in c++. Initially we made the backend in ruby but we ported it to c++ for more speed. The c++ port of the backend has exactly the same features and algorithms as the original ruby code. However we still have a bunch of code in ruby that does useful things but we want it to now get the data from the c++ classes. Our first thought was that we could save some of the data structures in something like XML or redis and call that, but some of the developers don't like that idea. We don't need anything particularly complex data structures to be passed between the different parts of the code, just tuples, strings and ints. Is there any way of integrating the ruby code so that it can call the c++ stuff natively? Will we need to embed code? Will we have to make a ruby extension? If so are there any good resources/tutorials you could suggest? For example say we have this code in the c++ backend: class The_game{ private: bool printinfo; //print the player diagnostic info at the beginning if true int numplayers; std::vector<Player*> players; string current_action; int action_is_on; // the index of the player in the players array that the action is now on //more code here public: Table(std::vector<Player *> in_players, std::vector<Statistics *> player_stats ,const int in_numplayers); ~Table(); void play_game(); History actions_history; }; class History{ private: int action_sequence_number; std::vector<Action*> hand_actions; public: void print_history(); void add_action(Action* the_action_to_be_added); int get_action_sequence_number(){ return action_sequence_number;} bool history_actions_are_equal(); int last_action_size(int street,int number_of_actions_ago); History(); ~History(); }; Is there any way to natively call something in the actions_history via The_game object in ruby? (The objects in the original ruby code all had the same names and functionality) By this I mean: class MyRubyClass def method1(arg1) puts arg1 self.f() # ... but still available puts cpp_method.the_current_game.actions_history.get_action_sequence_number() end # Constructor: def initialize(arg) puts "In constructor with arg #{arg}" #get the c++ object here and call it cpp_method end end Is this possible? Any advice or suggestions are appreciated.

    Read the article

  • Most proper way to use inherited classes with shared scopes in Mongo?

    - by Trip
    I have the TestVisual class that is inherited by the Game class : class TestVisual < Game include MongoMapper::Document end class Game include MongoMapper::Document belongs_to :maestra key :incorrect, Integer key :correct, Integer key :time_to_complete, Integer key :maestra_id, ObjectId timestamps! end As you can see it belongs to Maestra. So I can do Maestra.first.games But I can not to Maestra.first.test_visuals Since I'm working specifically with TestVisuals, that is ideally what I would like to pull. Is this possible with Mongo. If it isn't or if it isn't necessary, is there any other better way to reach the TestVisual object from Maestra and still have it inherit Game ?

    Read the article

  • How should flushing be handled in a doctrine EntityManager instance shared across different services in symfony2?

    - by Jbm
    I have defined several services in symfony 2 which persist changes to the database. These services have the doctrine instance as one of their dependencies: a.given.service: class: Acme\TestBundle\Service\AGivenService arguments: [@doctrine] If I have two different services and both of them persist objects through the EntityManager, which is obtained like this from the doctrine instance: $em = $doctrine->getEntityManager(); Would all services always share the same EntityManager? If so, how should I handle flushing if I wanted to handle all the changes in a single transaction? I have checked this: http://docs.doctrine-project.org/projects/doctrine-orm/en/2.0.x/reference/transactions-and-concurrency.html and it explains how to handle different transactions in a request, but I want to achieve the opposite, which is having different changes in different services handled as a single transaction. Is there a better approach to handle multiple changes in different services? For now my best bet is having a front-end service in charge of calling the other services and doing the flushing afterwards. Backend services would persist objects but would not do any flushing.

    Read the article

  • C++: static function member shared between threads, can block all?

    - by mhambra
    Hi all, I have a class, which has static function defined to work with C-style extern C { static void callback(foo bar) { } }. // static is defined in header. Three objects (each in separate pthread) are instantiated from this class, each of them has own loop (in class constructor), which can receive the callback. The pointer to function is passed as: x = init_function(h, queue_id, &callback, NULL); while(1) { loop_function(x); } So each thread has the same pointer to &callback. Callback function can block for minutes. Each thread object, excluding the one which got the blocking callback, can call callback again. If the callback function exists only once, then any thread attempting to callback will also block. This would give me an undesired bug, circa is interesting to ask: can anything in C++ become acting this way? Maybe, due to extern { } or some pointer usage?

    Read the article

  • GWT. Exclude shared domain objects to separate Maven module

    - by MyTitle
    I have some Domain classes such as Student, User etc which are used on server and client (gwt) sides. Can I exclude this domain classes to separate maven-module, so I can add this module as dependency to other maven-modules (i.e. add this module as dependency to maven-module which contains gwt related stuff, so this domain classes will be generated to JavaScript, and add this module as dependency to "normal" (not gwt) Java maven-modules, so this domain classes won’t be generated to JavaScript)?

    Read the article

< Previous Page | 76 77 78 79 80 81 82 83 84 85 86 87  | Next Page >