Posts

Showing posts from March, 2013

Codeigniter, Facebook and Facebook's login "code" query variable -

we're trying log users our codeigniter app php sdk, we're using segmented uris , have no need query strings we've opted not use them. 1 of problems seems ci , facebook passing redirect_uri parameter getloginurl() e.x. public function login(){ if(!$this->user){ $this->data['loginurl'] = $this->facebook->getloginurl(array( 'redirect_uri' => 'http://appdomain.com/users/login' )); $this->load->view('users/login', $this->data); }else{ redirect('home/index'); } } after logging facebook, uri returned has code query variable ci doesn't like, breaks routing , displays blank page. http://appdomain.com/users/login/?code=dsfeoilkjd983274893hflksdfhhewhkdsiue8... even if add $route['users/login/(:any)'] = 'users/login'; routes.php , i'm still redirected blank page. since using getaccesstoken() make api calls on user's beha

python - Flask-Admin: add filters on foreign keys -

i using flask-admin create back-end interface application. want add filters in admin view, error 'exception: unsupported filter type column_name' where column name column field foreign key. has worked flask-admin before? here models: class keywords(base): id = column(string(4), primary_key=true) language = column(foreignkey('w_accounts.language')) camp_type = column(foreignkey('w_camp_types.camp_type')) class keywordsadmin(baseadmin): column_searchable_list = ('toa_id', 'name', 'toa') column_list = ('toa_id', 'language', 'camp_type', 'name', 'aliases', 'toa', 'toa_type') column_filters = ('language',) after going through api, tried add following attribute well: column_select_related_list = ('language',) instead of getting error exception when load page on browser, "attributeerror: 'columnproperty' object ha

If-break in Clojure -

