Posts

Showing posts from September, 2014

android - Not scrolling screen -

i have layout file of screen in there gridview elements , lianerlayout lower in shall information on clicking elements in gridview output. here xml file: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearlayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="360dp" android:orientation="vertical" > <relativelayout android:id="@+id/header" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/calendar_top" > <relativelayout an

XSLT parser/content error xml to text for doctype cesAlign -

<?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform" version="1.0"> <xsl:output method="text" encoding="utf-8" /> <xsl:template match="linkgrp"> <xsl:value-of select="normalize-space()"/> <xsl:text>&#xa;</xsl:text> <!-- newline after sentences --> </xsl:template> </xsl:stylesheet> when attempt run above xslt stylesheet on following cesalign xml doc <?xml version="1.0" encoding="utf-8"?> <!doctype cesalign public "-//ces//dtd xml cesalign//en" ""> <cesalign version="1.0"> <linkgrp targtype="s" fromdoc="en/1976/7277/69682_1of1.xml.gz" todoc="zh/1976/7277/4041906_1of1.xml.gz"> <link id="sl0" xtargets=";1" /> <link id="sl1&quo

xml - Merge two Android projects so that both will appear on layout -

i have android project 2 modules. one banner advertisement , other application. how merge these projects banner ad show on every xml layout of project? i think best way creating baseactivity extends activity. create banner adview java code. extend baseactivity other activities using. here's sample code baseactivity import android.app.activity; import android.os.bundle; public class baseactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); createbanner(); } void createbanner() { //handle banner creation here } } if using fragments navigations have declare banner inside activity's layout xml

How to use selendroid with appium -

