Posts

Showing posts from March, 2012

webrtc - How i create peer-connection without localStream? -

i want achieve one client send mediasteam , a nother received mediasteam. receiver client needn't add localsteam.and code pc.addstream(null).but not work. how achieve webrtc? don't call pc.addstream null . instead, don't call it. when receiver answerer , there it. when receiver offerer , need little work: you need specify these rtcofferoptions createoffer : { offertoreceivevideo: true, offertoreceiveaudio: true } the reason default, offerer offers receive same kinds of streams sending. know, dumb default, gives offerer bit more control. on upside, there's no harm in specifying these options, if matches desired behavior.

java - Failed to create EJBContainer -

i trying create ejbcontainer in order integration testing. here code: map properties = new hashmap(); properties.put(ejbcontainer.modules, new file[]{new file("target/classes"), new file("target/test-classes")}); ec = ejbcontainer.createejbcontainer(properties); ctx = ec.getcontext(); it throws exception: javax.ejb.ejbexception: can't find directory d:\jboss-4.2.3.ga\jboss-4.2.3.ga\common\lib there no common/lib directory in jboss folder. when debug code inside of ejbcontainer see problem in jbossstandaloneejbcontainerprovider class seems default container provider class. there way change provider? or maybe doing incompatible?

javascript - how can i hide text after any click on button in jquery -

