Search Results

Search found 6376 results on 256 pages for 'launch condition'.

Page 96/256 | < Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >

  • about sending messages among bg.html, popup.html and contentscript.js

    - by T_t
    Hi!:) In my extension, when a button named "mybutton1" in the popup.html is clicked, it sends a message "getvar1" to the contentscript.js, then the contentscript.js sends a message "i want var1" to the background.html to get an object named "var1".If the button named "mybutton2" is clicked, the contentscript.js gets the "var2" object. How should i do under this condition? What's more, i am a little confused about the chrome.extension.onRequest.addListener method and chrome.extension.sendRequest method.Could someone tell me the mechanism of the two methods? Thanks!

    Read the article

  • Need help in Select query..

    - by Parth
    If I have four rows for a field with different values with other fields similar and then other four rows with same condition, as given below here u can see there different rows for insert with only difference in the "newvalue" and "field" excluding "id" for the table_name=jos_menu, operation=INSERT and live=0 now here what select query should be used to get only single row from the table on every change of table_name...??

    Read the article

  • Disabling all the Page Control through jQuery.

    - by Sanju
    I am working on asp.net and c#. I am using lots of ASP and HTML controls on the page and in some cases all the controls gets disabled. Some of the used Controls are: RadioButton RadioButtonList CheckBox CheckBoxList TextBox DropDownList Button etc... I need a Simple and short method to disabled all the Controls when i call this jQuery method on some condition. Any Help? Thanks in Advance...

    Read the article

  • Exact textual representation of an IEEE "double"

    - by CyberShadow
    I need to represent an IEEE 754-1985 double (64-bit) floating point number in a human-readable textual form, with the condition that the textual form can be parsed back into exactly the same (bit-wise) number. Is this possible/practical to do without just printing the raw bytes? If yes, code to do this would be much appreciated.

    Read the article

  • Understanding Haskell's filter

    - by dmindreader
    I understand that Haskell's filter is a high order function (meaning a function that takes another function as a parameter) that goes through a list checking which element fulfills certain boolean condition. I don't quite understand its definition: filter:: (a->Bool)->[a]->[a] filter p [] = [] filter p (x:y) | p x = x:filter p y | otherwise = filter p y I understand that if I pass an empty list to the function, it would just return an empty list, but how do I read the last two lines?

    Read the article

  • General ORM design question

    - by Calvin
    Suppose you have 2 classes, Person and Rabbit. A person can do a number of things to a rabbit, s/he can either feed it, buy it and become its owner, or give it away. A rabbit can have none or at most 1 owner at a time. And if it is not fed for a while, it may die. Class Person { Void Feed(Rabbit r); Void Buy(Rabbit r); Void Giveaway(Person p, Rabbit r); Rabbit[] rabbits; } Class Rabbit { Bool IsAlive(); Person pwner; } There are a couple of observations from the domain model: Person and Rabbit can have references to each other Any actions on 1 object can also change the state of the other object Even if no explicit actions are invoked, there can still be a change of state in the objects (e.g. Rabbit can be starved to death, and that causes it to be removed from the Person.rabbits array) As DDD is concerned, I think the correct approach is to synchronize all calls that may change the states in the domain model. For instance, if a Person buys a Rabbit, s/he would need to acquire a lock in Person to make a change to the rabbits array AND also another lock in Rabbit to change its owner before releasing the first one. This would prevent a race condition where 2 Persons claim to be the owner of the little Rabbit. The other approach is to let the database to handle all these synchronizations. Who makes the first call wins, but then the DB needs to have some kind of business logics to figure out if it is a valid transaction (e.g. if a Rabbit already has an owner, it cannot change its owner unless the Person gives it away). There are both pros/cons in either approach, and I’d expect the “best” solution would be somewhere in-between. How would you do it in real life? What’s your take and experience? Also, is it a valid concern that there can be another race condition the domain model has committed its change but before it is fully committed in the database? And for the 3rd observation (i.e. state change due to time factor). How will you do it?

    Read the article

  • MS Office & WebDAV Server Engine for .NET

    - by costa
    On this website,http://www.webdavsystem.com/server/documentation/ms_office_read_only, it states that in order to open a writable version of a MS Office doc this condition has to be met: Your WebDAV server must be configured on site root. Is this still true? Because I tried the SqlStorage sample and it works fine. I deployed the application on IIS 7, under <server>/TestWebDav and MS Office 2010 opened the documents in the sample just fine. Thanks

    Read the article

  • how important to register(license) your own components?

    - by XBasic3000
    i am new to component building, and i had notice to other components has a a comment on top of there units like agreement, terms and condition etc. wither its free or commercial. How important is to register(license) your own component and how/where? and when do you need to register it? how about the freeware? must have a licese too?

    Read the article

  • Does Hibernate always need a setter when there is a getter?

    - by Marcus
    We have some Hibernate getter methods annotated with both @Column and @Basic. We get an exception if we don't have the corresponding setter. Why is this? In our case we are deriving the value returned from the getter (to get stored in the DB) and the setter has no functional purpose. So we just have an empty method to get around the error condition..

    Read the article

  • SQL conditional row insert

    - by Pablo
    Is it possible to insert a new row if a condition is meet? For example, i have this table with no primary key nor uniqueness +----------+--------+ | image_id | tag_id | +----------+--------+ | 39 | 8 | | 8 | 39 | | 5 | 11 | +----------+--------+ I would like to insert a row if a combination of image_id and tag_id doesn't exists for example; INSERT ..... WHERE image_id!=39 AND tag_id!=8

    Read the article

  • Finding N contiguous zero bits in an integer to the left of the MSB position of another integer

    - by James Morris
    The problem is: given an integer val1 find the position of the highest bit set (Most Significant Bit) then, given a second integer val2 find a contiguous region of unset bits, with the minimum number of zero bits given by width to the left of the position (ie, in the higher bits). Here is the C code for my solution: typedef unsigned int t; unsigned const t_bits = sizeof(t) * CHAR_BIT; _Bool test_fit_within_left_of_msb( unsigned width, t val1, t val2, unsigned* offset_result) { unsigned offbit = 0; unsigned msb = 0; t mask; t b; while(val1 >>= 1) ++msb; while(offbit + width < t_bits - msb) { mask = (((t)1 << width) - 1) << (t_bits - width - offbit); b = val2 & mask; if (!b) { *offset_result = offbit; return true; } if (offbit++) /* this conditional bothers me! */ b <<= offbit - 1; while(b <<= 1) offbit++; } return false; } Aside from faster ways of finding the MSB of the first integer, the commented test for a zero offbit seems a bit extraneous, but necessary to skip the highest bit of type t if it is set. I have also implemented similar algorithms but working to the right of the MSB of the first number, so they don't require this seemingly extra condition. How can I get rid of this extra condition, or even, are there far more optimal solutions? Edit: Some background not strictly required. The offset result is a count of bits from the high bit, not from the low bit as maybe expected. This will be part of a wider algorithm which scans a 2D array for a 2D area of zero bits. Here, for testing, the algorithm has been simplified. val1 represents the first integer which does not have all bits set found in a row of the 2D array. From this the 2D version would scan down which is what val2 represents. Here's some output showing success and failure: t_bits:32 t_high: 10000000000000000000000000000000 ( 2147483648 ) --------- ----------------------------------- *** fit within left of msb test *** ----------------------------------- val1: 00000000000000000000000010000000 ( 128 ) val2: 01000001000100000000100100001001 ( 1091569929 ) msb: 7 offbit:0 + width: 8 = 8 mask: 11111111000000000000000000000000 ( 4278190080 ) b: 01000001000000000000000000000000 ( 1090519040 ) offbit:8 + width: 8 = 16 mask: 00000000111111110000000000000000 ( 16711680 ) b: 00000000000100000000000000000000 ( 1048576 ) offbit:12 + width: 8 = 20 mask: 00000000000011111111000000000000 ( 1044480 ) b: 00000000000000000000000000000000 ( 0 ) offbit:12 iters:10 ***** found room for width:8 at offset: 12 ***** ----------------------------------- *** fit within left of msb test *** ----------------------------------- val1: 00000000000000000000000001000000 ( 64 ) val2: 00010000000000001000010001000001 ( 268469313 ) msb: 6 offbit:0 + width: 13 = 13 mask: 11111111111110000000000000000000 ( 4294443008 ) b: 00010000000000000000000000000000 ( 268435456 ) offbit:4 + width: 13 = 17 mask: 00001111111111111000000000000000 ( 268402688 ) b: 00000000000000001000000000000000 ( 32768 ) ***** mask: 00001111111111111000000000000000 ( 268402688 ) offbit:17 iters:15 ***** no room found for width:13 ***** (iters is the count of iterations of the inner while loop)

    Read the article

  • Rails ActiveRecord conditions

    - by xpepermint
    Is there a way to create a condition like this? @products = Product.find(:all, :limit => 5, :conditions => { :products => { :locale => 'en', :id NOT '1' }, :tags => { :name => ['a','b']}) I would like to list all products not including product 1. Thx.

    Read the article

  • Get data on the basis of conditions in entity framework 3.5 with include

    - by Ashwani K
    Hello All: I am using entity framework 3.5 for my application. I want load data based on some condition e.g. var data = from e in context.Employee.Include("Employee.Projects") where e.IsActive select e; Using this, I will get all the Employees which are active with their project details. But I want to load only those projects which are active. So, how to load only active projects using the query? Thanks Ashwani

    Read the article

  • How to take first 4 time for each person.

    - by Gopal
    Using Access Database Table ID Time 001 100000 001 100005 001 103000 001 102500 001 110000 001 120000 001 113000 ..., From the above table, i want to take first four time Query like Select id, min(time) from table group by id I want to take first four min(time) for each person Expected Output ID Time 001 100000 001 100005 001 102500 001 103000 002 ..., How to make a query for this condition?

    Read the article

  • How to start a ColorAnimation from a MultiTrigger in a ControlTemplate ?

    - by banzai
    Hi all I have the following ControlTemplate for a WPF TabItem: <ControlTemplate x:Key="DefaultTabItemTemplate" TargetType="{x:Type TabItem}"> <ControlTemplate.Resources> <SolidColorBrush x:Key="UnselectedForegroundBrush" Color="#414141" /> <!-- Unique color for this template --> <SolidColorBrush x:Key="SelectedForegroundBrush" Color="#457581" /> <!-- Unique color for this template --> <SolidColorBrush x:Key="MouseOverTextBrush" x:Name="local_MouseOverTextBrush" Color="#FFF2F2F2"/> </ControlTemplate.Resources> <Grid> <Border Name="Border" MinHeight="30" Margin="0,0,0,-1" Background="{DynamicResource TabControlBackgroundBrush}" BorderBrush="{DynamicResource ndt_DisabledForegroundBrush}" BorderThickness="1,1,1,1" CornerRadius="0,0,0,0" > <ContentPresenter x:Name="ContentSite" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.FontStretch="UltraExpanded" TextElement.FontWeight="UltraBlack" ContentSource="Header" Margin="12,2,12,2" RecognizesAccessKey="True" /> </Border> </Grid> <ControlTemplate.Triggers> <Trigger Property="IsSelected" Value="True"> <Setter Property="Panel.ZIndex" Value="2" /> <Setter TargetName="Border" Property="Background" Value="{DynamicResource ndt_TabControlBackgroundBrush}" /> <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" /> <Setter TargetName="ContentSite" Property="TextElement.Foreground" Value="{StaticResource SelectedForegroundBrush}" /> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="Border" Property="Background" Value="{DynamicResource ndt_DisabledBackgroundBrush}" /> <Setter TargetName="ContentSite" Property="TextElement.Foreground" Value="{DynamicResource ndt_DarkGray}" /> <Setter Property="Foreground" Value="{DynamicResource ndt_DisabledForegroundBrush}" /> </Trigger> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsMouseOver" Value="True" /> <Condition Property="IsSelected" Value="False" /> </MultiTrigger.Conditions> <Setter TargetName="Border" Property="Background" Value="{DynamicResource ndt_NavigationAreaBrush}" /> <Setter TargetName="ContentSite" Property="TextElement.Foreground" Value="{DynamicResource MouseOverTextBrush}" /> </MultiTrigger> </ControlTemplate.Triggers> </ControlTemplate> Everything works fine so far. The MultiTrigger at the end of the template defines a mouse over effect for not selected TabItems. Now I thought the change in color for this mouse over effect looks a bit brash so let´s animate it with a ColorAnimation. But don´t count the chickens before they hatch - everything I tried didn´t work. Maybe I oversee the obvious - but how to achieve this feat ? Thanks in advance banzai

    Read the article

  • how to remove ConcurrentModificationException

    - by maverick
    what is this exception and how to remove this in my problem i am creating an arraylist of objects, and after checking some condition,i want to remove some objects. but the program is giving this exception ConcurrentModificationException. how to remove this thanks in advance

    Read the article

  • Read from cin or a file

    - by m42a
    When I try to compile the code istream in; if (argc==1) in=cin; else { ifstream ifn(argv[1]); in=ifn; } gcc fails, complaining that operator= is private. Is there any way to set an istream to different values based on a condition?

    Read the article

  • Slow form submission.

    - by Tony
    When I submit a form, I can see my browser's progress bar slowly increased, it takes 4-6s to submit a form. It was a generic form like : <form id="someid" name="someName" action="someAction.do"> ... </form> I test it in IE8 and Firefox 3,both are very slow. My network condition is fine, my server works great. What could be the problem?

    Read the article

  • Avoid throwing a new exception

    - by GustlyWind
    I have an if condition which checks for value and the it throws new NumberFormatException Is there any other way to code this if (foo) { throw new NumberFormatException } // .. catch (NumberFormatException exc) { // some msg... }

    Read the article

< Previous Page | 92 93 94 95 96 97 98 99 100 101 102 103  | Next Page >