Daily Archives

Articles indexed Friday March 19 2010

Page 18/124 | < Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >

  • How to retrieve the size of a file before uploading it?

    - by geowa4
    I have an file input tag in my web app. I'd like to check that the file isn't too big before sending it to the server. Of course, I still have validation server side. Is there any way to do this with JavaScript? It must work in IE7+ and FF3+. Thank you. EDIT: somefileinputobject.files[0].filesize works in FF, but not IE.

    Read the article

  • Why is Selenium RC so slow?

    - by Pete
    Hi. For some time I have been investigating Selenium RC in order to do functional testing of my web application. I have now found a test strategy that is so effective, that I do not want to move away from Selenium RC (after spending weeks trying to figure out a good way to validate ASP.NET validation controls). But now that my Selenium RC adventure is moving from a POC to be something that I actually use, I'm running into a problem. It is insanely slow. Executing a single test that loads a page, fills in some fields, and clicks a button takes in the magnitude of seconds to execute. When it is executing, I can easily see each individual field being filled out one at a time. Using Selenium IDE in Firefox is not that slow. I found this page, that clearly specifies that Selenium RC is slow http://selenium-grid.seleniumhq.org/how_it_works.html But why is that? Is it because the browser is polling the selenium server? If so, can this polling interval not be modified? Or is there another reason. I am not accustomed to a remote call taking a humanly noticable amount of time to execute. It is horrible that executing a few tests should take so long. I can execute my entire presentation (MVP), business, and database layer test suite (500+ tests) way quicker than it takes to run 10 tests for a single web page.

    Read the article

  • zipping a file used by a process

    - by jaganath
    i accidently zipped a log file of process (the process wasnt writing in it though, it writes it only during weekends when the process get killed).I unzipped the file immediately back. will it affect the process when it is trying to write in the log file?

    Read the article

  • Google facilite la migration des serveurs Exchange vers ses Apps, avec un nouvel outil gratuit

    Google facilite la migration des serveurs Exchange vers ses Apps, avec un nouvel outil gratuit Depuis deux jours, un nouvel outil crée par Google est disponible : il s'agit d' Apps Migration for Microsoft Exchange. Il est gratuit et permet d'automatiser et de simplifier la migration de données (e-mails, calendriers, contacts, etc.) depuis les serveurs Exchange (de Microsoft) vers la suite collaborative en ligne Google Apps. Les organisations qui souscrivent actuellement à une édition Premier ou Education de Apps en bénéficient gratuitement. L'outil fonctionne indépendament du fait que les serveurs d'origine soient hébergés en local ou en cloud. Le produit phare des applications Google, et qui motive l...

    Read the article

  • Is Prolog the best language to solve this kind of problem?

    - by Milan Babuškov
    I have this problem containing some inequations and requirement to minimize a value. After doing some research on the Internet, I came to conclusion that using Prolog might be the easiest way to solve it. However, I never used Prolog before, and I would hate to waste my time learning it just to discover that it is not the right tool for this job. Please, if you know Prolog, take a look at this problem and tell me if Prolog is the right one. Or, if you know of some other language that is really suited for this. a + b + c >= 100 d + e + f >= 50 g + h >= 30 if (8b + 2e + 7h > 620) then y = 0.8 else y = 1.0 if (d > 35) then x = 0.9 else x = 1.0 5xa + 8yb + 5c + 3xd + 2ye + 2f + 6xg + 7yh = w. I need to find the values for a, b, c, d, e, f, g and h that minimize w. I'm not really asking for code, although I'd be grateful for some hint how to tackle this if Prolog is really good for it. Thanks.

    Read the article

  • Writing a code example

    - by Stefano Borini
    I would like to have your feedback regarding code examples. One of the most frustrating experiences I sometimes have when learning a new technology is finding useless examples. I think an example as the most precious thing that comes with a new library, language, or technology. It must be a starting point, a wise and unadulterated explanation on how to achieve a given result. A perfect example must have the following characteristics: Self contained: it should be small enough to be compiled or executed as a single program, without dependencies or complex makefiles. An example is also a strong functional test if you correctly installed the new technology. The more issues could arise, the more likely is that something goes wrong, and the more difficult is to debug and solve the situation. Pertinent: it should demonstrate one, and only one, specific feature of your software/library, involving the minimal additional behavior from external libraries. Helpful: the code should bring you forward, step by step, using comments or self-documenting code. Extensible: the example code should be a small “framework” or blueprint for additional tinkering. A learner can start by adding features to this blueprint. Recyclable: it should be possible to extract parts of the example to use in your own code Easy: An example code is not the place to show your code-fu skillz. Keep it easy. helpful acronym: SPHERE. Prototypical examples of violations of those rules are the following: Violation of self-containedness: an example spanning multiple files without any real need for it. If your example is a python program, keep everything into a single module file. Don’t sub-modularize it. In Java, try to keep everything into a single class, unless you really must partition some entity into a meaningful object you need to pass around (and java mandates one class per file, if I remember correctly). Violation of Pertinency: When showing how many different shapes you can draw, adding radio buttons and complex controls with all the possible choices for point shapes is a bad idea. You de-focalize your example code, introducing code for event handling, controls initialization etc., and this is not part the feature you want to demonstrate, they are unnecessary noise in the understanding of the crucial mechanisms providing the feature. Violation of Helpfulness: code containing dubious naming, wrong comments, hacks, and functions longer than one page of code. Violation of Extensibility: badly factored code that have everything into a single function, with potentially swappable entities embedded within the code. Example: if an example reads data from a file and displays it, create a method getData() returning a useful entity, instead of opening the file raw and plotting the stuff. This way, if the user of the library needs to read data from a HTTP server instead, he just has to modify the getData() module and use the example almost as-is. Another violation of Extensibility comes if the example code is not under a fully liberal (e.g. MIT or BSD) license. Violation of Recyclability: when the code layout is so intermingled that is difficult to easily copy and paste parts of it and recycle them into another program. Again, licensing is also a factor. Violation of Easiness: Yes, you are a functional-programming nerd and want to show how cool you are by doing everything on a single line of map, filter and so on, but that could not be helpful to someone else, who is already under pressure to understand your library, and now has to understand your code as well. And in general, the final rule: if it takes more than 10 minutes to do the following: compile the code, run it, read the source, and understand it fully, it means that the example is not a good one. Please let me know your opinion, either positive or negative, or experience on this regard.

    Read the article

  • Different OS and Server Path

    - by justjoe
    in windows (using apache as server), my file path directory will be C:\xampp\htdocs\mysvn\PhpDocumentor\phpdoc.php. But what happen with other OS such as linux on APACHE, or IIS on windows, Or other OS i don't know and never use ? i would like to know to make sure i wrote the bullet proof, file reading via PHP.

    Read the article

  • button item lost when hide and unhide toolbar

    - by RAGOpoR
    i dont know, why the button are disappear after the toolbar set to hide and unhide. how can i fix it? and i setup my button at this method -(void)viewDidAppear:(BOOL)animated this code use for hide toolbar [self.navigationController setNavigationBarHidden:YES animated:YES]; [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES]; [self.navigationController setToolbarHidden:YES animated:YES];

    Read the article

  • What is the proper way to specify a path to 'app' in a Rails plugin?

    - by Brian Deterling
    This question came about because the cells gem specifies template directories using File.join('app','cells'). That works fine until you run Rails as a daemon (scripts/server -d). The daemon switches directories to / which leaves the cells template paths pointing to the wrong absolute path. My solution was to set the default paths to File.join(RAILS_ROOT, 'app', 'cells'). This works in Rails, but the unit tests for the plugin fail because RAILS_ROOT isn't defined. Using File.join(File.dirname(__FILE__),'..' ... also works but requires about 6 levels of '..' which seems wrong. So my question is what is the proper way to specify the path to a directory under 'app' in a Rails plugin? Or is there something else wrong that would cause daemonizing Rails to fail to find the relative paths?

    Read the article

  • functor returning 0

    - by Jon
    I've recently started teaching myself the standard template library. I was curious as to why the GetTotal() method in this class is returning 0? ... class Count { public: Count() : total(0){} void operator() (int val){ total += val;} int GetTotal() { return total;} private: int total; }; void main() { set<int> s; Count c; for(int i = 0; i < 10; i++) s.inset(i); for_each(s.begin(), s.end(), c); cout << c.GetTotal() << endl; }

    Read the article

  • Running in to some issues with Tumblr's Theme Parser

    - by Kylee
    Below part of a tumblr theme I'm working on and you will notice that I use the {block:PostType} syntax to declare the opening tag of each post, which is a <li> element in an Ordered List. This allows me to not only dynamicly set the li's class based on the type of post but cuts down on the number of times I'm calling the ShareThis JS which was really bogging down the page. This creates a new issue though which I believe is a flaw in Tumblr's parser. Each post is an ordered list with one <li> element in it. I know I could solve this by having each post as a <div> but I really like the control and semantics of using a list. Tumblr gurus? Suggestions? Sample of code: {block:Posts} <ol class="posts"> {block:Text} <li class="post type_text" id="{PostID}"> {block:Title} <h2><a href="{Permalink}" title="Go to post '{Title}'.">{Title}</a></h2> {/block:Title} {Body} {/block:Text} {block:Photo} <li class="post type_photo" id="{PostID}"> <div class="image"> <a href="{LinkURL}"><img src="{PhotoURL-500}" alt="{PhotoAlt}"></a> </div> {block:Caption} {Caption} {/block:Caption} {/block:Photo} {block:Photoset} <li class="post type_photoset" id="{PostID}"> {Photoset-500} {block:Caption} {Caption} {/block:Caption} {/block:Photoset} {block:Quote} <li class="post type_quote" id="{PostID}"> <blockquote> <div class="quote_symbol">&ldquo;</div> {Quote} </blockquote> {block:Source} <div class="quote_source">{Source}</div> {/block:Source} {/block:Quote} {block:Link} <li class="post type_link" id="{PostID}"> <h2><a href="{URL}" {Target} title="Go to {Name}.">{Name}</a></h2> {block:Description} {Description} {/block:Description} {/block:Link} {block:Chat} <li class="post type_chat" id="{PostID}"> {block:Title} <h2><a href="{Permalink}" title="Go to post {PostID} '{Title}'.">{Title}</a></h2> {/block:Title} <table class="chat_log"> {block:Lines} <tr class="{Alt} user_{UserNumber}"> <td class="person">{block:Label}{Label}{/block:Label}</td> <td class="message">{Line}</td> </tr> {/block:Lines} </table> {/block:Chat} {block:Video} <li class="post type_video" id="{PostID}"> {Video-500} {block:Caption} {Caption} {/block:Caption} {/block:Video} {block:Audio} <li class="post type_audio" id="{PostID}"> {AudioPlayerWhite} {block:Caption} {Caption} {/block:Caption} {block:ExternalAudio} <p><a href="{ExternalAudioURL}" title="Download '{ExternalAudioURL}'">Download</a></p> {/block:ExternalAudio} {/block:Audio} <div class="post_footer"> <p class="post_date">Posted on {ShortMonth} {DayOfMonth}, {Year} at {12hour}:{Minutes} {AmPm}</p> <ul> <li><a class="comment_link" href="{Permalink}#disqus_thread">Comments</a></li> <li><script type="text/javascript" src="http://w.sharethis.com/button/sharethis.js#publisher=722e181d-1d8a-4363-9ebe-82d5263aea94&amp;type=website"></script></li> </ul> {block:PermalinkPage} <div id="disqus_thread"></div> <script type="text/javascript" src="http://disqus.com/forums/kyleetilley/embed.js"></script> <noscript><a href="http://disqus.com/forums/kyleetilley/?url=ref">View the discussion thread.</a></noscript> {/block:PermalinkPage} </div> </li> </ol> {/block:Posts}

    Read the article

  • Need help using UIImagePNGRepresentation

    - by mustanggal511
    I'm trying to save a UIImageView image to a png file, and then use that file as a GLTexture. I'm having trouble with this, when I try to run my code in the simulator, XCode says it succeeded, but the simulator crashes with no error messages. Can someone help me with this? Here is my code: NSString *dataFilePath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/Picture.png"]; NSData *imageData = UIImagePNGRepresentation(imageView.image); [imageData writeToFile:dataFilePath atomically:YES]; // Load image into texture loadTexture("Picture.png", &Input, &renderer);

    Read the article

  • ItemsPanel vs Grid vs GridSplitter

    - by bitbonk
    I am currently trying to build a ControlTemplate for an ItemsControl that uses the Grid as its ItemsPanel where each item is stacked horizontally and delimited with a GridSplitter. The basic goal is to have a dynamic bindable ItemsControl where all items stack up in a row and where each item can be resized with a splitter. There are two things I can't wrap my head around: How is the GridSplitter supposed to end up automatically between each item? How do I set Grid.Column for each item.

    Read the article

  • .submit() doesn't work with Firefox and Greasemonkey...

    - by Shady
    I'm trying to make an auto login script and I'm stuck on the submit part... The source of the submit form from the website is <input type="submit" value="Sign In" class="signin" id="sumbitLogin"> and I'm trying document.getElementById("sumbitLogin").submit(); if I set an Attribute, for example the value, it changes just fine... How can I solve it?

    Read the article

  • PHP ingore case sensitivity when comparing array values

    - by dan.codes
    I have to modify some code in a application I am working on that is using the array_diff($array1,$array2) method. The problem I am having is it is case sensitive and I need to have it return the correct value if the array values match even if the case is different. I don't want to change the case to lowercase because I need the value returned to keep its case. I'm a little confused as the best method to do this.

    Read the article

  • Thread pool stack security issue

    - by elmatador
    In a naive implementation of a thread pool, can a piece of code that is being executed read the data left by some previous code on the stack (if it was running on the same thread instance)? Also, are there any other inherent security issues connected to thread pools?

    Read the article

  • How to get the window position and update to other windows?

    - by Rakesh
    Hi all..I have 2 dialog boxes in which I will display 1 dialogbox at a time..If I click NEXT in the first dialog box,I will hide the first dialog box and display the second dialog and vice versa...Now say If I move the dialog box after clicking NEXT in the first dialog..and when I click BACK(in the second dialog) ...it goes back to its previous position(to diaplay the first dialog box)..so I have decided to get the current window's position and update to the other window position so that it doesnt move even If I click next/back..I am not sure how to get the windows position and update to other..please help me if you guys know about this..

    Read the article

  • ACL architechture for a Software As a service in Spring 3.0

    - by geoaxis
    I am making a software as a service using Spring 3.0 (Spring MVC, Spring Security, Spring Roo, Hibernate) I have to come up with a flexible access control list mechanism.I have three different kinds of users System (who can do any thing to the system, includes admin and internal daemons) Operations (who can add and delete users, organizations, and do maintenance work on behalf of users and organizations) End Users (they belong to one or more organization, for each organization, the user can have one or more roles, like being organization admin, or organization read-only member) (role like orgadmin can also add users for that organization) Now my question is, how should i model the entity of User? If I just take the End User, it can belong to one or more organizations, so each user can contain a set of references to its organizations. But how do we model the users role for each organization, So for example User UX belongs to organizations og1, og2 and og3, and for og1 he is both orgadmin, and org-read-only-user, where as for og2 he is only orgadmin and for og3 he is only org-read-only-user I have the possibility of making each user belong to one organization alone, but that's making the system bounded and I don't like that idea (although i would still satisfy the requirement) If you have a better extensible ACL architecture, please suggest it. Since its a software as a service, one would expect that alot of different organizations would be part if the same system. I had one concern that it is not a good idea to keep og1 and og2 data on the same DB (if og1 decides to spawn a 100 reports on the system, og2 should not suffer) But that is some thing advanced for now and is not directly related to ACL but to the physical distribution of data and setup of services based on those ACLs This is a community Wiki question, please correct any thing which you wish to do so. Thanks

    Read the article

  • How should i determine for virtual dedicated hosting?

    - by babu
    Hi all What are all the criteria i should determine if i want to choose a virtual dedicated server? I have asp.net website that has 3800 vistors per day that is hosted on a shared hosting. Kindly advise me if i should upgrade it to VPS?? What is the advantage and disadvantage of using VPS? Thanks in advance!

    Read the article

  • Checking the configuration of two systems to determine changes

    - by None
    We are standing up a replicant data center at work and need to ensure that the new data center is configured (nearly) identically to the original. The new data center will be differently addressed and named than the original and will have differing user accounts, but all the COTS, patches, and configurations should be the same. We would normally ghost the original servers and install those images onto the new machines, however, we have a few problematic pieces of COTS that require we install them outside of an image due to how they capture the setup of the network during their installation and maintain it within their configuration information (in some cases storing it in various databases). We have tried multiple times and this piece of COTS cannot be captured within a ghost image unless the destination machine will have an identical network setup (all the same IPs, hostnames, user accounts, etc across the entire network) as the original. In truth, it is the setup of these special COTS that I want to audit the most because they are difficult to install and configure in the first place. In light of the fact that we can’t simply ghost, I’m trying to find a reasonable manner to audit the new data center and check to see if it is setup like the original (some sort of system wide configuration audit or integrity check). I’m considering using something like Tripwire for Servers to capture the configuration on the source machines and then run an audit on the destination machines. I understand that it will still show some differences due to the minor config changes, but I’m hoping that it will eliminate the majority of the work. Here are some of the constraints I’m working under: Data center is comprised of multiple Windows and Linux machines of differing versions (about 20 total) I absolutely cannot ghost or snap any other type of image of these machines … at least not in their final configuration I want to audit the final configuration to ensure all of the COTS, patches, configurations, etc are installed and setup properly (as compared to the original data center) I would rather not install any additional tools on these machines … I’d much rather run it from a standalone machine or off a DVD Price of tools is important but not an impossible burden, however, getting a solution soon is important (I can’t take the time to roll my own tools to do this) For the COTS that stores the network information, I don’t know all of the places it stores the network information … so it would be unlikely I could find a way in the near future to adjust its setup after the installation has occurred Anyone have any thoughts or alternate approaches? Can anyone recommend tools that would be usable for system wide configuration audits?

    Read the article

< Previous Page | 14 15 16 17 18 19 20 21 22 23 24 25  | Next Page >