Search Results

Search found 3828 results on 154 pages for 'mathematical optimization'.

Page 133/154 | < Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >

  • Python / Django : emulating a multidimensional layer on a MySQL database

    - by Sébastien Piquemal
    Hi, I'm working on a Django project where I need to provide a lot of different visualizations on the same data (for example average of a value for each month, for each year / for a location, etc...). I have been using an OLAP database once in college, and I thought that it would fit my needs, but it appears that it is much too heavy for what I need. Actually the volume of data is not very big, so I don't need any optimization, just a way to present different visualizations of the same data without having to write 1000 times the same code. So, to recap, I need a python library: to emulate a multidimensional database (OLAP style would be nice because I think it is quite convenient : star structure, and everything) non-intrusive, because I can't modify anything on the existing MySQL database easy-to-use, because otherwise there's no point in replacing some overhead by another.

    Read the article

  • Why should I reuse XmlHttpRequest objects?

    - by Xavi
    From what I understand, it's a best practice to reuse XmlHttpRequest objects whenever possible. Unfortunately, I'm having a hard time understanding why. It seems like trying to reuse XHR objects can increase code complexity, introduce possible browser incompatibilities, and lead to other subtle bugs. After researching this question for a while, I did come up with a list of possible explanations: Fewer objects created means less garbage collecting Reusing XHR objects reduces the chance of memory leaks The overhead of creating a new XHR object is high The browser is able to perform some sort of network optimization under hood But I'm not sure if any of these reasons are actually valid. Any light you can shed on this question would be much appreciated.

    Read the article

  • Why is it bad to use boolean flags in databases? And what should be used instead?

    - by David Chanin
    I've been reading through some of guides on database optimization and best practices and a lot of them suggest not using boolean flags at all in the DB schema (ex http://forge.mysql.com/wiki/Top10SQLPerformanceTips). However, they never provide any reason as to why this is bad. Is it a peformance issue? is it hard to index or query properly? Furthermore, if boolean flags are bad, what should you use to store boolean values in a database? Is it better to store boolean flags as an integer and use a bitmask? This seems like it would be less readable.

    Read the article

  • mysql - filtering a list against keywords, both list and keywords > 20 million records

    - by threecheeseopera
    I have two tables, both having more than 20 million records; table1 is a list of terms, and table2 is a list of keywords that may or may not appear in those terms. I need to identify the terms that contain a keyword. My current strategy is: SELECT table1.term, table2.keyword FROM table1 INNER JOIN table2 ON table1.term LIKE CONCAT('%', table2.keyword, '%'); This is not working, it takes f o r e v e r. It's not the server (see notes). How might I rewrite this so that it runs in under a day? Notes: As for server optimization: both tables are myisam and have unique indexes on the matching fields; the myisam key buffer is greater than the sum of both index file sizes, and it is not even being fully taxed (key_blocks_unused is ... large); the server is a dual-xeon 2U beast with fast sas drives and 8G of ram, fine-tuned for the mysql workload.

    Read the article

  • MATLAB Magical Mystery timing behavior

    - by Jacob Lyles
    I am experiencing some very odd timing behavior from a function I wrote. If I wrap my function inside another empty container function, it gets a 3x speedup. > tic; foo(args); toc time elapsed: ~140 seconds >tic; bar(args); toc time elapsed: ~35 seconds Here's the kicker - the definition of bar(): define bar(args) foo(args) end Is there some sort of optimization that gets triggered in MATLAB for nested function calls? Should I be adding a dummy function to every function that I write?

    Read the article

  • C: Pointers to any type?

    - by dragme
    I hear that C isn't so type-safe and I think that I could use that as an advantage for my current project. I'm designing an interpreter with the goal for the VM to be extremely fast, much faster than Ruby and Python, for example. Now I know that premature optimization "is the root of all evil" but this is rather a conceptual problem. I have to use some sort of struct to represent all values in my language (from number over string to list and map) Would the following be possible? struct Value { ValueType type; void* value; } I would store the actual values elsewhere, e.g: a separate array for strings and integers, value* would then point to some member in this table. I would always know the type of the value via the type variable, so there wouldn't be any problems with type errors. Now: Is this even possible in terms of syntax and typing?

    Read the article

  • What Kind of Knowledge is Necessary For a Permon Who Does Not Have IT Background? [closed]

    - by skyflyer
    One of my colleagues joined our company, which by the way is a internet company, months ago as an on-line marketing specialist. He majored English in his college and has never deeply touched IT before. He says that to be a good on-line marketing specialist he needs to lean some basic IT skills in order to deliver superb work. According to him, things like Search Engine Optimization, monitoring competitors' web sites, design some functionality on web site and so on require IT entree-level knowledge. And he asks me what kind knowledge is helpful for him to do his job. I am stunted by his question. It is easy enough to answer, things like HTML, CSS, even Photo-shop are required in some job descriptions. Also, I believe some basic understanding of dynamic web site, static web site is helpful to him. On the other hand, as a techie I still feel my answer is awkward. What is your opinion on this? Always lot of thanks to you guys on SO.

    Read the article

  • What data type should I use for my texture coordinates in OpenGL ES?

    - by Matthew Chen
    I notice that the default data type for texture coordinates in the OpenGL docs is GLfloat, but much of the sample code I see written by experienced iphone developers uses GLshort or GLbyte. Is this an optimization? GLfloat vertices[] = { // Upper left x1, y2, // Lower left x1, y1, // Lower right x2, y1, // Upper right x2, y2, }; glTexCoordPointer(2, GL_FLOAT, 0, iconSTs); vs. GLbyte vertices[] = { // Upper left x1, y2, // Lower left x1, y1, // Lower right x2, y1, // Upper right x2, y2, }; glTexCoordPointer(2, GL_BYTE, 0, iconSTs);

    Read the article

  • What is a flexible, hybrid python collection object?

    - by Naveen
    As a way to get used to python, I am trying to translate some of my code to python from Autohotkey_L. I am immediately running into tons of choices for collection objects. Can you help me figure out a built in type or a 3rd party contributed type that has as much as possible, the functionality of the AutoHotkey_L object type and its methods. AutoHotkey_L Objects have features of a python dict, list, and a class instance. I understand that there are tradeoffs for space and speed, but I am just interested in functionality rather than optimization issues.

    Read the article

  • fetch only first row from oracle - is it faster?

    - by john
    My main goal with this question is optimization and faster run time. After doing lot of processing in the Stored Proc I finally return a count like below: OPEN cv_1 FOR SELECT COUNT(*) num_of_members FROM HOUSEHOLD_MEMBER a, HOUSEHOLD b WHERE RTRIM(LTRIM(a.mbr_last_name)) LIKE v_MBR_LAST_NAME || '%' AND a.number = '01' AND a.code = v_CODE AND a.ssn_head = v_SSN_HEAD AND TO_CHAR( a.mbr_dob, 'MM/DD/YYYY') = v_DOB; But in my code that is calling the SP does not need the actual count. It just cares that count is greater than 1. Question: How can I change this to return just 1 or 0. 1 when count is 0 and 0 when count 1. Will it be faster to do this rather than returning the whole count?

    Read the article

  • Browser loading strategy, <head>...<body>

    - by Bin Chen
    I am inspecting some interesting behaviors of browser, I don't know it's in standard or not. If I put everythin inside <head></head>, the browser will only begin to render the page after all the resouces in head is retrieved. So I am thinking that put as little as possible things into head is one of the important website optimization techniques, is it right? My question is: If I put script/css in body or other parts of the html, how can I know that script has been loaded successfully so that I will not be calling a undefined function?

    Read the article

  • Python / Django : emulating a multidimensionnal layer on a mySql database

    - by Sébastien Piquemal
    Hi, I'm working on a Django project where I need to provide a lot of different visualizations on the same data (for example average of a value for each month, for each year / for a location, etc ...). I have been using OLAP database once in college, and I thought that it would fit my needs, but it appears that it is much to heavy for what I need. Actually the volume of data is not very big, so I don't need any optimization, just a way to present different visualizations of the same data without having to write 1000 times the same code. So let's recap : I need a python library : to emulate a multidimensional database (OLAP style would be nice because I think it is quite convenient : stat structure, and everything) non-intrusive, because I can't modify anything on the existing mysql database easy-to-use, because otherwise there's no point in replacing some overhead by another.

    Read the article

  • SQL Query - 20mil records - Best practice to return information

    - by eqiz
    I have a SQL database that has the following table: Table: PhoneRecords ID(identity Seed) FirstName LastName PhoneNumber ZipCode Very simple straight forward table. This table has over 20million records. I am looking for the best way to do queries that pull out records based off area codes from the table. For instance here is an example query that I have done. SELECT phonenumber, firstname FROM [PhoneRecords] WHERE (phone LIKE '2012042%') OR (phone LIKE '2012046%') OR (phone LIKE '2012047%') OR (phone LIKE '2012083%') OR (phone LIKE '2012088%') OR (phone LIKE '2012841%') As you can see this is an ugly query, but it would get the job done (if I wasn't running into timeout issues) Can anyone tell me the best way for speed/optimization to do the above query to display the results? Currently that query above takes around 2 hours to complete on a 9gb 1600mhz ram, i7 930 quadcore OC'd 4.01ghz. I obviously have the computer power required to do such a query, but still takes too long for queries.

    Read the article

  • Is it possible to give a python dict an initial capacity (and is it usefull)

    - by Peter Smit
    I am filling a python dict with around 10,000,000 items. My understanding of dict (or hashtables) is that when too much elements get in them, the need to resize, an operation that cost quite some time. Is there a way to say to a python dict that you will be storing at least n items in it, so that it can allocate memory from the start? Or will this optimization not do any good to my running speed? (And no, I have not checked that the slowness of my small script is because of this, I actually wouldn't now how to do that. This is however something I would do in Java, set the initial capacity of the HashSet right)

    Read the article

  • Detect template presence at compilation time

    - by doublep
    GCC up to 4.5 doesn't have standard C++0x type trait template has_nothrow_move_constructor. I could use it in my package for optimization, but I don't want to rule out one of the common compilers and don't want to overload configuration with symbols like HAVE_STD_HAS_NOTHROW_MOVE_CONSTRUCTOR. Is it somehow possible to use that template if present and just fall back to copying if not present without using any predefined configuration symbols? I also don't want to depend on Boost, since my library is small and doesn't need Boost for any other reasons. In pseudocode, I need something like: template <typename type> struct has_nothrow_move_constructor_robust : public integral_constant <bool, /* if possible */ has_nothrow_move_constructor <type>::value /* otherwise */ false> { }; Since move constructors are only for C++0x anyway, I don't mind using other C++0x features for the above definition, if at all possible.

    Read the article

  • MySQL: Get unique values across multiple columns in alphabetical order

    - by RuCh
    Hey everyone, If my table looks like this: id | colA | colB | colC =========================== 1 | red | blue | yellow 2 | orange | red | red 3 | orange | blue | cyan What SELECT query do I run such that the results returned are: blue, cyan, orange, red, yellow Basically, I want to extract a collective list of distinct values across multiple columns and return them in alphabetical order. I am not concerned with performance optimization, because the results are being parsed to an XML file that will serve as a cache (database is hardly updated). So even a dirty solution would be fine. Thanks for any help!

    Read the article

  • new image makes http request even though cached?

    - by joshs
    I have a javascript slide show that creates the next slide dynamically and then moves it into view. Since the images are actually sprites, the src is transparent.png and the actual image is mapped via background:url(.. in css. Everytime (well, most of the time) the script creates a new Element, Firefox makes an http request for transparent.png. I have a far-future expires header, and Firefox is respecting all other files' expiries. Is there a way to avoid these unnecessary requests. Even though the server is returning 304 unmodified responses, it would be nice if Firefox would respect the expiries on dynamically created images. I suspect that if I injected a simple string instead of using new Element, this might solve the problem, but I use some methods on Prototypes extended Element object, so I would like to avoid a bunch of html strings in my js file. This is a nit-picky question, but I'm working on front-end optimization now, so I thought I would address it. Thanks.

    Read the article

  • Has Object in VB 2010 received the same optimalization as dynamic in C# 4.0?

    - by Abel
    Some people have argued that the C# 4.0 feature introduced with the dynamic keyword is the same as the "everything is an Object" feature of VB. However, any call on a dynamic variable will be translated into a delegate once and from then on, the delegate will be called. In VB, when using Object, no caching is applied and each call on a non-typed method involves a whole lot of under-the-hood reflection, sometimes totaling a whopping 400-fold performance penalty. Have the dynamic type delegate-optimization and caching also been added to the VB untyped method calls, or is VB's untyped Object still so slow?

    Read the article

  • How to Software Service Industry get their Client from or where do they look for their Clients ?

    - by Rachel
    This question is inclined more towards Business Side of Software Industry, I am sure that we have two types in Software Industry as with any other Industry, i.e, Service side and Product Side. Basically for Product based company, we are looking more into product features and to see if market if mature or not for particular product but as far as Service Based company goes (may be it can be big giants like Infosys, TCS or Sapient or some midsize or small companies which provide services like:Web Design,Website Design,Corporate Identity,Logo Design,Flash Design,Web Applications,Enterprise Portal,Rich Internet Applications,Business Applications,Technology Consulting,Ecommerce,Online Store Creations,Custom Shopping Carts,Ecommerce Hosting,Website Marketing,Organic SEO,Pay-Per-Click,Social Media Optimization,Mobile,Mobile Website and Mobile Applications) where do they look for Client and how do they manage to get one ? So my basic question is Where do Service Based Companies Look for Client or get their Clients Form ?

    Read the article

  • Incremental Compilation in Eclipse. ASTNode-s and SVN versioning

    - by Alex
    Hi there, I am building up some statistics after analyzing the source code in eclipse. But the overall process is too slow because i rebuild my model every time from scratch after each compilation. I am looking for a way to get only the changed parts of the code (as ASTNodes) and to rebuild just that part of my model. I suppose that even the changed compilation units and not the exact code elements would be enough after the user compiles and still would be a nice optimization. I am sure eclipse is capable of knowing what code elements are changed (and even to know their semantics), because when I use the subclipse plugin my changes are ordered by a code element (an import, a method, a variable declaration, etc). Well.. at least that plugin is capable of knowing that info. Thanks in advance

    Read the article

  • In .NET which loop runs faster for or foreach

    - by Binoj Antony
    In c#/VB.NET/.NET which loop runs faster for or foreach? Ever since I read that for loop works faster than foreach a long time ago I assumed it stood true for all collections, generic collection all arrays etc. I scoured google and found few articles but most of them are inconclusive (read comments on the articles) and open ended. What would be ideal is to have each scenarios listed and the best solution for the same e.g: (just example of how it should be) for iterating an array of 1000+ strings - for is better than foreach for iterating over IList (non generic) strings - foreach is better than for Few references found on the web for the same: Original grand old article by Emmanuel Schanzer CodeProject FOREACH Vs. FOR Blog - To foreach or not to foreach that is the question asp.net forum - NET 1.1 C# for vs foreach [Edit] Apart from the readability aspect of it I am really interested in facts and figures, there are applications where the last mile of performance optimization squeezed do matter.

    Read the article

  • How to implement square root and exponentiation on arbitrary length numbers?

    - by tomp
    I'm working on new data type for arbitrary length numbers (only non-negative integers) and I got stuck at implementing square root and exponentiation functions (only for natural exponents). Please help. I store the arbitrary length number as a string, so all operations are made char by char. Please don't include advices to use different (existing) library or other way to store the number than string. It's meant to be a programming exercise, not a real-world application, so optimization and performance are not so necessary. If you include code in your answer, I would prefer it to be in either pseudo-code or in C++. The important thing is the algorithm, not the implementation itself. Thanks for the help.

    Read the article

  • Where is the chink in Google Chrome's armor?

    - by kudlur
    While browsing with Chrome, I noticed that it responds extremely fast (in comparison with IE and Firefox on my laptop) in terms of rendering pages, including JavaScript heavy sites like gmail. This is what googlebook on Chrome has to say tabs are hosted in process rather than thread. compile javascript using V8 engine as opposed to interpreting. Introduce new virtual machine to support javascript heavy apps introduce "hidden class transitions" and apply dynamic optimization to speed up things. Replace inefficient "Conservative garbage colllection" scheme with more precise garbage collection scheme. Introduce their own task scheduler and memory manager to manage the browser environment. All this sounds so familiar, and Microsoft has been doing such things for long time.. Windows os, C++, C# etc compilers, CLR, and so on. So why isn't Microsoft or any other browser vendor taking Chrome's approach? Is there a flaw in Chrome's approach? If not, is the rest of browser vendor community caught unaware with Google's approach?

    Read the article

  • Dynamic binding in C++

    - by chmike
    I'm implementing a CORBA like server. Each class has remotely callable methods and a dispatch method with two possible input, a string identifying the method or an integer which would be the index of the method in a table. A mapping of the string to the corresponding integer would be implemented by a map. The caller would send the string on the first call and get back the integer with the response so that it simply has to send the integer on subsequent calls. It is just a small optimization. The integer may be assigned dynamically on demand by the server object. The server class may be derived from another class with overridden virtual methods. What could be a simple and general way to define the method binding and the dispatch method ?

    Read the article

  • How to partition a plane

    - by puls200
    Let's say I have a fixed number (X) of points, e.g. coordinates within a given plane (I think you can call it a 2-D point cloud). These points should be partitioned into Y polygons where Y < X. The polygons should not overlap. It would be wonderful if the polygons were konvex (like a Voronoi diagram). Imagine it like locations forming countries. For example, I have 12 points and want to create 3 polygons with 4 points each. I thought about creating a grid which covers the points. Then iterate across the points, assigning them to the closest grid cells. Maybe I miss the obvious? I am sure there are better solutions. Thanks, Daniel I just found an optimization (kmeans++) .Maybe this will yield better results..

    Read the article

< Previous Page | 129 130 131 132 133 134 135 136 137 138 139 140  | Next Page >