Daily Archives

Articles indexed Tuesday October 29 2013

Page 4/19 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Associate two sets of values

    - by PJW
    I have the following code - public static int GetViewLevel(string viewLevelDesc) { try { switch (viewLevelDesc) { case "All": return 0; case "Office": return 10; case "Manager": return 50; default: throw new Exception("Invalid View Level Description"); } } catch (Exception eX) { throw new Exception("Action: GetViewLevel()" + Environment.NewLine + eX.Message); } } public static string GetViewLevelDescription(int viewLevel) { try { switch (viewLevel) { case 0: return "All"; case 10: return "Office"; case 50: return "Manager"; default: throw new Exception("Invalid View Level Description"); } } catch (Exception eX) { throw new Exception("Action: GetViewLevelDescription()" + Environment.NewLine + eX.Message); } } The two static Methods enable me to either get an int ViewLevel from a string ViewLevelDesc or vice versa. I'm sure the way I have done this is far more cumbersome than it needs to be, and I'm looking for some advice how to achieve the same objective but more concisely. The list of int / string pairs will increase significantly. The ones in the above code are just the first three I intend to use.

    Read the article

  • Why does my program not react to any arguments?

    - by Electric Coffee
    I have a simple test program in C++ that prints out attributes of a circle #include <iostream> #include <stdlib.h> #include "hidden_functions.h" // contains the Circle class using namespace std; void print_circle_attributes(float r) { Circle* c = new Circle(r); cout << "radius: " << c->get_radius() << endl; cout << "diameter: " << c->get_diameter() << endl; cout << "area: " << c->get_area() << endl; cout << "circumference: " << c->get_circumference() << endl; cout << endl; delete c; } int main(int argc, const char* argv[]) { float input = atof(argv[0]); print_circle_attributes(input); return 0; } when I run my program with the parameter 2.4 it outputs: radius: 0.0 diameter: 0.0 area: 0.0 circumference: 0.0 I've previously tested the program without the parameter, but simply using static values, and it ran just fine; so I know there's nothing wrong with the class I made... So what did I do wrong here? Note: the header is called hidden_functions.h because it served to test out how it would work if I had functions not declared in the header

    Read the article

  • CodeIgniter - Post multiple arrays to controller

    - by Bobe
    I have a dynamically generated form that allows users to enter new data and edit existing data. When the form is submitted, it collates the input values and groups them according to whether they are new or not, the former being denoted by class="new-entry". So the function generates two arrays: updateData and insertData. Both arrays are of similar formats: [ 0: { 'id' = 1, 'value' = foo }, 1: { 'id' = 1, 'value' = 'bar' }, etc... ] I am combining them into a new array object to send via ajax to the controller: var postData = { 'update_data': updateData, 'insert_data': insertData }; Then in the ajax call: $.post(url, postData, function() { // some code }); However, in the controller, doing print_r($this->input->post()) or print_r($_POST) as a test only returns Array(). Even $this->input->post('update_data') returns nothing. How can I retrieve these arrays in the controller?

    Read the article

  • Substr from end of string php?

    - by Gorostas
    I have this kind of array, i will make it very simple to understand $picture = ( 'artist2-1_thumb.jpg', 'artist2-2.jpg' , 'artist2-3_thumb.jpg', 'artist2-4.jpg', 'artist2-5_thumb.jpg'); Now i want use substr to get new array that only have thumb, to have new array like this $picturethumbs = ( 'artist2-1_thumb.jpg', 'artist2-3_thumb.jpg', 'artist2-5_thumb.jpg'); Can some substr but where to start?

    Read the article

  • JQuery code in ASP .NET content pages

    - by user2645830
    I have made a very simple sample project where I want to toggle an asp .net calendar control through jquery. Could anyone please point out why it is not working. I have made no changes to master page from the sample project provided for ASP .NET web application. <%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication5._Default" %> <asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent"> <script type="text/javascript" src="scripts/jquery-1.4.1.min.js"> </script> <script language="javascript" type="text/javascript"> // <![CDATA[ function Button1_onclick() { alert( $('<%=Calendar1.ClientID%>')); $('<%=Calendar1.ClientID%>').toggle(); } // ]]> </script> </asp:Content> <asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <h2> Welcome to ASP.NET! </h2> <p> To learn more about ASP.NET visit <a href="http://www.asp.net" title="ASP.NET Website">www.asp.net</a>. </p> <input id="Button1" type="button" value="button" onclick="return Button1_onclick()" /> <asp:Calendar ID="Calendar1" runat="server"></asp:Calendar> <p> You can also find <a href="http://go.microsoft.com/fwlink/? LinkID=152368&amp;clcid=0x409" title="MSDN ASP.NET Docs">documentation on ASP.NET at MSDN</a>. </p> </asp:Content>

    Read the article

  • Selenium Webdrivers: Load Page without any resources

    - by Biffy
    I am trying to prevent Javascript from changing the site's source code I'm testing with Selenium. The problem is, I can't just simply turn Javascript off in the Webdriver, because I need it for a test. Here's what I'm doing for the Firefox Webdriver: firefoxProfile.setPreference("permissions.default.image", 2); firefoxProfile.setPreference("permissions.default.script", 2); firefoxProfile.setPreference("permissions.default.stylesheet", 2); firefoxProfile.setPreference("permissions.default.subdocument", 2); I don't allow Firefox to load any Images, Scripts and Stylesheets. How can I do this with the Internet Explorer Webdriver and the Chrome Webdriver? I have not found any similar preferences. Or is there even a more elegant way to stop the webdrivers from loading the site's JS Files after all? Thank you!

    Read the article

  • vba excel copy subtable from sheet to sheet

    - by user429400
    I realize that this is probably a duplicate, but I've been searching for an hour and I can't to get the syntax right. I have a sheet with several tables. There is at least one empty column and one empty row between one table to the other. I know the start row and start column of each table, and I know that each table has 3 columns. I don't know how many rows it has. I want to write a sub that receives: table start row table start column and copies the table into another sheet (let's say that the destination is sheet2 starting at A1). I know I can do it with a loop, but I suspect there is a better syntax right? (The main issue here is that I need to find the number of rows each table has) Thanks. Li

    Read the article

  • Replace String pattern in Java

    - by Hirantha
    I have the following string "value=\"\\d{4}((((0[1-9])|(1[0-2]))((0[1-9])|([12]\\d)|(3[01]))?)?|(\\-(((0[1-9])|(1[0-2]))(\\-((0[1-9])|([12]\\d)|(3[01])))?)?)?)d{4}" There I want to replace all the occurrences of "{" with NCHAR(0x7B) "}" with NCHAR(0x7D). An the content in-between "{ }" should remain unchanged: Ex: \\d{4} after replacing -> NCHAR(0x7B) 4 NCHAR(0x7D). Is there a way to do this using Regular Expressions in Java?. Anyway, this can be done processing the whole string using string operations.

    Read the article

  • Xcode: Application name in OS X cannot be localized?

    - by Andrew Chang
    I have an project named "Multi-Camera Supervisor". I make the "MainMenu.xib" file localized. Here are the menu bar in localized nib file of Xcode: For English: For Japanese: But when I ran my application in Xcode, The first item doesn't work. Here are the menu bars when my application ran: For English: For Japanese You can see that the application name was still "Multi-Camera Supervisor". Meanwhile, the application name appeared in Dock icon was not localized either. How should I solve this? How can I localize the application name not only in main menu but also in Dock?

    Read the article

  • Update MySQL table using data from a text file through Java

    - by Karthi Karthi
    I have a text file with four lines, each line contains comma separated values like below file My file is: Raj,[email protected],123455 kumar,[email protected],23453 shilpa,[email protected],765468 suraj,[email protected],876567 and I have a MySQL table which contains four fields firstname lastname email phno ---------- ---------- --------- -------- Raj babu [email protected] 2343245 kumar selva [email protected] 23453 shilpa murali [email protected] 765468 suraj abd [email protected] 876567 Now I want to update my table using the data in the above text file through Java. I have tried using bufferedReader to read from the file and used split method using comma as delimiter and stored it in array. But it is not working. Any help appreciated. This is what I have tried so far void readingFile() { try { File f1 = new File("TestFile.txt"); FileReader fr = new FileReader(f1); BufferedReader br = new BufferedReader(fr); String strln = null; strln = br.readLine(); while((strln=br.readLine())!=null) { // System.out.println(strln); arr = strln.split(","); strfirstname = arr[0]; strlastname = arr[1]; stremail = arr[2]; strphno = arr[3]; System.out.println(strfirstname + " " + strlastname + " " + stremail +" "+ strphno); } // for(String i : arr) // { // } br.close(); fr.close(); } catch(IOException e) { System.out.println("Cannot read from File." + e); } try { st = conn.createStatement(); String query = "update sampledb set email = stremail,phno =strphno where firstname = strfirstname "; st.executeUpdate(query); st.close(); System.out.println("sampledb Table successfully updated."); } catch(Exception e3) { System.out.println("Unable to Update sampledb table. " + e3); } } and the output i got is: Ganesh Pandiyan [email protected] 9591982389 Dass Jeyan [email protected] 9689523645 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1 Gowtham Selvan [email protected] 9894189423 at TemporaryPackages.FileReadAndUpdateTable.readingFile(FileReadAndUpdateTable.java:35) at TemporaryPackages.FileReadAndUpdateTable.main(FileReadAndUpdateTable.java:72) Java Result: 1 @varadaraj: This is the code of yours.... String stremail,strphno,strfirstname,strlastname; // String[] arr; Connection conn; Statement st; void readingFile() { try { BufferedReader bReader= new BufferedReader(new FileReader("TestFile.txt")); String fileValues; while ((fileValues = bReader.readLine()) != null) { String[] values=fileValues .split(","); strfirstname = values[0]; // strlastname = values[1]; stremail = values[1]; strphno = values[2]; System.out.println(strfirstname + " " + strlastname + " " + stremail +" "+ strphno); } bReader.close(); } catch (IOException e) { System.out.println("File Read Error"); } // for(String i : arr) // { // } try { st = conn.createStatement(); String query = "update sampledb set email = stremail,phno =strphno where firstname = strfirstname "; st.executeUpdate(query); st.close(); System.out.println("sampledb Table successfully updated."); } catch(Exception e3) { System.out.println("Unable to Update sampledb table. " + e3); } }

    Read the article

  • Received memory warning and app crashes - iphone

    - by Anand Gautam
    I am creating an app using ARC but my app is crashing due to Received memory warning. The App is working fine in simulator. But in case of iphone device, If i run the app for few minutes then on doing anything, the app crashes straightaway. I have checked my app by xcode instrument. My app folder size is 6 MB but all memory allocation is showing 63 MB on xcode instrument. Because of this reason, presentViewController-Animated-Completion is getting slow during navigation. Does anyone have any solution why this is happening?

    Read the article

  • wcf rest service 400 error : There might be a typing error in the address

    - by Lokesh Kondapalli
    I am trying to invoke wcf rest service from url but its showing error like this Error : Most likely causes: •There might be a typing error in the address. •If you clicked on a link, it may be out of date. ** I need JSON responce Here my code : Iservice.cs using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; namespace SampleRestSample { interface name "IService1" in both code and config file together. [ServiceContract] public interface IService1 { [OperationContract] [WebInvoke(Method = "GET", UriTemplate = "Book/{id}", BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json)] List<Prasad> GetBookById(string id); } [DataContract] public class Prasad { [DataMember] public string Name { get; set; } [DataMember] public string Age { get; set; } } } Service1.svc.cs using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; namespace LoginRestSample { // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "Service1" in code, svc and config file together. public class Service1 : SampleRestSample { List<Prasad> list = new List<Prasad>(); public List<Prasad> GetBookById(string id) { try { Prasad cls = new Prasad(); cls.Age = "24"; cls.Name = "prasad"; list.Add(cls); //int bookId = Convert.ToInt32(id); //using (SampleDbEntities entities = new SampleDbEntities()) //{ // return entities.Books.SingleOrDefault(book => book.ID == bookId); //} } catch { throw new FaultException("Something went wrong"); } return list; } } } web.config <?xml version="1.0" encoding="utf-8"?> <configuration> <system.web> <compilation debug="true" targetFramework="4.0"> <assemblies> <add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" /> </assemblies> </compilation> </system.web> <system.serviceModel> <services> <service name="WcfRestSample.SampleRestSample"> <endpoint address="" behaviorConfiguration="restfulBehavior" binding="webHttpBinding" bindingConfiguration="" contract="WcfRestSample.ISampleRestSample" /> <host> <baseAddresses> <add baseAddress="http://localhost/SampleRestSample" /> </baseAddresses> </host> </service> </services> <behaviors> <endpointBehaviors> <behavior name="restfulBehavior"> <webHttp automaticFormatSelectionEnabled="true" /> </behavior> </endpointBehaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="false" /> </behavior> </serviceBehaviors> </behaviors> <serviceHostingEnvironment multipleSiteBindingsEnabled="true" /> </system.serviceModel> <system.webServer> <modules runAllManagedModulesForAllRequests="true" /> </system.webServer> </configuration> Any solutions? Thank you in advance.

    Read the article

  • How to accept confirmation Automatically in PowerShell for Outlook

    - by user2919845
    How to accept confirmation Automatically in PowerShell for Outlook I have script for Export attachments from email from Outlook - see next It works correctly on one PC, but on another PC is there a problem: Outlook gives message and wants answer: Permit Denny Help If I manually click on Permit or Denny it works correctly. I want to automate it. Can you give me some suggestion how to do it in PowerShell? I have tried to set Outlook to not give this message but I didn’t success. My script: # <-- Script ---------> # script works with outlook Inbox folder # check if email have attachments with ".txt" and save those attachments to $filepath # path for exported files - attachments $filepath = "d:\Exported_files\" # create object outlook $o = New-Object -comobject outlook.application $n = $o.GetNamespace("MAPI") # $f - folder „dorucena posta“ 6 - Inbox $f = $n.GetDefaultFolder(6) # 6 - Inbox # select newest 10 emails, from it olny this one with attachments $f.Items| select -last 10| Where {$_.Attachments}| foreach { # process only unreaded mail if($_.unread -eq $True) { # processed mail set as read, not to process this mail again next day $_.unread = $False $SenderName = $_.SenderName Write-Host "Email from: ", $SenderName # process all attachments $_.attachments|foreach { $a = $_.filename If ($a.Contains(".txt")) { Write-Host $SenderName," ", $a # copy *.txt attachments to folder $filepath $_.saveasfile((Join-Path $filepath "$a")) } } } } Write-Host "Finish" # <------ End Script ---------------------------------->

    Read the article

  • MS SQL Server Dates Excel

    - by KillerSnail
    I have data this is linked from SQL Server into an excel document. The column format on the SQL Server is datetime2. When I get the data via an ODBC connection it comes across as a string? I tried using CAST(column AS DATE ) but that didn't work. I tried reformatting via CONVERT(VARCHAR(10), column, 103) as well but that didn't work. I tried retrieving the data via Microsoft query as well but that didn't work. At the moment I am using VBA code like: While (ActiveCell.Value <> "") ActiveCell.Value = DATEVALUE(ActiveCell.Value) ActiveCell.Offset(1,0).Activate Wend and looping through each column that needs this treatment but 100000 rows in multiple columns takes forever to loop through. Are there any alternatives?

    Read the article

  • JMS MQ Connection closed in JSF 2 SessionBean

    - by veote
    I use Websphere Application Server 8 with MQ Series as Messaging Queue. When I open close the connection in sessionbean in a "postConstruct" method and I use it in another method then its closed. My Code is: import java.io.Serializable; import javax.annotation.PostConstruct; import javax.annotation.PreDestroy; import javax.annotation.Resource; import javax.faces.application.FacesMessage; import javax.faces.bean.ManagedBean; import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import javax.jms.JMSException; import javax.jms.Queue; import javax.jms.QueueConnection; import javax.jms.QueueConnectionFactory; import javax.jms.QueueSender; import javax.jms.QueueSession; import javax.jms.Session; import javax.jms.TextMessage; @ManagedBean @SessionScoped public class MQRequest implements Serializable { private static final long serialVersionUID = 1L; @Resource(name = "jms/wasmqtest/wasmqtest_QCF") private QueueConnectionFactory connectionFactory; @Resource(name = "jms/wasmqtest/Request_Q") private Queue requestQueue; private QueueConnection connection; private String text = ""; public void sendMessage() { System.out.println("Connection in sendMessage: \n" + connection); TextMessage msg; try { QueueSession queueSession = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); QueueSender sender = queueSession.createSender(requestQueue); msg = queueSession.createTextMessage(text); sender.send(msg); queueSession.close(); sender.close(); } catch (JMSException e) { // TODO Auto-generated catch block e.printStackTrace(); } text = ""; } @PostConstruct public void openConenction() { System.out.println("Open Connection"); try { connection = connectionFactory.createQueueConnection(); connection.start(); System.out.println("Connection in OpenConnectioN: \n" + connection); } catch (JMSException e) { e.printStackTrace(); } } @PreDestroy public void closeConnection() { try { System.out.println("Closing Connection"); connection.close(); } catch (JMSException e) { e.printStackTrace(); } } public void setText(String text) { this.text = text; } public String getText() { return text; } } In PostConstruct method the connection is initialized: [21.10.13 07:36:05:574 CEST] 00000025 SystemOut O Connection in OpenConnectioN: com.ibm.ejs.jms.JMSQueueConnectionHandle@36c9b1a managed connection = com.ibm.ejs.jms.JMSManagedQueueConnection@3657e8b physical connection = com.ibm.mq.jms.MQXAQueueConnection@36618b6 closed = false invalid = false restricted methods enabled = false open session handles = [] temporary queues = [] But in sendMessage() method it isnt and I get a ConnectionClosed Problem: [21.10.13 07:36:12:493 CEST] 00000025 SystemOut O Connection in sendMessage: com.ibm.ejs.jms.JMSQueueConnectionHandle@36c9b1a managed connection = null physical connection = null closed = true invalid = false restricted methods enabled = false open session handles = [] temporary queues = [] 21.10.13 07:36:12:461 CEST] 00000025 SystemErr R 15 [WebContainer : 3] INFO org.apache.bval.jsr303.ConfigurationImpl - ignoreXmlConfiguration == true [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R javax.jms.IllegalStateException: Connection closed [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at com.ibm.ejs.jms.JMSConnectionHandle.checkOpen(JMSConnectionHandle.java:821) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at com.ibm.ejs.jms.JMSQueueConnectionHandle.createQueueSession(JMSQueueConnectionHandle.java:206) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at de.volkswagen.wasmqtest.queue.MQRequest.sendMessage(MQRequest.java:51) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) [21.10.13 07:36:12:601 CEST] 00000025 SystemErr R at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at java.lang.reflect.Method.invoke(Method.java:611) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.el.parser.AstValue.invoke(AstValue.java:262) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:278) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.view.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:83) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:88) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:100) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UICommand.broadcast(UICommand.java:120) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot._broadcastAll(UIViewRoot.java:973) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:275) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot._process(UIViewRoot.java:1285) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:711) [21.10.13 07:36:12:602 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:34) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:171) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at javax.faces.webapp.FacesServlet.service(FacesServlet.java:189) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1147) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:722) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:449) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1020) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3703) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:304) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:953) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1655) [21.10.13 07:36:12:603 CEST] 00000025 SystemErr R at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:195) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:452) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:511) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:305) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) [21.10.13 07:36:12:604 CEST] 00000025 SystemErr R at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) [21.10.13 07:36:12:605 CEST] 00000025 SystemErr R at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1650) Do you have an idea why the connection is closed?

    Read the article

  • CRM 2011 Plugin for CREATE (post-operational): Why is the value of "baseamount" zero in post entity image and target?

    - by Olli
    REFORMULATED QUESTION (Apr 24): I am using the CRM Developer Toolkit for VS2012 to create a CRM2011 plugin. The plugin is registered for the CREATE message of the "Invoice Product" entity. Pipeline-Stage is post-operational, execution is synchronous. I register for a post image that contains baseamount. The toolkit creates an execute function that looks like this: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } IPluginExecutionContext context = localContext.PluginExecutionContext; Entity postImageEntity = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; } Since we are in post operational stage, the value of baseamount in postImageEntity should already be calculated from the user input, right? However, the value of baseamountin the postImageEntity is zero. The same holds true for the value of baseamount in the target entity that I get using the following code: Entity targetEntity = (context.InputParameters != null && context.InputParameters.Contains("Target")) ? (Entity)context.InputParameters["Target"] : null; Using a retrieve request like the one below, I am getting the correct value of baseamount: Entity newlyCreated = service.Retrieve("invoicedetail", targetEntity.Id, new ColumnSet(true)); decimal baseAmount = newlyCreated.GetAttributeValue<Money>("baseamount").Value; The issue does not appear in post operational stage of an update event. I'd be glad to hear your ideas/explanations/suggestions on why this is the case... (Further information: Remote debugging, no isolation mode, plugin stored in database) Original Question: I am working on a plugin for CRM 2011 that is supposed to calculate the amount of tax to be paid when an invoice detail is created. To this end I am trying to get the baseamount of the newly created invoicedetail entity from the post entity image in post operational stage. As far as I understood it, the post entity image is a snapshot of the entity in the database after the new invoice detail has been created. Thus it should contain all properties of the newly created invoice detail. I am getting a "postentityimages" property of the IPluginExecutionContext that contains an entity with the alias I registered ("postImage"). This "postImage" entity contains a key for "baseamount" but its value is 0. Can anybody help me understand why this is the case and what I can do about it? (I also noticed that the postImage does not contain all but only a subset of the entities I registered for.) Here is what the code looks like: protected void ExecutePostInvoiceProductCreate(LocalPluginContext localContext) { if (localContext == null) { throw new ArgumentNullException("localContext"); } // Get PluginExecutionContext to obtain PostEntityImages IPluginExecutionContext context = localContext.PluginExecutionContext; // This works: I get a postImage that is not null. Entity postImage = (context.PostEntityImages != null && context.PostEntityImages.Contains(this.postImageAlias)) ? context.PostEntityImages[this.postImageAlias] : null; // Here is the problem: There is a "baseamount" key in the postImage // but its value is zero! decimal baseAmount = ((Money)postImage["baseamount"]).Value; } ADDITION: Pre and post images for post operational update contain non-zero values for baseamount.

    Read the article

  • display base64 image in html

    - by Christopher
    Having trouble displaying a base64 image inline. Can someone point me in the right direction? <!DOCTYPE html> <html> <head> <title>Display Image</title> </head> <body> <img style='display:block; width:100px;height:100px;' id='base64image' src='data:image/jpeg;base64, LzlqLzRBQ...<!-- base64 data -->' /> </body>

    Read the article

  • JQuery not copying state dropdown list 1 to DDL2 on checkbox change

    - by user1001411
    I've looked at similar posts on the subject but none of the recommended solutions have worked for me so I'm not sure where I'm going wrong. I have a billing and shipping address form with a dropdown list for the state. Upon checking/unchecking the "billing address same as shipping" everything copies over except the state dropdown list. The state dropdown list is populated from a SQLDataSource state table. Here's my code: <script type="text/javascript" language="javascript" src="../Scripts/jquery-1.4.1.min.js"></script> <script type="text/javascript"> $(document).ready(function () { $('input:checkbox[id*=chkCopy]').change(function () { if ($(this).is(':checked')) { $('input:text[id*=TextBox5]').val($('input:text[id*=TextBox1]').val()); $('input:text[id*=TextBox7]').val($('input:text[id*=TextBox2]').val()); $('input:text[id*=TextBox9]').val($('input:text[id*=TextBox3]').val()); $('input:text[id*=TextBox12]').val($('input:text[id*=TextBox4]').val()); $('select#DropDownList6').val($("select#DropDownList1").val()); $('input:text[id*=TextBox14]').val($('input:text[id*=TextBox6]').val()); } else { $('input:text[id*=TextBox5]').val(''); $('input:text[id*=TextBox7]').val(''); $('input:text[id*=TextBox9]').val(''); $('input:text[id*=TextBox12]').val(''); $('select#DropDownList6').val(''); $('input:text[id*=TextBox14]').val(''); } }); }); and here is my SQL for the DDL: <asp:DropDownList ID="DropDownList1" runat="server" DataTextField="Descr" DataValueField="ID" DataSourceID="SqlDataSource1" Width="254"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" SelectCommand="SELECT * FROM [xrefState]"> </asp:SqlDataSource> the other one: <asp:DropDownList ID="DropDownList6" runat="server" DataTextField="Descr" DataValueField="ID" DataSourceID="SqlDataSource5" Width="254"> </asp:DropDownList> <asp:SqlDataSource ID="SqlDataSource5" runat="server" ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString1 %>" SelectCommand="SELECT * FROM [xrefState]"> </asp:SqlDataSource>

    Read the article

  • CAD like 3D geometry .NET library

    - by Naszta
    I am looking for a good 3D CAD like library. I need basic geometry shapes (cube, sphere, torus etc.) and the library should make the surface mesh - based on the shapes and some boolean operations. I have found many libraries on google (wrapped on C++), but most of them are not really comfortable, and/or do not support union/intersection. http://www.geometros.com/sgcore/index.htm - it has wrapped interface, http://www.opencsg.org/ - I haven't found wrapped interface, http://carve-csg.com/ - I haven't found wrapped interface, http://gts.sourceforge.net/ - I haven't found wrapped interface, http://www.ogre3d.org/ - I haven't found basic geometric shapes and boolean operators, http://brlcad.org/ - its interface is not clear for me, I haven't found wrapped interface, http://www.cgal.org/ - currently I try to make it work, I haven't found wrapped interface, http://www.k-3d.org/ - I haven't found wrapped interface, http://www.opencascade.org/ - I haven't found wrapped interface, http://ilnumerics.net/ - it does not support solid boolean operations, http://www.techsoft3d.com/ - seems to be really good one. Support both C++ and C#, http://www.devdept.com/products/eyeshot/ - one more C# library. It was not tested. Open source would be nice, but not necessary. Many thanks for help. P.S.: the previous topic Update: in C# we will use Eyeshot project.

    Read the article

  • How to fix "Xlib: extension "RECORD" missing on display :1" in vnc session?

    - by Manish Sapariya
    I am running a JNativeHook capture program on Ubuntu. When I run the session on default X session things are working fine. However when I run the same program from vnc session, it fails with "Xlib: extension "RECORD" missing on display". I checked that this extension is loaded in X which is started by display manager/init. However I am not sure if indeed is initialized during vncserver startup. I could not see anything related in the vnc log. I tried create custom xorg.conf with Module section, which explicitly loads RECORD extension as suggested by many posts but did not help. My environment: Xorg-server: 2.1.12.4-6 tightvncserver: 1.3.9 The same thing works fine on my CentOS 6.4 setup.

    Read the article

  • Long string insertion with sed

    - by Luis Varca
    I am trying to use this expression to insert the contents of one text file into another after a give string. This is a simple bash script: TEXT=`cat file1.txt` sed -i "/teststring/a \ $TEXT" file2.txt This returns an error, "sed: -e expression #1, char 37: unknown command: `M'" The issue is in the fact that the contents of file1.txt are actually a private certificate so it's a large amount of text and unusual characters which seems to be causing an issue. If I replace $TEXT with a simple ASCII value it works but when it reads the large content of file1.txt it fails with that error. Is there some way to carry out this action? Is my syntax off with sed or my quote placement wrong?

    Read the article

  • IIS web service responds on server, not from remote client

    - by Aharon Manne
    I have installed a web service on a server running IIS (v6, as far as I can tell). There is another service installed, which responds as expected. My service responds correctly when a browser is pointed to localhost, but there is no response when a remote client tries to query the service. Fiddler on the remote client simply reports a timeout. Wireshark on the remote client shows no response at all from the server, no NACK, nothing. Wireshark on the server detects no query at the relevant port (the service is installed on port 8080). There are no relevant entries in the event viewer. Obviously there is some issue of permissions or authentication. I have tried to compare my service to the service that works, but I have not been able to locate relevant parameters. Any help would be greatly appreciated.

    Read the article

  • VNC server shows black screen with a X cursor

    - by user2656114
    Starting VNC server using vncserver :1, client can connect to the server but it shows only a black screen with a X cursor. Contents of .vnc/xstartup is: #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec /etc/X11/xinit/xinitrc [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" & twm & Is it a problem with this?

    Read the article

  • Pfsense 2.1 OpenVPN can't reach servers on the LAN

    - by Lucas Kauffman
    I have a small network set up like this: I have a Pfsense for connecting my servers to the WAN, they are using NAT from the LAN - WAN. I have an OpenVPN server using TAP to allow remote workers to be put on the same LAN network as the servers. They connect through the WAN IP to the OVPN interface. The LAN interface also servers as the gateway for the servers to get internet connection and has an IP of 10.25.255.254 The OVPN Interface and the LAN interface are bridged in BR0 Server A has an IP of 10.25.255.1 and is able to connect the internet Client A is connecting through the VPN and is assigned an IP address on its TAP interface of 10.25.24.1 (I reserved a /24 within the 10.25.0.0/16 for VPN clients) Firewall currently allows any-any connection OVPN towards LAN and vice versa Currently when I connect, all routes seem fine on the client side: Destination Gateway Genmask Flags Metric Ref Use Iface 300.300.300.300 0.0.0.0 255.255.255.0 U 0 0 0 eth0 10.25.0.0 10.25.255.254 255.255.0.0 UG 0 0 0 tap0 10.25.0.0 0.0.0.0 255.255.0.0 U 0 0 0 tap0 0.0.0.0 300.300.300.300 0.0.0.0 UG 0 0 0 eth0 I can ping the LAN interface: root@server:# ping 10.25.255.254 PING 10.25.255.254 (10.25.255.254) 56(84) bytes of data. 64 bytes from 10.25.255.254: icmp_req=1 ttl=64 time=7.65 ms 64 bytes from 10.25.255.254: icmp_req=2 ttl=64 time=7.49 ms 64 bytes from 10.25.255.254: icmp_req=3 ttl=64 time=7.69 ms 64 bytes from 10.25.255.254: icmp_req=4 ttl=64 time=7.31 ms 64 bytes from 10.25.255.254: icmp_req=5 ttl=64 time=7.52 ms 64 bytes from 10.25.255.254: icmp_req=6 ttl=64 time=7.42 ms But I can't ping past the LAN interface: root@server:# ping 10.25.255.1 PING 10.25.255.1 (10.25.255.1) 56(84) bytes of data. From 10.25.255.254: icmp_seq=1 Redirect Host(New nexthop: 10.25.255.1) From 10.25.255.254: icmp_seq=2 Redirect Host(New nexthop: 10.25.255.1) I ran a tcpdump on my em1 interface (LAN interface which has the IP of 10.25.255.254) tcpdump: verbose output suppressed, use -v or -vv for full protocol decode listening on em1, link-type EN10MB (Ethernet), capture size 96 bytes 08:21:13.449222 IP 10.25.24.1 > 10.25.255.1: ICMP echo request, id 23623, seq 10, length 64 08:21:13.458211 ARP, Request who-has 10.25.255.1 tell 10.25.24.1, length 28 08:21:14.450541 IP 10.25.24.1 > 10.25.255.1: ICMP echo request, id 23623, seq 11, length 64 08:21:14.458431 ARP, Request who-has 10.25.255.1 tell 10.25.24.1, length 28 08:21:15.451794 IP 10.25.24.1 > 10.25.255.1: ICMP echo request, id 23623, seq 12, length 64 08:21:15.458530 ARP, Request who-has 10.25.255.1 tell 10.25.24.1, length 28 08:21:16.453203 IP 10.25.24.1 > 10.25.255.1: ICMP echo request, id 23623, seq 13, length 64 So traffic is reaching the LAN interface, but it's not getting passed it. But no answer from the 10.25.255.1 host. I'm not sure what I'm missing.

    Read the article

  • How to set robots.txt globally in nginx for all virtual hosts

    - by anup
    I am trying to set robots.txt for all virtual hosts under nginx http server. I was able to do it in Apache by putting the following in main httpd.conf: <Location "/robots.txt"> SetHandler None </Location> Alias /robots.txt /var/www/html/robots.txt I tried doing something similar with nginx by adding the lines given below (a) within nginx.conf and (b) as include conf.d/robots.conf location ^~ /robots.txt { alias /var/www/html/robots.txt; } I have tried with '=' and even put it in one of the virtual host to test it. Nothing seemed to work. What am I missing here? Is there another way to achieve this?

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >