Posts

Showing posts from June, 2013

joomla - I am using JWPlayer with a YouTube RSS Feed but it only shows 25 videos -

i using jwplayer youtube rss feed shows 25 videos. there anyway show more/all videos? i requesting 50 videos youtube (which seem show in rss feed) doesn't show in jwplayer... here playlist: http://gdata.youtube.com/feeds/api/playlists/plxvuy6gatg0ixs4iducs6xspq0fyqpv8e?max-results=50

java - How to check the precision of Float -

i have float one: float f = float.valueof("9.222333999444555666"); system.out.println(f); //prints 9.222334 is there way count number of digits after . sign without using regex: f.tostring().split("\\.")[1].length() ? simply convert value string , place of decimal point. string s = "" + f; int = s.indexof(".") system.out.println("the number of digits after decimal point " + s.length()-i-1 edit: read op's comment , doubt how round off float. question answered here: format float n decimal places for quick reference, use this: string.format("%.2f", f). have understand java's float , double not have methods , attributes manipulating precision after decimal point. there several reasons java this, should remember convert float , double string, manipulate them want , convert back.

android - Fragment + swipe + drawermenu -

i realized "swipe " project between 2 fragments works. have project walking drawer menu. try link 2 following assembly code , contains mainactivity menu must become / fragment. many functions change language / writing . there easy idea of plan here code mainactivity : package thyroid.com.thyroidmenu; import android.content.intent; import android.net.uri; import android.os.bundle; import android.support.design.widget.navigationview; import android.support.v4.app.fragment; import android.support.v4.app.fragmentactivity; import android.support.v4.widget.drawerlayout; import android.support.v7.app.actionbardrawertoggle; import android.support.v7.app.appcompatactivity; import android.support.v7.widget.toolbar; import android.util.log; import android.view.layoutinflater; import android.view.view; import android.view.menuitem; import android.view.viewgroup; import android.widget.adapterview; import android.widget.button; import android.widget.framelayout; import andro

How to programmatically detect VB.NET obfuscation? -

i using confuserex obfuscate program before release, want program show warning if being run without obfuscation. reduce chance of non obfuscated executable being shipped. @ runtime want function returns true/false depending if obfuscation has been applied. i can see 2 ways of doing it. if obfuscation process use part of release build , therefore release build has embedded instructions obfuscation part, that. appvalidator.validate() the validation validate release version or if not, application run allowed users (dev. team instance). i added way validate commandline calling myapp.exe validate however. not validated obfuscation per see, validates application in release mode. your obfuscator, if embedded release build, should fails if cannot obfuscate release version or premise validation not good. public class appvalidator #if debug private shared readonly isdebugversion boolean = true #else private shared readonly isdebugversion boolean = false #end if privat

Specify COM port file in java -

in unix operating systems, can access serial ports through files such /dev/ttyusb0 or something. , according question , filenames such com1: can used access serial ports. java alternative such file names? don't want use serial communication liberaries. edit what want code this. string input_port_file_name = linux?"/dev/ttyusb0":"<file name of comport>" file in = new file(input_port_file_name) what want widows alternative device file. edit on linux machine, , want enable code ported easily! yes, on linux there access serial port instance through device files /dev/ttys0 , /dev/ttyusb0 , others. depends on hardware/chips used communicate , distributions. if same hardware used in program can partly achieved. when worked serial comm libraries , real physical serial ports in linux used port numbers in config number 3 meant n=3, opens "com"+(1+n) on windows or "/dev/ttys"+n on linux. maybe similar can used access

How to pass the class name reference to edit text which is inside static method in android -

