Posts

Showing posts from 2014

java - GWT Designer not working with Eclipse 4.2 service release 2? -

i'm trying this tutorial after having installed eclipse juno 4.2 service release 2 (java ee distribution) und following gwt installation instructions over here . however, neither windowbuilder entry under preferences, nor there windowbuilder entry in new projects dialog appearing. doing wrong? i'm running ubuntu 12.04.02 lts on amd64, , have tried oracle jdk 7u17 , ubuntu's own jdk6 distribution, no avail... just tried same in win2k3. exact same result. google starting annoy me. gwt 2.5.1 throws error when trying 1 of simplest projects... update: working extent. meaning: windowbuilder not recognize gwt designer's installation , offers install gwt designer eclipse 3.7 . designer toolbar's gwt selection possibilities therefore not there. update: bug filed . update: bug closed won't fix. don't care. they care. gwt magical development environment, under constant evolution. have race new versions of browsers, javascript , releases of ec

machine learning - Duplicate detection of customers -

what current algorithms exist detecting duplicate accounts same costumer? customers trying hide fact opened 2 different accounts. example, maybe changed name shorter version or used email account in second account. what kind of algorithm used that? not sure if minhashing idea here.

python - Why does this pip call succeed in Makefile but not via command line? -

i ran across in makefile recently: develop: pip install "file://`pwd`#egg=myproject" this works fine when called make develop when call same command via command-line errors out " no such file or directory: /home/slack/tmp/myproject#egg=myproject' " why work when it's in makefile not called explicitly command line? the file:// bit telling pip install local resource. pwd command tells local resource in current directory, , tacks on egg called. i assume make file sets egg naming convention holds lookup, , there may default variables or commands in makefile adjust it.

sql - Why use named key constraint (Eg: Foreign Key) -

this question has answer here: differences between “foreign key” , “constraint foreign key” 3 answers i not familiar sql , please explain me difference of following 2 , best way use. there advantage using 1 on another. create table employee ( emp_id int not null, dep_id int not null, ... foreign key (dep_id) references department(dep_id) ); and create table employee ( emp_id int not null, dep_id int not null, ... constraint fk_empdept foreign key (dep_id) references department(dep_id) ); the difference in naming. if don't explicitly set name constraint, has auto generated name. example: fk_ employee _dep_id__164452b1 . , you'll see name in description of table keys, in different exceptions , on.

ios - Strange Swift Protocol behaviour -

this question has answer here: cannot assign property in protocol - swift compiler error 3 answers having trouble using swift protocol simplify uipageviewcontroller: i have protocol protocol pagable { var pageindex: int? { set } } which have of uiviewcontrollers being presented uipageviewcontroller conform to. then in uipageviewcontroller, this: var vc = storyboardscene.challenges.acceptedviewcontroller() as! pagable vc.pageindex = index return vc as? uiviewcontroller which works, want is: var vc = storyboardscene.challenges.acceptedviewcontroller() (vc as? pagable)?.pageindex = index return vc and reason, whenever instead (which me feels same snippet 1), error on (vc as? pagable)?.pageindex = index saying "cannot assign immutable expression of type int? ". i'm thoroughly confused. love insight why type system doing me.

python - Image not displaying Django 1.8 ImageField -

here's models.py class item(models.model): author = models.foreignkey('auth.user') name = models.charfield(max_length=200) price = models.decimalfield(max_digits=20,decimal_places=2) description = models.textfield() created_date = models.datetimefield(default=timezone.now) image = models.imagefield(upload_to=settings.media_root) def list(self): self.published_date = timezone.now() self.save() def __str__(self): return self.name views.py def item_list(request): items = item.objects.filter(created_date__lte=timezone.now()).order_by('-created_date') return render_to_response('item_list.html', {'items': items}, context_instance=requestcontext(request)) urls.py urlpatterns = [ url(r'^admin/', include(admin.site.urls)), url(r'', include('shop.urls')) ] + static(settings.static_url, document_root=settings.static_root) and settings.py base_dir = os.path.dirname(os.path.dirname(__file__))

How do I keep reading from a keyboard in C while outputting results? -

