Search Results

Search found 20484 results on 820 pages for 'small projects'.

Page 220/820 | < Previous Page | 216 217 218 219 220 221 222 223 224 225 226 227  | Next Page >

  • Install MySQLdb on a Mac

    - by Youcha
    I have Python 32 bits, I installed MySQL Community server 32 bits and I'm trying to install MySQLdb for Python. I run easy_install mysql-python and I have this error > easy_install mysql-python Searching for mysql-python Reading http://pypi.python.org/simple/mysql-python/ Reading http://sourceforge.net/projects/mysql-python/ Reading http://sourceforge.net/projects/mysql-python Best match: MySQL-python 1.2.4b5 Downloading http://pypi.python.org/packages/source/M/MySQL-python/MySQL-python-1.2.4b5.zip#md5=4f645ed23ea0f8848be77f25ffe94ade Processing MySQL-python-1.2.4b5.zip Running MySQL-python-1.2.4b5/setup.py -q bdist_egg --dist-dir /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/egg-dist-tmp-GjLaFB Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.28.tar.gz Extracting in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R Now working in /var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/temp/tmpOVVY_R/distribute-0.6.28 Building a Distribute egg in /private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5 /private/var/folders/ke/ke8HKCuzGB4LMCJ1eIAGqk+++TI/-Tmp-/easy_install-W_yT0e/MySQL-python-1.2.4b5/distribute-0.6.28-py2.6.egg unable to execute gcc-4.0: No such file or directory error: Setup script exited with error: command 'gcc-4.0' failed with exit status 1 Any idea on why gcc-4.0 cannot be found? I have Xcode and gcc 4.2.1 installed.

    Read the article

  • Ivy failed to resolve dependency : What to check, what to do ?

    - by fardon57
    Hi everyone, I'm using Ivy to resolve dependency in my very small project. It's the first time I'm doing that and it's more to learn as my project is very small. I had a problem 5 minutes ago, when trying to download log4j. My configuration is very basic, I have an ant task : <target name="resolve" description="--> retrieve dependencies with ivy"> <ivy:retrieve/> </target> and my Ivy.xml file is like this : <dependency org="javax.servlet" name="servlet-api" rev="2.5" /> <dependency org="log4j" name="log4j" rev="1.2.15" /> </dependencies> The problem is seems to happen when ivy tries to download jms 1.1 (I suppose it's needed for log4j) as I can see in the console : : ::::::::::::::::::::::::::::::::::::::::::::: [ivy:retrieve] :: FAILED DOWNLOADS :: [ivy:retrieve] :: ^ see resolution messages for details ^ :: [ivy:retrieve] :::::::::::::::::::::::::::::::::::::::::::::: [ivy:retrieve] :: javax.jms#jms;1.1!jms.jar [ivy:retrieve] :: com.sun.jdmk#jmxtools;1.2.1!jmxtools.jar [ivy:retrieve] :: com.sun.jmx#jmxri;1.2.1!jmxri.jar [ivy:retrieve] :::::::::::::::::::::::::::::::::::::::::::::: Is there anything I can do ? Thanks a lot guys. F

    Read the article

  • Starting with versioning mysql schemata without overkill. Good solutions?

    - by tharkun
    I've arrived at the point where I realise that I must start versioning my database schemata and changes. I consequently read the existing posts on SO about that topic but I'm not sure how to proceed. I'm basically a one man company and not long ago I didn't even use version control for my code. I'm on a windows environment, using Aptana (IDE) and SVN (with Tortoise). I work on PHP/mysql projects. What's a efficient and sufficient (no overkill) way to version my database schemata? I do have a freelancer or two in some projects but I don't expect a lot of branching and merging going on. So basically I would like to keep track of concurrent schemata to my code revisions. [edit] Momentary solution: for the moment I decided I will just make a schema dump plus one with the necessary initial data whenever I'm going to commit a tag (stable version). That seems to be just enough for me at the current stage.[/edit] [edit2]plus I'm now also using a third file called increments.sql where I put all the changes with dates, etc. to make it easy to trace the change history in one file. from time to time I integrate the changes into the two other files and empty the increments.sql[/edit]

    Read the article

  • Valueurl Binding On Large Arrays Causes Sluggish User Interface

    - by Hooligancat
    I have a large data set (some 3500 objects) that returns from a remote server via HTTP. Currently the data is being presented in an NSCollectionView. One aspect of the data is a path pack to the server for a small image that represents the data (think thumbnail for simplicity). Bindings works fantastically for the data that is already returned, and binding the image via a valueurl binding is easy to do. However, the user interface is very sluggish when scrolling through the data set - which makes me think that the NSCollectionView is retrieving all the image data instead of just the image data used to display the currently viewable images. I was under the impression that Cocoa controls were smart enough to only retrieve data for the information that is actually being output to the user interface through lazy loading. This certainly seems to be the case with NSTableView - but I could be misguided on this thought. Should valueurl binding act lazily and, moreover, should it act lazily in an NSCollectionView? I could create a caching mechanism (in fact I already have such a thing in place for another application - see my post here if you are interested http://stackoverflow.com/questions/1740209/populating-nsimage-with-data-from-an-asynchronous-nsurlconnection) but I really don't want to go this route if I don't have to for this specific implementation as the user could potentially change data sets often and may only want small sub-sets of the data. Any suggested approaches? Thanks!

    Read the article

  • typed-dataset initializer problem with C# windows app.

    - by Eyla
    Greetings, I'm working in windows application using C#. I have typed-dataset called packetsDBDataSet and it has table adapter called packetsTableAdapter with method to insert data called InsertPackets(). when I want to insert new data I used a code that I used before with asp.net page and it was working ok but not I'm getting error. here is the code: public packetsDBDataSetTableAdapters.packetsTableAdapter ds = new packetsDBDataSetTableAdapters.packetsTableAdapter(); public packetsDBDataSet.packetsDataTable insert = ds.InsertPackets(); and here is the error: Error 1 A field initializer cannot reference the non-static field, method, or property 'Packets.Form1.ds' C:\Users\Ali\Documents\Visual Studio 2008\Projects\Packets-3\Packets\Packets\Form1.cs 26 59 Packets I already included to my project: using Packets; using Packets.packetsDBDataSetTableAdapters; please advice to solve this problem. Update : I also tried : public packetsDBDataSetTableAdapters.packetsTableAdapter ds = new packetsDBDataSetTableAdapters.packetsTableAdapter(); ds.InsertPackets("1","2","3"); and I'm getting this error: Error 1 Invalid token '(' in class, struct, or interface member declaration C:\Users\Ali\Documents\Visual Studio 2008\Projects\Packets-3\Packets\Packets\Form1.cs 28 29 Packets

    Read the article

  • Cygwin Cruisecontrol cannot execute commands

    I'm having what I hope to be a simple problem. However, it's had me stumped all day. I'm working with cruisecontrol in windows, being set up through Cygwin. I have some CC experience in the linux platform and much of what I'm doing is very similar. However, most any command I try to execute in the config.xml file's Schedule section is giving an error. Here's the exception: ExecBuilder - Could not execute command: /cygdrive/d/Program\ Files/Subversion/bin/svn net.sourceforge.cruisecontrol.CruiseControlException: Encountered an IO exception while attempting to execute 'net.sourceforge.cruisecontrol.builders.ExecScript@b80f1c'. CruiseControl cannot continue. at net.sourceforge.cruisecontrol.builders.ScriptRunner.runScript(ScriptRunner.java:133) Here are some examples of commands I've tried to run which give this type of error. <exec command="${CCLoc}/projects/${project.name}/IOSdllScript"/> -Runs a script that I tested outside of the cruisecontrol.bat and it runs. Includes #!/bin/sh as the first line <exec command="${CCLoc}/projects/${project.name}/EmptyFile"/> -Essentially an empty text file, proving that the problem had nothing to do with my script. <exec command="/cygdrive/d/Program\ Files/Subversion/bin/svn" args="cleanup" workingdir="${svndir}"/> -Trys svn cleanup on a directory. I double checked the pathing and spelling. One command that I tested worked and didn't give this error. That command was touch. <exec command="touch" args="ABC.txt"/> I'm not sure why only touch seems to work and nothing else does. Thank you for your help.

    Read the article

  • How to convert a printer driver to a stand-alone console application which can generate a printer fi

    - by Thorbjørn Ravn Andersen
    I have a situation where the only way to generate a certain datafile is to print it manually to FILE: under Windows and save it in a file for further processing. I would really like to have a small stand-alone program which embeds this binary printer driver so I can run it from a batch file and have it generate that binary file for me, as we can then fully automate the "save file in Visio, 'print' it and upload it to the final destination and trigger a remote test". Is this possible with a suitable Windows SDK? I am a Java programmer, so I do not know Visual Studio and the possibilities with MSDN - yet! - but I'd appreciate pointers. EDIT: I have the installation files for that printer driver, both 32 and 64 bit. Older versions may include a 16 bit driver. EDIT: The "print to FILE:" functionality is just what was recommended by the documentation. I have played a little bit with using the LPR-protocol to see what it can do. I'd still prefer the "invoke small binary" approach.

    Read the article

  • PHP CodeIgniter Framework - Thoughts on developing with it?

    - by Sootah
    I've been reviewing different frameworks to use for my next couple of major web applications, and after days of research am almost set on using CodeIgniter. The reason I'm leaning towards CI is that so far it looks to be the best suited for me. It doesn't require constant command-line access (I am currently using shared hosting; the projects do not warrant a dedicate server yet), nothing special has to be installed on the server running it (you just upload the framework to the root of whatever your developing), and they appear to have some excellent documentation, videos, and tutorials on how to get started. Do any of you have experience with CodeIgniter? If so, what is your opinion of it and its features? What had you developed with it, and what types of applications is it best suited to create? I certainly don't want to get into a situation where I'm trying to bend a framework to do something that it isn't well-suited for. Both of my projects will be database-driven apps that will require user registration, the ability to manipulate data that is specific to their account (their posts, listings, user account details, etc), amongst other things. Also, if you have any other PHP framework suggestions, I am open to them. Thanks in advance for your help! -Sootah

    Read the article

  • jQuery UI slider coming out looking wierd

    - by jondavidjohn
    http://cl.ly/2W1V3s0G2G3y3D133I3U <--screenshot of rendered slider It acts normally by clicking the inner whitespace of the slider and dragging, values act accordingly, but the handles do not move and fill the area, and the line at the top grows/shrinks with the difference of the two values. Here is the code I am using to initiate the slider. $('.sliderific').each(function(){ alert($(this).attr('id')); $(this).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $(this).nextAll('.left:first').text(ui.values[ 0 ]); $(this).nextAll('.right:first').text(ui.values[ 1 ]); } }); }); and here is the DOM it's being applied to... <div class="white notwide"> <div id="price-slider" class="sliderific"></div> <span class="em small gray left center">Min Price</span> <span class="em small gray right center">Max Price </span> </div> EDIT : Also, I have verified I am including the proper css and the jquery theme images are connecting and being loaded.

    Read the article

  • Control pdb file output from build defintion file

    - by Urvi
    Hello, I am trying to generate a release build with no pdb files generated. I have seen numerous posts that suggest right-clicking on the project, selecting Properties, going to the Build tab and then to the Advanced... butoon and changing Debug Info to none. This works and all, but I need to do this for a build of ~50 solutions which contain ~25 projects each! Other posts mention editing the appropriate .csproj file, but again, with so many projects, this would take a long time. Is there any way to achieve this via the TFSBuild.proj file? I have tried adding the following to the TFSBuild.proj file, with no luck. <PropertyGroup> <Configuration>Release</Configuration> <Platform>AnyCPU</Platform> </PropertyGroup> <PropertyGroup> <DebugSymbols>false</DebugSymbols> <DebugType>none</DebugType> <Optimize>true</Optimize> </PropertyGroup> The following line prints out Release|AnyCPU, none, and false, but I still see .pdb file in the $(OutputDir) folder. <Message Text="$Configuration|Platform): $(Configuration)|$(Platform)" /> <Message Text="DebugType is: $(DebugType)"/> <Message Text="DebugSymbols is: $(DebugSymbols)"/> Thanks in advance, Urvi

    Read the article

  • With Go, how to append unknown number of byte into a vector and get a slice of bytes?

    - by Stephen Hsu
    I'm trying to encode a large number to a list of bytes(uint8 in Go). The number of bytes is unknown, so I'd like to use vector. But Go doesn't provide vector of byte, what can I do? And is it possible to get a slice of such a byte vector? I intends to implement data compression. Instead of store small and large number with the same number of bytes, I'm implements a variable bytes that uses less bytes with small number and more bytes with large number. My code can not compile, invalid type assertion: 1 package main 2 3 import ( 4 //"fmt" 5 "container/vector" 6 ) 7 8 func vbEncodeNumber(n uint) []byte{ 9 bytes := new(vector.Vector) 10 for { 11 bytes.Push(n % 128) 12 if n < 128 { 13 break 14 } 15 n /= 128 16 } 17 bytes.Set(bytes.Len()-1, bytes.Last().(byte)+byte(128)) 18 return bytes.Data().([]byte) // <- 19 } 20 21 func main() { vbEncodeNumber(10000) } I wish to writes a lot of such code into binary file, so I wish the func can return byte array. I haven't find a code example on vector.

    Read the article

  • APC values randomly disappear

    - by Michael
    I'm using APC for storing a map of class names to class file paths. I build the map like this in my autoload function: $class_paths = apc_fetch('class_paths'); // If the class path is stored in application cache - search finished. if (isset($class_paths[$class])) { return require_once $class_paths[$class]; // Otherwise search in known places } else { // List of places to look for class $paths = array( '/src/', '/modules/', '/libs/', ); // Search directories and store path in cache if found. foreach ($paths as $path) { $file = DOC_ROOT . $path . $class . '.php'; if (file_exists($file)) { echo 'File was found in => ' . $file . '<br />'; $class_paths[$class] = $file; apc_store('class_paths', $class_paths); return require_once $file; } } } I can see as more and more classes are loaded, they are added to the map, but at some point the apc_fetch returns NULL in the middle of a page request, instead of returning the map. Getting => class_paths Array ( [MCS\CMS\Helper\LayoutHelper] => /Users/mbl/Documents/Projects/mcs_ibob/core/trunk/src/MCS/CMS/Helper/LayoutHelper.php [MCS\CMS\Model\Spot] => /Users/mbl/Documents/Projects/mcs_ibob/core/trunk/src/MCS/CMS/Model/Spot.php ) Getting => class_paths {null} Many times the cached value will also be gone between page requests. What could be the reason for this? I'm using APC as an extension (PECL) running PHP 5.3.

    Read the article

  • ASP.NET MVC static-asset aides/practices

    - by shannon
    I want to keep assets that are only used by one view in a view-specific folder, so my Search.aspx properly finds images/*.jpg, and helps me maintain my convention: ~/Areas/Candidate/Views/Job/Search.aspx -> ~/Assets/Candidate/Job/Search/images/*.jpg Perhaps with the ability to easily reference controller- or area-common assets manually or automatically: ~/Assets/Candidate/Job/images/*.jpg ~/Assets/Candidate/images/*.jpg If you wonder why I'm doing this, then speak up; I'm probably missing something. But here's why: I don't want stale static assets sitting in my ASP.NET MVC projects, which I expect to be an automatic outcome of the ~/Assets/Images folder: i.e. As a shared asset loses its last reference-count, who knows to delete it, especially with it being so difficult to trace content link validity in MVC projects? How do you, personally, do this? I can imagine, for example: Implement HtmlHelper extension methods for URL-generation. Extending ViewPage and ViewMasterPage with URL-generation methods. Implementing an inbound request filter to search related folders for static assets. and, are there good libraries out there for this? For example, something that also automatically appends timestamps for .JS and .CSS files, writes the / tags for me, and maybe even that allows me to inject includes in the head section from outside head code?

    Read the article

  • How do I stop the m2eclipse plugin interfering with command line mvn builds?

    - by locka
    I use the m2eclipse plugin in Eclipse so that I can import a Maven project. The plugin reads the pom.xml and sorts out the dependencies in the projects in an Eclipse friendly way so I'm not looking at a sea of broken references and errors. I use Eclipse for code development however I usually build the projects from the command line, e.g. "mvn clean install". Unfortunately when I do this, m2eclipse detects disk activity and attempts to rebuild the workspace. This interferes with the command line build and sometimes results in a race condition. For example the command line might be in its clean phase but fails because it tries to delete a file or directory which is locked during the workspace rebuild. Aside from that workspace rebuilding is incredibly slow, and between failed builds and wasted CPU my build process is 2-3x longer than it should be. It isn't an option to not use Eclipse (e.g. to use Netbeans), or to disable m2eclipse. It is a useful plugin except for this behaviour. So my question is, how do I stop m2eclipse from rebuilding the workspace all the time? Can I invoke a manual refresh and otherwise disable this behaviour?

    Read the article

  • unable to delete file (jpeg)

    - by ile
    I implemented helper for showing thumbnails from here Next to thumbnail, there is delete link which calls this controller // // HTTP POST: /Photo/Delete/1 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Delete(int id, string confirmButton) { var path = "~/Uploads/Photos/"; Photo photo = photoRepository.GetPhoto(id); if (photo == null) return View("NotFound"); FileInfo TheFile = new FileInfo(Server.MapPath(path + photo.PhotoID + ".jpg")); if (TheFile.Exists) { photoRepository.Delete(photo); photoRepository.Save(); TheFile.Delete(); } else return View("NotFound"); return View(); } If I disable showing thumbnails then the file is deleted. Otherwise it sends error: System.IO.IOException: The process cannot access the file 'C:\Documents and Settings\ilija\My Documents\Visual Studio 2008\Projects\CMS\CMS\Uploads\Photos\26.jpg' because it is being used by another process. I also don't know if my file delete function is properly written. Searching on the net, I see everyone uses File.Delete(TheFile);, which i'm unable to use and I use TheFile.Delete(); For File.Delete(TheFile); i get following error: Error 1 'System.Web.Mvc.Controller.File(string, string, string)' is a 'method', which is not valid in the given context C:\Documents and Settings\ilija\My Documents\Visual Studio 2008\Projects\CMS\CMS\Controllers\PhotoController.cs 109 17 CMS Am I missing something here? Thanks in advance

    Read the article

  • jQuery: hard time to get <embed> element

    - by Patrick
    hi, how can I get the embed element with jQuery ? (I spent enough time trying with "children(), find(), last() jquery functions). This is my code. Until here it works, I would like to get the second children (embed). $('div.filefield-file').each(function(index) { console.log($(this).children()); }); </script> This is HTML code: Scheduling Video <div class="field-item even"> <div class="filefield-file clear-block"><div class="filefield-icon field-icon-video-x-flv"><img class="field-icon-video-x-flv" alt="video/x-flv icon" src="http://localhost/drupal/sites/all/modules/filefield/icons/protocons/16x16/mimetypes/video-x-generic.png"></div><div style="background-color: rgb(255, 255, 255); width: 400px;"><embed style="display: block;" src="/drupal/videoPlayer.swf?file=http://localhost/drupal/sites/default/files/files/projects/Project3/videos/screenshot.flv" type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" bgcolor="#ffffff" allowfullscreen="true" autoplay="true" flashvars="file=http://localhost/drupal/sites/default/files/files/projects/Project3/videos/screenshot.flv" height="400" width="400"><div>screenshot.flv</div></div></div> </div>

    Read the article

  • Handling learning curve for new developers

    - by pete the pagan-gerbil
    Our company likes to hire new developers, with no experience. We have a core set of skills that we try to get them up to speed with, like ASP.NET and WinForms - to teach basic programming, the .NET languages, and the things they'll need to maintain and write. We also try and mentor them through early projects, so they can learn from someone more experienced. Recently, we've been seeing the benefits of new frameworks like MVC and ideas like Unit Testing and TDD (by extension, dependancy injection and IoC), and we'd like to start using these in the team. However, this increases the time that a junior would have before they can get started on a new project - because doing something like unit tests wrong could cause major headaches months or years later in maintenance, especially if we believe unit tests to be comprehensive. How do you handle the huge amount of things that a junior will need to take on, acknowledging that the business wants them working independantly as soon as possible? Is it acceptable to tell them not to unit test till a while after they are independant (and give them small, simpler projects in the meantime) before taking them to 'level 2' of the core skills?

    Read the article

  • Applying for .net jobs as a "self learner"

    - by DeanMc
    Hi All, I have recently started applying for .Net jobs. I currently work in a sales role with a large telco. I found out quite late that I like programming and as such bought my house and made commitments that mean college is not an option. What I would like to know is, is it harder to get a junior job as a self learner? I have gotten a few enquiries regarding my C.V but nothing concrete yet. I try to be involved in projects as I get the chance and tend to put up any worthwhile projects as I develop them. Some examples of my work are: A Xaml lexer and parser: http://www.xlight.mendhak.com A font obfuscation tool: http://www.silverlightforums.com/showthread.php?1516-Font-Obsfucation-Tool-ALPHA A tagger for m4a: http://projectaudiophile.codeplex.com/SourceControl/list/changesets I, of course think that these are great examples of my work but that is my opinion based on self learning. The other query is how much should I actually know? I've never used linked lists but I know that strings are immutable and I understand what that means. I am only touching on T-SQL but I understand things like how properties function in IL (as two standard methods :) ). I suppose I understand a lot of concepts but specific features need some looking up to implement as I may not know the syntax off the top of my head.

    Read the article

  • rails: has_many :through validation?

    - by ramonrails
    Rails 2.1.0 (Cannot upgrade for now due to several constraints) I am trying to achieve this. Any hints? A project has many users through join model A user has many projects through join model Admin class inherits User class. It also has some Admin specific stuff. Admin like inheritance for Supervisor and Operator Project has one Admin, One supervisor and many operators. Now I want to 1. submit data for project, admin, supervisor and operator in a single project form 2. validate all and show errors on the project form. Project has_many :projects_users ; has_many :users, :through => :projects_users User has_many :projects_users ; has_many :projects, :through => :projects_users ProjectsUser = :id integer, :user_id :integer, :project_id :integer, :user_type :string ProjectUser belongs_to :project, belongs_to :user Admin < User # User has 'type:string' column for STI Supervisor < User Operator < User Is the approach correct? Any and all suggestions are welcome.

    Read the article

  • How to handle refunds or rebates via a payment processor?

    - by Tai Squared
    I need to handle online payments and am trying to choose a payment processor. One requirement is to handle refunds and rebates to the customer. These won't always be at the time of sale, and not for the entire amount of the purchase. Is this something all payment processors handle? I don't want to have to do this manually as there may be many rebates, and they may be for relatively small amounts. I see PayPal has a refund API, but other parts of their site talk about sending a refund within 60 days. Is this something also required by the API? Amazon FPS also has a refund API that seems a bit more flexible. The Google Checkout refund has an amout field, but it's unclear to me if you can do a partial refund as the description reads "The refund-order command instructs Google Checkout to refund the buyer for a particular order." What are some things to look out for when looking for a payment processor that can handle rebates and refunds? Is there always a time limit in issuing these refunds? Is using a merchant account better for this type of process? I was hoping to avoid that due to the increased cost and complexity, but would consider it if it meets all of my requirements. Update It appears the refund process is fairly simple and handled by all processors. Is there any additional information on rebates? I would like to avoid a process of sending live checks to customers, but I will have to send rebates in some small amounts that may be a few months after the initial purchase.

    Read the article

  • NetworkStream.Read delay .Net

    - by Gilbes
    I have a class that inherits from TcpClient. In that class I have a method to process responses. In that method I call I get the NetworkStream with MyBase.GetStream and call Read on it. This works fine, excpet the first call to read blocks too long. And by too long I mean that the socket has recieved plenty of data, but won't read it until some arbitrary limit is reached. I can see that it has recieved plenty of data using the packet sniffer WireShark. I have set the recieve buffer to small amounts, and very small amounts (like just a few bytes) to no avail. I have done the same with the buffer byte array I pass to the read method, and it still delays. Or to put it another way. I am download 600k. The download takes 5 seconds (at a little over 100k/second connection to the server which makes sense). The initial Read call takes 2-3 seconds and tells me only 256 bytes are availble (256 is the Recieve buffer and the size of the array I read in to). Then magically, the other few hundred thousand bytes can be read in 256 byte chunks in only a few process ticks each. Using a packet sniffer, I know that during those initial 2-3 seconds, the socket has recieved much more than just 256 bytes. My connection wasn't .25k/second for 3 seconds and then 400k for 2 seconds. How do I get the bytes from a socket as they come in?

    Read the article

  • Project Euler problem 214, How can i make it more efficient?

    - by Once
    I am becoming more and more addicted to the Project Euler problems. However since one week I am stuck with the #214. Here is a short version of the problem: PHI() is Euler's totient function, i.e. for any given integer n, PHI(n)=numbers of k<=n for which gcd(k,n)=1. We can iterate PHI() to create a chain. For example starting from 18: PHI(18)=6 = PHI(6)=2 = PHI(2)=1. So starting from 18 we get a chain of length 4 (18,6,2,1) The problem is to calculate the sum of all primes less than 40e6 which generate a chain of length 25. I built a function that calculates the chain length of any number and I tested it for small values: it works well and fast. sum of all primes<=20 which generate a chain of length 4: 12 sum of all primes<=1000 which generate a chain of length 10: 39383 Unfortunately my algorithm doesn't scale well. When I apply it to the problem, it takes several hours to calculate... so I stop it because the Project Euler problems must be solved in less than one minute. I thought that my prime detection function might be slow so I fed the program with a list of primes <40e6 to avoid the primality test... The code runs now a little bit faster, but there is still no way to get a solution in less than a few hours (and I don't want this). So is there any "magic trick" that I am missing here ? I really don't understand how to be more efficient on this one... I am not asking for the solution, because fighting with optimization is all the fun of Project Euler. However, any small hint that could put me on the right track would be welcome. Thanks !

    Read the article

  • How/when to hire new programmers, and how to integrate them?

    - by Shaul
    Hiring new programmers, especially in a small company, can often present a Catch-22 situation. We have too much work to do, so we need to hire new programmers. But we can't hire new programmers now, because they will need mentoring and several months of learning curve in your industry/product/environment before they're useful, and none of the programmers has time to be a mentor to a new programmer, because they're all completely swamped with the current work load. That may be a slightly frivolous way of describing the situation, but nevertheless, it's difficult for a small company on a tight budget to justify hiring someone who is not only going to be unproductive for a long time, but will also take away from the performance of the current programmers. How have you dealt with this kind of situation? When is the best time to hire someone? What are the best tasks to assign to a new team member so that they can learn their way around your code base and start getting their hands dirty as quickly as possible? How do you get the new guy useful without bogging your existing programmers down in too much mentoring? Any comments & suggestions you have are much appreciated!

    Read the article

  • Doxygen: grouping documentation by folder in a multi-project codebase

    - by John
    In one project, some pages were added - it was a new project in which doxygen was being tested properly - adding comments & pages - rather than simply auto-generating docs from our existing code-base. The problem is when doxygen is run on the main code-base, that project's pages show up at a top level. e.g they have a main-page and some sub-pages. But what we'd want is all those pages pushed down one level so you have main-project-main-project-pages. One question is what happens if multiple projects have a main-page? Do they get combined, or throw errors? Another question is if you can tell doxygen to use paths and containing folders to auto-generate groups or sections or page-hierarchies in some way? Going through all out projects to properly assign classes to groups is a mammoth task, so ideally everything in a directory would get put in a group of that name, as a way to make the documentation of non-doxygen codebases better. Sorry my question is a bit vague, the problem is even after reading the docs the terminology isn't totally clear yet. Hopefully the kind of question I'm asking is clear, if not I'll try to cobble an example file-structure together.

    Read the article

  • Rails does not display error messages on a form in a custom method

    - by slythic
    Hi all, I've created a custom method called checkout in my app. I create an order (which is done my adding products to my "cart"), assign it to my client, and then I head to my checkout screen where I confirm the items and enter their customer order number and complete the order (submit). Everything works great except that it doesn't display error messages. I'm able to display a flash error notice (seen in complete_order method) when things go wrong but it doesn't specify the details like a normal form would. The error messages should appear if the customer order number is not unique for that client. Below is the custom method (checkout) related code. Order Model: validates_uniqueness_of :customer_order_number, :scope => :client_id Orders_controller: def checkout @order = current_order end def complete_order @order = current_order respond_to do |format| if @order.update_attributes(params[:order]) @order.complete #sets submitted datetime and state to 'complete' flash[:notice] = 'Thank you! Your order is being processed.' format.html { redirect_to( products_path ) } format.xml { head :ok } else flash[:error] = 'Please review your items' #added to confirm an error is present format.html { redirect_to( checkout_path ) } format.xml { render :xml => @order.errors, :status => :unprocessable_entity } end end end And the form in the checkout view: <% form_for @order, :url => { :controller => "orders", :action => "complete_order" } do |f| %> <%= f.error_messages %> <%= f.text_field :customer_order_number, :label => "Purchase Order Number" %> <p> <%= f.submit 'Complete Order', :confirm => 'Are you sure?' %> <small> or <%= link_to 'cancel', current_cart_path %></small> </p> <% end %> Any idea how I can display the specific error messages? Thank you in advance! -Tony

    Read the article

< Previous Page | 216 217 218 219 220 221 222 223 224 225 226 227  | Next Page >