Search Results

Search found 38423 results on 1537 pages for 'try finally'.

Page 13/1537 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • angular, try to display object in ng-repeat fails

    - by Simone M
    i'm writing an mobile application in javascript with angularJS and ionicframework (last beta v.11), i create dinamically an object and want to display all objects inside in a ng-repeat. Why nr-repeat don't display anything? This is screen from my object: I use this code for put values in scope: $scope.distanceSuppliers = myCar; And this is the code in html: <ion-item ng-repeat="(id, supplier) in distanceSuppliers"> <div class="items item-button-right" ng-click="openDetails(id)"> {{supplier.name}}<br /> {{supplier.address}}<br /> </div> </ion-item> This is my complete code for JS: .controller('suppliers', function($scope, cw_db, $ionicPopup, $ionicActionSheet, appdelegate, $rootScope, $firebase, $location, $ionicLoading, cw_position) { $ionicLoading.show({ template: 'Updating data..' }); var geocoder; var tot = 0; var done = 0; geocoder = new google.maps.Geocoder(); cw_db.getData(cw_db.getSuppliers(), "", function(suppliers) { cw_position.getPosition(function (error, position) { suppliers.on('value', function(supp) { $scope.distanceSuppliers = {}; tot = 0; done = 0; supp.forEach(function(childSnapshot) { tot++; var childData = childSnapshot.val(); if (childData.address) { calculateDistance(childData, position.coords.latitude, position.coords.longitude); } }); }); $ionicLoading.hide(); }); }); function calculateDistance(childData, usrLat, usrLon) { var service = new google.maps.DistanceMatrixService(); service.getDistanceMatrix( { origins: [new google.maps.LatLng(usrLat, usrLon)], destinations: [childData.address], travelMode: google.maps.TravelMode.DRIVING, unitSystem: google.maps.UnitSystem.METRIC, avoidHighways: false, avoidTolls: false }, function(response, status) { if (status != google.maps.DistanceMatrixStatus.OK) { alert('Error was: ' + status); } else { done++; var results = response.rows[0].elements; childData.distance = results[0].distance.value; $scope.distanceSuppliers.push(childData); if (done == tot) { console.log($scope.distanceSuppliers); } } }); } $scope.openDetails = function(index) { //appdelegate.setCallId(index); //$location.path("/app/supplierDetails"); } }) what's wrong?

    Read the article

  • Cannot connect to Open WiFi hotspot created by Android

    - by Bibhas
    I'm trying to share my 3G data connection via WiFi hotspot. I have an open Hotspot running on my phone(Xperia Neo V - MT11i - Android 2.3.4). But I cannot connect to it from my Ubuntu system. Here is the syslog while I try to connect to it - NetworkManager[1077]: <info> Activation (wlan0) starting connection 'TheNeo' NetworkManager[1077]: <info> (wlan0): device state change: disconnected -> prepare (reason 'none') [30 40 0] NetworkManager[1077]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) scheduled... NetworkManager[1077]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) started... NetworkManager[1077]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) scheduled... NetworkManager[1077]: <info> Activation (wlan0) Stage 1 of 5 (Device Prepare) complete. NetworkManager[1077]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) starting... NetworkManager[1077]: <info> (wlan0): device state change: prepare -> config (reason 'none') [40 50 0] NetworkManager[1077]: <info> Activation (wlan0/wireless): connection 'TheNeo' requires no security. No secrets needed. NetworkManager[1077]: <info> Config: added 'ssid' value 'TheNeo' NetworkManager[1077]: <info> Config: added 'scan_ssid' value '1' NetworkManager[1077]: <info> Config: added 'key_mgmt' value 'NONE' NetworkManager[1077]: <info> Activation (wlan0) Stage 2 of 5 (Device Configure) complete. NetworkManager[1077]: <info> Config: set interface ap_scan to 1 NetworkManager[1077]: <info> (wlan0): supplicant interface state: inactive -> scanning wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) NetworkManager[1077]: <info> (wlan0): supplicant interface state: scanning -> authenticating kernel: [17498.113553] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17498.310138] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17498.510069] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17498.710083] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17504.779927] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17504.976420] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17505.176379] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17505.376314] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17511.478385] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17511.674738] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17511.874655] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17512.074659] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17518.152643] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17518.349064] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17518.549051] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17518.748999] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17524.858896] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17525.055404] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17525.255387] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17525.455254] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17531.589176] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17531.785747] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17531.985724] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17532.185610] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17538.329257] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17538.528003] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17538.728024] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17538.927922] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17545.022036] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17545.218339] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17545.418319] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17545.618206] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out wpa_supplicant[29352]: Trying to authenticate with 5c:b5:24:2f:d1:2f (SSID='TheNeo' freq=2462 MHz) kernel: [17551.724177] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 1/3) kernel: [17551.920685] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 2/3) kernel: [17552.120597] wlan0: direct probe to 5c:b5:24:2f:d1:2f (try 3/3) kernel: [17552.320526] wlan0: direct probe to 5c:b5:24:2f:d1:2f timed out NetworkManager[1077]: <warn> Activation (wlan0/wireless): association took too long, failing activation. NetworkManager[1077]: <info> (wlan0): device state change: config -> failed (reason 'supplicant-timeout') [50 120 11] NetworkManager[1077]: <warn> Activation (wlan0) failed for access point (TheNeo) NetworkManager[1077]: <warn> Activation (wlan0) failed. NetworkManager[1077]: <info> (wlan0): device state change: failed -> disconnected (reason 'none') [120 30 0] NetworkManager[1077]: <info> (wlan0): deactivating device (reason 'none') [0] NetworkManager[1077]: <info> (wlan0): supplicant interface state: authenticating -> disconnected NetworkManager[1077]: <warn> Couldn't disconnect supplicant interface: This interface is not connected. Why is direct probe to 5c:b5:24:2f:d1:2f timed out? Any idea?

    Read the article

  • Is it okay to use try catch inside finally?

    - by Hiral Lakdavala
    Hi, I am using a buffered writer and my code, closes the writer in the finally block. My code is like this. ........... BufferedWriter theBufferedWriter = null; try{ theBufferedWriter =..... .... ...... ..... } catch (IOException anException) { .... } finally { try { theBufferedWriter.close(); } catch (IOException anException) { anException.printStackTrace(); } } I have to use the try catch inside the clean up code in finally as theBufferedWriter might also throw an IOException. I do not want to throw this exception to the calling methos. Is it a good practice to use a try catch in finally? If not what is the alternative? Please suggest. Regards, Hiral

    Read the article

  • accessing values in a Map container, then try to match them

    - by wilson88
    Trying to compare the prices of the bids in the two maps.Sellers map and the buyers map. Conditions for comparison. 1) One bid is A and the other is B 2) Price of B i greater than price of A. I then copy the matched bids to a container called matched.I am not sure how to do the match of maps. map<int, Bid*> bidtable/Before matching map<int, Bid*> matched map<int, Bid*> unmatched

    Read the article

  • First try StructureMap and MVC3 via NuGet

    - by Angel Escobedo
    Hello Guys, I'm trying to figure how to config StructureMap for ASP.NET MVC3 I've already using NuGet and I notice that it creates App_Start Folder with a cs file named as StructuremapMVC, so I check it and notice that is the same code but simplified that will be written manually on App_Start section placed on Global.asax... My Question is when I inject some IoC on my Controllers as the follow (I use this pattern : Entity Framework 4 CTP 4 / CTP 5 Generic Repository Pattern and Unit Testable) : private readonly IAsambleaRepository _aRep; private readonly IUnitOfWork _uOw; public AsambleaController(IAsambleaRepository aRep, IUnitOfWork uOw) { _aRep = aRep; this._uOw = uOw; } public ActionResult List(string period) { var rs = _aRep.ByPeriodo(period).ToList<Asamblea>(); return View(); } I got an Exception Exception Details: System.MissingMethodException: No parameterless constructor defined for this object.

    Read the article

  • HTML Link and Jquery Live Only Works on First Try with one click

    - by Jon
    Hi Everyone, I'm running into a problem with jquery live event binding on a link. When the link is added to the page it works fine, however when another link is added to the unordered list it requires two clicks for the click event to fire on either link. Any ideas? $("div#website-messages ul li a").live("click", function() { var link = $(this); changeTab(link.attr("href")); $(link.attr("title")).focus(); return false; });

    Read the article

  • Video works with 'Try me' but not after install. What is the difference? U12.04LTS,

    - by HarveyP
    My hard drive got corrupted so I did a reinstall. Tested Youtube in FF during 'try me' and it worked - jerky, but it worked. Instal without all the updates (576 outstanding now) in order to get ff installed as per the demo - to no avail. In 'try me' mode ff NEVER crashed! After install ff crashed whilst I was typing in 'youtube' in the address field. When I finally got to youtube - no video. What is the difference between ff in try me and ff after install? Off to try some selected updates now to see if I can see it for myself. In previous installation I had several profiles and aliased ff with -safe-mode switch to simplify startup of most stable ff. Also found that ff startup in graphic mode worked better (but still without video) with all of the extensions disabled and all of the plugins set to "ask" and always denied ... I have SiS graphic card in SiS Motherboard for XP and ancient Hyundai ImageQuest QV770 monitor. I have Ubuntu 12.04.01 LTS 1 day after install with only the immediate upgrades requested to language pack (English UK). Using FR Alternative keyboard. Connected with domestic wifi network from Orange (FT) I really want to use Skype, but won't bother installing it (again) without video as I can do my sms on FB - whilst ff is not crashed ... Update ... Is something overflowing? I have just had to reboot in order to get ff to restart in any way shape or form - restart on crash form generates new crash form, etc. It was however a good half hour before it crashed so some improvement over conditions before disk corruption. I have now installed all of the critical updates (332 recommended updates still outstanding) which included some relating to ff. Still no video. Still crashing - especially when on Grepolis website. Since the re-install I have had a lovely 1024x768 screen, but after last ff crash and reboot I got a message about 'low graphics mode' and 'setting things myself'. I was not sufficiently tuned in at the time to take proper note - I have no doubt I shall see it again and shall report accordingly. I still have only laptop options for my screen and do not know how to rectify this. Spent a few days with ubuntu on a different, newer machine which has now suffered a graphics breakdown. Returned to this old one again, but with new flat screen Monitor. Found SIS drivers for my graphics BUT it is intended for Red Hat 7.2. I chose this over the version for 7.0 because I thought what the hell, I might not be able to do anything with either of them but this is the later one ... The file will not open with software manager - found a similar problem on Overclock but it has not helped me to install this driver. File name is sis_drv.o-410 and it is currently idling away in my Downloads folder ... I have tried the solution offered on another sis problem, but this shows that my xserver-xorg-video-sis driver is up to date. I am now at a loss as to how to proceed if I can't install the latest sis driver from sis ... Does nobody know how FF changes from "try-me" to "installed"? Any time I MUST have video I reboot from the disk again, but this is tedious! Also one of the things I mock most about MS is the constant rebooting ... UPDATE 10/6/2014 I have installed chromium-browser - worse, crashes even more often than ff.I have installed epiphany - better; Video works but not the associated soundtrack.FireFox is version 14.01 in 'try me' and version 29.0 from my install. Would it be useful to try to downgrade FireFox in order to get video?

    Read the article

  • I get NaN when I try to insert some HTML into a DIV element with jQuery

    - by Ankur
    I am tring to display a text box when a element of class numObj is clicked. For some reason I get NaNNaNaNaNNaNNaNaNaN where I expect to the see the result of the searchForm variable in the code below. I know that NaN stands for Not a Number. What I don't understand is why is Javascript expecting a number? I can't understand why it cares. $(".numObj").live('click',function(){ var preId = $(this).attr('preId'); var arrayPos = $(this).attr('numArrayPos'); alert(preId +" "+arrayPos); var searchForm = "<table border='0' cellspacing='0' cellpadding='4' id='add-tag2'>"+ +"<tr class='normal'><td bgcolor='#EEEEEE' valign='bottom' nowrap='nowrap'><span class='normal-small'>"+ +"<input name='predicate-name2' type='text' class='normal' id='predicate-name2' size='4' />"+ +"</span></td>"+ +"<td bgcolor='#EEEEEE' valign='bottom' nowrap='nowrap'><span class='normal-small'>&lt;=</span></td>"+ +"<td bgcolor='#EEEEEE' valign='bottom' nowrap='nowrap'>x</td>"+ +"<td valign='bottom' bgcolor='#EEEEEE'>&lt;=</td>"+ +"<td valign='bottom' bgcolor='#EEEEEE'><span class='normal-small'>"+ +"<input type='text' name='object-object2' id='object-object2' class='normal' size='4' />"+ +"</span></td>"+ +"</tr>"+ +"</table>"; $(".numObj").filter("[preId='"+preId+"']").filter("[numArrayPos='"+arrayPos+"']").html(searchForm); }); The generated code that has the numObj class looks something like this <td><div class="numObj" preid="73" numarraypos="5"><span class="normal">585.0</span></div></td>

    Read the article

  • Need to try and count repeated lists within a list

    - by user1828603
    Im trying to count how many repeated lists there are inside a list. But it doesnt work the same way I could count repeated elements in just a list. Im fairly new to python, so apologies if it sounds too easy. this is what i did x= [["coffee", "cola", "juice" "tea" ],["coffee", "cola", "juice" "tea"] ["cola", "coffee", "juice" "tea" ]] dictt= {} for item in x: dictt[item]= dictt.get(item, 0) +1 return(dictt)

    Read the article

  • Asp.Net Impersonation Fails On First Try But Succeeds on Second

    - by KevDog
    We are using RDLC's in a Asp.net web application. For reasons beyond our understanding, the first call to the database server fails with the following error: An error has occurred during report processing. Cannot open database "TryParkingIt2" requested by the login. The login failed. Login failed for user 'EXTRANET\OurServerNameHere$'. Run the report again, it works. Huh? Update Click the button the first time, it fails. Click the button again, it works. The account being impersonated is a domain account.

    Read the article

  • Rails - Permission denied when try to save uploaded file in windows

    - by logoin
    I'm writing my own file upload in rails. I saw some related questions but it doesn't answer my question. I use File.open ("#{RAILS_ROOT}/public/docs/attachments/#{@file_name}", "wb") {|f| f.write(@temp_file.read)} to write the file on my local machine (OS: Windows XP) instead of saving it in database. I got a Permission denied error on the File.open method. Since I have cygwin installed, I chmod 777 the folder that files should write to and also make sure the file I upload can be read. But I'm still getting the same error. Any ideas? Thanks!

    Read the article

  • Loop not working when I try to traverse a Simple XML Object

    - by Ben Shelock
    I'm trying to loop through the results from the Last.fm API but it's not working. function get_url($url){ $ch = curl_init(); curl_setopt($ch,CURLOPT_URL,$url); curl_setopt($ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,5); $content = curl_exec($ch); curl_close($ch); return $content; } $xml = get_url('http://ws.audioscrobbler.com/2.0/?method=album.search&album=kid%20a&api_key=b25b959554ed76058ac220b7b2e0a026'); $doc = new SimpleXMLElement($xml); $albums = $doc->results->albummatches; foreach($albums as $album){ echo $album->album->name; } This just shows the first album. If I change the code within the foreach loop to echo $album->name; it shows nothing at all. What am I doing wrong?

    Read the article

  • What is the best practice in C# to propagate an exception thrown in a finally block without loosing an exception from a catch block?

    - by Sergey Smolnikov
    When an exception is possible to be thrown in a finally block how to propagate both exceptions - from catch and from finally? As a possible solution - using an AggregateException: internal class MyClass { public void Do() { Exception exception = null; try { //example of an error occured in main logic throw new InvalidOperationException(); } catch (Exception e) { exception = e; throw; } finally { try { //example of an error occured in finally throw new AccessViolationException(); } catch (Exception e) { if (exception != null) throw new AggregateException(exception, e); throw; } } } }

    Read the article

  • sifr3 text doesn't load on first try?

    - by metal-gear-solid
    sifr3 text doesn't load many time first time on FF 3.5? I haven't checked on other browser. If i reload page again then it loads properly. this is my code sIFR.replace(futura, { selector: '#Homepage h1', ratios: [6, 1.24, 9, 1.13, 10, 1.15, 16, 1.09, 21, 1.06, 22, 1.07, 25, 1.04, 26, 1.06, 29, 1.03, 30, 1.05, 31, 1.03, 32, 1.05, 41, 1.04, 58, 1.03, 97, 1.02, 1.01], wmode: 'transparent', css: '.sIFR-root { background-color: none; color: #ffffff; }' });

    Read the article

  • ReflectionTypeLoadException when I try to run Enable-Migrations with Entity Framework 5.0

    - by Eric Anastas
    I'm trying to use Entity Framework for the first time on one of my projects. I'm using the code first workflow to automatically create my database. Intitaly setting up the database worked fine. Now I'm trying to migrate changes in my classes into the database. The tutorial I'm reading says I need to run "Enable-Migrations" in the package manager console. Yet when I do this I get the following error PM> Enable-Migrations System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module) at System.Reflection.RuntimeModule.GetTypes() at System.Reflection.Assembly.GetTypes() at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.FindType[TBase](String typeName, Func`2 filter, Func`2 noType, Func`3 multipleTypes, Func`3 noTypeWithName, Func`3 multipleTypesWithName) at System.Data.Entity.Migrations.Design.ToolingFacade.GetContextTypeRunner.RunCore() at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run() Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. What am I doing wrong? How do I retrieve the loader exceptions property? Also NuGet says I have EF 5.0, but Version property of the EntityFramework item in my project references says 4.4.0.0. I'm not sure if this is related.

    Read the article

  • COM+ Applications returns an error when when I try to add a new application

    - by Baright
    Error message returned 'An error occurred while processing the last operation. Error code 800401154 - Class not registered The event log may contain additional troubleshooting information.' The other thing is, the is a red arrow icon displayed over My Computer (Component Servers - Computers - My Computer). I have searched everywhere for this, but I couldnt find a solution that resolves my specific problem. Im using VISTA and this error started after I reinstalled my SQL server 2008. I have 2 dll that I need to add but I cannot, because of this error.

    Read the article

  • When I try to redefine a variable, I get an index out of bounds error

    - by user2770254
    I'm building a program to act as a calculator with memory, so you can give variables and their values. Whenever I'm trying to redefine a variable, a = 5, to a = 6, I get an index out of bounds error. public static void main(String args[]) { LinkedHashMap<String,Integer> map = new LinkedHashMap<String,Integer>(); Scanner scan = new Scanner(System.in); ArrayList<Integer> values = new ArrayList<>(); ArrayList<String> variables = new ArrayList<>(); while(scan.hasNextLine()) { String line = scan.nextLine(); String[] tokens = line.split(" "); if(!Character.isDigit(tokens[0].charAt(0)) && !line.equals("clear") && !line.equals("var")) { int value = 0; for(int i=0; i<tokens.length; i++) { if(tokens.length==3) { value = Integer.parseInt(tokens[2]); System.out.printf("%5d\n",value); if(map.containsKey(tokens[0])) { values.set(values.indexOf(tokens[0]), value); variables.set(variables.indexOf(tokens[0]), tokens[0]); } else { values.add(value); } break; } else if(tokens[i].charAt(0) == '+') { value = addition(tokens, value); System.out.printf("%5d\n",value); variables.add(tokens[0]); if(map.containsKey(tokens[0])) { values.set(values.indexOf(tokens[0]), value); variables.set(variables.indexOf(tokens[0]), tokens[0]); } else { values.add(value); } break; } else if(i==tokens.length-1 && tokens.length != 3) { System.out.println("No operation"); break; } } map.put(tokens[0], value); } if(Character.isDigit(tokens[0].charAt(0))) { int value = 0; if(tokens.length==1) { System.out.printf("%5s\n", tokens[0]); } else { value = addition(tokens, value); System.out.printf("%5d\n", value); } } if(line.equals("clear")) { clear(map); } if(line.equals("var")) { variableList(variables, values); } } } public static int addition(String[] a, int b) { for(String item : a) { if(Character.isDigit(item.charAt(0))) { int add = Integer.parseInt(item); b = b + add; } } return b; } public static void clear(LinkedHashMap<String,Integer> b) { b.clear(); } public static void variableList(ArrayList<String> a, ArrayList<Integer> b) { for(int i=0; i<a.size(); i++) { System.out.printf("%5s: %d\n", a.get(i), b.get(i)); } } I included the whole code because I'm not sure where the error is arising from.

    Read the article

  • I try to hook a character from javascript keydown event

    - by user523978
    I would like to hook a character typed in an input text field and type '1' in the field in case 'a' was pressed. Here is the code: <html> function translate_code(charCode) { switch (charCode) { case 65: // return '1' ; case 97: return '9'; } } function noEnglish(event) { if (event.charCode) { var charCode = event.charCode; } else { var charCode = event.keyCode; } if (65

    Read the article

  • iPhone: Try to send html code to a php script (but fail)

    - by Marc-André Weibezahn
    Hello all, I am trying this for an iPhone app in Xcode: create html code for a website on the fly sending it to a php-script and getting the response with this code: NSError * error = [[[NSError alloc]init]autorelease]; NSURL * phpURL = [NSURL URLWithString: @"http://www.mydomain.com/myscript.php?mywebsite= (...websitestring...) ];NSString * myResponse = [NSString stringWithContentsOfURL:phpURL encoding:NSUTF8StringEncoding error:&error]; It does not work. It should not be a problem of the php code because when I replace the websitestring which contains the html code with "hello" or something, this is accepted. (the script then creates a file "test.html" with the content I sent.) But when I put html code in it, I always get the error: Error Domain=NSCocoaErrorDomain Code=256 "The operation couldn’t be completed. (Cocoa error 256.)" UserInfo=0x322ec10 {} It seems that there are some things to consider when sending code to php? Thanks in advance!

    Read the article

  • Printer Canon MP540 succesfully added finally but doesn't print? (Attached Debug log)

    - by NES
    i tried to setup my printer in Ubuntu 10.10. I had to use special guide to install because Canon used libcupsys2 in its packages and ubuntu expects libscupsys i followed this guide in reference to this advice. The first problem was this one (the ubuntu "add printer dialog asked for root credentials". The suggested workarout in Launchpad to create a root password worked. Now i added the printer. It's available for printing. Then i got an error message "cups insecure filter" which prevented me from printing. That could be solved by setting the need root rights in the /usr/lib/cups/filter/ directory. The error message disappeared after restarting cups service. Now it should work but it doesn't. The main problem is now, the printer seems to be proper setup but when i try to print a document, the printer icon appears for short time in gnomepanel. There's a printing job in Queue which got completed, but the printer doesn't print. I attached the Debuglog provided by printer error control, had to upload to another site, since it was to big in the question body here. Perhaps someone can identify the problem with it? Note: i know that it once worked fine with an older release of Ubuntu, but not sure which version this was.

    Read the article

  • jQuery Find element else do nothing ?

    - by Andrew
    Hi Guys, I am trying to use jQuery to basically wrap a bunch of CSS modifications via jQuery but on pages where the #IDs or Classes dont exist I get errors ? Like jQuery(".class").css(random_stuff) is not a function Any ideas what I can do to either "find" the elements and do nothing or ?

    Read the article

  • Catching constraint violations in JPA 2.0.

    - by Dennetik
    Consider the following entity class, used with, for example, EclipseLink 2.0.2 - where the link attribute is not the primary key, but unique nontheless. @Entity public class Profile { @Id private Long id; @Column(unique = true) private String link; // Some more attributes and getter and setter methods } When I insert records with a duplicate value for the link attribute, EclipseLink does not throw a EntityExistsException, but throws a DatabaseException, with the message explaining that the unique constraint was violated. This doesn't seem very usefull, as there would not be a simple, database independent, way to catch this exception. What would be the advised way to deal with this? A few things that I have considered are: Checking the error code on the DatabaseException - I fear that this error code, though, is the native error code for the database; Checking the existence of a Profile with the specific value for link beforehand - this obviously would result in an enormous amount of superfluous queries.

    Read the article

  • Catching an exception that is nested into another exception

    - by Bernhard V
    Hi, I want to catch an exception, that is nested into another exception. I'm doing it currently this way: } catch (RemoteAccessException e) { if (e != null && e.getCause() != null && e.getCause().getCause() != null) { MyException etrp = (MyException) e.getCause().getCause(); ... } else { throw new IllegalStateException("Error at calling service 'beitragskontonrVerwalten'"); } } Is there a way to do this more efficient and elegant?

    Read the article

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