Posts

Showing posts from September, 2015

How to resolve Nattable conflicts between DefaultRowSelectionLayerConfiguration and ButtonCellPainter on left mouse keydown event? -

i developing rcp application, , using nebula's nattable that. configer row selection (use defaultrowselectionlayerconfiguration) , , configer cell button (use buttoncellpainter) . both ui bing left mouse down event. what want is: when click left mouse button, button responds event while button of whole row selected. below part code: selectionlayer = new selectionlayer(columnhideshowlayer,false); selectionlayer.setselectionmodel(new rowselectionmodel<row>(selectionlayer, bodydataprovider, new irowidaccessor<row>() { @override public serializable getrowid(row rowobject) { return rowobject.getstatus(); } })); selectionlayer.addconfiguration(new defaultrowselectionlayerconfiguration()); class buttonclickconfiguration<t> extends abstractuibindingconfiguration { private final buttoncellpainter buttoncellpainter; public buttonclickco

Java jTextPane one line with regular and bold Text missplaced -

Image
i have textpane using styleddocument. if message typed first adds current time , other users ip document after custom message entered user added right behind in bold. apparently problem bold takes more space , makes misplaced resulting in this: <- code used process following: public void addtext(string msg) { long timems = system.currenttimemillis(); date instant = new date(timems); simpledateformat sdf = new simpledateformat("hh:mm"); string time = sdf.format(instant); simpleattributeset bold = new simpleattributeset(); styleconstants.setbold(bold, true); try { styleddocument doc = getchat().getstyleddocument(); doc.insertstring(doc.getlength(), time + ": " + client.getclient().getpartnerip() + " >>", null); doc.insertstring(doc.getlength(), msg + "", bold); jscrollbar sb = getchatscroller().getverticalscrollbar(); sb.setvalue(sb.getmaximum()); } catch (badlocationexception

spring - Integration test: test the Autowired annotation -

i want test injection dependencies in spring. i have class: public someclass { @autowired somebean bean ; public somebean getbean(){ return this.bean ; } } i want test this: public someclasstest { someclass someclass ; @before public void setup(){ someclass = new someclass() ; } @test public testbeanwired(){ assertnotnull(someclass.getbean()) ; } } i have tried contextconfiguration test configuration file, test fails, don't want use @autowired in test, want create instance of class , bean autowired automatically. that possible if bean annotated @configuration , if byte-code instrumented. otherwise, beans created spring autowired. not beans created using new . because spring has no way know created object , must inject dependency in it. that's fundamental principle of dependency injection: objects instantiated ,

MongoDb document size is too large PhP.How to increase limit -

i want save documents gives me size large error. can not break data multiple collection not me while searching , joining, is there way can save array using gridfs , still searchable or increase document size limit. store data .txt files , shifting mongodb.txt files not searchable , hence need parsed , have search. please help.

c# - Handle multiple threads, one out one in, in a timed loop -

i need process large number of files overnight, defined start , end time avoid disrupting users. i've been investigating there many ways of handling threading i'm not sure way go. files come exchange inbox attachments. my current attempt, based on examples here , bit of experimentation, is: while (datetime.now < dtendtime.value) { var finished = new countdownevent(1); (int = 0; < numthreads; i++) { object state = offset; finished.addcount(); threadpool.queueuserworkitem(delegate { try { startprocessing(state); } { finished.signal(); } }); offset += numberoffilesperpoll; } finished.signal(); finished.wait(); } it

Mysql Update and Replace Syntax in PHP -

i need eliminate character (") column in database. can in mysql command line following command: mysql> update tname set colname=replace(colname, '"',''); and works perfectly. since need run in php, have used following syntax in php dosent work : $sql0 = "update tname set colname=replace(colname,'"','')"; if (mysqli_query($conn, $sql0)) { $result0 = "unwanted character removed "; } else { $result0 = "error filtering failed: " . $sql . "<br>" . mysqli_error($conn); } any idea?? you have escape double quotes inside double-quoted strings. $sql0 = "update tname set colname=replace(colname,'\"','')"; if (mysqli_query($conn, $sql0)) { $result0 = "unwanted character removed "; } else { $result0 = "error filtering failed: " . $sql . "<br>" . mysqli_error($conn); }

java - Which use for non-inherited abstract classes? -

what practice tells non-inherited abstract classes ? is there reason them exist in program not aiming @ providing api ? make sense systematically turn such classes non-abstract classes? if in cases ? well, abstract keyword forbids inctances creation (in order create instance 1 has inherit abstract class), however, abstract classes can have static methods e.g. // abstract: there's no sence in creating instance of class abstract class mathlibrary { // private: there's no sence in inheriting class private mathlibrary() {} // gamma function public static double gamma(double value) { ... } ... } please note, when in java abstract final class not allowed, in c# abstract sealed class static class : // c# static == abstract sealed public static class mathlibrary { // gamma function public static double gamma(double value) { ... } ... }

stored procedures - Updating a column name of a same table which has a parent child relationship using mysql -

i searched lot of doing task found no appropriate solution. basically scenario is. have user_comment table in there 5 column(id,parent_id,user_comments,is_deleted,modified_datetime). there parent child relationship 1->2,1->3,2->4,2->5,5->7 etc. now sending id front end , want update column is_deleted 1 , modified_datetime on records on id children , children's of children. i trying doing using recursive procedure. below code of procedure create definer=`root`@`localhost` procedure `user_comments`( in mode varchar(45), in comment_id int, ) begin declare p_id int default null ; if(mode = 'delete') update user_comment set is_deleted = 1, modified_datetime = now() id = comment_id ; select id user_comment parent_id = comment_id p_id ; if p_id not null set @@global.max_sp_recursion_depth = 255; set @@session.max_sp_recursion_depth = 255; call user_comments('delete&#

Bootstrap Popover Plugin not working with dynamic element through ajax -

using popover of bootstrap popover plugin library pulling content ajax , assigning html , calling $('[data-toggle="popover"]').popover(); not working. $.ajax({ url : '/recent_activity_jsn.html', data : {}, datatype : 'json', type : 'get', cache: false, success : function(res) { $("#recentactivitydiv").html(recentactivitymaindiv); $('[data-toggle="popover"]').popover(); }, error:function(response) { alert("server error please try again"); } });

c# - Custom Nancy bootstrapper not being called -

i building nancy based application uses nancyhost embedded web server. i trying serve static content, creating custom bootstrapper described in documentation here . however, problem see custom bootstrapper class never instantiated , configureconventions method never called. there specific action have in order make sure custom bootstrapper registered? the custom bootstrapper code below: using nancy; using nancy.conventions; using system; namespace application { public class custombootstrapper : defaultnancybootstrapper { protected override void configureconventions(nancyconventions conventions) { console.writeline("test"); conventions.staticcontentsconventions.add(staticcontentconventionbuilder.adddirectory("client", @"client")); conventions.staticcontentsconventions.add(staticcontentconventionbuilder.adddirectory("lib", @"lib")); base.configureconventio

Rails flash message password -

i need idea of making flash message password i have application has posts , need when try edit post or delete message asked password...please note don't want or have users, want have 1 password flash message, please tell me how make it put following code on posts controller http_basic_authenticate_with name: "root", password: "passpass", except: [:index, :show]

How to Reboot android phone programitically? -

i trying reboot android device through activity.i m using following code. public void reboot(){ powermanager pm=(powermanager)getsystemservice(context.power_service); pm.reboot(null) } and have given manifest permission too. android:name="android.permission.reboot error::java.lang.securityexception: neither user 10098 nor current process has android.permission.reboot. only applications signed system firmware signing key allowed these operations. more information can found in links below how compile android application system permissions programmatically switching off android phone

github - Clone git repo inside another repo (and don't treat the cloned one as a submodule) -

in previous project able clone third party git repo project repo. added cloned repo , committed changes project repo. way able keep cloned repo date via git pull in cloned repo folder, , able modify files in , commit them own project repo. i have tried replicate in new project , facing strange issue. follow same steps (in case cloned repo project of mine) when add cloned repo files own repo, main repo recognizes cloned 1 submodule (though no .gitmodules file generated). i compared git related files , found no difference between previous project , current one. cloned same third party repo used in previous project ( https://github.com/wymsee/cordova-http.git ) , able modify/add files , commit them own repo. can't see difference between third party repo clone , own project can't understand why latter treated submodule first isn't. ideas?

javascript - Different link color on different html pages using the same css doc -

i'm new programming, apologize is, i'm sure, relatively simple question. i'm looking efficient way make link color within <a> tags of each html page different (i.e. 1 page have green links, while have blue links) without having add class="green" or class="blue" every single <a> tag. i understand have separate css documents each page, i'd keep whole site on 1 css page, don't have update each style sheet separately when want make overarching changes. is there way of defining style rules in <a> tags in relation class of higher tag? example, possible say <body> <div class="page1content"> <p>text here <a href="someurl.com"> link here </a> more text <a href="secondurl.com"> second link</p> </div> <div class="footer"> <p>even more text <a href="thirdurl.com"></a></p> </div> </bod

compiling java package classes. Cannot access Class. class file contains wrong class while working with packages -

i trying compile few files in package in java. package name library . please have @ following details. this directory structure: javalearning ---library ------parentclass.java ------childclass.java i tried compile in following way: current directory: javalearning javac library/parentclass.java //this compilation works fine javac library/childclass.java //error on here the following parentclass.java : package library; class parentclass{ ... } the following childclass.java : package library; class childclass extends parentclass{ ... } the error follows: cannot access parentclass bad class file: .\library\parentclass.class please remove or make sure appears in correct sub directory of classpath you've got casing issue: class parentclass that's not same filename parentclass.class , nor same class you're trying use in childclass : class childclass extends parentclass . java classnames case-sensitive, windows filenames aren't. if

Excel: Obtain the row of the smaller value -

Image
i have following columns: - original values, b - absolute values, c - sorted absolute values (i obtain ordered values (c) using small formula given range - see link bellow) i need know each ordered absolute value, if original value or not negative: so in picture red columns filled-in manually... there way automatize via formula ? here link sandbox in excel online: http://1drv.ms/1vu2mz4 if first link not work, same thing , formulas on google sheets a partial answer, might enough if column e in screenshot want , column d helper column intended make column e easy compute. the problem abs() loses information. instead of using that, use function doesn't lose information doesn't change sort order , makes possible recover absolute value after sorting. 1 way leave positive numbers alone send negative numbers absolute value + 0.5. example, in b2 enter =if(a2 >= 0,a2, 0.5+abs(a2)) in c2 enter =small($b$2:$b$6,-1+row()) in d2 enter =int(c2

magento2 - Magento 2 - Product filters using Obeserver Event -

i trying create 1 observer apply additional filters product collection. so use magento 2 event :catalog_product_collection_load_after observer code : public function execute(\magento\framework\event\observer $observer) { $collection = $observer->getevent()->getcollection(); $collection->addattributetofilter('size',10); return $this; } but above code working fine product collection, showing wrong pagination , product count same happen layer navigation. is there solution that?

does python has a way to implement C#-like indexers? -

this question has answer here: implement list-like index access in python 2 answers how implement in python c# indexers-like this[int i] {get set}? in other words, how write follow code in python? public class foo{ ... list<foo2> objfoo; ... public foo2 this[int i] { get{ return objfoo[i]; }} }//end class foo //in class or method... ofoo = new foo(); ... foo2 x = ofoo[3]; if want make class work python list (which similar arrays in other languages), can subclass list , give class custom methods , properties without overriding of list methods or properties unless need to. trying mimic of you've posted: class foo(list): def __init__(self, *args): self.extend(args) self.x = "now" def smack(self): print("smackity!") ofoo = foo(1, 2, 3, 4, 5, 6) print(ofoo[3]) # prints

c# - How to add users to groups under Sub site's in sharepoint sitecollection? -

i have 2 sub-sites in sharepoint site,samplesite1 , samplesite2 under parentsite called mainsite. http://xyz.sharepoint.com/sites/mainsite/ - siteurl http://xyz.sharepoint.com/sites/mainsite/samplesite1 - subsite1's url http://xyz.sharepoint.com/sites/mainsite/samplesite2 - subsite2's url each of sites have 2 groups superuser , normaluser respectively. the credential uses siteurl of mainsite. securestring password = new securestring(); string pwd = "pass123"; string username = "abc@xyz.com"; password = converttosecurestring(pwd); clientcontext clientcontext = new clientcontext("http://xyz.sharepoint.com/sites/mainsite/"); clientcontext.credentials = new sharepointonlinecredentials(username, password); incase of adding user subsite's groups normaluser,can use same sharepoint context above siteurl access , perform operations(add/remove user) in groups present under subsites? if yes,how can it?i have built code add or remo

ios - Append audio samples to AVAssetWriter from streaming -

i'm using project when i'm recording video camera, audio comes streaming. audio frames not synchronised video frames. if use avassetwriter without video, recording audio frames streaming working fine. if append video , audio frames, can't hear anything. here method convert audiodata stream cmsamplebuffer audiostreambasicdescription monostreamformat = [self getaudiodescription]; cmformatdescriptionref format = null; osstatus status = cmaudioformatdescriptioncreate(kcfallocatordefault, &monostreamformat, 0,null, 0, null, null, &format); if (status != noerr) { // shouldn't happen return nil; } cmsampletiminginfo timing = { cmtimemake(1, 44100.0), kcmtimezero, kcmtimeinvalid }; cmsamplebufferref samplebuffer = null; status = cmsamplebuffercreate(kcfallocatordefault, null, false, null, null, format, numsamples, 1, &timing, 0, null, &samplebuffer); if (status != noerr) { // couldn't create sample alguiebuffer nslog(@"fail

elasticsearch - Mapping Nest response to a C# object -

i trying map nest response c# object , having little luck. my query returns result from var resp = eclient.search<dynamic>(q => q .type("movies") .from(0) .size(20) .queryraw(querystring)); how can map response c# object? needs dynamic, i.e there arrays wary in length in response. serialize dynamic object json , deserialize string proper c# object. totally inefficient. why not pass dynamic object around or manual mapping?

c++ - Dequeue in a priority queue -

i have implemented priority queue array (school work), , looks below: int dequeue(int a[], int n){ int i, numbertodequeue; numbertodequeue = a[0]; for(i = 0; < n; i++){ a[i] = a[i+1]; } return numbertodequeue; } dequeue in priority queue should take o(1) time. however, in code, takes o(1) time dequeue , o(n) time shift elements front 1 index. i wondering if there's better solution has time complexity of o(1). all form of reply appreciated. int dequeue(int a[], int n){ //provided numbers in ascending order int numbertodequeue; numbertodequeue = a[n - 1]; n--; return numbertodequeue; }

regex - How to extract a date value from a string using regexp in javascript? -

i have string this: var value = "/date(1454187600000+0300)/" - required date format 1/30/2016 - trying this: var value = "/date(1454187600000+0300)/" // need fetch here. var nd = new date(1454187600000); //this static. var month = nd.getutcmonth() + 1; //months 1-12 var day = nd.getutcdate(); var year = nd.getutcfullyear(); newdate = month + "/" + day + "/" + year; console.log( newdate ); //works fine but don't know how fetch numbers value variable using regexp. 1 me? you can use capture group extract date part you're looking for: nd = new date(value.match(/\/date\((\d+)/)[1] * 1); //=> sat jan 30 2016 16:00:00 gmt-0500 (est) here /\/date\((\d+)/)[1] give "1454187600000" , * 1 convert text integer.

java - multiple logback.xml configuration files for different tomcat war applications -

i'm dealing 2 war applications (let's call them app1.war , app2.war) deployed in tomcat7 environment. through setenv.sh i'm extending classpath shared folder located in /opt/configurations. i'd structure configurations way: configurations/ ├── app1.properties ├── app2.properties ├── logback-app1.xml └── logback-app2.xml how tell each application read different logback*.xml files shared classpath? in other words, how tell app1.war read logback-app1.xml , app2.war read logback-app2.xml. there answer question here : http://vtanase.blogspot.com/2012/07/how-to-create-different-logback.html the point use different jndi entry declared in each web.xml <env-entry> <env-entry-name>logback/configuration-resource</env-entry-name> <env-entry-type>java.lang.string</env-entry-type> <env-entry-value>app1/logback.xml</env-entry-value> </env-entry> and add property logback jndi : java_opts="$java_opts

javascript - Load multiple views in angular modal window with or without ui-route -

Image
i have requirement have load multiple view inside model window. there set of tabs icons in it, , on clicking icons views should change inside model window. once model window closed, should state before opening model window. i tried ui-route sub states using ui-sref getting either new page replaced on same screen or blank page instead of getting model window. below sample screen want make. here, want navigate through app, games, movies, etc. , load respective screens. on closing model window, should view is. please suggest me approach achieve it. in advance. have tried using ng-include inside modal? in below code "selection" should changed according sidebar of modal. div representing switchable content written as <div class="main-content" ng-switch on="selection"> <div ng-switch-when="movies" > <ng-include src="'movies.html'"></ng-include> </div> <div

Convert a number into its respective letter in the alphabet - Python 2.7 -

i working on python project take string of text, encrypt text adding keyword , outputting result. have features of program operational except converting numerical value text. for example, raw text converted numerical value, instance [a, b, c] become [1, 2, 3] . currently have no ideas of how correct issue , welcome help, current code follows: def encryption(): print("you have chosen encryption") outputkeyword = [] output = [] input = raw_input('enter text: ') input = input.lower() character in input: number = ord(character) - 96 output.append(number) input = raw_input('enter keyword: ') input = input.lower() characterkeyword in input: numberkeyword = ord(characterkeyword) - 96 outputkeyword.append(numberkeyword) first = output second = outputkeyword print("the following debugging only") print output print outputkeyword outputfinal = [x

angularjs - How to use getReactively with find all helper in Angular Meteor? -

i working through angular meteor tutorial , got deprecation warning on this.helpers({ parties: () => { return parties.find({}); //deprecation warning. use getreactively } }); but not quite sure how records reactively. not have queries return parties.find({field: this.getreactively(query)}) . want records/everything similar collection.find({}) or parties.find({}) without deprecation warning. im use parties: ()=> parties.find() , i'm has no error or deprecated warning. maybe should try it. beside, sometime need handle data fetch query. im used temp variable save data before handle it. can try (some code pseudo code) parties: () { this.temp = parties.find().fetch(); if(this.temp) { //handle data, adjust property format string, format date.... return this.temp } } work, no deprecated, no error. can try it.

arrays - test object is null in php -

i want test if object null or not, have follwing code $listcontact = array(); $contact=$ms->search('email','test@live.fr'); var_dump(($contact)); and result if $listcontact not null give follow object(stdclass)[6] public 'item' => string 'dfdfsd' (length=7) in case it's null , following result object(stdclass)[6] how can test variable $listcontact exists or not? i've tried is_null , (empty() not work use function is_null() follows : is_null($listcontact); the return value : returns true if var null, false otherwise. edit also can use : if ( !$your_object->count() ){ //null } for more information see answers try using array_filter() $emptyarray= array_filter($listcontact); if (!empty($emptyarray)){ } else{ //nothing there }

javascript - How do I load a specific url on refresh? -

let's decides press f5 or browser's reload button. possible open specific url in same tab? like posted in comment, if display prompt, possible using following ugly hack: var a,b; window.onbeforeunload = function (e) { if (b) return; = settimeout(function () { b = true; window.location.href = "//test.com"; }, 500); return "now redirected new page if choosing stay there..."; } window.onunload = function () { cleartimeout(a); }

angularjs - Angular & Firebase $_SESSION like php? -

im trying membership process angular , firebase. is there solution, instead of keeping user information in local storage , session storage? i not want keep local storage etc. sessionstorage. think because not safe.of course,i not keep sensitive information.i need more information on subject. current login , signup coding.. think right way ? "sorry bad english.." app.controller('signup',function($scope, $timeout,$sessionstorage, $window, sessions){ $scope.success = false; $scope.signup = function(){ var ref = new firebase('https://<myfirebase>.firebaseio.com/'); ref.createuser({ email : $scope.loginemail, password : $scope.loginpass }, function(error, userdata) { if (error) { console.log("error creating user:", error); $scope.error = true; $scope.errortext = error; alert(error); } else { console.log("successfully created user account uid:", us

Correct way(s) to call/trigger an anonymous function in JavaScript? -

let's have function, different version of , utilizes array.push different logic inside it: var array_values = []; function pump_array(needle, haystack, callback) { var pushed = false; if(haystack.indexof(needle) === -1) { haystack.push(needle); pushed = true; } if(typeof callback == 'function') { callback(haystack, pushed); } } and if use in manner: var pump_array_callback = function(new_data_in_array_values, pushed) { if(pushed) { console.log('added "first" "array_values[]"'); } else { console.log('"first" in "array_values[]"'); } console.log(new_data_in_array_values); }; pump_array('first', array_values, pump_array_callback); pump_array('first', array_values, pump_array_callback); the first function call of pump_array output: added "first" "array_values[]" and second opposite:

python - Unable to use thread.setDaemon(True) to terminate child thread on termination of main program -

file 1 sravi.py def sam(): while true: print "hi" main program/file trial.py from threading import thread import sravi x=thread(target=sravi.sam) #x.setdaemon(true) #x.daemon=true x.start() i want print "hi" stop once main thread ends continues print hi. have tried x.setdaemon(true) , x.daemon=true not working. understand such questions had been asked before unable figure out solution -------o/p------- >>> >>>hi hi hi hi hi hi hi it continues print hi when x.setdaemon(true), thread x terminated when main thread ends. prove use following code : from threading import thread def sam(): while true: print "hi" x=thread(target=sam) x.setdaemon(true) x.start() time.sleep(2) you see after 2 seconds sam function stop printing "hi".

jsf - context.addMessage not working for a fileupload component -

i want display message in uploadlistner of fileupload component.how ever not displaying message @ all.below code snippet using. facescontext context = facescontext.getcurrentinstance(); facesmessage msg = new facesmessage( facesmessage.severity_error, "please remove special charecters file name. ", ""); context.addmessage(null, msg); i tried same thing in p:commandbutton , working correctly. xhtml part of snippet. you need declare <h:messages> , <p:messages> or <p:growl> component in view in order display messages. given you're using null client id in facescontext#addmessage() , intend display global message, in case add globalonly="true" attribute aforementioned message components filter global messages only. further, if you're sending ajax request, should not forget ajax-update message component specifing client id of message com

linq - C# FindAll Method with array of values -

i have kind of ulr object list below list<myurl> urls = new list<myurl>(); myurl class contains 4 field , of them string. in list want find items not contain given list of values list<myurl> result = urls.findall( different_from_list_of_values condition; ); how can that? the best way should topic , idea override equals method own logic, have example 2 fields class twodpoint. need check topic instead of p2.id == p.id => rather have p2.equals(p)

linux - Adding two numbers with zero padding in bash shell -

var1=00001 var2=00001 expr $var1 + $var2 expected result: 00002 actual result: 2 how can expected result in bash? you can this: printf "%05d\n" $(expr $var1 + $var2)

c# - Find missing date in List<DateTime> and insert that date on the right index -

say have list following dates. list<datetime> datelist = new list<datetime>(); datelist.add(new datetime(2002, 01, 01)); datelist.add(new datetime(2002, 01, 02)); datelist.add(new datetime(2002, 01, 03)); datelist.add(new datetime(2002, 01, 04)); datelist.add(new datetime(2002, 01, 06)); datelist.add(new datetime(2002, 01, 08)); how can iterate through datelist, find datetimes missing (2002-01-05 , 2002-01-07), create datetimes , add them datelist on correct index? you can use following approach determines min- , max-dates , timespan difference , generates list: datetime min = datelist.min(); datetime max = datelist.max(); timespan diff = max - min; datelist = enumerable.range(0, diff.days + 1).select(d => min.adddays(d)).tolist(); you need use diff.days + 1 include end-date. if can't use linq whatever reason use for-loop , list.insert , have use list.sort beforehand if aren't sure whether list sorted or not: datelist.sort(); if (dateli

Bash: Regex matching on multiple lines simultaneously and extracting captured content -

i have xml file in following format <starttag name="aaa" > <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="yyy"/> </starttag> <starttag name="bbb" > <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="xxx"/> </starttag> <starttag name="ccc" > <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="xxx"/> <innertag name="xxx" value="yyy"/> </starttag> .. .. .. i want extract name attributes of starttag of innertag has value yyy. so in file above, output aaa , ccc. can use regex matching. suppose possible using lookaheads not able create regex pat

GROUP_CONCAT slow in MySQL -

i have following query in mysql: select query.*, group_concat(coalesce(query.gene,'none'), '(', query.loc, '|', coalesce(query.typ,'unknown'), ')') outt ( select genes.loc, genes.typ, genes.abans, genes.despres, genes.gene, mutations.id,mutations.chr,mutations.pos,mutations.ref, mutations.ale,mutations.g001,mutations.g002,mutations.g003, .... (snipped hundreds of denormalized fields).... genes inner join mutations on genes.id=mutations.id (mutations.g001>=0.40 , mutations.g002>=0.40 , mutations.g003>=0.40 , mutations.g004>=0.40 , mutations.g005>=0.40 , mutations.g006>=0.40 , mutations.g007>=0.40 , mutations.g008>=0.40 , mutations.g011>=0.40 , mutations.g012>=0.40 , mutations.g013>=0.40 , mutations.g014>=0.40 , mutations.g015>=0.40 , ....(you idea)... , mutations.g105>=0.40 ) limit 0, 100 ) query group query.id i group_concat in que

arrays - .NET stream writer Variable format -

i'm trying write csv file variable output format. the code is fs.writeline(string.format(format, data(0), data(1), data(2), data(3), data(4), data(5) ) ) this works, if i'm trying pass same argument data(0), data(1), data(2), data(3), data(4), data(5) in string str = "data(3) , data(2) , data(1) , data(0)" fs.writeline(string.format(format, str)) i error index (zero based) must greater or equal 0 , less size of argument list. what doing wrong? this literal string: str = "data(3) , data(2) , data(1) , data(0)" what want string array this: str = {data(3), data(2), data(1), data(0)} note: have change declaration of str being string being string array from: dim str string to dim str string(

.net - Image Brush Not working windows phone 8.1 -

my xaml code <grid background="white"> <stackpanel height="580" margin="0,0,0,50" orientation="vertical"> <image height="70" width="100" horizontalalignment="center"/> <image height="50" width="300" horizontalalignment="center"/> <ellipse x:name="imgprofile" height="180" width="180" visibility="visible" > <ellipse.fill> <imagebrush imagesource="/iob wallet/images/profile/photo.png" stretch="uniformtofill" /> </ellipse.fill> </ellipse> <textblock height="40" text="welcome !!!" foreground="#06419d" fontsize="30" fontweight="semibold" textalignment="center" margin="4"/> <textblock height="40&q

javascript - Js regex for password validation match -

i using following regex in conjunction abide foundation validating password: <form id="setpassword" action="{{ url('changepasswordwithouttoken') }}" method="post" class="account setpassword" data-abide="ajax" novalidate="novalidate"> {{ csrftoken() }} <input type="hidden" name="token" value="{{ data.token }}"/> <div class="row"> <div class="large-12 columns"><p>{{ 'pleasechooseapassword'|trans }}</p></div> <div class="large-12 columns"> <label class="password" for="setpasswordfield"> <input type="password" id="setpasswordfield" name="setpasswordfield" pattern="passwordadditional" required placeholder="{{ 'accountloginlabelpassword'|trans }}" />

tomcat6 - URIEncoding not working on Tomcat 6.0.26 -

we working multiple languages , korean being 1 of them, in our application have set encoding both @ tomcat level , spring filter encoding, reason when request.getparameter in our struts2 action class receive ??. tomcat encoding <connector port="8080" protocol="http/1.1" connectiontimeout="20000" maxthreads="150" redirectport="8443" uriencoding="utf-8"/> spring filter <filter> <filter-name>encodingfilter</filter-name> <filter-class>org.springframework.web.filter.characterencodingfilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> <init-param> <param-name>forceencoding</param-name> <param-value>true</param-value> </init-param> </filter> edit so message sent "안

objective c - Method always re-writing json file -

nsurl *url = [nsurl urlwithstring:@"file://localhost/users/admin/desktop/json/vivijson.json"]; nsdictionary *regdict = [[nsdictionary alloc] initwithobjectsandkeys:self.loginstring, @"login", self.namestring, @"name", self.lastnamestring, @"lastname", self.emailstring, @"email", self.numberstring, @"number", nil]; nserror *error; nsmutablearray *regmutarray = [[nsmutablearray alloc] init]; [regmutarray addobject:regdict]; nsdata *jsonconvregarraydata = [nsjsonserialization datawithjsonobject:regmutarray options:nsjsonwritingprettyprinted error:&error]; nsstring *jsonregstring = [[nsstring alloc] initwithdata:jsonconvregarraydat

What is the efficient way to pass value from other class to Main class, in JAVA? -

i have in main class: public void start(stage primarystage) throws exception { thread timecheckthread = new thread() { @override public void run() { try{ while (!done) { system.out.println("running!!"); system.out.println(); currentdate = localdate.now(); if (!olddate.equals(currentdate)) { index++; savedata(); system.out.println("saved!"); } currentthread().sleep(5000); } }catch(interruptedexception e){ e.printstacktrace(); } } }; timecheckthread.start(); stage = primarystage; stage.initstyle(stagestyle.transparent); fxmlloader loader = new fxmlloader(getclass().getresource("sample.fxml")); parent root = (parent) loa

android - ExpandableListView - A checkbox as indicator for expanded or not -

this have, expandable listview. each group item checkbox witha textview next it. i want checkbox toggled checked/unchecked if group expanded or not expanded. also vica versa, if checkbox checked, list should expanded etc. any ideas? this group_layout.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal"> <checkbox android:id="@+id/check_channel" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_margin="10dp" android:focusable="false" android:layout_gravity="left" android:checked="false" /> <textview android:textsize="20sp"

javascript - Node.js http: Parse "index of" -

i need write node.js function finds available node.js versions on official website. this, wanted receive content of link: https://nodejs.org/download/release/ , in form of array. there way how can automagically receive , parse available urls via module or need request site via http , somehow parse content manually, , if so, how? as suggested rahilwazir , can use different url give json. var request = require('request'); request( 'https://raw.githubusercontent.com/nodejs/nodejs.org/master/source/versions.json', function(err, resp, json) { if (err) return console.error(err); var data = json.parse(json); // need here }; ); if want scrape html page mentioned, use following, copy pasted (and adapted) http://maxogden.com/scraping-with-node.html var $ = require('cheerio'); function gothtml(err, resp, html) { if (err) return console.error(err); var parsedhtml = $.load(html); // tags , loop on them

php - Set $_SESSION to two URLs/Domains -

is possible have set $_session available on 2 urls/domains? same im using .htaccess re-write part of domain: rewritecond %{http_host} ^pagefor\.local$ [nc] rewriterule ^([a-za-z0-9-.]+)$ http://pagefor/$1.local [l,r] rewriterule ^([a-za-z0-9-.]+).local$ index.php?site=$1 [nc,l] the above rewrites url if following occurs http://pagefor.local/{username} http://pagefor/{username}.local . works fine, although when $_session set on http://pagefor.local same $_session not available on http://pagefor/{username}.local . i thought $_session available both, seeing same domain? effective way $_session set both? thankyou php sessions rely on cookies (phpsessid cookie in particular). cookies assigned domain name, means browser not reveal cookie set 1 domain another.

java - Which one is more efficient of using array list? -

which 1 more efficient instantiate list ? list<type> list = new arraylist<type>(2); list.add(new type("one")); list.add(new type("two")); or list<type> list = arrays.aslist(new type("one"), new type("two")); they create different types of objects. new arraylist<>() creates java.util.arraylist , can added to, etc. arrays.aslist() uses type happens called arraylist , nested type ( java.util.arrays$arraylist ) , doesn't allow elements added or removed. just wraps array. now, if don't care differences, end 2 roughly-equivalent implementations, both wrapping array in list<> interface. surprised see them differ in performance in significant way - ever, if have specific performance concerns, should test them in particular context.

html - Fullscreen and auto-height on second element -

i'm trying implement image box in html5/css3 showing image , description underneath in fullscreen lightbox. problem have description @ bottom of screen have dynamic height (i.e. don't want description cut) , image take remaining space, constrained max-width , max-height of 100% of remaining space. my problem bit similar "dynamic-height sticky-footer" problem, except whole content should have 100% height, no more, no less. i've tried solve problem "table-row technique" because of dynamic height: see http://galengidman.com/2014/03/25/responsive-flexible-height-sticky-footers-in-css/ explanation. can't make work. either large image makes table grow out of bounds or can't force description "take" height before image. see fiddle here: https://jsfiddle.net/sprat/ho463toa/ .content { display: table; width: 100%; table-layout: fixed; /* not work with, not work without either */ } .image-area { display: table-row; height:

java - How to check if a Date object or Calendar object is a valid date (real date)? -

simpledateformat class's method: public void setlenient(boolean lenient) specify whether or not date/time parsing lenient. lenient parsing, parser may use heuristics interpret inputs not precisely match object's format. strict parsing, inputs must match object's format. or calendar class's method: public void setlenient(boolean lenient) specifies whether or not date/time interpretation lenient. lenient interpretation, date such "february 942, 1996" treated being equivalent 941st day after february 1, 1996. strict (non-lenient) interpretation, such dates cause exception thrown. default lenient. checks conformity of format or rolls date. i confirm if date mm-dd-yyyy (02-31-2016) should return invalid 31day in feb not real date should 04-31-1980 return invalid. would not use joda time api java 8 suggestion on appreciated. using java time api, can done using strict resolverstyle : style resolve dates , times strictly.

Delphi 10 OpenURL on IOS -

i using delphi 10 in older rad studio versions ios possible use openurl sharedapplication in apple.utils.pas but apple.utils.pas cannot found, in unit can find sharedapplication , openurl ? you can find sharedapplication , openurl in iosapi.uikit , need iosapi.foundation, macapi.helpers and use it, need sharedapplication object , nsurl object contains address navigate to uses iosapi.uikit,iosapi.foundation, macapi.helpers var app : uiapplication; url : nsurl; begin app := tuiapplication.wrap(tuiapplication.occlass.sharedapplication); url := tnsurl.wrap(tnsurl.occlass.urlwithstring(strtonsstr('http://www.stackoverflow.com'))); if app.canopenurl(url) //check if there default app can open url app.openurl(url) else showmessage('can not open url'); end;

c# - What does "IsDlg=1" means? - SharePoint Site -

i stumbled open link: post /somewhere/_layouts/acomponent/page.aspx?isdlg=1 http/1.1 what isdlg=1 means @ end? i'm asking because i'm trying solve problem here . answer "isdlg=1" give me clue solve problem. it feature on every sharepoint page allows hide header , nav on page appending isdlg=1 end of url so basically, in sharepoint 2010, can add query string parameter “isdlg” url hide page’s top , left navigation. you can check more detailed descriptions here , here

php - How do I speed up this BIT_COUNT query for hamming distance? -

i have php script checks hamming distance between 2 still photos taken security camera. the table mysql 2.4m rows, , consists of key , 4 int(10)s. int(10)s have been indexed individually, together, , key, don't have significant evidence combination faster others. can try again if suggest so. the hamming weights calculated transforming image 8x16 pixels, , each quarter of bits stored in column, phash0, phash1... etc. there 2 ways have written it. first way use nested derived tables. theoretically, each derivation should have lesser data check it's predecessor. query prepared statement, , ? fields phash[0-3] of file i'm checking against. select `key`, bit_count(t3.phash3 ^ ?) + t3.bc2 bc3 (select *, bit_count(t2.phash2 ^ ?) + t2.bc1 bc2 (select *, bit_count(t1.phash1 ^ ?) + t1.bc0 bc1 (select `key`, phash0, phash1, phash2, phash3, bit_count