Posts

Showing posts from May, 2010

How do I get Eclipse Galileo to stop restarting an external Tomcat run configuration? -

How do I get Eclipse Galileo to stop restarting an external Tomcat run configuration? - i don't have servers setup except external tool configuration > program. i'm using jpda connector, , yet when things have eclipse auto generate serialversionuid automatically restarts tomcat. can't find might configured in project properties or window preferences. don't want eclipse tomcat unless i'm starting or stopping. thanks! well, months after giving up, having give-and-take co-worker tomcat context, , realized was. had reloadable = "true" in context node, , had nil eclipse. in scenario, eclipse communicate tomcat, , display console output. tomcat beingness notified in scenarios files had changed, , restarting automatically. set reloadable = "false", , no longer problem. eclipse tomcat

Python's sqlite3.register_converter() does not convert double to Decimal -

Python's sqlite3.register_converter() does not convert double to Decimal - in sqlite3 there table: create table t(d double) in python, code is: sqlite3.register_converter('double', decimal) ... d, in connection.execute('select d t limit 1'): print type(d) the printed result is: <type 'float'> thought why? connect database using optional argument: detect_types=sqlite3.parse_decltypes ie: conn = sqlite3.connect('database.db', detect_types=sqlite3.parse_decltypes) then go on have. should work. see: http://www.gossamer-threads.com/lists/python/python/627047 python sqlite3

reporting services - SSRS table with inside borders only - possible? -

reporting services - SSRS table with inside borders only - possible? - i want add together ssrs (rdlc) study in visual studio 2013 table object (tablix) have borders within table (between rows only, need no border between columns), no outside borders, in excel button: i have specified bottom borderstyle of element within tablix column next expression: =iif((rownumber(nothing) mod 2)=1, "dotted", "none") given fact have allways 2 rows per page within tablix. i guess universal formula this: =iif((rownumber(nothing) mod numberofrowsperpage)=numberofrowsperpage-1, "dotted", "none") it should remove lastly border line on page. though solution needs have fixed number of rows per page in table. reporting-services border ssrs-tablix

html - make element fill his parent element -

html - make <a> element fill his parent element - i'm trying create link element created laravel fill div element in . <li class="{{ active::route('guide-dashboard') }}"> <div class="dashboardlink"> <i class="fa fa-envelope-o dashboardicon"></i> {{ html::linkaction('guidecontroller@getindex', "messages") }} </div> </li> normally set div element in 'a' tags since link made laravel have no thought how set things between 'a' tags. there couple of ways can it, 1 way set a tag block element , total width/height a{ display:inline-block; width:100%; height:100%; } this approach avoids having set position style on parent element. (as div block level element) please not though approach fine if parent element contains no other content or elements unless positioned absolutely. you'd need utilize position styling on elem...

Check if string contains all values in array with php -

