Posts

Showing posts from January, 2012

java - Android call notifyDataSetChanged from AsyncTask -

i've custom listadapter fetches data internet in asynctask. the data added list, when try operations application crashes... i'm sure because i'm calling notifydatasetchanged(); @ wrong time (i.e. before asynctask ends). what i've got now: public class mylistadapter extends baseadapter { private arraylist<string> mstrings = new arraylist<string>(); public mylistadapter() { new retreivestringstask().execute(internet_url); //here call notify function **************** this.notifydatasetchanged(); } class retreivestringstask extends asynctask<string, void, arraylist<string>> { private exception exception; @override protected arraylist<string> doinbackground(string... urls) { try { url url= new url(urls[0]); //return arraylist return getstringsfrominternet(url);; } catch (exception e) {

javascript - Fixing dynamic responsive navigation when there are more items than the container has width -

so i'm working dynamic navigation. basic html markup of <ul><li> composition. problem occurs when user added many items navigation , there isn't enough room them within container (imagine simple <div>). so, need solution. wondering if there way determine when width of <ul> larger or equal containing <div>'s width, inject remaining <li> elements new <li> dropdown them all. possible , if how? i know basics of jquery i'm afraid i'm not sure on this. oh and, need work responsively need work percentages too. let me know if feasible or if have better way around this, thanks. update: have updated github repo plan outlined. -- i use jquery this. idea i'm having follows. you <div>'s width, add widths of <li>'s , see if bigger. take off many needed <li>'s fit <div>. then add ones took off new <li> <ul> dropdown. i'm happy write this, wont till later w

c# - KendoUI Grid ColumnMenu Undefined Columns -

i'm using asp.net mvc wrapper kendoui in project. i saw grid columnmenu , want use , works menu lists 3 undefined columns. my grid has 3 columns without model binding , empty title set this .includeinmenu(false) nothing changes, i've tried comment columns nothing changes again. edit: the grid code, cleaned readability. html.kendo().grid(model).name("grid") .datasource(datasource => datasource.ajax().read(read => read.action("", "").data("")).model(model => model.id(m => m.id)).pagesize(50).events(events => events.requeststart(""))) .columns(columns => { columns.template(o => "").clienttemplate("").htmlattributes(new { @style = "white-space: nowrap;" }).width(100).includeinmenu(false); columns.template(o => "").width(36).headertemplate(h => "").htmlattributes(new { style = "text-align:center" }).clienttemplate("&

EclipseLink nullable column but unique -

is possible define column eclipselink, can null if value != null exists, there should unique values within column. how can model that? thank you andre what type of value? i enforce uniqueness in object model, not in database. if want restrict in database, add check constraint in own ddl script. in java can use enum or type code or value , restrict through set methods. eclipselink have @objecttypeconverter allows conversion between set of values.

optimization - MATLAB fmincon interior-point Warning: Matrix is singular to working precision -

i trying run fmincon function of matlab optimization toolbox in following form: fmincon(@fun,a,b,aeq,beq,lb,ub) i cannot find solution , getting no feasible solution found. i went troubleshooting testing boundaries following code: f = zeros(size(x0)); xnew = linprog(f,a,b,aeq,beq,lb,ub) this did not work when did aeq=sparse(aeq);a=sparse(a); magically did! sparse not work fmincon ! in addition that, warning: matrix singular working precision when run fmincon . think matrix matrix in fmincon function. still presume problem matrices because of sparse experience above. here example of matrices: =0.3333 -0.3333 aeq = 1 1 0.6667 0.3333 0.3333 0.6667 so have idea problem , how can solve it? by way linear problem can solved 'active-set' algorithm out of 4 possible algos fmincon . 1 not strictly abide constraints, giving constraint violated results sometimes. any advice appreciated.

Stream support for git-p4 or good p4 command line tutorial? -

my current project sits in perforce stream workspace. quite familiar git, git-p4 not support streams. know way around limitation? do know cli tutorial perforce (from git user perspective)? or command line wrapper perforce use similar git (most not possible)? thanks, lars i don't think git-p4 supports streams. clone depot path, whereas stream may include several modules. here's article notes on how command usage stacks between git , perforce: http://answers.perforce.com/articles/kb_article/mapping-git-terms-and-commands-to-perforce/?l=en_us&fs=relatedarticle

java - Counting pages in a Word document -

i'm trying count pages word document java. this actual code, i'm using apache poi libraries string path1 = "e:/iugkh"; file f = new file(path1); file[] files = f.listfiles(); int pagescount = 0; (int = 0; < files.length; i++) { poifsfilesystem fis = new poifsfilesystem(new fileinputstream(files[i])); hwpfdocument wddoc = new hwpfdocument(fis); int pagesno = wddoc.getsummaryinformation().getpagecount(); pagescount += pagesno; system.out.println(files[i].getname()+":\t"+pagesno); } the output is: ten.doc: 1 twelve.doc: 1 nine.doc: 1 one.doc: 1 eight.doc: 1 4teen.doc: 1 5teen.doc: 1 six.doc: 1 seven.doc: 1 and not expected, first 3 documents' page length 4 , other 1 5 pages long. what missing? do have use library count pages correctly? thanks in advance this may you. counts number of form feeds (sometimes used separate pages), i'm not sure if it's gonna work documents (i guess not).

iphone - Best way to implement UIToolbar with UITextField above keyboard -

Image
what best way have uitoolbar uitextfield appear above keyboard ? in particular, i'm looking way implement in ios 6. the basic functionality trying achieve similar ios sms app except keyboard appear default. thanks. either adding toolbar storyboard , add outlet it, or add toolbar xib file use inputaccessoryview of text field want add toolbar e.g. [[nsbundle mainbundle] loadnibnamed:@"keyboardtoolbar" owner:self options:nil]; [textfield setinputaccessoryview:keyboardtoolbar];

parsing - M4 "No such file or directory".Bison -

this code in file skener.y %{ #include <stdio.h> %} %token t_int %% exp: t_int { $$ = $1; } | exp exp '+' { $$ = $1 + $2; } | exp exp '-' { $$ = $1 - $2; } | exp exp '*' { $$ = $1 * $2; } | exp exp '/' { $$ = $1 / $2; } ; %% when compile comand "bison -d skener.y" error "m4: no such file or directory.". of course located in working folder when typing command in prompt. dont know about? it means haven't installed bison -- have executable, missing support files. go , reinstall bison.

ruby - Net::HTTP adding port -

i doing http request need able add port not 80. here code: response = net::http.get(uri.parse("http://#{@hs_host}/dir/testpage.asp?event=#{cgi::escape(event_name)}")) which works perfect when server on port 80. if server on port 85? add :85 after host seems error. uri = uri.parse(http://#{@hs_host}/dir/testpage.asp?event=#{cgi::escape(event_name)}") uri.port = 8080 or even: uri = uri.parse(http://#{@hs_host}:8080/dir/testpage.asp?event=#{cgi::escape(event_name)}")

Android: Activity that close your antecessor -

i have 2 activities, "a" , "b", "a" opens "b". when user hits button on activity "b", don´t want see "a", want close "a". on "b" did this: @override public void finish() { // todo auto-generated method stub intent intent = new intent(this, loginactivity.class).putextra(tag, tag).setflags(intent.flag_activity_clear_top); startactivity(intent); //super.finish(); } and in activity "a", did this: @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); if(getintent().getextras() != null) if(getintent().getstringextra(homeactivity.tag) != "") finish(); } it works perfectly, i´m getting exception: e/activitythread(11115): activity br.com.pedmobiledroid.view.controller.lo

html - Wrapping paragraphs in p tags -

i have html document has correct paragraph formatting of text there paragraphs don't contain p tags , such not displaying correctly. is there way inclose paragraphs <p> </p> tags using text editor regular expressions? tried using html tidy, cant recognize separate paragraphs or reformats in wrong way, dont know going on... i need each paragraph doesnt contain html tags have paragraphs wrapped: template design creation layout content exist on each page. custom programing make features work design. photos of location website design elements. like this <p>template design creation layout content exist on each page.</p> <p>custom programing make features work design.</p> <p>photos of location website design elements.</p>' using regular expressions: /($|\n|^)/$1<\/p>\n<p>/g is easiest, requires cleaning close tag @ start of document , open tag @ end. possible perfect don't find it's wo

http headers - Link relation type for linking representations to the abstract resource? -

i use content negotiation let user-agents select 1 of several representations resource. example : resource http://example.com/essay has following representations: text/html → http://example.com/essay.html application/xhtml+xml → http://example.com/essay.xhtml application/pdf → http://example.com/essay.pdf let’s user-agent selects html variant. link other representations link relation type alternate : <link rel="alternate" type="application/xhtml+xml" href="/essay.xhtml"> <link rel="alternate" type="application/pdf" href="/essay.pdf"> but when has uri http://example.com/essay.html , how ever know content-type neutral uri http://example.com/essay , e.g. sending link without enforcing he’d want see html variant, too? is there link type link "abstract" resource ( http://example.com/essay )? i can’t use alternate link relation type link too, resource has no content type: if

jquery - jQuerytools RangeInput update on scroll -

hi i'm using latest version of jquerytools rangeinput drag slider , update donation amount, version not update range input (amount) on drag when complete drag, here link http://bit.ly/12up4c4 , here code. assistance. jquery(":range").rangeinput({ progress: true, change: function(e, i) { jquery('#input_4_4').val(jquery('.range').val()); jquery('.handle').text(jquery('.range').val()); }}); edit: have tried using onslide function below suggested not seem work jquery 1.8, workarounds? i think need use onslide event instead of change. like: jquery(":range").rangeinput({ progress: true, onslide : function(e, i) { jquery('#input_4_4').val(jquery('.range').val()); jquery('.handle').text(jquery('.range').val()); }}); the change event doesn't happen until after finished sliding. taken documentation. http://jquerytools.org/documentation/rangeinput/i

wpf - Why doesn't Blend 2012 allow me to create non-Windows store projects? -

Image
i can't view designer. shows me the xaml existing projects. any ideas on how fix this? install visual studio 2012 update 2 . download here . allows create silverlight , wpf applications blend vs 2012.

qt4 - sharing the same delegate between columns of QTableWidget -

i want use own delegates filtering user input in columns of qtablewidget. according the qabstractitemview class reference need delete delegates myself. i don't want create , delete them every time when change structure of table. fine use same delegate in columns need validated. reference doesn't recommend share same delegate between views: warning: should not share same instance of delegate between views. doing can cause incorrect or unintuitive editing behavior since each view connected given delegate may receive closeeditor() signal, , attempt access, modify or close editor has been closed. obviously, 1 instance of editor can shown in qtablewidget @ same time. is correct share same delegate between columns? you have 1 editor open @ same time single view, closeeditor signal perspective, should safe.

javascript - How to implement Progress Bar and Callbacks with async nature of the FileReader -

i have filereader api called within loop iterate through multiple file objects. i'm using filereader display preview of images. function() { (var in files) { var filereader = new filereader(); filereader.readasbinarystring(files[i]); filereader.onload = function() { // on filereader onload } filereader.onprogress = function(data) { if (data.lengthcomputable) { var progress = parseint( ((data.loaded / data.total) * 100), 10 ); console.log(progress); } } } // on completion of filereader process // actions here run before completion of filereader } i'm bumping 2 issues due async nature of filereader api. first, onprogress event fires each filereader instance. gives me progress each file. whereas, intend display total progress files instead of individual files. secondly, want perform actions sh

javascript - Add a google gadget to webpage -

i'd add google calendar gadget webpage. this page shows gadget http://www.google.com/ig/directory?synd=open&url=http://www.google.com/ig/modules/calendar3.xml the linked page includes code paste webpage http://www.gmodules.com/ig/creator?synd=open&url=http%3a%2f%2fwww.google.com%2fig%2fmodules%2fcalendar3.xml&lang=en i tried creating simple page: <!doctype html> <html> <head> <title>calendar</title> </head> <body> *<script src="//www.gmodules.com/ig/ifr?url=http://www.google.com/ig/modules/calendar3.xml&amp;up_calendarfeeds=&amp;up_calendarcolors=&amp;up_showdatepicker=1&amp;up_showemptydays=0&amp;up_showexpiredevents=1&amp;synd=open&amp;w=320&amp;h=447&amp;title=google_calendar&amp;lang=en&amp;country=all&amp;border=%23ffffff%7c3px%2c1px+solid+%23999999&amp;output=js"></script>* </body> </html> but resulting page not display

iso - Which standard/format does Locale class in Java return? -

if have following code snippet , set format in regional settings 2 letters before underscore , 3 letters before underscore. in iso 639-1 have 2 letters can't one? system.out.println(locale.getdefault()); according java 7 docs : language - iso 639 alpha-2 or alpha-3 language code, or registered language subtags 8 alpha letters script - iso 15924 alpha-4 script code country (region) iso 3166 alpha-2 country code or un m.49 numeric-3 area code.

java - maven settings.xml configuration for looking up workspace artifacts -

i'm using maven , i'm stumped following issue: project setup: - master (parent project) - module1 (parent master) - module2 (parent master , needs module1 "provided") as shown in following settings.xml, i'm making artifactory mirror artifact requests. in way needed because there few proprietary jars build needs (and artifactory responsible it). settings.xml: <settings xmlns="http://maven.apache.org/settings/1.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/settings/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localrepository>${user.home}/.m2/repository</localrepository> <interactivemode>true</interactivemode> <usepluginregistry>false</usepluginregistry> <offline>false</offline> <mirrors> <mirror> <id>artifactory-virtual-repo</id> <name>myar

excel vba - VBA library references not always updated when I update my libs -

i have dll + tlb release in personal folder of users regularly. piece of script un-registers old library , deletes it, copies new 1 , registers (same name, same place). let's have workbook refers lib (tools/references in vba editor) creates few com objects lib , works. save, close it, run uninstall/install process, , reopen it. of time, still works, , can check indeed using updated lib. however, sometimes, after update, code instantiates com objects contained in lib fails, saying activex object can't created. found in case, editing vba (adding couple of spaces), saving, , running again, solves problem... what going on excel here ? not option ask users edit vba when happens... fyi, editing workbook not fix way editing vba ! is there way make sure excel 'refreshes' lib references?

android - NFC Host Emulation not supported with NCI adapters -

device info: cyanogenmod 10.1 rom on 4.2.2 on rooted nexus 4 setup nfcee_access.xml file certificate. background: i'm trying test app card emulation on nfc reader, activity's onnewintent() method not getting triggered. i've tried setting launchmode singletop , no luck either. upon further investigation noticed following error on logcat time after tap on nfc reader, suspect may issue: e/nativenfcmanager(824): nfc host emulation not supported nci adapters does know error means? nci nfc controller interface specification . new api android uses nfc devices, since 4.2. host emulation (i.e. card emulation app) has never been official feature of android. apparently, cyanogenmod not support on nci-based devices.

JavaFX deployment through Java Web Start - Loading Progress Bar -

my app deployed javaws after user clicks on jnlp there long pause nothing seemingly happens, app pops on screen. javaws downloading jars in background there no progress indication, poor. set building custom one: public class loadingprogress implements downloadservicelistener { stage stage; textarea log = new textarea(); public loadingprogress() { stage = new stage(stagestyle.undecorated); stage.setscene(new scene(panebuilder.create().children(log).prefheight(300).prefwidth(300).build())); stage.show(); } @override public void downloadfailed(url url, string version) { log.appendtext(string.format("failed url=%s version=%s\n", url, version)); } @override public void progress(url url, string version, long readsofar, long total, int overallpercent) { log.appendtext(string.format("progress url=%s version=%s readsofar=%d total=%d overallpercent=%d\n", url, version, re

javascript - Angular UI.Bootstrap's radio buttons act strange with ng-repeat -

this question has answer here: setting , getting bootstrap radio button inside angular repeat loop 1 answer i have problem dynamically generating options radio model in angular's ui.bootstrap. thought ng-repeat on array, using it's contents btn-radio attribute so: //in controller $scope.radiomodel = undefined; $scope.radiomodelbuttons = ["a", "b", "c"]; //in html <div class="btn-group" > <button ng-repeat="value in radiomodelbuttons" class="btn" type="button" ng-model="radiomodel" btn-radio="'{{value}}'"> {{value}} </button> </div> i'm using angular 1.1.4 , ui.bootstrap 0.3.0. here jsfiddle of efforts , can see, radio buttons act independently , not affect radiomodel variable. thanks! this how shoul

c# - Generics new keyword with inheritance -

i need only allow types inherited person class used method. valid way of doing this? public static void add<t>(t item) t : person, new() {} the person constraint satisfies condition object of type person (or 1 of it's subclasses) can used method. constructor constraint ( new ) ensures provided type has public, parameterless constructor. necessary when method invokes constructor on class. for example: public static void add<t>(t item) t : person, new() { var newitem = new t(); ... } here new constraint needed because of line new t() . if method doesn't contain call constructor that, not need include new constraint. if wanted ensure objects types subclasses of person can used method , not objects of type person , either make person abstract or make sure not have public, parameterless constructor (subclasses have provide 1 in order used method). further reading constraints on type parameters (c# programming guide)

java - LZW decoding miss the first code entry -

i followed rosetta java code implementation. i tried lzw coding own dictionary , not ascii dictionary used. when try own dictioanry there problem decoding... result wrong, because each of decoded word don't view first 'a' letter. result have 'abraca abrac abra' , not 'braca brac bra' i see problem in decode() method @ string act = "" + (char)(int)compressed.remove(0); remove first 'a' letter. don't have ideas how can modify line... example if use string act = ""; instead of above line... coding wrong, or use command... don't know how can solve little problem... or maybe looking on bad way solution. public class lzw { public static list<integer> encode(string uncompressed) { map<string,integer> dictionary = dictionaryinitstringint(); int dictsize = dictionary.size(); string act = ""; list<integer> result = new arraylist<integer>(); (char c

c# - In EF/MVC, is it possible to edit virtual property? -

so have following 2 model: [table("company")] public class company { public virtual list<useraccount> users { { // load users here } } } [table("useraccount")] public class useraccount { public string email { get; set; } } in view, try edit it: @model myxsite2013.company <table> foreach (useraccount ua in model.users) { <tr class="norowhover"> <td> @html.textboxfor(modelitem => ua.email) </td> </tr> } </table> and on postback, try save: public actionresult edit(company companymodel) { company companycontext = database.companies.find(companymodel.id); database.entry(companycontext).currentvalues.setvalues(companymodel); companycontext.isactive = true; database.savechanges(); } this of course, not save changes users, in fact, it's not seeing changes coming in. your problem write view in wrong wa

Android Notifications push php error -

i trying send notification push user, there no way complete that, there code use in php $message = new gcm(); $message->sendmessagetophone(2, $message,$valor); class gcm { function sendmessagetophone($collapsekey, $messagetext, $gcmcode) { $apikey = 'there apikey'; $headers = array('authorization:key=' . $apikey); $data = array( 'registration_id' => $gcmcode, 'collapse_key' => $collapsekey, 'data.message' => $messagetext); $ch = curl_init(); curl_setopt($ch, curlopt_url, "https://android.googleapis.com/gcm/send"); if ($headers) curl_setopt($ch, curlopt_httpheader, $headers); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_postfields, $data); $re

model view controller - Spring Autowire error expected at least 1 bean which qualifies as autowire candidate for this dependency -

i trying autowire beans in project keep getting error expected @ least 1 bean qualifies autowire candidate dependency. dependency annotations: {@org.springframework.beans.factory.annotation.autowired(required=true)" java: @controller @requestmapping(value="/home") public class homecontroller { @autowired private personrepo personrepo; @requestmapping(method=requestmethod.get) public string showform(modelmap model){ list<person> persons = personrepo.getall(); model.addattribute("persons", persons); person person = new person(); model.addattribute("person", person); return "home"; } @requestmapping(value="/add", method=requestmethod.post) public modelandview add(@modelattribute(value="person") person person,bindingresult result){ modelandview mv = new modelandview("home"); if(!result.haserrors()){ personrepo.add(person); person = new person();

java - JGraph in an eclipse plugin -

does knows whether can use jgraph in eclipse plugin draw graphs? read jgraph swing , eclipse plugins in swt, there problem? cheers, simon it possible use swing components in swt application. if jgraph works remains tested though, couldn't find positive results on google. here article eclipse on how use swing components. good luck.

html - How to place a DIV regarding to lower left hand-side corner? -

i add li s in div . div frame fieldset has no width , no height . size should automatically sized using padding. problem div element of class of div : <div class="flag"> <div id="drop_up"> <fieldset> <ul> <li> content </li> </ul> </fieldset> </div> </div> okay, li 's inserted automatically through loop. now problem is, div drop-up frame. size of grows upwards , not downwands usual. can not position using left, bottom etc. because height different depending numbers of li 's. my question if there way position element lower left hand-side corner? positioning takes effect on upper right hand-side corner no problem when div growing downwards. if there can me out appreciate. thanks alot. if understand trying achieve want bottom of 'drop_up' divs attached top of parent 'f

How to add thirdparty library in classpath via ant for java jar? -

i build code via ant , later try run main class. java -cp my.jar mypackage.myclass but have similar exception following: exception in thread "main" java.lang.noclassdeffounderror: org/slf4j/loggerfactory @ org.apache.nutch.crawl.crawlerservice.<clinit>(crawlerservice.java:31) caused by: java.lang.classnotfoundexception: org.slf4j.loggerfactory @ java.net.urlclassloader$1.run(urlclassloader.java:366) @ java.net.urlclassloader$1.run(urlclassloader.java:355) @ java.security.accesscontroller.doprivileged(native method) @ java.net.urlclassloader.findclass(urlclassloader.java:354) @ java.lang.classloader.loadclass(classloader.java:423) @ sun.misc.launcher$appclassloader.loadclass(launcher.java:308) @ java.lang.classloader.loadclass(classloader.java:356) ... 1 more my main class: import org.slf4j.logger; import org.slf4j.loggerfactory; public class myclass{ private static final logger log = loggerfactory.getlogger(myclass.c

authentication - Best way to implement ban system for rails app -

i'm using devise cancan authentication in rails app , i'd able block accounts , prevent users registering blocked email , phone. i'm not sure best way this. i have roles: admin, moderator, , user admin: must have ability ban/block moderators, , users moderator: must have ability ban/block users my first thought add new 'blocked' role, think there better way. i go simplest way : boolean "blocked" on user table. define : class user def block(other_user) if(can_block? other_user) other_user.block = true other_user.save! end end def can_block?(other_user) # logic using roles. end end straightforward, way.

variables - Is it possible to call multiple batch files at once from a batch file? -

this question has answer here: how run multiple .bat files within .bat file 13 answers so, need call multiple batch files, each containing 1 variable, @ once, can activate multiple variables @ once. can me? if possible, what's code it? just have to: call another_file.bat

xna 4.0 - XNA 4.0: terrain glitches caused by SpriteBatch -

i'm trying implement terrain collision in xna i've added dynamic text allows me test whether calculations correct. rendered fine until called: spritebatch.begin(); spritebatch.end(); or spritebatch.begin(spritesortmode.backtofront, blendstate.alphablend); spritebatch.end(); with these instructions terrain glitches little bit, when remove these 2 lines code normal (but means cannot draw hud) anyone has clue can cause , how should fix it? screens: with sprite batch on with sprite batch off it due spritebatch change graphicsdevice states... before drawing terrain should store right renderstates... usually have set right rasterizerstate , depthstencilstate. common values rasterizarstate.cullnone , depthstencilstate.default

ios - In an AppDelegate, how is the main UIWindow instantiated? -

a snippet of default code in master-detail xcode project appdelegate.m - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions { // override point customization after application launch. uinavigationcontroller *navigationcontroller = (uinavigationcontroller *)self.window.rootviewcontroller; // *** here *** masterviewcontroller *controller = (masterviewcontroller *)navigationcontroller.topviewcontroller; controller.managedobjectcontext = self.managedobjectcontext; return yes; } appdelegate.h @property (strong, nonatomic) uiwindow *window; i aware @synthesize sets accessor methods, , no initialization happens automagically. how window have non-nil rootviewcontroller if never explicitly initialized? xcode init'ing behind scenes? from my book : if choose storyboard option specify template, process works little differently. app given main storyboard, pointed info.plist key “main storyb

javascript - how to remove one canvas element from displaying on top of another canvas element -

i have 2 canvases. one, main canvas. upon drawn, second, speech bubble canvas (balloon). displays information specific regions on main canvas upon client clicks. i playing around canvas after introducing speech bubble , came across issue. this simple code shows how speech bubble introduced:- http://jsfiddle.net/m1erickson/ajvkn/ my canvas timeline, , scrollable; has historical events plotted on it. once user clicks on event speech bubble appears. now don't want happen is, when client clicks on canvas, speech bubble appears , scrolls, speech bubble moves new position on scrolled image, still showing information previous location. for have hideballoon () assigns css property left : -200. still causes inconsistencies. example if drag canvas left right, balloon doesn't disappear scroll, reappears in new position. there .remove() function $("#balloon").remove() http://api.jquery.com/remove/ this removes balloon however, issue is:- removes balloon co

Enterprise architecture -

let's have propose enterprise system architecture. take in account in order specify structure, components, technology used, approaches delivery it? how start? i want understand how system architects work. design example whole system massive work , how grasp it? how know propose right thing? how know approach better other? etc. an enterprise architecture architecture spans across multiple systems, rather focussing on internals of systems (technology) defines systems used 1 big system/process (might say: business) formed. i think mean software architecture enterprise architecture can contain many things. software architecture design commonly documented in architecture notebook contains (can contain more ofcourse, does): some sort of division (think of packages in java) a software deployment model (which displays (uml) , documents how software should deployed) as how know right way go things. architecture notebook comes before functional , technical design ,

Rails: test module and model conflict -

it mistake, called model test (cause test). late rollback , give model name, because way need check lot of code on changing model name. problem. when call test in console, causes error. >> user.last #<user id: 44, email: nil, password_digest: nil, created_at: "2013-05-08 11:26:04", updated_at: "2013-05-08 11:26:04", guest: true> user load (4.0ms) select "users".* "users" order "users"."id" desc limit 1 >> @test=test.last nomethoderror: undefined method `last' test:module (irb):7 c:/ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:47:in `start' c:/ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands/console.rb:8:in `start' c:/ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.11/lib/rails/commands.rb:41:in `<top (required)>' c:/users/hp/study/script/rails:6:in `require' c:/users/hp/study/script/rails:6:in `<

excel - String in a conditional formatting formula in vba -

i want format column g if column d has "ai" in same row using vba in excel 2007. if manually in conditional formatting editor formula =(d1 = "ai") works correctly. if try add formula formula1 clause of formatconditions.add method must put ="(d1 = ""ai"")" or interpreter complains. copied literally doubled double quotes condition , formatting nothing. what should put in formula1 ? antonio this worked me: sub macro2() sheet1.range("g1").select sheet1.range("g:g") .formatconditions.delete .formatconditions.add type:=xlexpression, formula1:="=f1=""ai""" .formatconditions(1).interior.colorindex = 3 end end sub also, using vba set conditional formatting has been bit wonky (for me @ least). way work select g1 , set formatting. know typically don't need select, in case it's way work.

Ruby get return from system command (sox) -

i trying assign stats sox command ruby variable. when using system 'true/false' depending on success of command. i've tried: %x{ sox file -n stats } this shows stats in console, returns empty string, so: stat: 123 stat: 234 "" i want obtain string contains stats. possible? use ticks: result = `sox file -n stats` make sure sox doesn't output stderr. in such case redirect. result = `sox file -n stats 2>&1` edit ticks , %x{} same. sorry. mixed system . redirect need.

match - r-find two closet values in a vector -

i tried find 2 values in following vector, close 10. expected value 10.12099196 , 10.63054170. inputs appreciated. [1] 0.98799517 1.09055728 1.20383713 1.32927166 1.46857509 1.62380423 1.79743107 1.99241551 2.21226576 2.46106916 2.74346924 3.06455219 3.42958354 3.84350238 4.31005838 [16] 4.83051356 5.40199462 6.01590035 6.65715769 7.30532785 7.93823621 8.53773241 9.09570538 9.61755743 10.12099196 10.63018180 11.16783243 11.74870531 12.37719092 13.04922392 [31] 13.75661322 14.49087793 15.24414627 16.00601247 16.75709565 17.46236358 18.06882072 18.51050094 18.71908344 18.63563523 18.22123225 17.46709279 16.40246292 15.09417699 13.63404124 [46] 12.11854915 10.63054170 9.22947285 7.95056000 6.80923943 5.80717982 4.93764782 4.18947450 3.54966795 3.00499094 2.54283599 2.15165780 1.82114213 1.54222565 1.30703661 [61] 1.10879707 0.94170986 0.80084308 0.68201911 0.58171175 0.49695298 0.42525021 0.36451350 0.31299262 0.26922281 0.23197860 0

visual studio 2010 - Storing classes in a vector C++ -

i creating game in c++/directx , have came across problem of storing sprites. can create sprite , store in vector, doing 1 sprite works perfectly. but, when go insert sprite, texture property of previous sprite gets deleted. shall include screen shots of breakpointing , code. the problem suspect object not being placed vector , relying on temporary object used create sprite. here screenshots: https://www.dropbox.com/s/g5xdlaqf35w6q57/1.png https://www.dropbox.com/s/xmcyv611nqc27xc/2.png and code: // d2world.h class d2world { public: // functions vector<d2sprite> spriteslist; // more stuff private: d2sprite *tempsprite; // other private variables }; // d2world.h // other functions // new object created re-assigning tempsprite = new d2sprite(); // when sprite completed, add vector spriteslist.push_back(*tempsprite); // more stuff here what don't understand why texture property being affected? thanks help. edit: here header code d2sp