flags

Correct to check for a command line flag in bash

In the middle of a scrip, I want to check if a given flag was passed on the command line. The following does what I want but seems ugly: if echo $* | grep -e "--flag" -q then echo ">>>> Running with flag" else echo ">>>> Running without flag" fi Is there a better way? Note: I explicitly don't want to list all the flags in a switc...

Sign Flag and Overflow Flag are not functioning according to expectation

Suppose AX=8FFE and BX= 0FFF Now if we write Cmp ax,bx Now at this point what will happen is, source (bx) will be subtracted from destination (ax) and the appropriate flags will be updated. As computer represent each number in 2’s complement form so 8FFE is a 2’s complement of some number similarly 0FFF is 2’s complement of some numb...

Drupal Views Relationship ADD not LIMIT

I'm trying to set up a relationship system between node, using flags and cck node reference (using views selection). I need to create a view that does not LIMIT by relation, it adds to it. Example: When you add a Node-B, you can reference a Node-A that you have created - OR - flagged (using flags module) When I use views to get the fl...

C++/g++: Concurrent programm

Hi, I got a C++ program (source) that is said to work in parallel. However, if I compile it (I am using Ubuntu 10.04 and g++ 4.4.3) with g++ and run it, one of my two CPU cores gets full load while the other is doing "nothing". So I spoke to the one who gave me the program. I was told that I had to set specific flags for g++ in order t...

TranslateThis Button

hello..... just now i saw "TranslateThis Button" which is the script for translate the webpage using javascript. is there any chance to display language flags(ex: only four flags) with out dropdown? please help me.link text here is the code ` <!-- Begin TranslateThis Button --> <div id="translate-this"><a href="http://translateth.is...

GCC Compiler Flags Don't Match ELF Flags

I chopped down my make file so I can compile a C++ program with very few, but some flags set to see if I can determine if they are working. The following is my make file section on C++ flags: # Common compiler flags CFLAGS = -mips1 -Wa,-non_shared \ -mno-abicalls \ -I. -I$(SESCSOURCEDIR)/src/libapp \ -I$(SESC...

How to get imap flags?

Hello, I used the imap4flag plugin for Dovecot sieve: http://wiki.dovecot.org/LDA/Sieve#Flagging_or_Highlighting_your_mail The flag is correctly show in thunderbird but I search how get the flags for show them in roundcube. Thank's in advance. ...

Flags Enum attribute

What is the point of the [Flags] attribute you can bit test without it? ...

How to recognize x509 flags

Is there any way to tell the difference between data after flags and sub-flags after the flag? in a yahoo certificate i exported, there is a section with a0 2d a0 2b ..., where its all flags. on the other hand, the subject key ID is "a0 1e 6e 0c 9b 6e 6a eb d2 ae 5a 4a 18 ff 0e 93 46 1a d6 32". how would i tell the difference between whi...

Enums and flags checks in a given environmental condition

I have a event ServerStateReceived here checking condition of 4 servers whether they are UP or Down going on.In this particular type of scenario server will be down on beginning but after sometime server should be Up.So all 4 servers down and ReadySent = true; is a rare case we need to look . I have a method public write() in t...

how to maintain flag check for enumeration

I have a event ServerStateReceived here checking condition of 4 servers whether they are UP or Down is going on.Here if flag ReadySent = true and 4 servers DOWN(Both are rare condition in a typical scenario) there will be a logic so that cotrol will go to the calling function only after all servers became UP here is bit of code pri...

How to Bind Flags Enums To ListBox In MVVM

Hi, I want to bind an enum which has flags attribute to a listbox with a check list box item template in mvvm pattern? How can I do this? [Flags] public enum SportTypes { None = 0, Baseball = 1, Basketball = 2, Football = 4, Handball = 8, Soccer = 16, Volleyball = 32 } <ListBox Name="checkboxList2" ...

What is the best way to flag a model as inappropriate/spam in Django?

I am new to Django and in my webapp I'd like the user to be able to flag a model as inappropriate. I've been using reuasable apps like django-voting and tagging but there is not much documentation for django-flag. Suggestions? ...

android intent history

I have an application that execute a specific task when a file is clicked or an HTTP links is shared to it. I only want to execute the task once, unless the user himself re-execute the task. To be sure, I monitor the flag: FLAG_ACTIVITY_LAUNCHED_FROM_HISTORY. If its set I ignore the task, if not, I execute it. The problem is that som...

Individual User 'top 5' lists

Hello, I am aiming to produce a individual top 5 list for each user of my drupal site. now trying to work this one out has become quite difficult and hence why i am here. what im looking for is a top 5 list which allows the user to select nodes to be ranked by the user. so at anytime the user can edit the list and re-order the list. ...

MySQL problem with statement

SELECT a.id,i.* FROM ads a INNER JOIN images i ON i.ad_id=a.id GROUP BY a.id LIMIT 10 Can't figure out, how to pick images with flag "main" inside images table. For one a.id can be up to 3 photos inside images table, one of those 3 photos can have a field main=1. I need to pick photos by priority where flag mai...

How to check conditions in eventhandler

I have a method Modify which doing a operation ClientModify inside public bool Modify() { bool retval = false; retval = Spa.ClientModify(col); } Here what i wanted is the ClientModify should perform only after three events completed in the eventhandler "ServerEvents" otherwise it should return retval as false .How can i do that che...

PHP funtion flags, how?

I'm attempting to create a function with flags as its arguments but the output is always different with what's expected : define("FLAG_A", 1); define("FLAG_B", 4); define("FLAG_C", 7); function test_flags($flags) { if($flags & FLAG_A) echo "A"; if($flags & FLAG_B) echo "B"; if($flags & FLAG_C) echo "C"; } test_flags(...

android startActivityForResult FLAG_ACTIVITY_NEW_TASK

Is there a way to use startActivityForResult() in conjunction with the FLAG_ACTIVITY_NEW_TASK flag? I have a dialog activity that i want to be started new each time, however when i pass in the FLAG_ACTIVITY_NEW_TASK flag, then the onActivityResult() method of the calling activity is not called when i return from the child activity (usin...

enum flags with name

Hi! I'm going to use enum flags for options to initialize my class. The enum is: namespace MCXJS { enum VARPARAM { STATIC = 1, CONST = 2 } //other things } If I'm right, in this case, to check for STATIC I need to do this: if (param & MCXJS::VARPARAM::STATIC) //... I know to do it this way: if (par...