Posts

Showing posts from March, 2012

How to auto rerun of failed action in oozie? -

how can re-run action failed in workflow automatically? i know way rerun manually command line or thorough hue. $oozie job -rerun ... is there parameter can set or provide in workflow retry automatically when action fails? most of time, when action fails in oozie workflow, need debug , fix error , rerun workflow. there times, when want oozie retry action after interval, fixed number of times before failing workflow. can specify retry-max , retry-interval in action definition. examples of user-retry in workflow action : <workflow-app xmlns="uri:oozie:workflow:0.5" name="wf-name"> <action name="a" retry-max="2" retry-interval="1"> .... </action> you can find more information user-retry workflow actions in link.

Varchar(max) showing as text in SQL Server Management Studio -

Image
i have 2 columns in database running on sql server 2008r2(10.50.4000) varchar(max), in sql server management studio (11.0.5343.0) show text in explorer window. when run query select distinct j.ticketid, j.jobnotes, j.jobscopeofwork sysdba.alx_job j join sysdba.alx_jobtype t on j.jobtypeid = t.alx_jobtypeid join sysdba.alx_jobstatus s on j.statusid = s.id join sysdba.address on j.addressid = a.addressid left outer join sysdba.alx_job_jobusers ju on j.ticketid = ju.ticketid (ju.alx_userid = '12345' or j.userid = 12345) i error msg 421, level 16, state 1, line 1 text data type cannot selected distinct because not comparable. msg 421, level 16, state 1, line 1 text data type cannot selected distinct because not comparable. the compatibility option set follows if database engine running on sql server 2000, or if database compatibility level set "80" (sql server 2000), database doe...

python - Unexpected Performance Decrease -

i have parse huge (250 mb) text file, reason single line, causing every text editor tried (notepad++, visual studio, matlab) fail loading it. therefore read piece piece, , parse whenever logical line (starting # ) read: f = open(filename, "rt") line = "" buffer = "blub" while buffer != "": buffer = f.read(10000) = buffer.find('#') if != -1: # end of line found line += buffer[:i] processline(line) line = buffer[i+1:] # skip '#' else: # still reading current line line += buffer this works reasonably well, however, might happen, line shorter buffer, cause me skip line. replaced loop by while buffer != "": buffer = f.read(10000) = buffer.find('#') while != -1: pixels += 1 line += buffer[:i] buffer = buffer[i+1:] processline(line) = buffer.find('#') line += buffer , trick. @ least hundred times ...

c# - Connect view with viewmodel to share an ObservableCollection -

i can't show in listbox object observablecollection. how it? here elemental code: c# public observablecollection<string> collection { get; set; } private void add(window window) { collection = new observablecollection<string>(); collection.add("first item"); } xaml <listbox itemssource="{binding collection, mode=twoway}" horizontalalignment="left" height="100" margin="10,10,0,0" verticalalignment="top" width="100" /> you need initialize collection in view model's constructor, or call add() method constructor. btw, add() method doesn't use parameter.

android - Permission required to use UsageStatsManager -

i'm trying use usagestatsmanager. understand need put following android manifest: <uses-permission android:name="android.permission.package_usage_stats" tools:ignore="protectedpermissions" /> however, eclipse throws following error when try that: prefix "tools" attribute "tools:ignore" associated element type "uses-permission" not bound. how declare permission properly? in manifest file, have add tools namespace. can declare way: xmlns:tools="http://schemas.android.com/tools" for example in manifest tag: <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> . . . </manifest>

angularjs - R10 boot timeout error deploying Angular 2 to Heroku -

i'm trying deploy angular 2 app heroku. it's building fine, , works fine on local system, error: 2016-07-11t11:01:22.279789+00:00 app[web.1]: > tlbi@4.0.0 start /app 2016-07-11t11:01:29.109068+00:00 app[web.1]: [1] 2016-07-11t11:01:29.109079+00:00 app[web.1]: [1] > tlbi@4.0.0 lite /app 2016-07-11t11:01:29.187537+00:00 app[web.1]: [0] > tlbi@4.0.0 tscw /app 2016-07-11t11:01:29.888677+00:00 app[web.1]: [1] did not detect `bs-config.json` or `bs-config.js` override file. using lite-server defaults... 2016-07-11t11:01:29.890117+00:00 app[web.1]: [1] ** browser-sync config ** 2016-07-11t11:01:29.904639+00:00 app[web.1]: [1] watchoptions: { ignored: 'node_modules' }, 2016-07-11t11:01:29.904641+00:00 app[web.1]: [1] server: { basedir: './', middleware: [ [function], [function] ] } } 2016-07-11t11:01:30.090493+00:00 app[web.1]: [1] [bs] access urls: 2016-07-11t11:01:30.090728+00:00 app[web.1]: [1] --------------------------------------- 2016-07-11t1...

c++ - cuda multiple image erosion not work -

Image
i'm trying implement multiple black(0) , white(255) image erosion cuda,i use square (5x5)structure element .the kernel had implemented take unsigned char array buffer in stored nimg images 200x200 px . allow erosion of multiple image simultaneosly make grid 3d structure: each block has dimension of strel (5x5) the grid has height = image_height/blockdim.y , width = image_width/blockdim.x , z = nimg i've try implement extending sample . the problem if store pixels block of threads consider shared buffer shared between threads of block; allow fast memory access, algorithm doesn't work properly.i try change bindex me make mistake,but cannot found solution. any suggestion? here's code: //strel size #define strel_w 5 #define strel_h 5 // distance cente of strel strel width or height #define r (strel_h/2) //size of 2d region each block consider i.e neighborns each thread in block consider #define block_w (strel_w+(2*r)) #define block_h (strel_h...

c++ - GCC compiler output for specific functions -

i trying use gcc auto vectorization perform optimizations , see diagnostic informations whether optimizations have been done or hinders performance. use -fopt-info- option this, applying flag whole build or file, generates tons of informations have dig through. looking way limit output specific functions. done? piece of code looks this: template<unsigned inoutvectoraligment = 1, typename inoutvectortype> inline void swapvaluesinvector(inoutvectortype* __restrict__ inout, inoutvectortype oldvalue, inoutvectortype newvalue, int vectorlength) { inout = (inoutvectortype*)__builtin_assume_aligned(inout, inoutvectoraligment); for(int = 0; < vectorlength; ++i) { inout[i] = inout[i] == oldvalue ? newvalue : inout[i]; } } //static inline void changezerostoones(unsigned char *array, int arraylength) //__attribute__ ((optimize("-o3"), optimize("-ffast-math"), __target__("avx"))); #pragma gcc optimize ("-o3...

javascript - Adding Blending mode to HTML5 instance and/or shape -

i have made html5 animation using animate cc. software doesn't support blending-modes html5-canvases found ( http://blogs.adobe.com/webplatform/2014/02/24/using-blend-modes-in-html-canvas/ ) guide how add blending modes html5-canvas. problem is, adds multiple elements (shapes/instances/images) in html-5-canvas, , want add id specific elements in canvas. this js generated animate cc, failed attempt add blending mode. // col-yellow this.instance_21 = new lib.colyellow(); this.instance_21.settransform(598.6,184.4,0.449,0.449,0,0,0,43.8,43.9 this.instance_21.globalcompositeoperation = "multiply"; //my code

node.js - Change/ rewrite value in the package.json via the terminal -

i using 'cat package.json' view json file in terminal. because testing different modules, want replace main value can try different files entry point. : "main": "index.js", above rather change index.js via command line. you can use vim ( https://github.com/vim/vim ) or nano ( https://www.nano-editor.org/ ).

Windows 10 (UWP) manifest issue -

my uwp app has these package.manifest extensions content: <extensions> <extension category="windows.activatableclass.inprocessserver"> <inprocessserver> <path>mobilepos.win10.exe</path> <activatableclass activatableclassid="pclutilitiesuniversel.companioninfo" threadingmodel="both" /> <activatableclass activatableclassid="pclutilitiesuniversel.devicemanager" threadingmodel="both" /> </inprocessserver> </extension> <extension category="windows.activatableclass.inprocessserver"> <inprocessserver> <path>pclserviceuniversel.dll</path> <activatableclass activatableclassid="pclserviceuniversel.transout" threadingmodel="both" /> <activatableclass activatableclassid="pclserviceuniversel.pclservice" threadingmodel="both" />...

wpf - c# xaml project with System.Management.Automation -

when adding code project.csproj use ps snapin , commands i'm encountering error during compilling: cannot find type system.systemexception in module mscorlib.dll can suppressed? or there no way? include code: <itemgroup> <reference include="system.management.automation" /> </itemgroup> you can try delete reference, if necessary should consider automation library isn´t in global assembly cache need reference dll. in computer dll in path: c:\program files (x86)\reference assemblies\microsoft\windowspowershell\3.0\ the reference in ".csproj" should like: <reference include="system.management.automation, version=3.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35, processorarchitecture=msil"> <specificversion>false</specificversion> <hintpath>..\..\..\..\program files (x86)\reference assemblies\microsoft\windowspowershell\3.0\system.management.automation.dll</hintpath>...

SQLite Encryption in Universal Windows Platform C# -

i'm using sqlite.net-pcl v 3.1.1 nuget package , vs extension sqlite universal windows platform 3.13.0.0. , code in windows 10 application in c# , xaml: private void connecttodb() { var sqlpath = system.io.path.combine(windows.storage.applicationdata.current.localfolder.path, "persons.sqlite"); using (sqlite.net.sqliteconnection conn = new sqlite.net.sqliteconnection(new sqlite.net.platform.winrt.sqliteplatformwinrt(), sqlpath)) { var res = conn.execute("pragma key = 'mypass'"); conn.createtable<person>(); conn.insert(person.newpersion()); } } public class person { public static person newpersion() { return new person() { uuid = guid.newguid().tostring(), name = "john", age = 12 }; } [primarykey] public string uuid { get; set; } public string name { get; set; } public int age ...

Oracle Service Bus multiple operations inside exposed SOAP service -

Image
currently developing ws osb using jdeveloper 11. have simple web service, calls external soap service. my composite.xml file: operations of bpel soap service operations of remote soap service bpel component i have few questions regarding current development strategy. how shall add new operations bpel soap? added new method (getcompanydetails()) editing apusbpelprocess.xsd (added new request , response types) , apusbpelprocess.wsdl (added new operation, message , etc). is correct way adding new operations? now can call 1 method of remote soap service using "invoke" component bpel constructs. my bpel design: how can call bind method bpel soap (1) method remote service (2) ? example: when client calls method process bpel soap (1), want validation on input parameters , call getservicecompanies remote soap (2). , when client calls method bpel soap (1) want call other methods on remote soap (2). will thankful if can show me diagram, required component...

ruby on rails - fetch different keys with different attributes(params) -

def appliance_params params.require(:tv).permit(:x, y:, :z) end in example receive key 'tv' , values x, y, , z. how can modify function receive different keys ? this function can receive different appliances, can receive :iron, :computer etc... different values. i receive 1 appliance in params. def appliance_params params.require(:tv).permit(:x, :y, :z) end is specific tv model. to other params use: params[:iron] or if iron param part of tv take in permit call: def appliance_params params.require(:tv).permit(:x, :y, :z, :iron) end

C# Nhibernate how to join queryover one to many -

i new nhibernate query. have oracle table 1 many relationship have mentioned below. have done fluent nhibernate mapping , trying run below query keep getting error saying chinfo_id not valid. can me doing wrong here. var query = session.queryover(() => logalias) .inner.joinqueryover(()=>logalias.chinfo, ()=>chinfoalias) .where(()=>logalias.regdate.isbetween(fromdate).and(todate)) .future<log>(); return query.tolist(); tables: ch_info ch_no name log portid regdate ch_no class , fluentnhibernate maps: public class log { public virtual int portid { get; set; } public virtual datetime regdate { get; set; } public virtual chinfo chinfo { get; set; } } public class chinfo { public chinfo() { logs = new list<log>(); } public virtual string id { get; set; } public virtual string name { get; set; } public virtual ilist<log> logs { g...

python - Logical MultiIndexing in Pandas -

is there way extract values of b index one c greater zero? want extract values -0.22 , -1.21 . import numpy np import pandas pd arrays =[np.array(['one','one','one','two','two','two']),np.array(['a','b','c','a','b','c'])] df = pd.dataframe(np.random.randn(6,5),index=arrays) df 0 1 2 3 4 1 -0.908680 0.031505 -0.087090 -0.039527 0.221196 b 1.010757 1.272553 -0.220535 -1.216996 -0.122108 c -0.781714 -1.830215 0.584311 0.010987 -0.050355 2 -0.331269 0.410596 0.569802 1.455710 0.377796 b 0.079330 -2.538031 -1.665904 0.477257 0.500805 c -0.388749 2.188289 -1.465292 0.594870 -0.031983 you can create mask , use loc mask : import numpy np import pandas pd np.random.seed(1) arrays = [np.array(['one','one','one','two','two','two'])...

javascript - Append data to formData object -

i seem not additionally data added "formdata". first add input file: var form = $('#uploadform')[0]; var formdata = new formdata(form); var input = $("#uploadphoto")[0]; //add input file data formdata formdata.append(input.name, input.files[0]); this works fine. , php var_dump after "ajax call" results: array(1) { ["uploadphoto"]=> array(5) { ["name"]=> string(5) "1.xls" ["type"]=> string(24) "application/vnd.ms-excel" ["tmp_name"]=> string(40) "..../tmp/phpmyn3e1" ["error"]=> int(0) ["size"]=> int(42799) } } now i'd add data passing on php script: formdata.append('usr', selectedusr); formdata.append(input.name, selectedusr); formdata.append('usr', 'usr: '+ selectedusr); when check php var_dump, there no "usr" data in array. why? ...

.net - What does the "Be optimistic on external API" option do? -

in "static checking" options code contracts there option named "be optimistic on external api" . cannot find documentation on option does. how affect analyzer's behaviour? there indeed not seem documentation option. browsing source gives few clues. in options.cs links boolean lowscoreforexternal : [optiondescription("be optimistic on external api? assign proof obligations depending on low score")] [donothashincache] public bool lowscoreforexternal = true; where in warningscoresmanager used during initialization set score assigned info in external assembly. option turned on, same score applied if referencing different assembly applied framework assembly, otherwise high penalty applies. private void initializedefaultvaluesforcontextsofcalleeassumecandischarge (bool lowscoreforexternalapi) { // ... scorecalleeassumeextrainfodeclaredinaframeworkassembly = .05; scorecalleeassumeextrainfodeclaredinadifferen...

mysql - Optimizing queries on a relational DB where entities are full json objects and with another table with entity-value design -

in database, entities stored full json formatted objects. there table properties of entities. each property of entity stored own row. in sense, second table holds properties of json entity. i'm aware terrible design violating normal forms , anti-pattern called entity-attribute-value. for simple query, must make number of joins , terrible performance. i wonder if there way optimizing queries reducing number of joins? solutions out of question since there lots of constraints: normalizing tables migrating nosql engine by way, database engine mysql 5.6.21. if update mysql db version of mysql, can create queries on json objects directly? thank in advance. mysql 5.7.8 supports json datatype. without more details, it's hard see if - faster eav queries have do.

Internally load balance Docker Containers using Azure Container Service -

i using azure container service docker swarm host containers. containers running asp.net core web api , have private port exposed. trying use haproxy internal load balancer in front of these containers in turn exposed through port 8080 on azure container service. here haproxy.cfg global log 127.0.0.1 local0 log 127.0.0.1 local1 notice #log loghost local0 info maxconn 4096 chroot /usr/local/etc/haproxy uid 99 gid 99 defaults mode http timeout connect 5000ms timeout client 50000ms timeout server 50000ms frontend http-in bind *:8080 default_backend servers backend servers server server1 10.0.0.4:8080 maxconn 32 server server1 10.0.0.5:8080 maxconn 32 server server1 10.0.0.6:8080 maxconn 32 with docker swarm orchestrator, acs creates load balancers (separate agents , masters) in swarm based cluster. not need worry anymore. see sample demonstration here: " microsoft azure container service engine - sw...

selenium webdriver - ElementNotVisibleException: Element is not currently visible and so may not be interacted with -

i getting elementnotvisibileexception page has no duplicate names name of "history" have "calls history". can suggest best locator locate element? <li class="ui-widget ui-menuitem ui-corner-all ui-menu-parent" aria- haspopup="true" role="menuitem"> <a class="ui-menuitem-link ui-corner-all" href="javascript:void(0)"> <span class="ui-menuitem-text">history</span> <span class="ui-icon ui-icon-triangle-1-e"></span> </a> the error org.openqa.selenium.elementnotvisibleexception: element not visible , may not interacted (warning: server did not provide stacktrace information)command duration or timeout: 122 millisecondsbuild info: version: '2.52.0', revision: '4c2593c', time: '2016-02-11 19:03:33'system info: host: 'rsn-ga-78lmt-s2', ip: '127.0.1.1', os.name: 'linux', os.arch: 'am...

ios - Cannot specialize non-generic type 'Set' -

this nsmanagedobject : @objc(order) class order: nsmanagedobject { @nsmanaged var orderitems: set<orderitem> //error: cannot specialize non-generic type 'set' } anyone know why doesnt work? orderitem file created , works following declaration: @nsmanaged var orderitem: orderitem just reference if should come question in future nasty bug, since discussion went on in comments. yes, default set type in swift generic, in case custom non-generic set class shadowing class defined language's standard library. better choose different names classes, avoid name clashes. if needed, can use qualified name of classes refer class want. standard language classes available under swift. namespace, while other classes can use name of module followed dot , name of class (e.g. foundation.nsstring).

winforms - Windows form has disappeared in Visual Studio form designer -

yesterday edited form in visual studio's form designer. when returned today, designer shows nothing. can open properties window, select different constituent components , edit properties, not show up. application builds fine , form can run usual. i've tried couple of different solutions, such checking .csproj file has form.designer.cs included, nothing has worked. strangely, did see problem earlier in week, fixed when unlocked computer after returning coffee break. any suggestions? weird, after trying hour ended solving issue 30 seconds after posting this! i edited size property of item on form using properties tab, saved form, , reverted form.cs, form.designer.cs, , form.resx files latest source control version. at point form jollily re-appeared. edit: fwiw, didn't work form exhibiting same problem. edit 2: other form has fixed after coming lunch , unlocking pc... might how affects display - shifts on right hand monitor when that. edit 3: ok, ...

python - How to fix Selenium WebDriverException: "The browser appears to have exited" -

i got exception when want use firefox webdriver raise webdriverexception "the browser appears have exited " webdriverexception: message: browser appears have exited before connect. if specified log_file in firefoxbinary constructor, check details. i read this question , updated selenium, have same problem. my code : driver = webdriver.firefox() time.sleep(5) driver.get('http://www.ooshop.com') update i read this question and have error oserror: [errno 20] not directory exception attributeerror: "'service' object has no attribute 'process'" in <bound method service.__del__ of <selenium.webdriver.firefox.service.service object @ 0x407a690>> ignored if you're running selenium on firefox 47.0, need update firefox 47.0.1 which not released in ubuntu's main repos.. have add ppa: https://launchpad.net/~ubuntu-mozilla-security/+archive/ubuntu/ppa release notes: https://www.mozilla.org/en-u...

php - Laravel sync job and specific queue on the same command? -

i want dispatch new job on specific queue connection, thing want run right away (sync) on local machine. example: $job = ( new \myjobclass() )->onconnection('sqs2-connection'); dispatch( $job ); how can make sure job run sync on local env? found solution: $job = ( new \myjobclass() )->onconnection( env('queue_connection_2','sync') ); dispatch( $job );

ruby on rails - Organising data for a football (soccer) management simulation -

i'm trying create online football (soccer) management game ruby on rails, , it's quite ambitious me i'm finding parts challenging. i've coded basic match engine, when comes tactics, lineups, formations, etc. i'm finding more difficult organise various data , create relations in activerecord. same applies league , cup systems. i'll try provide brief overview here: a nation/club has first team , youth/u21 team a nation/club/team has players a nation/club/team has matches against others in league , cup systems a league system has 3 leagues in each division (pyramid system: 1 promoted, 3 relegated) a cup system has knockout matches (and mini-league group stages) including time , penalty shootouts a league/cup has rounds/match days each season a round/match day has matches a match has details e.g. scores/ratings a match has actions e.g. goal/assist a match has tactics/lineups each team e.g. formation/players any ideas how best organise in models?...

python - Modify other objects on update/insert -

i've got 2 mapped objects, parent , child. class parent(base) __tablename__ = 'parent' id = ... name = ... date_modified = column(sa_datetime, default=datetime.now, onupdate=datetime.now, nullable=false) class child(base) __tablename__ = 'child' id = ... name = ... date_modified = column(sa_datetime, default=datetime.now, onupdate=datetime.now, nullable=false) parent = relationship(parent, backref='parent') when child updated, want not child.date_modified changed, child.parent.date_modified . i tried this: @event.listens_for(child, 'after_update') def modified_listener(mapper, connection, target): if object_session(target).is_modified(target, include_collections=false): target.parent.date_modified = datetime.now() but doesn't work, because i'm in flush , sawarning: attribute history events accumulated on 1 clean instance withi...

android - Stay highlighted the selected item in navigation drawer -

i manually made navigation drawer using actionbardrawertoggle , drawerlayout , want selected item stay highlighted, either when open drawer or close selected item(fragment) should highlighted using color. have listview in drawer. drawer.xml (fragment) <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#34344d" android:orientation="vertical" > <listview android:id="@+id/drawerlist_1" android:dividerheight="0dp" android:divider="#fffff7" android:layout_weight="1" android:listselector="@drawable/list_view_scolor" android:layout_width="fill_parent" android:layout_height="0dp" > </listview...

make a dict/json from string with duplicate keys Python -

i have string parsed json or dict object. string variable looks : my_string_variable = "{ "a":1, "b":{ "b1":1, "b2":2 }, "b": { "b1":3, "b2":2, "b4":8 } }" when json.loads(my_string_variable) , have dict second value of key "b" kept, normal because dict can't contain duplicate keys. what best way have sort of defaultdict : result = { 'a':1, 'b': [{'b1':1,'b2':2}, { 'b1':3, 'b2':2,'b4':8 } ] } i have looked similar questions deal dicts ...

node.js - Angular2 with NodeJS and Typescript error -

Image
i have attempting set simple application in angular2, nodejs , typescript having errors getting angular2 application error instantiate. getting following errors: es6-shim.js:1 uncaught syntaxerror: unexpected token < angular2-polyfills.js:1 uncaught syntaxerror: unexpected token < system.src.js:1 uncaught syntaxerror: unexpected token < rx.js:1 uncaught syntaxerror: unexpected token < angular2.dev.js:1 uncaught syntaxerror: unexpected token < http.dev.js:2 uncaught referenceerror: system not defined(anonymous function) @ http.dev.js:2 (index):15 uncaught referenceerror: system not defined i unsure why happening? seems issue index.html file calls of angular2 script dependencies , instantiates systemjs functionality. here file: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>angular 2 quick start</title> <base href="/"/> <script src="../node_modules/es6-shim/es6-...

cmd - How to execute a command line in C# -

Image
i have problem executing command line in c#: i try: string mon_cmd=@"c:\windows\system32>consoletest.exe --asmrz c:\temp\test_cmd\image.jpg c:\temp\test_cmd\"; system.diagnostics.process.start("cmd.exe", @"/c ' mon_cmd'"); but error. how can execute exact command? provided consoletest.exe in c:\windows\system32 (which not seem idea that's topic) string mon_cmd = @"c:\windows\system32\consoletest.exe"; string arguments = @"--asmrz c:\temp\test_cmd\image.jpg c:\temp\test_cmd\"; system.diagnostics.process.start(mon_cmd, arguments); should job and suggested cfrozendeath , nyerguds, if want use mon_cmd in string, have several options such as: build new string using + operator, stringbuilder or if on c#6 string interpolation: string arguments = $"/c ' {mon_cmd}'"; (and don't need verbatim string one)

unix - Merge two multi-column files based on one common column -

i have 2 tab-separated columns want merge based on common column. example: file 1: abandoning 0 v abandonment 0 n abandonments 0 n abandons 0 v abducted 0 v abduction 0 n file 2: abandonment abducted abduction abound abounds abundance abundant accessable i want merge these files third file has empty value if information not available. file 3 (desired result): abandoning 0 v abandonment 0 n abandonments 0 n abandons 0 v abducted 0 v abduction 0 n abound abounds abundance abundant accessable i have been looking around here , here , here . far, closest thing have seen this: awk '{a[$1]=a[$1] fs $2} end {for (i in a) print a[i]}' origfile.txt tomerge.txt | sort > merged_dict.txt however, results not include third column information. result obtain is: abandoning 0 abandonment 0 abandonments 0 abandons 0 abducted 0 abduction 0 abound abounds abundance abundant accessable any hints going wrong? ...

python - Debug Django project with environment in docker container -

i running django project environment in docker container ok, when want debug project, pycharm run python2.7 -u /opt/.pycharm_helpers/pydev/pydevd.py –multiproc –qt-support –client 10.0.2.2 –port 56359 –file /opt/project/manage.py runserver 0.0.0.0:8000 no cython.... run "/usr/local/bin/python2.7" "/opt/.pycharm_helpers/pydev/setup_cython.py" build_ext –inplace and stack... using advice https://youtrack.jetbrains.com/issue/py-18913#comment=27-1373843 connect manually pycharm_helpers volumes docker container pycharm settings (see temp2.jpg ) then manually run "/usr/local/bin/python2.7" "/opt/.pycharm_helpers/pydev/setup_cython.py" build_ext –inplace setup_cython build successfully, commit image installed cython inside, start debug again , see : python2.7 -u /opt/.pycharm_helpers/pydev/pydevd.py –multiproc –qt-support –client 10.0.2.2 –port 56359 –file /opt/project/manage.py runserver 0...

c# - ASP.NET Core Authenticating Clients (Console/WPF) -

i've searched far , wide working (simple) solution authentication in asp.net core date. sorry if have missed , if has provided solution, here comes question: i've buil asp.net core mvc/api solution identity/ef cookieauthentication. can log in/out in mvc , set claims/roles user. i have wpf client whom i'd authenticate , connect api. far have attempted use httpclient sign in same way in asp.net - signinmanager credentials. how persist session/cookie/token wpf client future httprequests authenticated through built in identity? have tried deriving own webclient public class myclient : webclient { private readonly cookiecontainer _container = new cookiecontainer(); protected override webrequest getwebrequest(uri address) { httpwebrequest request = (httpwebrequest)base.getwebrequest(address); if (request == null) throw new invalidoperationexception("request == null"); request.automaticdecompression = de...

py.test - How do I get a pythonic list of all the pytest tests in a folder? -

something --collect, python , not cmd, returns list of paths. tried see how pytest , can't seem ro find it. thanks! all collected tests stored attribute items of session . can access session object by session level fixture pytest plugins, example: pytest_runtestloop or pytest_sessionstart example: @pytest.fixture(scope='session', autouse=true) def get_all_tests(request): items = request.session.items all_tests_names = [item.name item in items] all_tests_locations = [item.location item in items] # location tuple of (file_path, linenumber, classname.methodname) if want more info object session or item , of cause can read docs or source code, prefer use pdb.set_trace dig object.

ms office - How can I define a keyboard shortcut for inserting a multilevel list in Word? -

Image
i know keyboard shortcut start flat list ( ctrl + shift + l ), apparently there none multilevel lists (at least found nothing after hours of googling).. i tried define 1 myself, couldn't find where. any ideas? thank you! when want multilevel list, looking for? me, start list mentioned, ctrl + shift + l . begin type, , typed becomes top-level bullet point. i can hit return , , typing on top-level bullet point. i can hit return again, followed tab , indents bullet, creating second level of bullets. go back, hit shift + tab . updated due better understanding of question: the easiest way achieve that, think, create shortcut style directly. (in word 2013), click down arrow next multilevel list button on home tab of ribbon, , click "define new list style..." once you've set style way want it, click format button @ bottom-left, , add keyboard shortcut.

javascript - JQuery Mobile selectmenu() multiple option true/false -> not refreshing the displaying of choices -

Image
regarding jquery , jquerymobile, code in jsfiddle link: https://jsfiddle.net/nyluje/jg5cgw76/7/ i use flipswitch change, if select object has attribute multiple or not. at first flipswitch off , attribute multiple not apply on select . if use select , can choose 1 single option (this works fine). then turn flipswitch on . code implemented in function setselectaccordingtofs() attribute multiple added select , possible pickup multiple options. 1 notices pop-up , not native menu one, not display multiple select correctly, on picture: it keeps on displaying single select panel . allow add options, does not provide possibility take off some : hence wonder: how refresh select panel menu used select , depending on attribute multiple value:'off' or 'on', on select tag? any idea? ok found solution. implemented in version of jsfiddle: https://jsfiddle.net/nyluje/jg5cgw76/8/ the trick: using option 'refresh' wasn't enoug...

Javascript: Calculate balance and advance through text field input -

i beginner javascript. have code through user enters value through input field ('to enter given fees'). want is, if user types more '1000', advance value should come in input text('advance fee'). if user types less '1000', balance amount should come in text input ('balance fees'). my fiddle carries way worked in. my html form : <form> <div class="tbl_admission_formcell">given fees</div> <div class="tbl_admission_formcell" style="padding:10px;"><input type="text" name="given_fees" value="" id="given_fees" onkeypress="givenfees()" onkeyup="givenfees()"/> </div> <div class="tbl_admission_formcell">balance fees</div> <div class="tbl_admission_formcell"><span id="balance_fees"></span> </div> <div class="tbl_admission_formcell"...

php - Silex DoctrineORM: Custom Entity Repository -

i have issue when trying build custom entity repository. "php message: php fatal error: class 'doctrine\orm\entityrepository' not found in /home/user/projects/app/src/application/database/entityrepository/userrepository.php on line 8 in customrepository.php file have done this: <?php namespace application\database\entityrepository; use application\bootstrap bootstrap; use doctrine\orm\entityrepository; class userrepository extends \doctrine\orm\entityrepository { public function getpasswordbyusername($username) { $query = $app['orm.em']->createquery('select u.password application\database\entities\users u (u.username = :username)'); $query->setparameter('username', $username); return $query->getoneornullresult(); } } and in bootstrap file method loaded through constructor in bootstrap class. use silex\provider\doctrineserviceprovider s...

Scala: constructor with two paretneheses -

i'm new scala. following syntax mean? case class user(val id: long)(val username: string) i've read currying in scala, explain please how related construction above (if related). thanks. just partially-applied functions, constructor (which function arguments constructed type) can partially applied, in case: scala> case class user(val id: long)(val username: string) defined class user scala> val userbuilder = user(123l) _ userbuilder: string => user = <function1> note type of resulting userbuilder - it's function string (the remaining parameter) user now, partially applied functions, can apply result string , user instance: scala> val user = userbuilder("a") user: user = user(123) scala> user.username res1: string = when useful? when want construct many instances common values subset of arguments, e.g.: case class person(lastname: string)(val firstname: string) class family(lastname: string, firstnames: l...

createjs - How can i add oncomplete evetn to movie clip generated from animate CC exporter -

i have canvas project created animate cc , need add "oncomplete" event movie clip generated animate cc canvas project , solution present createjs site : target.alpha = 1; createjs.tween.get(target) .wait(500) .to({alpha:0, visible:false}, 1000) .call(handlecomplete); function handlecomplete() { //tween complete } from tweenjs site i don't want modify js file generated animate cc , not find way hock movie clip tween i've tried access exportroot.mymovieclipinstancename.timeline tween not lock regards you shouldn't need access timeline directly -- movieclips fire "animationend" event when timeline complete. anywhere should able do: exportroot.instance.on("animationend", function(e) { console.log(e); }); you add code timeline in animate, same thing. this.on("animationend", function(e) { console.log(e); });

syntax - What does the "@" symbol mean in reference to lists in Haskell? -

i've come across piece of haskell code looks this: ps@(p:pt) what @ symbol mean in context? can't seem find info on google (it's unfortunately hard search symbols on google), , can't find function in prelude documentation, imagine must sort of syntactic sugar instead. yes, it's syntactic sugar, @ read aloud "as". ps@(p:pt) gives names the list: ps the list's head : p the list's tail: pt without @ , you'd have choose between (1) or (2):(3). this syntax works constructor; if have data tree = tree [tree a] , t@(tree _ kids) gives access both tree , children.

c# - Search and move -

i set search function search rich text box. go through text box , highlight different cases match. rich text box lists name goes next line want export not highlighted stuff whole name different text box. have far search function. private void search_button_click(object sender, eventargs e) { int index = 0; int count = 0; string temp = display_rich_text_box.text; //bool k; display_rich_text_box.text = ""; display_rich_text_box.text = temp; string[] fullname; while (index <= display_rich_text_box.text.lastindexof(search_text_box.text)) { //searches , locates text searching display_rich_text_box.find(search_text_box.text, index, display_rich_text_box.textlength, richtextboxfinds.none); //color selection: hightlights in yellow display_rich_text_box.selectionbackcolor = color.yellow; count = count + 1; fullname = ...