Daily Archives

Articles indexed Monday December 27 2010

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

  • error-no suitable method found to override?

    - by Jun Jie
    When i use some of the codes Why do i always get this error..no suitable method found to override? and Warning 2 The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: Thing --- The base class 'System.Object' cannot be designed. Form1 --- The base class 'System.Object' cannot be designed. 0 0

    Read the article

  • Using a JSON web service from a Java client application

    - by user383341
    I am developing a client-side Java application that has a bit of functionality that requires getting data from some web services that transmit in JSON (some RESTful, some not). No JavaScript, no web browser, just a plain JAR file that will run locally with Swing for the GUI. This is not a new or unique problem; surely there must be some open source libraries out there that will handle the JSON data transmission over HTTP. I've already found some that will parse JSON, but I'm having trouble finding any that will handle the HTTP communication to consume the JSON web service. So far I've found Apache Axis2 apparently which might have at least part of the solution, but I don't see enough documentation for it to know if it will do what I need, or how to use it. Maybe part of the problem is that I don't have experience with web services so I'm not able to know a solution when I see it. I hope some of you can point me in the right direction. Examples would be helpful.

    Read the article

  • JS: Why isn't this variable available to the other functions?

    - by Marius Jonsson
    Hello there, I've am trying to make a canvas animation: var context; var meter; var pin; function init() { var meter = new Image(); var pin = new Image(); var context = document.getElementById('canvas').getContext('2d'); meter.src = 'background.png'; pin.src = 'needle.png'; context.drawImage(meter,0,0); context.translate(275,297); context.save(); setTimeout(startup,500); } function startup() { var r=2; // set rpm here. var i=r*36-27; var angleInRadians = 3.14159265 * i/180; //converting degree to radian context.rotate(angleInRadians); //rotating by angle context.drawImage(pin,-250,-3); //adjusting pin center at meter center context.restore(); } You can see the script at http://www.kingoslo.com/instruments/ With firebug I get error saying that context is undefined, which I think is strange. Thanks. Kind regards, Marius

    Read the article

  • Is there a jQuery plugin for making a step-by-step type presentation?

    - by Earlz
    Hello, I was making a small thing in HTML and basically I have some "frames" like <div id="frame_1"> ... </div> <div id="frame_2"> ... </div> ... Basically what I want is for only one frame to be visible at one time and to navigate between frames easily with previous and next buttons (navigation by frame number a plus, but not required) Before I set out to write it myself I figured someone had already done it so has it been done?

    Read the article

  • floating div problem in IE7

    - by Onur
    I'm trying to use a second background image with a floated div but it doesn't work in IE6 & 7 I'm aware that the floating div's is a pain in * in IE7 and lower versions but I really need to make it work. here is the code I'm using <body style="background-color:#FFFFFF; margin-top:0px; margin-right:0px;" topmargin="0" rightmargin="0" leftmargin="0"> <div id="bg2" style="float:right; top:0px; width:450px; height:151px; margin-right:0px; padding-right:0px; font-size:1px; overflow:visible; background-image:url(images/back2.jpg);"></div> <center> <div style="position:relative; top:0px; width:1050px; margin:0px; padding:0px; vertical-align:top; text-align:left;"> ....(huge div container)... I also tried to remove width attribute from the div which contains 2nd background image, then get the windows size and add the difference to the container div as left attribute with Jquery. It worked fine in all IE versions but this time not on Chrome here is a print screen any ideas please?

    Read the article

  • SFINAE and detecting if a C++ function object returns void.

    - by Tom Swirly
    I've read the various authorities on this, include Dewhurst and yet haven't managed to get anywhere with this seemingly simple question. What I want to do is to call a C++ function object, (basically, anything you can call, a pure function or a class with ()), and return its value, if that is not void, or "true" otherwise. #include <stdio.h> struct Foo { void operator()() {} }; struct Bar { bool operator()() { return false; } }; Foo foo; Bar bar; bool baz() { return false; } void bang() {} const char* print(bool b) { printf(b ? "true, " : "false, "); } template <typename Functor> bool magicCallFunction(Functor f) { return true; // lots of template magic occurs here... } int main(int argc, char** argv) { print(magicCallFunction(foo)); print(magicCallFunction(bar)); print(magicCallFunction(baz)); print(magicCallFunction(bang)); printf("\n"); }

    Read the article

  • How to add custom header to ASMX web service call using jquery?

    - by Mike
    I have a web service with the following contract: POST /Service/service.asmx HTTP/1.1 Host: xxx.xxx.xxx Content-Type: text/xml; charset=utf-8 Content-Length: length SOAPAction: "xxx.xxx.xxx/Service/Method" <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <Request xmlns="xxx.xxx.xxx/Service/"> <transactiontype>string</transactiontype> <username>string</username> <password>string</password> </Request> </soap:Header> <soap:Body> <Method xmlns="xxx.xxx.xxx/Service/"> <xml>xml</xml> </Method> </soap:Body> </soap:Envelope> And I am trying to call the service using jquery. This is my code: $.ajax({ url: serverUrl + 'Method', type: "POST", dataType: "xml", data: { xml: "xml" }, beforeSend: function (req) { req.setRequestHeader('Header', '<Request xmlns="xxx.xxx.xxx/Service/">' +'<transactiontype>4</transactiontype>' +'<agencyName>name</agencyName>' +'<username>user</username>' +'<password>pass</password>' +'</Request>'); }, success: function (data) { alert(data.text); }, error: function (request, status, errorThrown) { alert(status); } }); However, the header content is not passed to the web service? How would I go about passing the header credentials to my web service call?

    Read the article

  • Can I optimize this at all?

    - by Moshe
    I'm working on an iOS app and I'm using the following code for one of my tables to return the number of rows in a particular section: return [[kSettings arrayForKey:@"views"] count]; Is there any other way to write that line of code so that it is more memory efficient? EDIT: kSettings = NSUserDefaults standardUserDefaults. Is there any way to rewrite my line of code so that whatever memory it occupies is released sooner than it is released now?

    Read the article

  • Share IIS and related information via IIS Community Newsletter WIKI

    - by steve schofield
    Trying something different!  Do you have something to share with the IIS community?  Are you an IIS community leader wanting to share your info?  Do you run a local usergroup and want to let others know!  Sign-up for our WIKI @ http://www.iislogs.com/wiki/   The information will be reviewed and potentially included in the IIS Community Newsletter.  Cheers, Steve SchofieldMicrosoft MVP - IIS  

    Read the article

  • yum error when installing memcached

    - by Jack
    Hi, trying to install memcached with "yum install memcached" and i'm getting all these errors which I have no idea how to solve. Setting up Install Process Resolving Dependencies -- Running transaction check --- Package memcached.x86_64 0:1.4.5-1.el5.rf set to be updated -- Processing Dependency: perl(AnyEvent) for package: memcached -- Processing Dependency: perl(AnyEvent::Socket) for package: memcached -- Processing Dependency: perl(AnyEvent::Handle) for package: memcached -- Processing Dependency: perl(YAML) for package: memcached -- Processing Dependency: perl(Term::ReadKey) for package: memcached -- Processing Dependency: libevent-1.1a.so.1()(64bit) for package: memcached -- Running transaction check --- Package compat-libevent-11a.x86_64 0:3.2.1-1.el5.rf set to be updated --- Package memcached.x86_64 0:1.4.5-1.el5.rf set to be updated -- Processing Dependency: perl(AnyEvent) for package: memcached -- Processing Dependency: perl(AnyEvent::Socket) for package: memcached -- Processing Dependency: perl(AnyEvent::Handle) for package: memcached -- Processing Dependency: perl(YAML) for package: memcached -- Processing Dependency: perl(Term::ReadKey) for package: memcached -- Finished Dependency Resolution memcached-1.4.5-1.el5.rf.x86_64 from rpmforge has depsolving problems -- Missing Dependency: perl(AnyEvent::Socket) is needed by package memcached-1.4.5-1.el5.rf.x86_64 (rpmforge) memcached-1.4.5-1.el5.rf.x86_64 from rpmforge has depsolving problems -- Missing Dependency: perl(AnyEvent) is needed by package memcached-1.4.5-1.el5.rf.x86_64 (rpmforge) memcached-1.4.5-1.el5.rf.x86_64 from rpmforge has depsolving problems -- Missing Dependency: perl(AnyEvent::Handle) is needed by package memcached-1.4.5-1.el5.rf.x86_64 (rpmforge) memcached-1.4.5-1.el5.rf.x86_64 from rpmforge has depsolving problems -- Missing Dependency: perl(YAML) is needed by package memcached-1.4.5-1.el5.rf.x86_64 (rpmforge) memcached-1.4.5-1.el5.rf.x86_64 from rpmforge has depsolving problems -- Missing Dependency: perl(Term::ReadKey) is needed by package memcached-1.4.5-1.el5.rf.x86_64 (rpmforge) Packages skipped because of dependency problems: compat-libevent-11a-3.2.1-1.el5.rf.x86_64 from rpmforge memcached-1.4.5-1.el5.rf.x86_64 from rpmforge The perl modules that its complaining about are already installed. Any ideas?

    Read the article

  • Character coding problem

    - by out_sider
    I have a file named index.php which using a mysql server gets a simple username. The mysql server is running on centOS and I have two different systems running apache serving as web servers. One is my own windows pc using a "wamp" solution which uses the mysql server refereed before and the other is the centOS server itself. I use this so I can develop in my laptop and run the final on the centOS box. The problem is this: Accessing centOS box I get (on hxxp://centos): out_sider 1lu?s 2oi Using wamp on windows I get (on hxxp://localhost): out_sider 1luís 2oi The mysql database is configured correctly seeing that both use the same and I used svn repository to move files from windows to centOS so the file is the same. Does anyone have any suggestions? Thanks in advnce

    Read the article

  • Salary Survey Entry Level network position [closed]

    - by will
    Hello, I started interning with a company about 5 months ago and for the past 7 months I have been a normal part time employee. This week I have a review, where I am hoping to get a raise. I started at $8 interning, and now I'm up to $13. What I am trying to figure out is how to survey what others are making in similar positions so I can take it to the review as a base number. here are my thoughts on my position right now. Review Thoughts My Qualifications: • Associates of applied Science - IT network Specialist • CompTIA A+ certification • CompTIA Server+ certification • CompTIA Network+ certification • Currently pursuing Cisco certifications • Junior status at Insert college Pursuing Bachelors in Information Technology with an emphasis in Networking. 3.4 GPA • 1 year of working at Insert Company. My contributions to Insert Company • Offering near fulltime through semester and fulltime through summer. • Ability to work after hours and on weekends • Developed and support helpdesk system • Set up and maintain Update server to keep desktop clients up to date • Deployed and maintain antivirus solution for end users • Assist with main projects such as SAN, Virtualization, and network survey. Any tips on determining an asking number would help. I was thinking $17-$18, am I way off here? • Migrating end user stations to Windows 7 (current project) • Developing imaging solution for Desktop PCs (current project)

    Read the article

  • Artefacts during HDV capture

    - by Jakub Konecki
    When I try to capture HDV video stream from a Canon HV20 camera to a Dell Studio 1558 (Intel i7 720qm) laptop running Win 7 Home Premium x64, the image appears with a very annoying noise - it contains block artefacts. Something is wrong with the Fire Wire controller (Ricoh 1304 OHCI host controller, build-in). Tried changing the driver to legacy one to no avail. This does not happen with DV stream. I'm using a Belkin cable. The capture works OK on another machine.

    Read the article

  • Do any of the HP printers have implement printer sharing?

    - by BCS
    I've seen several (home grade) HP prints that have network port and allow connecting to them via that. However I haven't seen any way to use it without installing the printer specific drives. This seems a bit silly because I've seen printer sharing system (SMB I think) that didn't seem to need any printer specific software. My question is: Is there a way to use one of these with my printers? (I'm omitting the exact model in the hopes that answers for several models (or a resource that answers it for several models) will be given.)

    Read the article

  • How to move a partition to the end in gparted?

    - by matnagel
    I can't find a way to move the partition /dev/sdb2 to the end, where 12GB are free http://dl.dropbox.com/u/3358699/permanent/gparted-sdb.png I can resize (expand) the partition, but not create (insert) any free space in front of it. How to do the trick? (There are 2 small black arrows on the top of the popup window in the screenshot at the side of the blue box that represents the 400 GB sdb2 - I can only move the right arrow to the right, which extends the size, but I cannot move the left arrow. When I enter something in the free space preceding box it is always reset to zero by the programm immediateley) I hope I explained this well enough, please feel free to ask for details. This is serious for me as I am expanding a live image. Maybe there is another solution with linux commandline tools ?

    Read the article

  • Forwarding wifi traffic to wired pc

    - by brydgesk
    I'm trying to play around with Wireshark on my home network, and was wondering if there is a way to create a new connection on my PC that receives all wifi packets on the network. The PC is a wired Windows 7 machine, and I'm using DD-WRT on an Asus RT-N16 router. I'm not trying to hack anything, I have full admin access to the router itself. My searching has led me to articles about client bridges and repeater bridges, but none of them seemed to apply entirely to my situation. I'd like to continue using my standard wifi connection, but make my PC act as a repeater that receives all wifi traffic. Again, the PC has no wireless connection. I've used tcpdump which is installed on the router itself, but I'd be more comfortable analyzing the packets in Windows, as I'm trying to learn Wireshark. Thanks

    Read the article

  • time on files differ by 1 sec. FAIL Robocopy sync

    - by csmba
    I am trying to use Robocopy to sync (/IMG) a folder on my PC and a shared network drive. The problem is that the file attributes differ by 1 sec on both locations (creation,modified and access). So every time I run robocopy, it syncs the file again... BTW, problem is the same if I delete the target file and robocopy it from new... still, new file has 1 sec different properties. Env Details: Source: Win 7 64 bit Target: WD My Book World Edition NAS 1TB which takes its time from online NTP pool.ntp.org (I don't know if file system is FAT or not)

    Read the article

  • How do I get others to see past my prior inexperience?

    - by Kevin
    My core question is how do I proceed from the following predicament. I will be honest with you, I wasted my College Experience. I slacked off and didn't take any of my comp sci classes that seriously, somehow i still got out with a 3.25 GPA. But truth be told I learned nothing. I befriended most of my professors who went pretty lenient on me in terms of grading. However, I basically came out of College knowing how to program a simple calculator in VB.Net. I was (to my great surprise) hired by a very large respected company in Denver as a Junior developer. Well the long and the short of it is that I knew so little about programming that I quickly became the office pariah and was almost fired due to my incompetence. It has been 8 months now and I feel I have learned some basic things and I am not as picked on as I used to be by the other developers. However, everyone hates me and the first few months have given the other developers a horrible perception of me. I am no longer afraid of code or learning, but I have put my self in the precarious position of being the scapegoat of our department. I hate going to work every day because no one there is my friend and pretty much everyone is hostile to me. What should I do? Any advice?

    Read the article

  • Stack Exchange Notifier Chrome Extension [v1.2.9.3 released]

    - by Vladislav Tserman
    About Stack Exchange Notifier is a handy extension for Google Chrome browser that displays your current reputation, badges on Stack Exchange sites and notifies you on reputation's changes. You will now get notified of comments on your own posts (questions and answers) and of any comments that refer to you by @username in a comment, even if you do not own the post (aka mentions). All StackExchange sites are supported. Screenshots Access Install extensions from Google Chrome Extension Gallery Platform Google Chrome browser extension Contact Created by me (Vladislav Tserman). I'm available at: vladjan (at) gmail.com Follow Stack Exchange Notifier on twitter to get notified about news and updates: http://twitter.com/se_notifier Code Written in Java, Google Web Toolkit under Eclipse Helios. Stack Exchange Notifier uses the Stack Exchange API and is powered by Google App Engine for Java. Changelog I will be porting extension to not use app engine back-end due to some limitations. New versions of the extension will be making direct calls to Stack Exchange API right from your browser. Please do not expect new versions of the extension any time soon. Sorry. Read more about limitations here http://stackapps.com/questions/1713 and here http://stackoverflow.com/questions/3949815 Currently, you may sometimes experience some issues using extension, but most users will have no problems. You may notice too many errors in the logs, but there is nothing I can do with this now. Thanks for using my little app, thanks to all of you it still works in spite of many issues with API Version 1.2.9.3 - Thursday, October 14, 2010 - Bug fix release (back-end improvements) Version 1.2.9.2 - Thursday, October 07, 2010 - Bug fix release (high rate of occasional API errors were noticed so some fixes added to handle them were possible) Version 1.2.9.1 - Tuesday, October 05, 2010 - Mostly bug fix release, back-end performance improvements - You will now get notified of comments on your own posts (questions and answers) that are not older than 1 year and of any comments that refer to you by @username in a comment, even if you do not own the post (aka mentions). This is experimental feature, let me know if you like/need it. - New 'All sites' view displays all websites from Stack Exchange network (part of new feature that is not finished yet) Version 1.2.9 - Saturday, September 25, 2010 - Fixes an issue when some users got empty Account view. - When hovering on @Username on account view the title now displays '@Username on @SiteName' to easily understand the site name Version 1.2.7 - Wednesday, September 22, 2010 - Fixed an issue with notifications. - Minor improvements Version 1.2.5 - Tuesday, September 21, 2010 - Fixed an issue where some characters in response payload raised an exception when parsing to JSON. v1.2.3 (Sunday, September 19, 2010) - Support for new OpenID providers was added (Yahoo, MyOpenID, AOL) - UI improvements - Several minor defects were fixed v1.2.2 (Thursday, September 16, 2010) - New types of notifications added. Now extension notifies you on comments that are directed to you. Comments are expandable, so clicking on comment title will expand height to accommodate all available text. - UI and error handling improvements Future Application still in beta stage. I hope you're not having any problems, but if you are, please let me know. Leave your feedback and bug reports in comments. I'm available at: vladjan (at) gmail.com. I'm working on adding new features. I want to hear from the users and incorporate as much feedback as possible into the extension. Any suggestions for improvements/features to add?

    Read the article

  • AskUbuntu Add-on for Firefox, Opera and Chrome

    - by lovinglinux
    Screenshots Firefox Opera Chrome About The extension, called AskUbuntu Add-on, allows to easily track user info and questions from askubuntu.com. This extension displays user reputation and badges in the toolbar, provides an easy access menu to unanswered questions , user questions, favorites and user tags. It has an update checker that alerts when there is new activity in the user account or unanswered questions. The configuration options allow to disable alerts, limit the number of items displayed in the menu, hide user info and control the frequency of updates. There is also an option to store data temporarily if the browser is on private mode. License Free, open source released under: GNU General Public License v3 [Firefox] Apache License, Version 2.0 [Opera and Chrome] Download Home page: http://www.webgapps.org/addons/askubuntu GitHub downloads: http://github.com/webgapps/askubuntu/downloads Mozilla gallery: https://addons.mozilla.org/en-US/firefox/addon/242568/ Opera gallery: https://addons.opera.com/addons/extensions/details/askubuntu-add-on... Google gallery: https://chrome.google.com/extensions/detail/hamgohmiimamjpabgncmklojoibjknon Platform Firefox 3.5 to 4.0b8pre Opera 11.0 Chrome 5.0.316.0 [OS independent] Contact Developed by lovinglinux Code Javascript, HTML (Opera and Chrome) and XUL (Firefox) Source code at http://github.com/webgapps/askubuntu Note: some Gnome users might experience diminished functionality if their Firefox does not show icons in menus, since the icons are indicators of new activity. To solve this problem visit: http://askubuntu.com/questions/8586/where-is-the-gnome-option-to-display-icons-in-menus

    Read the article

  • StackWrap4J Java wrapper

    - by Bill the Lizard
    The StackWrap4J 1.0.1 jar is now available! (See the changelog) Sample Code / Screen Shot The following code snippet was used to test the wrapper in the Android emulator: TextView text = (TextView)findViewById(R.id.output); StackWrapper stackWrap = new StackOverflow(); String displayText = null; try { Stats stats = stackWrap.getStats(); displayText = "Stack Overflow Statistics"; displayText += "\nTotal Questions: " + stats.getTotalQuestions(); displayText += "\nTotal Unanswered: " + stats.getTotalUnanswered(); displayText += "\nTotal Answers: " + stats.getTotalAnswers(); displayText += "\nTotal Comments: " + stats.getTotalComments(); displayText += "\nTotal Votes: " + stats.getTotalVotes(); displayText += "\nTotal Users: " + stats.getTotalUsers(); } catch(Exception e){ displayText = e.getMessage(); } text.setText(displayText); About StackWrap4J is a Java wrapper for the Stack Exchange API. It is designed to be easy to use, and intuitive to learn while providing the full functionality of the API. License StackWrap4J is available under the MIT license. Download StackWrap4J Platform StackWrap4J was built using Java 1.5 and tested on Sun's JVM. It should run on any implementation of the JVM (1.5 or later). It's also been tested on the Android emulator. It also runs under the Google App Engine. Code You can download the code from our SVN repository hosted on SourceForge. Documentation for the code is also available on the SourceForge site. Authors Bill Cruise Justin Nelson Contact Please feel free to leave feedback here in the Answers section or on the StackWrap4J project discussion forum. Alternatively: Bill is available at: lizard.bill (at) gmail.com Justin can be reached at: jjnguy13 (at) gmail.com Future Currently we are focusing on adding more tests and fixing bugs. We are also working on adding serialization so that our objects can be easily persisted, and throttling so that users of our library don't have to worry about breaking the terms of use of the API. Notes The latest build was tested against version 1.0 of the API on July 28th.

    Read the article

  • CodeCritics.com: A no nonsense place for coders to critique code and raise awareness of standards and "good coding standards" [closed]

    - by Visionary Software Solutions
    StackOverflow has been a boon for increasing programming knowledge by allowing developers to ask for help and knowledge related to programming. Oftentimes these questions boil down to: This code is broken, fix it I don't know how to do this Is this the best approach (hard question to answer on StackExchange, but democratic) Oftentimes, however, these questions are discussed at a very high level. "I use web services with a proxy client to ..." But, as Grady Booch is fond of saying "the Truth is raw, naked, running code". Those high level descriptions can be accomplished in any ways. Programming is an Art, and there are an infinite number of different ways to do things. But some are better than others. A site devoted to Q&A can help increase knowledge...a site devoted to critique of code can help elevate standards and result in higher quality knowledge. By upvoting the most elegant ways to solve a short, concise problem statement, or just looking at a piece of code and saying "this is ugly, how can we fix it?" we can increase community participation in discussions about the substantive details of an approach: "is my commenting clear? "Is this 3 nested for-loops with a continue that breaks in a special case a good way of building an object?" "Does this extremely generic and polymorphic inheritance hierarchy have issues?") Code is an art/craft and science/engineering artifact. Doesn't it deserve the same type of review treatment as a painting and an experiment? For praising those that provide that moment of zen when looking at exceptionally good code that makes you believe in a better tomorrow, and panning those whose offal is so offensive that were you to meet them on the job you'd say "YOU! GET OUT!!!" Hence, CodeCritics. A collaborative critiquing platform in the style of StackOverflow focused solely on critiquing code that can act as a collaborative code review and assist in the discovery of Design Patterns.

    Read the article

  • How to Upload a file from client to server using OFBIZ?

    - by SIVAKUMAR.J
    I'm new to ofbiz so try to keep your answer as simple as possibly. If you can give examples that would be kind. My problem is I created a project inside the ofbiz/hot-deploy folder namely productionmgntSystem. Inside the folder ofbiz\hot-deploy\productionmgntSystem\webapp\productionmgntSystem I created a file app_details_1.ftl. The following are the code of this file <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> <script TYPE="TEXT/JAVASCRIPT" language=""JAVASCRIPT"> function uploadFile() { //alert("Before calling upload.jsp"); window.location='<@ofbizUrl>testing_service1</@ofbizUrl>' } </script> </head> <!-- <form action="<@ofbizUrl>testing_service1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> --> <form action="<@ofbizUrl>logout1</@ofbizUrl>" enctype="multipart/form-data" name="app_details_frm"> <center style="height: 299px; "> <table border="0" style="height: 177px; width: 788px"> <tr style="height: 115px; "> <td style="width: 103px; "> <td style="width: 413px; "><h1>APPLICATION DETAILS</h1> <td style="width: 55px; "> </tr> <tr> <td style="width: 125px; ">Application name : </td> <td> <input name="app_name_txt" id="txt_1" value=" " /> </td> </tr> <tr> <td style="width: 125px; ">Excell sheet &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: </td> <td> <input type="file" name="filename"/> </td> </tr> <tr> <td> <!-- <input type="button" name="logout1_cmd" value="Logout" onclick="logout1()"/> --> <input type="submit" name="logout_cmd" value="logout"/> </td> <td> <!-- <input type="submit" name="upload_cmd" value="Submit" /> --> <input type="button" name="upload1_cmd" value="Upload" onclick="uploadFile()"/> </td> </tr> </table> </center> </form> </html> the following coding is present in the file ofbiz\hot-deploy\productionmgntSystem\webapp\productionmgntSystem\WEB-INF\controller.xml ...... ....... ........ <request-map uri="testing_service1"> <security https="true" auth="true"/> <event type="java" path="org.ofbiz.productionmgntSystem.web_app_req.WebServices1" invoke="testingService"/> <response name="ok" type="view" value="ok_view"/> <response name="exception" type="view" value="exception_view"/> </request-map> .......... ............ .......... <view-map name="ok_view" type="ftl" page="ok_view.ftl"/> <view-map name="exception_view" type="ftl" page="exception_view.ftl"/> ................ ............. ............. The following are the coding present in the file ofbiz\hot-deploy\productionmgntSystem\src\org\ofbiz\productionmgntSystem\web_app_req\WebServices1.java package org.ofbiz.productionmgntSystem.web_app_req; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.DataInputStream; import java.io.FileOutputStream; import java.io.IOException; public class WebServices1 { public static String testingService(HttpServletRequest request, HttpServletResponse response) { //int i=0; String result="ok"; System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- Start"); String contentType=request.getContentType(); System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- contentType : "+contentType); String str=new String(); // response.setContentType("text/html"); //PrintWriter writer; if ((contentType != null) && (contentType.indexOf("multipart/form-data") >= 0)) { System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) after if (contentType != null)"); try { // writer=response.getWriter(); System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - try Start"); DataInputStream in = new DataInputStream(request.getInputStream()); int formDataLength = request.getContentLength(); byte dataBytes[] = new byte[formDataLength]; int byteRead = 0; int totalBytesRead = 0; //this loop converting the uploaded file into byte code while (totalBytesRead < formDataLength) { byteRead = in.read(dataBytes, totalBytesRead,formDataLength); totalBytesRead += byteRead; } String file = new String(dataBytes); //for saving the file name String saveFile = file.substring(file.indexOf("filename=\"") + 10); saveFile = saveFile.substring(0, saveFile.indexOf("\n")); saveFile = saveFile.substring(saveFile.lastIndexOf("\\")+ 1,saveFile.indexOf("\"")); int lastIndex = contentType.lastIndexOf("="); String boundary = contentType.substring(lastIndex + 1,contentType.length()); int pos; //extracting the index of file pos = file.indexOf("filename=\""); pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; pos = file.indexOf("\n", pos) + 1; int boundaryLocation = file.indexOf(boundary, pos) - 4; int startPos = ((file.substring(0, pos)).getBytes()).length; int endPos = ((file.substring(0, boundaryLocation)).getBytes()).length; //creating a new file with the same name and writing the content in new file FileOutputStream fileOut = new FileOutputStream("/"+saveFile); fileOut.write(dataBytes, startPos, (endPos - startPos)); fileOut.flush(); fileOut.close(); System.out.println("\n\n\t**********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - try End"); } catch(IOException ioe) { System.out.println("\n\n\t*********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - Catch IOException"); //ioe.printStackTrace(); return("exception"); } catch(Exception ex) { System.out.println("\n\n\t*********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) - Catch Exception"); return("exception"); } } else { System.out.println("\n\n\t********************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response) else part"); result="exception"; } System.out.println("\n\n\t*************************************\n\tInside WebServices1.testingService(HttpServletRequest request, HttpServletResponse response)- End"); return(result); } } I want to upload a file to the server. The file is get from user " tag in the "app_details_1.ftl" file & it is updated into the server by using the method "testingService(HttpServletRequest request, HttpServletResponse response)" in the class "WebServices1". But the file is not uploaded. Give me a good solution for uploading a file to the server.

    Read the article

  • Follow your friends on StackOverflow with FriendOverflow

    - by Mike Grace
    Screenshot About I created this app because I wanted to see what my friends and co-workers were doing on StackOverflow. I was previously going to their profiles to see what they were asking, answering, and commenting on because most of the time I found what they were doing was interesting or relevant to what I was doing. This app is for anyone who visits StackOverflow using their desktop browser and has 'friends' they would like to follow on StackOverflow. Cost Free Download Google Chrome extension http://goo.gl/ooE34 Mozilla Firefox extension http://goo.gl/3Pnqa Bookmarklet http://goo.gl/FkuQW Platform Desktop browsers via Google Chrome extension, Mozilla Firefox extension, and bookmarklet Contact @MikeGrace Code App was built on the Kynetx platform using KRL (Kynetx Rule Language)

    Read the article

  • Soapi.CS : A fully relational fluent .NET Stack Exchange API client library

    - by Sky Sanders
    Soapi.CS for .Net / Silverlight / Windows Phone 7 / Mono as easy as breathing...: var context = new ApiContext(apiKey).Initialize(false); Question thisPost = context.Official .StackApps .Questions.ById(386) .WithComments(true) .First(); Console.WriteLine(thisPost.Title); thisPost .Owner .Questions .PageSize(5) .Sort(PostSort.Votes) .ToList() .ForEach(q=> { Console.WriteLine("\t" + q.Score + "\t" + q.Title); q.Timeline.ToList().ForEach(t=> Console.WriteLine("\t\t" + t.TimelineType + "\t" + t.Owner.DisplayName)); Console.WriteLine(); }); // if you can think it, you can get it. Output Soapi.CS : A fully relational fluent .NET Stack Exchange API client library 21 Soapi.CS : A fully relational fluent .NET Stack Exchange API client library Revision code poet Revision code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Revision code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Answer code poet Revision code poet Revision code poet 14 SOAPI-WATCH: A realtime service that notifies subscribers via twitter when the API changes in any way. Votes code poet Revision code poet Votes code poet Comment code poet Comment code poet Comment code poet Votes lfoust Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Revision code poet Comment lfoust Votes code poet Revision code poet Votes code poet Votes lfoust Votes code poet Revision code poet Comment Dave DeLong Revision code poet Revision code poet Votes code poet Comment lfoust Comment Dave DeLong Comment lfoust Comment lfoust Comment Dave DeLong Revision code poet 11 SOAPI-EXPLORE: Self-updating single page JavaSript API test harness Votes code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Revision code poet Votes code poet Revision code poet Revision code poet Revision code poet Comment code poet Revision code poet Votes code poet Comment code poet Question code poet Votes code poet 11 Soapi.JS V1.0: fluent JavaScript wrapper for the StackOverflow API Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Comment George Edison Answer George Edison Votes code poet Votes code poet Votes code poet Votes code poet Revision code poet Revision code poet Answer code poet Comment code poet Revision code poet Comment code poet Comment code poet Comment code poet Revision code poet Revision code poet Votes code poet Votes code poet Votes code poet Votes code poet Comment code poet Comment code poet Comment code poet Comment code poet Comment code poet 9 SOAPI-DIFF: Your app broke? Check SOAPI-DIFF to find out what changed in the API Votes code poet Revision code poet Comment Dennis Williamson Answer Dennis Williamson Votes code poet Votes Dennis Williamson Comment code poet Question code poet Votes code poet About A robust, fully relational, easy to use, strongly typed, end-to-end StackOverflow API Client Library. Out of the box, Soapi provides you with a robust client library that abstracts away most all of the messy details of consuming the API and lets you concentrate on implementing your ideas. A few features include: A fully relational model of the API data set exposed via a fully 'dot navigable' IEnumerable (LINQ) implementation. Simply tell Soapi what you want and it will get it for you. e.g. "On my first question, from the author of the first comment, get the first page of comments by that person on any post" my.Questions.First().Comments.First().Owner.Comments.ToList(); (yes this is a real expression that returns the data as expressed!) Full coverage of the API, all routes and all parameters with an intuitive syntax. Strongly typed Domain Data Objects for all API data structures. Eager and Lazy Loading of 'stub' objects. Eager\Lazy loading may be disabled. When finer grained control of requests is desired, the core RouteMap objects may be leveraged to request data from any of the API paths using all available parameters as documented on the help pages. A rich Asynchronous implementation. A configurable request cache to reduce unnecessary network traffic and to simplify your usage logic. There is no need to go out of your way to be frugal. You may set a distinct cache duration for any particular route. A configurable request throttle to ensure compliance with the api terms of usage and to simplify your code in that you do not have to worry about and respond to 50X errors. The RequestCache and Throttled Queue are thread-safe, so can make as many requests as you like from as many threads as you like as fast as you like and not worry about abusing the api or having to write reams of management/compensation code. Configurable retry threshold that will, by default, make up to 3 attempts to retrieve a request before failing. Every request made by Soapi is properly formed and directed so most any http error will be the result of a timeout or other network infrastructure. A retry buffer provides a level of fault tolerance that you can rely on. An almost identical javascript library, Soapi.JS, and it's full figured big brother, Soapi.JS2, that will enable you to leverage your server cycles and bandwidth for only those tasks that require it and offload things like status updates to the client's browser. License Licensed GPL Version 2 license. Why is Soapi.CS GPL? Can I get an LGPL license for Soapi.CS? (hint: probably) Platforms .NET 3.5 .NET 4.0 Silverlight 3 Silverlight 4 Windows Phone 7 Mono Download Source code lives @ http://soapics.codeplex.com. Binary releases are forthcoming. codeplex is acting up again. get the source and binaries @ http://bitbucket.org/bitpusher/soapi.cs/downloads The source is C# 3.5. and includes projects and solutions for the following IDEs Visual Studio 2008 Visual Studio 2010 ModoDevelop 2.4 Documentation Full documentation is available at http://soapi.info/help/cs/index.aspx Sample Code / Usage Examples Sample code and usage examples will be added as answers to this question. Full API Coverage all API routes are covered Full Parameter Parity If the API exposes it, Soapi giftwraps it for you. Building a simple app with Soapi.CS - a simple app that gathers all traces of a user in the whole stackiverse. Fluent Configuration - Setting up a Soapi.ApiContext could not be easier Bulk Data Import - A tiny app that quickly loads a SQLite data file with all users in the stackiverse. Paged Results - Soapi.CS transparently handles multi-page operations. Asynchronous Requests - Soapi.CS provides a rich asynchronous model that is especially useful when writing api apps in Silverlight or Windows Phone 7. Caching and Throttling - how and why Apps that use Soapi.CS Soapi.FindUser - .net utility for locating a user anywhere in the stackiverse Soapi.Explore - The entire API at your command Soapi.LastSeen - List users by last access time Add your app/site here - I know you are out there ;-) if you are not comfortable editing this post, simply add a comment and I will add it. The CS/SL/WP7/MONO libraries all compile the same code and with the exception of environmental considerations of Silverlight, the code samples are valid for all libraries. You may also find guidance in the test suites. More information on the SOAPI eco-system. Contact This library is currently the effort of me, Sky Sanders (code poet) and can be reached at gmail - sky.sanders Any who are interested in improving this library are welcome. Support Soapi You can help support this project by voting for Soapi's Open Source Ad post For more information about the origins of Soapi.CS and the rest of the Soapi eco-system see What is Soapi and why should I care?

    Read the article

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