Search Results

Search found 6502 results on 261 pages for 'dont reinvent the wheel'.

Page 54/261 | < Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >

  • How long is the time frame between context switches on Windows?

    - by mattcodes
    Reading CLR via C# 2.0 (I dont have 3.0 with me at the moment) Is this still the case: If there is only one CPU in a computer, only one thread can run at any one time. Windows has to keep track of the thread objects, and every so often, Windows has to decide which thread to schedule next to go to the CPU. This is additional code that has to execute once every 20 milliseconds or so. When Windows makes a CPU stop executing one thread's code and start executing another thread's code, we call this a context switch. A context switch is fairly expensive because the operating system has to: So circa CLR via C# 2.0 lets say we are on Pentium 4 2.4ghz 1 core non-HT, XP. Every 20 milliseconds? Where a CLR thread or Java thread is mapped to an OS thread only a maximum of 50 threads per second may get a chance to to run? I've read that context switching is very fast in mircoseconds here on SO, but how often roughly (magnitude style guesses) will say a modest 5 year old server Windows 2003 Pentium Xeon single core give the OS the opportunity to context switch? 20ms in the right area? I dont need exact figures I just want to be sure that's in the right area, seems rather long to me.

    Read the article

  • Where can I find a control similar to the Firefox Rich List Box for use in my application?

    - by bsruth
    I'm trying to implement a control similar to Firefox's Rich List Box: However, I can only find the XUL implementation of this control, and I don't want to have to include a XUL processing engine in my application just to get a cool looking listbox. I've been trying to implement one on my own by customizing MFC's CListBox control, but am starting to realize it may take more time than I had intended. Before continuing to implement this control from scratch, I was wondering if anyone knew of a similar control that already exists, either commercial or open source. The main functionality I would like to have is: Small display for non selected items that expands when selected. Ability to add arbitrary controls to the expanded view. Preferably native code, but can probably use managed controls via native/managed interop with out too much extra work. Any help would be appreciated, I don't want to have to reinvent the wheel if I don't have to.

    Read the article

  • Is there are standard way to store a database schema outside a python app

    - by acrosman
    I am working on a small database application in Python (currently targeting 2.5 and 2.6) using sqlite3. It would be helpful to be able to provide a series of functions that could setup the database and validate that it matches the current schema. Before I reinvent the wheel, I thought I'd look around for libraries that would provide something similar. I'd love to have something akin to RoR's migrations. xml2ddl doesn't appear to be meant as a library (although it could be used that way), and more importantly doesn't support sqlite3. I'm also worried about the need to move to Python 3 one day given the lack of recent attention to xml2ddl. Are there other tools around that people are using to handle this?

    Read the article

  • Load javascript in app engine

    - by user624392
    I got so confused loading javascript in app engine. I am using django template. In my base html file. First I can't load my downloaded jquery from local say d:/jquery.js like <script src="d:\jquery.js" type="text/javascript" ></script></head>, This line is in my base html file. It works when I load jquery from remote. Like <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"type="text/javascript" ></script></head> I dont know why. Second, I can't load my own-created javascript to my html file, say I create a javascript like layout. Js and I try to load it like this in my child html file, which, by the way, inherits from the base html. <body><script src="layout.js" type="text/javascript"></script></body>, And it doesn't work at all, the only way it works I have tried is that I put the actual javascript in the body of my base html file. Like <body><script> $(document).ready( $("#yes"). Click(function() { $("#no"). Hide("slow"); })); </script> I dont know why either... Any help?

    Read the article

  • .NET 2d library for circuit diagrams

    - by Dinah
    I want to draw and manipulate logic flow (as opposed to analog) circuit diagrams and I'm trying not to reinvent the wheel. Problems like positioning, line drawing, line crossing and connecting, path finding, rubberband lines, and drag & drop are also identical in flow charts, UML diagrams, or class diagrams so I started by viewing related topics via Google and Stack Overflow. However, the following requirements seemed to keep me from finding anything that quite fit: assuming a chip has an image with input and output stubs, the connecting lines would connect to the chip only in the exact spots of the I/O stubs the color of connecting lines are able to be set as per a chip's output Is there an existing .NET 2d graphics library that would be suitable for drawing circuit diagrams?

    Read the article

  • How does Google implement Microsoft Exchange access?

    - by user358041
    I know with Android 2.x there is the ability to tap into Microsoft Exchange, for at least email, if not calendar and contacts. I would like to see how this was accomplished. Particularly because Microsoft Exchange exposes SOAP web services, and I understand there is no native Android support for SOAP. Since this is open source, shouldn't I be able to find something in the Android source? If so, can you point me in the right direction of where to find it in the ~4Gig (!) source? I want to develop an application that accesses Exchange contacts and calendars, but don't want to reinvent that piece. Any other guidance would be appreciated. Thanks.

    Read the article

  • after assembling jar - No Persistence provider for EntityManager named ....

    - by alabalaa
    im developing a standalone application and it works fine when starting it from my ide(intellij idea), but after creating an uberjar and start the application from it javax.persistence.spi.PersistenceProvider is thrown saying "No Persistence provider for EntityManager named testPU" here is my persistence.xml which is placed under meta-inf directory: <persistence-unit name="testPU" transaction-type="RESOURCE_LOCAL"> <provider>org.hibernate.ejb.HibernatePersistence</provider> <class>test.model.Configuration</class> <properties> <property name="hibernate.connection.username" value="root"/> <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/> <property name="hibernate.connection.password" value="root"/> <property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/test"/> <property name="hibernate.show_sql" value="true"/> <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLInnoDBDialect"/> <property name="hibernate.c3p0.timeout" value="300"/> <property name="hibernate.hbm2ddl.auto" value="update"/> </properties> </persistence-unit> and here is how im creating the entity manager factory: emf = Persistence.createEntityManagerFactory("testPU"); im using maven and tried the assembly plug-in with the default configuration fot it, i dont have much experience with assembling jars and i dont know if im missing something, so if u have any ideas ill be glad to hear them

    Read the article

  • c++ specialized overload?

    - by acidzombie24
    -edit- i am trying to close the question. i solved the problem with boost::is_base_and_derived In my class i want to do two things. 1) Copy int, floats and other normal values 2) Copy structs that supply a special copy function (template T copyAs(); } the struct MUST NOT return int's unless i explicitly say ints. I do not want the programmer mistaking the mistake by doing int a = thatClass; -edit- someone mention classes dont return anything, i mean using the operator Type() overload. How do i create my copy operator in such a way i can copy both 1) ints, floats etc and the the struct restricted in the way i mention in 2). i tried doing template <class T2> T operator = (const T2& v); which would cover my ints, floats etc. But how would it differentiate from structs? so i wrote T operator = (const SomeGenericBase& v); The idea was the GenericBase would be unsed instead then i can do v.Whatever. But that backfires bc the functions i want wouldnt exist, unless i use virtual, but virtual templates dont exist. Also i would hate to use virtual I think the solution is to get rid of ints and have it convert to something that can do .as(). So i wrote something up but now i have the same problem, how does that differentiate ints and structs that have the .as() function template?

    Read the article

  • jQuery version of YAHOO.lang (isUndefined, isNull, isString etc.)

    - by Chris S
    Does anyone know of a jQuery plugin that has 'helpers' or extensions like those found in the YAHOO.lang namespace? I have in mind functions such as: isNull isDefined isString isFunction I would also appreciate the same kind of thing for strings and arrays, such as Contains, StartsWith (I know these are easy to write, I'm just looking for a plugin that encompasses them all). It's not in the YAHOO.lang namespace but also form related extensions- determining a radiobox's value (from the one checked), a form element's type in a friendly name. Specifically a plugin with fluent API rather than selector based such as $("input[@type=radio][@checked]") Again I'm aware they're easy to implement but I don't want to reinvent the wheel.

    Read the article

  • Synchronous Android activities

    - by rayman
    Ive made mis-leading topic in my last question, so i open this new question to clear what I realy want. sorry for the inconvenience. I wanna run two system(Android) activities one after another in specific order from my main activity. now as we know, startActivity is an asynchronous operation, so i cant keep on a specific order. so i thought maybe I should try to do it with dialogBox in the middle but also running a dialogBox is an asynchronous. now as i said the activities which i try to run are Android activities, so i cant even start them with startActivityForResult (or mybe i can, but i dont get any result back to my main(calling) activity) Any tricks how could i manage with this issue? Some code: first activity: Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setAction(Settings.ACTION_APPLICATION_SETTINGS); startActivity(intent); second activity: Intent intent = new Intent(Intent.ACTION_VIEW); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.setDataAndType(Uri.fromFile(tmpPackageFile .getAbsoluteFile()), "application/vnd.android.package-archive"); startActivity(intent); as you can see, i dont have any access to those activites, i can just run thire intents from my main activity.

    Read the article

  • Log in to subdomain via main domain

    - by Mattias
    I have a website, available through multiple domainnames. like www.domain1.com .... www.domain5.com All my customers have their own subdomain. like: customer1.domain1.com customer2.domain1.com .... customer351.domain4.com Currently i dont use SSL, each customer log in their own account via their sub domain. I want to change this, and make all customers log in on a central log in page, that would use SSL, for example. https://login.domain1.com And somehow redirect each user to the correct sub domain adress. (Sub domain that don't use SSL) How do I do this, and maintain security? One idea i had: Login - add random value somewhere in the database, Redirect to subdomain, with querystring the randomvalue. And after that the session takes care of it, Each value can be used once only.. But how secure is that? I guess someone would ask the question "why?" to me. Because SSL costs money. And unfortunately i dont have a lot of it. :D Thanks for your time!

    Read the article

  • Synchronous HTTP Client with .NET sockets

    - by Ray Wits
    Does anyone know of any open source C# projects or some sample code that implement a synchronous HTTP client using sockets? I'm working on a project where I need a HTTP client using sockets. It can't use WebRequest or WebClient, nor can it use Asynchronous sockets. Don't ask. Also it would ideally be on .NET 2.0, yeah very cutting edge here. I figured the web would have tons of samples for this but suprisingly I couldn't find any. Probably because everyone is fortunate enough to use the built in APIs. If I don't find something I'll have to write it myself, which I don't really want to have to reinvent that wheel.

    Read the article

  • Template approach for a PHP application

    - by Industrial
    Hi everyone, We're in the middle of making a new e-commerce related PHP application and we have come to the point where we have started to think about how we should solve templating for our customers needs. What we would like to do is offer our customers the possibility of uploading/modifying templates to suit their company:s profile. The initial thought is that we shall not reinvent the wheel, so instead letting our customers upload their templates with FTP, so there will be basic HTML skills required. For those customers that want to modify/customize template and doesnt have the knowledge, we offer that service as well. I know that there's a number of issues to solve before this could be considered safe, like preventing XSS and writing scripts that check through each uploaded file for potential security threats and so on. Of course, there are some part that probably will be to complex for the customer to modify by themselves, so maybe this approach won't apply to all<< template files in the frontend application. But besides that, what would be a good way to handle this?

    Read the article

  • struct with template variables in c++

    - by monkeyking
    I'm playing around with template, so I'm not trying to reinvent the std::vector, I'm trying to get a grasp of templateting in c++. Can I do the following template <typename T> typedef struct{ size_t x; T *ary; }array; What I'm trying to do is a basic templated version of typedef struct{ size_t x; int *ary; }iArray; It looks like its working if I use a class instead of struct, so is it not possible with typedef structs? thanks

    Read the article

  • unbuffered I/O in Linux

    - by stuck
    I'm writing lots and lots of data that will not be read again for weeks - as my program runs the amount of free memory on the machine (displayed with 'free' or 'top') drops very quickly, the amount of memory my app uses does not increase - neither does the amount of memory used by other processes. This leads me to believe the memory is being consumed by the filesystems cache - since I do not intend to read this data for a long time I'm hoping to bypass the systems buffers, such that my data is written directly to disk. I dont have dreams of improving perf or being a super ninja, my hope is to give a hint to the filesystem that I'm not going to be coming back for this memory any time soon, so dont spend time optimizing for those cases. On Windows I've faced similar problems and fixed the problem using FILE_FLAG_NO_BUFFERING|FILE_FLAG_WRITE_THROUGH - the machines memory was not consumed by my app and the machine was more usable in general. I'm hoping to duplicate the improvements I've seen but on Linux. On Windows there is the restriction of writing in sector sized pieces, I'm happy with this restriction for the amount of gain I've measured. is there a similar way to do this in Linux?

    Read the article

  • Established javascript solution for secure registration & authentication without SSL

    - by Tomas
    Is there any solution for secure user registration and authentication without SSL? With "secure" I mean safe from passive eavesdropping, not from man-in-the-middle (I'm aware that only SSL with signed certificate will reach this degree of security). The registration (password setup, i.e. exchanging of pre-shared keys) must be also secured without SSL (this will be the hardest part I guess). I prefer established and well tested solution. If possible, I don't want to reinvent the wheel and make up my own cryptographic protocols. Thanks in advance.

    Read the article

  • solutions for rapid front-end development?

    - by fayer
    im using mvc framework and i have learned some techniques that help me with different parts of RAD. models: doctrine/visual paradigm controllers/libraries: various design patterns now i only need to know what technique/solution i should use for the views so that i can create views more rapidly. cause i don't think it's efficient to code css/html manually, even though i understand it. its the same principle when using visual paradigm to create both my mysql database tables and doctrine model classes. i believe in using right tools will boost up development speed. so what could i use for the views to save time and energy and don't reinvent the wheel all the time? dreamweaver? any css generation tools? 960/blueprint for layout? suggestions? thanks

    Read the article

  • Detailstext in TableView from Coredata Iphone

    - by user554867
    Hey, that is my first question here at stackoverflow. Let me try to be specific as I can. The project is as follows: I am trying to parse an xml file in an iphone app, which works already. I am saving the parsed data into the CoreData of the Iphone. So far so good: I have two elements of the xml file which I want to show in the tableview as the text and the detailtext. Now the strange behaviour occurs: If I take the data of the Core Data and trying to visualize them in the tableview, then both elements are displayed in seperate cells and not as detailtext of the element. If I am just taking a constant string for the detailtext, then it works, but if I am trying to take for every cell a specific element from the Core Data then it is shown seperately in the tableview. I googled a lot, reading here and there. I dont know which code I should show because I dont have a clue where exactly the mistake could be. Maybe someone can answer that immediately because it is a stupid mistake somewhere, which is common. Thanks for your help.

    Read the article

  • Finding out the windows group by virtue of which a user is able to access a database in sql server?

    - by Raghu Dodda
    There is a SQL Server 2005 database with mixed-mode authentication. Among others, we have the following logins on the server: our-domain\developers-group-1, and our-domain\developers-group-2 which are AD groups. The our-domain\developer-group-2 is added to the sysadmin role on the server, by virture of which all domain users of that group can access any database as SQL Server implictly maps the sysadmin role to the dbo user in each database. There are two users our-domain\good-user and our-domain\bad-user The issue is the following: Both the good-user and the bad-user have the exact same AD group memberships. They are both members of our-domain\developers-group-1 and our-domain\developers-group-2. The good-user is able to access all the databases, and the bad-user is not. The bad-user is able to login, but he is unable access any databases. By the way, I am the good-user. How do I go about finding out why? Here's what I tried so far: When I do print current_user, I get dbo When I do print system_user, I get my-domain\good-user When I do select * from fn_my_permissions(NULL, 'SERVER'), I see permissions. But if do execute as user='my-domain\good-user'; select * from fn_my_permissions(NULL, 'SERVER'), I dont see any permisisons. And When I do, execute as user='my-domain\bad-user'; select * from fn_my_permissions(NULL, 'SERVER'), I dont see any permisisons. Also, I was wondering if there is a sql command that will tell me, "hey! the current database user is able to access this database because he is a member such-and-such ad-group, which is a login that is mapped to such-and-such user in this database".

    Read the article

  • [C#] Creating standalone, console (shell) for domain-specific operations

    - by mr.b
    Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash shell, mysql cli, cmd.exe, and countless others), allow command line editing capabilities (history, cursor keys to move around text..), etc. Now, it's not that much of a problem to create something like that by rolling my own from scratch, handling user input, scanning pressed keys, and doing correct actions. But, why reinvent the wheel? Is there some library/framework that helps with this kind of problems, just like readline library that offers improved command-line editing capabilities under linux? Of course, this new "shell" would respond only to valid, domain-specific commands, and would suggest valid arguments, options, switches... Any ideas? Thanks!

    Read the article

  • integrating jquery with AJAX using MVC for ddl/html.dropdownlist

    - by needhelp
    the situation: a user on the page in question selects a category from a dropdown which then dynamically populates all the users of that category in a second dropdown beside it. all the data is being retrieved using LinqtoSQL and i was wondering if this can be done a) using html.dropdownlist in a strongly typed view? b) using jquery to trigger the ajax request on selected index change instead of a 'populate' button trigger? sorry i dont have code as what i was trying really wasnt working at all. I am having trouble with how to do it conceptually and programatically! will appreciate any links to examples etc greatly! thanks in advance! EDIT: this is kind of what i was trying to achieve.. first the ViewPage: <script type="text/javascript"> $(document).ready function TypeSearch() { $.getJSON("/Home/Type", null, function(data) { //dont know what to do here }); } </script> <p> <label for="userType">userType:</label> <%= Html.DropDownList("userType") %> <%= Html.ValidationMessage("userType", "*") %> <input type="submit" runat="server" onclick="TypeSearch()" /> <label for="accountNumber">accountNumber:</label> <%= Html.DropDownList("accountNumber") %> <%= Html.ValidationMessage("accountNumber", "*") %> </p> Then home controller action: public ActionResult Type() { string accountType = dropdownvalue; List<Account> accounts = userRep.GetAccountsByType(accountType).ToList(); return Json(accounts); }

    Read the article

  • How to get the next prefix in C++?

    - by Vicente Botet Escriba
    Given a sequence (for example a string "Xa"), I want to get the next prefix in order lexicographic (i.e "Xb"). As I don't want to reinvent the wheel, I'm wondering if there is any function in C++ STL or boost that can help to define this generic function easily? If not, do you think that this function can be useful? Notes The next of "aZ" should be "b". Even if the examples are strings, the function should work for any Sequence. The lexicographic order should be a template parameter of the function.

    Read the article

  • parsing command option with default values and range constrains in C

    - by agramfort
    Hi, I need to parse command line arguments in C. My arguments are basically int or float with default values and range constrains. I've started to implement something that look like this: option_float(float* out, int argc, char* argv, char* name, description, float default_val, int is_optional, float min_value, float max_value) which I call for example with: float* pct; option_float(pct, argc, argv, "pct", "My super percentage option", 50, 1, FALSE, 0, 100) however I don't want to reinvent the wheel ! My objective is to have error checking of range constrains, throw an error when the option is not optional and is not set. And generate the help message usually given by usage() function. The usage text would look like this: --pct My super percentage option (default : 50). Should be in [0, 100] I've started with getopt but it is too limited for what I want to do and I feel it still requires me to write too much code for a simple usecase like this. thanks

    Read the article

  • How to read pair in freemarker

    - by Lukasz Rys
    Ok i'm having little trouble with reading pair. So I'm creating my pair private Pair<Integer, Integer> count(somethink) { int c1 = 2; int c2 = 4; return new Pair<Integer, Integer>(c1, c2); } And 'sending' it to ftl via java mv.addObject("counted", count(somethink)); I won't write everythink how it sends because I dont think it really matters with my issue. So i'm recieving it in "ftl". Then i was trying to 'read' it <#list counted?keys as key> <a href="#offerOrderTab"><@spring.message "someMsg"/>(${key}/${counted[key]})</a> </#list> After then i'm getting error Expecting a string, date or number here, Expression x is instead a freemarker.ext.beans.SimpleMethodModel As i suppose you dont iterate pairs (or I'm wrong?) i know its pair that contains only one key and one value but still i have to do send it that way and I thought its goin be to similar to iterating through map, in java i would use pair.first() and pair.second() but it doesn't work in ftl (ye i know it shouldnt work). I also tried to cast it to String by using ?string but it didnt work too

    Read the article

  • How to create a web framework in C# without ASP?

    - by Mark
    I've managed to get a C# asp page running under ubuntu/apache/mono, but I don't want to write my framework in these ASP pages, I want to use straight C# and then I'll use a templating language for my views. But I don't know where to begin? C# is a compiled language, so... how would I do this? Would I compile everything and then have apache hook into the (single) executable and pass in the the request URL? Could I request specific .cs pages and then have apache tell it to compile and then "display" it only if it's been updated? Can the "view" files be compiled individually to avoid having to recompile everything every time there's a change? Is there some "base" I can work from, or am I going to have to reinvent accessing GET and POST variables (by reading header info) and all sorts of other stuff we take for granted in languages like PHP?

    Read the article

< Previous Page | 50 51 52 53 54 55 56 57 58 59 60 61  | Next Page >