Posts

Showing posts from May, 2013

java - Android Type mismatch help. Convert ArrayList to List? -

ok.. might hard follow.. app saves contacts sqlite database named contacts. contactactivity should load in sqlite database , create custom listview allows selection of multiple contacts via toggle button. the example following create custom lv allowing multiple selections has local contact class. running problems converting external dao contact class local contact class. contact.java dao class: package dto; /** * dto describes contact can create , respond survey * @author barnitek, bosticsa * */ public class contact { private int id; private string firstname; private string lastname; private string phonenumber; public contact(){ } public contact(int id, string firstname, string lastname, string phonenumber){ this.id = id; this.firstname = firstname; this.lastname = lastname; this.phonenumber = phonenumber; } public contact(string firstname, string lastname, string phonenumber){ this.firstname = firstname; this.lastname = lastname; th

java - Maven multi modules tomcat deployment , module missing -

i have 2 module in parent pom. project depends on b project. followed here in project , added b project dependency. ok in build path, see b project under maven dependencies. <dependency> <groupid>mygroup</groupid> <artifactid>b</artifactid> </dependency> but when deploy project tomcat(mvn tomcat7:deploy ,or redeploy) , project deployed b project(packaging jar) wasn't deployed. (also tried system scope , target jar file systempath) i didn't understand issue, did miss something? (using tomcat8 , no eclipse specific answer please.) can try mvn install , manually copy generated war tomcat7 folder. maybe wrong tomcat7 maven plugin. additional information: in .m2 repository there wasn't project b's jar , installed , changed tomcat7 plugin solution alternetive maven war plugin , configured outputfolder tomcat8's webapps folder, works charm.

clearcase ucm - change the mastership of my stream to be able to deliver to parent stream -

i have following error when try deliver stream b parent stream a : cleartool: warning: trigger "dlvr_start_precondition" has refused let deliver_start proceed. cleartool: error: deliver_start preop trigger not allow operation. cleartool: error: unable integration. cleartool: error: unable deliver stream "a" was indicated change mastership of stream temporary able deliver parent stream. stream on different server parent stream. i see can done with: multitool chmaster –stream [ –ove·rride ] master-replica-selector stream-selector in case should following command? multitool chmaster –stream b the multitool chmaster man page mention: -str/eam [ -ove/rride ] master-replica-selector stream-selector ... transfers mastership of specified streams , associated objects replica specified master-replica-selector . specify stream-selector in following form: stream-selector [stream:]stream-name[@vob-selector] use -override option

linux - Deal with different directories in bash cron -

the problem... i use trick77's ip blacklist script configure firewall of apache server , able run script in terminal. however, when assigning bash script in ipset-blacklist crontab, not run no matter do. code written in crontab file root: @daily /var/bash/update-blacklist.sh what think culprit... since haven't done sort of thing before, believe path of bash script isn't set correctly... again, i'm not sure. i have seen others using line such path=/usr/bin:/bin:/usr/sbin:/sbin resolve problems involving script's location, but, don't know does. i set location of bash file /var/bash instead of /usr/bin , believe throwing things off. pardon lack of understanding. beginner when comes bash. any appreciated. what have done... per @etanreisner: added echo here >> /tmp/update-blacklist.out top of update-blacklist.sh , set cron run every minute ( * * * * * ). the file created. added type -p curl grep egrep ipset >> /t

javascript - create nested divs with siblings using jquery -

it's been couple of days i'm struggling this, guys give me hand. i need create dom looks this. <div id="nestedaccordion"> <h2>walt disney world</h2> <div> <h3>magic kingdom</h3> <div> <ol> <li>one</li> </ol> </div> <h3>epcot</h3> <div> <ol> <li>two</li> </ol> </div> <h3>hollywood studios</h3> <div> <ol> <li>three</li> </ol> </div> </div> </div> i've tried: $('#sidebar') .append($('<div/>').attr('id', 'nestedaccordion').html('<h2>walt disney world</h2>') .append($('<div/>').html('<h3>magic kingdom

.net - ProtoBuf-Net to do raw read -

i want have simple piece of code iterate through random stream of protocol buffers, , print out contents without having explicit understanding of structural contents. equivalent xmlreader.read() inside while loop using (protobuf.protoreader protoreader = new protobuf.protoreader(stream1, null, new protobuf.serializationcontext { })) { protoreader.readfieldheader(); while (protoreader.wiretype != protobuf.wiretype.none) { switch (protoreader.wiretype) { case protobuf.wiretype.fixed64: console.writeline(protoreader.readint64()); break; case protobuf.wiretype.fixed32: console.writeline(protoreader.readint32()); break; case protobuf.wiretype.startgroup: console.writeline(protoreader.readint32()); break; default: console.writeline(protoreader.wiretype); break; } } } however don't know how advance protocol bu

Capping each member in an r array -

i'm new r , have losses data: losses=c(25,250,5,17,2,195,12,8,75,5,50,1); how cap each member of list @ 150? namely how perform min(150,x) each member of list? then want cap losses @ 'amount of insurance' array: aoi=c(150,250,100,125,300,200,80,250,100,350,500,120) see ?pmin , or parallel minima calculation: pmin(150,losses) #[1] 25 150 5 17 2 150 12 8 75 5 50 1 if need multiple times, beneficial collect variables in data.frame or list . e.g.: dat <- data.frame(losses,aoi) data.frame(map(pmin,dat,150)) # losses aoi #1 25 150 #2 150 150 #3 5 100 #etc...

node.js - Sorting in asynchronous code -

i working on system match volunteers have freeunits (slots of time when free) workunits (slots of times per x number of volunteers required). the algorithm wish implement sort workunits possible freeunits (workunit.time == freeunit.time) ascending , match them freeunits in order -- want populate workunits hardest fill first. to accomplish this, workunit model has method possiblefreeunit returns list of freeunit can devoted workunit. possiblefreeunit: function(next) { var freeunits = array(); freeunit.find() .populate("owner") .where({slot: this.slot}) .exec(function(err, units){ next(units); }); } i use # of possible freeunits in sort function, orders workunits number of possible freeunits ascending. workunit.find() .populate("owner") .then(function(workunits) { sails.log("before sort"); workunits.sort(function(a, b){ a.possiblefreeunit(function (afreeunits){ b.possiblefreeunit(function

jquery - Prevent enter key from triggering button -

Image
i have search input box when user presses enter needs nothing. using emberjs , jquery below code. works disable pop being triggered reason in ie9 when enter pressed toggle button becomes in focus. works fine in chrome. i've tried tabindex , preventdefault neither trick. if ($el.hasclass('form-control')) { if ( e.which == 13) { this.get('controller').flipit(); } } thank you. edit------ here snippet of page. when user hit enter within search box button right getting highlighted. how prevent this? do this $("#inputbox").on('keydown', function(event) { if (event.key == "enter") event.preventdefault(); });

mql - Modifying order returns error 130 -

i'm trying modify order, keep error modifying order!, error#130. i'm using ecn broker, need modify order set stoploss/takeprofit. doing wrong? int digits = marketinfo( symbol(), mode_digits ); if ( digits == 2 || digits == 3 ) pipdigits = 0.01; else if ( digits == 4 || digits == 5 ) pipdigits = 0.0001; selltakeprofit = ask + ( takeprofit * pipdigits ); sellstoploss = ask - ( stoploss * pipdigits ); ticket = ordersend( symbol(), op_sell, lotsize, ask, 100, 0, 0, 0, 0, 0, clr_none ); if ( ticket < 0 ) { print( "venda order send failed error #", getlasterror() ); print( "stop loss = ", sellstoploss ); } else { print( "order send sucesso!!" ); print( "balance = ", accountbalance() ); print( "equity = ", accountequity() ); bool res = ordermodify( ticket, 0, sellstoploss, selltakeprof

Basic python questino about import -

i trying run python (2.7.6) code, , compiler can't find "util" module. here line code: from util import getargs, write and error this: traceback (most recent call last): file "rs.py", line 11, in util import getargs, write importerror: no module named util i can't find util module anywhere, , pip install not recognize util, getargs, , write. how can fix problem? as of comments have pointed out, should utils (plural) , not util from utils import <your package>

asp.net mvc - Value cannot be null. Parameter name: items foreinkey in grid Kendo -

when create/update accout, after summited have error: "value cannot null. parameter name: items" on "columns.foreignkey(p => p.maquyen, (system.collections.ienumerable)viewbag.quyen, "maquyen", "quyen").title("quyền");" .columns(columns => // cột muốn hiển thị trên griwd { columns.bound(p => p.tendangnhap).title("tên quyền");//.clienttemplate("<b>#: idtest #</b>"); columns.bound(p => p.email).title("email"); columns.foreignkey(p => p.maquyen, (system.collections.ienumerable)viewbag.quyen, "maquyen", "quyen").title("quyền"); columns.bound(p => p.khoataikhoan).title("trạng thái tài khoản"); columns.template(@<text>sửa</text>).clienttemplate("<a class='k-button k-button-icontext' href='" + url.action("addaccout", "accoutmanagement") + "/#=tendangnhap#'

In Python (2.7), why is os.remove not identical to os.unlink? -

>>> import sys >>> sys.version '2.7.3 (default, mar 13 2014, 11:03:55) \n[gcc 4.7.2]' >>> import os >>> os.remove os.unlink false >>> os.remove == os.unlink true why that? isn't os.unlink supposed alias of os.remove? to answer question have dive bit details of how python interpreter works. might different in other python implementations. first let's start os.remove , os.unlink functions defined. in modules/posixmodule.c registered as: {"unlink", posix_unlink, meth_varargs, posix_unlink__doc__}, {"remove", posix_unlink, meth_varargs, posix_remove__doc__}, note function pointers both point posix_unlink in ml_meth member. for method objects, == equality operator implemented meth_richcompare(...) in objects/methodobject.c . it contains logic, explains why == operator returns true . a = (pycfunctionobject *)self; b = (pycfunctionobject *)other; eq = a->m

php - Get items in multidimensional array separately -

i have array ($myarray) this: print_r(array_values ($myarray)); result: array ( [0] => [1] => array ( [id] => 1 [name] => abc ) [2] => array ( [id] => 2 [name] => def ) ) i'm trying each id , name.. im trying this: foreach ($myarray $value) { foreach($value $result) { echo $result; } } i'm facing 2 problems: i php warning says: " invalid argument supplied foreach() on line 29 this line is: foreach($value $result) { i keys id , name place them in correct places. ways echo "1abc" , "2def" any idea? helping. basically, error triggered, since array in example (index 0 in particular) not array (most empty string/null ) being used inside foreach. since 1 of elements not array, check if array or not using is_array() : foreach($myarray $values) { if(is_array($values)) { echo $values['id'] . ' ' . $v

Python - Read and plot data from a .csv -

i have .csv full of gdp data year different countries. want read file , plot data of select few of countries in .csv file. far have: data = np.genfromtxt('the_data.csv', dtype=str, delimiter=',', names=none, usecols=np.arange(0,17)) which think lets me read data. how use matplotlib generate graph of gdp change on years, of countries? with open(the_data.csv) f: content = f.readlines() my_list=[] line in content: my_list.add(line.split(';') ) or use csv module https://docs.python.org/2/library/csv.html

javascript - When Loading html file with require.js error with extension -

i have file reg.html <label>name:</label> in require.config : requirejs.config({ paths: { reg:"/templates/reg.html" } }) when try load template : define('ng_start',["angular","jquery","reg"],function(an,$,template){ .... }) get /templates/registry.html.js?bust=1417489939824228.12310815788805 require.js:166 uncaught error: script error for: registry http://requirejs.org/docs/errors.html#scripterror how deleted js extension registry.html.js ? you need state "reg" module loaded text , not javascript module. see following details: https://github.com/requirejs/text your specific code should read: define('ng_start',["angular","jquery","text!reg"],function(an,$,template){ .... }) note : addition of text! in module definition requirements reg .

java - Why "class" cannot be use as tag name in JAXB -

i have pojo contain field need output xml tag name "class". using jersey 2.0, if client request json response, json object output correctly attribute name "class". however, if client request xml output, jersey fail http 500 internal error. checked statement causing error is @xmlelement(name = "class") private int vclass; removing xmlelement annotation , allow xml use vclass tag name work fine. how instruct jaxb use class tag name ?? why “class” cannot use tag name in jaxb you can use "class" tag name in jaxb. what issue hitting by default jaxb treats public properties mapped. since annotated field getting exception duplicate mapped property. exception in thread "main" com.sun.xml.internal.bind.v2.runtime.illegalannotationsexception: 1 counts of illegalannotationexceptions class has 2 properties of same name "vclass" problem related following location: @ public int forum2724

Jquery - Unable to retain <selected> & <input> latest values after page refresh -

i trying basic, proving harder anticipated. long story short, using ajax load content between product pages. on odd occasion user might refresh page (loading original) , refilling cart section below product section. i passing cart items between pages (and reloads) table of values written local storage , retrieved there. works fine, except...: problem: 'input' , 'selected' elements not keeping selected values, , instead revert whatever default selection is. i've isolated browser behavior, firefox keep selected values on reload (unless repeatedly reload). chrome , ie reset default on reload (as in whatever written select="selected" or value associated 'input' source html). how force instant attribute rewrite 'input' & 'selected' elements instant value changes? example: <select name="size" class="os0" onchange="calculatetotal()"> <option value="20" s

java - Connect wifi hotspot phone error: ENETUNREACH -

i have app, app connect 2 phone using hotspot send/recv file. 1 phone create hotspot (wifi hotspot ), connect hotspot phone using below code: msocket = new socket(); try { msocket.setreuseaddress(true); msocket.bind(null); msocket.setperformancepreferences(0, 1, 2); msocket.settcpnodelay(true); msocket.setsolinger(true, 0); msocket.setkeepalive(true); msocket.connect(new inetsocketaddress(mconnection.getserveraddress(), mconnection.getserverport()), socket_connect_timeout); //operation here.... } catch (socketexception e) { ((hotspotconnection)mconnection).getlocalip(); logutils.loge(log_tag, "init exception:" + e.tostring()); } catch (ioexception e) { logutils.loge(log_tag, "init exception:" + e.tostring());

Drupal 7 contextual filter and exposed filter in calendar views -

i've created calendar views wherein can see events i've created. add contextual filter(start_date_of_event) set date current on first load of page. working fine problem when put exposed filter(start_date_of_event) same field use in contextual filter, , tried run ? seems wont work. to further explain. below sample link : 1. contextual filter (working) : http://test.com/test-calendar-listing/2014-12 2. contextual filter , exposed filter (not working) :http://test.com/test-calendar-listing/2014-12?field_state_country_value=all&field_sample_method_of_delivery_tid=all&field_topics_tid=all&field_provider_type_value=all&field_event_status_value=1&field_start_date_value%5bvalue%5d%5bmonth%5d=11&field_start_date_value%5bvalue%5d%5byear%5d=2014 what did far used filter harmonizer no luck.i tried used hook_form_alter redirect page link want not working also. can please suggest best thing do? or things missing ? help.

python - Fill missing dates by group in pandas -

i need fill missing date down group. here code create data frame. want add date of fill column down far when date of fill column changes , until group 'name' changes. data = {'tdate': [20080815,20080915,20081226,20090110,20090131,20080807,20080831, 20080918,20081023,20081114,20081207,20090117,20090203,20090219,20090305,20090318,20090501], 'name': ['a','a','a','a','a','b','b','b','b','b','b','b','b','b','b','b','b'], 'fill': [nan,nan,20080915,nan,nan,nan,nan,nan,nan,20081023, nan,nan,nan,nan,20090219,nan,nan]} df = pd.dataframe(data, columns=['tdate', 'name', 'fill']) df current data frame tdate name fill 0 20080815 nan 1 20080915 nan 2 20081226 20080915 3 20090110 nan 4 20090131 nan 5 20080807 b

c preprocessor - When are C++ macros beneficial? -

the c preprocessor justifiably feared , shunned c++ community. in-lined functions, consts , templates safer , superior alternative #define . the following macro: #define succeeded(hr) ((hresult)(hr) >= 0) is in no way superior type safe: inline bool succeeded(int hr) { return hr >= 0; } but macros have place, please list uses find macros can't without preprocessor. please put each use-cases in seperate answer can voted , if know of how achieve 1 of answers without preprosessor point out how in answer's comments. as wrappers debug functions, automatically pass things __file__ , __line__ , etc: #ifdef ( debug ) #define m_debuglog( msg ) std::cout << __file__ << ":" << __line__ << ": " << msg #else #define m_debuglog( msg ) #endif

node.js - Grunt cli install error for windows -

i trying install grunt cli windows using command "npm install -g grunt-cli" getting bellow mentioned error message, please suggest me on this. ** npm err! error: connect econnrefused npm err! @ errnoexception (net.js:904:11) npm err! @ object.afterconnect [as oncomplete] (net.js:895:19) npm err! { [error: connect econnrefused] npm err! code: 'econnrefused', npm err! errno: 'econnrefused', npm err! syscall: 'connect' } npm err! npm err! if behind proxy, please make sure npm err! 'proxy' config set properly. see: 'npm config' npm err! system windows_nt 6.1.7601 npm err! command "c:\\program files (x86)\\nodejs\\\\node.exe" "c:\\program files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "grunt-cli" npm err! cwd c:\users\m1022339 npm err! node -v v0.10.33 npm err! npm -v 1.4.28 npm err! syscall connect npm err! code econnrefused npm err! errno eco

ios - Is it possible to change the text 'Video Too Long to Send' in message when using 'videoMaximumDuration' in 'UIImagePickerController'? -

Image
i'm using uiimagepickercontroller pick video(i'm limiting video length 1 minute) gallery. here code: - (void)chooseexistingvideo { cfstringref mtypes[1] = { kuttypemovie }; cfarrayref mtypesarray = cfarraycreate(cfallocatorgetdefault(), (const void**)mtypes, 1, &kcftypearraycallbacks); imagepickercontroller.mediatypes = (__bridge nsarray*)mtypesarray; cfrelease(mtypesarray); imagepickercontroller.sourcetype = uiimagepickercontrollersourcetypesavedphotosalbum; imagepickercontroller.videomaximumduration = 60.0f; imagepickercontroller.allowsediting = yes; [self presentviewcontroller:imagepickercontroller animated:yes completion:nil]; } when choose video 5 minutes length screen coming this: in screen possible change text of ' video long send ' message ' video long add ' or there way rid of entire message? i need valuable suggestions. please me. thanks in advance. please refer answer: iphone uiimagepick

c++ - Why is there no cdirent or sys/cstat -

i writing c++ code iterates through entries of directory , decided use dirent.h . since using c++, decided use c++ standard including c library files [i.e. prefixing library name c , removing .h @ end] without adding functionality decided compile program once see if there cdirent or sys/cstat . g++ threw error telling me these files not present #include <iostream> #include <cdirent> #include <sys/cstat> #include <sys/ctypes> using namespace std; int main() { } dummy.cpp:2:19: error: cdirent: no such file or directory dummy.cpp:3:21: error: sys/cstat: no such file or directory dummy.cpp:4:22: error: sys/ctypes: no such file or directory following advice given in page on standard c++ header files locate cstdio , cstdlib , ctime , brings me questions when c standard library file converted c++ standard library file? how should 1 include such files in program? page here talks standard , non standard header files. believe dirent.h standard libra

android - What about the installation process in gradle to run the project? -

i didn't know how use gradle.i downloaded gradle in link. https://www.gradle.org/downloads right using android eclipse.let me know gradle used in android eclipse or android studio? what installation process in gradle run project? android studio flexible gradle-based build system. contains gradle default. see this: https://developer.android.com/sdk/installing/studio.html for eclipse can use plugin. here's link: http://gradle.org/docs/current/userguide/eclipse_plugin.html

How to show specific point to show specific information in HighCharts -

i new highcharts , working on cricket app in have display run rate per on , number of wickets in over. if there wicket(s) in specific on want show ball(s) point , on hover or click point show information player , bowler etc. want can view link crichq graphs want same think in crichq graphs, don't know how do. please me out of issue. you can use point marker settings indicate wickets fell. e.g. make different colour , size. http://api.highcharts.com/highcharts#series.data.marker i process data follows: var ausdata = [ { x:1, y:1 }, { x:2, y:24, out:{num:2,names:['john','doe']} }, { x:3, y:5 }, { x:4, y:8 }, { x:5, y:22 }, { x:6, y:11 } ]; (var p in ausdata) { var point = ausdata[p]; if (point.out !== undefined) { point.marker = {fillcolor:'red',radius:4*point.out.num}; } else { point.marker = {radius:5}; } } this start basic info,

compulsory asterisk in textview android -

i using fields mandatory , using textview includesred colored asterisk my output: click link ! required output : click link ! i tried modify code,but didn't got expected result public void setcompulsoryasterisk(){ txt_name="name : "; string colored="*"; spannablestringbuilder strbuilder=new spannablestringbuilder(); strbuilder.append(txt_name); int start=strbuilder.length(); strbuilder.append(colored); int end=strbuilder.length(); strbuilder.setspan(new foregroundcolorspan(color.red), start, end, spannable.span_exclusive_exclusive); txtname.settext(strbuilder); } string txt_name="name "; string colored="*"; string colon = " : "; after append string colored, append string colon after it. voila.

"No printers are installed" printing from Excel via COM -

i have lotusscript code running in ibm domino 9.0 on 64-bit windows 2012 r2 server, uses com launch microsoft excel 2010, open workbook, print via pdfcreator (from pdfforge) convert workbook pdf. ibm domino running service under system user, excel , pdfcreator run under user when started code. this working fine until 2 days ago, pdfcreator started hanging on launch no reason i've determined. one of admins customer reinstalled excel , pdfcreator, , deleted windows user profile (though don't know user). pdfcreator starting ok, there have been several issues excel. i fixed excel issues changes code , os file system, problem when code tells excel print workbook, error occurs: microsoft excel: no printers installed. install printer click file tab, , click print. click no printers installed, , click add printer. follow instructions in add printer dialog box. this error occurs when trying print code. can launch excel admin user , print manually, 3 printers (including p

css - How can I have the text content of a div overflow in a HTML email template? -

Image
i'm working on html email template , thought done until figured out gmail , other e-mail clients strip out position css property. since writing html/css email readers going stone ages i'm little bit stuck on one. what want display score bar sort of progress bar, score text inside of it, this: this works fine until score becomes low , score text doesn't fit inside of blue container anymore. text gets cuts off so: and @ 0%: please note i'm not sure why word "score" still shows in last one. what want score text overlap red part when text long fit inside of blue container. my code follows: <div style="float: left;width: 70%;height: 30px;max-height: 30px;background-color: #f00;color: #fff;font-weight: bold;padding: 0px;font-size: 18px;"> <div style="float: left;width: 0%;height: 30px;max-height: 30px;margin: 0;padding: 0;background-color: #3c88a7;overflow: visible;"> <div style=&qu

PHP Singleton Class - Fatal error: Call to private MyObject::__construct() -

singleton class: <?php class db_singleton { const oracle_host = "someip"; const oracle_user = "validuser"; const oracle_pass = "validpass"; const oracle_db = "someip/dbname"; private static $instance; // stores oci_* instance private function __construct() { } // block directly instantiating private function __clone() { } // block cloning of object public static function call() { // create instance if not exist if(!isset(self::$instance)) { // oracle_* constants should set or // replaced db connection details self::$instance = oci_connect(self::oracle_user, self::oracle_pass, self::oracle_db); if(self::$instance->connect_error) { throw new exception('oracle connection failed: ' . self::$instance->connect_error); } } // return instance return sel

R: aggregating values between two time periods -

i have dataframe trades, along open times of these trades. i'm trying find equity @ time of trade. however, have equity @ beginning of each hour, i'm adding deposits/withdrawals between start of hour , time of trade equity. i have method doing loop, indicated below: (i in 1:nrow(tradedata)) { tradedata$equityusd [i] = hourlydata$equityusd[which(as.character(hourlydata$period) == min(hourlydata$period[as.character(hourlydata$period) >= as.character(tradedata$opentime [i])]))-1] #find equity of start of hour tradedata$equityusd [i] = tradedata$equityusd [i] + sum(tradedata$profitusd[tradedata$closetime <= tradedata$opentime[i] & tradedata$closetime >= tradehour$tradehour[i]]) #add profit realised closed trades before current trade, in current hour tradedata$equityusd [i] = tradedata$equityusd [i] + sum(currentnetdep$depositwithdrawal[currentnetdep$time <= tradedata$opentime [i] &curr

node.js - No description,No repository field,No readme data warning in time of installing Mocha -

i getting warning @ time of installing mocha in ubuntu npm warn package.json @ no description npm warn package.json @ no repository field. npm warn package.json @ no readme data my node version v0.10.33 , npm version 1.4.28 i install mocha using :npm install mocha and getting error when test code in node.js referenceerror: describe not defined how resolve error that's because package.json doesn't have description , respository fields nor have corresponding readme file. add those, , it'll fine. also, as getting referenceerror , that's because running test using node . should running follows: mocha -r spec -u bdd test.js edited: you should run based on installed mocha . for instance: root/ tests/test_index.js node_modules/mocha index.js then should do: ./node_modules/mocha/bin/mocha -r spec -u bdd tests/test_index.js

java - JOOQ class generation and gradle -

my question best way set build using gradle , jooq following constraints: i have: a basic gradle build file, 1 can use eclipse, jooq, postgres , hsql some 'core' java classes, including couple of enums, in eclipse project managed gradle several database schemata, each in own file (schema1.sql, schema2.sql, etc), in same project the excellent jooq library, , quite cool sqlfile utility hsqldb a combination of ant scripts , java programs following steps, in pretty handraulic fashion, , i'd automate. i want following functionality managed gradle: the core classes compiled each of database schema loaded postgres database (i know how in gradle) the jooq library generate classes each schema (i know how in gradle) using type mapping map database columns appropriate core class enums (i don't yet know how in gradle, because don't know how give jooq task access core classes) there appear several options in front of me, i'm not sure 1 best: option

animation - How to set a dynamic background in Android (just like Tumblr Login UI) -

i new android , having troubles setting dynamic background tumblr login ui, the link below got help. set animated .gif background android but works when load small-size animation, or have drop lots of frames of gif animation leads incoherence. if load frames cause outofmemoryerror, don't think it's right way. is tumblr uses gif animation or it's short video? i know twitter converts gifs mp4. video compression far better gifs leading smoother playback , reduced bandwidth , happy users :) using mp4s option? more on subject here.

GreenDao Android Studio -

i'm looking clear step-by-step explanation on how import greendao in android studio. i've used before in as, failed work again. there tutorials out there, don't seem apply latest version of as. when clone github, example project stuff etc. there way install greendaogenerator without these extras? just looking up-to-date step-by-step explanation. update: suggest using realm.io now! check out! :-) any appreciated! tested on android studio 2.0 with android studio 0.6.1+ (and possibly earlier) can add non android project android project module. using below method can have java modules( greendaogenerator ) , android modules in same project , have ability compile , run java modules stand alone java projects. open android project in android studio. if not have one, create one. click file > new module . select java library , click next. fill in package name , etc , click finish. should see java module inside android project. open build.gradle

javascript - Styling jQuery Validation error messages -

i've created form page using jade , being validated using jquery validation plugin. i style error messages, using bootstrap. use .has-error class , .has-success class. these have used on parent div class .form-group . more details here . i have been playing around errorclass, errorelement, errorcontainer, ... options, can't seem find right combination. missing here? this form: form#signupform.form-horizontal(method='post', action='') .form-group label.col-sm-2.control-label(for='firstname') | first name: .col-sm-10 input#firstname.form-control(type='text', placeholder='john',name='firstname') .form-group label.col-sm-2.control-label(for='lastname') | last name: .col-sm-10 input#lastname.form-control(type='text', placeholder='doe', name='lastname') .form-group .col-sm-2.control-label

php - SQL query count for each specified date -

i have sql query running on mysql database looks this... $count0 = $wpdb->get_results(" select *, count(*) totalvaluecount wp_rg_lead inner join wp_rg_lead_detail on wp_rg_lead.id=wp_rg_lead_detail.lead_id wp_rg_lead.form_id = '46' , cast(date_created date) >= current_date - interval '7' day , field_number = '18' group value "); foreach ( $count0 $page ) { echo $repid_field . ' - ' . $page->form_id . ' - ' . $page->value . ' - ' . $page->lead_id . ' - ' . $page->date_created.' - ' . $page->totalvaluecount. '<br/>'; what want return count each value each of previous 7 days, can results this... value | 01/01/2014 | 01/01/2014 | 01/01/2014 -------------------------------------------------- aa01 34 23 12 br65 3 65 65 yr76 45 12

QML model link to JSON data -

how link json stream qml model angularjs? in qml, have websocket object receives data server: websocket { id: socket url: "ws://3.249.251.32:8080/jitu" ontextmessagereceived: { var jsonobject = json.parse(message) } onstatuschanged: if (socket.status == websocket.error) { console.log("error: " + socket.errorstring) } else if (socket.status == websocket.open) { console.log("socket open"); } else if (socket.status == websocket.closed) { console.log("socket closed"); } active: false } in json have like: { items: [ "foo", "bar" ] } then want display 2 tabs, on titles foo , other, unsurprisingly, titled bar. this work great if create repeater goes through array in model , create tab each entry: tabview { anchors.fill: parent repeater { model: listmodel { id: tabs } tab { title: caption rectangle { color: "red" } } } } up now, looks angularjs. need

Scala pattern matching aggregate multiple matches -

if have case class case class test(a: option[boolean], b: option[boolean], c: option[boolean], d: option[boolean]) and have find out boolean result of parameters of class test amount to. example: test(none, none, some(true), some(false)) should result in false and test(some(true), none, some(true), none) would result in true i thinking use pattern matching, have match every possible scenario , that's lot, plus if adding more parameters code grows exponentially. but like test(some(true), none, some(true), none) match { case (_, _, _, some(b)) => b case (_, _, some(b), _) => b case (_, some(b), _, _) => b case (some(b), _, _, _) => b } and aggregate b 's single boolean result? for conjunction of defined arguments, consider this, case class test(a: option[boolean], b: option[boolean], c: option[boolean], d: option[boolean]) { def and() = this.productiterator

c# - Get original file extension and content type -

suppose have file name test.txt . if change extension of file .xls . now file name test.xls instead of test.txt . then how can know original file type of file? you can't. there no way retrieve previous extension or content type file. you can try parse file (for example pdf documents start %pdf ), isn't real solution in opinion, since need know format of each , every file format.

dns - How to get a list of domains that contain a particular keyword? -

i want list of registered domains contain specific keyword. for example, if "food" keyword, want list following: foodpanda.com orderfood.com www.foodnetwork.com ... the way list of domains in full (and free) apply appropriate registries access zone files. zone files lists of all registered domains overseen registry. access free , lists updated daily. need fill in form , sign agreement. once you've downloaded zone file, can search domains contain particular keyword using favourite method (e.g. grep ). for .com , .net domains, registry verisign . here few other links zone files: .org .info .us .biz .asia a larger set of links can found here . note lists of country-specific tlds such .uk or .cn not publicly available. it condition of accessing zone files (certainly made available verisign) person not make significant parts of lists publicly available or publicly searchable. reason, unlikely find complete list of domains on free-to-access

Powershell Delete String in text file -

i have file downloading daily want create script reads text file , deletes out lines containing string "---" i started "(get-content l:\holdings.txt) | {$_ -ne "" | out-file holdings.txt" this deletes blank lines without issue, tried $del -like "*-*" "(get-content l:\holdings.txt) | {$_ -ne $del | out-file l:\holdings.txt" which though delete out of lines of data, whilst runs without error line not being deleted out... i don't know if it's relevant line want delete second line comma delimited sql batch file automation. the file reads follows advice num ,bargain number --------------------,----------------- just try , give graphical representation trying resolve any ideas? regards richard solved it, quick amendment , here (get-content "l:\movement.txt") -notmatch "---" | out-file "l:\movement.txt"

xcode - iOS Incompatible pointer types returning NSDictionary from NSMutableDictionary -

i'm having issue use nsmutabledictionaries returns values nsdictionary. here warning message: incompatible pointer types returning 'nsdictionary *' function result type 'nsmutabledictionary *' here code: - (nsmutabledictionary *)dictionarywithcontentsatpath:(nsstring *)path { if ([path rangeofstring:@"/sessionstore"].location == 0) { return [_inmemorycache objectforkey:[path stringbyreplacingcharactersinrange:nsmakerange(0, 13) withstring:@""]]; } if ([path rangeofstring:@"/permanentstore"].location == 0) { return [nsdictionary dictionarywithcontentsoffile:[self.persistentstoragepath stringbyappendingpathcomponent:[path substringfromindex:15]]]; } return nil; } please me how resolve warning. you need ensure you're returning right type. method states it's returning nsmutabledictionary , returns nsdictionary . try instead: - (nsmutabledictionary*)dictionarywithcontentsatpath:(nsstrin

java - MPI Recv data getting corrupted -

i'm trying send number across using mpi, data getting corrupted. can't figure out why. code is: import mpi.*; public class test { public static void main(string[] args) throws mpiexception{ mpi.init(args); int rank = mpi.comm_world.rank(); int clustersize = mpi.comm_world.size(); int[] send = new int[1]; int[] recv = new int[1]; send[0] = 12387394; if(rank == 0) { mpi.comm_world.send(send[0], 0, 1, mpi.int, 1, 17); } else { mpi.comm_world.recv(recv, 0, 1, mpi.int, 0, 17); system.out.println(recv[0]); } mpi.finalize(); } } the output 1 . why that? shouldn't pass whole array buffer instead of first value? mean: mpi.comm_world.send(send, 0, 1, mpi.int, 1, 17);

How do I convert tabs to exact number of spaces in bash script? -

i need convert string tabs string spaces. but need number of spaces match tabbing format identical. i need because gnuplot labels don't tabs. so want: a fat cat which a\tvery\tfat\tcat , converted to: a fat cat with spaces, , not to a fat cat edit 1 i think misunderstood problem: $ cat -t aggregate/summary.txt | head -n1 date pnl annpnl days avtrds avevol avedur tdays pnl/$ avpnl stddev maxd shrpe but when assign variable spaces lost: $ ff=`cat aggregate/summary.txt | head -n1`; echo $ff date pnl annpnl days avtrds avevol avedur tdays pnl/$ avpnl stddev maxd shrpe you can use expand command: ~$ cat >c fast cat nrstaui e ~$ expand c>d when using cat -a , can see spaces used (tabs represented ^i ): ~$ cat -a c a^ifast^icat^inrstaui^ie$ ~$ cat -a d fast cat nrstaui e$ edit: if assign line variable, have use double quotes see differences: