Daily Archives

Articles indexed Tuesday June 1 2010

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

  • SOQL Pagination for Salesforce API queries

    - by Daniel Ballinger
    Is there an efficient way to page through results from a SOQL query without bringing all the query results back and then discarding the majority of them? As an example, I'd like to be able to to page through the complete list of contacts showing 10 records at a time. I don't have the need to sort by any particular field.

    Read the article

  • Java / Tomcat memory leak in RedHat Linux?

    - by black-rocky
    Hi, I've got a Red Hat box with 6G memory running Tomcat and I'm trying to figure out how much memory I have left on the box. Problem is, top & jconsole is showing one figure (around 200M), and system monitor is showing a different figure (around 2G). Does anybody know what the difference is? I'm not sure if there is a memory leak happenning here, but the highest memory consumer is a tomcat process that's taking 2.2G of memory. Screenshots below:

    Read the article

  • PHP readfile() and large downloads

    - by Nirmal
    While setting up an online file management system, and now I have hit a block. I am trying to push the file to the client using this modified version of readfile: function readfile_chunked($filename,$retbytes=true) { $chunksize = 1*(1024*1024); // how many bytes per chunk $buffer = ''; $cnt =0; // $handle = fopen($filename, 'rb'); $handle = fopen($filename, 'rb'); if ($handle === false) { return false; } while (!feof($handle)) { $buffer = fread($handle, $chunksize); echo $buffer; ob_flush(); flush(); if ($retbytes) { $cnt += strlen($buffer); } } $status = fclose($handle); if ($retbytes && $status) { return $cnt; // return num. bytes delivered like readfile() does. } return $status; } But when I try to download a 13 MB file, it's just breaking at 4 MB. What would be the issue here? It's definitely not the time limit of any kind because I am working on a local network and speed is not an issue. The memory limit in PHP is set to 300 MB. Thank you for any help.

    Read the article

  • Failing to send key presses to a running process in C#

    - by Waffles
    I'm using the following code to put the focus on a window (in this case, a notepad window), and sending some key presses to it everytime button 2 is clicked. However, when I press button 2, nothing happens. Can anyone tell my why my sendkeys command is failing? public partial class Form1 : Form { [DllImport("user32.dll")] static extern bool ShowWindow(IntPtr hWnd, int nCmdShow); private Process s; public Form1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { this.s = new Process(); s.StartInfo.FileName = "notepad"; s.Start(); s.WaitForInputIdle(); } private void button2_Click(object sender, EventArgs e) { ShowWindow(s.MainWindowHandle, 1); SendKeys.SendWait("Hello"); } }

    Read the article

  • How to protect a form HTML/PHP with JS callback to AS3

    - by Jk_
    Hi guys, I'm developing a Flash website (as3) where I need to be able to upload directly to YouTube by using the DATA API. However in order to do so, I had to use a proper HTML form on top of my flash object. Why? Because of the Browser Based Upload restictions. I first hide the form using JQuery and with a little CSS the form is display just where I want it. Within flash I use ExternalInterface.call() to show/hide the form when I need it! ExternalInterface.call("YTUploader.showIt"); The upload process is working great my only problem is that the form can be displayed easily... You just need a tool like firebug and you can use the form wherever you want on my flash app. So I was wandering which will be the best way to 'protect' this form or the best way to limit its access. Any advices will be appreciated. Thanks for your time. Jk.

    Read the article

  • What features do you want to see in Windows Server?

    - by Ben Herila
    I work for the Windows Server planning and management team at Microsoft. While I can't share any of our current plans right now, I am interested in seeing what features people would like to see in the next release of Windows Server. Please post your ideas as separate answers, and vote for the ones you want to see. If there is an overwhelming response to an idea or two, I'll personally see what I can do to get the feature included. I know this question is subjective, but I do believe this thread has relevance to the community. Looking forward to hearing from you!

    Read the article

  • Reducing similar commands

    - by Kevin
    How can I reduce the amount of similar commands into a loop? Something like pictureBox7.BackColor = Color.FromArgb(187, 187, 187); pictureBox9.BackColor = Color.FromArgb(187, 187, 187); pictureBox10.BackColor = Color.FromArgb(187, 187, 187); pictureBox11.BackColor = Color.FromArgb(187, 187, 187); pictureBox12.BackColor = Color.FromArgb(187, 187, 187); pictureBox13.BackColor = Color.FromArgb(187, 187, 187); G2g for now, will add on later.

    Read the article

  • Check if there are any repeated elements in a array recursively

    - by devoured elysium
    I have to find recursively if there is any repeated element in an integer array v. The method must have the following signature: boolean hasRepeatedElements(int[] v) I can't see any way of doing that recursively without having to define another method or at least another overload to this method (one that takes for example the element to go after or something). At first I thought about checking for the current v if there is some element equal to the first element, then creating a new array with L-1 elements etc but that seems rather inefficient. Is it the only way? Am I missing here something?

    Read the article

  • How do you set up your web server & document's html to correctly serve HTML5 documents?

    - by joedevon
    Maybe I'm an idiot but I don't quite get what goes in the header of my HTML to use XHTML w/ HTML5. Is this still good and we just add the HTML5 tags?: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html dir="ltr" lang="eng" xmlns="http://www.w3.org/1999/xhtml"> Or is it <!DOCTYPE html> or what? Then at A List Apart they say: If you do go with XHTML 5, remember that your server must deliver the documents with a MIME type of application/xhtml+xml or text/xml. Please explain to me as if I was stupid :) what that means in a practical sense? "deliver the documents"? Meaning html? What happens to php? What are the steps required to set up your web server this way?

    Read the article

  • .net framework sdk version(csc.exe) using vcbuild.exe on the command line.

    - by r9r9r9
    I create a c# class library project named: testVcBuild, then use vcbuild.exe to build the project in the command line like: C:\Program Files\Microsoft Visual Studio 9.0\VC\vcpackages>vcbuild testVcBuild.csproj "Debug|Win32" the out put shows: Microsoft (R) Visual C++ Project Builder - Command Line Version 9.00.21022 Copyright (C) Microsoft Corporation. All rights reserved. Microsoft (R) Build Engine Version 2.0.50727.4927 [Microsoft .NET Framework, Version 2.0.50727.4927] Copyright (C) Microsoft Corporation 2005. All rights reserved. I found that the vcbuild.exe always call the "C:\Windows\Microsoft.NET\Framework\v2.0.50727\Csc.exe /noconfig .." the problem is how can I change the Framework version to v3.5? I found my project works fine with the v3.5 but it's broken in the v2.0.50727. I try to use msbuild.exe instead of vcbuild.exe, everything goes well, I just don't understand how can I make it with the vcbuild.exe? win7+vs2005+vs2008 installed.

    Read the article

  • does webapp has 'elseif' or 'elif' in template tags..

    - by zjm1126
    my code is : Hello!~~~ {% if user %} <p>Logged in as {{ user.first_name }} {{ user.last_name }}.</p> {% elif openid_user%} <p>Hello, {{openid_user.nickname}}! Do you want to <a href="{{openid_logout_url}}">Log out?</p> {% else %} <p><a href="/login?redirect={{ current_url }}">google Log in</a>.</p> <p><a href="/twitter">twitter Log in</a>.</p> <p><a href="/facebook">facebook Log in</a>.</p> <p><a href="{{openid_login_url}}">openid Log in</a>.</p> <iframe src="/_openid/login?continue=/"></iframe> {% endif %} the error is : TemplateSyntaxError: Invalid block tag: 'elif' does not webapp has a 'else if ' ? thanks

    Read the article

  • Modified jQuery innerfade sluggish

    - by Jay Hankins
    HI. I am using the jQuery innerfade plugin to scroll through some images on my site. Innerfade is sluggish to move on Firefox 3.6.3, and IE 8. IE 8 is much worse than Firefox, and Chrome runs smoothly. Can you analyze my code to see what the problem is? I've used the modified innerfade from here: http://www.stylephp.com/2009/01/17/customizing-jquery-innerfade-plug-in-adding-controls-navigation-and-caption/ My sites are here: Without bg image: http://dl.dropbox.com/u/145908/doozie2/index.html With bg image: http://dl.dropbox.com/u/145908/doozie2/index2.html Removing my background image fixes the situation; it's not that big of a file. I don't understand why that is an issue. I am using a technique to resize the image to fit the browser window, as you can see in the CSS. Thanks so much. P.S. Sorry, I'm a new user so I can't post more than one link. Please copy and paste the address between <.

    Read the article

  • Css3 Transition on background transparent not working in Chrome 5

    - by Ricardo Koch
    I`m trying to create an animation using CSS3 transition. The animation is a gradient background that should change his color (rgba). I used the webkit tag for the gradient and it`s working in Chrome 5.0.375.55. Looking into w3c site I see that "background-image - only gradients" is supported for the transition. (http://www.w3.org/TR/css3-transitions/) But I can only animate the background-color property with this version of chrome. With gradient the transition does not work. Does anyone managed to create an animation with background gradients?

    Read the article

  • How to build a widget for my website

    - by Gublooo
    Hey guys I'm very new to the whole programming - so far I only have experience with building websites, database etc. I currently have a website where users can share their online purchases. I want to build a widget that other websites can integrate on their site. Users should be able to insert their purchases directly through this widget without having to come to my website. Thats the idea but I have no idea how to go about it - can anyone point me in the right direction. Thanks

    Read the article

  • Problem in using a second call to send() in C

    - by Paulo Victor
    Hello. Right now I'm working in a simple Server that receives from client a code referring to a certain operation. The server receives this data and send back the signal that it's waiting for the proper data. /*Server Side*/ if (codigoOperacao == 0) { printf("A escolha foi 0\n"); int bytesSent = SOCKET_ERROR; char sendBuff[1080] = "0"; /*Here "send" returns an error msgm while trying to send back the signal*/ bytesSent = send(socketEscuta, sendBuff, 1080, 0); if (bytesSent == SOCKET_ERROR) { printf("Erro ao enviar"); return 0; } else { printf("Bytes enviados : %d\n", bytesSent); char structDesmontada[1080] = ""; bytesRecv = recebeMensagem(socketEscuta, structDesmontada); printf("structDesmontada : %s", structDesmontada); } } Following here is the client code responsible for sending the operation code and receiving the signal char sendMsg[1080] = "0"; char recvMsg[1080] = ""; bytesSent = send(socketCliente, sendMsg, sizeof(sendMsg), 0); printf("Enviei o codigo (%d)\n", bytesSent); /*Here the program blocks in a infinite loop since the server never send anything*/ while (bytesRecv == SOCKET_ERROR) { bytesRecv = recv(socketCliente, recvMsg, 1080, 0); if (bytesRecv > 0) { printf("Recebeu\n"); } Why this is happening only in the second attempt to send some data? Because the first call to send() works fine. Hope someone can help!! Thnks

    Read the article

  • Implement delegates for Core Data's fetched results controller or not

    - by Spanky
    What advantage is there to implementing the four delegate methods: (void)controllerWillChangeContent:(NSFetchedResultsController *)controller (void)controller:(NSFetchedResultsController *)controller didChangeSection:(id )sectionInfo atIndex:(NSUInteger)sectionIndex forChangeType:(NSFetchedResultsChangeType)type (void)controller:(NSFetchedResultsController *)controller didChangeObject:(id)anObject atIndexPath:(NSIndexPath *)indexPath forChangeType:(NSFetchedResultsChangeType)type newIndexPath:(NSIndexPath *)newIndexPath (void)controllerDidChangeContent:(NSFetchedResultsController *)controller rather than implement: (void)controllerDidChangeContent:(NSFetchedResultsController *)controller Any help appreciated // :)

    Read the article

  • SQL SERVER – Precision of SMALLDATETIME – A 1 Minute Precision

    - by pinaldave
    I am myself surprised that I am writing this post today. I am going to present one of the very known facts of SQL Server SMALLDATETIME datatype. Even though this is a very well-known datatype, many a time, I have seen developers getting confused with precision of the SMALLDATETIME datatype. The precision of the datatype SMALLDATETIME is 1 minute. It discards the seconds by rounding up or rounding down any seconds greater than zero. Let us see the following example DECLARE @varSDate AS SMALLDATETIME SET @varSDate = '1900-01-01 12:12:01' SELECT @varSDate C_SDT SET @varSDate = '1900-01-01 12:12:29' SELECT @varSDate C_SDT SET @varSDate = '1900-01-01 12:12:30' SELECT @varSDate C_SDT SET @varSDate = '1900-01-01 12:12:59' SELECT @varSDate C_SDT Following is the result of the above script and note that any value between 0 (zero) and 59 is converted up or down. The part that confuses the developers is the value of the seconds in the display. I think if it is not maintained or recorded, it should not be displayed as well. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: Pinal Dave, SQL, SQL Authority, SQL DateTime, SQL Query, SQL Scripts, SQL Server, SQL Tips and Tricks, T SQL, Technology

    Read the article

  • Is it possible to capture a window with windows 7 DWM thumbnail in it?

    - by Dogan Demir
    I am starting to believe that you can do nothing with Windows API. I have two windows. One has a DWM thumbnail in it. What I want to do is, I want to be able to capture the screen of the window with the thumbnail into the other one. When I do this, using bitblt, everything is copied except the thumbnail. It just isn't there in the bitmap. So how does the DWM rendering work? I mean, if DWM renders thumbnails directly onto the DC of the registered window, then my approach should work. I'm confused. Thanks a bunch.

    Read the article

  • PHP: Handling Multiple Submit Buttons

    - by sebb
    Would like to get a consensus as to what the best practice is in this scenario: Muliple submit buttons, is it better to handle this by having separate FORMS for each one of the submits, OR is it okay to have one form and check which button was pressed? thank you for your input :D

    Read the article

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