Search Results

Search found 3168 results on 127 pages for 'grand central dispatch'.

Page 98/127 | < Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >

  • Referencing not-yet-defined variables - Java

    - by user2537337
    Because I'm tired of solving math problems, I decided to try something more engaging with my very rusty (and even without the rust, very basic) Java skills. I landed on a super-simple people simulator, and thus far have been having a grand time working through the various steps of getting it to function. Currently, it generates an array of people-class objects and runs a for loop to cycle through a set of actions that alter the relationships between them, which I have stored in a 2d integer array. When it ends, I go look at how much they all hate each other. Fun stuff. Trouble has arisen, however, because I would like the program to clearly print what action is happening when it happens. I thought the best way to do this would be to add a string, description, to my "action" class (which stores variables for the actor, reactor, and the amount the relationship changes). This works to a degree, in that I can print a generic message ("A fight has occurred!") with no problem. However, ideally I would like it to be a little more specific ("Person A has thrown a rock at Person B's head!"). This latter goal is proving more difficult: attempting to construct an action with a description string that references actor and reactor gets me a big old error, "Cannot reference field before it is defined." Which makes perfect sense. I believe I'm not quite in programmer mode, because the only other way I can think to do this is an unwieldy switch statement that negates the need for each action to have its own nicely-packaged description. And there must be a neater way. I am not looking for examples of code, only a push in the direction of the right concept to handle this.

    Read the article

  • purblic or private svn repository server?

    - by ajsie
    is there a good and free svn repository i could use to store files in a central location for other programming members to access? its a private project so i dont want other to have access to it. should i use a free one or set up my own svn repository. if the latter is a better choice, how do i do that? rent a vps/dedicated server for it? cause i have to have a 24*7 online server up and running i guess...

    Read the article

  • How to keep Hibernate mapping use under control as requirements grow

    - by David Plumpton
    I've worked on a number of Java web apps where persistence is via Hibernate, and we start off with some central class (e.g. an insurance application) without any time being spent considering how to break things up into manageable chunks. Over time as features are added we add more mappings (rates, clients, addresses, etc.) and then amount of time spent saving and loading an insurance object and everything it connects to grows. In particular you get close to a go-live date and performance testing with larger amounts of data in each table is starting to demonstrate that it's all too slow. Obviously there are a number of ways that we could attempt to partition things up, e.g. map only the client classes for the client CRUD screens, etc., which would have been better to get in place earlier rather than trying to work it in at the end of the dev cycle. I'm just wondering if there are recommendations about ways to handle/mitigate this.

    Read the article

  • Designing a peer to peer network

    - by Varun
    I am designing a simple peer to peer network. The basic architecture will be as follows: A central server- that keeps track of all the peers. The job of this server is to keep track of all the peers that join the network. Every peer could do things: a. Download a file from it's peer b. Push a file (send a file) to it's peer. Could anybody please tell me what would be the best design for such a system? What would be the problems that i might run into and so on. I am planning to use Java as the programming language to implement. Would it be a good choice? Also, is it necessary that i would need a Linux box to develop the system? or is it fine if i use a Windows machine? Your help will be much appreciated! Thanks!

    Read the article

  • How do I use an index in an array reference as a method reference in Perl?

    - by Robert P
    Similar to this question about iterating over subroutine references, and as a result of answering this question about a OO dispatch table, I was wondering how to call a method reference inside a reference, without removing it first, or if it was even possible. For example: package Class::Foo; use 5.012; #Yay autostrict! use warnings; # a basic constructor for illustration purposes.... sub new { my $class = shift; return bless {}, $class; } # some subroutines for flavor... sub sub1 { say 'in sub 1' } sub sub2 { say 'in sub 2' } sub sub3 { say 'in sub 3' } # and a way to dynamically load the tests we're running... sub sublist { my $self = shift; return [ $self->can('sub1'); $self->can('sub3'}; $self->can('sub2'); ]; } package main; my $instance = Class::Foo->new(a => 1, b => 2, c => 3); my $tests = $instance->sublist(); my $index = int(rand($#{$tests})); # <-- HERE So, at HERE, we could do: my $ref = $tests->{$index}; $instance->$ref(); but how would we do this, without removing the reference first?

    Read the article

  • How to notify table-data change to a client program?

    - by JMSA
    Suppose I have an application that access data resident in a central DB server and more than one user access data from client machines networked with the DB server. Suppose two client machines are running a copy of the application and two users are accessing the same DB table. How can I automatically refresh the data on the GUI, that is being viewed by one client, as soon as a change is made by another client in the DB table-data? Which technology should be used to solve this particular scenario in .net? WCF?

    Read the article

  • Trying to find a good javascript function for hmac-sha1

    - by Darxval
    So i have been searching the web for a javascript source for an Hmac-sha1 algorithm. I saw Crypto's but i cant seem to get it to work, mainly because it has no idea what crypto means. (i copied the .js script functions into my script file) http://code.google.com/p/crypto-js/ I have my base64 encoded function already. that i got from here: http://nerds-central.blogspot.com/2007/01/fast-scalable-javascript-and-vbscript.html btw this for a twitter application using the new OAuth system. any help or links to where i can find anything on this would be helpful If you need me to elaborate let me know. thank you!

    Read the article

  • Load balancing and scheduling algorithms.

    - by Lukas Šalkauskas
    Hello there, so here is my problem: I have several different configuarion servers. I have different calculations (jobs); I can predict how long approximately each job will take to be caclulated. Also, I have priorities. My question is how to keep all machines loaded 99-100% and schedule the jobs in the best way. Each machine can do several calculations at a time. Jobs are pushed to the machine. The central machine knows the current load of each machine. Also, I would like to to assign some kind of machine learning here, because I will know statistics of each job (started, finished, cpu load etc.). How can I distribute jobs (calculations) in the best possible way, keeping in mind the priorities? Any suggestions, ideas, or algorithms ? FYI: My platform .NET.

    Read the article

  • How Do I Rollout WP-Cache To 1000 WordPress Blogs?

    - by Volomike
    My client has 1000 WordPress blogs hosted on a server for customers. Each one is in its own domain through cpanel and SuPHP, running in CGI mode on Apache2.2. Now he wants me (I'm the PHP programmer) to get WP-Cache loaded out on each of these blogs and not just activated, but enabled. He also wants the timeout value set to 2 days instead of the default setting. I have root on LAMP. What is the preferred way to roll out an update to each blog such that on a page view, it sees if WP-Cache is enabled or not. If not, it needs to copy it out from a central source, activate it, and then enable it along with the different timeout value being used.

    Read the article

  • Branching and remote heads in Mercurial

    - by hekevintran
    I created a new branch using this command: hg branch new_branch After the first commit to the new branch, the default branch becomes inactive. If this is pushed the central repository will have only one head which belongs to the new branch. When my colleague pushes his commits on the default branch, he will get this error: pushing to ssh://... searching for changes abort: push creates new remote heads! (did you forget to merge? use push -f to force) Is there anything bad about forcing the push? Why are remote heads bad? How do you work remotely on separate branches and push to one repository?

    Read the article

  • Noobie Jquery Question

    - by piratebill
    I've been working with Jquery fro a grand total of two hours now. Up until this point I have made this really simple FAQ page. <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $("#void").click(function(event) { event.preventDefault(); }); $('#faq').find('dd').hide().end().find('dt').click(function() { $(this).next().slideToggle(); }); }); </script> <dl id="faq"> <dt><a href="" id="void">Coffee</a></dt> <dd>- black hot drink</dd> <dt><a href="" id="void">Milk</a></dt> <dd>- white cold drink</dd> </dl> The problem is only the first item is working. My questions are, why is only the first entree working and how do I fix it? I've tried using an each() but I am unsure where to put it.

    Read the article

  • MapView EXC_BAD_ACCESS (SIGSEGV) and KERN_INVALID_ADDRESS

    - by user768113
    I'm having some 'issues' with my application... well, it crashes in an UIViewController that is presented modally, there the user enters information through UITextFields and his location is tracked by a MapView. Lets call this view controller "MapViewController" When the user submits the form, I call a different ViewController - modally again - that processes this info and a third one answers accordingly, then go back to a MenuVC using unwinding segues, which then calls MapViewController and so on. This sequence is repeated many times, but it always crashes in MapViewController. Looking at the crash log, I think that the MapView can be the problem of this or some element in the UI (because of the UIKit framework). I tried to use NSZombie in order to track a memory issue but it doesn't give me a clue about whats happening. Here is the crash log Hardware Model: iPad3,4 Process: MyApp [2253] OS Version: iOS 6.1.3 (10B329) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000044 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 IMGSGX554GLDriver 0x328b9be0 0x328ac000 + 56288 1 IMGSGX554GLDriver 0x328b9b8e 0x328ac000 + 56206deallocated instance 2 IMGSGX554GLDriver 0x328bc2f2 0x328ac000 + 66290 3 IMGSGX554GLDriver 0x328baf44 0x328ac000 + 61252 4 libGPUSupportMercury.dylib 0x370f86be 0x370f6000 + 9918 5 GLEngine 0x34ce8bd2 0x34c4f000 + 629714 6 GLEngine 0x34cea30e 0x34c4f000 + 635662 7 GLEngine 0x34c8498e 0x34c4f000 + 219534 8 GLEngine 0x34c81394 0x34c4f000 + 205716 9 VectorKit 0x3957f4de 0x394c7000 + 754910 10 VectorKit 0x3955552e 0x394c7000 + 582958 11 VectorKit 0x394d056e 0x394c7000 + 38254 12 VectorKit 0x394d0416 0x394c7000 + 37910 13 VectorKit 0x394cb7ca 0x394c7000 + 18378 14 VectorKit 0x394c9804 0x394c7000 + 10244 15 VectorKit 0x394c86a2 0x394c7000 + 5794 16 QuartzCore 0x354a07a4 0x35466000 + 239524 17 QuartzCore 0x354a06fc 0x35466000 + 239356 18 IOMobileFramebuffer 0x376f8fd4 0x376f4000 + 20436 19 IOKit 0x344935aa 0x34490000 + 13738 20 CoreFoundation 0x33875888 0x337e9000 + 575624 21 CoreFoundation 0x338803e4 0x337e9000 + 619492 22 CoreFoundation 0x33880386 0x337e9000 + 619398 23 CoreFoundation 0x3387f20a 0x337e9000 + 614922 24 CoreFoundation 0x337f2238 0x337e9000 + 37432 25 CoreFoundation 0x337f20c4 0x337e9000 + 37060 26 GraphicsServices 0x373ad336 0x373a8000 + 21302 27 UIKit 0x3570e2b4 0x356b7000 + 357044 28 MyApp 0x000ea12e 0xe9000 + 4398 29 MyApp 0x000ea0e4 0xe9000 + 4324 I think thats all, additionally, I would like to ask you: if you are using unwind segues then you are releasing view controllers from the memory heap, right? Meanwhile, performing segues let you instantiate those controllers. Technically, MenuVC should be the only VC alive in the heap during the app life cycle if you understand me.

    Read the article

  • MySQL query against pseudo-key-value pair data in WordPress custom query

    - by andrevr
    I'm writing a custom WordPress query to use some of the data which the Woothemes Diarise theme creates. Diarise is an event planner theme with calendar blah, blah... and uses custom fields to store the event start and end dates in WP custom fields in the *wp_postmeta* table, which implements a key-value store. So for each post in the "event" category, there are 2 records in *wp_postmeta*, named *event_start_date* and *event_end_date* that I'm interested in. The task is to compare a tourist's arrival and departure dates with the start and end dates of events, yielding a what's on list of events available. We thought we'd killed it with a grand flash of logic, that goes like this: Disregard any event that ends before the tourist arrives, and any that begin after the departure date. I wrote this query: SELECT wposts.* FROM wp_posts wposts LEFT JOIN wp_postmeta wpostmeta ON wposts.ID = wpostmeta.post_id LEFT JOIN wp_term_relationships ON (wposts.ID = wp_term_relationships.object_id) LEFT JOIN wp_term_taxonomy ON (wp_term_relationships.term_taxonomy_id = wp_term_taxonomy.term_taxonomy_id) WHERE wp_term_taxonomy.taxonomy = 'category' AND wp_term_taxonomy.term_id IN(3,4) AND ( wpostmeta.meta_key = 'event_start_date' AND NOT ( concat(subst(wpostmeta.meta_value,7,4),'-',subst(wpostmeta.meta_value,4,2),'-',subst(wpostmeta.meta_value,1,2) > '2010-07-31' ) ) AND ( wpostmeta.meta_key = 'event_end_date' AND NOT ( concat(subst(wpostmeta.meta_value,7,4),'-',subst(wpostmeta.meta_value,4,2),'-',subst(wpostmeta.meta_value,1,2) < '2010-05-01' ) ) ) ORDER BY wpostmeta.meta_value ASC And, of course it returns no records. The problem I believe is in the dual reference to wpostmeta.meta_key, but how to get around that?

    Read the article

  • Custom URL Schema and UTI

    - by user573259
    I define a Custom URL Schema for my iPhone App http://iphonedevelopertips.com/cocoa/lau…url-scheme.html or a custom UTI (Uniform type identifier) developer.apple.com/library/ios/#documentation/FileManagement/Conceptual/understanding_utis/understand_utis_declare/understand_utis_declare.html%23//apple_ref/doc/uid/TP40001319-CH204-SW1 -- Where is this information stored on the iphone? (I do not mean the Info.plist of the app - here must be a central file for such settings like keychain-2.db for passes and stuff) I got some very confusing behavior of an app that was compiled installed with different settings in the Info.plist for the file type (UTI) association and I would like to check if there is some trash (old settings) left from previous versions. Regards, Frood

    Read the article

  • S.redirectTo leads always to a blank screen

    - by Jaime Ocampo
    I am now playing a little bit with lift (2.8.0), and all the features in LiftRules work as intended. But I haven't been able to use S.redirectTo at all. I always ends with a blank screen, no matter what. No error messages at all! As an example, I have the following form: ... <lift:logIn.logInForm form="post"> <p><login:name /></p> <p><login:password /></p> <p><login:submit /></p> </lift:logIn.logInForm> ... And the code is: object LogIn extends helper.LogHelper { ... def logInForm(in: NodeSeq): NodeSeq = { var name = "" var password = "" def login() = { logger.info("name: " + name) logger.info("password: " + password) if (name == "test1") S.redirectTo("/example") if (name == "test2") S.redirectTo("/example.html") if (name == "test3") S.redirectTo("example.html") S.redirectTo("/") } bind("login", in, "name" -> SHtml.text(name, name = _), "password" -> SHtml.password(password, password = _), "submit" -> SHtml.submit("Login", login)) } } The method 'login' is invoked, I can check that in the log information. But as I said, no matter which name I enter, I always end with a blank screen, although 'examples.html' is available when being accessed directly in the browser. How should I invoke S.redirectoTo in order to navigate to 'examples.html'? Also, why don't I receive an error message (I am logging at a debug level)? I think all the configuration in Boot is correct, since all LitRules examples (statelessRewrite, dispatch, viewDispatch, snippets) work fine.

    Read the article

  • Ruby on Rails: Uploading a modifed site.

    - by Califer
    I'm having a heck of a time getting a site I modified to work correctly. I didn't set the site up originally, and since the person that set it up no longer works with me I had to learn ruby just to make some changes. I made all the changes in the development server and everything worked fine. Then I did a diff on the production and development and moved only my changes over. Unfortunately when I loaded my changes onto the production server I got a lot of errors. I've changed all of the permissions to 755, which took care being able to access anything at all, but after that I started getting a lot of 500 errors. Nothing showed up in the production.log file. I really have no clue what's going wrong except that perhaps things are not noticing the new changes. I moved the old site to a backup folder, and the new site crashes whenever it goes to anything that I've changed. In particular, I added a link to a new setup with an extra controller/model/view group. It works fine on development but in production it gives me a 404. Yes, I did copy all the files up. I even put everything back how it was, but the website is still showing the broken version of it. I checked the tmp/cache folder but it was empty. Running dispatch.fcgi shows the old site (which I expected) but it still shows the flawed new site when I connect through a browser. I've been tearing my hair out trying to get this to work. Any ideas as to how I can get this to work?

    Read the article

  • How to reorder table rows (drag-and-drop) along with their sub rows

    - by Eirik Johansen
    I have a table which looks like this (simplified for the example): <table> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> <tr class="lvl_1"> <td> Level 1 </td> </tr> <tr class="lvl_2"> <td> Level 2 </td> </tr> <tr class="lvl_3"> <td> Level 3 </td> </tr> The content in the rows with the lvl_3 class are children of the previous lvl_2 row, and the lvl_2 rows are children of the previous lvl_1. Had the data been a list, it would have looked something like this: Level 1 -- Level 2 ---- Level 3 Level 1 -- Level 2 ---- Level 3 I'm not looking to implement drag-and-drop sorting functionality, make it possible to rearrange the level 1 and two rows. The tricky part is that once I start moving a row, the corresponding children (and grand-children, if any) should move along with it. Is this even possible with the current markup, or do I have to rearrange the code? Thanks in advance !

    Read the article

  • Using Remote Web Server to Initialize iPhone App

    - by Chris_K
    My iPhone app relies on a vendor's XML feed to provide data. But that feed is not locked down. The vendor could change the format of the XML at any time, although so far they've promised not to. Since I might want to tell my app to use a different URL for its data source, I'd like to set up a single "Command Central" Web page, on my own server, to direct the app to the correct data source. In other words, each time my app starts, in the background and unseen by the user, it would visit "http://www.myserver.com/iphoneapp_data_sources.xml" to retrieve the URL for retrieving data from my vendor. That way, if my vendor suddenly changes the exact URL or the XML feed that the app needs, I can update that Web page and ensure that all installations of the app are using the correct XML feed. Does anyone have any advice or examples showing this kind of approach? It seems as if this must be a common problem, but so far I haven't found a well-established design pattern that fits it.

    Read the article

  • Looking for a wiki-style, standalone, version-control-"safe" documenation package

    - by basszero
    This may sound like it's not a programming related question, but stick with me here... My team and I have found that documenting our project (a development platform w/ API) with a wiki is both useful to us and useful to the users. Due to some organizational issues, we're forced to do multi-site development without network connectivity. We've switched to a DVCS (Mercurial) and had great success with this. The wiki documentation proves to be a problem as the central site is setup with MediaWiki. The offsite people have no way to access or edit the wiki. Is there any sort of wiki-style package which doesn't not require a server/database and will be useable in a DVCS environment? Update: Should be open-source and cross-platform

    Read the article

  • CSS - Best way to do a border like this (with link to a website as example)

    - by markzzz
    Hi to everybody. I need to do a border for my website that looks like this one. The only way I know is to split the website with 9 div, such : 1 2 3 4 5 6 7 8 9 and create 8 images, respectively: top-left (on 1) top central (on 2) top-right (on 3) left (on 4) right (on 6) bottom-left (on 7) bottom-center (on 8) bottom-right (on 9) The div 5 is attempt as main. But the whole strategy looks not so well-formed. Any tips? Thanks

    Read the article

  • Accessing a webpage in C++

    - by wyatt
    Is there a good, simple library which allows C++ to load a webpage? I just want to grab the source as text. I'm not using any IDE or significant library, just straight command line. Tangentially, is there something fundamental I'm missing about programming in C++? I would think any language in common use today would have droves of web-based functionality, being so central to computer usage, but I can find next to no discussion on how to accomplish it. I realise C++ significantly predates the modern internet, so it lacking any core ability in the regard is reasonable, but the fact that relevant libraries seem so sparse is baffling. Thanks for your help.

    Read the article

  • Android remote code loading

    - by sehugg
    I am developing a library for Android that requires frequent updates from a central server. I was thinking how nice it would be if my library could update itself -- or if I could just release a bootstrap library that downloads the target library when the app is installed. I see this class in 1.5 called "DexClassLoader" but there seems to be precious little on the web besides the API docs. Has anyone used this successfully for the scenario which I described? Also, do the terms of the Android Market permit such a thing?

    Read the article

  • Can Git push / pull over the internet to distributed repos?

    - by Quigrim
    I understand that Git can be used without a central repository. However, I am starting a project with several other people, and we are geographically distributed. I.e. We will never be on the same LAN to synch repos. So my question: Is it possible to push / pull changes from each others repos over the internet? If so, how do I go about it? Easiest non-fuss way. Thanx in advance.

    Read the article

  • Clarification on Threads and Run Loops In Cocoa

    - by dubbeat
    I'm trying to learn about threading and I'm thoroughly confused. I'm sure all the answers are there in the apple docs but I just found it really hard to breakdown and digest. Maybe somebody could clear a thing or 2 up for me. 1)performSelectorOnMainThread Does the above simply register an event in the main run loop or is it somehow a new thread even though the method says "mainThread"? If the purpose of threads is to relieve processing on the main thread how does this help? 2) RunLoops Is it true that if I want to create a completely seperate thread I use "detachNewThreadSelector"? Does calling start on this initiate a default run loop for the thread that has been created? If so where do run loops come into it? 3) And Finally , I've seen examples using NSOperationQueue. Is it true to say that If you use performSelectorOnMainThread the threads are in a queue anyway so NSOperation is not needed? 4) Should I forget about all of this and just use the Grand Central Dispatch instead?

    Read the article

  • Displaying performance metrics in a modern web app?

    - by Charles
    We're updating our ancient internal PHP application at work. Right now, we gather extensive performance measurements on every pageview, and log them to the database. Additionally, users requested that some of the metrics be displayed at the bottom of the page. This worked out pretty well for us, because the last thing that the application does on every request is include the file containing the HTML footer. The updated parts of the application use an MVC framework and a Dispatch/Request/Response loop. The page footer is no longer the last thing done. In fact, it could very well be the first thing done, before the rest of the page is created. Because we can grab the Response before it's returned to the user, we could try to include placeholders for the performance metrics in the footer and simply replace them with the actual numbers, but this strikes me as a bad idea somehow. How do you handle this in your modern web app? While we're using PHP, I'm curious how it's done in a Ruby/Rails app, and in your favorite Python framework.

    Read the article

< Previous Page | 94 95 96 97 98 99 100 101 102 103 104 105  | Next Page >