Posts

mysql - C3P0ConnectionProvider error when deploying on JBoss -

i'm attempting connect mysql database via jpa on jboss server. i following exception when deploying project. 13:04:41,035 error [org.jboss.msc.service.fail] (msc service thread 1-1) msc00001: failed start service jboss.persistenceunit."dryrun.war#dbname": org.jboss.msc.service.startexception in service jboss.persistenceunit."dryrun.war#dbname": failed start service @ org.jboss.msc.service.servicecontrollerimpl$starttask.run(servicecontrollerimpl.java:1767) [jboss-msc-1.0.2.ga.jar:1.0.2.ga] @ java.util.concurrent.threadpoolexecutor.runworker(threadpoolexecutor.java:1145) [rt.jar:1.7.0_15] @ java.util.concurrent.threadpoolexecutor$worker.run(threadpoolexecutor.java:615) [rt.jar:1.7.0_15] @ java.lang.thread.run(thread.java:722) [rt.jar:1.7.0_15] caused by: javax.persistence.persistenceexception: [persistenceunit: dbname] unable build entitymanagerfactory @ org.hibernate.ejb.ejb3configuration.buildentitymanagerfactory(ejb3configuration.java:914) @ org.hiber...

.net - how do I obtain or create a .srprofile file when nuget doesn't create it? -

to configure , use many features of specrun (beefed version of specflow, cucumber .net), need sort of .sfprofile file. file " default.sfprofile " supposedly , (i assume) typically created when nuget package installed. did not me. is there way trigger creation of " default.sfprofile "? if not, if create myself? if work, please post initial contents of file should be? thanks! the template file in packages\specrun.specflow.1.2.0\content\default.srprofile.pp copy , replace {...} placeholders values. projectid guid.

c++ - How to test/verify that zero-initialization takes place -

i trying test 0 initialization on virtual machine g++ options -std=c++98, -std=c++03, -std=c++11 unfortunately there not many garbage values , see zeros in place shouldn't be. how force random values can test this? #include <iostream> #include <string> using namespace std; class { public: int a; }; class b { public: b(){} int x; }; int main() { { int tab[50000] = {0}; } a; a* aa = new a; b b; b* bb = new b; cout << a.a << endl; cout << aa->a << endl; cout << b.x << endl; cout << bb->x << endl; return 0; } you not guaranteed see random numbers. c/c++ standard says uninitialized values undefined, cannot values have. 0 ok (maybe virual machine zeros memory before allocating). if need random numbers, generate them using <random>

iphone - sqlite file path created using iOS - UIWebView -

in application using sqlite uiwebview store user preferences , details. moving functionality in native objective-c code, , want preserve defaults when application updated. i thinking of accessing .sqlite file objective-c code , transfer preferences in nsuserdefaults . can .sqlite files created uiwebview , whats default location ? if you're on simulator, db files here: /users/<your-user>/library/application\ support/iphone\ simulator/user/applications/<your-app-id>/library/webkit/databases/file__0/<database-name> on device, try: /var/mobile/applications/<your-app-id>/library/webkit/databases/file__0/<database-name>

React Native allow user to reorder elements in a scrollview list -

