Posts

Showing posts from August, 2012

user interface - Android+LibGDX - textures gone in Android UI activity only after finishing a Libgdx activity? -

my situation this: i have 3 activities: 2 using android uis (shown below) , 1 libgdx androidapplication i can go , forth 2 menu activities want , wai i can go libgdx androidapplication menu activity , wai i can go menu activites libgdx androidapplication, , split second have fonts/etc. rendering should, turn this: http://i.stack.imgur.com/vtocb.jpg my hypothesis libgdx androidapplication when destroyed must freeing / unloading, or instructing android to, texture memory or gl surface view or texture memory backing android fonts using? the ninepatch drawables buttons being affected not font-specific thing. on/off switch not though, assigning drawable in-code. perhaps layout inflater setcontentview thinks textures loaded when being freed libgdx activity's ondestroy? p.s. @ first thought out of memory fonts couldn't loaded texture, meaning had fat memory leak somewhere, memory analysis indicates leak free. image after going , forth through 3 activities 5 tim

java - Syntactical Errors in my Android media player -

these syntactical errors, , don't know how figure out, current_song cannot resolved variable multiple markers @ line, song_url cannot resolved variable how resolve above errors. unable access song_url , current_song in methods, instance in, next.setonclicklistener(new view.onclicklistener(){ @override public void onclick(view v) { // todo auto-generated method stub mp.stop(); ++current_song; mp.setdatasource(song_url[current_song]); mp.start(); } }); my complete code, public class jsonmedia extends activity { private mediaplayer mp; button play, pause, next; public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.jsonview); mp = new mediaplayer(); mp.setaudiostreamtype(audiomanager.stream_music); play = (button) findviewbyid(r.id.play); pause = (button) findviewbyid(r.id.pause); next = (button) findviewby

Android System Services not available error -

