Posts

android - How to make a script run automatically whenever i boot up the kernel -

i want create , run shell script each time boot kernel along android on mobile a script can't run when boot kernel because interpreter (your shell) isn't ready @ point. @ best can run script when kernel done loading, , quite hackey within kernel. best use init.rc purpose, designed for

sql server - Restrict Full access to certain User of Database - Database Administrators Stack Exchange

the scenario following: given sql server instance created , handled not me creation of database , user on given instance me question: to limited understanding, sa login have full access database. there way can create user user/login have full access database, despite fact don't own instance? if trying prevent owner of instance or windows or sql server administrators being able access database, the answer no . essentially should assume administrator on box owns , can gain access on box, including database. you may able protect actual data in cases (check out always encrypted in sql server 2016 , example), that's it. administrator can access don't encrypt (and of stuff in current versions), drop database, lock out, etc. if don't trust service provider that's hosting database, should host elsewhere. after all, host worth salt should have agreements in place legally protect you, though not physically, internal data breach.

python - Why is a tuple of tuples of length 1 not actually a tuple unless I add a comma? -

given tuple of tuples t : (('a', 'b')) and individual tuple t1 : ('a','b') why does: t1 in t return false? update: ipython: in [22]: t = (('a','b')) in [23]: t1 = ('a','b') in [24]: t1 in t out[24]: false and how check tuple in tuple? the problem because t not tuple of tuples, tuple. comma makes tuple, not parentheses. should be: >>> t = (('a','b'),) >>> t1 = ('a', 'b') >>> t1 in t true in fact, can loose outer parentheses: >>> t = ('a','b'), >>> t1 = 'a','b' >>> type(t) <type 'tuple'> >>> type(t[0]) <type 'tuple'> >>> type(t1) <type 'tuple'> >>> t1 in t true although needed precedence, if in doubt put them in. remember, comma makes tuple.

How to split a string in java by using following String? -

this question has answer here: how split string in java 29 answers how split following string how split following string "llslotbook17-07-2015@friday@1@10.00am-12.00pm@10@lmv,mcwg" ',' , '@' you can use string.split(regexp) function : string[] array = "llslotbook17-07-2015@friday@1@10.00am-12.00pm@10@lmv,mcwg".split(",|@");

java - How to define Kmeans cluster of the new data -

im trying cluster data , wanna learn accurancy of on weka.i mean lets say, cluster our training data n groups have new test data learn clusters. how can it? checked samples of them test in training data. use filteredclusterer , , choose kmeans in configuration dialog of filteredclusterer. here text "more" button shows documentation clusterer: name weka.clusterers.filteredclusterer synopsis class running arbitrary clusterer on data has been passed through arbitrary filter. like clusterer, structure of filter based exclusively on training data , test instances processed filter without changing structure.

fiware - Error at defining a specific field in a Hive Query -

i have orion context broker connected cosmos cygnus. it works ok, mean send new elements context broker , cygnus send them cosmos , save them in files. the problem have when try searchs. i start hive, , see there tables created related files cosmos have created, launch querys. the simple 1 works fine: select * table_name; hive doesn't launch mapreduce jobs. but when want filter, join, count, or fields. happens: total mapreduce jobs = 1 launching job 1 out of 1 number of reduce tasks determined @ compile time: 1 in order change average load reducer (in bytes): set hive.exec.reducers.bytes.per.reducer=<number> in order limit maximum number of reducers: set hive.exec.reducers.max=<number> in order set constant number of reducers: set mapred.reduce.tasks=<number> starting job = job_name, tracking url = job_details_url kill command = /usr/lib/hadoop-0.20/bin/hadoop job -kill job_name hadoop job information stage-1: number of mappers: 1; numbe...

ruby - Is overriding a module's method a good convention? -

i've got kind of template patterned module few method defined (default behaviour) , method below: def tax 1.2 end def do_something! raise "please implement in class" end i've read in cases should use modules on inheritance because of inheritance capabilities (single inheritance) , when don't need super() @ all. but feel bit guilty override raise "..." methods , default (like tax method), because module. what think? when need override methods should rather use inheritance or including modules? the rule follow is: when method has defined in class including module (e.g. module acts interface) do: def method_that_needs_to_be_defined raise nomethoderror end it's practice, prevents unexpected calls yet undefined method. example: module speaker def speak raise nomethoderror end end class bird < animal include speaker def speak 'chirp' end end