Check if string contains all values in array with php - what have far: $searchquery = "keyword1 keyword2"; $searcharray = explode(" ", $searchquery); $stringtocheck = "keyword1 keyword3 keyword2"; foreach ($searcharray $searchkeyword) { if (strpos($stringtocheck, $searchkeyword) !== false) : //do endif; } endif; what want display if values in search query found in string. current code above, if string contains keyword1 , keyword2, "does something" twice, 1 time each match. comes true if string contains keyword1 not keyword2, in case displays content once. solution function str_contains_all($haystack, array $needles) { foreach ($needles $needle) { if (strpos($haystack, $needle) === false) { homecoming false; } } homecoming true; } usage: $haystack = 'foo, bar, baz'; $needles = array('foo', 'bar', 'baz'); if (str_contains_all($hayst...

SmallBasic calculate monthly salary for employees -

SmallBasic calculate monthly salary for employees - i need set overtime hours 0 if negative number entered , if overtime hours greater 20 set 20. entered follows textwindow.write(" come in number of overtime hours: ") overtime = textwindow.readnumber() if (overtime < 0 or overtime > 20) textwindow.writeline("invalid hours. hours must between 0 , 20") endif i believe i'm doing wrong not know how prepare it. i don't know smallbasic here simple logic assuming want set overtime=0 when entered number negative , overtime=20 when entered number greater 20; if (overtime < 0 ) textwindow.writeline("invalid hours. hours must greater 0") overtime =0 else if (overtime > 20 ) textwindow.writeline("invalid hours. hours must less 20") overtime =20 else //do stuff here endif smallbasic

real time - 3 sensor reading from arduino to matlab serially -

real time - 3 sensor reading from arduino to matlab serially - i taking 3 input sensor values arduino. code arduino is unsigned int pres; unsigned int temp; unsigned int fluidrate; void setup() { serial.begin(9600); } void loop() { pres = analogread(0); temp = analogread(1); fluidrate = analogread(2); serial.println(pres); serial.println(temp); serial.println(fluidrate); } i want plot these values in 3 different axes created in matlab guide.these plot should in real time.how can sensor info separately. code single info plot obj = serial('com8'); %creating object set(obj,'baudrate',9600) %setting baudrate fopen(obj); %open port set(obj,'terminator','cr') %providing terminator pressure1=0; % variable y axis time1=now; % time in x axis % create graphics object particular axes handles.hplot1 = plot(handles.axes1, nan, nan); guidata(hobject, handles); while 2>1 % infinite loop time2=now; x=[time1 time2]; i...

android - How to test a new Facebook messenger App on local device -

android - How to test a new Facebook messenger App on local device - i have created sample app android, app has integration new messenger platform. don't know how test on device, , feature of app visible in facebook messenger installed on device? have installed app on device don't see listed in facebook messenger app. thank you android facebook

c++ small linked list game keeps crashing -

c++ small linked list game keeps crashing - i have started learning linked lists , trying create little game few nodes. have created 7 nodes , trying create little game can go node node until user escapes castle..the start of game works , sec level 1 time 3rd level no matter take null.this first time creating little programme tips fixing issue appreciated.here code far... #include <iostream> #include <string> using namespace std; struct listnode { string text1; string text2; string text3; string text4; listnode *right; listnode *left; listnode *up; listnode *down; int choice; listnode() { text1 = "null"; text2 = "null"; text3= "null"; text4= "null"; right = null; left = null; = null; downwards = null; selection = 1; } }; int main() { char choice; listnode *start = new listnode(); listnode *two = null; 2 = new listnode(); start->right = two; two->left = start; listnode *three = ...

javascript - How to add JQuery after Ajax? -

javascript - How to add JQuery after Ajax? - there containers have dropdowns, initialized using materializecss class="lang-js prettyprint-override"> $('.dropdown-button').dropdown({ induration: 300, outduration: 225, constrain_width: true, // not alter width of dropdown of activator hover: false, // activate on click alignment: 'right', // aligns dropdown left or right border (works constrain_width) gutter: 0, // spacing border beloworigin: false // displays dropdown below button }); later add together more containers page using ajax, dropdowns not work on them anymore ... how prepare it? javascript jquery ajax

imageview - Does android:scaleType="fitCenter" only work with fix Layout_width and Layout_height attributes? -

imageview - Does android:scaleType="fitCenter" only work with fix Layout_width and Layout_height attributes? - i utilize layout_width="fill_parent " , layout_height="wrap content" . if image bigger imageview, downscaled perfectly. however, never got working upscale smaller images. tried combination of scaletype , "adjustviewbounds": stays in own size in middle of image view. here code... <linearlayout android:id="@+id/linearlayout02" android:layout_height="wrap_content" android:background="@drawable/content_bg" android:orientation="vertical" android:padding="5dp" android:layout_width="fill_parent" android:layout_marginleft="1px"> <imageview android:layout_height="wrap_content" android:src="@drawable/test" android:id="@+id/imageviewtest...

scala - Changing sbt project's directory layout -

scala - Changing sbt project's directory layout - according sbt tutorial on changing paths i'm trying alter "target" output directory "someother" override def outputdirectoryname = "someother" everything goes fine except one: sbt automatically creates target directory ".history" file inside. why sbt when supposed create only "someother" dir ? tryied override methods inherited basicprojectpaths (i utilize sbt.defaultproject superclass of project descriptor) override def maincompilepath = ... override def testcompilepath = ... ... but sbt creates "target" folder in spite of paths overriding. it seems should utilize overridden outputdirectoryname in trunk... /** path file provides persistence history. */ def historypath: option[path] = some(outputrootpath / ".history") def outputpath = crosspath(outputrootpath) def outputrootpath: path = outputdirectoryname def outputdirectoryname =...

oracle - Java: Send array to a PL-SQL function -

oracle - Java: Send array to a PL-SQL function - i need pass array of objects pl-sql function my oracle code: create or replace type uu.itemtab table of itemrec; / create or replace type uu.itemrec object (id number, name varchar2(30)) / java class public class itemrec { private int id; private string name; public itemrec(int id, string name) { super(); id = id; name = name; } public int getid() { homecoming id; } public void setid(int id) { id = id; } public string getname() { homecoming name; } public void setname(string name) { name = name; } } java code: import java.sql.callablestatement; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import java.sql.types; import oracle.sql.array; import oracle.sql.arraydescriptor; public class testna { public static void ...

Video element for XHTML MP - WAP2 Phones -

Video element for XHTML MP - WAP2 Phones - i trying develop xhtml mp website supporting wap2 browsers. video elememt in html5 not working , tried object element. both of them not supported . tried play in nokia 220 phone. nil coming. sample code used <video controls="controls" poster="" width="200" height="200"> <source src="video/small.mp4" type="video/mp4" /> <object type="application/x-shockwave-flash" data="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" id="video-elemnt" > <param name="movie" value="http://flashfox.googlecode.com/svn/trunk/flashfox.swf" /> <param name="allowfullscreen" value="true" /> <param name="wmode" value="transparent" /> <param name="flashvars" value="controls=true&amp;po...

javascript - Indexing into array with functions -

javascript - Indexing into array with functions - i'm trying modify illustration of kernel density estimation https://github.com/jasondavies/science.js/tree/master/examples/kde have 1 1 line instead of 2. need modify code below. more specifically, need modify .data(d3.values(science.stats.bandwidth)) . chrome developer tools can see variable returned var bw = d3.values(science.stats.bandwidth) following: bw: array[2] 0: function (x) { 1: function (x) { length: 2 __proto__: array[0] i've tried indexing variable, returned function cannot used plotting. becomes undefined . var granularity = 0.1; var x_min = 30; var x_max = 110; d3.json("faithful.json", function(faithful) { info = faithful; var w = 800, h = 400, x = d3.scale.linear().domain([30, 110]).range([0, w]); bins = d3.layout.histogram().frequency(false).bins(x.ticks(60))(data), max = d3.max(bins, function(d) { homecoming d.y; }), y = d3.scale.linear().domain([0...

sql server - Attempting to add a new column in SQL by subtracting a year -

sql server - Attempting to add a new column in SQL by subtracting a year - noob @ this. cutting point on this. class assignment , professor has not answered emails since thursday. problem trying solve - "write query subtract 1 year production date of each album , label recorddate , display album title, production date, , record date each entry in table. order results album title." here table supposed like here query used (given in class know repeated inserts wanted)... create table album( album_id char(4) unique not null, album_title varchar(255), album_year year, album_producer varchar(255), primary key(album_id) ); insert album (album_id, album_title, album_year, album_producer) values ('a001', 'awake', '1994', 'east west record'); insert album (album_id, album_title, album_year, album_producer) values ('a002', 'moving pictures', '1981', 'anthem'); insert album (album_id, album_title, album_...

swift - UnsafeMutablePointer to Concrete Object Type -

swift - UnsafeMutablePointer<Void> to Concrete Object Type - how can cast unsafemutablepointer<void> concrete object type i've created kvo observer , passed custom class context this class info : nsobject { } class foo : nsobject { dynamic var property = "" } var info = info() class observing : nsobject { func observe1(object: nsobject) { object.addobserver(self, forkeypath: "property", options: .new, context: &info) } override func observevalueforkeypath(keypath: string, ofobject object: anyobject, change: [nsobject : anyobject], context: unsafemutablepointer<void>) { println("observed \(keypath) change:'\(change)' context: \(context)") } } allow o = observing() var object = foo() o.observe1(object) object.property = "new value" i know how cast context info class unsafemutablepointer has initializer takes unsafemutablepointer of type, result be...

galaxy - recording screencast on android -

galaxy - recording screencast on android - i trying record screencast on galaxy s5 using adb on mac. cd /android-sdk-macosx/platform-tools ./adb devices ./adb shell screenrecord --verbose ./sdcard/screencast-recording.mp4 after lastly line maintain getting configuration error main display 1080x1920 @44.70fps (orientation=0) configuring recorder 1080x1920 video @ 4.00mbps error: unable configure codec (err=-2147483648) warning: failed @ 1080x1920, retrying @ 720x1280 configuring recorder 720x1280 video @ 4.00mbps any ideas how work? android galaxy screencast

javascript - Populate a list (not HTML) from JSON -

javascript - Populate a list (not HTML) from JSON - i trying utilize wordcloud2.js generate word clouds. works fine using illustration given: var options = { list : [ ["pear", "9"], ["grape", "3"], ["pineapple", "8"], ["apple", "5"] ], gridsize: math.round(16 * document.getelementbyid('canvas_cloud').offsetwidth / 1024), weightfactor: function (size) { homecoming math.pow(size, 1.9) * document.getelementbyid('canvas_cloud').offsetwidth / 1024; } } wordcloud(document.getelementbyid('canvas_cloud'), options); however, struggling populating "list :" info json file next structure: [ { "wordcloud": "manchester", "freq": 2321 }, { "wordcloud": "munich", "freq": 566 }, { ... }, { "wordcloud":...

How to display all google calendar events and add new event using php -

How to display all google calendar events and add new event using php - i want write 1 php script can create event on google calendar , can fetch list of event on 1 particular google calendar account. i saw documentation , confusing , not clear. on stack on flow there different technic no 1 explain clearly. i have created 1 project google console , generate public api access , using code fetch list of calendar event got error "fatal error: uncaught exception 'google_service_exception' message 'error calling https://www.googleapis.com/calendar/v3/calendars.../google_agenda/src/google/http/rest.php on line 110" also using updated library https://github.com/google/google-api-php-client and code error_reporting(e_all); ini_set("display_errors", 1); require_once('google_agenda/src/google/autoload.php'); date_default_timezone_set('europe/paris'); $client = new google_client(); $client->setapplicationname("my_app"...

angularjs - How to acess to a var in a test script AngularJS_e2e -

angularjs - How to acess to a var in a test script AngularJS_e2e - i utilize variable "fructs". var fructs = [ { name: "banna", color: "yellow"}, { name: "lemon", color: "yellow"}, { name: "strawberry", color: "red"} ]; i have application in angularjs <div class="fructlist"> {{ fruct.name }}: <input type="checkbox" ng-repeat="fruct in fructs" ng-model="fruct.checked ng-checked="fruct.checked"> </div> so, want utilize property "color" in test.i utilize protractor, selenium web-driver it('should click on fructs yellow', function() { element.all(by.repeater('fruct in fructs')).then(function(arr) { var size = arr.length; (var = 0; < size; i++) { if(arr[i].color=='yellow...

Converting an int into a 4 byte char array (C) -

Converting an int into a 4 byte char array (C) - hey, i'm looking convert int inputed user 4 bytes, assigning character array. how can done? example: convert user inputs of 175 to 00000000 00000000 00000000 10101111 issue of answers far, converting 255 should result in 0 0 0 ff although prints out as: 0 0 0 ffffffff unsigned int value = 255; buffer[0] = (value >> 24) & 0xff; buffer[1] = (value >> 16) & 0xff; buffer[2] = (value >> 8) & 0xff; buffer[3] = value & 0xff; union { unsigned int integer; unsigned char byte[4]; } temp32bitint; temp32bitint.integer = value; buffer[8] = temp32bitint.byte[3]; buffer[9] = temp32bitint.byte[2]; buffer[10] = temp32bitint.byte[1]; buffer[11] = temp32bitint.byte[0]; both result in 0 0 0 ffffffff instead of 0 0 0 ff just illustration 175 input prints out 0, 0, 0, ffffffaf when should 0, 0, 0, af the portable way (ensuring 0x00 0x00 0x00 0xaf everywhere) utilize shifts...

C# Multithreading -

C# Multithreading - okay. want have 2 threads running. current code: public void foo() { lock(this) { while (stopthreads == false) { foreach (var acc in mylist) { // process stuff } } } } public void bar() { lock(this) { while (stopthreads == false) { foreach (var acc in mylist) { // process stuff } } } } both accessing same list, problem first thread "foo" not releasing lock guess; because "bar" starts when "foo" done. thanks yes, that's how lock designed work. the lock keyword marks statement block critical section obtaining mutual-exclusion lock given object, executi...

php - Hold record id for ticketing system problem -

php - Hold record id for ticketing system problem - ok have custom ticketing scheme developed in php/postgresql. how works info entered, click submit, ticket number shown. like, ticket number shown, come in information, click submit. now know can create blank record , utilize record id update when user submits. i wanted know if there better/alternative way in doing this? some key points: record id pk, auto increments record id's must in order, no skipping record id numbers the problem end user start ticket id process , not click submit result in blank record. might best way proceed. any ideas or best approach? edit: understand gripes , need finish requested action, looks i'm going dealing blank records. shouldn't happen wanted see if had deal before. input there no practical way this. it's not prudent lock tables or utilize transactions app must wait additional user input. means tickets info have gaps between them. silly requirement o...

angular ui router - How to animate change state smoothly - not as 2 separate animation and a scroll action? -

angular ui router - How to animate change state smoothly - not as 2 separate animation and a scroll action? - simply want alter state animation fade out @ current position , fade in on top of page (without additional separate scrolling on top of page, want have there before fade in animation starts). is possible? right works using 2 separate actions (first fade out/ alter page/ fade in , scroll on top of page) bit funny... thanks lot suggestions. ps: found lot of answers issue covers ui route alter state ng-animation , scrolling in 2 separate actions 1 look @ sample scroll angular-ui-router ng-animate

c++ - Virtual Destructor Test Fails -

c++ - Virtual Destructor Test Fails - #include <iostream> #include <string> using namespace std; class base of operations { virtual ~base() = default; }; class derived1 : protected base of operations {}; class derived2 : protected derived1{}; class derived3 : protected derived2{}; int main() { base* b[] = {new base, new derived1, new derived2, new derived3}; delete[] b; cin.get(); homecoming 0; } this gives me next compilation errors , next taught: warning 1 warning c4624: 'derived1' : destructor not generated because base of operations class destructor inaccessible or deleted warning 2 warning c4624: 'derived2' : destructor not generated because base of operations class destructor inaccessible or deleted warning 3 warning c4624: 'derived3' : destructor not generated because base of operations class destructor inaccessible or deleted error 4 error c2243: 't...

How can I git clone https://github.com/apache/falcon/tree/0.6.1? -

How can I git clone https://github.com/apache/falcon/tree/0.6.1? - this question has reply here: how clone single branch in git? 7 answers i clone apache falcon project. not trunk/ master branch. clone 0.6.1 branch. for master branch next command: git clone https://git-wip-us.apache.org/repos/asf/falcon.git falcon but 0.6.1 branch (https://github.com/apache/falcon/tree/0.6.1). please help me. as specified in man of git clone, have utilize -b option. man page concerning -b alternative : --branch , -b instead of pointing newly created head branch pointed cloned repository’s head, point branch instead. in non-bare repository, branch checked out. --branch can take tags , detaches head @ commit in resulting repository. it's obvious, have next command clone specific branch on remote project: git clone -b [branch] [remote]. in c...

How do I read multiple images into an array in MATLAB? -

How do I read multiple images into an array in MATLAB? - i working on pca face recognition project , wondering how read multiple images matrix , resize them 50x50. im aware need utilize imread , pass in images, followed using imresize. following? myfolder = 'c:\users\x'; filepattern = fullfile(myfolder, '*.jpg'); jpegfiles = dir(filepattern); k = 1:length(jpegfiles) basefilename = jpegfiles(k).name; fullfilename = fullfile(myfolder, basefilename); fprintf(1, 'now reading %s\n', fullfilename); imagearray50x50 = imread(fullfilename); imagearray50x50new = imresize(imagearray50x50, [50 50]); imshow(imagearray30x40new) is approach? how resize images correctly? thanks in advance, mark from have dealt with, way read in multiple images file serially , through for loop. have indeed approach, need determine how want store of these images in matlab. 2 easiest options create 3d matrix each piece 50 x 50 image read file or cell array each cell 50 x...

git submodule present in different branch -

git submodule present in different branch - i made couple of commits before adding submodule . in graph below added submodule (appcore) in 3rd commit , moved on doing more changes. as per understood if checkout first commit before submodule added submodule folder ( appcore in case) should not nowadays still see there . how submodules work or m doing wrong $ git checkout dc5626b $ ls git git-submodules

PostgreSQL table to json -

PostgreSQL table to json - i have table key | value -----+------- | "foo" b | "bar" how can result {"a": "foo", "b": "bar"} it doesn't work with select array_to_json(array_agg(t)) table t; -- [{"key": "a", "value": "foo"}, {"key": "b", "value": "bar"}] can help me? postgresql ≥ 9.4 : select json_object(array_agg(key), array_agg(value)) t; ┌────────────────────────────┐ │ json_object │ ├────────────────────────────┤ │ {"a" : "foo", "b" : "bar"} │ └────────────────────────────┘ (1 row) json postgresql

php - Where to put/find schema.xml and other config files in solarium using Yii2? -

php - Where to put/find schema.xml and other config files in solarium using Yii2? - i'm trying utilize solr through solarium under yii 2 framework, after googling many hours still don't know config files. i have solarium folder under vendor, --- vendor --- solarium --- solarium --- examples --- library --- phar --- tests ... but don't know how add together config files, , if need create multiple indexes/cores. thanks try using yii2-solr package. website, need add together these configurations @app/config/main.php file. 'components' => [ ... 'solr' => [ 'class' => 'sammaye\solr\client', 'options' => [ 'endpoint' => [ 'solr1' => [ 'host' => '10.208.225.66', 'port' => '8983', 'path' => ...

python - aiohttp - exception ignored message -

python - aiohttp - exception ignored message - i'm running next code makes 5 requests via aiohttp: import aiohttp import asyncio def fetch_page(url, idx): try: url = 'http://google.com' response = yield aiohttp.request('get', url) print(response.status) except exception e: print(e) def main(): try: url = 'http://google.com' urls = [url] * 5 coros = [] idx, url in enumerate(urls): coros.append(asyncio.task(fetch_page(url, idx))) yield asyncio.gather(*coros) except exception e: print(e) if __name__ == '__main__': try: loop = asyncio.get_event_loop() loop.run_until_complete(main()) except exception e: print(e) output: 200 200 200 200 200 exception ignored in: exception ignored in: exception ignored in: exception ignored in: exception ignored in: note: there no additional info what/where exce...

Assembly x86 - Issue with code -

Assembly x86 - Issue with code - i'm still quite new assembly. wrote code when seek run in emu8086, programme starts in info segment. set end start @ end of programme , thought indicate begin reading code. i looked @ other samples of code seemed same mine. i'm sure simple, doing wrong? org 100h info segment str db "hello",'$' ; strings printed $ terminating character ends code segment start: mov dx, offset str ; set dx point str phone call printstrline ; phone call print procedure ret ; homecoming scheme ;---------------------------------------; proc printstrline ; ; ; ; prints string terminated $. ; ; ; ; receives: dx = ptr str ; ; ; ;---------------------------------------; force ax ; reg modified, save mov ah, 09...

android 4.4.x webview window.innerWidth is twice of which before 4.4.x -

android 4.4.x webview window.innerWidth is twice of which before 4.4.x - i seek on android 4.4.4 device. meta <meta name="viewport" content="width=device-width, user-scalable=no"/> and got html width 720px height 1230px i think should width 360 height 640px why it's 720x1230 android-webview

ios - CGImageRef uses lot of memory even after release -

ios - CGImageRef uses lot of memory even after release - i'm using cgimageref , noticed uses lot of memory doesn't deallocated. tried experimenting next code - (void)photofromasset:(alasset *)asset completion:(void(^)(nserror *error))completionhandler alassetrepresentation *representation = asset.defaultrepresentation; uiimageorientation orientation = (uiimageorientation)representation.orientation; cgimageref fullresolutionimage = representation.fullresolutionimage; //uiimage *fullimage = [uiimage imagewithcgimage:fullresolutionimage scale:0.0 orientation:orientation]; //[self startupload:fullimage completion:completionhandler]; } put breakpoints , set first 3 lines of code in @autorelease pool. tried removing @autorelease , called cgimagerelease(fullresolutionimage); when uiimageorientation app using less 30mb phone call cgimageref gets more 80mb. both memory freeing methods me 50mb, there's 20mb somewhere. 20mb freed when whole...

call python module functions from command line -

call python module functions from command line - i know if there way phone call module functions command line. problem have file bundle called find_mutations. requires input files sorted in specific way, made function so. user able have alternative run code normally: $ python -m find_mutations -h or run specific sort_files function: $ python -m find_mutations.sort_files -h is possible? if so, sort_files function need in own strip? need add together __init__.py script? bundle install , runs fine, add together this. you add together flags run function. next illustration not way work command arguments, demonstrates idea. import sys if __name__ == "__main__": if '-s' in sys.argv: sort_files() add flag run specific function, in case -s sort files. python function module distutils setup.py

Is there a way to shrink an Excel table to fit the data? -

Is there a way to shrink an Excel table to fit the data? - i have excel table has several other places in spreadsheet using various reasons, , realized table had bad data. collected new data, , there fewer rows in new info set in previous table. is there way can shrink table reflect new count of data? not @ sure understand requirement i'm guessing want cut down size of tables/table without deleting entire rows in spreadsheet (because of content nowadays elsewhere in spreadsheet in same rows table data). if so, simply select area of table deleted , press delete. if want remove formatting remains select angle icon shown @ extreme bottom right of table , drag suit. i assuming (table) rows deleted contiguous block @ bottom of table. excel excel-2013

java - How to create OR blocks containing multiple criterias with Hibernate? -

java - How to create OR blocks containing multiple criterias with Hibernate? - i have multiple criterias constructed out of criterions , create disjunction between them. criteria criteria1 = hibernatesession.createcriteria(myclass); criteria1.add(restrictions.eq(field1, value1)); criteria1.add(restrictions.eq(field2, value2)); criteria1.add(restrictions.ne(field3, value3)); which create where field1 = value1 , field2 = value , field3 != value3 . then, criteria criteria2 = hibernatesession.createcriteria(myclass); criteria2.add(restrictions.eq(field4, value4)); criteria2.add(restrictions.eq(field5, value5)); which create where field4 = value4 , field5 = value5 . my end goal here create disjunction between criteria1 , criteria2 have where (field1 = value1 , field2 = value , field3 != value3) or (field4 = value4 , field5 = value5) . i know disjunction / conjonction in hibernate, however, take criterions (and not criterias). have of achieved similar before ? ...

python - How does a website know your metric system, date format ...? -

python - How does a website know your metric system, date format ...? - i run same python script on 2 different server (us/europe) using beautiful soup , requests html string. receive different string same url : http://magicseaweed.com/playa-jaco-surf-report/2472/ one units in meters , date in europe format (europe server) , 1 in feet , date format (us server). i've tried changed http header of request : headers = {'accept': '*/*', 'accept-encoding': 'gzip, deflate', 'accept-language': 'fr-fr,fr;q=0.8,en-us;q=0.6,en;q=0.4,de;q=0.2,ru;q=0.2,ja;q=0.2', 'user-agent': 'python-requests/2.6.0 cpython/2.7.6 darwin/14.1.0'} r = requests.get(url,headers = headers) but doesn't alter anything, server still receive feet units/us format date... how can receive meters units , europe date format on server on europe server ? there no way determine metric scheme preferred;...

java - Android app crashes after launching intent and using setText() in TextView -

java - Android app crashes after launching intent and using setText() in TextView - i'm trying launch activity using intents , setting values in textviews in launched activity, when seek app crashes. heres activity i'm trying launch. crashes when seek set text in lastly 2 code lines public class gameover extends activity { textview correcttxt; textview incorrecttxt; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); intent intent = getintent(); int right = intent.getintextra("correct", 0); int wrong = intent.getintextra("incorrect", 0); correcttxt = (textview)findviewbyid(r.id.correct_txt); incorrecttxt = (textview)findviewbyid(r.id.incorrect_txt); correcttxt.settext("" + correct); incorrecttxt.settext("" + incorrect); } } and activity that's launching. create utilize of intent in truebutton onclicklistener ...

MVVM and Login Windows -

MVVM and Login Windows - i'm writing first "real" mvvm application, , first step user need take provide login credentials. in past, have shown login dialog after main window has been laid out , made visible first time. what preferred way of doing in mvvm world, , why? i see many options, 1 of go on doing way i've done before, it's one-time step , won't interfere rest of "mvvm-ness" of application. 1 time user has logged in, initialize mainwindow 's modelview credentials , go on on way. alternative allow modelview cause login dialog shown (somehow). mvvm gurus prefer either of these? (there 1 other option, showing login dialog first, , when dismissed, create main window. technically solve dilemma, wouldn't educate me, nor aesthetics of having "naked" login dialog.) the model-view-viewmodel pattern doesn't tell how define ui workflow. free take appropriate workflow ourself. prefer first approach because s...

java - How do you add the file icon to the titlebar, and indicate that something is not saved in JavaFX on Mac? -

java - How do you add the file icon to the titlebar, and indicate that something is not saved in JavaFX on Mac? - how add together file icon titlebar in javafx on mac? this: and how indicate document hasn't been saved, this: in swing, this how it, possible in javafx too? no pre-coded solution in answer. feature request not available out of box javafx 8. some approaches consider: see: javafx exclusively customized windows? , undecorator project. potentially utilize undecorator in conjunction resources aquafx accomplish want. or another way utilize 2 stages layered on top of each other, top stage beingness transparent , overlaying icon on lower stage - need maintain them in sync location, size, visibility , iconification states. use swing stage , application implements icon , place javafx content within swing stage using jfxpanel. java osx javafx

magento - Cake Php 3.0 how to use OAuth php extenstion -

magento - Cake Php 3.0 how to use OAuth php extenstion - i trying utilize php extension oauth in cakephp 3 application authentication magento. the module installed in php when utilize in application gives error. the code written (i got magento site) $oauthclient = new oauth($consumerkey, $consumersecret,oauth_sig_method_hmacsha1, $authtype); the error got class 'app\controller\oauth' not found the error simple, new php , don't know much structure need add utilize oauth; php magento cakephp oauth

c# - Closing the Form opened in another thread -

c# - Closing the Form opened in another thread - i'm getting troubles winforms c# app. wish create form named popup closing after operations in main thread done. problem exception caused cross-thread form closing. private void loginbutton_click(object sender, eventargs e) { loginprocess.start(); // running form.show() in new thread activeacc.isvalid = false; activeacc.username = userbox.text; seek { logincheck(userbox.text, passbox.text); } grab (ioexception) { messagebox.show(".."); return; } grab (socketexception) { messagebox.show(".."); return; } if (activeacc.isvalid) { messagebox.show(".."); close(); } else { popup.close(); // error caused closing form different thread messagebox.show(""); } } public login() // 'main' form constructor { initializec...

alertdialog - Custom Alert Dialog with multiple EditText -

alertdialog - Custom Alert Dialog with multiple EditText - i want build custom alert dialog person can insert new values, address, postal code, city , nation. after sets new values, app update local database. when insert value , click ok button, app crash , homecoming fatal exception error. xml of endspesa.activity <?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" > <textview android:id="@+id/costo" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_alignparentleft="true" android:layout_alignparentstart="true" android:layout_marginleft="40dp" android:layout_marginstart="40dp" android:layo...

swift - Unarchiving a .tar file in ios 8 -

swift - Unarchiving a .tar file in ios 8 - how untar file in ios 8? i have followed these examples: nvhtargzip, light-untar, ziparchive have not been able create them work. for team, used light-untar-for-ios available @ https://github.com/mhausherr/light-untar-for-ios the actual line of code is: if allow path = nsbundle.mainbundle().pathforresource("es_es", oftype:"tar") { allow documentdirectory:nsarray = nssearchpathfordirectoriesindomains(nssearchpathdirectory.documentdirectory, .userdomainmask, true) allow documentdirectorypath:string = documentdirectory[0] as! string var filemanager = nsfilemanager.defaultmanager() var isdirectory: objcbool = objcbool(true) if !filemanager.fileexistsatpath(documentdirectorypath + "/\(tolocale)", isdirectory: &isdirectory){ filemanager.createdirectoryatpath(documentdirectorypath + "/\(tolocale)", withintermediatedirectories: true...

c# - How to get/set text into View Text ? MonoMac - Xamarin, IB - Xcode, -

c# - How to get/set text into View Text ? MonoMac - Xamarin, IB - Xcode, - i'm creating app in xamarin monomac. ui created ib xcode. created view text area, can't set/get text to/from it. tried search, without success. i need textfield.stringvalue used textfields. thanks you need create outlet text field. xamarin auto generate property after , able set textfield.stringvalue. see doc here:https://developer.apple.com/library/ios/recipes/xcode_help-ib_connections/chapters/creatingoutlet.html c# xcode xamarin

c# - Knight's Tour algorithm -

c# - Knight's Tour algorithm - i new programming , want resolve knight's tour practice. don't understand error on programme here method: class knight { int n, m; bool[,] board ; public knight() { n = 5; board = new bool[n, n]; n *= n; m = n - 1; } public bool movement(int y, int x, int mov) { if (x < 0 || x >= 5 || y < 0 || y >= 5) { homecoming false; } if (board[x, y] == true) // has been in position { homecoming false ; } if (mov == m) { console.writeline("solution"); board[x, y] = true; homecoming true; } else { bool result = false; result = result || movement( x+2, y+1, mov+1); result = result || movement( x+2, y-1, mov+1); result = result || movement( x-2, y+1, mov+1); ...

Using $and in the pipeline for mongodb aggregate() function driver in C# -

Using $and in the pipeline for mongodb aggregate() function driver in C# - i trying work mongodb aggregation framework in c#. i want able set $and in query. here's mongodb query want run- db.students.aggregate( { $match: { name:"mira", $and:[{date:{$gte:isodate("2015-03-01t00:00:00")}}, {date:{$lte:isodate("2015-04-01t00:00:00")}}] }, { $group:{"_id":"$subject", "$sum":"$marks"} } ) i created match corresponding mongodb query isn't right here because compiler errors on brackets. c# code follows- var match = new bsondocument { { "$match", new bsondocument { { "name", "mira" } }, { "$and", new bsondocument{ { new bsondocument { { "date", new bsondocument { { "$gte...

c# - Precompiled symbols not finding custom configuration -

c# - Precompiled symbols not finding custom configuration - i using vs2010, c#. have custom configuration named wcfdebug. i've added configuraion through configuration manager. have added conditional compilation symbols project: the problem when utilize code this: #if wcfdebug /*my code here*/ #endif program never finds configuration - neither other configuration, debug: #if debug /*this 1 not found*/ #endif what should do, programme finds configurations precompiled symbols? edit: of course, expect programme find configuration during debug sessions in run-time mode. in solution explorer, right click on "solution ...." -> configuration manager - that's how select active configuration. c# .net