Search Results

Search found 3996 results on 160 pages for 'operations'.

Page 11/160 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Hex to bin after logical operations

    - by user355926
    I want: 111 || 100 ---> 111, not 1 100 && 100 ---> 100, not 1 101 && 010 ---> 000, not 0 Broken code #include <stdio.h> main(void){ string hexa = 0xff; strig hexa2 = 0xf1; // CONVERT TO INT??? cast int hexa3 = hexa || hexa2; int hexa4 = hexa && hexa2; puts(hexa3); puts(hexa4); }

    Read the article

  • Arithmetic Operations in Arrays with PHP

    - by Ajith
    I have two arrays $data1 = array() $data1 = array( '10','22','30') and also another array carries $data2 = array() $data2 = array( '2','11','3'); I need to divide these two arrays(ie,$data1/$data2) and store value to $data3[]. I need to get it as follows $data3[] = array('5','2','10') If someone knows of an easy way to do this would be of great help. Thanks

    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

  • Minimize the sequence by putting appropriate operations ' DP'

    - by Vikas
    Given a sequence,say, 222 We have to put a '+' or '* ' between each adjacent pair. '* ' has higher precedence over '+' We have to o/p the string whose evaluation leads to minimum value. O/p must be lexicographically smallest if there are more than one. inp:222 o/p: 2*2+2 Explaination: 2+2+2=6 2+2*2=6 2*2+2=6 of this 3rd is lexicographically smallest. I was wondering how to construct a DP solution for this.

    Read the article

  • Highly efficient filesystem APIs for certain kinds of operations

    - by romkyns
    I occasionally find myself needing certain filesystem APIs which could be implemented very efficiently if supported by the filesystem, but I've never heard of them. For example: Truncate file from the beginning, on an allocation unit boundary Split file into two on an allocation unit boundary Insert or remove a chunk from the middle of the file, again, on an allocation unit boundary The only way that I know of to do things like these is to rewrite the data into a new file. This has the benefit that the allocation unit is no longer relevant, but is extremely slow in comparison to some low-level filesystem magic. I understand that the alignment requirements mean that the methods aren't always applicable, but I think they can still be useful. For example, a file archiver may be able to trim down the archive very efficiently after the user deletes a file from the archive, even if that leaves a small amount of garbage either side for alignment reasons. Is it really the case that such APIs don't exist, or am I simply not aware of them? I am mostly interested in NTFS, but hearing about other filesystems will be interesting too.

    Read the article

  • Lua operations, that works in mutitheaded environment

    - by SBKarr
    My application uses Lua in multithreaded environment with global mutex. It implemented like this: Thread locks mutex, Call lua_newthread Perform some initialization on coroutine Run lua_resume on coroutine Unlocks mutex lua_lock/unlock is not implemented, GC is stopped, when lua works with coroutine. My question is, can I perform steps 2 and 3 without locking, if initialisation process does not requires any global Lua structs? Can i perform all this process without locking at all, if coroutine does not requires globals too? In what case I generally can use Lua functions without locking?

    Read the article

  • "pseudo-atomic" operations in C++

    - by dan
    So I'm aware that nothing is atomic in C++. But I'm trying to figure out if there are any "pseudo-atomic" assumptions I can make. The reason is that I want to avoid using mutexes in some simple situations where I only need very weak guarantees. 1) Suppose I have globally defined volatile bool b, which initially I set true. Then I launch a thread which executes a loop while(b) doSomething(); Meanwhile, in another thread, I execute b=true. Can I assume that the first thread will continue to execute? In other words, if b starts out as true, and the first thread checks the value of b at the same time as the second thread assigns b=true, can I assume that the first thread will read the value of b as true? Or is it possible that at some intermediate point of the assignment b=true, the value of b might be read as false? 2) Now suppose that b is initially false. Then the first thread executes bool b1=b; bool b2=b; if(b1 && !b2) bad(); while the second thread executes b=true. Can I assume that bad() never gets called? 3) What about an int or other builtin types: suppose I have volatile int i, which is initially (say) 7, and then I assign i=7. Can I assume that, at any time during this operation, from any thread, the value of i will be equal to 7? 4) I have volatile int i=7, and then I execute i++ from some thread, and all other threads only read the value of i. Can I assume that i never has any value, in any thread, except for either 7 or 8? 5) I have volatile int i, from one thread I execute i=7, and from another I execute i=8. Afterwards, is i guaranteed to be either 7 or 8 (or whatever two values I have chosen to assign)?

    Read the article

  • Operations on 64bit words in 32bit system

    - by Vilo
    I'm new here same as I'm new with assembly. I hope that you can help me to start. I'm using 32bit (i686) Ubuntu to make programs in assembly, using gcc compiler. I know that general-purpose-registers are 32bit (4 bytes) max, but what when I have to operate on 64 bit numbers? Intel's instruction says that higher bits are stored in %edx and lower in %eax Great... So how can I do something with this 2-registers number? I have to convert 64bit dec to bin, then save it to memory and show on the screen. How to make the 64bit quadword at start of the program in .data section?

    Read the article

  • Operations on Java Swing

    - by gustavo
    In my project,I will get the coordinates of some points from an XML file,and create some visual components using this information ? I am planning to give these components to a Java swing frame or panel. However,The users are supposed to click on the figure(which I will construct using Graphics 2d libraries) and select two points and give a label to the points between those two points ? How can i get the clicks clicked on JFrame or JPanel(i.e events for this kind of actions) ?

    Read the article

  • C++ Arrays manipulations (python-like operations)

    - by Linai
    Hi Guys, I'm trying to figure out the best C++ library/package for array manipulations in a manner of python. Basically I need a simplicity like this: values = numpy.array(inp.data) idx1 = numpy.where(values > -2.14) idx2 = numpy.where(values < 2.0) res1 = (values[idx1] - diff1)/1000 res1 = (values[idx2] - diff2)*1000 In python it's just 5 lines, but the simplest way in C++ i can think of is quite a number of nested loops. Pls advise..

    Read the article

  • Operations in table data with javascript

    - by Zangrandi
    I'm working with rails and I don't know javascript. I have a table with a select_tag field and I want to have another field that capture the option selected, multiply for the price captured in another field and display the total. Like this <table> <tr> <td>(select_tag)</td> <td>price</td> <td>total</td> </tr> </table

    Read the article

  • 1:M relationship in Hibernate and cascading operations

    - by EugeneP
    Table SUBCOURSE references COURSE COURSE(id, name) SUBCOURSE(id, course_id, name) So, 1:M. Hibernate generates for Course: @OneToMany(fetch = FetchType.LAZY, mappedBy = "course", cascade = CascadeType.ALL) public Set getSubCourses() { return this.subCourses; } for Subcourse it generates @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "course_id", nullable = false) public Course getCourse() { return this.course; } Now the problem is that cascading does not work as expected. I want to create a collection of SubCourse objects (Set), fill it and then bind it to setSubCourses() of Course object. Though, having ManyToOne thing in a Subcourses table, I need to manually setCourse() before adding to collection on each object. If I do not do so, an exception is raised. What can you recommend me?

    Read the article

  • How to define 2-bit numbers in C, if possible?

    - by Eddy
    For my university process I'm simulating a process called random sequential adsorption. One of the things I have to do involves randomly depositing squares (which cannot overlap) onto a lattice until there is no more room left, repeating the process several times in order to find the average 'jamming' coverage %. Basically I'm performing operations on a large array of integers, of which 3 possible values exist: 0, 1 and 2. The sites marked with '0' are empty, the sites marked with '1' are full. Initially the array is defined like this: int i, j; int n = 1000000000; int array[n][n]; for(j = 0; j < n; j++) { for(i = 0; i < n; i++) { array[i][j] = 0; } } Say I want to deposit 5*5 squares randomly on the array (that cannot overlap), so that the squares are represented by '1's. This would be done by choosing the x and y coordinates randomly and then creating a 5*5 square of '1's with the topleft point of the square starting at that point. I would then mark sites near the square as '2's. These represent the sites that are unavailable since depositing a square at those sites would cause it to overlap an existing square. This process would continue until there is no more room left to deposit squares on the array (basically, no more '0's left on the array) Anyway, to the point. I would like to make this process as efficient as possible, by using bitwise operations. This would be easy if I didn't have to mark sites near the squares. I was wondering whether creating a 2-bit number would be possible, so that I can account for the sites marked with '2'. Sorry if this sounds really complicated, I just wanted to explain why I want to do this.

    Read the article

  • Tasks, jobs, activities, operations... which term to use when?

    - by Paul Stovell
    My application has a number of different asynchronous 'things' that it performs: There are things that fire off a schedule (every 5 minutes) There are things that are fired when a user clicks a button There are things that are triggered by an incoming web service call I use the terms like this: Scheduled things = Jobs User-triggered things = Tasks Web service-triggered things = Operations Tasks are quite complicated, so they're implemented using a hierarchy of different objects which I call Activities (operations and jobs may also begin to use these Activities as their building blocks). I feel like I might be using the wrong terms - for example, would you expect something that happens every 5 minutes automatically to be a Job or a Task? Is there an industry standard for this? All of the words seem to mean the same thing.

    Read the article

  • Can all code be represented as a series of Map / Filter / Reduce operations?

    - by Mongus Pong
    I have recently been refactoring large chunks of code and replacing them with Linq queries. Removing the language bias - Linq is essentially a set of Map / Filter and Reduce operations that operate on a sequence of data. This got me thinking, how far would I theoretically be able to take this. Would I be able to rewrite the whole code base into a series (or even a single) of Map / Filter and Reduce operations. Unfortunately I get paid to do useful stuff, so I haven't been able to experiment much further, but I can't think of any code structure that couldn't be re structured as such. Side effected code can be dealt with via monads.. Even output is essentially mapping memory addresses to screen addresses. Is there anything that couldn't be (theoretically) rewritten as a Linq query?

    Read the article

  • What kind of specific projects can I do to master bitwise operations in C++? Also is there a canonical book? [closed]

    - by Ford
    I don't use C++ or bitwise operations at my current job but I'm thinking of applying to companies where it is a requirement to be fluent with them (on their tests anyway). So my question is: Can anyone suggest a project which will require gaining a fluency in bitwise operations to complete? On a side note, is there a canonical book on optimization techniques using bitwise operations since that seems to be an important use of them?

    Read the article

  • Experience/Articles about "decision tree" documentation?

    - by Philipp Keller
    I'm running an "defect fixing" group (developers do 2 weeks operations, then rotate). I want to build up a documentation "how to deal with problem x" - basically a decision tree: Is the problem in part x of the web site? Yes: Is the problem occurring in all browsers? Yes: ... No: ... No: ... The documentation should be written and extended by the people using it. Do you know of any book/article describing how that is best done, or is there a software (Mac OS X) that helps doing that?

    Read the article

  • operation specified in binding is not defined for 'Porttype', but it is there, wsdl.. help..

    - by adnan
    Hi guys... this thing is driving me crazy... Whenever I try to validate it.. it gives me error at <wsdl:operation name="ComposedClassOpt"> complete definition is below... that "The operation specified for the 'Binding' binding is not defined for port type 'ComposedClassPortType'. All operations specified in this binding must be defined in port type 'ComposedClassPortType'." But the operation is in the PortType plz thank you. <?xml version="1.0" encoding="UTF-8"?>

    Read the article

  • Geek City: What gets logged for SELECT INTO operations?

    - by Kalen Delaney
    Last week, I wrote about logging for index rebuild operations. I wanted to publish the result of that testing as soon as I could, because that dealt with a specific question I was trying to answer. However, I actually started out my testing by looking at the logging that was done for a different operation, and ending up generating some new questions for myself. Before I starting testing the index rebuilds, I thought I would just get warmed up by observing the logging for SELECT INTO. I thought I...(read more)

    Read the article

  • Geek City: What gets logged for index rebuild operations?

    - by Kalen Delaney
    This blog post was inspired by a question from a future student. Someone who was already booked for my SQL Server Internals class in June asked for some information on a current problem he was having with transaction log writes causing excessive wait times during index rebuild operations when run in ONLINE mode. He wanted to know if switching to BULK_LOGGED recovery could help. I knew the difference between ALTER INDEX in FULL vs BULK_LOGGED recovery when doing normal OFFLINE rebuilds, but I wasn't...(read more)

    Read the article

  • Windows Azure : Microsoft effectue une série de mises à jour sur son service Cloud, l'entreprise mise sur la simplicité des opérations

    Windows Azure : Microsoft effectue une série de mises à jour sur son service Cloud, l'entreprise mise sur la simplicité des opérations Microsoft a annoncé le déploiement d'un ensemble de mises à jour pour son service Cloud. Parmi les nouveautés figurent la disponibilité générale des services de restauration. Windows Azure Backup permet aux administrateurs et aux développeurs de sauvegarder de manière sélective. Toutes les données sont chiffrées sur place avant d'être envoyées sur le Cloud....

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >