Search Results

Search found 3476 results on 140 pages for 'alex holding'.

Page 2/140 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • PHP-FPM processes holding onto MongoDB connection states

    - by Brendan
    For the relevant part of our server stack, we're running: NGINX 1.2.3 PHP-FPM 5.3.10 with PECL mongo 1.2.12 MongoDB 2.0.7 CentOS 6.2 We're getting some strange, but predictable behavior when the MongoDB server goes away (crashes, gets killed, etc). Even with a try/catch block around the connection code, i.e: try { $mdb = new Mongo('mongodb://localhost:27017'); } catch (MongoConnectionException $e) { die( $e->getMessage() ); } $db = $mdb->selectDB('collection_name'); Depending on which PHP-FPM workers have connected to mongo already, the connection state is cached, causing further exceptions to go unhandled, because the $mdb connection handler can't be used. The troubling thing is that the try does not consistently fail for a considerable amount of time, up to 15 minutes later, when -- I assume -- the php-fpm processes die/respawn. Essentially, the behavior is that when you hit a worker that hasn't connected to mongo yet, you get the die message above, and when you connect to a worker that has, you get an unhandled exception from $mdb->selectDB('collection_name'); because catch does not run. When PHP is a single process, i.e. via Apache with mod_php, this behavior does not occur. Just for posterity, going back to Apache/mod_php is not an option for us at this time. Is there a way to fix this behavior? I don't want the connection state to be inconsistent between different php-fpm processes.

    Read the article

  • JavaScript, iPhone: Repeat Action while Holding Button

    - by Doug
    I am working on a website which I would like to work on iPhones, however I want it so they can tap and hold a button and have it continue firing the onclick event. I got it to work in other browsers, but the iPhone is the only one that will need to hold down the button. Is there a way to repeat a function when holding down the button? Thanks.

    Read the article

  • JavaScript setInterval loop not holding variable

    - by Ryan
    Here is my code: var showNo = 1; window.setInterval(function() { console.log(showNo); if(showNo === 1) { var nextNo = 2; } else if(showNo === 2) { var nextNo = 3; } else if(showNo === 3) { var nextNo = 4; } else if(showNo === 4) { var nextNo = 5; } else if(showNo === 5) { var nextNo = 1; } else { var showNo = 1; var nextNo = 2; } var showNo = nextNo; }, 500); My question is, why is the showNo variable not holding when the setInterval loop starts? The console displays 'undefined' in the above example. This may be a simple question, but I am trying to teach myself query and this has me stuck.. Any answers would be great. Thanks.

    Read the article

  • jQuery setInterval loop not holding variable

    - by Ryan
    Here is my code: var showNo = 1; window.setInterval(function() { if(showNo === 1) { var nextNo = 2; } else if(showNo === 2) { var nextNo = 3; } else if(showNo === 3) { var nextNo = 4; } else if(showNo === 4) { var nextNo = 5; } else if(showNo === 5) { var nextNo = 1; } else { var showNo = 1; var nextNo = 2; } var showNo = nextNo; }, 500); My question is, why is the showNo variable not holding when the setInterval loop starts? This may be a simple question, but I am trying to teach myself query and this has me stuck.. Any answers would be great. Thanks.

    Read the article

  • Exporting makefile from Eclipse CDT

    - by Alex Farber
    I have C++ project in the Ubuntu OS, Eclipse CDT. My final goal is to build the project binaries for FreeBSD OS. The first test. I create simple C++ CDT project with main.cpp file: cout << "OK" << endl; and build it. Then I open Terminal window in Release directory: alex@alex-linux:~/workspace/HelloWorld/Release$ ls HelloWorld main.d main.o makefile objects.mk sources.mk subdir.mk alex@alex-linux:~/workspace/HelloWorld/Release$ rm HelloWorld main.d main.o alex@alex-linux:~/workspace/HelloWorld/Release$ ls makefile objects.mk sources.mk subdir.mk alex@alex-linux:~/workspace/HelloWorld/Release$ make Building file: ../main.cpp Invoking: GCC C++ Compiler g++ -O3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp" Finished building: ../main.cpp Building target: HelloWorld Invoking: GCC C++ Linker g++ -o"HelloWorld" ./main.o Finished building target: HelloWorld alex@alex-linux:~/workspace/HelloWorld/Release$ ./HelloWorld OK alex@alex-linux:~/workspace/HelloWorld/Release$ So far, so good. Now I copy the whole project tree to FreeBSD and trying to build it: $ cd /home/alex/project $ ls main.cpp release $ cd release $ ls makefile objects.mk sources.mk subdir.mk $ make "makefile", line 5: Need an operator "makefile", line 10: Need an operator "makefile", line 11: Need an operator "makefile", line 12: Need an operator CDT-generated makefile doesn't work. This is makefile beginning: $ Automatically-generated file. Do not edit! -include ../makefile.init RM := rm -rf $ All of the sources participating in the build are defined here -include sources.mk -include subdir.mk -include objects.mk ... Line 5 is -include ../makefile.init. Really, there is no such file. But it works by some way on Ubuntu computer. What is the trick, how can I build this? BTW, manually written makefile works: all: g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.d" -o"main.o" "../main.cpp" g++ -o"HelloWorld" ./main.o Note: $ in makefile is actually #, I replaced it because # creates formatting problems inside of stackoverflow pre block.

    Read the article

  • Holding value in collection

    - by Amit Ranjan
    I have a application which is on timesheet. I have total of 54 columns out of which 10 columns are visible rest invisible. First 3 columns are Project, MileStone and Classes. Rest are Sun- Sat work hrs. Now I have a column named 'taskid' as SunTaskID,MonTaskID and so on till SatTaskID for holding each days taskid. Now on the selection of SunHrs (Sunday's Work Hrs), i retrieve that days taskid and on the basis of task id i retrieve attachments which is displayed under a listbox. Now the problem is that since a day can have multiple attachments and a user can attach multiple attachments at time. He can enter values from grid to. Grid cells are editable. I am using BindingList(of TaskClass) in VB.Net for binding grid. I have total 54 properties n my task class. So i want to what property do i need to hod each days attachment and in what way. Earlier I tried Dictionary. But i was not aware of its usage as a property so i gave. Then prepared a separate class for attachment but, it was difficult to synchronize the existing attachments with taskid...

    Read the article

  • MVC keeping the PartialView in its own context - ignore the main view holding the partial view

    - by Mike
    I'm looking at the partialview components of the MVC Framework. i want my partial view to be handled in its own action and for the rest of the view to handle itself, but i'm getting an exception because the main page is not getting its view fired. Am i going around this the wrong way? My Main View (Jobs/Index.aspx): <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MvcApplication3.Models.JobViewModel>" %> <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <% Html.RenderPartial("JobListing", Model.Jobs); %> </asp:Content> The partialview (Jobs/JobListing.ascx): <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<MvcApplication3.Models.Job>>" %> <table> <tr> <td> Job Title </td> <td> Job Location</td> </tr> <% foreach (var job in Model) { %> <tr> <td> <%= job.Title %> </td> <td> <%= job.Location %> </td> </tr> <% } %> <% Html.BeginForm("DoSomeStuff", "Job", null, FormMethod.Post); %> <%= Html.TextBox("SomeInfo") %> <button type="submit" id="submit" /> <% Html.EndForm(); %> The main controller for both the main view (Index) and the partialview (DoSomeStuff()) public class JobController : Controller { public ActionResult Index() { JobProvider provider = new JobProvider(Session); JobViewModel vm = new JobViewModel(); vm.Jobs = provider.GetJobs(); return View(vm); } public PartialViewResult DoSomeStuff() { return PartialView("JobListing"); } } As you can see in the partial view, it has its own form that posts to the Action called DoSomeStuff(). i want this action to handle any data submitted from that form. but when the form is submitted the main action (Index) does not fire and then i get an exception as the Model (.Models.JobViewModel) is not passed to the view that the partialview (JobListings) lives in. basically what im saying is, if i have a myview.aspx with lots of html.RenderPartialView('apartialview') that have forms in them, can i get it so these forms post to their own actions and the main view (with what ever model it inherits) is handled as well. Rather then having all the form submitting code in the main action for the view. am i do this wrong?

    Read the article

  • XDocument holding onto Memory?

    - by Jon
    I have an appplication that does a XDocument.Load from a 20mb file and then gets passed to a form to view its contents: openFileDialog1.FileName = ""; if (openFileDialog1.ShowDialog() == DialogResult.OK) { AuditFile = XDocument.Load(openFileDialog1.FileName); fmAuditLogViewer AuditViewer = new fmAuditLogViewer(); AuditViewer.ReportDocument = AuditFile; AuditViewer.Init(); AuditViewer.ShowDialog(); AuditViewer.Dispose(); AuditFile.RemoveNodes(); AuditFile = null; } In Task Manager I can see the memory being used by my application shoot up when I open this file. When I have finished viewing this file in my application I call : myXDocument.RemoveNodes(); myXDocument = null; However the memory use in Task Manager is still pretty high against my app. Is the XDocument still being held in memory and can I decrease the memory usage by my app?

    Read the article

  • What's holding up my PHP script?

    - by gAMBOOKa
    We've got a PHP crawler running on our web server. When the crawler is running, there are no cpu, memory or network bandwidth spikes. Everything is normal. But our website (also PHP), hosted on the same server, stops responding. Basically the crawler blocks any other php script from running. What could be the problem? EDIT: ** fsockopen is being used to download files to crawler! **

    Read the article

  • Dataflow Pipeline holding on to memory

    - by Jesse Carter
    I've created a Dataflow pipeline consisting of 4 blocks (which includes one optional block) which is responsible for receiving a query object from my application across HTTP and retrieving information from a database, doing an optional transform on that data, and then writing the information back in the HTTP response. In some testing I've done I've been pulling down a significant amount of data from the database (570 thousand rows) which are stored in a List object and passed between the different blocks and it seems like even after the final block has been completed the memory isn't being released. Ram usage in Task Manager will spike up to over 2 GB and I can observe several large spikes as the List hits each block. The signatures for my blocks look like this: private TransformBlock<HttpListenerContext, Tuple<HttpListenerContext, QueryObject>> m_ParseHttpRequest; private TransformBlock<Tuple<HttpListenerContext, QueryObject>, Tuple<HttpListenerContext, QueryObject, List<string>>> m_RetrieveDatabaseResults; private TransformBlock<Tuple<HttpListenerContext, QueryObject, List<string>>, Tuple<HttpListenerContext, QueryObject, List<string>>> m_ConvertResults; private ActionBlock<Tuple<HttpListenerContext, QueryObject, List<string>>> m_ReturnHttpResponse; They are linked as follows: m_ParseHttpRequest.LinkTo(m_RetrieveDatabaseResults); m_RetrieveDatabaseResults.LinkTo(m_ConvertResults, tuple => tuple.Item2 is QueryObjectA); m_RetrieveDatabaseResults.LinkTo(m_ReturnHttpResponse, tuple => tuple.Item2 is QueryObjectB); m_ConvertResults.LinkTo(m_ReturnHttpResponse); Is it possible that I can set up the pipeline such that once each block is done with the list they no longer need to hold on to it as well as once the entire pipeline is completed that the memory is released?

    Read the article

  • Second Thread Holding Up Entire Program in C# Windows Form Application

    - by Brandon
    In my windows form application, I'm trying to test the user's ability to access a remote machine's shared folder. The way I'm doing this (and I'm sure that there are better ways...but I don't know of them) is to check for the existence of a specific directory on the remote machine (I'm doing this because of firewall/other security restrictions that I'm confronted with in my organization). If the user has rights to access the shared folder, then it returns in no time at all, but if they don't, it hangs forever. To solve this, I threw the check into another thread and wait only 1000 milliseconds before determining that the share can't be hit by the user. However, when I do this, it still hangs as if it was never run in the same thread. What is making it hang and how do I fix it? I would think that the fact that it is in a separate thread would allow me to just let the thread finish on it's own in the background. Here is my code: bool canHitInstallPath = false; Thread thread = new Thread(new ThreadStart(() => { canHitInstallPath = Directory.Exists(compInfo.InstallPath); })); thread.Start(); thread.Join(1000); if (canHitInstallPath == false) { throw new Exception("Cannot hit folder: " + compInfo.InstallPath); }

    Read the article

  • holding session state with zend framework in iframe?

    - by princyp
    I have a php site optimized for iphone, its currently running inside of an iframe in a uiwebview objective c wrapper. Everything currently works except for the sessions inside of the iframe, Im assuming this is due to the cross domain issue with iframes and sessions? my solution is to save the sessions to the db. Is this the best solution? Will this even solve my problem? should I use memcache instead? are there any good tutorials for doing this? I havent been able to find an easy to implement solution for saving the session data, im a bit confused by the bootstrap.php and I keep getting this error when I try to add session saving: 'no adapter found for Zend_Session_SaveHandler_DbTable' any help would be greatly appreciated, thank you

    Read the article

  • Global NSMutableArray doesn't seem to be holding values

    - by diatrevolo
    I have a Cocos2D iPhone application that requires a set of CGRects overlaid on an image to detect touches within them. "Data" below is a class that holds values parsed from an XML file. "delegateEntries" is a NSMutableArray that contains several "data" objects, pulled from another NSMutableArray called "entries" that lives in the application delegate. For some strange reason, I can get at these values without problems in the init function, but further down the class in question, I try to get at these values, and the application crashes without an error message (as an example, I put in the "ccTouchBegan" method which accessess this data through the "populateFieldsForTouchedItem" method. Can anyone see why these values would not be accessible from other methods? No objects get released until dealloc. Thanks in advance! @synthesize clicked, delegate, data, image, blurImage, normalImage, arrayOfRects, delegateEntries; - (id)initWithTexture:(CCTexture2D *)aTexture { if( (self=[super initWithTexture:aTexture] )) { arrayOfRects = [[NSMutableArray alloc] init]; delegateEntries = [[NSMutableArray alloc] init]; delegate = (InteractivePIAppDelegate *)[[UIApplication sharedApplication] delegate]; delegateEntries = [delegate entries]; data = [delegateEntries objectAtIndex:0]; NSLog(@"Assigning %@", [[delegateEntries objectAtIndex:0] backgroundImage]); NSLog(@"%@ is the string", [[data sections] objectAtIndex:0]); //CGRect rect; NSLog(@"Count of array is %i", [delegateEntries count]); //collect as many items as there are XML entries for(int i=0; i<[delegateEntries count]; i++) { if([[delegateEntries objectAtIndex:i] xPos]) { NSLog(@"Found %i items", i+1); [arrayOfRects addObject:[NSValue valueWithCGRect:CGRectMake([[[delegateEntries objectAtIndex:i] xPos] floatValue], [[[delegateEntries objectAtIndex:i] yPos] floatValue], [[[delegateEntries objectAtIndex:i] xBounds] floatValue], [[[delegateEntries objectAtIndex:i] yBounds] floatValue])]]; } else { NSLog(@"Nothing"); } } //remove the following once the NSMutableArray from above works (legacy) blurImage = [[NSString alloc] initWithString:[data backgroundBlur]]; NSLog(@"5"); normalImage = [[NSString alloc] initWithString:[data backgroundImage]]; clicked = NO; } return self; } And then: - (void)populateFieldsForTouchedItem:(TouchedRect)touchInfo { Data *touchDatum = [[Data alloc] init]; touchDatum = [[self delegateEntries] objectAtIndex:touchInfo.recordNumber]; NSLog(@"Assigning %@", [[[self delegateEntries] objectAtIndex:touchInfo.recordNumber] backgroundImage]); rect = [[arrayOfRects objectAtIndex:touchInfo.recordNumber] CGRectValue]; image = [[NSString alloc] initWithString:[[touchDatum sections] objectAtIndex:0]]; [touchDatum release]; } - (BOOL)ccTouchBegan:(UITouch *)touch withEvent:(UIEvent *)event { TouchedRect touchInfo = [self containsTouchLocation:touch]; NSLog(@"Information pertains to %i", touchInfo.recordNumber); if ( !touchInfo.touched && !clicked ) { //needed since the touch location changes when zoomed NSLog(@"NOPE"); return NO; } [self populateFieldsForTouchedItem:touchInfo]; NSLog(@"YEP"); return YES; }

    Read the article

  • Holding variables in memory, C++

    - by b-gen-jack-o-neill
    Today something strange came to my mind. When I want to hold some string in C (C++) the old way, without using string header, I just create array and store that string into it. But, I read that any variable definition in C in local scope of function ends up in pushing these values onto the stack. So, the string is actually 2* bigger than needed. Because first, the push instructions are located in memory, but then when they are executed (pushed onto the stack) another "copy" of the string is created. First the push instructions, than the stack space is used for one string. So, why is it this way? Why doesn't compiler just add the string (or other variables) to the program instead of creating them once again when executed? Yes, I know you cannot just have some data inside program block, but it could just be attached to the end of the program, with some jump instruction before. And than, we would just point to these data? Because they are stored in RAM when the program is executed. Thanks.

    Read the article

  • string holding text every \n

    - by gcc
    I tried to take input in form of string, specifically: int i=0; char c[50][500]; for(;i<50;++i) scanf("%s",A[i]); The input is x is a website that allows the easy[1] creation and editing of any number of interlinked web pages via a web browser using a simplified markup language or a WYSIWYG text editor. In my program, I want the text to be stored as: A[0]="x is a website that allows the easy[1] creation and editing of any number of interlinked" A[1]=" web pages via a web browser using a simplified markup language or a WYSIWYG text editor." But my code causes the text to be stored as A[0]="is" A[1]="a" A[2]="website" .... What am I doing wrong?

    Read the article

  • taking and holding input

    - by gcc
    i tried to take input from user input like that input:: first line:>>name(white space)last name second line:>>identification number(white space)birtdate(,,:,,:) third line:>>lesson which he take (ce140 ce213 ce383...) last line:>>note he take(80 60 ......) this input type for each student i tried to hold this input in struct like struct name is first line { second line third line last line } my testing scanf("%[^\n]\n); take input hold in string scanf("%s",...secondline_name); storing in secondline_name . . . but this doesnot work are there any other way to hold input

    Read the article

  • Picking photo from Photochooser or holding hardware back button cause active timers ring

    - by Nznoonee
    This is very strange problem, and all the people I had asked to confirm it said that it takes place. I have a Threading.Timer instance which fires every 15 minutes. And if I call the PhotoChooser view and then select a photo from it, when going back to the calling page my application calls that timer's callback! I tried different timers either it be Timer from Threading namespace or Dispatcher timer. The same happens when being in my app I hold the back button of my device and then choose the app from the list. My application is as plain as it can be - the timer with a callback and method calling PhotoChooser. Could anyone help with solution or workaround please?

    Read the article

  • Programme d'étude sur le C++ bas niveau n° 2 : les types de données, un article d'Alex Darby traduit par Bousk

    Dans ce deuxième article sur le C++ bas niveau, Alex Darby aborde les types de données et leurs représentations internes. Programme d'étude sur le C++ bas niveau n° 2 : les types de données Quels sont les points les plus importants pour vous à connaître sur les types ? Connaissez-vous d'autres subtilités sur les types de données ? Bonne lecture. Retrouver l'ensemble des articles de cette série sur la

    Read the article

  • Programme d'étude sur le C++ bas niveau n° 3 : la Pile, un article d'Alex Darby traduit par ram-0000

    L'objectif de cette série d'articles d'Alex Darby sur la programmation « bas-niveau » est de permettre aux développeurs ayant déjà des connaissances de la programmation C++ de mieux comprendre comment ses programmes sont exécutés en pratique. Ce troisième article explique le rôle et le fonctionnement de la Pile, son usage lors de l'appel d'une fonction, la gestion des variables locales ainsi que la gestion de la valeur de retour d'une fonction. Programme d'étude sur le C++ bas niveau n° 3 : la Pile Connaissiez-vous bien le fonctionnement de la Pile et des appels de fonctions ?

    Read the article

  • Plug-in jQuery RoyalSlider de Dmitry Semenov : tutoriel et révision du code par Alex Young, traduction de vermine

    Je vous propose une traduction d'un tutoriel et d'une révision de code d'Alex Young à propos du plugin jQuery (payant) RoyalSlider de Dmitry Semenov. Ce plugin a reçu beaucoup de retours positifs. Il y a beaucoup de plugins du style des carrousels (slide), et ils ont tous des forces et des faiblesses différentes. Cependant, RoyalSlider est une très bonne galerie d'images jQuery réactive et activable également via les touches du clavier. Cet article montre que ce plugin est bien conçu et qu'il est performant.

    Read the article

  • what is wrong with this easy script

    - by alex
    what is wrong with this easy script? I just want to write an script which change my directory: A. I put below commands on the file witch its name is pathABC on the /home/alex directory, #!/bin/sh cd /home/alex/Documents/A/B/C echo HelloWorld B. also I did chmod +x pathABC , On the terminal when I am on the /home/alex directory, I run ./pathABC . But the output is just HelloWorld and the current directory remains with no change. I mean my directory remains as /home/alex and not go to the /home/alex/Documents/A/B/C. So where is wrong?

    Read the article

  • Why doesn't `cd` work in a shell script?

    - by alex
    what is wrong with this easy script? I just want to write an script which change my directory: A. I put below commands on the file witch its name is pathABC on the /home/alex directory, #!/bin/sh cd /home/alex/Documents/A/B/C echo HelloWorld B. also I did chmod +x pathABC , On the terminal when I am on the /home/alex directory, I run ./pathABC . But the output is just HelloWorld and the current directory remains with no change. I mean my directory remains as /home/alex and not go to the /home/alex/Documents/A/B/C. So where is wrong?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >