Posts

javascript - Rails link_to ignoring e.preventDefault(); from a jQuery call because method: :get is set -

experimentally i've learned following code: <td><%= link_to 'notify', '/w/'+w.id+'/notify', method: :get, :class => "btn btn-success notify-btn" %></td> fires regardless of jquery: $('.notify-btn').click(function(e){ e.preventdefault(); bootbox.confirm("alert?", function(result){ if(result === true){ return true; } else { return false; } }); }); and it's due method: :get. removed elements of link one-by-one , tried various combinations. if method: :get there, it's going fire. i can prevent e.stoppropagation, won't follow link at all . if click ok sits on page doing nothing. if rid of erb , use straight html so: <a href="/w/53531e8a963e6503c60002b2/notify" class="btn btn-success notify-btn" data-method="get">notify</a> and data-method="get" there, same result. if remo...

Twitter and spam control -

we developing carpool app, , posting search requests customers , registration requests customers on twitter. there may time when tweets increase significantly. need ensure not breaking rules ? tweet looks this the tweet looks this @caregiri ride viman nagar, hindjewadi,. install caregiri android app, , reduce @pune_traffic? @mcruiseon @caregiri , @mcruiseon our @ tags. @pune_traffic not. i'd suggest checking rules , policies twitter applications ( https://dev.twitter.com/terms/api-terms ) , if you're unsure, file ticket platform operations team @ https://support.twitter.com/forms/platform

Java webstart complaining about missing jar that isn't in my library anymore (Netbeans) -

i've stumbled on strange behavior when running java app through webstart. used have itext jars added project in netbeans 7.3.1. recently, removed these jars libraries (via project properties) did not use anymore. i've rebuild project (with code-signing certificate), had no errors whatsoever , put new update online. now, when open app first time through java webstart (jnlp), receive following error (from java console): ... basic: exception: unable load resource: http://<my url>/lib/itextpdf-5.3.1-javadoc.jar. exitexception[ 3]com.sun.deploy.net.faileddownloadexception: unable load resource: http://<my url>/lib/itextpdf-5.3.1-javadoc.jar @ sun.plugin2.applet.jnlp2manager.downloadresources(unknown source) @ sun.plugin2.applet.jnlp2manager.preparelaunchfile(unknown source) @ sun.plugin2.applet.jnlp2manager.loadjarfiles(unknown source) @ sun.plugin2.applet.plugin2manager$appletexecutionrunnable.run(unknown source) @ java.lang.thread.run(unknown source) ignored ex...

c++ - Clear input command line? -

i'm making console application. starts menu if press key; 1. menu changes menu screen. note, without me pressing 'enter'. means 1 still remains, bad when stepping down further in menus. how clear input command line? the function im using. if(getasynckeystate('1')) { ieventdataptr gamestate(gcc_new evtdata_set_game_state("pregamestate")); em->vtriggerevent(gamestate); //enter line clearing code. } the function getasynckeystate gives "the current state of key". return true between point when keyboard driver has received "key 1 has been pressed" until keyboard driver receives "key 1 has been released". i suggest use readconsoleinput instead if want 1 keypress @ time. the alternative use this: while(getasynckeystate('1')) { // nothing. } to wait key released.

c# - insert asp tags in innerHtml in a div -

i'm trying kind of thing: aspx <div runat="server" id="divaltriindirizzi"> </div> aspx.cs in page_load method stringbuilder sbdivindirizzi = new stringbuilder(); (int = 0; < dtind.rows.count; i++) { sbdivindirizzi.append("<div class='row'> "); sbdivindirizzi.append("<div class='col-lg-12'>"); sbdivindirizzi.append("<h3>indirizzo "+ (i+1).tostring() +"</h3>"); sbdivindirizzi.append("<div class='form-group'>"); sbdivindirizzi.append("<div class='row'>"); sbdivindirizzi.append("<div class='col-lg-8' id='divindirizzo'+(i+1).tostring()>"); sbdivindirizzi.append("indirizzo:"); sbdivindirizzi.append("<asp:textbox runat='s...

JavaFX - Get TableView column by name -

is there way column tableview name? when need column have index: tableview.getcolumns().get(i); but column name: tableview.getcolumns().get("column name"); it's hard envision situation in couldn't keep references columns, can write method like private <t> tablecolumn<t, ?> gettablecolumnbyname(tableview<t> tableview, string name) { (tablecolumn<t, ?> col : tableview.getcolumns()) if (col.gettext().equals(name)) return col ; return null ; }

android - Progress while recording audio -

i trying make progress bar , react while record sound. mean while record on , there sound progress bar have move. dont know how should call using in audio players show music playing. hope know mean. i recording sound code: recorder = new mediarecorder(); recorder.setaudiosource(mediarecorder.audiosource.voice_recognition); recorder.setoutputformat(mediarecorder.outputformat.three_gpp); recorder.setaudioencoder(mediarecorder.audioencoder.amr_nb); recorder.setoutputfile(outputfile); use getmaxamplitude() . call method multiple times delay , need. here's implementation using rxjava : mtimersubscription = observable.interval(100, timeunit.milliseconds) .observeon(androidschedulers.mainthread()) .subscribe(along -> { // evey 100 milliseconds method called int amplitude = mrecorder.getmaxamplitude(); logwrapper.d(tag, ...