i trying figure out equivalent of java in clojure: public int compute(int x) { if (x < 0) return 0; // continue computing return result; } is there idiomatic clojure "break" processing within function , return result? no. there no short-circuit return statement (or break or goto ... ). return implicit. a near equivalent in clojure example is (defn test [x] (if (< x 0) 0 (let [result (comment compute result)] result))) but return result without naming it: (defn test [x] (if (< x 0) 0 (comment compute result))) these run, comment evaluates nil . by way, if construct 2 expressions (rather full three) returns nil if test fails. (if (< 3 0) 0) ; nil so there return.

html - ios tab bar with bartender.css How do I set icons? -

i attempting use bartender.css in project making fun. desire replace default icons own icons, yet can't seem find how so. there unresolved stackoverflow here also: jquerymobile , bartender tabbar - individual icons feel should asked again many things plugin seem have changed in past year or so. in example, shows 5 different icons. yet can't find in css need changed. believe icon urls go somewhere in part of css: /* ============= seperate css-sprites ======================= */ /* 7b. seperate */ /* regular */ .solosprite li .ui-btn-inner { display: inline-block; position: static; height: 30px; width: 30px; background-color: none; background: url("sprite_lo-res.png") no-repeat; background-size: 300px 44px; -o-background-size: 300px 44px; -webkit-background-size: 300px 44px; -moz-background-size: 300px 44px; -ms-background-size: 300px 44px; } .solosprite li a[data-icon="features"] span:only-child { backgr

model - propagate new default value to old Django objects -

i added default value 1 of fields of 1 of models in django site. objects of type existed before set default have null value field. new default value set propagated backwards onto of objects existed before set default value. how can this? just run update query: mymodel.objects.filter(myfield__isnull=true).update(myfield=new_value)

backbone.js - RequireJS/Backbone : inheritance of dependencies? -

update : i've found solution slighty same in first answer. but in fact i'd know if there manner using requirejs, without using special var or parameters in views . here solution : define(['resthub', 'backbone', 'views/mymodule/parent-view', 'views/mymodule/a-view'], function(resthub, backbone, parentview, aview) { var parentview = backbone.view.extend({ // stuff before buildaview : function(aviewobject){ var aview = aviewobject || aview; // enought source code before , after following lines // don't want duplicate in childview this.aview = new aview(); this.aview.render(); } // stuff after }); return parentview; }); i try use maximum inheritance in backbone project dependencies managed requirejs avoid duplicate code. in fact, create new view extend base view. base view has dependency want override. if try override, origina

c# - JavaScriptSerializer.Deserialize() skip property if cannot parse it -

i deserializing json strings using person objects using code: javascriptserializer serializer = new javascriptserializer(); person person = serializer.deserialize<person>(jsonstring); the person class has age property: int age {get;set;} the json string has value like: {age: 'not valid int'} and getting exception follows: cannot cast string int32 is there way tell javascriptserializer skip on error , continue other properties? yes, possible control deserialization process writing custom javascriptconverter class: public class personconverter : javascriptconverter { public override object deserialize(idictionary<string, object> dictionary, type type, javascriptserializer serializer) { person person = new person(); foreach (string key in dictionary.keys) { var value = dictionary[key]; switch (key) { case "name":

vb.net - (VB / ACCESS / CR) Filter VB Crystal Report based on Access Form -

before question, here overview of going on. access a form has combobox selects jobid crystal reports a report calls info several tables, based on jobid vb a form (using crystal reports plug-in) shows report outside of crystal reports designer app. my problem i need report displayed in vb filtered job chosen in access combobox. update i have database linked vs2012, , works fine without issues. can pull info table easily. need link combobox from access form to vs2012 filter report. i hope makes question clearer. update 2 i able figure out how create select query based on value of combobox inside of access, should able use access value looking for, still need know how use value filter cr... one possible solution create saved select query in access replicates query in cr, , name query [jobreport_base]. then, create saved select query in access , name [jobreport_current]. add code access form updates .sql property of [jobreport_current] query r

regex - sed formatting double quotes single quotes -

i'm using sed replace word in text.xml. the text.xml looks this: some line <state name='generate'> notify </state> line i'm trying replace word 'notify' caller' command have far is: sed -i "/<state name=\'generate\'>/,/<\/state>/s/notify/caller/" ./test.xml i giving sed range of lines between , . between lines word 'notify' replacing caller. i'm unsure if quoting problem. insight appreciated, thanks. edit: got work removing escape characters around generate. sed -i "/<state name='generate'>/,/<\/state>/s/notify/caller/" ./test.xml does know reason behind it? it seems don't need escape single quotes when using double quotes sandwich entire expression... – siddhartha i got work removing escape characters around generate. – user2661842

Windows 8 blows error on c# process for printing pdf file, how? -

the following code @ least works printing pdf file in windows 7, blowing error in windows 8: process process = new process(); //process.startinfo.createnowindow = true; process.startinfo.windowstyle = processwindowstyle.hidden; process.startinfo.filename = deffile; if (rwprinter.length > 0) { process.startinfo.verb = "printto"; process.startinfo.arguments = "\"" + rwprinter + "\""; } else { process.startinfo.verb = "print"; } process.start(); here details of error: ************** exception text ************** system.componentmodel.win32exception (0x80004005): no application associated specified file operation @ system.diagnostics.process.startwithshellexecuteex(processstartinfo startinfo) @ system.diagnostics.process.start() @ ecitation

oop - How to call parent class' method from a subclass in JavaScript so that parent's local variables would be accessible? -

i'm using 1 of approaches class inheritance in javascript (as used in code i'm modifying), not understand how attach additional functionality method in subclass functionality respective parent class method has; in other words, want override parent's method in child class method besides own sub-class-specific stuff same parent's method doing. so, i'm trying call parent's method child's method, possible? the code here: http://jsfiddle.net/7zmnw/ . please, open development console see output. code here: function makeassubclass (parent, child) { child.prototype = new parent; // no constructor arguments possible @ point. child.prototype.baseclass = parent.prototype.constructor; child.prototype.constructor = child; child.prototype.parent = child.prototype; // 2nd way of calling methodb. } function parent (invar) { var parentvar = invar; this.methoda = function () {console.log("parent's methoda sees parent's local

customization - Google forms stopped working -

i student worker , learning how work google forms. trying build form our department involved in. have custom google form working bit stopped. located @ http://www.uaf.edu/marketing/intake/ . have trigger set onformsubmit > fromspreadsheet > onformsubmit . using code in script editor , set onformsubmit: function onformsubmit(e) { var name = e.values[1]; var title = e.values[2]; var department = e.values[3]; var email = e.values[4]; var phone = e.values[5]; var newproject = e.values[6]; var project = e.values[7]; var description = e.values[8]; var descriptcomment = e.values[9]; var audience = e.values[10]; var audiencecomment = e.values[11]; var accomplish = e.values[12]; var result = e.values[13]; var tarday = e.values[14]; var compday = e.values[15]; var infoday = e.values[16]; var chat = e.values[17]; var refer = e.values[18]; // change address address want notification go var = "email#1,email#2"; var subject = "mc intake form notification"; var me

sql server - using sp_send_dbmail with join -

i trying run following job on sql server agent , don't email. i think there wrong way representing tables in inner join because if replace query simple query without joins, task works . exec msdb.dbo.sp_send_dbmail @profile_name = 'test_dev', @recipients = 'xxx@gmail.com', @query = ' select percentage = convert(decimal(10,1),100 - (cast(count(distinct case when pd.exception != ' ' pd.id end) float)/cast(count(pd.id) float)*100)) databasename.dbo.product p inner join databasename.dbo.logproduct pd on p.logid = pd.logid responsetime < getdate() , requesttime > dateadd(minute, -150, getdate()) ' , @subject = 'test', @attach_query_result_as_file = 1 ; i use joins in @query parameter time without error. fact don't email sent typically indication query did not parse @ run time. does query

Rails 4 and Ruby 2 Net/HTTP SSL Request: OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: unknown protocol -

this duplicate of: ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed but specific rails 4 , ruby 2 environment. figure appropriate make new question because solutions worked on machine previous environments no longer appear work after updates rails , ruby. the problem when making net/http ssl request tune of: api_uri = uri("http://accounts.google.com/o/oauth2/token") https = net::http.new(api_uri.host, api_uri.port) https.use_ssl = true https.ca_file = '/usr/local/etc/openssl/cert.pem' if rails.env == "development" https.request_get(api_uri.path) i receive the openssl::ssl::sslerror: ssl_connect returned=1 errno=0 state=sslv2/v3 read server hello a: unknown protocol error. i've tried out solutions in referenced question worked in previous environments, no avail. try setting certificate in environment i.e env see env['ssl_cert_file'] = "your certificate path"

python - Identifying audio's tempo from live input -

this question has answer here: how detect bpm of song in php [closed] 12 answers i haven't been able find adequate answer yet, figured ask. i'm trying build app takes audio signal (someone playing piano, not .wav or .mp3) follow player's tempo. application here live karaoke, there video screen lyrics follow tempo well. right now, i'm trying solve audio portion, need write identifies tempo of incoming audio , able follow tempo. there libraries or resources directly relate problem? i thinking coding in python (since that's i'm familiar with) wrapping in objc, i'm still neophyte programming, i'm open learning whatever need to. any appreciated! unfortunately, cannot tell way prepared solutions. think should listen every byte of discret audio signal. any music has rythm, periodical pulsation of audio signal amplitude. i

objective c - Get int value of UITextField -

i'm trying int value of uitextfield. have set keyboard type to: textfield.keyboardtype = uikeyboardtypenumberpad; and try int value this: nslog:([nsstring stringwithformat:@"%i", [textfield.text intvalue]]); even though enter integers returns 0. whats wrong? my guess is, textfield nil. outlet set correctly? outlet property , access self.textfield.text . you log textfield , see if nil.

linux - Can't start MySQL after ESXi reboot -

my mysql server stopped working after esxi server restart... not start automatically, , can't start unix shell. ~# service mysql restart restart: unknown instance: ~# sudo service mysql start start: job failed start ~# sudo -u mysql mysqld ~# ~# netstat -tap | grep mysql ~# ~# service mysql restart restart: unknown instance: files @ /var/log/ : mysql.err , mysql.log empty. file here /var/log/mysql/error.log has info: version: '5.1.62-0ubuntu0.11.10.1' socket: '/var/run/mysqld/mysqld.sock' port: 3306 (ubuntu) 130410 9:50:54 [error] /usr/sbin/mysqld: table './radius/radcheck' marked crashed , should repaired 130410 9:50:54 [warning] checking table: './radius/radcheck' 130410 9:50:54 [error] /usr/sbin/mysqld: table './radius/radpostauth' marked crashed , should repaired 130410 9:50:54 [warning] checking table: './radius/radpostauth' 130410 9:50:54 [error] /usr/sbin/mysqld: table './radius/resv' marked cra

javascript - Programmatically opening a popup in a Mapbox map -

i have mapbox map @ http://bei.dev.bclcmaps.com/ has popups open when clicking marker. my problem need way set default popup open on page load based on value in url. can latitude , longitude or other value, whatever's easiest. i have banged on while , seems either need to: programmatically open popup via mapbox js api, can't figure out since seems popups auto-generated on fly when marker clicked, or programmatically click marker open popup. can't figure out because 1) don't know how find marker lat/lon , 2) can't figure out how click marker js. i've tried this: map.gridlayer.fire('click', {latlng: l.latlng(28.04419, -81.947864)}); which closes existing open popups doesn't seem open own. i've tried digging through map , leaflet objects see if location/marker data stored in there , can't find besides tiles. most of examples can find seem using geojson i'm not using makes things difficult. any advice? map.fir

javascript - jQuery to slide a div right to left slides the div out of window -

i have created slider slides right left. changing margin-right make slide work. as per requirement, have treeview, when user clicks on node, opens sliding dialog controls in it. when user clicks on node, should first close open dialog , open dialog selected node. able make work when user clicks on node, dialog opens, , when user click again on same node or slider-button, dialog hides. somehow, code hide when user click on other node doesn't work properly. moves slider-button , dialog away , don't see anything. i used following code: if($('#slider-button').css("margin-right") == "400px") { $(sliderdialog).animate({"margin-right": '-=400'}); $('#slider-button').animate({"margin-right": '-=400'}); } else{ $(sliderdialog).animate({"margin-right": '+=400'}); $('#slider-button').animate({"margin-right": '+=400'}); } i thought, simple finding

ios - initWithNibName loads but viewDidLoad does not -

myviewcontroller view controller without associated xib (it inherits myparentviewcontroller does have associated xib). in myviewcontroller.m have viewdidload , initwithnibname methods. why initwithnibname called viewdidload not?

spring - Caused by: java.lang.NoClassDefFoundError: Could not initialize class net.sf.cglib.proxy.Enhancer -

when autowire bean scope of request.session ,i error.i using spring 3 hibernate. have create proxy around concerete class,so have cglib option. problem of autowiring solved design patterns method injection,factory pattern,but have autowire lot of beans going solution of proxing. caused by: java.lang.noclassdeffounderror: not initialize class net.sf.cglib.proxy.enhancer @ org.springframework.aop.framework.cglib2aopproxy.createenhancer(cglib2aopproxy.java:228) @ org.springframework.aop.framework.cglib2aopproxy.getproxy(cglib2aopproxy.java:170) @ org.springframework.aop.framework.proxyfactory.getproxy(proxyfactory.java:112) @ org.springframework.aop.scope.scopedproxyfactorybean.setbeanfactory(scopedproxyfactorybean.java:109) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.invokeawaremethods(abstractautowirecapablebeanfactory.java:1422) @ org.springframework.beans.factory.support.abstractautowirecapablebeanfactory.initializebean(abstractautowirecapable

asp.net - RenderBody() and RenderSection() must be on every child layout? -

i have 3 simple layout, _layout.cshtml (this base layout) @rendersection("something", required: false) @renderbody() _main.cshtml @{ layout = "~/views/shared/_layout.cshtml"; } @section { hey i'm on _main layout. } index.cshtml @{ layout = "~/views/shared/_main.cshtml"; } when try render index view in action, got error, the "renderbody" method has not been called layout page "~/views/shared/_main.cshtml". but wait, _main.cshtml has parent layout has renderbody() . wrong, must call renderbody() every child layout? yes, renderbody should included on every layout page, regardless nesting. @renderbody works placeholder engine know drop content of view using layout page.

javascript - jquery-ui autocomplete ajax, isusse in succes -

i have 1 autocomplete element in page, use json request data, cant see ui. i made test in past, default fuctionaly $(function() { var availabletags = [ "actionscript", "applescript", "asp", "basic", "c", "c++", "clojure", "cobol", "coldfusion", "erlang", "fortran", "groovy", "haskell", "java", "javascript", "lisp", "perl", "php", "python", "ruby", "scala", "scheme" ]; $( "#tags" ).autocomplete({ source: availabletags }); }); but, i chage structure of data $(function () { var availabletags = [ {"label":"one label", "value":"one value", "id":1}, {"label":"2 label

Translating this XML to JSON using XSLT -

i attempting translate trivial xml json using xslt. my xml looks following: <some_xml> <a> <b> <c foo="bar1"> <listing n="1">a</listing> <listing n="2">b</listing> <listing n="3">c</listing> <listing n="4">d</listing> </c> <c foo="bar2"> <listing n="1">e</listing> <listing n="2">b</listing> <listing n="3">n</listing> <listing n="4">d</listing> </c> </b> </a> </some_xml> the output should following: { "my_c": [ { "c": { "foo_id": "bar1", "listing_1": "a", "listing_2": "b", "listing_3": "c",

Can I display a random string into a HTML document? -

i have web page. i'd randomly switch between 2 different strings. easiest way of doing this? <!-- begin #random part --> <section id="countdown"> <div class="countdown-background"> <h1>this first random string</h1> <h1>i'd second random string</h1> </div> <div class="clear"></div> <div class="countdown-background"> <p>here's first random string</p> <p>and here's second of second random string</p> </div> </section> <!-- end #random part --> of course try using javascript. <body> <p id="pp"> </p> <script> var strarray = new array("random string1","random string2","random string3"); randomnum = math.round(math.random()*2); para = document.getelementbyid('pp'); para.innerhtml = strarray[randomnum] </s

batch file - Reg add for loop -

sorry if question has been asked before, haven't been able find answer can understand , apply. i'm writing batch file installs application, , need batch file add registry key in software key every profile in hkey_users hive. i've been able use reg add add key logged on user, because our desk running batch file elevated command prompt, change not affect user needs run application. this had reg add reg add "hkcu\software\application" /v "current practice" /t reg_sz /d "\\server\share" any suggestions? you need load user's hive registry before can modify it: @echo off setlocal set "hive=hku\temp" set "key=software\application" set "value=current practice" set "data=\\server\share" /d %%u in (c:\users\*) ( if exist "%%~u\ntuser.dat" ( reg load %hive% "%%~u\ntuser.dat" reg add "%hive%\%key%" /v "%value%" /t reg_sz /d "%data%

php - Link to a different page within an included file, to be loaded on the same parent file -

i hope question makes sense because seems simple, yet can't work out how word in understandable way. basically - have ajax system loading content onto html file via seperate php file. not need actual page browser has loaded change, content. what able create link within 1 of loaded content pages, change content page via parent. example: load 'menu' page using ajax, onto div contained in main page click link on 'menu' page, , different page loaded onto same div on main page cheers create javascript function load content, , create javascript: links, or onclick handlers run requested page :)

is anything wrong with this php-sql query? -

could check what's wrong sql query select distinct a.a a.b tableaa inner join(tablebb b) on(a.a= b.a) inner join(tablecc c) on(a.a = c.a) inner join(tabledd d) on(a.a = d.a) b.c = '$selectedtype' , b.d not '%$selection%' , c.e='$selction111' or d.c = '$selectedtype' , a.d not '%$selection%' , c.e='$selction111' i have concerns or conditions, want here either conditions between 'where' , 'or' true or below 'or' true. is way of writing correct? or there other way write? you looking for: (b.c = '$selectedtype' , b.d not '%$selection%' , c.e='$selction111') or (d.c = '$selectedtype' , a.d not '%$selection%' , c.e='$selction111')

ASP.Net MVC Routing/Using Dynamic Actions -

ok trying build controller has following action methods public actionresult executestep_1a public actionresult executestep_1b public actionresult executestep_2 etc... is there way define route uses parameter concatenated action name? instance url /step/executestep_1a. tried defining route url equal to: {controller}/{action}_{number} with no success. tried few other permutations again no results. if point me in right direction i'd appreciate it. oh set action equal executeresult_ default if adds explanation any. you can use root action , them use reflection that: {controller}/{action}/{step} public actionresult executestep(string step){ try { type thistype = this.gettype(); methodinfo themethod = thistype.getmethod("executestep_" + step); return themethod.invoke(this, null); } catch {} } but there speed limitation, if using reflection.

java - How to compute, for each method, the set of exceptions that method may throw, including runtime exceptions? -

i'm trying implement intra-procedural analysis computes, each method, set of exceptions method may throw, including runtime exceptions explicitly thrown means of throw statement. so far, i'm lost on how start soot. can give me first hint? you should @ implementations of throwsanalysis . analyses can parameterized make different assumptions statement can throw exceptions. analysis intra-procedural, however, i.e., have make coarse assumptions method calls. if want model method calls precisely recommend crafting inter-procedural analysis heros . cheers, eric

awk - Sed: Complicated replace after pattern (on same line) -

suppose have text this: foobar 42 | ff 00 00 00 00 foobaz 00 | 0a 00 0b 00 00 foobie 00 | 00 00 00 00 00 bar 00 | ab ba 00 cd 00 and want change non- 00 on right hand side of | wrapped () , if on lhs of | has 00 . desired result: foobar 42 | ff 00 00 00 00 foobaz 00 | (0a) 00 (0b) 00 00 foobie 00 | 00 00 00 00 00 bar 00 | (ab) (ba) 00 (cd) 00 is there way of going using sed, or trying stretch beyond capabilities of language? here's work far: s/[^0]\{2\}/(&)/g wraps rhs values /[^|]*00[^|]*|/ can used address command operate on valid lines the trick formulate command executes in portion of pattern space. this isn't line oriented, may explain why i'm having trouble getting expression works. $ awk 'begin{ fs=ofs="|" } $1~/ 00 /{gsub(/[^ ][^0 ]|[^0 ][^ ]/,"(&)

Umbraco - Edit a custiom data type -

i want modify existing custom data type in umbraco. tried option somehow can't see edit option in context. have idea ? your appreciated. thanks!!!! to create own data type click right on data types folder in developer section of umbraco admin page select create , type in name want call it. a panel displayed can choose data type want in property editor. when press save button settings relevant data type have chosen displayed. show when select data type in data types tree. these data type settings can change in umbraco admin section know of.

How do I use the CloudBees SDK (command line interface) on Jenkins -

i running job in dev@cloud on cloudbees - want use cloudbees sdk/cli, how do within job? the scripting bees sdk in jenkins doc includes write-up this. firstly, use freestyle job, install bees sdk part of it: # install , configure bees sdk export bees_home=/opt/cloudbees/cloudbees-sdk/ export path=$path:$bees_home if [ ! -d ~/.bees ]; bees init -f -a <your account name here> -ep -k $bees_api -s $bees_secret fi then set secrets in jenkins setup bees_api bees_secret - , can use bees sdk commands. you can install plugins need here well.

how to connect SQL-Server database with Oracle Enterprise Repository -

my dept wants keep using homegrown asp application runs off sql-server database, want take advantage of governance capabilities , slick navigator in oracle enterprise repository. possible integrate oer database un-normalized sql-server database? i don't mean one-shot migration sql oer. i'm looking adapter or allow use of both oer , asp application on ongoing basis? i don't want tightly coupled solution involves lot of coding of .bat files. i'd rather takes advantage of existing connectors , adapters, if possible. oer support sql server backend - take @ oer installation guide. great idea use oer - find powerful , flexible tool governance, , hear oracle investing lot in future versions.

sqlite - Was it mandatory to put a "distinct" field as the first field in a query? -

just out of curiosity, looks distinct field must placed ahead of other fields, wrong? see example in sqlite, sqlite> select ip, distinct code parser; # syntax error? error: near "distinct": syntax error sqlite> select distinct code, ip parser; # works why that? have syntax error? there no such thing " distinct field". distinct applies fields in query , therefore must appear after select . in other words, select distinct code, ip really select distinct code, ip rather than select distinct code, ip it selects distinct pairs of (code, ip) . result set include repeated values of code (each different value of ip ). it not possible apply distinct single field in way you're trying ( group by might useful alternative, need understand you're trying achieve).

c++11 - noexcept(expression) - where expression is a noexcept function that actually throws -

looking @ c++11 spec (n3485) section 5.3.7, note 3 says result of noexcept(expr) false if: ... potentially-evaluated call function... not have non-throwing exception-specification ... potentially-evaluated throw-expression ... potentially-evaluated dynamic_cast ... potentially-evaluated typeid expression... does "potentially evaluated" mean drills down (not @ all? little?) determine if 1 of conditions can result in false? i'm finding (in test code, not application) function claims noexcept does, in fact, throw (even if in cases) still considered noexcept. misunderstanding spec or code in following example wrong? double calculate(....) noexcept { throw "haha"; } // using simpsons::nelson bool does_not_throw = noexcept(calculate()); according clang 3.3 test says calculate() not throw. all it's doing checking expression see if terms of expression throw exception. doesn't check actual code potentially called. if 1 of expre

jquery - Delay html form submission until div animation complete -

i'm using jquery form validation plugin validate form. have set rules , messages etc. in html have made css styled dialog displayed user confirmation message.when user registers div confirmation fades in on entire page before form's action file called. question how delay forms submit action triggering long enough confirmation fade in , out. when try either straight away fires submit or doesn't @ all. //validation plugin $("#register_form").validate({ errorclass: "invalid", invalidhandler: function (event, validator) { $('html, body').animate({ scrolltop: '0px' }, 300); }, onfocusout: false, onkeyup: false, onclick: false, rules: { firstname: { required: true }, lastname: { required: true }, email: { required: true, email: true } }, messages: { firstname: {

caching - Why redis does not use Direct IO? -

as redis large buffer, there no need kernel cache buffer redis. why doesn't use direct io? direct i/o poor choice following reasons: for aof, need decorrelate write operation fsync operation since may not happen in same thread. cannot when use direct io. for aof rewrite , rdb, stdio (buffered io) used, since lot of small objects written. don't think can use o_direct stdio (there constraints attached o_direct ...). use direct io, have write our own buffering system on top of low level api. o_direct not available filesystems, , not portable. sometimes buffer cache useful. instance when slave connects master, request rdb dump, , read dump. without buffer cache, operation generate twice i/o. generally, dump file smaller data in memory. in many cases, not gain as think. while o_direct not solution redis, using posix_fadvise posix_fadv_dontneed option useful in cases. in past, played simple implementation of rdb dump.

javascript - How to make image resizable in UIWebView? -

i try find api resize image drag resizable in jqueryui in ios. command $("img").resizable(); work mouse gestures on desktop. please guide me how make? my code load uiwebview thank in advance! there lot of libraries convert touch events mouse events have binded functions. used touch-punch , met needs. if need resize or drag. edit: btw resize may need increase size of handles through css.

MySQL - Select rows with approximate interval -

i run website dedicated tracking statistics of players on online game. 1 of functions of website build charts them track progress on past 2000 games. what i'm doing using query records, using php select records in increments of approximately 100 battles, until have 20 records need build charts: select distinct battles, victories, survived, destroyed, detected, hitratio, damage, capture, defense, avg_exp, efficiency account_stats account_id = xxxxxxx , battles >= zzzzzzz; zzzzzzz current number of battles minus 2000. i'm using distinct because database can keep duplicate values (this because of historical functions). the reason must use approximate values because data game's api, during 1 check, might have played multiple games. means in database, "battles" count of varying increments. using query above killing database server since creates lot of temporary tables on disk, bringing entire website crawl. so question is: there way

javascript - AngularJS ng-repeat in this model -

i want know if possible use ng-repeat in model this: example model: $scope.items = { item1:{[1,2,3,4,5]}, item2:{[a,b,c,d,e]}, item3:{[a1,b2,c3,d4,e5]} }; the table should using ng-repeat: ------------------------- | item1 | item2 | item3 | ------------------------- | 1 | | a1 | | 2 | b | b2 | | 3 | c | c3 | | 4 | d | d4 | | 5 | e | e5 | ------------------------- if not possible using model, can please suggest alernatives? appreciated. in advance. you can change data model this function ctrl($scope) { $scope.items = [{ item1: 1, item2: 'a', item3: 'a1' }, { item1: 2, item2: 'b', item3: 'b2' }, { item1: 3, item2: 'c', item3: 'c3' }, ...]; } <div ng-app ng-controller="ctrl"> <table> <tbody> <th>item1</th&g

Using Select and Where parameter = any\dontcare in MySQL with C# -

in mysql based c# code have implement , search filter on database, have written select * table (list of parameter conditions); problem want default "select all" particular parameter. select * table type=(any\don't care); i want different rows types shown without filtering. same case happen if had omitted clause; cant omit clause in mine cause structure of query broken . . whole or missing "and" cause im using string builder concatenate query. ill post code below incase has better way of doing this; str.append("select * "); str.append(" recording "); str.append(" "); switch (type) { case "audio": str.append(" , type = " + 1 + " "); break; case "video": str.append(" , type = " + 2 + " "); break; case "voip": str.append(" , type = " + 3 +

class not found exception in android -

Image
i using following code sqlconnection in android: public void queryresultset(string commandsql) throws classnotfoundexception, java.sql.sqlexception { resultset rs; connection conn = null; toast msg1 = toast.maketext(getbasecontext(), "name = " + commandsql, toast.length_long); msg1.show(); class.forname("net.sourceforge.jtds.jdbc.driver"); string username="14graficali\\administrator"; string connurl="jdbc:jtds:sqlserver://14graficali\\mssqlserver2008;databasename=dvdkiosk;user=14graficali\\administrator;instance=sqlexpress"; conn = drivermanager.getconnection(connurl); statement st=conn.createstatement(); rs=st.executequery(commandsql); while(rs.next()) { toast msg2 = toast.maketext(getbasecontext(), "name = " + rs.getstring(

javascript - KineticJS: image.destroy() doesn't destroy the Kinetic.Image and group.destroy() causes an infinite loop -

i facing last few days strange problem kineticjs , web-application: in general application consists of several "pages" represented kinetic.group s. of groups except 1 offset, means not visible. non-visible groups added separate kinetic.layer temporarily (for caching etc...) , visible page added kinetic.layer make interactive. all of pages (or kinetic.group s) stored in array (because there no fixed amount) , accessed following: activelayer.add(pages[1]); . everything fine far, when i'm trying destroy kinetic.shape image, doesn't destroy image, means still there, visible , interactive. in next step wanted destroy entire "temporary" kinetic.layer , resulted in infinite loop , caused browser crash. so far i've investigated destroy -function of kineticjs , found out, go._removeid(this.getid()); , go._removename(this.getname(), this.getid()); functions receive undefined values. destroying layers, unrelated pages mentioned above, works with

wsdl - Using yodlee with php and nusaop library -

with soap server (“ https://sdkeval2.yodlee.com/yodsoap/service ”). getting below error: http error: couldn't open socket connection server ( http://xx.xx.xx:8080/yodsoap/services/cobrandloginservice/ ), error (110): connection timed out the issue due firewall @ either end. @ end check if outbound traffic allowed specific server on specified port. @ yodlee's end use white-list mechanism filter traffic make sure ip addresses included in white-list. note yodlee may take week before ip maybe allowed system. if of these in order connection should successful without issue.

How to explain multiple inheritance in Java -

this question has answer here: java : if extends b , b extends object, multiple inheritance 10 answers actually question asking 1 of interviewer que: how can java not supporting multiple inheritance? if object class parent of classes in java. i have no answer of question. that means no clear idea java concepts :-( ex: if a extends b and here extending object class. right? how works? please share answers.. multiple inheritance multiple- direct -inheritance. a single class class can't have 2 immediate parent classes. can have grandparent class, though. a extends b , b extends c , not same a extends both b , c . the reason disallowed simplicity when have case like: a extends both b , c b extends d c extends d if had such case, , had code: a = new a(); a.someabstractorvirtualmethodond(); ... talking b implementation of someab

.htaccess - Htaccess language redirect for joomla page -

i have website 6 languages - use /en , /de or /it language codes in url. want redirect 1 langauge (it) domain (external link - forward user italian website). think .htaccess right way this. .htaccess still complex me. user should redirected when trying access italian language on site, once accesses url has /it/ language tag. can out .htaccess magic? i tried modify following code found don't understand enough yet... doesn't work yet... rewritecond %{http:accept-language} ^(it.*) [nc] rewritecond %{request_uri} !(^/it/.*) [nc] rewriterule ^(.*)$ /it/$1 [l,r=301] rewritecond %{request_uri} !(^/.*) [nc] rewriterule ^(.*)$ /$1 [l,r=301] this can help: rewriteengine on rewritebase / rewriterule ^it/(.*)$ http://another-domain.com/$1 [r=301,l] requested url: http://old-domain.com/it/hello will redirect to: http://another-domain.com/hello

c# - How to create a new Live ID and check exists id from Web? -

so, want create tool register new live id & check exists id vailable [winform- c# - httpwebrequest] used fiddler catch get/post request didn't see parameters post server (username=xxx&password=xxx&xxx). register link: live.com how can ? winform : - textbox : username, password, email address - show captcha form signup.live.com user fill - button : register. when click button, auto-register(get parameters user fill) on signup.live.com. ================= edit : sniff fiddler : a sslv3-compatible clienthello handshake found. fiddler extracted parameters below. major version: 3 minor version: 1 random: 52 1a 03 d2 81 48 f0 3b fd cb 50 8c c8 ee 1b 57 48 8e a9 0e 52 ab 95 0b 7e 82 ea 61 aa cf c6 sessionid: a2 44 00 00 96 50 7b 3e 2c 90 02 4b 58 3e 02 d7 0a 3c d3 5a c9 c3 7c 92 49 bf 54 4d 3b 55 96 9c ciphers: [00ff] tls_empty_renegotiation_info_scsv [c00a] tls1_ck_ecdhe_ecdsa_with_aes_256_cbc_sha [c014] tls1_ck_ecdhe_rsa_with_aes_256_cbc_sha

sql server - Faster way to write specified query -

Image
so in our company have large amount of articles. have customized search function search in these articles, , here piece of code generates part of searchquery needs optimalization. dtmodif = daldoctype.fetchbyanyidentifier(false, "+") sb.append("(select ( ") each row in dtmodif.rows sb.append("isnull((select -sum(amount) ") sb.append("from sales." & row("tablename") & "detail ") sb.append("where articleid = articles.article.articleid ") sb.append("and dateadd(year,-1,getdate()) < timestamp ") sb.append("),0) ") sb.append("+ ") next dtmodif = daldoctype.fetchbyanyidentifier(false, "-") each row in dtmodif.rows sb.append("isnull((select +sum(amount) ") sb.append("from sales." & row("tablename&

ios - How to Turn off ARC for a framework if files of that framework are not seen under compile sources? -

this question has answer here: disable automatic reference counting files 5 answers i have compiled pantomime framework , when add project shows following error: pantomime.framework/versions/a/headers/cwcachemanager.h:40:13: arc forbids objective-c objects in structs or unions how can turn off arc or solve issue because file cwcachemanager not showing in compile sources. all suggestions welcome. thanx in advance this basic step : select project form project manager | | targets | | build phases | | compile sources | | select file want crate arc. (you can select multiple file name here) | | press "enter" key | |

c - Can I change the getenv 's return value? -

i want know happened if change memory return getenv i know not code. know setenv way. like: char *new_path = "/home/user/dev/mytry1"; char *path = getenv("path");// assume there : path=/home/user/dev/mytry //now *path = "/home/user/dev/mytry" memcpy(path,new_path,strlen(new_path)+1); is undefined behavior ? or wrong code? i tried , no error or segmentation fault happened. no, can't. documentation : conforming applications required not modify environ directly, use functions described here manipulate process environment abstract object.

wso2 - Can we Consume the Messages using wso2esb Jms -

i using wso2esb4.7.0 , activemq 5.8.0 versions followed wso2esb docs provided store , forward message store policy dont want store want consume messages has been store client application wish pool messages every 5 sec possible in wso2esb jms using activemq write sample code of proxy <messageprocessor name="duplicate5" class="org.apache.synapse.message.processors.forward.scheduledmessageforwardingprocessor" messagestore="duplicate" xmlns="http://ws.apache.org/ns/synapse"> <parameter name="interval">1000</parameter> <parameter name="message.processor.reply.sequence">fault</parameter> </messageprocessor> i tried not working to pull messages queue, need use jms transport..check jms proxy samples..

org.openqa.selenium.ElementNotVisibleException is occure even though the element is visible -

org.openqa.selenium.elementnotvisibleexception occuring though element visible. i find element using xpath , sending data in field using send keys. done fields in form.but , when control comes specific field , throws error . validated xpath, correct.element not added dynamically(input/text box) ../selenium-2.34.0/libs/guava-14.0.jar has no source attachment error.what mean if there iframe in application , u need navigate using driver.switchto(). unless navigate it, u getting similar result .

android - Jenkins fails to parse POM on Mac -

i setting ci jenkins on mac mini, after configuration error : error: failed parse poms java.io. ioexception: cannot run program "/users/shared/jenkins/home/tools/hudson.model.jdk/jdk/bin/java" (in directory "/users/shared/jenkins/home/jobs/maventest/workspace"): error=2, no such file or directory @ java.lang.processbuilder.start(processbuilder.java:1041) @ hudson.proc$localproc.<init>(proc.java:244) @ hudson.proc$localproc.<init>(proc.java:216) @ hudson.launcher$locallauncher.launch(launcher.java:773) @ hudson.launcher$procstarter.start(launcher.java:353) @ hudson.maven.abstractmavenprocessfactory.newprocess(abstractmavenprocessfactory.java:234) @ hudson.maven.processcache.get(processcache.java:235) @ hudson.maven.mavenmodulesetbuild$mavenmodulesetbuildexecution.dorun(mavenmodulesetbuild.java:729) @ hudson.model.abstractbuild$abstractbuildexecution.run(abstractbuild.ja

html5 - I want to add current datetime for a image which is taken from camera API using phonegap -

i developing app ios/andorid/windows, have functionality capture image , save in our apps. images capturing , save folder , display in div. want add date time image taken. lets if take image on 25-08-2013. want display date time in image @ right corner. how achieve in phonegap. heard canvas html5 feature dont know how use taken image in canvas tag. function capturephoto() { navigator.camera.getpicture(onphotodatasuccess, onfail, { quality: 50, destinationtype: destinationtype.file_uri }); } function onfail(message) { alert('failed because: ' + message); } function onphotodatasuccess(imagedata) { console.log("image property-->"); var smallimage = document.getelementbyid('smallimage'); smallimage.style.display = 'block'; // smallimage.src = "data:image/jpeg;base64," + imagedata; smallimage.src = imagedata; } <div data-role="page"> <div data-role="header" data-theme="