i have static method , inside method creating edit text dynamically. here code, public static void done() { edittext[] edittext = new edittext[dynamiclen]; (int n = 0; n < dynamiclen; n++) { edittext[n] = new edittext(clasname.this); ...... } when use code, getting error in classname.this saying can't reference. tried changing clasname.class.getname().this still not able resolve it. great new edittext() requires context not class name so can modify method below public static void done(context context) { edittext[] edittext = new edittext[dynamiclen]; (int n = 0; n < dynamiclen; n++) { edittext[n] = new edittext(context); ...... }

javascript - Bootstrap 3: Add 'More options' on Navbar on window resizing -

i need help. i want show 'more options' collapsed button when window resizing collapse every hidden <li> example : <li id="menu_more_container" class="dropdown" style="display: none;"> <a href="#" class="dropdown-toggle" data-toggle="dropdown">more options<b class="caret"></b></a> <ul id="menu_more" class="dropdown-menu"> </ul></li> you can manage responsive utilities: http://getbootstrap.com/css/#responsive-utilities just add .visible-xs-* etc needed...

javascript - angular-fullstack generator failed to load template while running dist folder? -

Image
i having issue in image this issue random.if again gulp build , start running project command grunt serve:dist now may find navbar.html not find template directive or routes.i confused.if right, think gulp hasnot minfied or compressed html $templatecache service.please help.i running node v5.0.0 , npm 3.5.1.the generator using https://github.com/angular-fullstack/generator-angular-fullstack.any appreciated.

python - Django template - get matching foreign key objects in a template? -

i have model named circuits , each circuit may have many files associated it. so in view getting circuits , files, trying files match circuits in template using if statement. i have tried, below come empty, how traverse models in template find match? file.circuit_contract_data file.circuit_contract_data__id thanks view.py @login_required def showroom_detail(request, showroom_id): modelshowroom = get_object_or_404(showroomconfigdata, pk=showroom_id) modelcircuits = circuitinfodata.objects.filter(showroom_config_data=showroom_id) modelcircuitfiles = circuitfiles.objects.filter(circuit_contract_data__showroom_config_data=showroom_id) modelsitephotos = sitephotos.objects.filter(showroom_config_data=showroom_id) modelsitefiles = sitefiles.objects.filter(showroom_config_data=showroom_id) return render(request, 'service/showroom_detail.html', { 'showroom': modelshowroom, 'circuits': modelcircuits,

compare - Comparing observations -

suppose dataset includes following variables: set obs 100 generate var1 = rnormal() generate var2 = rnormal() input double(id var5 var6) 1 1052 17.348 2 1288 17.378 3 1536 17.387 4 2028 17.396 5 1810 17.402 6 2034 17.407 end input double(id var5 var6) 1 10000 0.4 2 22000 0.55 3 25000 0.5 4 40000 1 end i need delete rows of ids have an increased value of var5 , reduced value of var6 compared @ least 1 other id . in first example, number 4 2028 , 17.396 should deleted. in second example, number 3 25000 , 0.5 should deleted. after elimination, observations of 3 variables should this: 1 1052 17.348 2 1288 17.378 3 1536 17.387 5 1810 17.402 6 2034 17.407 1 10000 0.4 2 22000 0.55 4 40000 1 while var1 , var2 should remain intact. how can this? this odd because appear have dataset unrelated variables. have initial dataset of 100 observations variables var1 , var2 , secondary dataset 6 observations variables var5 , var6 . objective appears to remove observations,

Implement HTML5 / CSS calendar -

hey found calendars app want develop. because i'm totally new need on how can implement calendar application. https://designsmaz.com/free-html5-css3-calendar/ right copied css files , on in project folder right nothing shows up. think got implement in app or place stuff in other directory. developing i'm using intel xdk. thanks help! ok, added index file online project project directory , works fine. i'm able go on testing. ;)

Working of TypedValue in Android -

when want change width of edittext in android, use line of code: int px=(int)typedvalue.applydimension(typedvalue.complex_unit_dip,200,r.getdisplaymetrics()); can explain how works , typedvalue.complex_unit_dip return? complex_unit_dip specifies measurement unit number refer to. wrote translates "200 dip". believe know dip is. if complex_unit_sp 200 translated "200 sp" here source code of applydimension: public static float applydimension(int unit, float value, displaymetrics metrics) { switch (unit) { case complex_unit_px: return value; case complex_unit_dip: return value * metrics.density; case complex_unit_sp: return value * metrics.scaleddensity; case complex_unit_pt: return value * metrics.xdpi * (1.0f/72); case complex_unit_in: return value * metrics.xdpi; case complex_unit_mm:

go - Golang: How to create interactive command execution? -

Image
my problem interaction exec.command. automate runas on windows. i want via application launch other applications (eg ccleaner, antivirus eset online, etc ...) on computers of clients. create adminsys account , want launch these various applications automatically account. cmd := exec.command("runas", user, nameprogram) cmd.stdout = os.stdout cmd.stderr = os.stderr stdin, err := cmd.stdinpipe() if err != nil { fmt.println(err) } defer stdin.close() err = cmd.start() if err != nil { fmt.println(err) return } time.sleep(3 * time.second) io.writestring(stdin, password) err = cmd.wait() if err != nil { fmt.println(err) return } this not work! the errors runas. erreur de runas : impossible d’exécuter - c:\program.exe 1326 : le nom d’utilisateur ou le mot de passe est incorrect. it looks not recognize password. works when directly in command prompt i'm not running windows, , code have in question works me. so, following may not

Aptana Studio 3 - Rails project won't import -

i had project got corrupted, reverted older version had in git repo. whatever reason, can't import project aptana studio3. the error is: "no projects found import" i'm assuming can't find .project file. functioning project can run via command line. any idea problem is? go new > rails project, uncheck use default location, point root folder of project using browse button, , make sure option generate code set "i'll generate own" hope works

php - Symfony3 You have requested a non-existent service "doctrine". MongoDB FOSUserBundle -

i'm having problem symfony3 , fosuserbundle mongodb. when run following command: php bin/console doctrine:schema:update --force i error: you have requested non-existent service "doctrine". i followed tutorials on symfony website. error mean? ty. if indeed mongodb problem @malcolm indicated, need read through this: https://symfony.com/doc/current/bundles/doctrinemongodbbundle/index.html

java - What's the "principal" in Spring Security? -

i'm new spring , spring security. reading spring security , came out concept of principal , should current logged user. if have more 1 current logged user? so, question is, principal in spring security? i've read example tutorial: http://www.mkyong.com/spring-security/get-current-logged-in-username-in-spring-security/ and seem take account there's 1 current logged user, isn't case. how retrieve specific user? , how differentiate between users doing requests? the principal is logged in user. however, retrieve through security context bound current thread , such it's bound current request , session. securitycontextholder.getcontext() internally obtains current securitycontext implementation through threadlocal variable. because request bound single thread context of current request. to simplify security context in session , contains user/principal , roles/authorities. how retrieve specific user? you don't. apis designed all

php - Query chaining without using QueryScopes in Laravel -

i'm building analytics dashboard large laravel app contains many complex queries. want chain queries together, otherwise i'm duplicating code on place, write this: $query_result = $this->customers ->whereactivebetween($dates) ->withordersizegreaterthan($amount) ->get(); because specific, long, , not used in other parts of app, want avoid polluting complex models query scopes going used analytics repository. so, best way achieve this, both keeping code readable, , making code reusable? have @ traits - feature introduced in php 5.4 allows reuse code in independent classes. can find more details in docs here http://php.net/manual/en/language.oop5.traits.php in case should help: // move reusable scopes trait trait analyticsscopes { function whereactivebetween() { code here } function withordersizegreaterthan() { code here } } // add trait model classes class customer extends model { use analyticsscopes; } // use scopes if imple

ios - UINavigationController.navigationBar setHidden:NO doesn't work? -

i have homeviewcontroller , has property searchviewcontroller . homeviewcontroller delegate of searchviewcontrollerdelegate can pop searchviewcontroller when click button in searchviewcontroller.view (i use pushviewcontrolleranimated: push searchviewcontroller view controller stack. i want show navigationbar when searchviewcontroller popped up. however [self.navigationcontroller.navigationbar sethidden:no]; is not working. i've checked navigationbar not nil can't figure out problem might be. actual code #pragma mark - hometabsearchtableviewdelegate -(void)parentviewcontrollerpop{ [self.navigationcontroller popviewcontrolleranimated:yes]; [self.navigationcontroller.navigationbar sethidden:no]; } searchviewcontroller popped successfully, navigationbar problem. on homeviewcontroller -(void)viewwillappear:(bool)animated{ [super viewwillappear:animated]; [self.navigationcontroller setnavigationbarhidden:no]; //shows

javascript - Chart.js stacked and grouped bar chart -

is there way stacked , grouped bar chart chart.js library? it should http://www.highcharts.com/demo/column-stacked-and-grouped ok, found solution. it's described in github issue , solution in this jsfiddle chart.defaults.groupablebar = chart.helpers.clone(chart.defaults.bar); var helpers = chart.helpers; chart.controllers.groupablebar = chart.controllers.bar.extend({ calculatebarx: function (index, datasetindex) { // position bars based on stack index var stackindex = this.getmeta().stackindex; return chart.controllers.bar.prototype.calculatebarx.apply(this, [index, stackindex]); }, hideotherstacks: function (datasetindex) { var meta = this.getmeta(); var stackindex = meta.stackindex; this.hiddens = []; (var = 0; < datasetindex; i++) { var dsmeta = this.chart.getdatasetmeta(i); if (dsmeta.stackindex !== stackindex) { this.hiddens.push(dsmeta.hidden); dsmeta.hidden = true; } } }, unh

VB.NET - Borderless MDI child form issue on shown -

Image
i working on project mdi forms . problem when open mdi child borderless form. moment see this... and appears ok... any idea can cause this? note title bar , bottom bar custom controls. formborderstyle none !!! windows doesn't support changing border style mdi child windows. operating system lets it, unsupported configuration , quite buggy. winforms supposed insulate these types of concerns, design flaw. should throwing exception when try modify formborderstyle property of mdi child. implementing mdi support wasn't microsoft's biggest priority. dead when winforms first released way in 2001-ish. entire mdi paradigm no longer supported, , no longer recommended use in software. as you've seen, can hack kind of works. flickering effect because windows trying draw non-client area supposed there. two better ideas: stop using obsolete mdi paradigm , find different, more user-friendly way implement ui. example, separate, top-level forms. or serie

php - How to use a tag for input type submit -

<form> <label class="screen-reader-text" for="s"><?php _x( 'search for:', 'label' ); ?></label> <input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" placeholder="search"/> <input type="submit" id="searchsubmit" value="<?php echo esc_attr_x( 'search', 'submit button' ); ?>" /> </form> how use tag input type button. tag cod is: <a href="#" class="fa fa-search" ></a> by default submit uses form action redirect on submit. <form method="post" action="redirect.html"> <input type="submit" value="clickable button" /> </form> or <!-- form here --> <button type="submit" form="form2" value="submit">submit</button>

resize - Create image and rename is not working in PHP -

i need create process making images different dimensions , move them repective folder.the below code working images , not some.some images being renamed in subfolder , not.some images being created , not.i have performed unit testing on single image , works.but when run on server,i above problem.there more 500 images needs processed.i not able understand went wrong.please help. $arr=array(); $arr["popup"]=array("width"=>228,"height"=>304); $arr["zoom"]=array("width"=>1500,"height"=>2000); $source = imagecreatefromjpeg($file_path); list($width, $height) = getimagesize($file_path); foreach($arr $image_type=>$dimention){ echo "<br> $image_type : "; $temp_folder_name=$image_type; $temp_folder_path='../prod_images/'.$folder_name.'/'.$temp_folder_name; //check if directory exists if not create else trav

java - Android JSON access thumbnail element -

i have json result http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&num=25&q=http://www.abc.net.au/news/feed/51120/rss.xml i trying access thumbnails each news article located in entries>mediagroups>contents>thumbnails>url however unsure of how access deep in element. code far. public list<newsobj> constructjson(string jsonin){ arraylist<newsobj> newslist = new arraylist<>(); try{ //add more levels extract json jsonobject jsonobject1 = new jsonobject(jsonin); string responsedata = jsonobject1.getstring("responsedata"); log.d("receivejsonobjectlevel1",responsedata); jsonobject jsonobject2 = new jsonobject(responsedata); string feed = jsonobject2.getstring("feed"); log.d("receivejsonobjectlevel2",feed); jsonobject jsonobject3 = new jsonobject(feed); string entries = jsonobject3.getstring("entries");

spring mvc - Issue with RedirectAttributes on SpringMVC -

i'm having issue redirectattributes not saving (i think). code: @requestmapping(path = "/job_offers", method = requestmethod.post) public string createjoboffer(@valid @modelattribute("jobofferform") jobofferform jobofferform, final bindingresult binding, redirectattributes attr) { attr.addflashattribute("org.springframework.validation.bindingresult.jobofferform", binding); attr.addflashattribute("jobofferform", jobofferform); return "redirect:/job_offers"; } @requestmapping(path = "/job_offers", method = requestmethod.get) public modelandview joboffers(@requestparam(required = false, value = "skill_id") final long skillid, @modelattribute("jobofferform") jobofferform jobofferform, final bindingresult binding) { modelandview mav = new modelandview("job_offers/index"); mav.addallobjects(getjoboffersmap(skillid)

c - Current directory in CLion -

i use clion 2016.1. example, run such code in directory ~/clionprojects/tutorial : #include <stdio.h> int main() { char * string; string = "hello, everyone"; printf(string); } why clion go code directory?: /home/ken/.clion2016.1/system/cmake/generated/tutorial-9a39f70/9a39f70/debug/tutorial hello, process finished exit code 15 how make programs running in "normal" directory ~/clionprojects/tutorial ? upd i want read "data.csv" file locates in current directory (where main.c is). clion looks in /home/ken/.clion2016.1/system/cmake/generated/tutorial-9a39f70/9a39f70/debug/tutorial . how make clion looks data.csv in ~/clionprojects/tutorial ? if want appear binaries in folder you've specified, need tell clion adjusting cmakelists.txt this: set(cmake_runtime_output_directory ${project_source_dir}/bin) set(cmake_archive_output_directory ${project_source_dir}/lib) set(cmake_library_output_directory ${project_sourc

openerp - Limit products to company assigned to user in multi-company Odoo 9 -

i have multi-company setup in odoo, , limit products each user (under group "user") can access (read/write/create/delete) products assigned company user assigned to. to clear, have: companies: company a company b users: user (assigned "company a" , user group "user") user b (assigned "company b" , user group "user") products: product (assigned "company a") product b (assigned "company b") with default setup, user has access both product , product b, , user have access exclusively product a, on modules (sales, inventory, pos…) i believe possible accomplish using record rules, haven't been able it. i got answer needed jerome guerriat @ the odoo forums. needed tick checkbox under general settings page: there product.product multicompany rule (but inactive default): "product multi-company" xml id: product.product_comp_rule you can active going setti

html - rotated text in sidebar - css -

Image
i want make sidebar text rotated , centered inside sidebar. want in text , css, not background image or something... how done in css? i have tried use transform: rotate(7deg); , stuff, can't position correctly. here codepen basic structure. topbar should on left side of screen (like in picture). this has responsive. , when click menu toggle sidebar slides open text should hidden css/js. thanks answered: answer @darrylyeo right fix me. simpeler make div (horizontally) , rotate whole div. rotation text inside div seemed more difficult position right responsive breakpoints.

microcontroller - PIC24F32KA302 Sleep mode -

i want configure pic24f32ka302 go sleep mode , wake rtc interrupt. however, after waking up, program runs again beginning. datasheet mentions that: - if assigned priority interrupt less or equal current cpu priority, device wake-up , continue code execution instruction following pwrsav instruction initiated sleep mode. - if assigned priority level interrupt source greater current cpu priority, device wake-up , cpu exception process begin. code execution continue first instruction of isr. tried both configurations results same. code below: int main(void) { sys_init(); while(1){ __delay_ms(400); sleep(); } return 0;} void __attribute__ ( (interrupt, no_auto_psv) ) _rtccinterrupt(void) { ifs3bits.rtcif = 0; //to do: total_pulse += tmr1; tmr1 = 0; led = ~led;} void interruptpriority_init(void) { intcon1bits.nstdis = 1; intcon2bits.altivt = 0; srbits.ipl = 1; ipc15bits.rtcip = 6;//6 _u2rxip = 5; _t1ip = 4; _u1rxip = 2; _hlvdip = 3;} the function sys_init() initializes int

c# - Run new animation only when previous one is finished -

i'm new unity , i'm struggling configuring animations properly. have attack animation must played if press spacebar once , if hold it should play until release. problem once release spacebar animator instantly returns previous state. i've read answer on unity q&a site concerning script runs animations, don't use script run mine i'm setting them in animator. how can fix ? way change animation switching value of boolean variable : if(input.getkeydown(keycode.space)) { isattacking = true; } if(input.getkeyup(keycode.space)) { isattacking = false; } playeranimator.setbool("isattacking", isattacking); my project in 2d if matters. click -> exit time inside of animator have clips. clicking on clip bring inspector view. you'll want check has exit time'. then you'll want set exit time 1 , transition duration 0. by setting values, you're telling animator animation mus

android - FirebaseRemoteConfig.fetch() does not trigger OnCompleteListener every time -

i'm trying implement firebase remote config : override fun oncreate(savedinstancestate: bundle?) { val configsettings = firebaseremoteconfigsettings.builder().setdevelopermodeenabled(buildconfig.debug).build() mfirebaseremoteconfig = firebaseremoteconfig.getinstance() mfirebaseremoteconfig.setconfigsettings(configsettings) mfirebaseremoteconfig.setdefaults(r.xml.remote_config_defaults) fetchremoteconfig() } private fun fetchremoteconfig() { var cacheexpiration = 3600l if (mfirebaseremoteconfig.info.configsettings.isdevelopermodeenabled) { cacheexpiration = 0l } mfirebaseremoteconfig.fetch(cacheexpiration) .addoncompletelistener { task -> if (task.issuccessful) { log.d(tag, "remote config fetch succeeded") mfirebaseremoteconfig.activatefetched() } else { log.d(tag, "remote config fetch failed - ${task.exception?.m

php - Custom Wordpress Ajax Coding -

ok have created ajax code wordpress theme , have html. how use wordpress php coding content wordpress pages when clicked? not concerned getting post loops etc.... going have static page. need content of pages on click. heres code $( document ).ready(function() { $.ajax({ method: 'get', url: "pages/main.html", success: function(content) { $('#contentarea').html (content); } }); }); $('.menu_nav') .click (function () { var href = $(this) .attr('href'); $('#contentarea').hide() .load(href).slidedown( 'very slow' ) return false; }); html structure menu_nav <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#homenav"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span

.net - Best way to disable a System.Threading.Timer -

i have system.threading.timer toggled on , off. know of 2 methods turn off timer: call timer.change(-1,-1) dispose timer, , create new 1 when needed which 1 better, in terms of resources , performance? calling change(-1,-1) cpu heater? expensive create timer? setting timer's initial value , interval -1 (i.e. change(-1, -1) ) not "cpu heater." timers don't use cpu resources. callback method does, of course, during (usually brief) time when it's executing. in case, not @ expensive create new timer, nor disabling change(-1, -1) have negative performance consequences. use whichever technique best fits model.

How to display a dialog fragment in almost full screen in Android -

i have dialog fragment , createview of @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.zse_dialog, container,false); return view; } i call fragment with expandablelistview.setonchildclicklistener(new expandablelistview.onchildclicklistener() { @override public boolean onchildclick(expandablelistview parent, view v,int groupposition, int childposition, long id) { fragmentmanager fm = getfragmentmanager(); dialogf dialogfragment = new dialogf (); dialogfragment.show(fm, "sample fragment"); return false; } }); but seems compressed in center of screen. how make show in full screen or in full screen margin if have container on activity show dialogfragment, can add regular fragment, this getfragmentmanager() .begintransaction() .add(r.id.container, new myfrag

Can't figure out the Java equivalent of "passing by reference" in C++ to solve this, and the best method to solve by -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 74 answers i took cs-1 course in c++ , i'm @ new university , use java here. i've been learning new syntax , doing old c++ labs , i've hit wall pass-by-reference one. my understanding far java pass-by-value how can achieve goal of problem? write program tells coins give out amount of change 1 cent 497 cents. since wouldn’t use pennies, need round cents near 5 or 10’s. example, if amount 368 cents, rounded number 370 cents , if amount 367 cents, rounded number 365 cents. change 1 toonie (two dollar coin), 1 loonie, 2 quarters, 2 dimes 370 cents. use coin denominations of 2 dollars (toonie), 1 dollar (loonie), 25 cents (quarters), 10 cents (dimes), , 5 cents (nickels). program use following function: void computecoin(int coinvalue, int &number, int &amountleft);

Is there a way to specify the interface/class being overrode using Java's Override annotation? -

some classes have many interfaces inherit from. i want make explicit in overrided methods interface or class method overrides when @ code month now, don't have linear search on every interface being implemented , class being extended find interface or class method being overrode for. situation: class foo extends bar implements foo1, foo2, bar1, bar2 { public foo(){} @override void foo1() {} @override void foo2() {} @override void bar1() {} @override void bar2() {} } i want like: class foo extends bar implements foo1, foo2, bar1, bar2 { public foo(){} @overrides(source="foo2") void foo1() {} @overrides(source="bar1") void foo2() {} @overrides(source="bar2") void bar1() {} @overrides(source="foo1") void bar2() {} } is there way accomplish this? solution (thanks nikem): can create custom annotation (overrides.java) public @interface overrides

windows - Dynamically loading exe file -

i'm trying dynamically load exe file program , run someprocedure dynamicaly loaded exe. here's i'm doing in loaded exe - library.exe interface procedure someprocedure; stdcall; implementation procedure someprocedure; begin showmessage('ala has cat'); end; and here's exe load's library.exe , try run someprocedure it. type thandle = integer; tproc = procedure(); var ahandle: thandle; proc: tproc; procedure tform1.button1click(sender: tobject); begin ahandle := loadlibrary('library.exe'); if ahandle <> 0 begin @proc := getprocaddress(ahandle, 'someprocedure'); if @proc <> nil try proc; freelibrary(ahandle); end; end; end; end; unfortunately it's not working - ahandle has address getprocaddress returns nil. doing wrong? to best of knowledge, attempting not possible. cannot use loadlibrary load .exe file, , call exported functions.

python 2.7 - tkinter event binding to button -

from tkinter import * master = tk() def callback(): print "click!" b = button(master, text="ok", command=callback) b.pack() mainloop() right running in ipython prints "click!" console. if result of script or function appear in gui box, under button how can achieve this? size of box need allocated in advanced? edit: function want call more complicated callback above. when run following code, instead of printing clusone.head() prints <function centroid @ 0x2cf3410> to output box. able print lines of data resulting function rather pointer address. master = tk() # output box prints address (pointer) result of running function. #i see output in box. df=pd.read_csv('8162013.csv') df=df.set_index('date1') # initialize centroid. cen1=df.mean() v=ny.random.randn()+10 cen2=df.mean()-v train=df[0:1615] def centroid(train,cen1,cen2): in range(0,3): # sum of squares. results in series containing 'date'

c# - Viewbag properties inside action link helper -

i trying include , viewbag object inside actionlink helper. @html.actionlink( "date" + viewbag.icon , "index", new{ sortby=viewbag.datesort}) logic viewbag. viewbag.icon = (viewbag.datesort == "date desc") ? "▼" :"▲"; i implement sort here. just add datesort viewbag in controller, , in view: @{ var dateheader = "date " + (viewbag.datesort == "date desc" ? "▼" : "▲"); } @html.actionlink(dateheader, "index", new { sortby = viewbag.datesort })

Inject Multiple JavaScript to Multuple Page of WebView Android -

say, set webview example.com clicked on page , load example.com/about. in webview i've injected javascript modify html on example.com, , worked, , problem is, how inject javascript modify example.com/about. mean how inject multiple javascript multiple page of webview? public class mainactivity extends appcompatactivity { webview mwebview; private int getscale() { display display = ((windowmanager) getsystemservice(context.window_service)).getdefaultdisplay(); int width = display.getwidth(); double val = new double(width) / new double(100); val = val * 100d; return val.intvalue(); } @override protected void oncreate(bundle savedinstancestate) { this.requestwindowfeature(window.feature_no_title); getwindow().setflags(windowmanager.layoutparams.flag_fullscreen, windowmanager.layoutparams.flag_fullscreen); super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main);

ios - Remove a key from a dictionary for a given value -

how can remove key dictionary value x? need dictionary.removekeyforvalue(...) function. i'd optimise following code. have text associated category , dictionary associates keywords categories. although text categorised i'd check whether should fall different category. let text = "he said hello , ran away" // taken "activity" category // dictionary associating keywords categories let categoryrules = ["hi" : "greeting", "hello" : "greeting", "jogging" : "activity", "joy" : "feeling"] let keywords = array(categoryrules.keys) // make out of text array of words. let textwordarray = text.lowercasestring.characters.split{$0 == " "}.map(string.init) // shouldn't have go through keys associated "activity" because text in it. keyword in keywords { // if text contains rule if let index = textwordarray.indexof(keyword) { // associated

maven - java.lang.NoClassDefFoundError: org.springframework.beans.FatalBeanException -

Image
i building jax-ws web service in java 8 , using spring 4.2.6 , hibernate 5.1 it. when deploying project on tomcat, encountering following exception. have googled same , none of stackoverflow post has been helpful. exception stack severe: exception sending context initialized event listener instance of class org.springframework.web.context.contextloaderlistener java.lang.noclassdeffounderror: org.springframework.beans.fatalbeanexception @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.docreatebean(abstractautowirecapablebeanfactory.java:553) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.createbean(abstractautowirecapablebeanfactory.java:482) @ org.springframework.beans.factory.support.abstractbeanfactory$1.getobject(abstractbeanfactory.java:306) @ org.springframework.beans.factory.support.defaultsingletonbeanregistry.getsingleton(defaultsingletonbeanregistry.java:230) @ org.springframework.bea