how can hide text after 2 click on text in jquery? <!doctype html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script> $(document).ready(function(){ $("p").click(function(){ $(this).hide("slow"); }); }); </script> </head> <body> <p>if click on me, disappear.</p> </body> </html> code double click event. $("p").dblclick(function(){ $(this).hide("slow"); }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> <p>if click on me, disappear.</p> code second click event. $("p").click(function(){ if($(this).hasclass('one')) $(this).hide('s...

ruby on rails - How to use rspec to test a transaction block -

i wrapping code in transaction block i.e. tip.transaction ...make changes lots of tips... end the reason doing want make sure changes made before being committed database. how use rspec test if failure occurs before transaction completed, database rollback previous state? you can check no tip persisted in case of failure. doubt here failing tip means you, since that's reproduce in test. plain vanilla example: # app/models/tip.rb before_save :fail_if_bad_amoun def fail_if_bad_amount fail badamount if amount == 'bad' end def self.process(tips) tip.transaction tips.all? &:save end end # spec/models/tip_spec.rb "does not commit in case of failure in 1 of tips" good_tip = tip.new(amount: 1_000) bad_tip = tip.new(amount: 'bad') expect tip.process([good_tip, bad_tip]) end.not_to change { tip.count } end

Android - how to get the layout id from a view? -

hello fellow developers! i'll keep simple , short can, have fragment, , in oncreateview giving different layouts depend on status. is there way of knowing on layout am? code below: my oncreateview: @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view; if (programstate) { view = inflater.inflate(r.layout.fragment_home_program_on, container, false); } else { view = inflater.inflate(r.layout.fragment_home, container, false); } findviews(view); setupviews(); return view; } basically, "findviews" method gets view, , wondering if there's way know layout on switch statement example or that.. : private void findviews(view mainview) { switch(mainview) { case r.layout.fragment_home: //do work break; case r.layout.fragment_home_program_on: //do work break; } } i trying no suc...

sql - jOOQ - support for UPDATE ... SET ... query with arbitrary degree -

i have 2 functions: 1 returns list of fields, other returns select query (which selects corresponding values of fields). private list<field<?>> fields() { .... } private select<?> select() { ... } note degree determined @ runtime, depends on user input. hence list<field<?>> , select<?> . it possible insert table: context.insertinto(table, fields()).select(select())) it not possible update table: context.update(table).set(dsl.row(fields()), select()) could functionality added jooq 3.7? which workaround can use now? nice catch, there's missing method on updatesetfirststep dsl api, accepts rown first argument, type returned dsl.row(collection) . should fixed jooq 3.7: https://github.com/jooq/jooq/issues/4475 as workaround, , if can live guilt of hack, cast raw types: context.update(table).set((row1) dsl.row(fields()), (select) select()) you can cast dsl.row(fields()) row1 , because internal implementat...

php - How to ensure user is authenticated before he publishes an article in Laravel in the below scenario? -

i developing simple web blogging application in laravel 5.1. application contains 2 controllers, userscontroller , articlescontroller . the authenticate() , check() functions validate whether user authorized carry out operation in userscontroller , , store() , update() etc. features related articles in articlescontroller . how supposed call authenticate() or check() function articlescontroller before say, store() ing article database? laravel uses middleware, in controller need put this public function __construct(){ $this->middleware('auth'); //requires auth } and in routes need add code use middleware in needed controllers this route::group(['middleware' => 'auth'], function () { route::get('/', function () { // uses auth middleware }); route::get('user/profile', function () { // uses auth middleware }); }); read documentation of laravel middleware can create more mi...

node.js - Error Installing laravel-elixir on windows: npm ERR! EEXIST, open '\AppData\Roaming\npm-cache\837c67b9-adable-s tream-1-0-33-package-tgz.lock' -

i have fresh installation of laravel 5.1 . followed these steps set elixir, bootstrap, font-awesome etc. when run npm install throws error. tried using npm install --no-bin-links laravel elixir documentation suggests. $ npm install --no-bin-links npm warn optional dep failed, continuing fsevents@0.3.8 npm warn optional dep failed, continuing fsevents@0.3.8 > node-sass@3.2.0 install c:\users\user\phpstormprojects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass > node scripts/install.js binary downloaded , installed @ c:\users\user\phpstormprojects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node > node-sass@3.2.0 postinstall c:\users\user\phpstormprojects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass > node scripts/build.js ` c:\users\user\phpstormprojects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\no...

Getting "minimal" SSA from LLVM -

the llvm's opt -s -mem2reg pass produces so-called "pruned" ssa -- form has dead phi functions removed. keep phi instructions in ir, obtaining "minimal" ssa, i'm failing find easy way it. am doomed implement whole ssa construction algorithm scratch or there way existing tools? llvm doesn't have support forming other pruned ssa form, , it's unlikely grow such mechanism. quite literally don't work synthesize information when doing phi placement.

c# - Exclude certain fields when returning as json -

i have asp.net web api application. for lets application consists of user entity , post entity. post written user, every post entity contains reference user entity. class post { public int id { get; set; } public string title { get; set; } public string content { get; set; } public user user { get; set; } // reference user wrote post } the problem when want return list of posts json. don't want include writers of posts inside list, in other words, want exclude user field list of posts. example: [ { "id": 1, "title": "post a", "content": "..." }, { "id": 2, "title": "post b", "content": "..." } ] i know can creating new class called jsonpost without user field , converting list of post's list of jsonpost's linq, want solve without creating new class. thanks, arik ju...

eclipse cannot be opened after Windows 10 upgrade -

after update pc windows 8.1 windows 10, eclipse java se ide , ee ide cannot opened anymore. tried set windows 8 compatible didn't work. what did fix following: i downloaded latest version of eclipse , extract it. rename previous 1 (e.g., rename c://program files/eclipse c://program files/eclipse_old cope new eclipse previous directory (e.g., c://program files/eclipse) then, eclipse can run again. careful select right version of eclipse (32bit vs. 64bit).

java - Largest area in matrix -

Image
i've been aksed write program finds largest area of equal neighbour elements in rectangular matrix , prints size. tried construct 2d array numbers think should switch using tree or in order solve problem. chould suggest possible way of solving it? example: "hint: use algorithm depth-first search or breadth-first search." sounds standard maze search problem. suggest use recursion find elements haven't been before have same number 1 have found. can either update matrix go or create copy keep track of cells have visited. don't need tree or additional complex data structure. use algorithm depth-first search or breadth-first search these 2 types of recursive searches. suspect implement both of these see how behave.

email - Single OSSEC rule to supress alert_by_email -

im trying supress/ignore alert_by_email-option every ossec-rule. documentation suggests following: "some rules have option set force ossec sending alert email. option alert_by_email. 1 of these rules 1002. ignore these rules have create rule ignore it, or overwrite rule without alert_by_email option." however not find example creating single role ignore option. hope guys can me. add following rule in ossec/rules/local_rules.xml file: add rule @ bottom of file make sure within <group> tag. <group> ... .. ... <rule id="1002" level="2" overwrite="yes"> <options>no_email_alert</options> <description>unknown problem somewhere in system.</description> </rule> </group> this stop sending email alerts rule id=1002

How to correctly (re)pack omni.ja in Firefox? -

i try edit files in <firefox_dir>/browser/omni.ja . unpacked archive, did changes , used zip -qr9xd omni.ja * command repack archive suggested in about omni.ja . seems recommended command doesn't work since firefox refuses start: $ ./firefox --no-remote -p altprofile 1439747229638 addons.xpi warn exception running bootstrap method startup on adbhelper@mozilla.org 1439747229824 addons.repository warn cacheenabled: couldn't pref: extensions.getaddons.cache.enabled 1439747229825 addons.repository warn cacheenabled: couldn't pref: extensions.getaddons.cache.enabled 1439747229825 addons.repository warn cacheenabled: couldn't pref: extensions.getaddons.cache.enabled 1439747229825 addons.repository warn cacheenabled: couldn't pref: extensions.getaddons.cache.enabled 1439747229826 addons.repository warn cacheenabled: couldn't pref: extensions.getaddons.cache.enabled 1439747229826 addons.repository warn cach...

objective c - Retrieve images from Parse along its geolocation -

i geolocations annotations on map , show user related image same row in custom view. i've tried saving pffiles in dictionary along objectids because i'm setting each annotation's title location's objectid gives me - [pfobject objectid]: unrecognized selector sent instance . this i'm doing. pfquery *query = [pfquery querywithclassname:@"photoobject"]; [query findobjectsinbackgroundwithblock:^(nsarray *objects, nserror *error){ (id object in objects) { [self.annotationarray addobject:object[@"location"]]; nslog(@"annotation's coordinate : %@", self.annotationarray); uiimage *image = [uiimage imagewithdata:object[@"photo"]]; [self.imagefiledict setobject:object[@"photo"] forkey:[object objectid]]; nslog(@"imagefiledict : %@", self.imagefiledict); self.geopoint = object[@"location"]; c...

HTML and CSS table overflow not working -

i'm trying make table auto overflow, doesn't seem work. what have now: <div class="panel-group col-sm-offset-1 col-sm-10"> <div class="panel panel-default"> <div class="panel-heading"> <i class="fa fa-folder-open-o fa-fw"></i> <strong>chatbox</strong> </div> <div id="forum4" class="panel-collapse collapse in" style="height:248px;"> <div class="table-responsive"> <table class="table table-hover" style="overflow:auto;max-height:248px;"> <thead> <tr> <th style="width:5%"></th> <th style="width:81%;"></th> <th style="width:5%;"></th> <th style="width:8%;"></th> </...

regex - replace characters in notepad++ BUT exclude characters inside single quotation marks(3rd) -

this question has answer here: replace characters in notepad++ exclude characters inside single quotation marks(2nd) 1 answer replace characters in notepad++ exclude characters inside single quotation marks replace characters in notepad++ exclude characters inside single quotation marks(2nd) sorry, sorry users (especially avinash raj + jonny 5) answered successfull 1st/2nd similiar question... here whole statement part: (the problem didn't mention - ''word/number'' part additional included in global single quotation marks - please @ beginning , end of whole 2nd statement...) select column_name table_name column_name in ('a' , 'st9u' ,'meyer', ....); vpl_sql_string := ' select b.mview_name -- use all_objects@'|| pi_2 ||' -- master_site ,user_mviews ...

javascript - disable selected timeslots using angularjs -

the idea user selects date calendar, available time slots displayed, , upon selecting available timeslot, time slot blocked cancel duplicate timeslot selection, , added database. using mvc.net, webapi, entityframework , angularjs. my time slots array: $("input").click(function () { $('.datepicker').pickadate() $scope.hours = {}; $scope.hours = [ { id: 1, name: '12:00' }, { id: 2, name: '13:00' }, { id: 3, name: '14:00' }, { id: 4, name: '15:00' }, { id: 5, name: '16:00' }, { id: 6, name: '17:00' }, { id: 7, name: '18:00' }, { id: 8, name: '19:00' }, { id: 9, name:...

jquery - How to build my gulp file? -

i using reactjs , want use gulp following convert jsx,js files 1 js file use browserify minify js output file allow jquery required using require() function in jsx files watch changes jsx , convert js here's have far: var gulp = require('gulp') var browserify = require('browserify') var source = require('vinyl-source-stream') var reactify = require('reactify') var rename = require('gulp-rename') gulp.task('js', function() { var b = browserify({ entries: ['./lib/test.js', './lib/app.jsx'], transform: [reactify], extensions: ['.js','.jsx'], debug: false, cache: {}, packagecache: {}, fullpaths: false }); function build(file) { return b .external('jquery') .plugin('minifyify', { map: false }) .bundle() .pipe(source('main.js')) // ad...

javascript - How cpu intensive is too much for node.js (worried about blocking event loop) -

i writing node app various communities , within communities users able create , join rooms/lobbies. have written logic these lobbies node app though collection of lobby objects. lobbies require maintenance once created. users can change various statuses within lobby , have calls using socket.io @ regular intervals(about every 2 seconds) each lobby keep track of user input "live". none of tasks cpu intensive. biggest potential threat foresee load distributing algorithm not 1 of "live calls" , activated upon button press lobby creator (it never performed on more 10 things). my concern arises in that, in production, if server starts close around 100-200 lobbies risking blocking event loop. concerns reasonable? potential quantity of these operations, although small, large enough warent offloading code separate executable or getting involved various franken-thread javascript libs? tl;dr: node app has object regular small tasks run. should worry event-l...

Refactoring firstReverse using each -

// trying refactor firstreverse function using each? // created func takes str parameter, use firstreverse within // loop output reversed version of string. var stringname = "matt"; var firstreverse = function(str){ var output = ""; for(var = str.length -1; >= 0; i--){ output+= str[i]; } return output; }; firstreverse(stringname) // output: "ttam" something this? var stringname="matt"; function firstreverse(str) { var newstring=""; str.split('').foreach(function(a){newstring=a+newstring}); return newstring; } document.getelementbyid('test')./*danger!!!*/innerhtml = firstreverse(stringname); <div id="test"></div>

python - Nest simulator: C compiler cannot create executable -

i spent while looking @ other posts error, nothing relevant specific issue nest installation. nest installation requires ./configure install, according https://nest.github.io/nest-simulator/xcode_workflow kept getting following error when running ./configure: c compiler cannot create executable and after re-installing new versions of python, numpy, scipy, matplotlib, gcc, , knows else, keep getting error. suggestions? so, after tinkering around time, decided install anaconda , used following command install nest (neural) simulation tool: ./configure --prefix=$home/opt/nest --without-openmp this terminal command let me continue make, make install, , make installcheck portions of nest neural simulator tool installation. whew.

java - How can I calculate GC pause time? -

i need find way or calculate gc pause time time appears when use -xx:+printgcdetails : [gc [psyounggen: 129536k->20978k(150528k)] 129536k->92722k(492544k), 0.1067600 secs] [times: user=0.18 sys=0.08, real=0.10 secs] [gc [psyounggen: 145214k->20987k(280064k)] 216958k->213054k(622080k), 0.1758780 secs] [times: user=0.36 sys=0.10, real=0.17 secs] [gc [psyounggen: 280059k->20976k(280064k)] 472126k->412607k(674304k), 0.1969610 secs] [times: user=0.52 sys=0.11, real=0.20 secs] [full gc [psyounggen: 20976k->5608k(280064k)] [paroldgen: 391631k->393789k(841728k)] 412607k->399398k(1121792k) [pspermgen: 4370k->4369k(21504k)], 2.0758810 secs] [times: user=6.38 sys=0.03, real=2.08 secs] i have tried use managementfactory.getgarbagecollectormxbeans() list , use getcollectiontime() method it's generate cumulative wall clock time scavenge gc , marksweep gc. iterator beans = managementfactory.getgarbagecollectormxbeans().iterator(); while (beans.has...

java - How can i send click mouse and keyboard events to a flash plugin running in firefox when the firefox window runs in background with JNA? -

i want program bot in java controls flash program running in firefox. therefore have send mouse , keyboard events it. on research found jna , used creating screenshot of firefox window(it works of course when firefox in background, have handle of firefox window). after started easy mouse events simple left click(see code below), doesn't work. tested own simple window , events sent processed jframe's mouselistener , not example jbutton's actionlistener. user32 user32 = (user32) native.loadlibrary("user32", user32.class, w32apioptions.default_options); getrightwindowhandle(user32); system.out.println("got right handle"); windef.hwnd hwnd = rightwindowhandle; thread.sleep(1000); long y = 20 + (20 << 16);// x + (y << 16) windef.lparam l = new windef.lparam(y); windef.wparam w = new windef.wparam(0); user32.postmessage(hwnd, wm_lbuttondown, w, l); system.out.println("message posted...

javascript - PhantomJS not returning any results -

i'm using phantomjs scrape data webpage. phantomjs not returning evaluate method. script runs few seconds , exits. i've checked see if phantomjs connecting page -- is. phantomjs able grab page title. i've double-checked class i'm looking for, yes -- i'm spelling correctly. var page = require('webpage').create(); page.open('http://www.maccosmetics.com/product/13854/36182/products/makeup/lips/lipstick/giambattista-valli-lipstick', function(status) { page.includejs("http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", function() { waitfor(function() { return page.evaluate(function() { $('.product__price').is(':visible'); }); }, function(){ search = page.evaluate(function() { return $('.product__price').text(); }); console.log(search) }); }); phantom.exit(); }); i don...

security - Inno Setup detect Windows Firewall state -

i need detect windows firewall state (i.e. whether enabled or not) in order display message warning firewall rule may need configured allow inbound connections on specific ports when firewall enabled, not when isn't. see below code example: [code] //check if windows firewall enabled function iswindowsfirewallenabled(): boolean; begin //method required here result := true; end; function nextbuttonclick(curpageid: integer): boolean; begin //display warning message on server install if windows firewall enabled if curpageid = wpselectcomponents , iscomponentselected('server') , iswindowsfirewallenabled begin msgbox('windows firewall enabled.' + #13#10 + #13#10 + 'you may need enable inbound connections on ports 2638, 445 , 7.' mbinformation, mb_ok); result := true; end; end; what need method iswindowsfirewallenabled function. 1 way have read about, , ironically has more or less been suggested below whilst in midd...

Swagger: How to handle a response containing a java 'object' class -

i trying understand how specify in "swagger" response object of class "viewobject.java" contains object of class "object" in example below contains instance of "app.java" . in below code when specify @apioperation "response = viewobject.class" cannot figure out in viewobject "result" field contains instance of "app". @get @path("/app/{appcode}") @produces("application/json") @apioperation(value = "get app configuration", response = viewobject.class) public @responsebody viewobject getapp(@pathparam("appcode") string appcode) throws freemoexception,exception { app app = new app(); app.setappcode(appcode); viewobject viewobject = new viewobject(); app apploadedfromdb = appservice.getapp(app.getappcode()); //load app db viewobject.setstatus(freemostatus.success); viewobject.setresult(apploadedfromdb); return viewobject; } viewobject....

multithreading - C# - How to hand off which thread reads from serial port? -

background a customer asked me find out why c# application (we'll call xxx, delivered consultant has fled scene) flaky, , fix it. application controls measurement device on serial connection. device delivers continuous readings (which displayed on screen), , app needs stop continuous measurements , go command-response mode. how not it for continuous measurements, xxx uses system.timers.timer background processing of serial input. when timer fires, c# runs timer's elapsedeventhandler using thread pool. xxx's event handler uses blocking commport.readline() several second timeout, calls delegate when useful measurement arrives on serial port. portion works fine, however... when time stop realtime measurements , command device different, application tries suspend background processing gui thread setting timer's enabled = false . of course, sets flag preventing further events, , background thread waiting serial input continues waiting. gui thread sends comman...

c# - Dynamicly showing file contents in textbox [WPF] -

im building wpf application in have textbox, problem textbox needs contents of file text, txt file keeps getting written too. i have made class handle this: public class chathandler { public filestream stream; streamwriter writer; streamreader reader; public chathandler() { stream = new filestream(@"chat/" + datetime.today.tostring("d") + ".txt", filemode.openorcreate, fileaccess.readwrite, fileshare.readwrite); writer = new streamwriter(stream); reader = new streamreader(stream); } public void write(string line) { writer.writelineasync(line); writer.flush(); } public string read() { string tmp = ""; string line; while((line = reader.readline()) != null){ tmp += line + '\n'; } return tmp; } } and have user control has textbox: public partial class chatscreen : usercontrol { mainwind...

multithreading - Haskell forkIO threads writing on top of each other with putStrLn -

i playing around haskell lightweight threads ( forkio ) following code: import control.concurrent begintest :: io () begintest = go go = putstrln "very interesting string" go return () main = threadid1 <- forkio $ begintest threadid2 <- forkio $ begintest threadid3 <- forkio $ begintest threadid4 <- forkio $ begintest threadid5 <- forkio $ begintest let tid1 = show threadid1 let tid2 = show threadid2 let tid3 = show threadid3 let tid4 = show threadid4 let tid5 = show threadid5 putstrln "main thread" putstrln $ tid1 ++ ", " ++ tid2 ++ ", " ++ tid3 ++ ", " ++ tid4 ++ ", " ++ tid5 getline putstrln "done" now expected output whole bunch of these: very interesting string interesting string interesting string interesting string with 1 of these somewhere in there: main thread however, output (or first s...

json - parse.com nested objects _encode() and decode to php array not working properly -

i have parseobject called follow explained in js tutorial https://parse.com/docs/js/guide#relations-using-join-tables although i'm doing in php. goal once follow object saved able php array representation of object nested classes. from , to properties of follow object pointers _user object. this block of code create follow object, attempts convert object php array using json_decode, top level object correctly decoded. public function post_follow() { try { $user = $this->get_user(input::post('objectid')); $follow = new parseobject("follow"); $follow->set("from", $this->currentuser); $follow->set("to", $user); $follow->save(); $this->output = json_decode($follow->_encode(),true); } catch(parseexception $ex) { return $this->error($ex); } } where $this->output php array later turned json via framework. this method has output ...

r - dplyr::select - Including All Other Columns at End of New Data Frame (or Beginning or Middle) -

when interacting data find dplyr library's select() function great way organize data frame columns. one great use, if happen working df has many columns, find myself putting 2 variables next each other easy comparison. when doing this, need attached other columns either before or after. found matches(".") function super convenient way this. for example: library(nycflights13) library(dplyr) # have 5 columns: select(flights, carrier, tailnum, year, month, day) # new order column: select(flights, carrier, tailnum, year, month, day, matches(".")) # matches(".") attached other columns end of new data frame the question - curious if there better way this? better in sense of being more flexible. for example of 1 issue: there way include "all other" columns @ beginning or middle of new data.frame? (note select(flights, matches("."), year, month, day, ) doesn't produce desired result, since matches(".") ...

Chrome save CSS, load on site load -

sometimes on sites l edit css in order make site prettier, less cluttered, whatever. l want css saved every time go site, it's way l it. how can this? i use chrome extension called stylish . works quite , can share , download styles , others have built websites.

How to find the data replication in Apache CouchDB -

there 2 couchdb instances running in 2 different machines namely master & b. there database called sampledb in both machines data replication set. there way find out data replication set, whether in master or in master b? after searching options in apache couchdb, found replication of database can found "status" option in couchdb.

ios - Way To Check Next Case After Fall Through In Switch Statement? -

is there way check next case after fallthrough in swift? seems great way write concise code. case 1...8: self.correctanswerlabelone.text = answerlabelone?.firstobject as? string self.correctanswerlabelone.alpha = 0.0 self.correctanswerlabelone.hidden = false self.fadeanimation(self.correctanswerlabelone, duration: 0.3, delay: 0.0, alpha: 1.0, options: .curveeasein) fallthrough case 2...8: self.correctanswerlabeltwo.text = answerlabeltwo?.firstobject as? string self.correctanswerlabeltwo.alpha = 0.0 self.correctanswerlabeltwo.hidden = false self.fadeanimation(self.correctanswerlabeltwo, duration: 0.3, delay: 0.0, alpha: 1.0, options: .curveeasein) fallthrough case 3...8: self.correctanswerlabelthree.text = answerlabelthree?.firstobject as? string self.correctanswerlabelthree.alpha = 0.0 self.correctanswerlabelthree.hidden = false self.fadeanimation(se...

tidyr - How to split column into two in R using separate -

this question has answer here: split column of data frame multiple columns 14 answers i have dataset column of locations (41.797634883, -87.708426986). i'm trying split latitude , longitude. tried using separate method tidyr package library(dplyr) library(tidyr) df <- data.frame(x = c('(4, 9)', '(9, 10)', '(20, 100)', '(100, 200)')) df %>% separate(x, c('latitude', 'longitude')) but i'm getting error error: values not split 2 pieces @ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, what doing wrong? specify separating character dataframe %>% separate(location, c('latitude', 'longitude'), sep=",") but, extract looks cleaner since can remove "()" @ same time dataframe %>% extract(x, c("latitude", "longitude"), "\\(...

indexing - Mysql - Which index is better? -

i have 2 column this: column | column b and these column searchable. want search both of them @ same time. should index pair of key (a,b) or index seperate , b. 1 better? a composite index on (a, b) may used queries involving only a , queries involving both a , b , never on queries involving b . which index better depends on queries performing on data. not that, order of fields in index relevant, since index on (a, b) , index on (b, a) may useful in different situations. to complicate matters more, queries can use index alone without accessing data in tables, e.g., if query select b table = 5 , have index on (a, b) , engine may traverse index, since contains data need.

shortening form validation jQuery code -

i have written code, , works find, feel i'm being stupid here , shorten code. there anyway shorten this? please leave answer, thank you. $('.submit-form').on('click' , function() { if($('.form-signup1').val().length === 0) { $('.form-signup1').addclass('error') } if($('.form-signup2').val().length === 0) { $('.form-signup2').addclass('error') } if($('.form-signup3').val().length === 0) { $('.form-signup3').addclass('error') } if($('.form-signup4').val().length === 0) { $('.form-signup4').addclass('error') } if($('.form-signup5').val().length === 0) { $('.form-signup5').addclass('error') } if($('.form-signup6').val().length === 0) { $('.form-signup6').addclass('error') } }); edit: thank answers, appreciate time. chose 1 understand best. again! add common class elements the...

javascript - ScrollMagic Tween: play animation only once going forward -

i want know how have animation play once going forward when scroll down , when scroll there no animation. var controller = new scrollmagic.controller(); var tween_1 = tweenmax.to('#obj_1', 0.5, { left: '0%', delay: .1 }); var containerscene = new scrollmagic.scene({ triggerelement: '#scene_1', offset: -100 }) .settween(tween_1) .addindicators() .addto(controller); it's pretty ease actually, set reverse:false option, so: var controller = new scrollmagic.controller(); var tween_1 = tweenmax.to('#obj_1', 0.5, { left: '0%', delay: .1 }); var containerscene = new scrollmagic.scene({ triggerelement: '#scene_1', offset: -100, reverse:false }) .settween(tween_1) .addindicators() .addto(controller);

qt - Writting a custom QPushButton class in Python -

i've started learning pyqt on own , i've come in trouble trying write custom class inherits qpushbutton can adjust attributes. i'm trying pass text argument whenever initialize object of class. pretty sure there's wrong init haven't found yet. here code: import sys pyside import qtgui, qtcore class mainb(qtgui.qpushbutton): def __init__(text,self, parent = none): super().__init__(parent) self.setupbt(text) def setupbt(self): self.setflat(true) self.settext(text) self.setgeometry(200,100, 60, 35) self.move(300,300) print('chegu aqui') self.settooltip('isso é muito maneiro <b>artur</b>') self.show() class mainwindow(qtgui.qwidget): def __init__(self , parent = none): super().__init__() self.setupgui() def setupgui(self): self.settooltip('oi <i>qwidget</i> widget') self.resize...

javascript - how to set dynamic value (textbox value) to cordova download plugin -

i new cordova plugin , in thing.. have implemented coedova plugin download file.. cordova plugin here code.. var app = { filename: "abc.txt", //<-- 1 want dynamic uristring: "http://.....", //<-- 1 want dynamic // application constructor initialize: function() { this.bindevents(); }, downloadfile: function(uristring, targetfile) { var lblprogress = document.getelementbyid('lblprogress'); var complete = function() { lblprogress.innerhtml = 'done'; }; var error = function (err) { console.log('error: ' + err); lblprogress.innerhtml = 'error: ' + err; }; var progress = function(progress) { lblprogress.innerhtml = (100 * progress.bytesreceived / progress.totalbytestoreceive) + '%'; }; try{ var downloader = new backgroundtransfer.backgrounddownloader(); // create new download operation. var download = downloader.createdow...

How to integrate Eslint with jenkins? -

Image
i trying integrate eslint jenkins, didn't found links in google, please me this. awaiting favorable response. thanks, siva ramanjaneyulu vegi you need export eslint report xml file , use of violation/lint reporter plugins jenkins has available checkstyle , warnings or violations plugins. for eslint prefer using checkstyle plugin in jenkins. so way export eslint reports jenkins doing following: from jenkins job's configuration screen, add build step of "execute shell" add following command it: eslint -c config.eslintrc -f checkstyle apps/**/* > eslint.xml (replace apps/**/* path of app files) add post build action of "publish checkstyle analysis results" , input path "eslint.xml" file got exported. (this assuming have installed checkstyle plugin in jenkins) then, when execute job able see eslint report against files got executed. understanding have done with: eslint -c config.eslintrc -f checkstyle apps/*...

javascript - Regular expression for y,yes, Y, YES ,1 -

i need write regex validating string. regular expression should pass string if contains of following: y , y , yes , yes , 1 . letters can in case. new regular expression , javascript. you need add optional group case-insensitive i modifier. /y(?:es)?|1/i.test(str) or /[1y](?:es)?/i.test(str) or /[y1]/i.test(str) for doing exact match. /^(?:y(?:es)?|1)$/i.test(str)

arrays - Userform Combo List from Sheet Names -

i have sub call open workbook in window (using getopenfilename , workbooks.open ) , copy entire sheet contents 1 file , paste new sheet in macro workbook (active workbook), close second workbook without saving. i want implement userform combobox populated sheets second workbook (whose name stored string "vfile". i'm assuming i'll need userform_initialize , me.combobox1.list = activeworkbook.sheetnames ??? thanks in advance. sorry figuring out not long after posting, i'll provide answer found in case others need it, or maybe better answer suggested: private sub userform_initialize() dim snarray variant redim snarray(1 sheets.count) = 1 sheets.count snarray(i) = activeworkbook.sheets(i).name debug.print snarray(i) next me.combobox1.clear me.combobox1.list = snarray end sub and it's simple as: private sub commandbutton1_click() if combobox1.value = "" msgbox ("please select sheet import.") else works...

vba - Excel add up values in one cell based on mutliple results from one look up value -

Image
hope doing today! i've been working on spreadsheet tracks invoices , hours recorded each one. each invoice has multiple entries different numbers of hours each entry, same reference number combines project number , invoice number. example, invoice #1 of project cz23, reference number cz23-1. invoice 2 cz23-2, , on. located in column i, while hours located in column h in sheet named "document data". now have sheet tracks hours called "summary". want have cell b28 of "summary" add hours cz23-1 "document data". since barely know vba, don't have code i'll display situation here: in case, cell b28 on "summary" 15 (all cz23-1 hours added up: 2+5+1+7), while b29 7 (all cz23-2 hours added up: 4+3) , on. doesn't have b28/b29, reference i've used cells. thank time - hope able explain well. best way create pivot table. 1. select cell inside data , on insert tab select pivottable. 2. "create pivo...

objective c - iOS continuous fade-out and fade-in animation -

in objective-c , want add fade in , fade out animation uiview . want fade-out , fade-in animation continuously. illustrate it, effect want have following: fade out - fade in - fade out - fade in - ... what i'm trying following: -(void)fadeoutin:(uiview *)view duration:(nstimeinterval)duration { static cgfloat alpha = 1.0; [uiview animatewithduration:duration delay:0.0 options: uiviewanimationoptionrepeat| uiviewanimationoptioncurveeaseinout animations:^{ alpha = abs((int)(alpha - 1.0)); view.alpha = alpha; } completion:^(bool finished){ }]; } i tried following: -(void)fadeoutin:(uiview *)view duration:(nstimeinterval)duration { [uiview animatewithduration:duration delay:0.0 options: uiviewanimationoptionrepeat| uiviewanimati...

javascript - How to increase the vertical height and add space between contents in div scroll in bootstrap -

Image
i trying add space between each div , circle should show in full size. html : <body> <h1 class="page-header">horizontal scroll questions</h1> <div class="container-fluid" style="overflow-x:scroll;white-space: nowrap;overflow-y:hidden ;"> <div class="col-sm-3 c"> <h6>2</h6> </div> <div class="col-sm-3 c"> <h6>3</h6> </div> <div class="col-sm-3 c"> <h6>4</h6> </div> <div class="col-sm-3 c"> <h6>5</h6> </div> <div class="col-sm-3 c"> <h6>5</h6> </div> <div class="col-sm-3 c"> <h6>5</h6> </div> <div class="col-sm-3 c"> <h6> 5</h6> </div> </div> <!-- jquery (neces...