i want read string , 4 integers display read read again string , 4 integers. want keep doing until end of file ( hitting ctrl + d). example : tennis 4 2 3 2 (hit enter) (the output) helloworld 2 8 7 4 (hit enter) (the output) here tried : #include <stdio.h> int main() { char name[30]; int won = 0; int lost = 0; int tie = 0; int streak = 0; int ch; while((ch = getchar()) != eof) { scanf("%s %d %d %d %d",name,&won,&lost,&tie,&streak); printf("%s%d%d%d%d",name,won,lost,tie,streak); } return 0; } while(scanf("%29s%d%d%d%d",name,&won,&lost,&tie,&streak) == 5) printf("%s%d%d%d%d",name,won,lost,tie,streak); from man -s3 scanf : these functions return number of input items matched , assigned

c# - How does WebEx addin knows that it's a WebEx Appointment it's updating in Outlook? -

when cancel or modify appointment in outlook, how webex knows it's webex meeting? does use event handlers on appointmentitems , check webex footer? or there flag or property set on appointmentitem? (which don't think, @ least not without extending appointmentitem: https://msdn.microsoft.com/en-us/library/office/dn320241.aspx ) what i'm looking do: have our own server store our appointmentitems , can create appointment able update server when user updates or deletes appointment calendar. need know when it's appointment created using our addin, must update server changes , ignore if appointment created using other program or locally in outlook.

Looking for Microsoft .NET based Open Source Intranet Solutions -

does know of microsoft .net based, open source, intranet solutions? have not been able find recent. i have used dnn in past. worked small intranet. http://www.dnnsoftware.com/

vb.net - An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dl -

on line line dim read oledb.oledbdatareader = cmd.executereader() it says: an unhandled exception of type 'system.data.oledb.oledbexception' occurred in system.data.dl. please can have done correct, not understand why register system not work. 'enables use of oledb classes. imports system imports system.data.oledb imports system.net.mail public class register 'determines connection , location within users file system. dim myconnstring string = "provider=microsoft.jet.oledb.4.0;data source=" & environment.currentdirectory & "\bloodbank.mdb" private sub register_load(sender object, e eventargs) handles mybase.load 'this line of code loads data 'bloodbankdataset.user' table. can move, or remove it, needed. me.usertableadapter.fill(me.bloodbankdataset1.user) 'bindingsource - encloses data source form, in case register. ' addnew, adds new record. me.userbind

c++ - How export old C dll for use in C# Class Library -

