Daily Archives

Articles indexed Monday May 24 2010

Page 11/108 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >

  • Powershell 2.0 error handling - Command line call vs. ISE

    - by Gromix
    Hi, In the context of deployment scripts, I would like to capture any error than happens and stop immediately. I have notice some significant differences between the following calls: powershell.exe -File Script.ps1 powershell.exe -Command "& '.\Script.ps1'" powershell.exe .\Script.ps1 For example, the -File call will handle errors in the exact same way as the ISE. The other two seem to ignore the $ErrorActionPreference variable, and do not seem to catch Write-Error in try/catch blocks. Could someone help me understand the implications of each one, and why they are behaving differently? Thanks, Romain

    Read the article

  • [Jquery Validation Plugin]How to conditionally execute a jquery validation?

    - by Pandiya Chendur
    I am validating form using jquery validation plugin...... rules: { Name: "required", MobileNo: { required: true, minlength: 10, remote: '<%=Url.Action("getClientMobNo", "Clients") %>' }, Address: "required" }, messages: { Name: "please provide a client name", MobileNo: { required: "Please provide a mobile phone no", rangelength: jQuery.format("Enter at least {0} characters"), remote: jQuery.format("This MobileNo is already in use") }, Address: "please provide client address" }, This works pretty well on add form validation but i use the same form for edit here they can use the same mobile no,but my plugin validates that mobileno saying there is already a mobileno... But how to execute remote attribute based on a condition, MobileNo: { required: true, minlength: 10, if($("#HfId").val() == ""){ remote: '<%=Url.Action("getClientMobNo", "Clients") %>' } }, Is this a valid jquery conditional validation statement.... How to skip remote attribute based on a condition....

    Read the article

  • FileReference.download() not working

    - by Lowgain
    I'm building a Flex app which requires me to download files. I have the following code: public function execute(event:CairngormEvent) : void { var evt:StemDownloadEvent = event as StemDownloadEvent; var req:URLRequest = new URLRequest(evt.data.file_path); var localRef:FileReference = new FileReference(); localRef.addEventListener(Event.OPEN, _open); localRef.addEventListener(ProgressEvent.PROGRESS, _progress); localRef.addEventListener(Event.COMPLETE, _complete); localRef.addEventListener(Event.CANCEL, _cancel); localRef.addEventListener(Event.SELECT, _select); localRef.addEventListener(SecurityErrorEvent.SECURITY_ERROR, _securityError); localRef.addEventListener(IOErrorEvent.IO_ERROR, _ioError); try { localRef.download(req); } catch (e:Error) { SoundRoom.logger.log(e); } } As you can see, I hooked up every possible event listener as well. When this executes, I get the browse window, and am able to select a location, and click save. After that, nothing happens. I have each event handler hooked up to my logger, and not a single one is being called! Is there something missing here?

    Read the article

  • Passing variable string to create arrays (Android)

    - by dweebsonduty
    Hello all, I am a newb to Android and Java and want to write a funtion that will display a list based on a varable that I pass to the function. The function is below and the code below creates an array out of a string called type, but what I want to do is pass it a variable string and have it build a list based on that string. So if I wanted the type list I would say list_it("type") But if I try something like getResources().getStringArray(R.array.thelist); it doesn't work. Can someone point me in the right direction? public void list_it(String thelist){ String[] types = getResources().getStringArray(R.array.type); ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, R.layout.list_item1, types); setListAdapter(mAdapter); ListView lv = getListView(); lv.setTextFilterEnabled(true); }

    Read the article

  • Why is this simple file upload not working? JSF

    - by Nitesh Panchal
    Hello, Why is this code not working? I always get size() = 0, whenever i upload file. xhtml file :- <?xml version='1.0' encoding='UTF-8' ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html"> <h:head> <title>Abc</title> </h:head> <h:body> <center> <form method="post" enctype="multipart/form-data" id="form" action="/upload/uploadFile"> <input type="file"/> <br/> <input type="Submit" value="upload"/> </form> </center> </h:body> </html> This is my servlet :- package servlets; import java.io.IOException; import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.commons.fileupload.FileItem; import org.apache.commons.fileupload.FileUploadException; import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.servlet.ServletFileUpload; @WebServlet(name="uploadFile", urlPatterns={"/uploadFile"}) public class uploadFile extends HttpServlet { protected void processRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException, FileUploadException { System.out.println("executed!"); List<FileItem> items = new ServletFileUpload(new DiskFileItemFactory()).parseRequest(request); System.out.println(items.size()); for (FileItem item : items) { if (!item.isFormField()) { System.out.println("Name: " + item.getName()); System.out.println("Size: " + item.getSize()); System.out.println("Type: " + item.getContentType()); } } } @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (FileUploadException ex) { ex.printStackTrace(); } } @Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (FileUploadException ex) { ex.printStackTrace(); } } @Override public String getServletInfo() { return "Short description"; } }

    Read the article

  • PackageManager: Not granting permission

    - by scott
    Im trying to force my phone to go to sleep as soon as i turn my screen off, but whenever i install with adb, packagemanager informs me that it wont grant the permission i need, so my service throws an exception. I was able to install another app called power save mode toggle which has the same permission, and it seems to work, so i should be able to get this to work, right?

    Read the article

  • php cache zend framework

    - by msaif
    server side is PHP + zend framework. problem: i have huge of data appox 5000 records and no of columns are 5 in input.txt file. i like to read all data into memory only once and send some data to the every browser request. but if i update that input.txt file then updated data must be auto synchronized to that memory location. so i need to solve that problem by using memory caching technique.but caching technique has expire time.but if input.txt is updated before cache expire then i need to auto synchronize to that memory location. now i am using zend framework 1.10.is it possible in zend framework. can anybody give me some line of code of zendfrmawork i have no option to use memchached server(distributed). Only zend framwork.

    Read the article

  • How to find the closest descendants (that matches a selector) with jQuery?

    - by powerboy
    We can use closest(selector) to find the first ancestor element that matches the selector. It travels up the DOM tree until it finds a match for the selector. But what if I want to travels down the DOM tree until it finds a match for the selector? Is there any jQuery function for doing this? Or do I need to implement this using breadth-first search? Give an example. For the DOM tree below, <div id="main"> <div> <ul><!-- I want to match this ul --> <li> <ul><!-- but not this ul --> </ul> </li> </ul> <ul><!-- and match this ul --> </ul> </div> </div> how to do something like $('#main').closestDescendants('ul')?

    Read the article

  • Is it a jaxb bug?

    - by wd-shuang
    I take a scheme, its element definition as follows: <xs:complexType name="OriginalMessageContents1"> <xs:sequence> <xs:any namespace="##any" processContents="skip"/> <xs:any namespace="##any" processContents="skip" minOccurs="0"/> </xs:sequence> </xs:complexType> I use xjb to export java file,xjb as follow: <jxb:bindings version="2.0" xmlns:jxb="http://java.sun.com/xml/ns/jaxb" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jxb:bindings schemaLocation="ibps.706.001.01.xsd" node="/xs:schema"> <jxb:bindings node="//xs:complexType[@name='OriginalMessageContents1']/xs:sequence"> <jxb:bindings node=".//xs:any[position()=1]"> <jxb:property name="anyOne"/> </jxb:bindings> <jxb:bindings node=".//xs:any[position()=2]"> <jxb:property name="anyTwo"/> </jxb:bindings> </jxb:bindings> </jxb:bindings> </jxb:bindings> Java as: @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "OriginalMessageContents1", propOrder = { "anyOne", "anyTwo" }) public class OriginalMessageContents1 { @XmlAnyElement protected Element anyOne; @XmlAnyElement protected Element anyTwo; public Element getAnyOne() { return anyOne; } public void setAnyOne(Element value) { this.anyOne = value; } public Element getAnyTwo() { return anyTwo; } public void setAnyTwo(Element value) { this.anyTwo = value; } } When I unmashaller this object by using getAnyOne,I get the contents of the second element. I got null by using getAnyTwo. It is a bug? Anybody can help me ?

    Read the article

  • Creating a Java platform game as easily as possible

    - by directx
    I need to create a Java-based platformer game for a high school project (not computer science related), and I want to spend as little time on technical stuff as possible. I'm already experienced in Java, and I already have most of the gameplay, graphics, etc. All I need to do is code it. I've looked and I'm considering one of two options that do not involving coding a game from scratch: Copy an existing Java platformer (best option, but I can't find an open source Java platformer) Use a Java game engine to avoid coding from scratch. I've looked at JGame but I'm not sure if it's the best bet for a platformer.

    Read the article

  • How to conditionally execute a jquery validation?

    - by Pandiya Chendur
    I am validating form using jquery validation plugin...... rules: { Name: "required", MobileNo: { required: true, minlength: 10, remote: '<%=Url.Action("getClientMobNo", "Clients") %>' }, Address: "required" }, messages: { Name: "please provide a client name", MobileNo: { required: "Please provide a mobile phone no", rangelength: jQuery.format("Enter at least {0} characters"), remote: jQuery.format("This MobileNo is already in use") }, Address: "please provide client address" }, This works pretty well on add form validation but i use the same form for edit here they can use the same mobile no,but my plugin validates that mobileno saying there is already a mobileno... But how to execute remote attribute based on a condition, MobileNo: { required: true, minlength: 10, if($("#HfId").val() == ""){ remote: '<%=Url.Action("getClientMobNo", "Clients") %>' } }, Is this a valid jquery conditional validation statement.... How to skip remote attribute based on a condition....

    Read the article

  • change message body in blackberry of HTML message

    - by PankajV
    By using BlackBerry Api - mesasge.setContent( Object o );, we can change the message body of blackberry messaging application. But This work when message is plain text, How can we change / update the message body for HTML message programmaticay. message.setContent(object o); does not work for HTML message. Please advice

    Read the article

  • Implementing In App purchases in Android?

    - by hgpc
    It looks like Android won't natively support in-app purchases for a while, and when it does there might be a huge user base with devices that don't support them. What's the best way to implement iPhone-like (additional content or services) in-app purchases in Android using the Android Market if possible? The solution should consider in particular: For all kinds of in-app purchases: Android Market's 24-hour cancellation policy For consumables/non-consumables: storage of additional content (ie: use precious application memory to avoid piracy, or use SD card to avoid bloating application memory) Thanks!

    Read the article

  • safely hosting a django project over apache using centos

    - by tipu
    Error can be seen at: http://djaffry.selfip.com:8080/ I had a project working great, but I had all the files under /var/www/ and with my limited understanding it's bad, according to django's site: "If your background is in PHP, you’re probably used to putting code under the Web server’s document root (in a place such as /var/www). With Django, you don’t do that. It’s not a good idea to put any of this Python code within your Web server’s document root, because it risks the possibility that people may be able to view your code over the Web. That’s not good for security. Put your code in some directory outside of the document root, such as /home/mycode." So I went to /home/tipu/stuff/ and executed django-admin.py startproject twingle. Then I went to apache and did <VirtualHost *:8080> ServerName tweet_search_engine DocumentRoot /home/tipu/stuff/twingle/ </VirtualHost> <Directory /home/tipu/stuff/twingle> SetHandler python-program PythonHandler django.core.handlers.modpython SetEnv DJANGO_SETTINGS_MODULE settings PythonOption django.root /home/tipu/stuff/twingle PythonDebug On PythonPath "['/home/tipu/stuff/', '/home/tipu/stuff/twingle/'] + sys.path" </Directory> Now I am getting a 403 Forbidden error.. any idea what I'm doing wrong? I'm newer to Linux (CentOS) and django, so I could be over looking some very simple things.

    Read the article

  • Best Zend Framework architecture for large reporting site?

    - by Andy
    I have a site of about 60 tabular report pages. Want to convert this to Zend. The report has two states: empty report and filled in with data report. Each report has its own set of input boxes and select drop downs to narrow down searches. You click on submit and it retrieves the data. Thats all each page does. Do I create 60 controllers with each one with default index action and getData action? All I have read online do not really describe how to architect a real site.

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17 18  | Next Page >