Search Results

Search found 4126 results on 166 pages for 'bitwise operations'.

Page 66/166 | < Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >

  • Django: FloatField or DecimalFied for Currency ?

    - by Hellnar
    I am curious which one would be better fitting as a currency field ? I will do simple operations such as taking difference, the percentage between old and new prices. I plan to keep two digits after the zero (ie 10.50) and majority of the time if these digits are zero, I will be hiding these numbers and display it as "10"

    Read the article

  • Change TrayIcon Tooltip from ProgressMonitorDialog

    - by Raven
    Hello, i am using the Eclipse RCP trayitem, which is described in Vogellas tutorials here: http://www.vogella.de/articles/RichClientPlatform/article.html#systemtray The requirement now is not only to show the name of the app in the tooltip but also a percentage while doing lengthy operations. I understand that the trayitem attribute is a private from ApplicationWorkbenchWindowAdvisor, so I added a getter and setter method. The only thing missing is a possibility to access the trayitem instance from my ProgressMonitorDialog instance. Can you tell me, how you would solve this puzzle? Thanks

    Read the article

  • Parallel programming in C#

    - by Alxandr
    I'm interested in learning about parallel programming in C#.NET (not like everything there is to know, but the basics and maybe some good-practices), therefore I've decided to reprogram an old program of mine which is called ImageSyncer. ImageSyncer is a really simple program, all it does is to scan trough a folder and find all files ending with .jpg, then it calculates the new position of the files based on the date they were taken (parsing of xif-data, or whatever it's called). After a location has been generated the program checks for any existing files at that location, and if one exist it looks at the last write-time of both the file to copy, and the file "in its way". If those are equal the file is skipped. If not a md5 checksum of both files is created and matched. If there is no match the file to be copied is given a new location to be copied to (for instance, if it was to be copied to "C:\test.jpg" it's copied to "C:\test(1).jpg" instead). The result of this operation is populated into a queue of a struct-type that contains two strings, the original file and the position to copy it to. Then that queue is iterated over untill it is empty and the files are copied. In other words there are 4 operations: 1. Scan directory for jpegs 2. Parse files for xif and generate copy-location 3. Check for file existence and if needed generate new path 4. Copy files And so I want to rewrite this program to make it paralell and be able to perform several of the operations at the same time, and I was wondering what the best way to achieve that would be. I've came up with two different models I can think of, but neither one of them might be any good at all. The first one is to parallelize the 4 steps of the old program, so that when step one is to be executed it's done on several threads, and when the entire of step 1 is finished step 2 is began. The other one (which I find more interesting because I have no idea of how to do that) is to create a sort of worker and consumer model, so when a thread is finished with step 1 another one takes over and performs step 2 at that object (or something like that). But as said, I don't know if any of these are any good solutions. Also, I don't know much about parallel programming at all. I know how to make a thread, and how to make it perform a function taking in an object as its only parameter, and I've also used the BackgroundWorker-class on one occasion, but I'm not that familiar with any of them. Any input would be appreciated.

    Read the article

  • Differences between a conceptual UML class diagram and an ERD?

    - by Adam
    If I create a conceptual class diagram such that each class captures 'name' and 'attributes' but not 'operations', have I not basically created what would be otherwise considered an ERD? I'm trying to gain an understanding of what the differences are between creating a conceptual class diagram as I have described versus calling it a ERD? If these are still two different animals, can somebody please explain what the differences are?

    Read the article

  • Sending data to a web site over HTTP

    - by sfactor
    i have a program that receives data from a wireless device over bluetooth...i now need to do some operations in the data and then send it to the website (web server!!!) as a .csv file...i also need to authenticate the device itself from it hardware address which is also obtained in the program.i am coding this in gcc linux compiler using C...can anyone tell me how do i go about doing this?

    Read the article

  • Fulltext searching array of strings

    - by Gotys
    I have a PHP array of strings: ie: "Big green car parked outside"..etc I would like to perform boolean search operations on these strings, similar to MySQL fulltext searching , or Sphinx Searching. For example, I would like to find all strings containing word "green" but not "car" Does anyone know of any existing PHP classes or libraries which would help me accomplish this ? Or can anyone suggest any google terms I could search for ? Thank you in advance!

    Read the article

  • How can i interpret a time value in ascii into a numerical value?

    - by Bilal
    I have a file which is as follows: 15:03:21 II 0.88 0.64 15:03:31 II 0.88 0.64 15:03:42 II 0.40 0.40 etc. after loading the file in matlab, I want to be able to read the first column (which corresponds to time) and interpret them as numerical values. At the moment, they are interpreted as a string of ascii characters and i can't perform any mathematical operations on them. Does anyone have any suggestions as to how i can read the time as numbers instead of a string of ascii characters?

    Read the article

  • Java - PriorityQueue vs sorted LinkedList

    - by msr
    Hello, Which implementation is less "heavy": PriorityQueue or a sorted LinkedList (using a Comparator)? I want to have all the items sorted. The insertion will be very frequent and ocasionally I will have to run all the list to make some operations. Thank you!

    Read the article

  • How to wrap LINQ to SQL queries in stored proc?

    - by Satish
    LINQ to SQL internally generates SQL queries and fire on the database after submitting changes. Is there any way we can wrap all these queries in some stored procedure and execute this store proc everytime when anything gets inserted or updated in the database. Problem is only stored procedures are allowed to carry any insert or update or delete operations, direct queries are restricted for security purpose.

    Read the article

  • Get notification when NSOperationQueue finishes all tasks

    - by porneL
    NSOperationQueue has waitUntilAllOperationsAreFinished, but I don't want to wait synchronously for it. I just want to hide progress indicator in UI when queue finishes. What's the best way to accomplish this? I can't send notifications from my NSOperations, because I don't know which one is going to be last, and [queue operations] might not be empty yet (or worse - repopulated) when notification is received.

    Read the article

  • Java Best Practice for type resolution at runtime.

    - by Brian
    I'm trying to define a class (or set of classes which implement the same interface) that will behave as a loosely typed object (like JavaScript). They can hold any sort of data and operations on them depend on the underlying type. I have it working in three different ways but none seem ideal. These test versions only allow strings and integers and the only operation is add. Adding integers results in the sum of the integer values, adding strings concatenates the strings and adding an integer to a string converts the integer to a string and concatenates it with the string. The final version will have more types (Doubles, Arrays, JavaScript-like objects where new properties can be added dynamically) and more operations. Way 1: public interface DynObject1 { @Override public String toString(); public DynObject1 add(DynObject1 d); public DynObject1 addTo(DynInteger1 d); public DynObject1 addTo(DynString1 d); } public class DynInteger1 implements DynObject1 { private int value; public DynInteger1(int v) { value = v; } @Override public String toString() { return Integer.toString(value); } public DynObject1 add(DynObject1 d) { return d.addTo(this); } public DynObject1 addTo(DynInteger1 d) { return new DynInteger1(d.value + value); } public DynObject1 addTo(DynString1 d) { return new DynString1(d.toString()+Integer.toString(value)); } } ...and similar for DynString1 Way 2: public interface DynObject2 { @Override public String toString(); public DynObject2 add(DynObject2 d); } public class DynInteger2 implements DynObject2 { private int value; public DynInteger2(int v) { value = v; } @Override public String toString() { return Integer.toString(value); } public DynObject2 add(DynObject2 d) { Class c = d.getClass(); if(c==DynInteger2.class) { return new DynInteger2(value + ((DynInteger2)d).value); } else { return new DynString2(toString() + d.toString()); } } } ...and similar for DynString2 Way 3: public class DynObject3 { private enum ObjectType { Integer, String }; Object value; ObjectType type; public DynObject3(Integer v) { value = v; type = ObjectType.Integer; } public DynObject3(String v) { value = v; type = ObjectType.String; } @Override public String toString() { return value.toString(); } public DynObject3 add(DynObject3 d) { if(type==ObjectType.Integer && d.type==ObjectType.Integer) { return new DynObject3(Integer.valueOf(((Integer)value).intValue()+((Integer)value).intValue())); } else { return new DynObject3(value.toString()+d.value.toString()); } } } With the if-else logic I could use value.getClass()==Integer.class instead of storing the type but with more types I'd change this to use a switch statement and Java doesn't allow switch to use Classes. Anyway... My question is what is the best way to go about something thike this?

    Read the article

  • How do I perform 'WHERE' on groups of rows?

    - by Drew
    I have a table, which looks like: +-----------+----------+ + person_id + group_id + +-----------+----------+ + 1 + 10 + + 1 + 20 + + 1 + 30 + + 2 + 10 + + 2 + 20 + + 3 + 10 + +-----------+----------+ I need a query such that only person_ids with groups 10 AND 20 AND 30 are returned (only person_id: 1). I am not sure how to do this, as from what I can see it would require me to group the rows by person_id and then select the rows which contain all group_ids. I'm looking for something which will preserve the use of keys without resorting to string operations on group_concat() or such.

    Read the article

  • Silverlight 4 wait/spinner control

    - by Keith
    I'd like to implement a spinner control (something along these lines) in Silverlight 4 to display during pending operations. There are several examples on the web for Silverlight 3 but I'm either unable to compile them into my project or they just flat out display nothing. In addition I'm unable to find any examples specific to Silverlight 4. Can someone please post a sample for Silverlight 4 or a link to one?

    Read the article

  • For distributed applications, which to use, ASIO vs. MPI?

    - by Rhubarb
    I am a bit confused about this. If you're building a distributed application, which in some cases may perform parallel operations (although not necessarily mathematical), should you use ASIO or something like MPI? I take it MPI is a higher level than ASIO, but it's not clear where in the stack one would begin.

    Read the article

  • Running on Windows CE 6 'and' Windows XP

    - by Psychic
    Is it possible to create a small program that will run, without recompiling and without emulators, on both Windows CE 6 AND Windows XP SP3? From my knowledge, this isn't possible. Source code needs to be recompiled for the target platform. However, a hardware manufacturer for embedded boards is claiming otherwise. The application isn't anything complex, just a simple benchmarking tool analysing floating point operations, CPU ticks etc, and displaying the results on a plain GUI.

    Read the article

  • Performing application reliability using iis 6/7

    - by Erup
    I have web-services applications, running on Windows Server 2003. These hosts (each of them on separate appPool) contains multiple operations (consulting services). Does exist an approach to perform reliability on these hosts, in terms of appPools? If there is a way to perform it in IIS 7 - or using WCF - I would appreciate the information. Thanks

    Read the article

  • How are iterators and pointers related?

    - by sharptooth
    Code with iterators looks pretty much like code with pointers. Iterators are of some obscure type (like std::vector<int>::iterator for example). What I don't get is how iterators and pointer are related to each other - is an iterator a wrapper around a pointer with overloaded operations to advance to adjacent elements or is it something else?

    Read the article

  • Assign to a slice of a Python list from a lambda

    - by Bushman
    I know that there are certain "special" methods of various objects that represent operations that would normally be performed with operators (i.e. int.__add__ for +, object.__eq__ for ==, etc.), and that one of them is list.__setitem, which can assign a value to a list element. However, I need a function that can assign a list into a slice of another list. Basically, I'm looking for the expression equivalent of some_list[2:4] = [2, 3].

    Read the article

  • How do I move a file (or folder) from one folder to another in TortoiseSVN?

    - by codeflunky
    I would like to move a file or folder from one place to another within the same repository without having to use Repo Browser to do it, and without creating two independent add/delete operations. Using Repo Browser works fine except that your code will be hanging in a broken state until you get any supporting changes checked in afterwards (like the .csproj file for example). Update: People have suggested "move" from the command line. Is there a TortoiseSVN equivalent?

    Read the article

  • how can I get instance from the property.

    - by viky
    In my application I have a class which has properties of user-defined types like this: class MyType { public A MyProperty { get; set; } } class A { .....some methods and proeprties } for some operations that I need to perform from my main program, I create a List of MyProperty whenever creating object of MyType and pass it to my main program and there I perform different operation on these properties which reflects in there instances also. Is there any way by which I could get the object instance for any particular MyProperty from that property in the list.

    Read the article

< Previous Page | 62 63 64 65 66 67 68 69 70 71 72 73  | Next Page >