i want try use system service such wakelock reason when run errors saying "system services not available activities before oncreate()" tried changing little of wakelock see if fix moving newwakelock oncreate() still not work, can fix this? public class mainactivity extends listactivity { string[] activities = {"package1", "package2", "package3"}; private powermanager powermanager = (powermanager) getsystemservice(context.power_service); //@suppresswarnings("deprecation") private powermanager.wakelock wakelock; //= powermanager.newwakelock(powermanager.full_wake_lock, "my tag"); @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); wakelock = powermanager.newwakelock(powermanager.full_wake_lock, "my tag"); wakelock.acquire(); this.setlistadapter(new arrayadapter

c++ - error: undefined reference to `vector<int>::pushBack(int const&)' -

i create vector class , in qt wrote code this click action trying add new value in vector click action void mainwindow::manuelclick() { int b=0; vector<int> a; a.pushback(10); for(int i=0;i<a.size();i++) { b=a.getarray(i); qstring str=qstring::number(b); ui->mbox->settext(str); } these errors got undefined referance vector<int>::pushback(int const&) undefined referance vector<int>::size() undefined referance vector<int>::vector() undefined referance vector<int>::getarray(int) undefined referance vector<int>::~vector() undefined referance vector<int>::~vector() collect2: error: ld returned 1 exit status when delete code there no error here "vector.h" #include<iostream> template <class t> class vector { int vsize,maxsize; t* array; void alloc_new(); public: vector(); vector(int);

java - Wait for a thread before continue on Android -

i've 1 thread, i'd wait finish before continue next actions. how it? new thread( new runnable() { @override public void run() { mensaje = getfilesfromurl(value); } }).start(); here i'd put (but loops) knows when thread finishes , evaluate result ( mensaje ) btnok.setvisibility(view.visible); progressbar.setvisibility(view.gone); lblestado.settext(mensaje); if(mensaje.equals("importado")) startactivity(new intent(scanurl.this, mainactivity.class)); thread t = new thread(new runnable() { @override public void run() { mensaje = getfilesfromurl(value); }}); t.start(); // spawn thread t.join(); // wait thread finish

In android I am posting xml data to server but getting 403 error -

i need verify user making post request. posting xml data using using rest protocol getting 403 error. please me find out doing wrong, below code post. public void makepostconnection(string fileurl, hashmap<string, string> requestdata) { url url; httpurlconnection urlconnection; try { url = new url(fileurl); urlconnection = (httpurlconnection) url.openconnection(); urlconnection.setrequestmethod("post"); urlconnection.setrequestproperty("content-type", "application/x-www-form-urlencoded"); httpclient httpclient = new defaulthttpclient(); httppost httppost = new httppost(fileurl); httppost.addheader("accept", "text/xml"); list<namevaluepair> namevaluepairs = new arraylist<namevaluepair>( requestdata.size()); system.out.println("s

objective c - How to determine when all methods are finished? -

i have rootviewcontroller create mainviewdownload instance , call method of instance. mainviewdownload *download = [[mainviewdownload alloc] init]; [download loadmainviewimages]; how can know when loadmainviewimages finished ? call loadmainviewimages rootviewcontroller loadmainviewimages calls method inside mainviewdownload class (lets method2), , method2 calls again method3. so, there way know when loadmainviewimages finished (actually when method3 finished since last called). if you're not multithreading, i.e. starting method runs on separate thread loadmainviewimages , methods executed sequentially. once loadmainviewimages returns can sure "in it" executed. how methods work. edit better formatting of comments: mainviewdownload.h @protocol mainviewdownloaddelegate; @interface mainviewdownload @property (nonatomic, weak) nsobject<mainviewdownloaddelegate> *delegate; @end @protocol mainviewdownloaddelegate - (void)downloaddidfinish:(mainvi

javascript - Save Email Addresses on Website -

i have created simple website , have form asks user input email address receive future updates me. what best way save these emails. not anticipating having many thought email them myself every time submits theirs. know how using asp.net , gmail. questions are: 1) there way accomplish using html , javascript , better having use asp.net 1 thing on site (i haven't looked web hosting have thought cheaper use html , javascript)? 2) there better way go have missed? thanks rob is there way accomplish using html , javascript no is there better way go have missed? use real mailing list software or third party mailing list service. save having maintain list manually (which error prone) , (especially if use decent third party service) reduce number of indicators emails trigger in spam filters.

swing - Java code needs to restrict the user input -

i got serious problem on code. i got swing jdbc code need fill table of names, addresses , id person, different table's id. created swing input code it, however, wish not include id number's possibility - therefore, make swing have nothing else name , address being able set used, , not show id @ all. is there possibility it? the creation of new partner, has name, address , identitynumber strings, private , getters , setters public. { protected final string frame_title = "vehicle repository"; private databasehandler dbhandler; private jtabbedpane tabbedpane; private jtable partnertable; private jpacontrolledtablemodel<partner> partnertablemodel; @override public void oncreate() { setdefaults(frame_title); setdefaultcloseoperation(dispose_on_close); dbhandler = new databasehandler(); dbhandler.open(); tabbedpane = new jtabbedpane(); partnertablemodel = new asyncfullqueryingt

New to Access 2013 - Would like to create a dynamic search form -

i new access 2013 , create form allows users interactively enter search parameters , see results listed on same form multiple items or data sheet. this work search on web page: users enter search criteria , click search button. data grid display results. each time user re-enters search criteria, data grid reloaded query results. important user not required launch 1 form enter criteria , see results on form. should done on same form. my questions are: if use vba handle click event , perform query, possible programmatically set control source of data sheet or multiple items new query results? the method used create dynamic search form is: create access form prompt search paramaters. mine consisted of 2 text boxes format set general date. (i want list rows between start , end date), unbound list box results , command button execute search. create access query uses criteria setting references starting , ending text boxes on search form. field name want use

PHP arrays to JavaScript -

this question has answer here: php arrays javascript arrays 6 answers i searching in page answer question, dont found it. <script type="text/javascript"> var jsarray= []; <?php include("conectar.php"); if (isset($_get['selector'])) $condicion = ' clave=' . $bd->quote($_get['selector']); else $condicion = ''; $pet = $bd->prepare("select * calendario" . $condicion); $pet->execute(); $filas = $pet->fetchall(); $arrayf=array(); $arrayu=array(); print '<table class="gridtable">'; foreach ($filas $fila) { //print '<tr><td>'.$fila['fecha'] . '</td><td>' . $fila['url'] . '</td></tr>'; array_push($arrayf,$fila['fecha']);

templates - C++ functor binding -

i tried use old bind2nd function in way: template<typename t> class printer { public: void operator()(t a, string& kd) { cout<<a<<endl; } }; int main(int argc, char *argv[]) { string nme = "j-dar"; auto f1 = bind2nd(printer<int>(),nme); //f1(5); return 0; } but lot of errors: required here error: no type named 'first_argument_type' in 'class printer<int>' class binder2nd ^ error: no type named 'second_argument_type' in 'class printer<int>' typename _operation::second_argument_type value; ^ error: no type named 'second_argument_type' in 'class printer<int>' binder2nd(const _operation& __x, ^ error: no type named 'result_type' in 'class printer<int>' operator()(const typename _operation::first_argument_type& __x) const ^ error: no type named 'resu

c# - Creating BitmapImage from a byte array -

i trying create bitmapimage byte array returned service. my code is: using (sc = new serviceclient()) { using (memorystream ms = new memorystream(sc.getimage())) { display = new bitmapimage(); display.begininit(); display.streamsource = ms; display.endinit(); } } however, exception thrown @ endinit method. says object reference not set instance of object. . it seems, uri null , causes problem. unfortunately, cannot find solution myself. well, turned out, wpf binding causing error. private bitmapimage _display; public bitmapimage display { { return _display; } set { _display = value; raisepropertychanged("display"); } } i resolved issue getting image not in property display itself, rather in filed _display. so, following working fine. using (sc = new serviceclient()) { using (memorystream ms = new memorystream(sc.getimage())) { _display = new bitmapimage();

SQL injection attack(hacker posting spam hyperlinks) into our sql db columns. -

does know why our website getting these sql injection attacks (the hacker posts spam paydayloan hyperlinks our database columns)? know how remove error not find solution in first place. ricky most data access implenmentation take care of injection you. use prepared statements / bind variables instead of string concatenation.

regex - Emacs regexp replace situation -

on emacs let have text: abcd abcd. 23 . 2 important catching with \. [[:digit:]] can catch pattern how replace without . output should abcd abcd 23 . you use capturing groups retain numeral. replace regexp: \. ([[:digit:]]) replace regexp with: \1 the \1 refers numeral captured using ([[:digit:]]) .

Grabbing a service from anywhere in the app (Android) -

i created service has check repeatedly after given amount of time, should communicate app result of check, no matter activity app in precise time, should respond message accordingly. i got point service performs check periodically, don't know how grab instance of service anywhere on app, in order results, stop service when app in background etc. if using spring framework, can inject service want accessible in program. otherwise can work singleton-pattern. example singleton pattern written in java can found here: http://www.javaworld.com/javaworld/jw-04-2003/jw-0425-designpatterns.html or google "singleton pattern example". hope helps far.

c# - jquery.getJSON() call back function doesn't execute -

i have write code perform deletion operation ajax call. c# code given below. [acceptverbs(httpverbs.get)] public jsonresult delete(guid code) { genre obj = null; //todo : fix hack try { obj = genre.fetch(code, currentuserid, null); if (obj != null) obj.delete(currentuserid, null); } catch (exception ex) { return json(new { deleted = false }, jsonrequestbehavior.allowget); } return json(new { deleted = true }, jsonrequestbehavior.allowget); } then have used jquery getjson() follows: function deletegenre(code) { $.getjson("/administration/genre/delete?code=" + code, function (data) { if (!data.deleted) { alert("warning - cannot dele

jquery - Migrating from .live to .on when using functions and selector -

probably simple answer don't understand principles of jquery enough work out. i have this: $(".remove", document.getelementbyid(itemsareaid)).live("click", function(){ which want migrate .on() i tried doing this var selectedels = $(".remove", document.getelementbyid(itemsareaid)); $(document).on('click',selectedels, function(e){ but doesn't work. anyone explain i'm doing wrong? and if possible why solution didn't work can understand. many thanks, paul the optional selector on() must string . you're providing jquery object ( selectedels ). instead, use string selector .remove directly. rather targeting document , use itemsareaid ; $('#' + itemsareaid).on('click', '.remove', function ()); if wanted target document , use descendant selector along itemsareaid , .remove , this; $(document).on('click', '#' + itemsareaid + ' .remove', functio

java - Unable to right click on Jframe / JTextAreaNetBeans -

for reason, run code can't paste text in text areas. ideas? enterpackage cesar; import java.io.file; import java.io.filenotfoundexception; import java.util.scanner; import java.util.logging.level; import java.util.logging.logger; /** * * @author sanikte */ public class newjframe extends javax.swing.jframe { cesar cifrado = new cesar(); /** * creates new form newjframe */ public newjframe() { initcomponents(); } /** * method called within constructor initialize form. * warning: not modify code. content of method * regenerated form editor. */ // <editor-fold defaultstate="collapsed" desc="generated code"> private void initcomponents() { jbutton2 = new javax.swing.jbutton(); jscrollpane2 = new javax.swing.jscrollpane(); jtextarea2 = new javax.swing.jtextarea(); label2 = new java.awt.label(); jbutton3 = new javax.swing

x86 - How to use Ethernet interrupt with vdx-6354 (vortex86dx) -

i new vdx-6354 (pc/104) , getting familiar @ work. need send/receive data on ethernet. have managed run dsocks library demo projects there problem. our current project consists of notable amount of codes , it's not possible service receive requests in our main loop. need service incoming tcp requests separately , somehow in interrupt routine. datasheet says interrupt vector 0x62 on irq6. can 1 me write interrupt routine task?

c# - The remote name could not be resolved - webclient -

i facing error : the remote name not resolved: 'russgates85-001-site1.smarterasp.net' when request html contents read using web client gives me error. below code. string strhtml = string.empty; webclient myclient = new webclient(); utf8encoding utf8 = new utf8encoding(); byte[] requesthtml; string pdffilename = "outputpdf_" + datetime.now.ticks + ".pdf"; string weburl = request.url.scheme + "://" + request.url.host + (request.url.port != 80 ? ":" + request.url.port : ""); requesthtml = myclient.downloaddata("http://russgates85-001-site1.smarterasp.net/adminsec/images/printinvoice.aspx?iid=2"); // or requesthtml = myclient.downloaddata(weburl + "?iid=3"); when put same url on local code/environment works fine. most other location run code on indeed not have access remote location. i.e. in many corporate environment servers aren't allowed outside internet access. may want try ping/tr

html - Navigating through search results in a custom div dropdown using jquery -

i have created field displays default list of options available on focus , allows users search through list , select option desire. , want these options selectable using keyboard. keyboard selection of default list working fine. but, when enter search query in field , try select options displayed using keyboard not work properly. please me out on this. code here ----> http://jsbin.com/ujimih/10/edit

javascript - jQuery .height() return 0 when visible but non-0 when hidden -

i have problem here right opposite others: in jquery cannot height of element when it's visible, when hidden. have html code: <div id="filtering-filter-holder"> <div id="filtering-filter-holder-inner"></div> </div> basic css it: #filtering-filter-holder { display: none; position: absolute; width: 420px; min-height: 100px; padding: 5px 5px 5px 5px; background-color: #ffffff; border: 1px solid #164372; } and finally, js in document.ready(): $('div.filtering-filter-headline').mouseenter(function() { var el = $(this).parent().find('div.filtering-filter-content'); if ($('div#filtering-filter-holder').is(':visible')) { $('div#filtering-filter-holder-inner').stop(true, true).fadeout(300, function() { $('div#filtering-filter-holder-inner').html($(el).html()); var height = $('div#filtering-filter-holder-inner&#

windows - Should I compile my VS2008 C++ Win32 applications statically or link them dynamically? -

i'm trying avoid dll hell problem , users having install redistribution packages in case don't have dlls. is recommended compile application statically? it depends. if program small, , want able drop single executable onto machine , run it, static linking appropriate , simplest thing do. if program larger, or if need installer anyway (to deploy multiples files, set registry keys, etc.), may link dynamically, can substantially reduce size of executable. can avoid dll hell installating necessary, redistributable run time dlls in same directory executable. if want go pro, can create msi-based installer includes merge modules run time libraries project requires. do not compile dynamically , expect user either have dlls or install vcredist package. that's difficult support , it's pain users. there additional considerations if you're thinking linking own dll static run-time library. if statically link run time, can end of having multiple instan

cocoa touch - Xcode - Break on exception, but no useable symbols -

Image
i need figuring out magical incantation necessary usable information in lldb. i have strange behavior i'm trying debug, , can reliably reproduce issue don't yet understand underlying cause. noticed there exception being thrown, , added exception breakpoint xcode. exception: coredata: error: serious application error. exception caught delegate of nsfetchedresultscontroller during call -controllerdidchangecontent:. *** -[__nsarraym objectatindex:]: index 2 beyond bounds empty array userinfo (null) so, breakpoint in place following stack trace: this looks super helpful! looks there's funkiness going on uicollectionviewflowlayout reusable header views... need to... oh. crap. wait. what? how inspect array in frame 1 of stack trace that's being called out of bound index? can po <some memory address> in console inspect it? cannot use frame variable in lldb console when frames 11 - 1 selected ( from here ). the way read stack trace is: (

how to integrate jquery form plugin and jquery validation plugin -

how integrate form plugin http://malsup.com/jquery/form/ , jquery validation plugin http://docs.jquery.com/plugins/validation . have been trying integrate both plugin problem form gets submitted if click button first time, if fields empty, in other words how beforesubmit overlooked. when button clicked second time the beforesubmit takes effect , validation kicked in. cant see doing wrong. can 1 point me in right direction: $(document).ready(function () { $("#register_student_1 button").click(function (e) { var options = { target: '#reg-output1', beforesubmit: showrequest, success: showresponse, type: 'post' }; $('#register_student_1').ajaxform(options); }), function showresponse(responsetext, statustext, xhr, $form) { console.log("showresponse test"); } function showrequest(formdata, jqform, options) { $("#register_student_1").validate({

java - Parameterize the Loop in selenium Webdriver -

how parametrize following code each time new value has take how pass value. for(int i=1 ; i<6; i++ ) { greeting[i] = driver.findelement(by.xpath("//table[@width=\"270\"]/tbody/tr[i]/td")).gettext(); system.out.println(""+greeting[i]); } i want each time greeting[1] = driver.findelement(by.xpath("//table[@width=\"270\"]/tbody/tr[1]/td")).gettext(); system.out.println(""+greeting[1]); like on, please guide me you have use string's format method this. define variable like string xpath = "//table[@width=\"270\"]/tbody/tr[%s]/td"; template before loop in loop use string xpathofelement = string.format(xpath, string.valueof(i)); however ideally have wait elements before getting properties.

javascript - How to add a close button to jquery Lightbox? -

i made lightbox , want add close button it. here have: <style> .black_overlay{ display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; -moz-opacity: 0.8; opacity:.80; filter: alpha(opacity=80); } .white_content { width:600px; height:560px; padding: 16px; top: 5%; left: 25%; position: absolute; display: none; -webkit-border-radius: 20px; -moz-border-radius: 20px; border-radius: 20px; border:2px solid #ffffff; background-color:#ffffff; -webkit-box-shadow: #c9c9c9 8px 8px 8px; -moz-box-shadow: #c9c9c9 8px 8px 8px; box-shadow: #c9c9c9 8px 8px 8px; z-index:1002; overflow: auto; </style> </head>

mysql - How do I do IN queries in Go? -

i'd run query in go using "database/sql" package: select id, name users id in (1,2,3,4); how use variable substitution in query command? e.g., want (which of course doesn't work): db.query("select id, name users id in (?)", []int{1,2,3,4}) @volker suggests in comments database drivers may able expand slice you. driver can handle slice elements individually, however: db.query("select id, name users id in (?, ?, ?, ?)", 1, 2, 3, 4) of course, you'd need know how many elements going in slice when write that, isn't case. generating correct number of question marks simple enough , gives general solution: ints := []interface{}{1,2,3,4} marks := strings.repeat("?,", len(ints) - 1) + "?" db.query("select id, name users id in (" + marks + ")", ints...) if slice might empty, you'll have handle somehow.

rename excel workbook in c# -

i know how rename excel workbook using microsoft.office.interop dll? use xlsx file create new workbook. know name attribute of workbook class reading. excel.workbook classeur = xlsapp.workbooks.add(path + "\\template.xlsx"); anybody know? thank you if want rename file in c#, can use method : system.io.file.move(oldfilename, newfilename); if want use office methods, saveas method can useful, delete old file.

memory management - C Function argument value changing by itself -

i have simple function that, after has returned, values of array a[] (passed argument) changed. problem not written on in function, read - supposedly, @ least -. hope can me that: double *bhaskara(double a[]){ double = a[2], b = a[1], c = a[0]; double raizes[2]; double delta = b*b - 4*a*c; if(delta<=0){//ignora delta para pegar soh parte inteira das raizes raizes[0] = -b/(2*a); raizes[1] = raizes[0]; }else{ raizes[0] = (-b+sqrt(delta))/(2*a); raizes[1] = (-b-sqrt(delta))/(2*a); } return raizes; } you're returning pointer local variable has gone out of scope. it's undefined behaviour. can, , will, happen.

android - Monitor message sent status launched by Intent= new Intent(Intent.ACTION_SEND) -

i looking way monitor sent status of mms message started intent.action_send can return original activity upon message being sent. im using startactivityforresult() request code start theres return , display toast , i'm using intent.putextra("exit_on_sent", true) exits default messenger , returns original activity when send button pressed gives illusion sent message , doesn't monitor , wait sent. have found examples monitor sms messages use smsmanager , pending intents, , broadcast receivers, being noob i'm uncertain if thats approach should use. guidance appreciated. i looking way monitor sent status of mms message started intent.action_send can return original activity upon message being sent. that not possible. first, have no control on activity user chooses handle action_send . second, authors of other activity how implement "send" operation, , how none of business. currently im using startactivityforresult() action_send

I want the form action to be decided based on whether a check box has been selected or not using php -

if check box below selected want form processed teacherprocess.php , if checkbox not selected want form processed process.php. i'd rather done using php know people not support javascript in browsers. <form class="form-horizontal" action="#" method="post" name="form"> <div class="control-group"> <input class="input-block-level" type="text" id="username" name="username" placeholder="username"> </div> <div class="control-group"> <input class="input-block-level" type="password" name="password" id="inputpassword" placeholder="password"> </div> <input type="checkbox" name="teacher" value="i teacher"> <input type="submit" name="submit2" value="student" class="btn btn-info"> </form>

c# - XNA - Memory leak while saving frames -

i use xna game project creating frames of 3d scene. got memory leak while using memorystream. code below called part of draw function. byte[] framesave() { int w = graphicsdevice.presentationparameters.backbufferwidth; int h = graphicsdevice.presentationparameters.backbufferheight; //pull picture buffer int[] backbuffer = new int[w * h]; graphicsdevice.getbackbufferdata(backbuffer); //copy texture texture2d texture = new texture2d(graphicsdevice, w, h, false, graphicsdevice.presentationparameters.backbufferformat); texture.setdata(backbuffer); memorystream ms = new memorystream(); texture.saveasjpeg(ms, w, h); //memoryleak byte[] zframe = ms.toarray(); ms.close(); ms.dispose(); texture.dispose(); return zframe; } any appreciated. ah found response in other thread: according texture2d.saveasjpeg (as texture2d.saveaspng)

visual studio 2012 - How to see local and auto variables values on remote debugging -

sas wrote in subject can't see values of variables in remote debug mode. window of auto , locals empty during debug. any ideas why? , how can solve it? when i'm trying add watch on variable get: internal error in expression evaluator its bug in visual studio 2012 . apparently works vs 2010 . vs 2012 update 2 fixed update 3 broke again according posts on connect http://connect.microsoft.com/visualstudio/feedback/details/764708 update : i not able working in visual studio 2012 after installing update 3. installed visual studio 2013 , works fine. can step code , add watch

analysis - How do I pair up rows of network traffic data in R or SPSS? -

i have lots of silk flow data data mining on. looks destination ip column matches source ip column of row of data further down. rows (with many more columns) this: uid sip dip protocol sport dport 720107626538 1207697420 3232248333 17 53 7722 720108826800 3232248333 1207697420 17 47904 53 i have never programmed in r or spss , having trouble figuring out how turn 2 rows of 27 columns of data 1 row of 54 columns of data. you can corresponding sip , dip records on same line through merge : df <- data.frame( "uid" = c(720107626538, 720108826800), "sip" = c(1207697420, 3232248333), "dip" = c(3232248333, 1207697420), "protocol" = c(17, 17), "sport" = c(53, 47904), "dport" = c(7722, 53), stringsasfactors = false) df_merged <- merge( df[,setdiff(colnames(df), "dip")], df[,setdiff(colnames(df), "sip")], by.x = "sip", by.y = "dip&quo

dns - Custom root domain on Heroku -

i have domain, example.com, want use rails-app resides @ example.herokuapp.com , i'm pretty confused how go this. heroku says "zone apex domains (aka "naked", "bare" or "root" domains), e.g., example.com, using conventional dns a-records not supported on heroku." , go on explaining workarounds (using alias or aname). i have spent hour reading on subject (here on , elsewhere) still don't head around this. are there alternative ways or explanations on how acomplish "a dummy"? i'll take stab @ it's frequent question. ok, assuming have domain example.com , want use www.example.com host site. in traditional hosting you'd have virtual server has been assigned ip address, in case use host record, otherwise known record in dns control panels map www.example.com ip address. in case, since have set www.example.com fixed ip address should ip address ever change need update dns yourself. also,

ruby on rails - Can't Retrieve Model Data -

i'm starting use ember.js rails 3.2.13 through ember-rails gem. unable access data through browser console following command: var posts = app.post.find(); it returns undefined on console, following outputted on server logs: started "/posts" ....... processing postscontroller#index json parameters: {"posts"=>{}} post load select "posts".* "posts" completed 200 ok ..... please let me know if doing wrong or missing something. thanks here steps took install ember-rails 1) add ember-rails gem file 2) after bundle install, run: rails g ember:bootstrap there mvc directories, app.js, application.js, router.js, , store.js. store.js has following contents: app.store = ds.store.extend({ revision: 11 }); 3) did rails g scaffold post title:string body:text next added active_model_serializer gem , generated serializer post. can check actual response server (in chrome, open inspector, find request in netw

How to make the assumption of the second case of an Isabelle/Isar proof by cases explicit right in place? -

i have isabelle proof structured follows: proof (cases "n = 0") case true (* lots of stuff here *) show ?thesis sorry next case false (* lots of stuff here *) show ?thesis sorry qed the first case several pages long, when reading second case it's no longer clear casual reader, not myself, false refers to. (well, is , not reading, in interactive environment: if, e.g., in isabelle/jedit, place cursor after case false , you'll see n ≠ 0 under "this" in output panel.) so there syntax allows making assumption of "false" case explicit, reader neither has interact ide, nor scroll proof keyword, can see assumption right in place? in case proof becomes more readable stating assumption of each case explicitly: proof cases assume "n = 0" show ?thesis sorry next assume "n ≠ 0" show ?thesis sorry qed

python - Conditionals and itertools.groupby issue -

i using groupby parse list of words , organize them lists length. example: from itertools import groupby words = ['this', 'that', 'them', 'who', 'what', 'where', 'whyfore'] key, group in groupby(sorted(words, key = len), len): print key, list(group) 3 ['who'] 4 ['this', 'that', 'them', 'what'] 5 ['where'] 7 ['whyfore'] getting lengths of lists works well: for key, group in groupby(sorted(words, key = len), len): print len(list(group)) 1 4 1 1 the issue if put conditional before beforehand this, result: for key, group in groupby(sorted(words, key = len), len): if len(list(group)) > 1: print list(group) output: [] why this? each group iterable, , turning list exhausts it. cannot turn iterable list twice . store list new variable: for key, group in groupby(sorted(words, key = len), len): grouplist = list(group)

sql - Keeping track of user ID with custom authentication -

i making app on apex.oracle.com, , i've been trying solve couple hours now, have no idea how to. alright, application has custom authentication based on user table created inside of application. therefore, seems render useless apex_util functions retrieve info on current user. issue is, trying find way store user's numeric id table in session, retrieve directly in queries throughout application, in order where id = :member_id instead of where upper(username) = upper(:app_user) . now, way attempted creating post authentication procedure retrieves user id based on username, , stores value in session using apex_util.set_session_state( p_name => 'member_id', p_value => member_id ) . however, seems set_session_state unable create custom session values or something, returning err-1002 every time use value name isn't mentioned in documentation. i total newbie apex unaware of something, have done many searches, not find related issue. thanks lot if can

dictionary - Any free database of English-Spanish words? -

i want make vocabulary trainer , thinking best way it. first searched translation apis use, avoid having build own dictionary, found of them paid , free have limitations. so, think best way make own dictionary, allow me work offline, wonder if there free database of english-spanish words avoid starting scratch. do know any? lot! you try http://www.omegawiki.org/ claim this: the aim of our project create dictionary of words of languages, including lexical, terminological , ontological information. our data available in relational database, result possible use data many purposes.

C++ Initialize Class based global variables -

i trying define few global variables should available functions initialize main program. can me syntax? please note still bit beginner c++ classes etc. need run same copy of program multiple times , don't want have same shared class across multiple instances of program - need ensure create new class in main body. wanted mention - printvars - pre-built function me , don't have control on passing pointer variables - can use global variables in function. class gvars { public: int x=0; int y=0; gvars() {} ~gvars() {} }; std::unique_ptr<gvars> *g=null; // must pointer class //i can't pass parameters function //only have control on body of program access global vars void printvars() { std::cout << (*g).x << " " << (*g).y << std::endl; } int main() { if (g==null) { g=new gvars(); // critical - create new class here } (*g).x=10; (*g).y=20; printvars(); // expected output : 10 20 delete

In CSS and HTML Footer Page -

i trying create footer page - abit stuck...! want have in-line text shown on link: http://postimg.org/image/6cyb2y2mx/ the copyright on left , links on right. can guide me how achieve this? working progress here: jsfiddle.net/5grph/5/ thank you. you can use float:left; , float:right; after floated elements, should clear:both make sure footer height reset. html <div> <div class="left">copy 2013</div> <div class="right">sitemap | contact</div> <div class="clear"></div> </div> css .right{ float:right; } .left{ float:left; } .clear{ clear:both; } see here on jsfiddle: http://jsfiddle.net/5grph/6/

backbone.js - Really strange JS error in Underscore.js file when rendering view -

i have 2 views right now. 1 lists collection of mongodb objects, , other supposed allow editing er. list view works fine, whenever try render edit view, error: uncaught syntaxerror: unexpected identifier and here code failed on (line 1155 of underscore.js): try { render = new function(settings.variable || 'obj', '_', source); uncaught syntaxerror: unexpected identifier } catch (e) { e.source = source; throw e; } and here code causes above code run: render : function(){ var id = glob; var skill = new skillmodel({_id:id}); skill.fetch(); console.log("blah"); var template = _.template($('#edittemplate').html(), {skill: {name:"test", value:"value", id:"123"}}); this.$el.html(template); return this;

html - How do I apply padding within a select dropdown box? -

Image
i have 2 types of input. select dropdown box, , regular input . on input , have added padding: 10px; makes big. the issue once put select box beside it, both different heights. how either apply padding select, or make same height input . here live example . edit 1 this how looks me: try adding -webkit-appearance: none @ least <select> possibly both. osx wants controls apple-y

c++ - How can i release the memory of cvHaarDetectObjects? -

cvseq* objects = cvhaardetectobjects( &image, this->cascade, this->storage, scale, // scale : scale 1.3 means next round scan scale 30% bigger. 2, // neigbors : if objects less 2-1, whole detection invalid. 0, // flags : valid flag 0 now, means don't check edges. cvsize(20, 20) // min_size : minium size of object. ); i'm using opencv object detection, can't find interface release objects' memory. to release cascade: cvreleasehaarclassifiercascade( &cascade ); to release memstorage: cvreleasememstorage( &storage ); ( of reason use c++ api instead , no ? )

regression - order of coefficients in lm, R -

when running regression in r, order returned coefficients? example: coef(lm(y ~ x + z, data=data.frame(x=1:10, y=10:1, z=1:5))) is guaranteed coefficient associated x returned before coefficient associated z ? order mean order in vector of returned coefficients. reason matters me test linear hypothesis coefficients in model , therefore order of coefficients in variance covariance matrix returned vcov , actual estimates returned coef matters. index name, not position. right answer. coef(lm(y ~ x+z, data=data.frame(x=1:10, y=10:1, z=1:5)))['x'] ## x ## -1 coef(lm(y ~ x+z, data=data.frame(x=1:10, y=10:1, z=1:5)))['z'] ## z ## -1.855301e-16 and both of them, in desired order: coef(lm(y ~ x+z, data=data.frame(x=1:10, y=10:1, z=1:5)))[c('x', 'z')] ## x z ## -1.000000e+00 -1.855301e-16

Declaring a parameter in html and receiving it in Javascript -

my js function goes this: function tester (message) { alert(message); } and in markup have: <a href="#" onclick="tester(text show);">link</a> but doesn't work. can please tell me why? text show not string unless wrap quotes, either single or double. like this: <a href="#" onclick="tester('text show');">link</a> notice can't use same kind of quote both javascript code , html. your code giving errors. check console when code doesn't expect to.

java - How can I fix this code bug? -

i trying make image editing application in java using mvc design pattern. so, event handling in controller, state , operations relevant state stored in models, , user sees stored in views. when open image, there zoom box displays zoom level of image being displayed. zoom automatically calculated when first rendered in paintcomponent() (see step #3). when open image, want zoom level set calculated be. the problem zoom level shows 0 , , know why. let me explain: 1. the actionlistener for open menu item fired in jpscontroller: class menubarfileopenlistener implements actionlistener { public void actionperformed(actionevent event) { file filechooserreturnvalue = view.showandgetvalueoffilechooser(); if (filechooserreturnvalue != null) { try { // irrelevant code omitted view.adddocument(newdocument); } catch(ioexception ex) { ex.printstacktrace(); } } } } 2.

php - How to show the unicode in cakephp when using SQL server -

i use cakephp sql server 2012. in database have declare nvarchar instead of varchar show unicode. when use $this->set('types',$this->manager->query('select * product_types')) the result : array ( [0] => array ( [0] => array ( [id] => 2 [name] => th?c u?ng c� c?n ) ) [1] => array ( [0] => array ( [id] => 3 [name] => b�nh k?o ) ) [2] => array ( [0] => array ( [id] => 4 [name] => x� b�ng ) ) [3] => array ( [0] => array ( [id] => 5 [name] => h�ng h�a d�ng h?p ) ) ) it doesn't show u

javascript - Gmap3 clear and add marker too fast causes delay -

i try implement dynamic marker list come server. notice when user click button quite fast (0.5 sec/s example), markers re-appear huge delay (sometimes on 3 secs)... ? causing that? here's code. ? $("a#userbookmark").click(function () { $.ajax({ type: "post", url: "details.aspx/loaduserbookmark", data: "", contenttype: "application/json", datatype: "json", success: function (res) { if (!res.d) { window.location = "login.aspx?url=" + "<%= clsstringextensions.base64encode("details.aspx")%>"; } else { $("#mapdetail").gmap3({ clear: { name: "marker",