i'm trying let user reorder elements in scrollview list long-pressing on 1 of elements. we're trying let user use long press pick element of scrollview list, , put element somewhere else in list. have working using animated view, issue it's difficult integrate scrolling , swipe-to-delete animated view. we're hoping add "pick , reorder" scrollview. is there preferred method accomplishing this? touchablewithoutfeedback has onlongpress method, can implement this: _onlongpress() { // perform sort }, <touchablewithoutfeedback onlongpress={ () => this._onlongpress() }> <text>click , hold call onlongpress</text> </touchablewithoutfeedback> as far sorting, can use type of library such lodash or underscore, plus there ways sort using vanilla javascript. check out this thread. i've set basic project using sort function on listview here . https://rnplay.org/apps/mpbktg 'use strict'; var react = requ...

node.js - Webpack/TypeScript Raising Errors When node_modules is Excluded -

Image
i have following webpack , typescript configs: webpack.config.js module.exports = { entry: { dev: './src/ts/site' }, output: { filename: './com/js/site.js' }, resolve: { extensions: ['', '.ts', '.tsx'] }, module: { loaders: [ // typescript { test: /\.tsx?$/, loader: 'ts-loader' } ] } } tsconfig.json { "compileroptions": { "noimplicitany": true, "module": "commonjs" } } i've simplified project include following dependencies: package.json (partial) "typescript": "^1.7.5", "ts-loader": "^0.7.2", "webpack": "^1.12.9" when run webpack, massive slew of errors: the list goes on many many screen lengths, far i've scrolled every 1 duplicate identifier err...

ruby - Why did I get `main.using is permitted only at toplevel` when I used a Refinement in IRB? -

i tried use refinement in irb (v0.9.6, ruby 2.3.0): module foo refine object def foo() "foo" end end end using foo # => runtimeerror: main.using permitted @ toplevel this the exact setup documentation (which results in same error). what went wrong? how fix this? it's either bug or misfeature of irb. well-known due pretty hackish way irb implemented, not behave correctly corner-cases. the incompatibility knows in ruby, methods defined @ top-level become private instance methods of object , whereas in irb, become public instance methods of object . obvious behavioral difference in irb, require_relative doesn't work, because searches relative current file, in irb, there is no current file. there differences in syntax gets accepted, believe, , local variables , when , aren't defined. so, not inconceivable there might behavioral differences wrt. refinements. in fact, myself have encountered error message, , running exact same c...

c# - Coroutine stops working -

i have 2 scripts coroutine in them. works fine in first one, not in second one, no apparent reason. it works in one: using system.collections; using unityengine; using unityengine.ui; using unitystandardassets.imageeffects; public class gamestartcontroller : monobehaviour { public button startbutton; public gameobject cubespawner; // use initialization private void start() { startbutton = startbutton.getcomponent<button>(); } public void startgame() { enablecubespawner(); spawnstartingcubes(); hidestartmenu(); startcoroutine("focuscamera"); playbackgroundmusic(); } // enables cube spawner, can start spawning cubes private void enablecubespawner() { cubespawner.setactive(true); } private void spawnstartingcubes() { cubespawner.getcomponent<cubespawner>().generatestartingcubes(); } private void playbackgroundmusic() { var audio...

parse.com - Android - Parse - deleteInBackground, record not being deleted -

i'm using parse android in order sync data. i'm trying delete object stored in parse cloud via callback returns , there's no exception, logcat message "deleted". but object still exists in table when check parse data. tasttoedit object task class (configured locally in app). parseobject parse_task = new parseobject("task"); parse_task.put("description",tasttoedit.getdescription()); parse_task.put("duedate",tasttoedit.getduedate()); parse_task.put("priority",tasttoedit.getpriority().ordinal()); int com_state = (tasttoedit.getcompleted()) ? 1 : 0; parse_task.put("iscompleted",com_state); parse_task.put("location",0); parse_task.put("category",tasttoedit.gettask_catg().ordinal()); parse_task.put("status", tasttoedit.gettask_sts().ordinal()); //parse_task.deleteinbackground(); parse_task.deleteinbackground(new deletecallback() { ...

javascript - Sorting Azure Mobile Services API -

i want return sorted table rest service, getting last record, doing wrong here? ideally want limit records returned, example top 100 ? thank you rest: https://restname.azure-mobile.net/api/test exports.get = function(request, response) { var collectionofvotes = request.service.tables.gettable('country'); collectionofvotes.orderbydescending('countryname') .read({ success: function(results) { results.foreach(function(r) { response.send(r); //console.log(r); }); }}); }; you're calling method response.send every record returned query . since 1 request sent, 1 of responses returned. if want send records back, should send results passed success callback. also, can limit number of records returned using take method in table / query object, shown below. exports.get = function(request, response) { var collectionofvotes = request.service.tables.gettable('country'); collectionofvotes.orderby...

asp.net - C# Delegate, Label text not changing -

i have created delegate each time click button text within label's text should change reason not work , label's text not change. this aspx page: <body> <form id="form1" runat="server"> <div> <asp:button id="btnfeed" onclick="btnfeed_click" runat="server" text="button" /> <asp:label id="lblraceresults" runat="server" text="label"></asp:label> </div> </form> </body> this aspx.cs page using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; namespace webprogramming3.week_3 { public partial class exercise1 : system.web.ui.page { //only testing static person test_person; static person person2; static person person3; protected void page_load(object sender, eventargs e) ...

Description for URL in Google Sitemap -

is possible specify description url-element in google sitemaps? example (see description-tag): <url> <loc>http://www.example.com/dogs</loc> <description>this page dogs, can find new products dogs here.</description> <changefreq>hourly</changefreq> <priority>1.00</priority> <image:image> <image:loc>http://www.example.com/image.jpg</image:loc> </image:image> </url> <url> <loc>http://www.example.com/cats</loc> <description>this page cats, can find new products cats here.</description> <changefreq>hourly</changefreq> <priority>1.00</priority> <image:image> <image:loc>http://www.example.com/image.jpg</image:loc> </image:image> </url> thank you! second support of google sitemaps can submit rss or atom file (a xml) sitemap. in rss or atom file can put description url. ca...

c++ - How can I define RAND_MAX -

how create program generates ten random numbers 1 -> rand_max ? rand_max must number input user. int main() { using namespace std; int x; int y; random: { x = rand(); cout << x << endl; } y = y + 1; if (y == 10) { return 0; } goto random; } something like: int main() { int randmax; cin >> randmax; (int y = 0; y < 10; y++) { int x = rand() % randmax; // range = [0, randmax) cout << x+1 << endl; // range = [1, randmax] } } oh, , try avoid goto (at least in opinion). here two questions it.

spring - Return Object from controller to ajax -

code below succesfully send string jsp via ajax controller , returning string. how send (from controller ajax) object contains getter , setter or boolean? ajax: $.ajax({ type: 'get', url : 'register/checkusername', data : {'typedtext' : typedtext}, success : function(data) { $('#doesusernameavailable').text("ok " + data); }, error: function(){ $('#doesusernameavailable').text('error'); } }); controller: @requestmapping(value = "/checkusername", method = requestmethod.get) public @responsebody string checkusername(string typedtext, httpservletresponse response){ //some code return boolean or object return "text controller"; } solution: i not post pom.xml. missing: <dependency> <groupid>com.fasterxml.jackson.core</groupid> <artifactid>...

scala - Functional Tests in Play 2.4.6 when using compile time DI -

i'm using play 2.4.6 compile time dependency injection , scalatest. controller's constructor has few parameters, , in applicationloader create it. here code: class bootstraploader extends applicationloader { def load(context: context) = { new appcomponents(context).application } } class appcomponents(context: context) extends builtincomponentsfromcontext(context) ningwscomponents { lazy val router = new routes(httperrorhandler, authenticationcontroller, applicationcontroller, assets) lazy val applicationcontroller = new controllers.application() lazy val authenticationcontroller = new controllers.authentication()(configuration, wsapi.client) lazy val assets = new controllers.assets(httperrorhandler) } class authentication(implicit configuration: configuration, val ws: wsclient) extends controller { def login = action { implicit request => unauthorized(s"${redirecturl}") } } class authenticationspec extends playspec oneapppersuite { ...

reactjs - PropType validation is throwing an error because of RoutingContext -

i'm getting following error props validating: warning: failed proptype: required prop assettype not specified in assetmanagementshow . check render method of routingcontext . warning: failed proptype: required prop assettypes not specified in assetmanagementtransactionsfecher . check render method of routingcontext . routes this: <route path='asset_management' component={assetmanagementcontainer} > <indexroute component={assetmanagementindex} /> <route path=':name' component={assetmanagementtransactionsfetcher}> <indexroute component={assetmanagementshow} /> <route path=':transactionkey' component={transactionsshow} /> </route> </route> i'm getting error when trying render assetmanagementshow (and transactionsshow). i'm getting error props of both assetmanagementtransactionsfetcher , assetmanagementshow. the assetmanagementcontainer fetches data , renders chi...

opencart2.x - Opencart Login Issues -

i unable login opencart dashboard. can see login screen , enter passwords. did fresh install. doesn't redirect me dashboard. have read , tried every possible solution. there on server blocking re-direct. this caused .htaccess redirect. happened me because website getting redirected www.example.com session example.com. make sure have same version of url everywhere.

Encoding dec char instead of octal -

i not understand why char test = '\032'; converts to 26 dec '\032' seems interpreted octal, want treated decimal number. i think confused character encoding. can clarify me , give me hint on how convert way want it? in c, '\octal-digit' begins octal-escape-sequence . there no decimal-escape-sequence . code use: char test = 32; to assign value of 32 char , code has many options: // octal escape sequence char test1 = '\040'; // \ , 1, 2 or 3 octal digits char test2 = '\40'; // hexadecimal escape sequence char test3 = '\x20'; // \x , 1 or more hexadecimal digits // integer decimal constant char test4 = 32; // 1-9 , 0 or more decimal digits // integer octal constant char test5 = 040; // 0 , 0 or more octal digits char test6 = 0040; char test7 = 00040; // integer hexadecimal constant char test8 = 0x20; // 0x or 0x , 1 or more hexadecimal digits char test9 =...

sql - Retrieve all records sharing duplicate value from a column -

i return records table share duplicate values given specific column, in case bin column. create table #tempcompany (companyid varchar(6), name varchar(50),bin varchar(6)) insert #tempcompany (companyid,name,bin) select '000001','abc company','000000' union select '000002','def company','000001' union select '000003','ghi company','000001' union select '000004','jkl company','000002' union select '000005','lmn company','000003' union select '000006','opq company','000003' union select '000007','rst company','000003' drop table #tempcompany i return result: companyid name bin 000002 def company 000001 000003 ghi company 000001 000005 lmn company 000003 000006 opq company 000003 000007 rst company 000003 you can using window functions: select tc.* (select tc.*, count(*) on (par...

java - @RestController("/xxx") maping is ignored -

i'am trying create simple, annotation based rest service have 2 distinct endpoints endpoints specified value of @restcontroller annotations. problem url provided in annotations ignored. @restcontroller("/books") public class booksapi { @requestmapping("/getbook") public string getbook() { return "book"; } @restcontroller("/movies") public class moviesapi { @requestmapping("/getmovie") public string getmovie() { return "movie"; } } @configuration @enablewebmvc @componentscan(basepackages = "application.webservices.apis") public class apiconfiguration { } public class apisservletdispacher extends abstractannotationconfigdispatcherservletinitializer { @override protected class<?>[] getrootconfigclasses() { return new class<?>[] {apiconfiguration.class}; } @override protected class<?>[] getservletconfigclasses() { return new class<?>[0]; } @override protected str...