logical

Is there any way of reducing the dump file size of a Sybase database?

When I dump a Sybase database, it doesn't seem to matter whether there's data in the tables or not, the file size is the same. I've been told that this is down to the fact that my dump file is binary and not logical, so the file of the dump file is based on the allocated size of the database. I know that Oracle can use logical dump files...

Bitwise Ops

I'm hooked on bitwise for a new security paradigm I'm creating called VMAC. Variable Matrix Access Control. I want to do logical implication on to bit strings. (1) Before I reinvent the wheel, is there an established shortcut to emulate '->' (logical implication) using AND and OR and NOT or other basic SQL binary operators? (2) XNOR ...

Logic for Searching *.* from text file using J2ME Application

Hello, Friend I have a one textField in J2ME. I want to search from a textfile using that textField Value then what will be the logic for that ? Suppose if i enter abc in textField then logic should return abc by comparing it from textfile field. ...

Prevent misuse of logical operator instead of bitwise operators

In C++ it's possible to use a logical operator where a biwise operator was intended: int unmasked = getUnmasked(); //some wide value int masked = unmasked & 0xFF; // izolate lowest 8 bits the second statement could be easily mistyped: int masked = unmasked && 0xFF; //&& used instead of & This will cause incorrect behaviour - masked...

bitwise operator variations in C++

I read in a book that C++ provides additional operators to the usual &,|, and ! which are "and","or" and "not" respectively, plus they come with automatic short circuiting properties where applicable. I would like to use these operators in my code but for some reason the compiler interprets them as identifiers whenever i use them and thr...

bitwise operators and "Endianness"

Does Endianness matter at all with the bitwise operations. Either logical or shifting? I'm working on homework with regard to bitwise operators and I can not make heads or tails on it and I think I'm getting quite hung up on the endianess. That is, I'm using a little endian machine (like most are) but does this need to be considered or...

How to make a logical boolean parser for text input ?

Hello friends, I need to make a parser to be able to extract logical structure from a text input in order to construct a query for some web service. I tried to use regular expressions but it gets really complicated to handle imbrication logic, so I decided to ask for help, maybe I am doing it the wrong way. ex: ( (foo1 and bar) or (f...

Logical xor operator in c++?

Is there such a thing? First time I encountered a practical need for it, but I don't see one listed in stroustrup. I intend to write: // Detect when exactly one of A,B is equal to five. return (A==5) ^^ (B==5); But there is no ^^ operator. Can I use bitwise ^ here and get the right answer (regardless of machine representation of true ...

Django very tiny modification - logical delete

Hi, I want to make the following tiny modification to the Django framework. I want it to create a "deleted" field for each model I create, plus of course I want it to be checked as deleted when I delete it from the admin page instead of being physically deleted, and I dont want these records checked as deleted to be listed. I'm new to ...

Getting logical drives

I use following code to get logical drives: string[] strDrives = Environment.GetLogicalDrives(); but when I want to iterate through it, an exception occurs, with the message: Drive Not Ready How can I get just ready drives? ...

Swapping two variable value without using 3rd variable

One of the very tricky question asked in an interview... we need to swap the values of two variables like a=10 and b=15 Generaly to swap two variables values, we need 3rd variable like.. temp=a a=b b=temp Now the requirement is, swaping value of two variable values without using 3rd variable? How can be accopmplish this? ...

regex && logical condition (telephone numbers in Sweden)

8, 10, 12, 981 (few area codes in Sweden). Total phone number can be 10 or 11 (digits only) If 8 + 9 or 10 digits if 981 + 7 or 8 digits Can this be done in regex? something like that ..hm (8|10|12)\d{n} => Total Length 10 or 11 ...

Why is this logical expression in python False?

My question is, why are these expressions False? Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> num = raw_input("Choose a number: ") Choose a number: 5 >>> print num 5 >>> print ( num < 18 ) False >>> print ( num == 5 ) False Because i...

Replace empty cells with logical 0's before cell2mat in MATLAB

I've got a cell array of empty cells and ones that I want to convert to a logical array, where the empty cells are zeros. When I use cell2mat, the empty cells are ignored, and I end up with a matrix of solely 1's, with no reference to the previous index they held. Is there a way to perform this operation without using loops? Example cod...

Optimal code in Java to convert Integer value into Hexadecimal

Hello All... I Have one situation where I need to convert integer value into hexadecimal way. I have done with some logical, but I want the optimized solutions... Thanks in advance... EDIT : Sorry I forgot to post that I am not allowed to use any in-built functions. ...

Complicated programming and math tasks online. Any?

Possible Duplicate: What are some good websites for programming puzzles? Maybe it is not very thematic question in here, but I guess it will be interesting not only to me. I hope. So, I just want to get some cool tasks to do using programming languages or just pen and sheet of paper. I guess it can lead to improving my abilit...

The largest prime factor with php

So, I wrote php program to find the largest prime factor with php and I think it is quite optimal, because it loads quite fast. But there is a problem, it doesn't count very big numbers's prime factors. Here is a program: function is_even($s) { $sk_sum = 0; for($i = 1; $i <= $s; $i++) { if($s % $i == 0) { $sk_sum++; }...

Is there any way to maximize PHP_INT_MAX?

I can't find this row in php.ini, so is there any way to do that? So ok, I understood, the answer is not, then how should I calculate the result of this task if I want it do with php? The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? ...

Logical vs Numerical array in MATLAB

I am comparing two binary arrays. I have an array where values can either be one or zero, one if the values are the same and zero if they are not. Please note I am doing other stuff beyond checking, so we don't need to get into vectorization or the nature of the code. What is more efficient, using a numerical array or a logical array in...

Merge two sorted parts of an array with constant memory in O(n) time

Hi! Assume we have an array of length N where the subarrays from 0 to N/2 and N/2 to N elements are sorted. Is it possible to sort the whole array using constant memory in O(N) time? Example of an array: 10, 20, 30, 40, 1, 2, 35, 60 ...