Search Results

Search found 35561 results on 1423 pages for 'value'.

Page 75/1423 | < Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >

  • Conditionally set a column to its default value in Postgres

    - by Evgeny
    I've got a PostgreSQL 8.4 table with an auto-incrementing, but nullable, integer column. I want to update some column values and, if this column is NULL then set it to its default value (which would be an integer auto-generated from a sequence), but I want to return its value in either case. So I want something like this: UPDATE mytable SET incident_id = COALESCE(incident_id, DEFAULT), other = 'somethingelse' WHERE ... RETURNING incident_id Unfortunately, this doesn't work - it seems that DEFAULT is special and cannot be part of an expression. What's the best way to do this?

    Read the article

  • ColdFusion static key/value list?

    - by richardtallent
    I have a database table that is a dictionary of defined terms -- key, value. I want to load the dictionary in the application scope from the database, and keep it there for performance (it doesn't change). I gather this is probably some sort of "struct," but I'm extremely new to ColdFusion (helping out another team). Then, I'd like to do some simple string replacement on some strings being output to the browser, looping through the defined terms and replacing the terms with some HTML to define the terms (a hover or a link, details to be worked out later, not important). Can anyone point me in the right direction of: How to define the stucture (if that is what I need for a key/value pair list) How to query at the application start-up and reuse the list properly The best way to do the string replacement

    Read the article

  • I can't change HTTP request header Content-Type value using jQuery

    - by Matt
    Hi I tried to override HTTP request header content by using jQuery's AJAX function. It looks like this $.ajax({ type : "POST", url : url, data : data, contentType: "application/x-www-form-urlencoded;charset=big5", beforeSend: function(xhr) { xhr.setRequestHeader("Accept-Charset","big5"); xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded;charset=big5"); }, success: function(rs) { target.html(rs); } }); Content-Type header is default to "application/x-www-form-urlencoded; charset=UTF-8", but it obviously I can't override its value no matter I use 'contentType' or 'beforeSend' approaches. Could anyone adivse me a hint that how do I or can I change the HTTP request's content-type value? thanks a lot. btw, is there any good documentation that I can study JavaScript's XMLHttpRequest's encoding handling?

    Read the article

  • Getting a value from a row at particular time

    - by Swetha Bindu
    I had a row in my database: starttime:4/6/2012 2:00pm, Endtime:31/12/9999, name:"swetha", status:"open"..... When I update this row I changed the starttime to the current time (getdate()) and have no issues. I am running a Windows Service each day at 1am to modify a value in the row. I would like to know the status of my row at 4/6/2012 11:59 pm when my service runs. There is no need to do an update at 4/6/2012 11:59 pm and the last update may be at any time of the day however my requirement is to get the status value at 4/6/2012 11:59 pm. I would like to have the query in SQL Server 2008. Can anyone please help me to find a solution?

    Read the article

  • jsf icefaces basic problem with displaying value

    - by michal
    Hi All, I don't know what I'm doing wrong.I'm using icefaces and have basic controller: public class TestingController { private String name; public String submit() { setName("newName"); return null; } public void setName(String name) { this.name = name;} public String getName() { return name; } } --------and view: <ice:inputText id="inp" value="#{testController.name}" /> <br> <ice:commandButton id="submit" value="SUBMIT" action="#{testController.submit}" /> When I submit the form after first displaying the page..the input is set to newName, next I clear the inputText to "". and submit again but the name is not set to newName again as I would expect but it's empty. thank you in advance for you help.

    Read the article

  • Selenium: How to use stored value in a javascript comparison

    - by dstrube
    I've searched around for the answer to this and found lots of much more complicated questions, but none that gave me insight enough to figure this one out. What I'm doing: 1- open a page with a number that will probably be large 2- get the X Path to where that number is and store it to a variable 3- do a javascript to compare the above stored variable to see if it is bigger than 10, if so, set a new varaible to true; else false (because that is the default value) 4- verify the variable in #3 is true Sounds simple enough, no? Where it goes wrong: At step 3, comparing the variable from step #2 to 10 isn't allowed, at least not the way I'm writing it. Why? Details: <tr> <td>open</td> <td>http://www.google.com/search?hl=en&q=selenium+verifyEval</td> <td></td> </tr> <tr> <td>store</td> <td>/html/body/div[5]/div/p/b[3]</td> <td>resultCount</td> </tr> <tr> <td>storeEval</td> <td>var isMoreThan10 = new Boolean(); isMoreThan10 = (resultCount &gt; 10);</td> <td>isMoreThan10</td> </tr> <tr> <td>verifyExpression</td> <td>${isMoreThan10}</td> <td>true</td> </tr> I just thought of one possible workaround: Exapnd the javascript code to get the value there & assign it to a variable there so I'll be more likely to be able to use that variable in the javascript. Not sure exactly how that would be done- anyone wanna help with that? But surely there is be a better way, isn't there? I must be able to assign a value to a variable in Selenium, then in the next line use that variable in a javascript, right?

    Read the article

  • Extracting numeric value from output of a uder defined aggregate in netezza using bash script

    - by Ankit
    I am executing a shell script to execute my user defined aggregate which is taking inputs yavg=nzsql -c 'select avg(x) from Input1' which is giving output like this AVG ---------- 2.000000 (1 row) I want to pass only the numeric(double) value which is 2.0000(where xavg is expected) from this to S4(x,y,$xavg,$yavg) where x and y are the whole column from table Input1, xavg=nzsql -c 'select avg(y) from Input1' Below is my InputTable.txt which is a text file from which I am popluating my "Input1" table in the shell script. 1 2 3 2 1 2 3 2 1 nzsql -c 'create table Input1(x integer, y integer, v integer)' nzload -t Input1 -df InputTable.txt nzsql -c 'select * from Input1 yavg=`nzsql -c 'select avg(x) from Input1'` xavg=`nzsql -c 'select avg(y) from Input1' nzsql -c 'select S4(x,y,$xavg,$yavg) from test' Below is the output : xavg := AVG ---------- 2.000000 (1 row) yavg := AVG ---------- 1.666667 (1 row) and i am passing this value to S4(x,y,$xavg,$yavg) which is a User defined aggregate

    Read the article

  • how to add value to windows installer property table

    - by Felix
    According to MSDN installer sets ROOTDRIVE to the local drive that can be written to having the most free space. In my situation it is a slow USB drive that I use for nightly backup, but I would prefer to use my C drive for the install folder. But somehow I can't figure out how to set this property from command line or through PowerShell. I found that it is possible, but these instructions don't make any sense

    Read the article

  • Delete cell content in Libre (Open) Office based on the cell value

    - by take2
    I have a huge csv file (tens of thousands of rows) that I need to filter based on different criteria. After trying to find a proper CSV editor, I decided to use LibreOffice Calc. CSVed is great, but it doesn't support neither UTF-8 nor macros for advanced filtering. So, there are 4 columns, 3 of which contain numbers (with decimal numbers) and 1 of which contains text. I'm trying to find a way to delete rows with a macro code. I can achieve the desired behavior with filters too, but it's annoying to type all of the filtering values over and over again and there doesn't seem to be a way to export the filter and us it repeatedly. These rows should be deleted: The ones that don't contain certain words in textual column (column A). There are a few thousand different words used in that column and I want to keep only the rows that contain one of about 30 words in that column. Additionally, the number is the other columns should be bigger than 3.8 (column B), 4.5 (column C) and smaller than 20 (column C). The row-deletion type is "Shift up". Hopefully I have explained it well. Thanks a lot in advance for your help!

    Read the article

  • Query for value where a default namespace node exists

    - by Jay
    I have the following XML that is provided to me and I cannot change it: <Parent> <Settings Version="1234" xmlns="urn:schemas-stuff-com"/> </Parent> I am trying to retrieve the "Version" attribute value using XPath. It appears since the xmlns is defined without an alias it automatically assigns that xmlns to the Settings node. When I read this XML into an XMLDocument and view the namespaceURI value for the Settings node it is set to "urn:schemas-stuff-com". I have tried: //Parent/Settings/@Version - returns Null //Parent/urn:schemas-stuff-com:Settings/@Version - invalid syntax

    Read the article

  • Mock a void method which change the input value

    - by Kar
    Hi, How could I mock a void method with parameters and change the value parameters? My void method looks like this: public interface IFoo { void GetValue(int x, object y) // takes x and do something then access another class to get the value of y } I prepared a delegate class: private delegate void GetValueDelegate(int x, object y); private void GetValue(int x, object y) { // process x // prepare a new object obj if (y == null) y = new Object(); if (//some checks) y = obj; } I wrote something like this: Expect.Call(delegate {x.GetValue(5, null);}).Do (new GetValueDelegate(GetValue)).IgnoreArguments().Repeat.Any(); But seems like it's not working. Any clue on what could be wrong?

    Read the article

  • Large, high performance object or key/value store for HTTP serving on Linux

    - by Tommy
    I have a service that serves images to end users at a very high rate using plain HTTP. The images vary between 4 and 64kbytes, and there are 1.300.000.000 of them in total. The dataset is about 30TiB in size and changes (new objects, updates, deletes) make out less than 1% of the requests. The number of requests pr. second vary from 240 to 9000 and is dispersed pretty much all over, with few objects being especially "hot". As of now, these images are files on a ext3 filesystem distributed read only across a large amount of mid range servers. This poses several problems: Using a fileysystem is very inefficient since the metadata size is large, the inode/dentry cache is volatile on linux and some daemons tend to stat()/readdir() it's way through the directory structure, which in my case becomes very expensive. Updating the dataset is very time consuming and requires remounting between set A and B. The only reasonable handling is operating on the block device for backup, copying, etc. What I would like is a deamon that: speaks HTTP (get, put, delete and perhaps update) stores data it in an efficient structure. The index should remain in memory, and considering the amount of objects, the overhead must be small. The software should be able to handle massive connections with slow (if any) time needed to ramp up. Index should be read in memory at startup. Statistics would be nice, but not mandatory. I have experimented a bit with riak, redis, mongodb, kyoto and varnish with persistent storage, but I haven't had the chance to dig in really deep yet.

    Read the article

  • javascript filter nested object based on key value

    - by murray3
    I wish to filter a nested javascript object by the value of the "step" key: var data = { "name": "Root", "step": 1, "id": "0.0", "children": [ { "name": "first level child 1", "id": "0.1", "step":2, "children": [ { "name": "second level child 1", "id": "0.1.1", "step": 3, "children": [ { "name": "third level child 1", "id": "0.1.1.1", "step": 4, "children": []}, { "name": "third level child 2", "id": "0.1.1.2", "step": 5, "children": []} ]}, ]} ] }; var subdata = data.children.filter(function (d) { return (d.step <= 2)}); This just returns the unmodified nested object, even if I put value of filter to 1. does .filter work on nested objects or do I need to roll my own function here, advise and correct code appreciated. cjm

    Read the article

  • Converting "User Shell Folders" registry value

    - by Sach
    The following registry key contains many system default folder locations. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders The value for the path of the All Users desktop, which is found there, is as follows: XP or earlier : [%ALLUSERSPROFILE%\Desktop] Vista or later: [%PUBLIC%\Desktop] Whereas the actual paths of the All User desktops, respectively, are as follows: XP or earlier : "C:\Documents and Settings\All Users\Desktop" Vista or later: "C:\Users\Public\Desktop" Now, if you use copy and paste the above registry values in Windows Explorer and hit enter it takes you to the actual folders. For example, if you paste [%PUBLIC%\Desktop] in a Windows Explorer in Vista it takes you to ["C:\Users\Public\Desktop"]. My question is this; how do I reproduce this behavior from withing a C# program? To be more specific, if I retrieve the registry value [%PUBLIC%\Desktop] from withing a C# program, which I can do easily, how do I convert it to ["C:\Users\Public\Desktop"]? Obviously I'm not looking for a string replacement, I need to do what Windows does.

    Read the article

  • Get a CSS value from external style sheet with Javascript/jQuery

    - by Acorn
    Is it possible to get a value from the external CSS of a page if the element that the style refers to has not been generated yet? (the element is to be generated dynamically). The jQuery method I've seen is $('element').css('property','value');, but this relies on element being on the page. Is there a way of finding out what the property is set to within the CSS rather than the computed style of an element? Will I have to do something ugly like add a hidden copy of the element to my page so that I can access its style attributes?

    Read the article

  • xsl:value-of Not Working

    - by Ashar Syed
    Hi, I am having a little issue this piece of code in my Xsl. <xsl:if test="ShippingName != ''"> <tr> <td colspan="6" style="border:none;" align="right"> <strong>Shipping Via</strong> </td> <td align="right"> <xsl:value-of select="ShippingName" /> </td> </tr> </xsl:if> It passes the test condition (ShippingName != '') and assigns the style to 'td' but at the point where I am displaying the value that this element contains (), it displays nothing. Any ideas why this could be happening. Thanks.

    Read the article

  • how to change the value to a name depending on case

    - by ZeroSoul13
    i've created a select button with 3 option <%= f.label :prioridad %><br/> <%= f.select :prioridad, options_for_select([['Alta', 1], ['Medio', 2], ['Baja', 3]]) %> The value gets inserted to the DataBase but when i display it i see the number op the option selected (which is correct). What i would like to know is how i can change that so on the index the user can see the name and not the value: def convertidor case llamada.prioridad when prioridad == '1' puts "Alta" when prioridad == '2' puts "Media" else puts "Baja" end end This didn't worked. Regars

    Read the article

  • Show up value of select option in IE

    - by Pete
    Hello, I have a problem with a html select object and its options in IE. My html <select id="Select1" onchange="closeMenu1(this.value)"> <option></option> <option>1</option> <option>2</option> And the javascript function closeMenu1 (x) { var show = document.getElementById("divID"); show.innerHTML = x; } Now, in every browser except the IEs the divID will show up the value which I selected in the select object. But IE doesn’t. Can somebody please tell me a way around that? Thanks.

    Read the article

  • Passing value from :locals to link_remote_to

    - by Teef L
    In my edit.haml file, I have =render :partial => 'old_question_tags', :locals => {:current_question => @question.id}. I'd like to pass the value in :current_question to a link_to_remote call in _old_question_tags.haml: #{link_to_remote image_tag('red-x.png', {:alt => "Remove #{t.name} tag"}), :url => {:action => 'remove_old_tag_from_question', :tag_remove => t.id, :current_question => current_question}} But I get this error on the link_to_remote line: ActionView::TemplateError (undefined local variable or method `current_question' for #<ActionView::Base:0xdb2fec8>) In _old_question_tags.haml, if I just print current_question (using =current_question), it prints the number without any problems. How do I properly pass that value to the partial so that I can pass it to the link_to_remote call?

    Read the article

  • Get a value from hashtable by a part of its key

    - by htf
    Hi. Say I have a Hashtable<String, Object> with such keys and values: apple => 1 orange => 2 mossberg => 3 I can use the standard get method to get 1 by "apple", but what I want is getting the same value (or a list of values) by a part of the key, for example "ppl". Of course it may yield several results, in this case I want to be able to process each key-value pair. So basically similar to the LIKE '%ppl%' SQL statement, but I don't want to use a (in-memory) database just because I don't want to add unnecessary complexity. What would you recommend?

    Read the article

< Previous Page | 71 72 73 74 75 76 77 78 79 80 81 82  | Next Page >