Image
there 2 old c files tow related headers . use them in visual studio 2013 created visual c++ win32 console application , disabled precompiled headers properties of project. deleted stdafx.h & targetver.h & dllmain.cpp && project_name.cpp(created vs) . in header files area added 2 files , in source files area added tow files. project : [ here entire project's link consider on .c file extensions(no .cpp ). in header files there no class usage , see many structs in there because of old c language. want export project's dll use in simple console application c# project. how can that? put peace of code in upper of both header files : __declspec(dllexport) int main(); int main() function inside wmm_file.c file , main function uses many functions in c file ( geomagnetismlibrary.c ). want use functions of c++ project in c# code. here c# codes ( prpogram.cs ) : using system; using system.collections.generic; using system.linq;

android - RemoteControlClient - is Audio Focus necessary/required? -

i'm newbie remotecontrolclient , i'm still looking it. however, i've seen can used media buttons play/pause on lock screen. anyway, question is, audio focus required remotecontrolclient work show on lock screen? don't have form of audio focus app (and maybe way media player implemented app not best way so), , lock screen controls aren't showing up. i'm finding randommusicplayer example little confusing, if helps answer @ all. yes, found out audio focus required have audio controls displayed on lock screen. implemented according randommusicplayer , works fine now. , yes agree randommusicplayer bit confusing sample. requires reasonable time figure out. here's nice tutorial audio focus can use http://developer.android.com/training/managing-audio/audio-focus.html .

c# - Passed Variables Null -

i building small web api syncing data , pulling down objects works great, pushing objects doesn't work no matter have tried. edited reflect changes: here controller: [system.web.mvc.httppost] public void updatetasks([frombody] string s) { console.writeline(s); } here client code: httpcontent c = new stringcontent("1234"); httpclient client = new httpclient(); c.headers.contenttype = new mediatypeheadervalue("application/json"); client.baseaddress = new uri("http://localhost/qaqc_syncwebservice/tasks/updatetasks/"); var resp = client.postasync(client.baseaddress, c).result; i can value though if put in uri, string content alone doesn't seem work. try [httpput] public void updatetasks([frombody]string s) { console.writeline(s); } please note: [frombody] parameters must encoded =value final hurdle remaining web api requires pass [frombody] parameters in particular

multithreading - How to workaround huge pthread memory cost in FlasCC? -

we've got quite massive codebase compiling , starting run in flascc. when open .swf, player's memory usage ~300mb. more or less fine, since seems there's still around 300mb of dynamically-allocated memory available c++ code. problems start when create threads. according documentation , every thread copies .swf in memory , runs in sandbox. mean every pthread eat same ~300mb of memory used player open .swf? it seems so. i've done simple test of spawning pthreads , dumping memory usage (what flash.system.system reports us, cmodule.ram.length ). here's log: starting 10 threads. memory usage: total=288mb private=335mb free=2mb cmodule=33mb thread 0 started. memory usage: total=683mb private=732mb free=1mb cmodule=36mb thread 1 started. memory usage: total=1071mb private=1121mb free=1mb cmodule=37mb thread 2 started. memory usage: total=1459mb private=1510mb free=1mb cmodule=38mb at point plash_player_debugger has exited (crashed) without error messages. th

Apply proguard to a Java Library Project -

i have java library project contains dependency guava library. guava has near 11k methods count, , expect of users came android community. on android there limit count method, 65k... but total count methods of library 11.400, library's code under 200 lines. i able download , shrank guava jar using proguard, reducing count method number 1k. project needs contain reference shrank jar, instead reference remote repository guava hosted. but jar added project discard maven when published @ remote repository artifact, guava dependencies not resolved , application client crash. guava advices not use proguard if “application” library, , leave users of library deal situation, using proguard in order shrank guava. don’t idea, because offer easy configuration solution. as far know, output proguard provides sort of executable (jar, apk, etc), so, if shrank own library, final output jar, , jar, again, not published artifact, because discarded (i tried several times). is there

rails has_many through for multiple models - no method for nil:class -

i have model properties, residents , people(people outside city have not residents) , have owner join table set if property belongs resident, or person here models class property < activerecord::base has_many :owners, dependent: :destroy has_many :residents, through: :owners has_many :people, through: :owners belongs_to :ptype end class resident < activerecord::base has_many :owners, dependent: :destroy has_many :properties, through: :owners end class person < activerecord::base has_many :owners, dependent: :destroy has_many :properties, through: :owners end class owner < activerecord::base belongs_to :resident belongs_to :property belongs_to :person end i want have view show relation if owner.resident show properties or if owner.person show properties <% if @owner.resident %> <ol><% @residents.properties.each |property| %> <li><%= property.ptype.name %> , <%= proper

algorithm - Are there more than one families of flow networks with non unique minimum cuts? -

Image
i'm wondering if way construct flow network several minimum cuts include @ least 2 consecutive edges same capacity, such 1 of them in minimum cut edge set. it's clear simplest kind of such network path edges of same capacity, in case 1 of |e| edges can edge separating s t. is way construct such networks? if so, how can prove it? i don't think true: consider network: a->b capacity 4 b->c capacity 2 a->c capacity 1 c->d capacity 3 we can either have cut (a,b,c)/(d) or (a,b)/(c,d) both cut of 3.

javascript - How read of Object.keys() value JSON? -

how read of object.keys() value json ? i trying read value key name , give error: keys dynamic { "marka1": { "name": "mika", }, "beti1": { "name": "yii", } } var ojson = json.parse(objectjson); var keys = object.keys(ojson); //read key console.log("test - " + ojson.keys[0].name); //give error change console.log("test - " + ojson[ keys[0] ].name); because keys[0] string.

javascript - Fit container inside element with table layout -

i need fit container inside table cell. currently, unable so, , container shows when manually set height. here fiddle showing issue. https://fiddle.sencha.com/#fiddle/13ug if set container height (say, 300), container displayed. however, container automatically fit colspan/rowspan , resize according table. could please help? thanks! this auto size container fill 100% of cell height - if cell height increases. initcomponent: function() { var me = this; var tester2 = ext.create("ext.container.container"); ext.apply(tester2, { height: "100%", layout: "fit", style:"background-color: red", colspan: 5, rowspan: 2, });

activerecord - rails active record group by for child class -

class goal has_many :tasks end class task belongs_to :goal end for each goal, tasks grouped task attribute size. in view can display table shows number of tasks each size. goal size count sm 5 med 3 lg 4 xl 2 goal b size count sm 10 med 7 lg 8 xl 0 initially had table tasks , able achieve wanted with task.group(:size).count.sort_by { |size, _| size } now have added parent class, goal, there way active query record tasks each goal , have tasks grouped size? if goal has many tasks can goal.tasks.group(:size).count.sort_by { |size, _| size } goal might goal = goal.find_by(id: 1)

google apps script - onEdit(e) not working in Add-on -

i've written script works great when used in native spreadsheet. trying publish add-on, , finding onedit(e) not working, when onopen(e) , oninstall(e) work fine. i've looked on documentation on authorization modes , installing/enabling add-on, think missing (hopefully straightforward) since beginner. should calling functions differently? or placement of onedit? appreciated. thanks!! function setup() { var ui = spreadsheetapp.getui(); var ss = spreadsheetapp.getactivespreadsheet(); var sheet = ss.getsheetbyname('send auto emails'); try {ss.setactivesheet(ss.getsheetbyname('send auto emails'));} catch (e) {ss.insertsheet('send auto emails', 0);} sheet.getrange(1,1).setvalue('recipient email address'); etc... } function onedit(e) { var ss = spreadsheetapp.getactivespreadsheet(); var sheet = e.source.getactivesheet(); var range = e.source.getactiverange(); if (range.geta1notation() == "c1" | range.geta1notation()

php - Blind Arithmetic Evaluation Differential : SQL Injection -

i getting sql & url injection vulnerabilities when scan website. code i'm using: if(isset($_get["id"])) { if(!is_int($_get["id"]) ==false) { //redirect person homepage } else { $sql = "select * workshop id=".trim($_get['id']); $result = mysql_query($sql); $row = mysql_fetch_assoc($result); $id = $row['id']; $prod_name = $row['prod_name']; $description = $row['description']; $image1 = $row['image1']; $image2 = $row['image2']; $image3 = $row['image3']; $pdffilename = $row['pdffilename']; $publish = $row['publish']; $workshop_date = $row['workshop_date']; $workshop_date_end = $row['workshop_date_end']; $course_desc = $row['course_desc']; $attend = $row['attend']; $trainer_detail = $row['t

ms access - SQL Add column to normalize time of different Oil Wells -

Image
i'm working on normalizing oil wells' production data can plot them if turn on @ same time. way add "normalized time" row table each well. normalized time reset 1 every time new introduced. i'm looking how add "normalized time" column below: i'm working in ms access sql. how go adding new "normalized time" column? need wells appear start producing @ same time , easier compare. you can use query: select *, (select count(*) yourtable t t.well_name = w.well_name , t.rpt_date <= w.rpt_date) [normalized time] yourtable w order well_name, rpt_date

jquery - Loading & executing audio.js on jQueryMobile AJAX page load -

i have page being displayed via jquery mobile has audio.js player on it. however, when page loaded via jquery mobile's ajax hijacking of click handler, audio.js code doesn't executed there no audio player. is there way can javascript code, such audio.js code, execute when pages being loaded via ajax? you can see example of issue going http://media.urbansermons.net/m/audio-list/term/6711 , clicking on of audios listed there. note test site. since user has click on item, if instead of loading new link in browser made switch list detail page using divs no opening new url use same click start player (since mobile devices makes necessary click event precedes play of audio/video. also on link sent mp3 come empty files.

php - Designing an object rendering system -

i wrote code consists of set of objects implement simple interface. these objects plain dto's. need rendered. each 1 requires it's own renderer. think ok there renderer interface has 1 method render , accept result resultinterface . each result item has different pieces of data need rendered. so happens each renderer checks receives correct type. although seems accepts implementing resultinterface doesn't. think, why bother type hinting on resultinterface . here few examples illustrate: <?php interface rendererinterface { public function render(resultinterface $result); } class exceptionfailurerenderer implements rendererinterface { public function render(resultinterface $result) { if (!$result instanceof exceptionfailure) { throw new invalidargumentexception; } } } class someotherfailurerenderer implements rendererinterface { public function render(resultinterface $result) { if (!$result instan

Taxee API (http://www.taxee.io/) - JavaScript - How To: POST Request and Pass Parameters -

thanks helping out question. i've been trying federal, state, , fica tax post request on taxee api ( https://market.mashape.com/stylinandy/taxee ), haven't been able working. able access data (simply figure out how api works) using 1 of 2 requests available api: var state = 'ca'; var year = 2014; var url = ' https://taxee.io/api/v1/state/'+year+'/'+state; var xmlhttp = new xmlhttprequest(); xmlhttp.open("get", url, true); xmlhttp.onload = function() { var result = json.parse(this.responsetext); console.log(result.single.income_tax_brackets); xmlhttp.abort(); } xmlhttp.send(); but data need in post request. know how access post request this, , more specifically, pass parameters noted on link above. can provide, it's appreciated. figured out how actually. problem way parameters passed differently in post requests. helps else out there: var url = 'h

sql - Implementation of blocked dates for a user-event ORM model -

in continuation of find entry value not intersect other value i have application (ruby on rails, activerecord, postgresql) uses user table, date table , event table in order track users , events dates on these events take place. event has many dates, , user has ability sign events via different table. the feature working on here users able block dates, can later find 1) users not have of dates in x[] blocked, , 2) side of user, events not consist of dates user has blocked. i using primitive approach, dates stored simple strings both users , events , operators: user.where.not("string_to_array(blocked_dates, ',') && string_to_array(?, ',')", "date1,date2...") i wondering if there database-oriented approaches of solving issue have better performance comparing array overlaps. postgres version: psql (postgresql) 9.4.5 table cardinalities: user - event: 1 many (if user of status manager) user - event: many many through differe

javascript - I can't get my angular ui-router nested states to work. Code inside -

i literally tried @ point, still learning , can't work. https://plnkr.co/edit/frnchlswhydbapr7gfqh?p=preview <a class="collection-item" ng-repeat="task in tasks" ui-sref="todo.detail({ todoid: task.todoid })"> {{ task.text }} </a> what trying do, routing /todo/1, /todo/2 , on "todo"-view, seem have problem $stateparams. it'd nice if guys me out , show me problem :). in addition adding id field task objects need put <section ui-view></section> in todo.html file. how nested states work. can use href oliver mentioned or stick sref. i've forked plunk here example.

Git - pulling causes deleting files -

after running 'git pull origin' against main branch, new files, committed, in branch marked deleted. have run git reset and git checkout ---. to recover files. in situation, how merge main branch branch? first, need after editing local files commit files following command: git pull origin and make change of files git add . git commit -m "text" then should commited pulling files remote repository following command: git push origin

python - Django Rest Framework: How can I patch a serializer for unit testing, when it's used in the serializer_class attribute? -

i have serializer create() function. when post request, want function called , create new object. when in browser, works , calls function. inside test, says function not called. think have done wrong patch, because in api set serializer_class , class called somewhere inside framework. thought was, not need test this, because should guaranteed rest_framework , if way, framework should call function correct parameters. # serializers.py class fooserializer(models.modelserializer): class meta: ... def create(self, validated_data): ... # apis.py class fooapi(generics.createapiview): serializer_class = fooserializer # tests.py @patch('apis.fooserializer'): def test_that_create_is_called(self, mock): mock.create = magicmock() mock.create.return_value = foo() # foo model response = self.client.post('/foo', {name: 'test'}) self.asserttrue(mock.create.called) # => output says "false not true" your

c# - Checkbox state not changed on postback -

i have following mark user control (.ascx) <table> <tr> <td> <asp:label id="label1" runat="server" text="select logical symbol search:"></asp:label> </td> <td> <asp:dropdownlist id="ddlcomponenttype" runat="server" onselectedindexchanged="ddlcomponenttype_selectedindexchanged" autopostback="true"> </asp:dropdownlist> </td> <td> <asp:checkbox id="chkadvsearchalllibs" runat="server" tooltip="check box search available libraries" text="search libraries"/> </td> </tr> <tr> <td> <asp:label id="label2" runat="server" text="search logical symbol properties:"></asp:label> </td> <td> </td> </tr> on page load protected void pa

javascript - braces around params -- why? -

this question has answer here: function parameter definitions in es6 1 answer i ran across in tutorial: const todos = ({todos}) => ( <div> <h1>todos</h1> {todos.map(todo => <p key={todo}>{todo}</p>)} </div> ) why parameter have braces around it? if i'd written myself, first line this: const todos = (todos) => (... is wacky new es6 syntax can't find documented? this syntax parameter object destructuring , introduced part of ecmascript 2015. todos function doesn't define single parameter named todos , instead accesses todos property of object that's passed in (and destructured). it equivalent following version: const todos = (_param) => { let todos = _param.todos; return ( <div> <h1>todos</h1> {todos.map(todo => <p key={todo}>

.net - Mapping new columns in a huge table in Entity Framework -

i have horrifically huge table/view (623 columns) upstream me, , need read source data application, , 2 new columns (varchar(255) , bit) need have been added latest release. using entity framework 6.0, using database first. caveats: absurd number of columns out of control, may able delete columns don't need in our local copy. it's view we're presented further upstream. i tried update model database, , new columns not added scalar properties. manually created scalar properties (string & boolean), resulted in error due no mapping table. however, when scroll thru table, don't see columns in list. can go sql , select columns in query, know exist. 2 properties created show in dropdown list of mapping details. is there upper limit how many columns picked ef? or manual way map scalar properties columns in underlying table when using db first? this @ least workaround: able columns show deleting table edmx file , adding again. old entity had 579 mapped col

complexity theory - Is the complement of the language CLIQUE element of NP? -

i'm studying np class , 1 of slides mentions: it seems verifying not present more difficult verifying present. ______ _________ hence, clique (complement) , subsetsum (complement) not members of np. was ever proved, whether complement of clique element of np? also, have proof? this open problem, actually! complexity class co-np consists of complements of problems in np . it's unknown whether np = co-np right now, , many people suspect answer no. just clique np -complete, complement of clique co-np -complete. (more generally, complement of np -complete problem co-np -complete). there's theorem if co-np -complete problem in np , co-np = np ,which huge theoretical breakthrough. if you're interested in learning more this, check out the wikipedia article on co-np , around online more resources.

c++ - Can I use an enum in a constructor for a class? -

i trying make class , inside of class want define enum called type. can use enum defined constructor class? if so, how access outside of class? class type { public: enum ttype { black, white, gray }; type(ttype type, std::string value); ~type(); ... this code doesn't give me errors when try create instance of class in class gives me error because black not defined: type piece(black, value); is there special way , still have ttype class constructor type class? first time using enums don't know how work exactly. yes can: type piece(type::black, value); enum ttype in scope of class type , have use scope resolution when accessing outside type 's body , member functions.

python - Merging txt files matchs conditions -

i have list of files in txt format in python in app this: ['pr00-1.txt', '900-2.txt', 'pr00-2.txt', '900-1.txt', 'pr900-3.txt', '00-3.txt'] i'm trying merge 00 files ['pr00-1.txt', 'pr00-2.txt', '00-3.txt'] in 1 00.txt file. same 900 files , on regardless on pr or -*.txt , * number. tried using split it's not helping. any idea how it? i think want. find 00 files regular expression open 00.txt , write files it. note solution isn't generalized xx pattern, , fails if 1 of files doesn't exist. i'll leave rest you. import re open('00.txt.', 'w') outfile: filenames = ['pr00-1.txt', '900-2.txt', 'pr00-2.txt', '900-1.txt', 'pr900-3.txt', '00-3.txt'] filename in filenames: match = re.search(r'(^|[^0-9])00.*.txt', filename) if (match): open(filename) infile:

python - Using a class field in another fields -

i have field in class depends on field in same class have problem code: class myclass(models.model): nation = [('sp', 'spain'), ('fr', 'france')] nationality = models.charfield(max_length=2, choices=nation) first_name = models.charfield(max_length=2, choices=name) i want put name = [('ro', 'rodrigo'), ('ra', 'raquel')] if nation = spain , name = [('lu', 'luis'), ('ch', 'chantal')] if nation = france. how can that? thanks! i think want change view user sees. have above underlying db model wrong place sort of feature. in addition (assuming web application), need in javascript, can change set of allowed names user changes nationality field.

c# - Control animation and execute script when animation ends -

Image
my project military fps , i'm having problems animations. i have 3 different weapons, 1 animator controller each 1 , every weapon has "enter" , "leave" animation. cs, cod, etc... i need know when "leave" animation ends disable gameobject, enable other 1 , play "enter" animation. i tryed this: http://answers.unity3d.com/questions/362629/how-can-i-check-if-an-animation-is-being-played-or.html without sucess. i'll leave here print of animator controller, hierarchy , script, if u need more details, need say. animator controller of weapon number 1 all transitions "sair" (leave animation) have trigger (ak47_sair) , transition "extit" state have trigger ("ak47_saircontrolador") on code, when press 2 (change weapon number 2) want transition. this hierarchy, script attached "jogador". with actual code, disable tha ak47 gameobject when leave animation still playing. using unit

language extension - How to customize comment block characters in visual studio code? -

i created language extension visual studio code , change comment block characters couldn't find way so.. has done or know how it? ok, figured out problem. there 2 ways can change comment blocks: 1 - config file i dont know why it's not in docs (or @ least couldn't find it) there optional property pass object inside contributes.languages array in package.json named configuration . the description found on vs code source code: a relative path file containing configuration options language. on files can create object 1 , it's gonna overwrite default comment characters { "comments": { "linecomment": "//", "blockcomment": [ "<!--", "-->" ] } } you can see properties on api references: https://code.visualstudio.com/docs/extensionapi/vscode-api#commentrule note: comment block command triggered different shortcut. can overwrite though (in general or specific lang

c# - Dynamically specifying lambda function parameters -

suppose have following line of code: context.load(itemcollection, item => item.include(i => i["title"], => i["name"])); is there way can dynamically specify parameters item.include() function instead of hard-coding them above? i ideally allow users select properties want retrieve of object such title , name , description , etc. fyi, here clientcontext.load function. function coming microsoft.sharepoint.client.dll public void load<t>(t clientobject, params expression<func<t, object>>[] retrievals) t : clientobject { if ((object) clientobject == null) throw new argumentnullexception("clientobject"); clientaction.checkactionparameterincontext(this, (object) clientobject); dataretrieval.load<t>(clientobject, retrievals); } i don't have necessary setup test it, work? string[] keys = ...; context.load( itemcollection , item => item .include(keys

scikit learn - Do test data for machine learning need to have column names? -

suppose have training data below: age:12 height:150 weight:100 gender:m age:15 height:145 weight:80 gender:f age:17 height:147 weight:110 gender:f age:11 height:144 weight:130 gender:m after train data , model, if need pass 1 test observation prediction, need send data column names below? age: 13 height:142 weight :90 i cases have seen people sending test data in array without column names. not sure how algorithms work. note: using python scikit-learn , training data dataframe. not sure whether test data should in dataframe format are predicting gender? if so, yes. input records columns: age , height , weight . otherwise, predicting on record missing gender value. keyerror if model not allow missing fields/columns. i not sure whether test data should in dataframe format in short: yes. usually this: # x input data, format depends on how model (pre)process data. # numeric matrix, list of dict's, list of s

Protractor - Change Browser Capabilities at RunTime -

is there way change browser capabilities within beforeeach of protractor suite. need set capabilities.name attribute before each spec execution. to create separate instances of desired capabilities, such capabilities.name, want try multicapabilities option available via protractor. example similar below , reside in conf.js file. allows submit unique name each test session. onprepare: function(){ var caps = browser.getcapabilities() }, multicapabilities: [{ browsername: 'firefox', version: '32', platform: 'os x 10.10', name: "firefox-tests", shardtestfiles: true, maxinstances: 25 }, { browsername: 'chrome', version: '41', platform: 'windows 7', name: "chrome-tests", shardtestfiles: true, maxinstances: 25 }], a complete example of can seen here: https://github.com/saucelabs-sample-test-frameworks/js-cucumberjs-protractor3.0/blob/master/conf.

ruby - How can I exclude external libraries in Rubymine -

rubymine taking on hour index new project because including every ruby file found on computer external libraries. i not want of these files included in project, cannot figure out how exclude them. if right click on them, have option delete them, deletes file instead of removing library , don't want that. have looked through settings , seen nothing setting external libraries. have ideas?

node.js - ffmpeg not working with piping to stdin -

i want stream file being uploaded ffmpeg. i'm using node.js , it's not working! i ended testing piping input ffmpeg local file, , doens't work either. here's code: var processvideo = function(videostream, resultpath) { var cmdparams = [ '-i', '-', '-y', '-f', 'mp4', '-vcodec', 'libx264', '-vf', 'scale=-1:720', '-f', 'mp4', resultpath ]; var ffmpeg = child_process.spawn('ffmpeg', cmdparams); var data = ''; ffmpeg.stdout .on('data', function(chunk) { data += chunk; }) .on('end', function() { console.log('result', data); }); var err = ''; ffmpeg.stderr .on('data', function(chunk) { err += chunk; }) .on('end', function() { console.log('error', err);}); videostream.pipe(ffmpeg.stdin); }; processvideo(fs.createreadstream(pathtolocalmp4file), localpa

Externalize mongo json query using spring boot -

i have started using spring data mongodb spring-boot . i have mongo based json queries added in interface using @query annotation when using spring data repository. i want know if possible externalize or separate out json query outside codebase can optimized separately , also not having mixed code. thanks suggestions. this code have added in interface , annotated @query annotation. @query("{ 'firstname' : ?0 ,'lastname': ?1}") list findbycriteria(string firstname,string lastname); the above simple example. have complex conditions involving $and , $or operators . what want achieve externalize above native mongo json query config file , refer in above annotation. spring data supports similar when using jpa hibernate. not sure if can same using spring data mongodb spring boot. do (i explaining api) suppose have entity user at top there user domain public class user extends coredomain { private static final long serialvers

vba - Import text files to excel and create master workbook -

i grad student , collect lot of data stored in txt files. want import text files fixed width, columns a, b , c 12, save files excel files , move them master workbook. found following code worked making master workbook not import them in numerical order. i using microsoft 2010. sub merge2multisheets() dim wbdst workbook dim wbsrc workbook dim wssrc worksheet dim mypath string dim strfilename string application.displayalerts = false application.enableevents = false application.screenupdating = false mypath = "c:\users\kyle\desktop\scan rate study 1-14-16" set wbdst = workbooks.add(xlwbatworksheet) strfilename = dir(mypath & "\*.xls", vbnormal) if len(strfilename) = 0 exit sub until strfilename = "" set wbsrc = workbooks.open(filename:=mypath & "\" & strfilename) set wssrc = wbsrc.worksheets(1) wssrc.copy after:=wbdst.worksheets(wbdst.worksheets.count) wbsrc.close false strfilename = dir() loop wbdst.worksheets(1).delete applica

web2py how to import module at the same directory? -

i have file name default.py in controllers,and file getmsg.py @ same directory, can't import getmsg in default.py . why not? how import it? the error: traceback (most recent call last): file "f:\xampp\htdocs\web2py\gluon\restricted.py", line 212, in restricted exec ccode in environment file "f:/xampp/htdocs/web2py/applications/tools/controllers/default.py", line 11, in <module> import getmsg file "f:\xampp\htdocs\web2py\gluon\custom_import.py", line 81, in custom_importer raise importerror, 'cannot import module %s' % str(e) importerror: cannot import module 'getmsg' in web2py, controllers not python modules -- don't import them. can put modules in application's /modules folder , import there. in theory, (assuming there __init__.py file in /controllers folder) can do: import applications.myapp.controllers.getmsg but wouldn't considered standard practice. in particular, contr