i have java maven project runs test of native app in real device using appium. trying use selendroid appium. set capability automationname selendroid , set selendroid port 8080 in appium. app getting launched click or tap not working. need set more. below error appium , code > starting node server > info: welcome appium v1.2.0 (rev e53f49c706a25242e66d36685c268b599cc18da5) > debug: non-default server args: {"address":"127.0.0.1","lognocolors":true,"platformname":"android","platformversion":"18","automation name":"selendroid"} > info: appium rest http interface listener started on 127.0.0.1:4723 > info: loglevel: debug > info: --> post /wd/hub/session {"desiredcapabilities": {"app":"c:\\users\\antony\\workspace\\appiumjustwink\\app\\justw

java - android change first blank to "AA" -

change first blank "aa" string = "a b c"; change string = "aaab c"; the answer clear a = a.replacefirst(" ", "aa"); try code,you may got expected answer, string str="a b c"; boolean a1 = true ; stringbuilder strbu = new stringbuilder(); for(int i=0 ; i<str.length();i++) { character b = str.charat(i); if(b.equals(' ') && a1 == true ) { a1 = false; strbu = strbu.append("aa"); } else { strbu = strbu.append(b); } } log.e("str","string:"+strbu.tostring());

html - separating <th> elements in a table -

Image
i trying make list of mobile phones website , actual problem @ screenshot here codes thml , css files <th> s must separated border picture : code: <html> <head> <title>mobile phones</title> <link rel="stylesheet" href="styles.css"> </head> <h1>emobile</h1> <div id="wid"> <input type="text" name="manuf" value="დასახელება"></br> <select> <option value="none">მწარმოებელი</option> <option value="nokia">nokia</option> <option value="mercedes">samsung</option> <option value="sony">sony</option> </select> </br> ფილტრაცია ფასით</br> დან:<input type="number" name="from" value="0"> მდე:<input t

Ruby on Rails: get variable from include do -

yesterday asked quiostion rails 4 enum , got answer. so have defined global status enum in #app/models/concerns/my_enums.rb this: module myenums extend activesupport::concern included enum status: [:active, :inactive, :deleted] end end now im trying defined properties in status enum controller, cannot access enum because initializes when module included , if include in controller i`ll error: undefined method `enum' homecontroller:class how can in controller(like product.statuses)? => {"active"=>0, "inactive"=>1, "deleted"=>2} you cannot include module controller. try: module myenums extend activesupport::concern statuses = [:active, :inactive, :deleted] included enum status: statuses end end and in controller: myenums::statuses

ios - Cocoapods podfile pod name -

i new cocoapods , ios development, , i'm trying set first pod file. i'm having hard time finding right name pod, example, pod 'googleplus' i added "googleplus" in podfile, since googleplus.framework name see in xcode panel on left, got unable find specification 'googleplus' error, after pod install. after long google search found out proper name googleplus 'google-plus-ios-sdk'. however, have more 30 dependencies name, , can't seem find clue on other dependency names. can please give me piece of advice? you can search pods in master repository on http://cocoapods.org

Linux process API using C# in Mono -

i know possible code c# .net apps in linux using mono. however, wondering process interfaces of linux. use services getpid() , getppid() , fork() using c# , mono , running on linux environment? for getpid() , getppid() use syscall in way: using system; using mono.unix.native; namespace stackoverflow { class mainclass { public static void main(string[] args) { int pid = syscall.getpid(); int ppid = syscall.getppid(); console.writeline ("pid: {0}", pid); console.writeline ("ppid: {0}", ppid); } } } you need mono.posix.dll for fork() can use process . see example here: creating child process c# documentation process class c# .

wordpress - Custom plugin wont load my CSS -

i'm creating wordpress plugin custom js , css. codes adding js file code perfectly, not css. css file in same folder plugin. heres how i'm attempting load them in: add_action( 'wp_enqueue_scripts', 'addjs' ); add_action('admin_enqueue_scripts', 'addcss'); function addjs() { wp_register_script( 'registeruser', plugins_url( 'registeruser.js', __file__ ) ); wp_enqueue_script( 'registeruser'); } function addcss() { wp_register_style( 'cafe', plugins_url('cafe.css')); wp_enqueue_style( 'cafe' ); } you need add __file__ css enqueue , using "admin" loads files on admin pages. unless want happen need use same call js files

web scraping - NameError: name 'hxs' is not defined when using Scrapy -

i have launched scrapy shell , have pinged wikipedia. scrapy shell http://en.wikipedia.org/wiki/main_page i confident step correct, judging verbose nature of scrapy's response. next, i'd see happens when write hxs.select('/html').extract() at point, error: nameerror: name 'hxs' not defined what problem? know scrapy installed fine, has accepted url destination, why there issue witht hxs command? i suspect using version of scrapy doesn't have hxs on shell anymore. use sel instead (deprecated after 0.24, see below): $ scrapy shell http://en.wikipedia.org/wiki/main_page >>> sel.xpath('//title/text()').extract()[0] u'wikipedia, free encyclopedia' or, of scrapy 1.0, should use selector object of response , it's .xpath , .css convenience methods: $ scrapy shell http://en.wikipedia.org/wiki/main_page >>> response.xpath('//title/text()').extract()[0] u'wikipedia, free encyclop

Specman DAC macro: How to define 2 inputs of different type (uint and string)? -

in verification environment have different registers' types same name differs index, e.g.: timer_load_0 , timer_load_1 etc.. try create macro gets 2 parameters: string (the 'name' of register without index) , uint (the register's index) , returns variable of "concatenated" register type. example command: my_idx : uint = 0; create_reg "timer_load" my_idx; will return variable timer_load_0 . my macro code : define <var_by_idx'action> "create_reg <name'any> <idx'exp>" computed { var idx : uint = <idx'exp>.as_a(uint); result = appendf("%s_%d",<name'any>, idx); }; the compilation error get: error: looking number found 'my_idx' @ line 45 in @macros var idx : uint = <idx'exp>.as_a(uint); during execution of define-as-computed macro: @ line 380 in @timer_monitor create_reg "t

angularjs - Jasmine/Karma not finding Angular modules -

i'm trying unit testing jasmine , karma, reason angular modules cannot found. i've modified code examples: karma.config.js: files: [ 'lib/angular.js', 'lib/angular-mocks.js', 'js/app.js', 'js/controllers.js', 'js/factories.js', 'tests/**/*.js' ] app.js: var app = angular.module('app', ['ngroute']); app.config(function ($routeprovider) { $routeprovider .when('/test', { templateurl: 'views/test.html', controller: 'testctrl' }) .otherwise({redirectto: '/'}); }); controllers.js: app.controller('testctrl', function ($scope, $location) { console.log('test controller'); $scope.isactive = function(route) { return route === $location.path(); }; }); test-spec.js: describe('testctrl testing', function () { var scope, $location, createcontroller; beforeeach(inject(function ($rootscope,

c# - Deserialize json string to a class using NewtonSoft.JSON -

this json string {\"currentdatetime\":\"21-09-2014 17:48:00\",\"currenttime\":\"17:48:00.2360971\"} i want convert class public class currentdatetimejson { public string currentdatetime { get; set; } public string currenttime { get; set; } } i using newtonsoft.json deserialize. following code deserialize var = jsonconvert.deserializeobject<currentdatetimejson>(jsonstring); i getting following error error converting value "{"currentdatetime":"21-09-2014 17:51:56","currenttime":"17:51:56.9643252"}" type 'currentdatetimejson'. edit code produces json public string getcurrentdatetimejson() { currentdatetime cdt = new currentdatetime() { currentdatetime = datetime.now.tostring(), currenttime = datetime.now.timeofday.tostring() }; string json = jsoncon

osx - Applescript not delaying in Automator -

i'm trying create scanner script. it's working in script editor, in automator delay not working. function executes instead. on imagecaptureopen() tell application "system events" (name of processes) contains "image capture" end imagecaptureopen on scanimage() tell application "system events" tell process "image capture" set scanwindow group 2 of splitter group 1 of window 1 set combobox combo box 1 of scroll area 1 of scanwindow if value of combobox number less 300 set value of combobox "300" if button "scan" of scanwindow exists click button "scan" of scanwindow end tell end tell end scanimage if not imagecaptureopen() tell application "image capture" activate delay 30 scanimage() else scanimage() end if any ideas why isn't working? you should've posted workflow well, because t

ios - Xcode Using XIBs to move non-modally to view controllers -

i have first app, uses storyboard. first view, can 8 model views deep before returning start. i think using xibs (not storyboards) better application. learn how views in code books , tutorials treat code black plague. hard learn if no 1 teaches anymore. my concern 8 deep modal string of views memory consumed each view , not released until fall start - releasing each 1 fall back. my application state machine (so want simple move 1 view another), releasing aspects of view being left. move 1 state next, release current view move next one. can point me in right direction? thanks. you have couple of choices. create custom container controller (which exist life of run), , switch out controller embedded in it. long have nothing pointing 1 replace, deallocated. a simpler solution, 1 don't use, replace window's root view controller next controller want go to, cause replaced 1 deallocated.

windows - batch code to transfer all files and folder from location(s) -

i looking batch code transfer files inside folders. transfer them location. d:\transfered files\ and keep exact folder/file names. for example want transfered c:\users\ c:\program files\ i have tried , works: xcopy source destination /y just save in batch file of course change directories see fit. also note '/y' parameter says if files exist in destination overwrite them. if remove it, ask each file separately. if think isn't enough can use robocopy: robocopy source destination again need change source , destination directories , put line in batch file. i have used both , both works 100%. have windows 7 home premium 64x.

php - Cannot get the full value of a URL passed in the query string -

i want send url page this: http://localhost/l.php?u=http://www.simplesite.com?view=photo&id=13 where url http://www.simplesite.com?view=photo&id=13 value of parameter u . in l.php file result looks this: echo $_get['u']; // http://www.simplesite.com?view=photo // &id=13 missing what wrong this? want redirect url http://www.simplesite.com?view=photo&id=13 , &id=13 part missing. i create links preg_replace . cannot apply php function $1 variable preg_replace("/(https?:\/\/[\w-?#&;~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"l.php?u=$1\">$1</a>",$text); try code: preg_replace_callback("/(https?:\/\/[\w-?#&;~=\.\/\@]+[\w\/])/i", function($m){ return "<a target='_blank' href='l.php?u=".urlencode($m[0])."'>".$m[0]."</a>"; }, $text); this replace links anchor tags & encode u

php - cant add new record in HABTM table -

i want add new record in table called tutorssubject. table created habtm relationship of tutor , subject. anyway load subject names in text box , can select subject name cant add new record. need set id of tutor_id. there 3 fields in tutorssubject table called id,tutor_id , subject_id. need select in 1 field subject_id list of names found in subject table, , set tutor_id manually. currently able select list of subject names cant add new record subject name , set tutor_id. error: sqlstate[23000]: integrity constraint violation: 1452 cannot add or update child row: foreign key constraint fails class tutorssubjectscontroller extends appcontroller { public function tutoradd() { $this->loadmodel('subject'); $options['recursive']=-1; $options['fields']=array('subject.name'); $te2= $this->subject->find('list',$options); debug($te2); $this->set( 'te',$te2); //put edit , po

java - Creating variables with names of strings -

i making api kind of thing school custom xml writer. have: public document createdocument(int loops, int attr, string data[], string dataattr[][][]) { document betterdoc = documenthelper.createdocument(); element root = betterdoc.addelement("root"); (int = 0; < loops; i++) { element(object) data[i] = root.addelement(data[i]) (int i2 = 0; < attr; i++) { .addatribute(dataattr[i][i2][0], dataattr[i][i2][1]) }; } return betterdoc; } the line want is: element(object) data[i] = root.addelement(data[i]) i want create element same name of data[i]. i using dom4j xml .jar in this, way. i have heard of called hashmap , if correct method, please explain how use it. you can't create dynamic variable unlike groovy, php or javascript, can create array or reuse existing variable: with existing variable: public document createdocument(int loops, int attr, string data[], string dataattr[][][]) {

xcode - "The C++ compiler "/usr/bin/c++" is not able to compile a simple test program." When trying to install OpenCV -

i'm trying install opencv on mac following link however, when type cmake -g "unix makefiles" .. on terminal, error printed. -- cxx compiler identification unknown -- c compiler identification unknown -- check working cxx compiler: /usr/bin/c++ -- check working cxx compiler: /usr/bin/c++ -- broken cmake error @ /opt/local/share/cmake-3.0/modules/cmaketestcxxcompiler.cmake:54 (message): c++ compiler "/usr/bin/c++" not able compile simple test program. it fails following output: change dir: /users/kwmaeng/desktop/opencv/build/cmakefiles/cmaketmp run build command:"/usr/bin/make" "cmtrycompileexec653545098/fast" make: error: unable find utility "make", not developer tool or in path cmake not able correctly generate project. call stack (most recent call first): cmakelists.txt:56 (project) -- configuring incomplete, errors occurred! see "/users/kwmaeng/desktop/opencv

Glassfish: Error in linking security policy for -

i got error while restarting or re-deploying app glassfish , exception below: com.sun.enterprise.admin.cli.commandexception: remote failure: exception while loading app : org.glassfish.deployment.common.deploymentexception: error in linking security policy appname -- inconsistent module state what should solve issue? after googling couple of hours found replies , 1 worked me: remove application folder placed under policy folder: rm -rf /opt/sun-glassfish/glassfish/domains/domain1/generated/policy/appname then redeploy , restart glassfish. it should work.

windows - How to use a batch file to check WinService Status? -

i created winservice , set start , stop on scheduled tasks. everyday after service started 20 seconds, automatically stops without alert though in scheduled task did setup re-starting if starting fails. therefore, have re-start service manually everyday morning. now, want write batch file can implement following tasks: check winservice running if not in 1), start service write record 1) , 2). appreciate if can provide walk-through procedure it. @echo off set "sevice_name=winservice" sc query "%sevice_name%" | find /i "running" || ( echo service "%sevice_name%" stopped sc start "%sevice_name%" goto :end ) >> log.txt :end echo service "%sevice_name%" running >> log.txt

apache - .htaccess Mask Domain and hide url -

i trying subdomain show contents of domain, ability go area of other domain i.e. directories so example client go "sub.domain-one.com" or more "sub.exampledomain.com/client_name". show content of "domain-two.com", development server, without client knowing. i if possible keep base domain of "sub.domain-one.com" stay on live server can keep index.php on server. wish :) my current code is options +followsymlinks rewriteengine on rewritecond %{request_uri} !^(sub.)?domain-one.com/$1 rewritecond %{http_host} ^(sub.)?domain-one.com rewriterule ^(.*) http://domain-two.com/$1 [p,nc] this code seems work extent (it let me go sub.domain-one.com if go sub.domain-one.com/client_name redirect browser url domain-two.com/client_name need hidden :( thanks heaps in advanced james you need use proxypassreverse in order rewrite redirects proxied site site proxying from . unfortunately, can't in htaccess file. in server/vhost config

ruby - How to get Nokogiri to install on Ubuntu 14.04 64-bit -

this when try install nokogiri on ubuntu 14.04 64-bit. /usr/local/bin/ruby extconf.rb building nokogiri using packaged libraries. *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/usr/local/bin/ruby --help --clean --use-system-libraries <internal:lib/rubygems/custom_require>:29:in `require': no such file load -- openssl (loaderror) <internal:lib/rubygems/custom_require>:29:in `require' /usr/local/lib/ruby/1.9.1/net/https.rb:92:in `<top (required)>' <internal:lib/rubygems/custom_require>:29:in `require' <internal:li

java - How to return the new value of a public String from a private void JButton? -

i have public string in 1 class , used other classes. value of string can acquired use of jbutton . code seems right still null returned button. below class containing public string variable , code jbutton : public class seminar_menu extends javax.swing.jframe { connection conn = null; resultset rs = null; preparedstatement ps = null; // public string mentioned in quesiton public string seminar_choosen; ...... //button code private void jbutton3actionperformed(java.awt.event.actionevent evt) { conduct_seminar consem = new conduct_seminar(); seminar_menu semen = new seminar_menu(); string message = "conduct seminar?"; string title = "conduct"; int reply = joptionpane.showconfirmdialog(null, message, title, joptionpane.yes_no_option); if (reply == joptionpane.yes_option) { seminar_choosen = title_field.ge

Accuracy: C++11's binomial_distribution<int> not coincide with the what R returns -

i need generate samples in c++ follow hypergeometric distribution. but, case can approximate binomial distribution without problem. thus i'd use std implementation in c++11. if generate many samples @ calculate probability different values 1 r tells me. more, difference not smaller when increase number of samples increases. parameters same r , c++. thus question: why not same results , can do/which should trust? see below, r , c++ code. c++ program calculates difference r values. if let program run quite while numbers don't smaller wiggle around e-5, e-6, e-7 magnitude. r: dbinom(0:2, 2, 0.48645948945615974379) #0.26372385596962805154 0.49963330914842424280 0.23664283488194759464 c++: #include <iostream> #include <iomanip> #include <random> using namespace std; class generator { public: generator(); virtual ~generator(); int binom(); private: std::random_device randev; std::mt19937_64 gen; std::binomial_distribution&

c# - Select a part of string when find a character -

i need select part of string ,suppose have string : hello::hi , i use characters :: separator, need separate hello , hi .i using c# application form . i googled ,i found substring didn't me. best regards string.split right method, syntax little tricky when splitting based on string versus character . the overload split on string takes input array of strings can distinquished overload takes array of characters (since string can cast array of characters), , adds parameter stringsplitentries , can set none use default option (include "empty" entries): string source = "hello::hi"; string[] splits = source.split(new string[] {"::"}, stringsplitoptions.none);

java - How to make eclipse only complete the auto complete IF pressed ENTERED .. Not Dot or Space -

good day dears .. as far know have searched relative question didn't find anything. searching answer while on internet no luck. i using eclipse developing java .. happy using auto complete features build in in eclipse .. 1 thing bother me .. if writing variable name , pressed dot or space .. eclipse automatically pick first choice don't want. the question .. there way make auto complete take place if entered has been pressed? thanks guys .. well .... have found answer myself , other ... check https://bugs.eclipse.org/bugs/show_bug.cgi?id=348857#c12 just copy jar far eclipse/dropins -folder it should work great after restart eclips ..

c - Infinite "Signal 11 being dropped" loop with Valgrind while trying to add to linked list -

i'm trying create simple singly linked list in c, , have encountered infinite "singal 11 being dropped" loop while running program in valgrind. my .h file: #ifndef test_h #define test_h struct fruit { char name[20]; }; struct node { struct fruit * data; struct node * next; }; struct list { struct node * header; unsigned count; }; #endif my .c file: #include "test.h" #include <stdio.h> #include <string.h> void init_list(struct list my_list) { my_list.header = null; my_list.count = 0; } void add_to_list(struct list my_list, struct fruit my_fruit) { struct node my_node; struct node nav_node; my_node.data = &my_fruit; my_node.next = null; if(my_list.count == 0) { /* set head node if list empty */ my_list.header = &my_node; my_list.count++; } else { nav_node = *my_list.header; while (nav_node.next != null) { /* traverse list until end */

Highlight old post on wordpress -

how highlight old post on wordpress, have site has thumbnails of videos. want have older videos gray out or have div style opacity main focus of viewer new post. possible? test posts many days old date (in case 46 days) <?php $mylimit=46 * 86400; //days * seconds per day //$post_age = date('u') - get_post_time('u'); $post_age = date('u') - mysql2date('u', $post->post_date_gmt); if ($post_age < $mylimit) { echo 'this post within date limit '; } ?> also can use plugins old post notifier or old posts highlighter .

php - Aramex Rate calculator APT returning error code "ISE01" -

the aramex rate calculator api returning error code ise01 , and following error message: internal server error has occurred while getting calculating rate` while requesting what reason error? the following sample code aramex rate calculator api: <?php $params = array( 'clientinfo' => array( 'accountcountrycode' => 'jo', 'accountentity' => 'amm', 'accountnumber' => '00000', 'accountpin' => '000000', 'username' => 'user@company.com', 'password' => '000000000', 'version' => 'v1.0' ), 't

image - Parsing Dicom results with Python -

Image
i'm trying parse results page dicom study. i've tried pydicom parses "header" info (patient info, device info, etc.). i'd extract numeric results study in text format. in following example: i'd text these lines: r eia 1.13m/s 53 0.14m/s 53 r cfa 0.69m/s 53 0.11m/s 53 etc... is there way parse data in python or other language text, degree of accuracy? i've tried grabbing pixeldata pydicom, dump tiff format , performing ocr. results quite good, 6's , 3's confused 8's. thanks! m as data stored pixel-data not attached report , dont have choice choose ocr values or can ask device manufacturer if modality can produce these values sr/pdf report study , devices .

forms - Javascript Two calculators on one site -

hi have code on site` <body> <script> function calcresult() { document.getelementbyid('result').innerhtml = ''; var num1 = new number(document.getelementbyid('txt1').value); var num2 = new number(document.getelementbyid('txt2').value); if (isnan(num1) || isnan(num2)) { alert('one or both inputs not number'); } else { document.getelementbyid('result').innerhtml = num1 * num2; } } window.onload = function() { document.getelementbyid('btncalc').onclick = calcresult; } </script> <div> enter value 1 <input type="text" id="txt1" /> <br />enter value 2 <input type="text" id="txt2" /> <br /> <button id="btncalc">calculate diff

java - How to make launcher chooser pop up even the default launcher is set -

i doing launcher app now, may know how make launcher chooser pop default launcher set? know possible choose 2 default launchers in jelly bean or above version, teach me how that? thanks. my code below:- intent selector = new intent(); selector.setaction(intent.action_main); selector.addcategory(intent.category_home); selector.addflags( intent.flag_activity_clear_when_task_reset ); activity.startactivity(selector); try following: intent selector = new intent(); selector.setaction(intent.action_main); selector.addcategory(intent.category_home); selector.addflags( intent.flag_activity_clear_when_task_reset ); startactivity(intent.createchooser(selector, "select app:")); hope helps!

ejb - Deploying Java @Schedule with Wildfly 8.1.0 Final -

i trying test @schedule annotation following code: import javax.ejb.schedule; import javax.ejb.singleton; import javax.ejb.startup; @singleton @startup public class timertest { public timertest() { } @schedule(second = "*", minute = "*", hour = "*") public void sayhello() { system.out.println("hello"); } } however, when deploy standalone instance of wildfly 8.1.0 (final) getting following error messages in logs: 2014-09-23 08:38:03,076 error [org.jboss.msc.service.fail] (msc service thread 1-4) msc000001: failed start service jboss.deployment.unit."test-server.war".component.timertest.ejb3.timerservice: org.jboss.msc.service.startexception in service jboss.deployment.unit."test-server.war".component.timertest.ejb3.timerservice: failed start service @ org.jboss.msc.service.servicecontrollerimpl$starttask.run(servicecontrollerimpl.java:1904) [jboss-msc-1.2.2.final.jar:1.2.2.final]

sql - Grouping by month using a date column (DD.MM.YYYY HH24:MI:SS) -

i trying create monthly report easy review , comparison of runtimes of processes. the raw data needed stored in oracle 11g database table, runtime being difference between startdate , enddate both formatted dd.mm.yyyy hh24:mi:ss . one dateset created each run of process, there huge number of them stored in table (several datasets per process per hour). now pretty straight forward using group by clause, however, couldn't work in case. due date columns being involved special format. is there possibility group data sets month stored within startdate column? tried using oracle date functions found via googling, e.g. month() , extract() , far didn't anywhere it. i appreciate hints regarding issue. thanks in advance , best regards, dazza to dates month in oracle can convert part string , use this: select to_char(startdate, 'yyyymm') startmonth, .... ... group to_char(startdate, 'yyyymm');

SQl - select columns and group them -

i have table below , need result when run query results title | count ---------------- foo | 3 bar | 2 table customer_id | title ------------------- 55 | foo 22 | foo 55 | bar <-- duplicate 23 | bar 55 | bar <-- duplicate 23 | foo update thank quick response! the trick count distinct customer ids, won't count double foo customer 55. if need to, can order results count too, or can leave out order by clause. select title, count(distinct customerid) `count` yourtable group title order `count` desc

Javascript in Lightslider jquery plugin not working -

i having problem. not able jquery plugin lightslider work in page working on. i pretty sure missing obvious, kind of new. current using twitter bootstrap well. here html: <section> <div ckass="row"> <div class="col-md-12"> <div class="clearfix" style="padding:20px;background-color:#f6f6f6;"> <ul id="lightslider" class="list-unstyled clearfix csdemo cs-hidden" > <li> <h3>first slide</h3> <p>lorem ipsum cupidatat quis pariatur anim.</p> </li> <li> <h3>second slide</h3> <p>lorem ipsum excepteur amet adipisicing fugiat velit nisi.</p> </li> </ul> </div> </div> </div> </section> and here js <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="js/lightslider.js"></

sql - Very Simple Insert From Select Not Working? -

all did remake table , add null constrants , default values on columns: original table structure (now renamed): create table "cartweights_old" ( entrytime datetime, employee text, plugs numeric, id integer primary key, po numeric, fuser integer, reman integer, oem integer, digitek integer, lexmark integer, pdw integer, trash integer, cart text, "voided" bool not null default 0 ) the new table: create table cartweights ( entrytime datetime, employee text, plugs numeric not null default 0, id integer primary key, po numeric, fuser integer not null default 0, reman integer not null default 0, oem integer not null default 0, digitek integer not null default 0, lexmark integer not null default 0, pdw integer not null default 0, trash integer not null default 0, cart text, "voided" bool not null default 0 ) then when try run: insert cartweights select * cartweights_o

qt - Qt5Cored.lib(Qt5Cored.dll) : module machine type 'x64' conflicts with target machine type 'X86' -

i in jenkins. i'm using cmake configuring project makefile generator: visual studio 12. after have solution file - * .sln. next step building project using msbuild. run command line arguments -/p:"visualstudioversion=12.0". while step prorocessing message: > qt5cored.lib(qt5cored.dll) : fatal error lnk1112: module machine type 'x64' conflicts target machine type 'x86' i tried using makefile generator : visual studio 12 win64 , there more failures. after tried run msbuild parameter /p:"platform=x64" failed - "debug|x64" invalid. i have qt x64 platform , machine x64 too. have right paths qt in cmake_prefix_path . have no idea else do:c i solve problem: install qt x86 , works:))

rest - Spring OAuth 2: public access to a resource -

how allow public access in specific url in spring security oauth-2 rest application. i have urls started /rest/** secured, make /rest/about public, not require user authenticate access it. tried using permitall() still requires token in request. httpsecurity configuration: @configuration @enableresourceserver protected static class resourceserverconfiguration extends resourceserverconfigureradapter { @override public void configure(resourceserversecurityconfigurer resources) { resources.resourceid(resource_id); } @override public void configure(httpsecurity http) throws exception { http .authorizerequests() .antmatchers("/rest/about").permitall() .antmatchers("/rest/**").authenticated() ; } } a request /rest/about still returns 401 unauthorized - "error":"unauthorized","error_description":"full authentica

git - Failed commit in SmartGit -

i did commit (& push) in smartgit not connected internet. represented red cross in smartgits "output"-window. text reads: unable access ' _____ ': not resolve host: ' _____ '. after did successful commit of other files , successful push. do need fix something? failed commit happened earlier mess things or ok? everything fine. should see 2 commits in outgoing view. once connected internet, invoke push , commits transmitted server.

java - Does a ClassLoader load a complete package when there is a wildcard? -

how java classloader load imports import java.util.* ? asking, because have custom classloader asked load package instead of class. example: public class<?> loadclass(string classname) throws classnotfoundexception { system.out.println(classname); return parent.loadclass(classname); } example output: org.test.model.user org.test.model org.test.model so seems whole package requested (may due import org.test.model.* ?) not sure if imports causing (and how handle it) or if fine , should way. in advance! note: question seems root of actual problem . edit out of answer below understand classes loaded when referenced , import statement not important. anyhow, why packages (like " org.test.model " in example above) being loaded? or such request mean? 'import' syntactic sugar. when code gets compiled bytecode, classes referenced complete package.name

Background jobs that run on every request on Heroku and node.js -

i have app needs run long process (takes 30-60 seconds each request). after processing, result returned request response. works fine locally, crashes heroku instance. what i'd happen instead is: user comes on site, request sent backend backend returns immediately, , kicks off process/task/job processing when processing ends, response returned correct user. i not sure need this. based on hour-long research, seems can use redis queue , worker can poll every x minutes. can't understand how figure out request send response after processing ends. is there sample express/node.js this? pointers helpful. like found in research, setting worker queue using redis approach long running processes. nice library kue (https://github.com/learnboost/kue) . when comes responding request results of job, having outanding requesting hanging waiting response not way go (and may not work, heroku kills requests have been idle period of time). what when request made start ba

html - Meaning of JavaScript form validation code? -

i have explain how specific javascript code validates web form, stuck of features do, section of code. understand first line defines rest of section should run if field field1 of form exampleform left empty, not know purpose rest of code serves. know msg variable created earlier in document empty default value, , result variable default value of true. can me out explaining each line does? if (document.exampleform.field1.value=="") { msg+="you must enter name \n"; document.exampleform.name.focus(); document.getelementbyid('field1').style.color="red"; result = false; } in plain english: if document form field value equal empty string, set error message msg , focus on element, , give red color user knows it's error, , set result false, whatever you're going use later in code/function.

java - How to update tree node size with custom model? -

Image
i using custom model in jtree . when label of node changes, passing treemodelevent listeners in following way: protected void firenodechanged(treepath path) { treemodelevent evt = new treemodelevent(this, path); for(treemodellistener listener : listeners) { listener.treenodeschanged(evt); } } where path path changed node, including itself. this causes title change, size of not: swing truncates title , adds ellipsis (pointed red arrow). how fix this? note have custom model , can't call nodechanged , should emulate it. without snippet there several guesses make, situation seems familiar me. try adding renderer jtree performs updateui() on rendering component before returning it: tree.setcellrenderer(new defaulttreerenderer() { public component gettreecellrenderercomponent(jtree tree, object value, boolean selected, boolean expanded, boolean leaf, int row, bool

gcc - Why gcov will cause program crash? -

i using gcov test program (add " -fprofile-arcs -ftest-coverage ") on linux , program crash after start: (gdb) bt #0 0x00000034e433386f in __strlen_sse42 () /lib64/libc.so.6 #1 0x000000000053c57a in __gcov_init () #2 0x000000000053c4b9 in _global__i_65535_0_g_st_rerun_cmd_param () @ source/rerun/aicent_ara_rerun.c:963 #3 0x000000000053dc26 in __do_global_ctors_aux () #4 0x0000000000403743 in _init () #5 0x00007fff6d6b3ce8 in ?? () #6 0x000000000053db55 in __libc_csu_init () #7 0x00000034e421ecb0 in __libc_start_main () /lib64/libc.so.6 #8 0x0000000000404449 in _start () from __gcov_init() source ( http://www.coreboot.org/~stepan/coreboot-coverage/lib/libgcov.c.gcov.html ) , ...... size_t filename_length = strlen(info->filename); ...... i can see root cause " info->filename " invalid (after disassembling code, address 0x57c4ac00000000 , , indeed invalid). i don't know how analyse bug, give clues? in advance! p.s. linux enviro