Daily Archives

Articles indexed Sunday August 24 2014

Page 7/15 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Cocos2d/Cocos2d-x Attaching an arrow (sprite) to another body sprite (person)

    - by Satchmo Brown
    I am trying to set up a simple bow and arrow game. When the arrow hits the enemy body, the arrow's body is deleted and the arrow sprite continues to update, keeping the position correct in relation to the enemy it hit. Picture an arrow sticking into a body and that body still rotating and moving. My problem is that the rotation is completely wrong when the enemy rotates. I know how to do this in 3d with matrix transformation but I can't seem to figure it out in 2d with Cocos. Here is my method. I save offset at which the arrow hit the enemy. Every frame, I make the rotation of the sprite match the rotation of the enemy. Then, I apply the offset I took initially which is where the arrow hit the enemy. When they rotate, they rotate about their respective anchors and I am wondering if I need to set the anchor of the arrow to the center of the sprite. Does anyone know of an easy way to do this. If not, I will try to create an algorithm where the anchor is set to the offset divided by the width and height of the sprite image hopefully giving me the correct anchor values. Then I assume I need to reposition the sprite. Does anyone have a simpler way to do this?

    Read the article

  • Recursive Maze in Java

    - by Api
    I have written a short Java code for solving a simple maze problem to go from S to G. I do not understand where the problem is going wrong. import java.util.Scanner; public class tester { static char [][] grid={ {'.','.'}, {'.','.'}, {'S','G'}, }; static int a=2; static int b=2; static boolean findpath(int x, int y) { if((x > grid.length-1) || (y > grid[0].length-1) || (x < 0 || y < 0)) { return false; } else if(x==a && y==b){ return true; } else if (findpath(x,y-1) == true){ return true; } else if (findpath(x+1,y) == true){ return true; } else if (findpath(x,y+1) == true) { return true; } else if (findpath(x-1,y) == true){ return true; } return false; } public static void main(String[] args){ boolean result=findpath(2,0); System.out.print(result); } } I am giving the starting position directly and goal is defined in a & b. Do help.

    Read the article

  • java.lang.ClassCastException: org.postgresql.jdbc4.Jdbc4Connection cannot be cast to org.postgresql.jdbc4.Jdbc4Connection

    - by ???????? ??????
    I want to get PGConnection from posgresql connection in JBOSS AS7 (Data source postgresql-9.0-801.jdbc4.jar) I've got cast exception when used (WrappedConnection)connection So now I use reflection(JDK 1.7): private static PGConnection getPGConnection(Connection connection) throws SQLException { if(connection instanceof PGConnection) { return (PGConnection)connection; } try { Class[] parms = null; Method method =(connection.getClass()).getMethod("getUnderlyingConnection", parms); return (PGConnection) jdbc4Conn; } catch ... and catch exception java.lang.ClassCastException: org.postgresql.jdbc4.Jdbc4Connection cannot be cast to org.postgresql.jdbc4.Jdbc4Connection It is the same class!!! Haw could it be?

    Read the article

  • Dependency issue in inheritance chain

    - by Razer
    I have a class in coffeescript a class layout like the following. class @A foo: -> console.log('foo') class @B extends A fooB: -> @foo() class @C extends B fooC: -> @foo() I tried this in interpreters, it works. However it raises errors, when executing this in the browser (all of them are in separate coffee files, and are used in a global context. Therefore the @ before the class): Uncaught ReferenceError: B is not defined application.js It seems that B is defined after the definition of C. How can this happen?

    Read the article

  • Sql server 2012 management studio is not showing me the Databasemail

    - by Sreejith
    I am trying to send mail through SQL server. But in my case when i expanded the SQL Server Logs i cannot find my Database mail. How can i do this Please help me guys. I tried so many ways for showing the database mail there.. i could get anything. Please help me guys. I tried the following codes too // To fix the run the following script: USE Master GO sp_configure 'show advanced options', 1 GO reconfigure with override GO sp_configure 'Database Mail XPs', 1 GO reconfigure GO sp_configure 'show advanced options', 0 GO Please find the below link to my snapshot of the SQL server 2012 management studio. I dont have Database mail there.. https://imageshack.com/i/f0xY6qH2p

    Read the article

  • How to add Ads for my android app using eclipse?

    - by user3896367
    I am trying to add ads to my app but I don't know how I followed the instructions from this site: https://developer.android.com/google/play-services/ads.html I did step 1 and 2 in the getting started column, I imported the google-play-services_libs to my workspace then I referenced it in my app and I added this code in my mainfest: <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> I opened the sample ad and copied this code to my xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:ads="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@android:color/black" android:gravity="center" android:orientation="vertical" > <com.google.android.gms.ads.AdView android:id="@+id/adView" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_alignParentLeft="true" ads:adUnitId="@string/ad_unit_id"/> but I am getting this error: The following classes could not be instantiated: - com.google.android.gms.ads.AdView so do you know how to fix this problem and can you tell me what should i write in the java to make in work thanks

    Read the article

  • Auto showing tips and closing popup when lost focus

    - by darkwindkey
    I have two elements: a TextBox, and a Popup, where the popup contains a tree view to show some tips according to text of TextBox. When the textBox got the KeyDown Event, the KeyDown directly executes pup.IsOpen=true to show the popup tips. However, I also want to show the popup tips when the mouse on clicking the TextBox, and auto closing the popups when the mouse click on any place (besides the TextBox and the TreeView in Popup). I have tried some cases but do not works fine. Case1: Add pup.IsOpen=true; in TextBox.PreviewMouseUp, the popup will stay opening, even if I click any other place in the window. Case2: Add pup.IsOpen=true in TextBox.PreviewMouseDown, the popup tips only shows on keep clicking the Mouse. Case3: Using CheckBox with Binding IsChecked to Popup.IsOpen works fine. but the tips is listed according to the content of the TextBox, therefore the checkbox is not editable for user... Here is my code now: <Window x:Class="popUpTesting.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525"> <Grid> <TextBox Name="SearchBox" HorizontalAlignment="Center" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Center" KeyDown="SearchBox_KeyDown" PreviewMouseUp="SearchBox_PreviewMouseUp" /> <Popup Placement="Bottom" AllowsTransparency="True" PopupAnimation="Fade" StaysOpen="false" x:Name="pup" PlacementTarget="{Binding ElementName=SearchBox}" IsOpen="False" > <Grid> <TreeView HorizontalAlignment="Left" Height="200" VerticalAlignment="Top" Width="200"> <TreeViewItem Header="A"> <TreeViewItem Header="A1"/> </TreeViewItem> <TreeViewItem Header="B"></TreeViewItem> <TreeViewItem Header="C"></TreeViewItem> <TreeViewItem Header="D"></TreeViewItem> </TreeView> </Grid> </Popup> </Grid> </Window> and the event functions: private void SearchBox_KeyDown(object sender, KeyEventArgs e) { pup.IsOpen = true; } private void SearchBox_PreviewMouseUp(object sender, MouseButtonEventArgs e) { pup.IsOpen = true; }

    Read the article

  • C++ Compound Interest Exercise

    - by Lameste
    I'm a beginner trying to learn C++ using "C++ Primer Plus Sixth Edition". I'm on Chapter 5, going over loops. Anyways I was doing this programming exercise from the book, the problem is: Daphne invests $100 at 10% simple interest.That is, every year, the investment earns 10% of the original investment, or $10 each and every year: interest = 0.10 × original balance At the same time, Cleo invests $100 at 5% compound interest.That is, interest is 5% of the current balance, including previous additions of interest: interest = 0.05 × current balance Cleo earns 5% of $100 the first year, giving her $105.The next year she earns 5% of $105, or $5.25, and so on.Write a program that finds how many years it takes for the value of Cleo’s investment to exceed the value of Daphne’s investment and then displays the value of both investments at that time. Here is the code I have written for this exercise, I'm not getting good results though. #include <iostream> #include <array> double Daphne(int, double, double); double Chleo(double, double); int main() { using namespace std; int p = 100; //Principle double i1 = 0.1; // 10% interest rate double i2 = 0.05; // 5% interest rate double dInv = 0; //Daphnes investment double cInv = 0; // Chleos investment int t=1; //Starting at year 1 double s1 = 0; //Sum 1 for Daphne double s2 = 0; // Sum 2 for Chleo s1 = p + 10; //Initial interest (base case after year 1) for Daphne s2 = p + (i2*p); //Initial interest (base case after year 1) for Chleo /*cout << s1 << endl; cout << s2 << endl;*/ while (cInv < dInv) { dInv = Daphne(p, i1, s1); cInv = Chleo(i2, s2); t++; } cout << "The time taken for Chleos investment to exceed Daphnes was: " << t << endl; cout << "Daphnes investment at " << t << " years is: " << dInv << endl; cout << "Chleos invesment at " << t << " years is: " << cInv << endl; system("pause"); return 0; } double Daphne(int p, double i, double s1) { s1 = s1 + (p*i); return s1; } double Chleo(double i, double s2){ s2 = s2 + (s2*i); return s2; } Output from console: The time taken for Chleos investment to exceed Daphnes was: 1 Daphnes investment at 1 years is: 0 Chleos invesment at 1 years is: 0 Press any key to continue . . . Can anyone explain why I'm getting this current result? The while loop is supposed to continue executing statements until Chleo's investment exceeds Daphnes.

    Read the article

  • Error using maven profiles

    - by user3127896
    I've added two profiles to my application and that how it looks: <profiles> <profile> <id>dev</id> <properties> <db.username>root</db.username> <db.password>root</db.password> <db.connectionURL>localhost:3306</db.connectionURL> <db.driverClass>com.mysql.jdbc.Driver</db.driverClass> </properties> </profile> <profile> <id>prod</id> <properties> <db.username>prodroot</db.username> <db.password>prodpass</db.password> <db.connectionURL>localhost:3306</db.connectionURL> <db.driverClass>com.mysql.jdbc.Driver</db.driverClass> </properties> </profile> </profiles> In my jdbc.properties file i changed values like this: jdbc.driverClassName=${db.driverClass} jdbc.dialect=org.hibernate.dialect.MySQLDialect jdbc.databaseurl=jdbc:mysql://${db.connectionURL}/dbname jdbc.username=${db.username} jdbc.password=${db.password} And here's bean from spring-container.xml <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close" p:driverClassName="${jdbc.driverClassName}" p:url="${jdbc.databaseurl}" p:username="${jdbc.username}" p:password="${jdbc.password}" /> When i try to deploy my application i got following error: SEVERE: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'dataSource' defined in ServletContext resource [/WEB-INF/spring-servlet.xml]: Could not resolve placeholder 'db.driverClass' Structure of project: Any ideas what i'm doing wrong? Thanks in advance!

    Read the article

  • From Dictionary To File Python

    - by user3600560
    I am basically trying to write this information from my dictionary to this file. I have this dictionary named files = {} and it is for a filing system I am making. Anyhow it is always being update with new items, and I want those items to be uploaded to the file. Then if you exit the program the files are loaded back to the dictionary files = {}. Here is the code I have so far: file = {} for i in files: g = open(i, 'r') g.read(i) g.close() EDIT I want the contents of the dictionary to be written to a file. The items inside the dictionary are all stored like this: files[filename] = {filedate:filetext} where filename is the file's name, filedate is the date that the file was made on, and the filetext is the files contents.

    Read the article

  • php regex replace slashes and spaces and hyphens

    - by Muhammad Shahzad
    I have fews combinations of strings that I need to bring in to one pattern, that is multiple spaces should be removed, double hyphens should be replaced with single hypen, and single space should be replaced with single hyphen. I have already tried this expression. $output = preg_replace( "/[^[:space:]a-z0-9]/e", "", $output ); $output = trim( $output ); $output = preg_replace( '/\s+/', '-', $output ); But this fails in few combinations. I need help in making all of these combinations to work perfectly: steel-black steel- black steel black I should also remove any of these as well "\r\n\t".

    Read the article

  • making a password-only auth with bcrypt and mongoose

    - by user3081123
    I want to create service that let you login only with password. You type a password and if this password exists - you are logged in and if it's not - username is generated and password is encrypted. I'm having some misunderstandings and hope someone would help me to show where I'm mistaken. I guess, it would look somewhat like this in agularjs First we receive a password in login controller. $scope.signup = function() { var user = { password: $scope.password, }; $http.post('/auth/signup', user); }; Send it via http.post and get in in our node server file. We are provided with a compare password bcrypt function userSchema.methods.comparePassword = function(candidatePassword, cb) { bcrypt.compare(candidatePassword, this.password, function(err, isMatch) { if (err) return cb(err); cb(null, isMatch); }); }; So right now we are creating function to catch our http request app.post('/auth/signup', function(req, res, next) { Inside we use a compair password function to realize if such password exists or not yet. So we have to encrypt a password with bcrypt to make a comparison First we hash it same way as in .pre var encPass; bcrypt.genSalt(10, function(err, salt) { if (err) return next(err); bcrypt.hash(req.body.password, salt, function(err, hash) { if (err) return next(err); encPass=hash; )}; )}; We have encrypted password stored in encPass so now we follow to finding a user in database with this password User.findOne({ password: encPass }, function(err, user) { if (user) { //user exists, it means we should pass an ID of this user to a controller to display it in a view. I don't know how. res.send({user.name}) //like this? How should controller receive this? With $http.post? } else { and now if user doesn't exist - we should create it with user ID generated by my function var nUser = new User({ name: generId(), password: req.body.password }); nUser.save(function(err) { if (err) return next(err); )}; )}; )}; Am I doing anything right? I'm pretty new to js and angular. If so - how do I throw a username back at controller? If someone is interested - this service exists for 100+ symbol passphrases so possibility of entering same passphrase as someone else is miserable. And yeah, If someone logged in under 123 password - the other guy will log in as same user if he entered 123 password, but hey, you are warned to make a big passphrase. So I'm confident about the idea and I only need a help with understanding and realization.

    Read the article

  • best way to add route under resource in Laravel 4

    - by passingby
    I would like know if there is a better way to add additional route aside from the default of resource in Laravel 4. I have this code below which is no problem with regard to the functionality, it's just that it seems to be long: <?php Route::group(array('before' => 'auth'), function() { # API Route::group(array('prefix' => 'api'), function() { Route::resource('projects', 'ProjectsController'); Route::resource('projects.groups', 'GroupsController'); Route::post('/projects/{projects}/groups/{groups}/reorder', 'GroupsController@reorder'); }); }); If in Rails Rails.application.routes.draw do # API namespace :api, defaults: { format: 'json' } do scope module: :v1 do resources :projects do resources :groups do member do post :reorder end end end end end end

    Read the article

  • Strange Behaviour in Swift: constant defined with LET but behaving like a variable defined with VAR

    - by Sam
    Stuck on the below for a day! Any insight would be greatly appreciated. The constant in the first block match0 behaves as expected. The constant defined in the second block does not behave as nicely in the face of a change to its "source": var str = "+y+z*1.0*sum(A1:A3)" if let range0 = str.rangeOfString("^\\+|^\\-|^\\*|^\\/", options: NSStringCompareOptions.RegularExpressionSearch){ let match0 = str[range0] println(match0) //yields "+" - as expexted str.removeRange(range0) println(match0) //yields "+" - as expected str.removeRange(range0) println(match0) //yields "+" - as expected } if let range1 = str.rangeOfString("^\\+|^\\-|^\\*|^\\/", options: NSStringCompareOptions.RegularExpressionSearch){ let match1 = str[range1] println(match1) //yields "+" as expected str.removeRange(range1) println(match1) //!@#$ OMG!!!!!!!!!!! a constant variable has changed! This prints "z" } The following are the options I can see: match1 has somehow obtained a reference to its source instead of being copied by value [Problem: Strings are value types in Swift] match1 has somehow obtained a closure to its source instead of just being a normal constant/variable? [Problem: sounds like science fiction & then why does match0 behave so well?] Could there be a bug in the Swift compiler? [Problem: Experience has taught me that this is very very very rarely the solution to your problem...but it is still in beta]

    Read the article

  • LIMIT amount of rows fetched by JOIN

    - by user892134
    How do i LIMIT the child rows fetched to only 5? Here is the SQLfiddle http://sqlfiddle.com/#!2/bd96a/2. Right now it fetches all rows with parentid='4' and parentid='14'. It should only fetch 5 of each parentid. Assuming i have hundreds of rows, it should only fetch a max of 5 for each parentid. "SELECT child.* FROM mytable as parent LEFT JOIN mytable as child on child.parentid=parent.id WHERE parent.pageid IN ( 1, 2) AND parent.submittype='1' ORDER BY child.id ASC"; How do i solve this?

    Read the article

  • Having issues with div layouts

    - by Chowderhound
    new here and I'm crossing fingers for help. I'm working on http://www.catgriz.com On the frontpage I have a slideshow that stacks all of the information on top of itself when you initially visit the page. But after a simple browser refresh, it displays correctly. I was hoping someone could look at it and point me in the right direction of what I've done wrong. I'm using Joomla with a Yootheme. Thank you so much in advance!

    Read the article

  • jQuery if checkbox is checked to toggle classes

    - by Lynx
    I am needed to change my jQuery code up. Instead of the label toggling the class and showing the icon I need it to where if the checkbox is checked to show to toggle those classes. I have tried prop and is but I couldn't get them to work properly. The reason for the change is I want to preload data into the form and if it's going to be checked those toggles need to reflect that change. http://jsfiddle.net/70fbLooL/2/ EDIT Seems to be confusion as to exactly what I am trying to do. The fiddle I provided works perfectly fine. The problem is if I want to call the form from server-side and pre-populate the form the checkbox toggles will not show that they are checked because it's based on the clicked function. I need it to be based on if the checkbox equal true or checked. That way if the value equals true from the server-side call it will toggle those classes and look like it's checked.

    Read the article

  • How to add model entity property in WCF RIA service

    - by Oblomingo
    I'm developing silverlight app with WCF Ria service. I'm using MS SQL database and Entity Framework as ORM framework (Database first method). Model with domain service are in separate project - App1.Data. Silverlight and generated model proxy classes are in App1 project. I want to add property to model entity class EntityClass to get this property on client side. So I did it that way - added this class to project App1.Data: public partial class EntityClass { [DataMember] public List<EntityClass2> PropertyName {get; set;} } After rebuilding EntityClass proxy on client side doesn't have this new property. Where is my mistake?

    Read the article

  • Libreoffice Calc run macro with HYPERLINK

    - by Kurt Borno
    I'm trying to use hyperlinks instead of buttons to run Basic macros. It seems to be more natural to me because hyperlinks are directly connected to a cell and buttons are not. I'm using the following Formula: =HYPERLINK("vnd.sun.star.script:Standard.Module1.Test?language=Basic&location=document";"Check") It should call the Subroutine Test placed in the document's macros under Standard.Module1 and display the Text 'Check' in the Cell it is written. This works absolutely fine with libreoffice 3.6.1.2 but it doesn't work at all with version 4.1.4.2. I can't see any errors it just happens nothing at all. I tried to simply click the Hyperlink and also to hold CTRL and click it. Same result - nothing. When I use a button the macro works as expected. Does anyone know how to solve this problem?

    Read the article

  • Recurring payment, receiving transaction_id

    - by Dmitry Velesnitsky
    What is the data paypal returns if we make recurring payments through a Subscription button on the website? How can we get transaction_id? It's that we want our users to pay with credit cards with no need to register, but so far we can't get transaction_id to get the information for automatic processes on the website directly. Instead we have to manage it all through paypal account. How can we avoid it?

    Read the article

  • JSON object array to store data of a form in local storage temporary (PhoneGap project)

    - by Nadeesha
    I am building a data aqusition system using PhoneGap. .I am trying to store my form data temporary on local storage using JSON,Data should be visible after I close and reopen the application (after pressing Get Data button),But after I close it only the lastly entered record is visible This is my code <!DOCTYPE html> <html> <head> <title>Household Profile DB storage</title> <meta charset="utf-8"> <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1,width=device-width" /> <link rel="stylesheet" href="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css"> <link rel="stylesheet" href="css/table.css"> <script type="text/javascript" src="js/jquery-1.9.1.min.js"></script> <script type="text/javascript" src="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js"></script> <script type="text/javascript" src="js/iscroll.js"></script> <script type="text/javascript" charset="utf-8"> function onDeviceReady() { persistData(homeId,owner,gramaND,contactNo,address,race); } function saveLocal(form){ if (window.localStorage) { var fhomeId = form.homeId.value, fowner = form.owner.value, fgramaND = form.gramaND.value, fcontactNo= form.contactNo.value, faddress = form.address.value, frace = form.race.value; alert("hi"); var highscores = [{"homeId": fhomeId, "owner":fowner, "gramaND":fgramaND, "contactNo":fcontactNo, "address":faddress, "race":frace}]; localStorage.setItem("highscores",JSON.stringify(highscores)); alert("The data has been stored successfully."); } else { alert("Your Browser does not support LocalStorage."); } } function readLocal(){ if (window.localStorage) { var scores =[]; //Get the highscores object scores = localStorage.getItem("highscores"); scores = JSON.parse(scores); for (i=0;i<scores.length;i++){ var text = "homeId :"+scores[i].homeId +"<br>"+ "owner:"+ scores[i].owner+"<br>"+ "address"+scores[i].address +"<br>"+ "gramaND"+scores[i].gramaND +"<br>"+ "contactNo"+scores[i].contactNo+"<br>" + '<Button value="DELETE" onclick="'+scores.splice(i, 0)+'><>/Button>'; var tbodyx = document.getElementsByTagName("tbody"); var tr=document.createElement("TR"); var td=document.createElement("TD"); td.innerHTML = text; tr.appendChild(td); tbody.appendChild(tr); } } } </script> </head> <body> <div data-role="page" id="page1"> <!--/header--> <div data-role="header" data-position="inline" data-theme="b"> <a href="#" data-icon="back" data-rel="back" title="Go back">Back</a> <h1>Household Profile</h1> <a href="index.html" data-icon="home">Menu</a> </div> <!--/header--> <div id="wrapper"> <form id="userInput" action ="" method="GET"> <div data-role="content"> <div data-role="fieldcontain"> <label > Home ID </label> <input class="inputClass" id="homeId" placeholder="H0001" value="" data-mini="true" type="text"> </div> <div data-role="fieldcontain"> <label > Owner </label> <input class="inputClass" id="owner" placeholder="Aberathne" value="" type="text"> </div> <div data-role="fieldcontain"> <label class="select">GramaNiladhari Division</label> <select class="inputClass" id="gramaND"> <option value="GramaNiladhari Division 1">GramaNiladhari Division 1</option> <option value="GramaNiladhari Division 2">GramaNiladhari Division 2</option> <option value="GramaNiladhari Division 3">GramaNiladhari Division 3</option> <option value="GramaNiladhari Division 4">GramaNiladhari Division 4</option> </select> </div> <div data-role="fieldcontain"> <label > Contact No </label> <input class="inputClass" id="contactNo" placeholder="071-9545-073" value="" type="number"> </div> <div data-role="fieldcontain"> <label >Address:</label> <textarea cols="40" rows="8" class="inputClass" id="address"></textarea> </div> <div class="ui-block-a"><button type="submit" data-theme="d">Location in a Map</button></div> <div data-role="fieldcontain"> <label >Race</label> <select class="inputClass" id="race"> <option value=" Sinhalese"> Sinhalese</option> <option value=" Sri Lanka Tamils"> Sri Lanka Tamils</option> <option value=" Moors"> Moors</option> <option value=" Indian Tamils "> Indian Tamils </option> <option value=" Malays "> Malays </option> <option value=" Burghers "> Burghers </option> </select> </div> <input class="buttonClass" type="button" value="Insert Data" onclick="saveLocal(this.form);"> </div> </form> </div> <input class="buttonClass" type="button" value="get Data" onclick="readLocal();"> <!-- <p id="dhomeId"></p> <p id="downer"></p> <p id="dgramaND"></p> <p id="dcontactNo"></p> <p id="daddress"></p> <p id="drace"></p>--> <table border="1"> <tbody id="tbody"> <tr><td>test1</td></tr> <tr><td>test2</td></tr> </tbody> </table> </div> </body> </html> Also I need to expand my code to edit and delete record from local storage.

    Read the article

  • Devise: Allow users to edit their account without providing a password BUT also use 'reconfirmable' functionality

    - by Betjamin Richards
    I've been following this how-to in the Devise wiki... How To: Allow users to edit their account without providing a password ...to enable my users to change the account credential and update without providing their existing password. However, I also want to use the Confirmable modules reconfirmable functionality Even though I have config.reconfirmable = true set in my devise initializer file the controller doesn't seem to be sending the reconfirmable emails. Any ideas what's wrong?

    Read the article

  • Gradle + Robolectric: Where do I put the file org.robolectric.Config.properties?

    - by Rob Hawkins
    I'm trying to setup a test using Robolectric to click on a menu button in this repository. Basic Robolectric tests will run, but I'm not able to run any project-specific test using resources because it says it can't find my AndroidManifest.xml. After running ../gradlew clean check, here's the standard output from the Robolectric html file: WARNING: No manifest file found at ./AndroidManifest.xml.Falling back to the Android OS resources only. To remove this warning, annotate your test class with @Config(manifest=Config.NONE). I found these instructions which indicate I should create an org.robolectric.Config.properties file, but I'm not sure where to put it. I've tried everywhere, pretty much, and despite moving the file, the path in the error message is always the same as above (./AndroidManifest.xml). This makes me think the build process has never picked up the settings in the file org.robolectric.Config.properties. I also tried the @Config(manifest="") directive but this gave me a cannot find symbol error. If I move the AndroidManifest.xml into my project directory, then I get an error about it not being able to find the path ./res/values and I wasn't able to resolve that either. Any ideas? Update 1 Thanks Eugen, I'm now using @RunWith(RobolectricGradleTestRunner.class) instead of @RunWith(RobolectricTestRunner). Now I get a different error, still occurring on the same line of my BasicTest.java KeywordList keywordList = Robolectric.buildActivity(KeywordList.class).create().get(); Below are results from the standard error, standard output, and "failed tests" tab in the Robolectric test report: Note: I also tried substituting in a jar built from the latest Robolectric updates, robolectric-2.2-SNAPSHOT.jar, but still got an error. Standard Error WARNING: no system properties value for ro.build.date.utc Standard Output DEBUG: Loading resources for net.frontlinesms.android from ~/workspace-studio/frontlinesms-for-android/FrontlineSMS/build/res/all/debug... DEBUG: Loading resources for android from jar:~/.m2/repository/org/robolectric/android-res/4.1.2_r1_rc/android-res-4.1.2_r1_rc-real.jar!/res... INFO: no id mapping found for android:drawable/scrollbar_handle_horizontal; assigning ID #0x1140002 INFO: no id mapping found for android:drawable/scrollbar_handle_vertical; assigning ID #0x1140003 INFO: no id mapping found for android:color/highlighted_text_dark; assigning ID #0x1140004 INFO: no id mapping found for android:color/hint_foreground_dark; assigning ID #0x1140005 INFO: no id mapping found for android:color/link_text_dark; assigning ID #0x1140006 INFO: no id mapping found for android:color/dim_foreground_dark_disabled; assigning ID #0x1140007 INFO: no id mapping found for android:color/dim_foreground_dark; assigning ID #0x1140008 INFO: no id mapping found for android:color/dim_foreground_dark_inverse_disabled; assigning ID #0x1140009 INFO: no id mapping found for android:color/dim_foreground_dark_inverse; assigning ID #0x114000a INFO: no id mapping found for android:color/bright_foreground_dark_inverse; assigning ID #0x114000b INFO: no id mapping found for android:layout/text_edit_paste_window; assigning ID #0x114000c INFO: no id mapping found for android:layout/text_edit_no_paste_window; assigning ID #0x114000d INFO: no id mapping found for android:layout/text_edit_side_paste_window; assigning ID #0x114000e INFO: no id mapping found for android:layout/text_edit_side_no_paste_window; assigning ID #0x114000f INFO: no id mapping found for android:layout/text_edit_suggestion_item; assigning ID #0x1140010 Failed Tests android.view.InflateException: XML file ~/workspace-studio/frontlinesms-for-android/FrontlineSMS/build/res/all/debug/layout/rule_list.xml line #-1 (sorry, not yet implemented): Error inflating class net.frontlinesms.android.ui.view.ActionBar at android.view.LayoutInflater.createView(LayoutInflater.java:613) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:82) at org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:272) at android.app.Activity.setContentView(Activity.java) at net.frontlinesms.android.activity.KeywordList.onCreate(KeywordList.java:70) at android.app.Activity.performCreate(Activity.java:5008) at org.fest.reflect.method.Invoker.invoke(Invoker.java:112) at org.robolectric.util.ActivityController$1.run(ActivityController.java:119) at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256) at org.robolectric.util.ActivityController.create(ActivityController.java:114) at org.robolectric.util.ActivityController.create(ActivityController.java:126) at net.frontlinesms.android.BasicTest.setUp(BasicTest.java:30) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:241) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:355) at org.gradle.internal.concurrent.DefaultExecutorFactory$StoppableExecutorImpl$1.run(DefaultExecutorFactory.java:66) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) at java.lang.Thread.run(Thread.java:680) Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createView(LayoutInflater.java:587) at android.view.LayoutInflater.createView(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:352) at android.view.LayoutInflater.inflate(LayoutInflater.java) at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:82) at org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.robolectric.bytecode.ShadowWrangler$ShadowMethodPlan.run(ShadowWrangler.java:455) at android.app.Activity.setContentView(Activity.java) at net.frontlinesms.android.activity.KeywordList.onCreate(KeywordList.java:70) at android.app.Activity.$$robo$$Activity_c57b_performCreate(Activity.java:5008) at android.app.Activity.performCreate(Activity.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.fest.reflect.method.Invoker.invoke(Invoker.java:112) at org.robolectric.util.ActivityController$1.run(ActivityController.java:119) at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256) at org.robolectric.util.ActivityController.create(ActivityController.java:114) at org.robolectric.util.ActivityController.create(ActivityController.java:126) at net.frontlinesms.android.BasicTest.setUp(BasicTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:241) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... 7 more Caused by: android.view.InflateException: XML file ~/workspace-studio/frontlinesms-for-android/FrontlineSMS/build/res/all/debug/layout/actionbar.xml line #-1 (sorry, not yet implemented): Error inflating class android.widget.ProgressBar at android.view.LayoutInflater.createView(LayoutInflater.java:613) at org.robolectric.shadows.RoboLayoutInflater.onCreateView(RoboLayoutInflater.java:38) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at net.frontlinesms.android.ui.view.ActionBar.<init>(ActionBar.java:65) at android.view.LayoutInflater.createView(LayoutInflater.java:587) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:82) at org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:272) at android.app.Activity.setContentView(Activity.java) at net.frontlinesms.android.activity.KeywordList.onCreate(KeywordList.java:70) at android.app.Activity.performCreate(Activity.java:5008) at org.fest.reflect.method.Invoker.invoke(Invoker.java:112) at org.robolectric.util.ActivityController$1.run(ActivityController.java:119) at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256) at org.robolectric.util.ActivityController.create(ActivityController.java:114) at org.robolectric.util.ActivityController.create(ActivityController.java:126) at net.frontlinesms.android.BasicTest.setUp(BasicTest.java:30) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:241) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) ... 7 more Caused by: java.lang.reflect.InvocationTargetException at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createView(LayoutInflater.java:587) at android.view.LayoutInflater.createView(LayoutInflater.java) at org.robolectric.shadows.RoboLayoutInflater.onCreateView(RoboLayoutInflater.java:38) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_onCreateView(LayoutInflater.java:660) at android.view.LayoutInflater.onCreateView(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_rInflate(LayoutInflater.java:749) at android.view.LayoutInflater.rInflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java) at net.frontlinesms.android.ui.view.ActionBar.<init>(ActionBar.java:65) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createView(LayoutInflater.java:587) at android.view.LayoutInflater.createView(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java) at android.view.LayoutInflater.$$robo$$LayoutInflater_1d1f_inflate(LayoutInflater.java:352) at android.view.LayoutInflater.inflate(LayoutInflater.java) at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:82) at org.robolectric.shadows.ShadowActivity.setContentView(ShadowActivity.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.robolectric.bytecode.ShadowWrangler$ShadowMethodPlan.run(ShadowWrangler.java:455) at android.app.Activity.setContentView(Activity.java) at net.frontlinesms.android.activity.KeywordList.onCreate(KeywordList.java:70) at android.app.Activity.$$robo$$Activity_c57b_performCreate(Activity.java:5008) at android.app.Activity.performCreate(Activity.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.fest.reflect.method.Invoker.invoke(Invoker.java:112) at org.robolectric.util.ActivityController$1.run(ActivityController.java:119) at org.robolectric.shadows.ShadowLooper.runPaused(ShadowLooper.java:256) at org.robolectric.util.ActivityController.create(ActivityController.java:114) at org.robolectric.util.ActivityController.create(ActivityController.java:126) at net.frontlinesms.android.BasicTest.setUp(BasicTest.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24) at org.robolectric.RobolectricTestRunner$2.evaluate(RobolectricTestRunner.java:241) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.robolectric.RobolectricTestRunner$1.evaluate(RobolectricTestRunner.java:177) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.runTestClass(JUnitTestClassExecuter.java:80) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassExecuter.execute(JUnitTestClassExecuter.java:47) at org.gradle.api.internal.tasks.testing.junit.JUnitTestClassProcessor.processTestClass(JUnitTestClassProcessor.java:69) at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.processTestClass(SuiteTestClassProcessor.java:49) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35) at org.gradle.messaging.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24) at org.gradle.messaging.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32) at org.gradle.messaging.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93) at com.sun.proxy.$Proxy2.processTestClass(Unknown Source) at org.gradle.api.internal.tasks.testing.worker.TestWorker.processTestClass(TestWorker.java:103) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) ... 7 more Caused by: java.lang.ClassCastException: org.robolectric.res.AttrData cannot be cast to org.robolectric.res.StyleData at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getParent(ShadowAssetManager.java:353) at org.robolectric.shadows.ShadowAssetManager$StyleResolver.getAttrValue(ShadowAssetManager.java:336) at org.robolectric.shadows.ShadowResources.findAttributeValue(ShadowResources.java:259) at org.robolectric.shadows.ShadowResources.attrsToTypedArray(ShadowResources.java:188) at org.robolectric.shadows.ShadowResources.access$000(ShadowResources.java:51) at org.robolectric.shadows.ShadowResources$ShadowTheme.obtainStyledAttributes(ShadowResources.java:460) at android.content.res.Resources$Theme.obtainStyledAttributes(Resources.java) at android.content.Context.obtainStyledAttributes(Context.java:374) at android.view.View.__constructor__(View.java:3297) at org.fest.reflect.method.Invoker.invoke(Invoker.java:112) at org.robolectric.shadows.ShadowView.__constructor__(ShadowView.java:68) at android.view.View.<init>(View.java:3295) at android.widget.ProgressBar.<init>(ProgressBar.java:253) at android.widget.ProgressBar.<init>(ProgressBar.java:246) at android.widget.ProgressBar.<init>(ProgressBar.java:242) at android.view.LayoutInflater.createView(LayoutInflater.java:587) at org.robolectric.shadows.RoboLayoutInflater.onCreateView(RoboLayoutInflater.java:38) at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.rInflate(LayoutInflater.java:749) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at net.frontlinesms.android.ui.view.ActionBar.<init>(ActionBar.java:65) at android.view.LayoutInflater.createView(LayoutInflater.java:587) at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687) at android.view.LayoutInflater.rInflate(LayoutInflater.java:746) at android.view.LayoutInflater.inflate(LayoutInflater.java:489) at android.view.LayoutInflater.inflate(LayoutInflater.java:396) at android.view.LayoutInflater.inflate(LayoutInflater.java:352) at org.robolectric.tester.android.view.RoboWindow.setContentView(RoboWindow.java:82) [truncated, hit stack overflow character limit...]

    Read the article

  • How can I convert spaces to tabs in Vim or Linux?

    - by cwd
    I've looked over several questions on Stack Overflow for how to convert spaces to tabs without finding what I need. There seem to be more questions about how to convert tabs to spaces, but I'm trying to do the opposite. In Vim I've tried :retab and :retab! without luck, but I believe those are actually for going from tabs to spaces anyways. I tried both expand and unexpand at the command prompt without any luck. Here is the file in question: http://gdata-python-client.googlecode.com/hg-history/a9ed9edefd61a0ba0e18c43e448472051821003a/samples/docs/docs_v3_example.py How can I convert leading spaces to tabs using either Vim or the shell?

    Read the article

  • Programmer Puzzle: Encoding a chess board state throughout a game

    - by Andrew Rollings
    Not strictly a question, more of a puzzle... Over the years, I've been involved in a few technical interviews of new employees. Other than asking the standard "do you know X technology" questions, I've also tried to get a feel for how they approach problems. Typically, I'd send them the question by email the day before the interview, and expect them to come up with a solution by the following day. Often the results would be quite interesting - wrong, but interesting - and the person would still get my recommendation if they could explain why they took a particular approach. So I thought I'd throw one of my questions out there for the Stack Overflow audience. Question: What is the most space-efficient way you can think of to encode the state of a chess game (or subset thereof)? That is, given a chess board with the pieces arranged legally, encode both this initial state and all subsequent legal moves taken by the players in the game. No code required for the answer, just a description of the algorithm you would use. EDIT: As one of the posters has pointed out, I didn't consider the time interval between moves. Feel free to account for that too as an optional extra :) EDIT2: Just for additional clarification... Remember, the encoder/decoder is rule-aware. The only things that really need to be stored are the player's choices - anything else can be assumed to be known by the encoder/decoder. EDIT3: It's going to be difficult to pick a winner here :) Lots of great answers!

    Read the article

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