Search Results

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

Page 24/1423 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • Add constant value to numeric XML attribute

    - by Dave Jarvis
    Background Add a constant value to numbers matched with a regular expression, using vim (gvim). Problem The following regular expression will match width="32": /width="\([0-9]\{2\}\)" Question How do you replace the numeric value of the width attribute with the results from a mathematical expression that uses the attribute's value? For example, I would like to perform the following global replacement: :%s/width="\([0-9]\{2\}\)"/width="\1+10"/g That would produce width="42" for width="32" and width="105" for width="95". Thank you!

    Read the article

  • High shmmax value in Redhat 6.3

    - by xpapad
    We are using Redhat 6.3 with 30G RAM to host our Postgres server. The (default) shmmax value is 68,719,476,736 In some forums I have read that having an shmmax value larger than the RAM causes extensive paging, but in the Redhat forums it warns against changing a kernel parameter that is already configured to a value larger than the minimum requirements for an environment. In ServerFault I've read that this probably has no impact. So is there any impact of having shmmax value RAM in a DB server, or the kernel understands this and handles it appropriately? Thanks

    Read the article

  • Zabbix doesn't update value from file neither with log[] nor with vfs.file.regexp[] item

    - by tymik
    I am using Zabbix 2.2. I have a very specific environment, where I have to generate desired data to file via script, then upload that file to ftp from host and download it to Zabbix server from ftp. After file is downloaded, I check it with log[] and vfs.file.regexp[] items. I use these items as below: log[/path/to/file.txt,"C.*\s([0-9]+\.[0-9])$",Windows-1250,,"all",\1] vfs.file.regexp[/path/to/file.txt,"C.*\s([0-9]+\.[0-9])$",Windows-1250,,,\1] The line I am parsing looks like below: C: 8195Mb 5879Mb 2316Mb 28.2 The value I want to extract is 28.2 at the end of file. The problem I am currently trying to solve is that when I update the file (upload from host to ftp, then download from ftp to Zabbix server), the value does not update. I was trying only log[] at start, but I suspect, that log[] treat the file as real log file and doesn't check the same lines (althought, following the documentation, it should with "all" value), so I added vfs.file.regexp[] item too. The log[] has received a value in past, but it doesn't update. The vfs.file.regexp[] hasn't received any value so far. file.txt has got reuploaded and redownloaded several times and situation doesn't change. It seems that log[] reads only new lines in the file, it doesn't check lines already caught if there are any changes. The zabbix_agentd.log file doesn't report any problem with access to file, nor with regexp construction (it did report "unsupported" for log[] key, when I had something set up wrong). I use debug logging level for agent - I haven't found any interesting info about that problem. I have no idea what I might be doing wrong or what I do not know about how Zabbix is performing these checks. I see 2 solutions for that: adding more lines to the file instead of making new one or making new files and check them with logrt[], but those doesn't satisfy my desires. Any help is greatly appreciated. Of course I will provide additional information, if requested - for now I don't know what else might be useful.

    Read the article

  • Formula to search for a value in a range of cells

    - by Sacha
    I have a spreadsheet with several cells in one column. Each cell has identical conditional formatting: In 1 cell value equal to ='Y' In 2 cell value equal to ='N' In 3 cell value equal to ='?' What I would like to achieve is, if all 7 cells contain "Y" as the option then a separate cell will display "Yes", but if any of the cells contain "N" as the selection then the separate cell will display "NO". How can I achieve this?

    Read the article

  • Global list doesn't contain value at another function [migrated]

    - by burakim
    I want to make a global list and I saved a value in my global list (def rand()). Whatever I save, my saved value doesnt include at another function except rand(). What am I missing? sayi = [] def rand(): global sayi initial = 1000 for i in range(1000,10000): initial +=1 sayi.append(initial) print sayi[43] def main(): rand() print len(sayi) /////// Shows 0 but I have added value at rand funct. with append funct. main()

    Read the article

  • Big Data – Operational Databases Supporting Big Data – Key-Value Pair Databases and Document Databases – Day 13 of 21

    - by Pinal Dave
    In yesterday’s blog post we learned the importance of the Relational Database and NoSQL database in the Big Data Story. In this article we will understand the role of Key-Value Pair Databases and Document Databases Supporting Big Data Story. Now we will see a few of the examples of the operational databases. Relational Databases (Yesterday’s post) NoSQL Databases (Yesterday’s post) Key-Value Pair Databases (This post) Document Databases (This post) Columnar Databases (Tomorrow’s post) Graph Databases (Tomorrow’s post) Spatial Databases (Tomorrow’s post) Key Value Pair Databases Key Value Pair Databases are also known as KVP databases. A key is a field name and attribute, an identifier. The content of that field is its value, the data that is being identified and stored. They have a very simple implementation of NoSQL database concepts. They do not have schema hence they are very flexible as well as scalable. The disadvantages of Key Value Pair (KVP) database are that they do not follow ACID (Atomicity, Consistency, Isolation, Durability) properties. Additionally, it will require data architects to plan for data placement, replication as well as high availability. In KVP databases the data is stored as strings. Here is a simple example of how Key Value Database will look like: Key Value Name Pinal Dave Color Blue Twitter @pinaldave Name Nupur Dave Movie The Hero As the number of users grow in Key Value Pair databases it starts getting difficult to manage the entire database. As there is no specific schema or rules associated with the database, there are chances that database grows exponentially as well. It is very crucial to select the right Key Value Pair Database which offers an additional set of tools to manage the data and provides finer control over various business aspects of the same. Riak Rick is one of the most popular Key Value Database. It is known for its scalability and performance in high volume and velocity database. Additionally, it implements a mechanism for collection key and values which further helps to build manageable system. We will further discuss Riak in future blog posts. Key Value Databases are a good choice for social media, communities, caching layers for connecting other databases. In simpler words, whenever we required flexibility of the data storage keeping scalability in mind – KVP databases are good options to consider. Document Database There are two different kinds of document databases. 1) Full document Content (web pages, word docs etc) and 2) Storing Document Components for storage. The second types of the document database we are talking about over here. They use Javascript Object Notation (JSON) and Binary JSON for the structure of the documents. JSON is very easy to understand language and it is very easy to write for applications. There are two major structures of JSON used for Document Database – 1) Name Value Pairs and 2) Ordered List. MongoDB and CouchDB are two of the most popular Open Source NonRelational Document Database. MongoDB MongoDB databases are called collections. Each collection is build of documents and each document is composed of fields. MongoDB collections can be indexed for optimal performance. MongoDB ecosystem is highly available, supports query services as well as MapReduce. It is often used in high volume content management system. CouchDB CouchDB databases are composed of documents which consists fields and attachments (known as description). It supports ACID properties. The main attraction points of CouchDB are that it will continue to operate even though network connectivity is sketchy. Due to this nature CouchDB prefers local data storage. Document Database is a good choice of the database when users have to generate dynamic reports from elements which are changing very frequently. A good example of document usages is in real time analytics in social networking or content management system. Tomorrow In tomorrow’s blog post we will discuss about various other Operational Databases supporting Big Data. Reference: Pinal Dave (http://blog.sqlauthority.com) Filed under: Big Data, PostADay, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, T SQL

    Read the article

  • Boost.Program_Options not working with short options

    - by inajamaica
    I have the following options_description: po::options_description config("Configuration File or Command Line"); config.add_options() ("run-time,t", po::value(&runTime_)-default_value(1440.0), "set max simulation duration") ("starting-iteration,i", po::value(&startingIteration_)-default_value(1), "set starting simulation iteration") ("repetitions,r", po::value(&repetitions_)-default_value(100), "set number of iterations") ... ; As you can see the three shown have a long,short names employed. The long versions all work. However, none of the short ones do, and each time I try a -t 12345.0 or a -i 12345, etc., I get the following from Program_Options: std::logic_error: in option 'starting-iteration': invalid option value I'm using Boost 1.42 on Win32. Any thoughts on what might be going on here? Thanks!

    Read the article

  • DropDownList Value not changing with UpdatePanel and ModalPopupExtender

    - by Richard
    Greetings, I have an asp.net webpage with an modalpopupextender inside of an updatepanel. When I click Ok on the popup, I can get the textbox values from the popup just fine, but the DropDownLists have the old/default value, not the new value I have selected for them. All the controls on the popup are set to enableviewstate = true, and autopostback = false (I just want to make the trip to the server when I click the ok button, not every time I change the value of the popups). Here is the relevant code. ========================== Client Side <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate> <asp:Panel ID="EditIssuePanel" runat="server" CssClass="modalPopup" Style="display:block;" > <table style="width:500px;"> <tr style="height:50px;"> <td colspan="2" align="center"> <asp:Label ID="lblEditIssueHeader" runat="server" Text="Edit Issue"></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblIssueName" runat="server" Text="Name:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtName" runat="server" Width="250px" MaxLength="50"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDescription" runat="server" Text="Description:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtDescription" runat="server" Width="250px" MaxLength="1000"></asp:TextBox> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblType" runat="server" Text="Type:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlType" runat="server"> <asp:ListItem Selected="True" Value="B">Bug</asp:ListItem> <asp:ListItem Value="R">Request</asp:ListItem> <asp:ListItem Value="O">Other</asp:ListItem> </asp:DropDownList> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblStatus" runat="server" Text="Status:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlStatus" runat="server"> <asp:ListItem Selected="True" Value="L">Logged</asp:ListItem> <asp:ListItem Value="I">In Process</asp:ListItem> <asp:ListItem Value="C">Complete</asp:ListItem> </asp:DropDownList> &nbsp; </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblPriority" runat="server" Text="Priority:"></asp:Label> </td> <td class="datacolumn"> <asp:DropDownList ID="ddlPriority" runat="server" EnableViewState="true" AutoPostBack="false"> <asp:ListItem Selected="True" Value="L">Low</asp:ListItem> <asp:ListItem Value="M">Medium</asp:ListItem> <asp:ListItem Value="H">High</asp:ListItem> </asp:DropDownList> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logger</td> <td class="datacolumn"> <asp:Label ID="lblEnteredByClientUserID" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn"> <asp:Label ID="lblDateResolutionRequested" runat="server" Text="Requested Complete Date:"></asp:Label> </td> <td class="datacolumn"> <igsch:WebDateChooser ID="wdcRequestCompleteDate" runat="server"> </igsch:WebDateChooser> &nbsp;</td> </tr> <tr style="height:30px"> <td class="labelscolumn">Logged Date</td> <td class="datacolumn"> <asp:Label ID="lblLoggedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">In Process Date</td> <td class="datacolumn"> <asp:Label ID="lblInProcessDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px"> <td class="labelscolumn">Resolved Date</td> <td class="datacolumn"> <asp:Label ID="lblResolvedDate" runat="server" Text=""></asp:Label> </td> </tr> <tr style="height:30px;"> <td class="labelscolumn" valign="top"> <asp:Label ID="lblEmailCCList" runat="server" Text="Email CC:"></asp:Label> </td> <td class="datacolumn"> <asp:TextBox ID="txtEmailCCList" runat="server" MaxLength="2000" Rows="0" TextMode="MultiLine" Height="83px" Width="250px"></asp:TextBox> &nbsp;</td> </tr> <tr> <td> <asp:Label ID="lblIssueID" runat="server" Text="" Visible="false"></asp:Label> <asp:Label ID="lblClientID" runat="server" Text="" Visible="false"></asp:Label> </td> <td align="right"> <asp:Button ID="btnEditOk" runat="server" Text="Ok" onclick="btnEditOk_Click"/>&nbsp;&nbsp; <asp:Button ID="btnEditCancel" runat="server" Text="Cancel" onclick="btnEditCancel_Click" />&nbsp;&nbsp;&nbsp;&nbsp; </td> </tr> </table> </asp:Panel> . . . THEN THERE IS A WEBGRID HERE. . . This modal popupextender here got mangled. I cant get stackoverflow to show it right. It shows the properties here though. " BackgroundCssClass="modalBackground" DropShadow="true" OkControlID="btnEditOk" CancelControlID="btnEditCancel" Animations="" </ContentTemplate> </asp:UpdatePanel> ========================================= Server Side protected void btnEditOk_Click(object sender, EventArgs e) { IssueDAO issueDAO = new IssueDAO(); string client = "Eichleay"; string name = null; string description = null; string type = null; string status = null; DateTime? resolvedDate = null; string enteredByClientUserName = User.Identity.Name.ToString(); DateTime? loggedDate = DateTime.Now; DateTime? inProcessDate = null; DateTime? completeDate = null; DateTime? requestCompleteDate = null; string priority = null; int? prioritySort = null; string emailCCList = null; name = txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1); description = txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1); type = ddlType.SelectedValue; status = ddlStatus.SelectedValue; resolvedDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); inProcessDate = string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)); completeDate = string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)); requestCompleteDate = wdcRequestCompleteDate.Value == null ? null : string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())); priority = ddlPriority.SelectedValue; emailCCList = txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1); if (lblEditIssueHeader.Text.Substring(0, 3) == "New") { issueDAO.InsertIssue(client, name, description, type, status, resolvedDate, enteredByClientUserName, loggedDate, inProcessDate, completeDate, requestCompleteDate, priority, prioritySort, emailCCList); } else { Issue issue = new Issue(Convert.ToInt32(lblIssueID.Text), lblClientID.Text, txtName.Text.Substring(txtName.Text.Length > 0 ? 1 : 0, (txtName.Text.Length > 0 ? txtName.Text.Length : 1) - 1), txtDescription.Text.Substring(txtDescription.Text.Length > 0 ? 1 : 0, (txtDescription.Text.Length == 0 ? 1 : txtDescription.Text.Length) - 1), ddlType.SelectedValue, ddlStatus.SelectedValue, string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), lblEnteredByClientUserID.Text, string.IsNullOrEmpty(lblLoggedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblLoggedDate.Text)), string.IsNullOrEmpty(lblInProcessDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblInProcessDate.Text)), string.IsNullOrEmpty(lblResolvedDate.Text) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(lblResolvedDate.Text)), string.IsNullOrEmpty(wdcRequestCompleteDate.Value.ToString()) == true ? null : new Nullable<DateTime>(Convert.ToDateTime(wdcRequestCompleteDate.Value.ToString())), ddlPriority.SelectedValue, null, txtEmailCCList.Text.Substring(txtEmailCCList.Text.Length > 0 ? 1 : 0, (txtEmailCCList.Text.Length > 0 ? txtEmailCCList.Text.Length : 1) - 1)); issueDAO.UpdateIssue(issue); } // wdgIssues.ClearDataSource(); // UpdatePanel1.Update(); lblIssueID.Text = null; lblClientID.Text = null; txtName.Text = null; txtDescription.Text = null; ddlType.SelectedValue = null; ddlStatus.SelectedValue = null; lblLoggedDate.Text = null; lblInProcessDate.Text = null; lblResolvedDate.Text = null; wdcRequestCompleteDate.Value = null; ddlPriority.SelectedValue = null; txtEmailCCList.Text = null; }

    Read the article

  • Preparing a MySQL INSERT/UPDATE statement with DEFAULT values

    - by Raveren
    Quoting MySQL INSERT manual - same goes for UPDATE: Use the keyword DEFAULT to set a column explicitly to its default value. This makes it easier to write INSERT statements that assign values to all but a few columns, because it enables you to avoid writing an incomplete VALUES list that does not include a value for each column in the table. Otherwise, you would have to write out the list of column names corresponding to each value in the VALUES list. So in short if I write INSERT INTO table1 (column1,column2) values ('value1',DEFAULT); A new row with column2 set as its default value - whatever it may be - is inserted. However if I prepare and execute a statement in PHP: $statement = $pdoObject-> prepare("INSERT INTO table1 (column1,column2) values (?,?)"); $statement->execute(array('value1','DEFAULT')); The new row will contain 'DEFAULT' as its text value - if the column is able to store text values. Now I have written an abstraction layer to PDO (I needed it) and to get around this issue am considering to introduce a const DEFAULT_VALUE = "randomstring"; So I could execute statements like this: $statement->execute(array('value1',mysql::DEFAULT_VALUE)); And then in method that does the binding I'd go through values that are sent to be bound and if some are equal to self::DEFAULT_VALUE, act accordingly. I'm pretty sure there's a better way to do this. Has someone else encountered similar situations?

    Read the article

  • Stupid problem with Javascript calculations and postbacks

    - by rockinthesixstring
    I'm working on an ASP.NET web app where I'm using a Wizard to take the client through a large series of steps. One of the steps includes calculating a bunch of numbers on the fly... the numbers calculate properly but when I click "next" and then go back again... some of the numbers are not retained. Here is the calculation function function CalculateFields() { txtSellingPrice = document.getElementById('<%=txtSellingPrice.ClientID %>'); txtBalanceSheet = document.getElementById('<%=txtBalanceSheet.ClientID %>'); txtDownPayment = document.getElementById('<%=txtDownPayment.ClientID %>'); txtSusEarn = document.getElementById('<%=txtSusEarn.ClientID %>'); txtSusRev = document.getElementById('<%=txtSusRev.ClientID %>'); txtBalanceMult = document.getElementById('<%=txtBalanceMult.ClientID %>'); txtGoodwillMult = document.getElementById('<%=txtGoodwillMult.ClientID %>'); txtSellingPriceMult = document.getElementById('<%=txtSellingPriceMult.ClientID %>'); txtGoodWill = document.getElementById('<%=txtGoodWill.ClientID %>'); txtBalance = document.getElementById('<%=txtBalance.ClientID %>'); chkTakeBack = document.getElementById('<%=chkTakeBack.ClientID %>'); txtVendorTakeBackPercentage = document.getElementById('<%=txtVendorTakeBackPercentage.ClientID %>'); txtSusEarnPercentage = document.getElementById('<%=txtSusEarnPercentage.ClientID %>'); txtBalanceMultPercentage = document.getElementById('<%=txtBalanceMultPercentage.ClientID %>'); txtGoodwillMultPercentage = document.getElementById('<%=txtGoodwillMultPercentage.ClientID %>'); txtSellingPriceMultPercentage = document.getElementById('<%=txtSellingPriceMultPercentage.ClientID %>'); var regexp = /[$,]/g; //Empty value checks SellingPrice = (SellingPrice == "" ? "$0" : SellingPrice); BalanceSheet = (BalanceSheet == "" ? "$0" : BalanceSheet); DownPayment = (DownPayment == "" ? "$0" : DownPayment); susearn = (susearn == "" ? "$0" : susearn); susrev = (susrev == "" ? "$0" : susrev); balmult = (balmult == "" ? "$0" : balmult); goodmult = (goodmult == "" ? "$0" : goodmult); sellmult = (sellmult == "" ? "$0" : sellmult); //Replace $ with String.Empty SellingPrice = txtSellingPrice.value.replace(regexp, ""); BalanceSheet = txtBalanceSheet.value.replace(regexp, ""); DownPayment = txtDownPayment.value.replace(regexp, ""); susearn = txtSusEarn.value.replace(regexp, ""); susrev = txtSusRev.value.replace(regexp, ""); balmult = txtBalanceMult.value.replace(regexp, ""); goodmult = txtGoodwillMult.value.replace(regexp, ""); sellmult = txtSellingPriceMult.value.replace(regexp, ""); //Set the new values txtGoodWill.value = "$" + (SellingPrice - BalanceSheet); txtBalance.value = "$" + (SellingPrice - DownPayment); txtSellingPriceMult.value = "$" + SellingPrice; txtGoodwillMult.value = "$" + (SellingPrice - BalanceSheet); txtBalanceMult.value = "$" + BalanceSheet; if (chkTakeBack.checked == 1) { txtVendorTakeBackPercentage.value = Math.round((SellingPrice - DownPayment) / SellingPrice * 100); } else { txtVendorTakeBackPercentage.value = "0"; } if (!(susearn == "") && !(susearn == "0") && !(susearn == "$0")) { txtSusEarnPercentage.value = Math.round(susearn / susrev * 100); txtBalanceMultPercentage.value = Math.round(balmult / susearn); txtGoodwillMultPercentage.value = Math.round(goodmult / susearn); txtSellingPriceMultPercentage.value = Math.round(sellmult / susearn); } else { txtSusEarnPercentage.value = "0"; txtBalanceMultPercentage.value = "0"; txtGoodwillMultPercentage.value = "0"; txtSellingPriceMultPercentage.value = "0"; } } all of these calculate properly and retain their value across postbacks txtGoodWill.value = "$" + (SellingPrice - BalanceSheet); txtBalance.value = "$" + (SellingPrice - DownPayment); txtSellingPriceMult.value = "$" + SellingPrice; txtGoodwillMult.value = "$" + (SellingPrice - BalanceSheet); txtBalanceMult.value = "$" + BalanceSheet; These ones however do not retain their value across postbacks if (chkTakeBack.checked == 1) { txtVendorTakeBackPercentage.value = Math.round((SellingPrice - DownPayment) / SellingPrice * 100); } else { txtVendorTakeBackPercentage.value = "0"; } if (!(susearn == "") && !(susearn == "0") && !(susearn == "$0")) { txtSusEarnPercentage.value = Math.round(susearn / susrev * 100); txtBalanceMultPercentage.value = Math.round(balmult / susearn); txtGoodwillMultPercentage.value = Math.round(goodmult / susearn); txtSellingPriceMultPercentage.value = Math.round(sellmult / susearn); } else { txtSusEarnPercentage.value = "0"; txtBalanceMultPercentage.value = "0"; txtGoodwillMultPercentage.value = "0"; txtSellingPriceMultPercentage.value = "0"; } The txtVendorTakeBackPercentage always comes back BLANK and the other three always come back as 0 I'm firing these functions by using the onkeyup event within the form fields. If Not Page.IsPostBack Then txtSellingPrice.Attributes.Add("onkeyup", "CalculateFields()") txtBalanceSheet.Attributes.Add("onkeyup", "CalculateFields()") txtDownPayment.Attributes.Add("onkeyup", "CalculateFields()") txtSusRev.Attributes.Add("onkeyup", "CalculateFields()") txtSusEarn.Attributes.Add("onkeyup", "CalculateFields()") End If any thoughts/help/direction would be greatly appreciated.

    Read the article

  • Would I really want to return the minimum date?

    - by Clay Shannon
    An old work colleague used to quote his father about tools, "You have to be smarter than it." In the code below, Resharper is telling me, "Value assigned is not used in any execution path" (pointing to the first line). If I accept its offer of help, dt is not assigned a value ("today"). Is this a case where "I have to be smarter than it" and ignore their warning, or is this a case where the tool is smarter than me, and I'm just not understanding it? My take on the situation is that if the if statement fails, the current date is returned (the default value I want), but if I acquiesce to Resharper's "demands" it would return the default value for Datetime, which is the minimum date, which I assume is something like 7/4/1776 or 1/1/0000 or so. DateTime dt = DateTime.Now; if (!(DateTime.TryParse(substr, out dt))) { using (var dtpDlgForm = new ReturnDate("Please select the Date that the file was created:")) { if (dtpDlgForm.ShowDialog() == DialogResult.OK) { dt = dtpDlgForm.ReturnVal; } } } return dt;

    Read the article

  • VB.NET Function Return

    - by waves
    In order to return a value from a VB.NET function one can assign a value to the "Functions Name" or use "return value." I sometimes see these inter-mixed in the same function. Personally, I prefer the return. My question is, what is the internal difference, if any, between the two?

    Read the article

  • Hidden Field losing its Value on postback

    - by Ratan
    I have a ascx page where I am using a hidden field to store the value of a the drop down box as it is generated using a google address finder. My problem is that when I try to store the value directly in the hidden field : hfDdlVerifyID.Value = ddlVerifySS.SelectedValue; in the event of a button click, the value is stored but on postback is lost again. Whereas, if i try to use Scriptmanager to do it, nothing is stored. getBuild.AppendLine("$get('" + hfDdlVerifyID.ClientID + "').value = $get('" + ddlVerifySS.ClientID + ").value;"); ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "storeHidden", getBuild.ToString(), true); // Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "storeHidden", getBuild.ToString(), true); string test = hfDdlVerifyID.Value.ToString(); The ascx page is : <asp:UpdatePanel ID = ddlUpdate runat="server"> <ContentTemplate> <asp:Panel ID="pVerify" runat="server"> <br /> <fieldset> <legend> <asp:Literal ID="lVerify" runat="server" /> </legend> <asp:CheckBox ID ="cbVerify" runat ="server" Text ="Use the value from the following list, (Uncheck to accept address as it is)." Checked ="true" /> <br /> <asp:DropDownList ID="ddlVerifySS" runat="server" onselectedindexchanged="ddlVerifySS_SelectIndexChange" /> <asp:HiddenField id ="hfDdlVerifyID" runat ="server" /> </fieldset> </asp:Panel> </ContentTemplate> </asp:UpdatePanel> <padrap:Button ID ="bVerify" runat ="server" CssClass ="btn" OnClick ="bVerify_Click" Text ="Verify Address" /> <asp:Button ID ="btnSubSite" runat ="server" text ="Save" CssCLass ="btn" OnClick ="save_btn_Click_subSite" onLoad="ddlVerify_Load" />

    Read the article

  • Trend analysis using iterative value increments

    - by Dave Jarvis
    We have configured iReport to generate the following graph: The real data points are in blue, the trend line is green. The problems include: Too many data points for the trend line Trend line does not follow a Bezier curve (spline) The source of the problem is with the incrementer class. The incrementer is provided with the data points iteratively. There does not appear to be a way to get the set of data. The code that calculates the trend line looks as follows: import java.math.BigDecimal; import net.sf.jasperreports.engine.fill.*; /** * Used by an iReport variable to increment its average. */ public class MovingAverageIncrementer implements JRIncrementer { private BigDecimal average; private int incr = 0; /** * Instantiated by the MovingAverageIncrementerFactory class. */ public MovingAverageIncrementer() { } /** * Returns the newly incremented value, which is calculated by averaging * the previous value from the previous call to this method. * * @param jrFillVariable Unused. * @param object New data point to average. * @param abstractValueProvider Unused. * @return The newly incremented value. */ public Object increment( JRFillVariable jrFillVariable, Object object, AbstractValueProvider abstractValueProvider ) { BigDecimal value = new BigDecimal( ( ( Number )object ).doubleValue() ); // Average every 10 data points // if( incr % 10 == 0 ) { setAverage( ( value.add( getAverage() ).doubleValue() / 2.0 ) ); } incr++; return getAverage(); } /** * Changes the value that is the moving average. * @param average The new moving average value. */ private void setAverage( BigDecimal average ) { this.average = average; } /** * Returns the current moving average average. * @return Value used for plotting on a report. */ protected BigDecimal getAverage() { if( this.average == null ) { this.average = new BigDecimal( 0 ); } return this.average; } /** Helper method. */ private void setAverage( double d ) { setAverage( new BigDecimal( d ) ); } } How would you create a smoother and more accurate representation of the trend line?

    Read the article

  • Passing Control's Value to Modal Popup

    - by Sherwin Valdez
    Hello, Just would like know how to pass textbox value to a modal popup after clicking a button using ModalPopUpExtender in ASP.NET, I've tried these codes but seems that I have no luck :( <script runat="server"> protected void Page_Load(object sender, EventArgs e) { Button1.Attributes.Add("onclick", "showModalPopup(); return false;"); } </script> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox> <asp:Button ID="Button1" runat="server" Text="Button" OnClick='showModalPopup(); return false;' /> <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server" TargetControlID="Button1" PopupControlID="Panel1" CancelControlID="btnCancel" OkControlID="btnOkay" BackgroundCssClass="ModalPopupBG"> </cc1:ModalPopupExtender> <asp:Panel ID="Panel1" Style="display: none" runat="server"> <div class="HellowWorldPopup"> <div class="PopupHeader" id="PopupHeader"> Header</div> <div class="PopupBody"> <asp:Label ID="Label1" runat="server"></asp:Label> </div> <div class="Controls"> <input id="btnOkay" type="button" value="Done" /> <input id="btnCancel" type="button" value="Cancel" /> </div> </div> </asp:Panel> javascript function showModalPopup() { //show the ModalPopupExtender var value; value = document.getElementById("TextBox1").value; $get("<%=Label1.ClientID %>").value = value; $find("<%=ModalPopupExtender1.ClientID %>").show(); } I wonder what I miss out :(, Thanks and I hope someone could help me :)

    Read the article

  • Trying to access a specific option value to generate a popup window

    - by Isaac
    I am trying to use a click event to generate a popup window based off of the specific value chosen. I am having trouble with the if statement and trying to access each specific option value. Can any of you give me some hints? <select id="offices"> <option value="Choose an Office">Choose an Office</option> <option value="Residential Education (ResEd)" >Residential Education (ResEd)</option> <option value="Dean of Students">Dean of Students</option> <option value="Office of Student Affairs">Office of Student Affairs</option> <option value="Vice-Provost of Student Affairs">Vice-Provost of Student Affairs</option> </select> </div> function display(){ var officearray = [{ Office: "Residential Education (ResEd)", ID: "725-2800", Description: "The Office of Residential Education is responsible for developing the policies, programs, and staffing which support the intellectual, educational, and community-building activities in student residences. Second Floor. " }, { Office: "Dean of Students", ID: "723-7833", Description: "The Dean of Students office is composed of 13 individual administrative units that are concerned with the general welfare of both undergraduate and graduate students, in and out of the classroom. Second floor." }, { Office: "Office of Student Activities (OSA)", ID: "723-2733", Description: "Services for student organizations, student-initiated major events and programs, and fraternities and sororities. Second floor." }, { Office: "Vice-Provost of Student Affairs", ID: "725-0911", Description: "The Vice Provost for Student Affairs is responsible to the Provost for providing services and programs to undergraduate and graduate students in support of the academic mission of the University. Second floor." }] for(var i = 0; i < officearray.length; i++) { var o = document.getElementById("offices") var oString = o.options[o.selectedIndex].value; newwindow2 = window.open('', 'name', 'height=200, width=150') var tmp = newwindow2.document if (oString == officearray[i].Office) { tmp.writeln(officearray[i].Description) } } } document.getElementsByTagName('option').addEventListener("click",display,false)

    Read the article

  • WPF Toolkit: Nullable object must have a value

    - by Via Lactea
    Hi All, I am trying to create some line charts from a dataset and getting an error (WPF+WPF Toolkit + C#): Nullable object must have a value Here is a code that I use to add some data points to the chart: ObservableCollection points = new ObservableCollection(); foreach (DataRow dr in dc.Tables[0].Rows) { points.Add(new VelChartPoint() { Label = dr[0].ToString(), Value = double.Parse(dr[1].ToString()) }); } Here is a class VelChartPoint public class VelChartPoint : VelObject, INotifyPropertyChanged { public DateTime Date { get; set; } public string Label { get; set; } private double _Value; public double Value { get { return _Value; } set { _Value = value; var handler = PropertyChanged; if (null != handler) { handler.Invoke(this, new PropertyChangedEventArgs("Value")); } } } public string FieldName { get; set; } public event PropertyChangedEventHandler PropertyChanged; public VelChartPoint() { } } So the problem occures in this part of the code points.Add(new VelChartPoint { Name = dc.Tables[0].Rows[0][0].ToString(), Value = double.Parse(dc.Tables[0].Rows[0][1].ToString()) } ); I've made some tests, here are some results i've found out. This part of code does'nt work for me: string[] labels = new string[] { "label1", "label2", "label3" }; foreach (string label in labels) { points.Add(new VelChartPoint { Name = label, Value = 500.0 } ); } But this one works fine: points.Add(new VelChartPoint { Name = "LabelText", Value = double.Parse(dc.Tables[0].Rows[0][1].ToString()) } ); Please, help me to solve this error.

    Read the article

  • Setting the value of a radio button with JQuery (ASP.NET MVC)

    - by Mario
    I have 2 "lists" of (4) radio buttons {value = "0", "1", "2", "3"} in all lists. The first list needs to drive the second list (which may occur multiple times). So if an option is selected in the first list, the SAME option is selected in the second list. It sounds weird, but it has a purpose. The first list is more of a "select all" type of list, and the second list is an individual selection list(s). I have the value of the "selectall" list via JQuery: $("#selectalllist").change(function() { var str = $('input[name=selectall]:checked').val(); $(".radiolist").attr('checked', str); //This is my thinking }); The current selected value is stored in the str variable, and that is seemingly correct (I used alert to tell me what is stored, and it comes up what I expect). I just need to set the value of the next set of lists. The second line of the code I thought would set the checked value of $(".radiolist") to the stored value, but it ALWAYS set the value to the last entry (value = "3"). I'm wondering if I have the wrong attribute in the .attr('', str) call? Any thoughts?

    Read the article

  • UISlider how to set the initial value

    - by slim
    I'm pretty new at this iphone dev stuff and i'm working on some existing code at a company. The uislider i'm trying to set the initial value on is actually in a UITableViewCell and is a custom control. I was thinking in the cell init cell = (QuantitiesCell *)[self loadCellWithNibName:@"QuantitiesCell" forTableView:ltableView withStyle:UITableViewCellStyleDefault]; i could just call something like ((QuantitiesCell *)cell).value = 5; The actual QuantitiesCell class has the member value and the following functions -(void)initCell;{ if (listOfValues == nil) { [self initListOfValues]; } quantitiesSLider.maximumValue = [listOfValues count]-1; quantitiesSLider.minimumValue = 0; quantitiesSLider.value = self.value; } -(void)initListOfValues;{ listOfValues = [[NSMutableArray alloc] initWithCapacity:10]; int j =0; for (float i = minValue; i <= maxValue+increment; i=i+increment) { [listOfValues addObject:[NSNumber numberWithFloat: i]]; if (i == value) { quantitiesSLider.value = j; } j++; } } like i said, i'm pretty new at this so if i need to post more of the code to show whats going to get help, let me know, This slider always is defaulting to 1, the slider ranges usually from 1-10, and i want to set it to a specific value of the item i'm trying to edit.

    Read the article

  • Programmatically change an EditorGrid's cell value

    - by Snowright
    Hi, I have an Editor Grid where if a specific cell is in focus (is being edited), a window containing a tree panel pops up allowing the user to choose a node from the treepanel as the new value of the cell. This way, the user isn't actually editing the cell in question, but is using the window to choose the new value. However, I am having difficulties setting the value of the cell in question programmatically. Below is the code I use to set the grid up, including the column model that chooses what editor to use for a cell depending on the value type: var editorCM = new Ext.grid.ColumnModel({ //config ,editors : { //rest of editors 'id' : new Ext.grid.GridEditor(new Ext.form.TextField({readOnly : true})) } ,getCellEditor : function(col, row) { //choose editor depending on the type value of a cell } }) var editorGrid = new Ext.grid.EditorGridPanel({ //rest of config ,cm : editorCM }) Below is my code to change the cell's value once the user chooses from the treepanel. function submitNode(newValue) { var temp = editorGrid.GetSelectionModel().getSelectedCell(); //returns array containing column and row position of selected cell, which value we want to change. //temp[1] = column index, temp[0] = row index //Gets the cell editor at specific position and sets new value for that cell editorGrid.getColumnModel().getCellEditor(temp[1], temp[0]).setValue(newValue); } I've also tried a few other ways (all including setValue(newValue)), but have come up empty handed. I've looked through the API and the ExtJS forums for any clue but have also come up empty handed.

    Read the article

  • Managed bean property value not set to null

    - by Vladimir
    Hi! I'm new to JSF, so this question might be strange. I have an inputText component's value bound to managed bean's property of type Float. I need to set property to null when inputText field is empty, not to 0 value. It's not done by default, so I added converter with the following method implemented: public Object getAsObject(FacesContext arg0, UIComponent arg1, String arg2) throws ConverterException { if (StringUtils.isEmpty(arg2)) { return null; } float result = Float.parseFloat(arg2); if (result == 0) { return null; } return result; } I registered converter, and assigned it to inputText component. I logged arg2 argument, and also logged return value from getAsObject method. By my log I can see that it returns null value. But, I also log setter property on backing bean and argument is 0 value, not null as expected. To be more precise, it is setter property is called twice, once with null argument, second time with 0 value argument. It still sets backing bean value to 0. How can I set value to null? Thanks in advance.

    Read the article

  • JSF, writeAttribute("value", str, null) fails with strings obtained through ValueExpression.getValue

    - by Roma
    Hello, I'm having a somewhat weird problem with custom JSF component. Here's my renderer code: public class Test extends Renderer { public void encodeBegin(final FacesContext context, final UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("textarea", component); String clientId = component.getClientId(context); if (clientId != null) writer.writeAttribute("name", clientId, null); ValueExpression exp = component.getValueExpression("value"); if (exp != null && exp.getValue(context.getELContext()) != null) { String val = (String) exp.getValue(context.getELContext()); System.out.println("Value: " + val); writer.writeAttribute("value", val, null); } writer.endElement("textarea"); writer.flush(); } } The code generates: <textarea name="j_id2:j_id12:j_id19" value=""></textarea> Property binding contains "test" and as it should be, "Value: test" is successfully printed to console. Now, if I change the code to: public void encodeBegin(final FacesContext context, final UIComponent component) throws IOException { ResponseWriter writer = context.getResponseWriter(); writer.startElement("textarea", component); String clientId = component.getClientId(context); if (clientId != null) writer.writeAttribute("name", clientId, null); ValueExpression exp = component.getValueExpression("value"); if (exp != null && exp.getValue(context.getELContext()) != null) { String val = (String) exp.getValue(context.getELContext()); String str = "new string"; System.out.println("Value1: " + val + ", Value2: " + str); writer.writeAttribute("value", str, null); } writer.endElement("textarea"); writer.flush(); } generated html is: <textarea name="j_id2:j_id12:j_id19" value="new string"></textarea> and console output is "Value1: test, Value2: new string" What's going on here? This doesn't make sense. Why would writeAttribute differentiate between the two strings? Additional info: The component extends UIComponentBase I am using it with facelets

    Read the article

  • How can I change a form's input value with javascript

    - by Biroka
    How can I change a form's input value with javascript depending on witch combobox item is selected. I have a form with some imported values, and there is a field of witch imported value can be changed via a combobox. In my case: print("<input type='hidden' name='issue_array[{$issue["nr"]}][\"supplier\"]' value='{$issue["supplier"]}' />"); I have a combobox, that if I change it's value, should change the value of the input above. This is what I tried: print("<select name='supplier_combo' onchange='setSupplierInputValue(this.value, ${issue['nr']})'>"); and the script: echo "\r\n" . '<SCRIPT TYPE="text/javascript">' . "\r\n"; echo 'function setSupplierInputValue(value, issue_nr)' . "\r\n"; echo '{' . "\r\n"; echo ' issue_array[issue_nr]["supplier"] = value;'; echo '}' . "\r\n"; echo '</SCRIPT>'. "\r\n"; But it doesn't work, please help.

    Read the article

  • Where clause on joined table used for user defined key/value pairs

    - by Steve Wright
    Our application allows administrators to add “User Properties” in order for them to be able to tailor the system to match their own HR systems. For example, if your company has departments, you can define “Departments” in the Properties table and then add values that correspond to “Departments” such as “Jewelry”, “Electronics” etc… You are then able to assign a department to users. Here is the schema: In this schema, a User can have only one UserPropertyValue per Property, but doesn’t have to have a value for the property. I am trying to build a query that will be used in SSRS 2005 and also have it use the PropertyValues as the filter for users. My query looks like this: SELECT UserLogin, FirstName, LastName FROM Users U LEFT OUTER JOIN UserPropertyValues UPV ON U.ID = UPV.UserID WHERE UPV.PropertyValueID IN (1, 5) When I run this, if the user has ANY of the property values, they are returned. What I would like to have is where this query will return users that have values BY PROPERTY. So if PropertyValueID = 1 is of Department (Jewelry), and PropertyValueID = 5 is of EmploymentType (Full Time), I want to return all users that are in Department Jewelry that are EmployeeType of Full Time, can this be done? Here's a full data example: User A has Department(Jewelry value = 1) and EmploymentType(FullTime value = 5)User B has Department(Electronics value = 2) and EmploymentType(FullTime value = 5)User C has Department(Jewelry value = 1) and EmployementType(PartTime value = 6) My query should only return User A using the above query UPDATE: I should state that this query is used as a dataset in SSRS, so the parameter passed to the query will be @PropertyIDs and it is defined as a multi-value parameter in SSRS. WHERE UPV.PropertyValueID IN (@PropertyIDs)

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >