Posts

Showing posts from March, 2010

opencv - Image detection features: SIFT, HISTOGRAM and EGDE -

i working on developing object classifier using 3 different features i.e sift, histogram , egde. however these 3 features have different dimensional vector e.g. sift = 128 dimension. hist = 256. now these features cannot concatenated once vector due different sizes. planning not sure if going correct way this: for each features train classifier separately , apply classification separately 3 different features , count majority , declare image majority votes. do think correct way? there several ways classification results take account multiple features. have suggested 1 possibility instead of combining features train multiple classifiers , through protocol, arrive @ consensus between them. typically under field of ensemble methods . try googling boosting, random forests more details on how combine classifiers. however, not true feature vectors cannot concatenated because have different dimensions. can still concatenate features huge vector. e.g., joining sift , hi...

php - What script to write on receiving file? -

i have created script takes photo , transfers remote server follow tutorial here . seems working, unsure write on recieving end of script, ie: need put on php file on server. ultimately, write image directory on server , save path database. would know function(s) should for, this? cannot find in cordova manuals , pretty lost do. should using phps get or request functions? (i creating app ios in xcode) my code is: smallimage.src = "data:image/jpeg;base64," + imageuri; var fail, ft, options, params, win; // callback when photo has been uploaded: var success = function(response) { alert("photo saved"); }; // callback if photo fails upload successfully. var fail = function(error) { alert("an error has occurred: code = " + error.code); alert(filetransfererror.connection_err); }; ...

apache - Unknown javascript with html links found in my footer.php -

hello can tell me code do, because found in footer of website, related blackhat seo. below how how when found. if tell me how came footer.php, good. <div id="awesomelinks"> <a href="http://www.361studios.net" style="margin-left:-98901px;" title="website design">website design</a>, <a href="http://www.361studios.net" style="margin-left:-98902px;" title="website creation">website creation</a>, <a href="http://www.uslbarcodefy.org" style="margin-left:-96832px;" title="sports skills">sports skills</a>, <a href="http://www.uslbarcodefy.org" style="margin-left:-96833px;" title="sports technology">sports technology</a>, <a href="http://www.pinkeyegraphics.com" style="margin-left:-80381px;" title="graphic design">graphic design</a>, <a href="http://w...

c - char splitting and parsing -

so i'm attempting setup function correctly parse following type of input (note input jibberish try , illustrate example) "./test script";ls -a -o;mkdir "te>st";ls > somefile.txt where each command separated ';' , each argument separated whitespace ' ' except in cases wrapped in "" in case should treated literal or whole. ie output want cmd : "./test script" cmd : ls args[2] {-a, -o} cmd : mkdir args[1] { "te>st" } cmd : ls args[2] {>, somefile.txt} i've tried splitting via ; first, via ' ' first example fails (wrapped in "" should considered whole), i'm having trouble c i'm not familiar language, help? have far // commands split ; char *cmdsplittoken = strtok(srcpointer, ";"); // store commands seperately can deal them 1 one while(cmdsplittoken != null) { cmds[cmdcount++] = cmdsplittoken; cmdsplittoken = st...

makefile - ffdec_h264 (video decoder) GstElement not found, libgstffmpeg.so already linked, works fine from command line gcc but not from cmake -

some of lines myapp.c file ... gstelement* video_decoder; video_decoder = gst_element_factory_make ("ffdec_h264", "video_decoder_one"); assert(video_decoder); ... when compiled using command line gcc, compiles/ runs fine, gcc -o app myapp.c `pkg-config --cflags --libs gstreamer-0.10 gstreamer-app-0.10 ` now wanted use cmake(like else!) , hence added fancy lines, after trying various approaches given on stack overflow... pkg_check_modules() , execute_process() etc. of them resulted in errors like error : assertion 'video_decoder' failed question 1 - issue here, have included/ linked same way gcc compile command ? so, tried check ffdec_h264 , normal gcc compile command have picked $ gst-inspect-0.10 ffdec_h264 resulted in plugin details: name: ffmpeg description: ffmpeg codecs , formats (local snapshot) filename: /usr/lib/gstreamer-0.10/libgstffmpeg.so versio...

path - Javascript File Not Found, File extension has %22 Added for No Reason? -

i using both wamp server , school server, have javascript refuses run, looking mozilla firefox's debugger best i've been able determine either can't find or access file. on wamp side of things "forbidden" when tries poke @ it: [00:53:56.653] local_host/myusername%27s%20homepage/japanese/js/myjs.js%22 [http/1.1 403 forbidden 1ms] if use school server says "not found": [01:09:26.683] http://users.faculty.myschool.ca/~myusername/japanese/testing.js%22 [http/1.1 404 not found 30ms] however can verify file should be, however: [01:09:26.782] http://users.faculty.myschool.ca/~myusername/japanese/images/kiniro- mosaic.jpg [http/1.1 304 not modified 21ms] i notice there's %22 file trying find, versus not there find, best can figure out. i've been trying recreate file , stuff far windows concerned, valud js file...? appears have been typo, confused of you.

java - iText pdf functionality broken after lib upgrade - cannot merge tables -

ugrading itext pdf library 2.0.4 5.4.1 has broken existing functionality in application. merging tables 1 complex table not work anymore. //creating tables table table0 = new table(2); table table1 = new table(7); table table2 = new table(17); table table3 = new table(24); //setting widths tables table0.setwidths(widths0); table3.setwidths(widths); table1.setwidths(widths1); //inserting 3 tables 1 cell cell; cell = new cell(table1); table0.addcell(cell); cell cell2 = new cell(table2); table0.addcell(cell2); cell cell3 = new cell(table3); cell3.setcolspan(2); table0.addcell(cell3); //populating cells , data table1, table2, table3... //adding table pdf document document.add(table0); document.close(); actual result: table0 being added document not showing @ all. (i tried adding tables 1,2,3 separately , showed up) same code working older version of itext pdf. bg info: java version has upgraded 1.5 -> 1.7, jboss 4.0.4 -> 6.1, consider not related trouble. many in ...

objective c - iOS 5 and above: enable landscape mode in MPMoviePlayerController -

Image
i have application entirely in portrait mode. (ios 5 , above) have video played using mpmovieplayercontroller, in video want when user rotates iphone, video should go landscape mode(in fullscreen). when video ends , again video should go portrait mode. code: -(void)playvideo:(nsurl*)videourl { movieplayercontroller = [[mpmovieplayercontroller alloc] initwithcontenturl:videourl]; [movieplayercontroller.view setframe:cgrectmake(6, 69, 309, 196)]; [self.view addsubview:movieplayercontroller.view]; // movieplayercontroller.fullscreen = yes; movieplayercontroller.controlstyle = mpmoviecontrolstylenone; [self.view bringsubviewtofront:self.shareview]; [self.view bringsubviewtofront:self.qualityview]; [movieplayercontroller play]; // register receive notification when movie has finished playing. [[nsnotificationcenter defaultcenter] addobserver:self selector:@selector(movieplaybackdidfinish:...

xpath - Href link click using capybara -

how can click link using capybara.i need click graduation link <a href="/arts?occasion=graduation&amp;top_menu_item_title=+-+graduation">graduation</a> i used following code .but showing error message undefined method click page.find(:link,"graduation").click also used xpath page.find(:xpath, "//a[@href='/arts?occasion=graduation']").click it not working but problem page contains multiple links of graduation. so using page.all(:link,"graduation") r eturns ambiguous match, found 2 elements matching link "graduation" page.all(:link,"graduation") returns ambiguous match, found 2 elements matching link "graduation" that means page contains multiple graduation text link.so if want click first 1 can write page.all(:link,"graduation")[0].click it click first link , below 1 click second link.you can use needs. page.all(:link,"graduation")...

java - Hide the text on a button in android? -

please tell me how hide text on button in android. when try code, button hidden want hide text on button. button b= (button)findviewbyid(r.id.follow); b.setvisibility(view.gone); please tell me how solve this. thank you. i have suggestion if want settext button don't want show it. just set text in xml android:text="text" then make font 0 android:textsize="0sp" text exist can't seen.

php - acess denied in joomla when call through ajax -

i have joomla ajax based modules fetching data db. want use script fetching data db $db = jfactory::getdbo(); $db->setquery("my query"); $db->query(); $res = $db->loadassoclist(); but give me error fatal error: class 'jfactory' not found in then put code @ top of page defined( '_jexec' ) or die( 'restricted access' ); to enable jfacotry , enabled expected can not enter page recieve message "restricted access". what should on come problem. as understand question want use joomla methods in external file , call file data through ajax. if correct, wold default joomla environment can call external file function directly module. can not use joomla method directly fetching result database without including library files. suggestion : 1 thing works me while having same problem. have made custom component , define task in it, fetch data database , call task in module through ajax , show r...

Convert Flash into HTML5, keep using Flash if browser does not support HTML5 -

my company using flash throughout website. want upgrade html5, while keep using flash if browser doesn't support html5. flash converted using google swiffy. i have tried many solution, complicated. here current idea: create new audio object in try/catch statement, if browser supports it, print html5 code translated google swiffy, if jump catch statement, means browser doesn't support html5, use old code. here code: try { new audio(); // google swiffy code here } catch (er) { // use many lines of "document.write" old flash code // many lines flash code } however, cannot import swiffy runtime code, because non-supporting browser complain runtime script, , stuck immediately. change code, import script manually this, don't know why doesn't work: try { new audio(); var js = document.createelement("script"); js.onload = function() { document.body.appendchild(js); // google swiffy code here }...

python - I want to show footer only on last page using xhtml2pdf in django template -

if delete lastpage keyword shows footer on pages when add lastpage keyword doesnt showing footer <style> {% block style %} @page lastpage{ ///last page keword line size: {{pagesize}}; margin: 1cm; @frame footer { -pdf-frame-content: footercontent; ///footer div bottom: 1cm; margin-left: 1cm; margin-right: 1cm; height: 140px; } } {%endblock%} </style> <body> <div id="footercontent"> <div class="botom"> test data </div> <div class="agree"> i/we certify our xxx... </div> </div> </b...

javascript - POST 500 (Internal Server Error) when I use the JEditable plugin -

Image
i'm trying use jeditable plugin in symfony2 application. pys entity a films , tv shows entity; i've got usuario , critica entities. want manage user's critics plugin. i've analyzed more , more examples, can not work. value (in case title of critic) update in template not in db; when refresh browser old value appears. the error: this js: $('.edit').editable(function(value, settings) { var data = {}; data[this.id] = value; console.log(path); console.log(data); $.post(path, data); return(value); }, { indicator : 'saving...', tooltip : 'click edit...' }); this route: critica_ajax: locales: { es: "/gestion-critica/{pysstr}/", en: "/manage-critic/{pysstr}/" } defaults: { _controller: usuariobundle:default:gestionarcritica } this controller: public function gestionarcriticaaction($pysstr) { $em = $this->getdoctrine()-...

asp.net - How to fire ActiveTabChanged event of ajax:Tabcontainer conditionally -

i have ajax:tabcontainer on web form , have 2 tabpanel 's in tabcontainer . need call server side methods when user clicks on second tabpanel . when user clicks on first tabpanel it'll noting , when user clicks on second tabpanel it'll fire server side code. for tried use activetabchanged , onclientactivetabchanged. server side code void tabcontainer1_activetabchanged(object sender, eventargs e) { //code goes here } javascript code function firechangedevent(sender, e) { if (sender.get_activetabindex() == 1) { return false; } else { return true; } } but not working every time user clicks on tab it'll fire tabcontainer1_activetabchanged . can 1 guide me on how can fire event when need not every time when user clicks on tab? if got correctly, can specifying tabindex asp:tabpanel. <asp:tabpanel id="tab1" tabindex=1> <asp:tabpanel id="tab2" tabindex=2> then void tabcontainer...

jsf - c:forEach runs always the same amount of loops -

hi i'm trying display tree structure in jsf for intendation want insert <span class="intendwidth" /> this jsf-code <ui:repeat value="#{myhandler.entitytree}" var="entitydepthholder"> <p:commandlink action="#{myhandler.toggle(entitydepthholder.entity)}"> <div> <c:foreach begin="0" end="#{entitydepthholder.depth}"> <span class="intendwidth" /> </c:foreach> #{entitydepthholder.depth} #{entitydepthholder.entity.title} </div> </p:commandlink> </ui:repeat> but reason c:foreach run once, although 1 entitydepthholder.depth 1, others 0 any ideas how insert tag n-times without c:foreach? the <c:foreach> runs during view build time (that moment when xhtml turned jsf component tree), while <ui:repeat> runs during view render time (that moment when jsf c...

c++ - Swapping std::functions with user-implemented swaps -

i have created functor defines own swap function. simplicity assume functor's operator signature int (int). if initialize 2 std::function functor, std_func1 , std_func2, swapping them call user-implemented swap function of functor or not? in advance. here have tried: #include <iostream> #include <vector> #include <boost/function.hpp> using namespace std; class myclass { public: myclass(int n):data_(n,0){} void swap(myclass& rhs) { using std::swap; std::cout << "swapping myclass" << '\n'; data_.swap(rhs.data_); } private: vector<int> data_; }; struct square { square(int n):b(n){} int operator()(int x) { return x*x; } myclass b; void swap(square& rhs) { using std::swap; std::cout << "swapping square" << '\n'; b.swap(rhs.b); } }; void swap(myclass& a, myclass& b) { a.swap(b); } void swap(square& a, square& b)...

java - JVM Heap Dump Analysis point to sun.awt.windows.WToolkit? -

Image
i analyzing memory leak in our application. after investigation using eclipse memory analyzer recognized root 'keeps' references ` sun.awt.windows.wtoolkit and don't know how interprate result. thought sun.awt.windows.wtoolkit shouldn't cause leaks. maybe has suggestion how interprate result? one of our ideas try check is caused jide library using http://www.jidesoft.com/ hard if has it. calling ilog.views.chart.ilvscalablefontmanager#dispose solved our problem. see class ilvscalablefontmanager

php - How to conditionally find items by Tag in mongodb -

Image
i new nosql , mongodb , little puzzled on type of queries can , how them. knowledge limited simpler queries i make think complicated query within mongodb instead of using php sort not know if possible or how it. i have tag field within collection array . {tag: ["blue","red","yellow","green","violet"]} . first level problem: let says want find birds have tag blue & yellow & green , blue must have tag , other colours optional. second level problem: order query birds have queried colours appear first. is possible create query in mongodb? , if how it? most of have in application. in order find documents bird has tag "blue", can this: db.collection.find( { tag: "blue" } ); which colours optional doesn't matter, have find required tag anyway. after finding them, need sort. sorting want (by 3 colours) not can in mongodb, , have in php instead.

android - Add custom title bar using ActionBar -

i want add custom title bar in child of fragmentactivity, have layout title bar , how it. final actionbar actionbar = getactionbar(); actionbar.setdisplayoptions(actionbar.display_show_custom); actionbar.setcustomview(r.layout.title_bar); actionbar.setnavigationmode(actionbar.navigation_mode_tabs); actionbar.addtab(actionbar.newtab().settext("tab0").settablistener(this)); actionbar.addtab(actionbar.newtab().settext("tab1").settablistener(this)); actionbar.addtab(actionbar.newtab().settext("tab2").settablistener(this)); but problem title bar showing below tabs. want title bar above navigation tabs. this title_bar.xml <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/titlebar" android:layout_width="fill_parent" android:layout_height="fill_parent" android...

c++ - Podofo build errors -

i want build solution visual studio. know, minumum cmake, zlib, jpeg , freetype. build freetype(debug , relise). downloaded compiled zlib dll. (for visual studio need build libjpeg version of visual studio. download libjpeg sources here , unpack them working directory. i'll assume you've used c:\developer\jpeg. once sources unpacked, start visual studio command prompt , cd c:\developer\jpeg run copy jconfig.vc jconfig.h nmake /f makefile.vc /a) jpeg done, or need more it? then make cmd file: del cmakecache.txt set ftdir=c:\dev\freetype-2.4.5 set ftlibdir=c:\dev\freetype-2.4.5\objs\win32\vc2010 set jpegdir=c:\dev\jpeg set zlibdir=c:\developer\zlib128-dll cmake -g "visual studio 10" c:\dev\podofo-0.9.2\ -dcmake_include_path="%ftdir%\include;%jpegdir%\include;%jpegdir%;%zlibdir%\include" -dcmake_library_path="%ftlibdir%;%ftdir%\lib;%jpegdir%;%jpegdir%;%zlibdir%\lib" -dpodofo_build_shared:bool=false -dfreetype_library_names_debug=freetyp...

ios - How to find from which view controller a method is called -

to give more specifics: working fbloginview. using storyboards , separate xib file loginviewcontroller. in app, have loginviewcontroller fbloginviewdelegate. , settingsviewcontroller fbusersettingsdelegate. , have skip button in loginview in order sign in guest instead of facebook user. now doing is: when app opens, show walkthrough view includes login view @ bottom. when user logs in facebook login button, following method gets executed automatically via facebook sdk: - (void)loginviewfetcheduserinfo:(fbloginview *)loginview user:(id<fbgraphuser>)user; in method performing segue main view. however people can choose first login guest, , go settings, , can still login facebook. happens execute same method above! but segue isn't recognized because not in walkthrough viewcontroller anymore. in settings view controller in totally different place in hierarchy in storyboard. so question is: how can know viewcontroller method being invoked? ...

debugging - How to get Android USB API debug log -

i have android app implemented interaction on usb (with sources) , i'm facing difficulties implementing same in native code using libusb. there chanсe libusb invocations log android usb api? update: seems android uses libusbhost not libusb

html - two projects can't be opened anymore - can't find .project file - how can i restore my work? -

i worked on 2 projects last night. morning opened aptana 3 , 2 projects can't opened anymore. alerts me .project file missing. can't find anywhere on mac book. how can restore work? i'm greatful , if answer detailed because i'm beginner aptana , webdesign. thanx you can either find .project file (which may hidden on mac?) or can import project folder aptana , create new .project file. file > import > general > existing folder new project

bash - How to remove empty rows from text file -

i have text file [end-of-line-characters in square brackets]. clearly somethings wrong here , want remove empty lines. how can this? i prefer bash solution, others welcome. 717016|2026493|88650639|agridex|carrier|nr||v/v||nr|||1||nr||nr||nr[cr][lf] 717016|2026493|88650639|agridex|carrier|nr||v/v||nr|||1||nr||nr||nr[cr][lf] 717018|2026494|67685|sulfinyl bis(methane)|carrier|nr||nr||nr|||nr||nr||nr||10% of carrier solution[cr] [cr][lf] [cr][lf] 717019|2026494|57556|1,2-propanediol|carrier|nr||nr||nr|||nr||nr||nr||40% of carrier solution[cr][lf] 717016|2026493|88650639|agridex|carrier|nr||v/v||nr|||1||nr||nr||nr[cr][lf] this did not work (dont know why..): sed -i '/^$/d' file.txt update desired output is 717016|2026493|88650639|agridex|carrier|nr||v/v||nr|||1||nr||nr||nr[cr][lf] 717016|2026493|88650639|agridex|carrier|nr||v/v||nr|||1||nr||nr||nr[cr][lf] 717018|2026494|67685|sulfinyl bis(methane)|carrier|nr||nr||nr|||nr||nr||nr||10% of carrier solution[cr][lf] 71...

javascript - Verticle flip action for div in JQuery.. -

i want vertical flip action div flips using javascript. please suggest me. should work browsers this html code: <div class="flip"> <div class="card"> <div class="face front"> front<br> other text.<br> other text.<br> other text.<br> other text. </div> <div class="face back"> </div> </div> this javascript: $('.flip').click(function(){ $(this).find('.card').toggleclass('flipped'); return false; }); this css supports chrome & safari: body { background: #ccc; } .flip { -webkit-perspective: 800; width: 400px; height: 200px; position: relative; margin: 50px auto; } .flip .card.flipped { -webkit-transform: rotatex(-180deg); } .flip .card { width: 100%; height: 100%; -webkit-transform-style: preserve-3d; -webkit-transition: 0.5s; } .flip .car...

FTP upload path on PHP -

here folder's reource. path : /www/partner/bulk_files location : ftp://plus1000@exampleip/www/plus1000/www/partner/bulk_files i couldn't upload. what ploblem. t^t $ftp_host = "exampleip"; $ftp_hostid = "id"; $ftp_hostpwd = "password"; $connect_id =ftp_connect($ftp_host) or die("fail"); $bulk_uploaddir = '/www/partner/bulk_files'; $login_ftp_result = ftp_login($connect_id, $ftp_hostid, $ftp_hostpwd); if ((!$connect_id) || (!$login_ftp_result)) { echo "ftp connection has failed!"; echo "attempted connect $ftp_host user $ftp_hostid"; die; } else { echo "connected $ftp_host, user $ftp_hostid<br/-->"; } echo "<hr>"; if (ftp_put($connect_id, $bulk_uploaddir, $_files["file"]["name"], ftp_ascii)) { echo "<br>succes upload<br>"; } else { ...

android - Unable to see heap updates on eclipse -

Image
with objective of memory analysis, trying on heap usage on ddms perspective. unfortunately, after following instructions mentioned in many community posts, hardly in on. here have done far. a. open ddms > devices b. select process (application package) , enable 'update heap' button c. open heap view see heap usage. i attaching screenshot more clarity. what preventing heap showing up? clue? this bug in adt, there 2 bug reports related issue. i've updated sdk tools version 22.05 , issue fixed me. http://code.google.com/p/android/issues/detail?id=55517 http://code.google.com/p/android/issues/detail?id=55394

c++ - Copy vector struct to file using ostream_iterator and copy -

Image
i'm trying copy vector new text file after making necessary changes vector. can build project fine, giving me weird errors don't understand. possibly me this? my struct class accdetails { public: string username; string name; string topicid; string testid; }; the code giving me errors vector<accdetails>accinfo; ofstream temp ("temp.txt"); ostream_iterator<accdetails>temp_itr(temp,"\n"); copy(accinfo.begin(),accinfo.end(),temp_itr); there's whole chunk of error lines, think should important 2 lines: you'll need overload operator<< accdetails . ostream_iterator calls internaly. something this: std::ostream& operator<<(std::ostream& stream, const accdetails& obj) { // insert objects fields in stream 1 one along // description , formatting: stream << "user name: " << obj.username << '\n' << "real name...

iphone - Getting dyld: Symbol not found: _UICollectionElementKindSectionFooter when trying to run my app in ipod touch? -

hello getting dyld: symbol not found: _uicollectionelementkindsectionfooter when trying run app in ipod touch . here xcode project setting - deployment target = 5.0. ipod touch os version = 5.1 . ideas? project working on iphone 3gs ios 6.0. uicollectionview class (and constants declared it) available starting ios 6.0 only, cannot use in older ios versions. if still want support ios older 6.0 can use pstcollectionview library, copies uicollectionview functionality , interface + uses actual uicollectionview class when app being run on ios 6+

jQuery attr() not working on Bootstrap button after reset -

i have simple code doesn't work , don't understand i'm missing. external resources <link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet"> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script> html <p> <button id="btn-id" class="btn btn-large btn-primary" type="button" data-loading-text="loading stuff...">click me</button> </p> javascript $(document).ready(function () { $("#btn-id").button(); $("#btn-id").click(function () { //$("#btn-id").attr("disabled",true); $(this).button('loading'); settimeout(function () { //this desn't work. button resets does...

windows 8 - HttpClient throws error on SendAsync (C#) -

my code (c#): httpclienthandler httpclienthandler = new httpclienthandler(); httpclienthandler.preauthenticate = true; //httpclienthandler.usedefaultcredentials = true; httpclienthandler.credentials = credentialcache.defaultnetworkcredentials; //httpclienthandler.credentials = new networkcredential("usr", "pw", "domain"); httpclienthandler.cookiecontainer = new cookiecontainer(); var httpcontent = new stringcontent(content); httpclient httpclient = new httpclient(httpclienthandler); httpclient.defaultrequestheaders.expectcontinue = false; httpclient.baseaddress = ews_url; // var request = httpclient.postasync(ews_url, httpcontent); var requestmessage = new httprequestmessage(); requestmessage.requesturi = ews_url; requestmessage.content = httpcontent; requestmessage.method = httpmethod.post; var request = httpclient.senda...

ember data - Saving model from REST adapter into localstorage -

is there easy way save or copy ember model "from restadapter lsadapter" (including relationships)? for example that? var person = ds.reststore.find(model.person, 1); ds.lsstore.createrecord(person); ds.lsstore.commit();

c# - How to pass mouse events to a WinForms control at design time? -

we have custom-made winforms grid control inherits standard control class. users can create columns @ design time using our custom verbs , interactive column collection editor, cannot resize created columns interactively @ design time using normal mouse actions (similar column resizing in windows explorer). to allow - i.e. passing mouse input grid header when mouse pointer on area, overrode gethittest method of designer attached our control (inherits controldesigner). structurally looks following one: protected override bool gethittest(system.drawing.point point) { if (ismouseingridheaderarea()) return true; else return false; } all works expected while moving mouse pointer: column headers correctly highlighted @ design time user moving mouse on them, , mouse pointer changed double-arrow we-resize cursor when on column divider area. minor problem latter case cursor changed 4-arrow cursor indicates whole control can selected/moved (the standard behavior controls on...

facebook - Given URL is not allowed by the Application configuration in wordpress social plugin -

Image
error - given url not allowed application configuration.: 1 or more of given urls not allowed app's settings. must match website url or canvas url, or domain must subdomain of 1 of app's domains. i have created app facebook error comes in wordpress socil login plugin . if body know me out just add wordpress web page url application settings. must add url in "website facebook login" part.

clojure - Architecture for plugins to be loaded in runtime -

considering developing end-user software program (as uberjar) wondering options make possible user download plugin , load during runtime. the plugin(s) should come compiled , without source code, sth. load not option. existing libraries (or ways of java...?) exist build on? edit: if not sure satisfied way costs reboot/-start of main-program. however, important source-code won't included in jar file (neither main application nor plugin-jars, see :omit-source of leiningen documentation). to add jar during runtime, use pomegranate lets add .jar file classpath. plugins of software should regular clojure libs follow conventions need establish: make them provide (e. g. in edn ) symbol object implementing constructor/destructor mechanism such lifecycle protocol in stuart sierras component library. in runtime, require , resolve symbol, start resulting object , hand on rest programs plugin coordination facilities. provide public api in program allows plugins int...

knockout.js - using knockout to set css class with an if condition -

i want set bootstrap css class span if condition (up binded value). have isapproved field in list , want see field 'label-success' class when active , 'label-important' class when inactive i added line , time taking first class : data-bind="text: isapproved, css: isapproved = 'true' ? 'label label-important' : 'label label-important'" is possible in html or should add computed field on vm? if understood right, binding looking for. data-bind="text: isapproved, css: { 'label' : true, 'label-success' : isapproved(), 'label-important': !isapproved() }" i hope helps.

How do I pass a value to an object in javascript? -

i have think called object(?) in javascript: paymentwindow = new paymentwindow({ 'merchantnumber': "xxxxxx", 'amount': '10500', 'currency': "dkk" }); now want set amount value object. like: paymentwindow.amount = '20000'; however, not work. sure simple, can't find solution. now want able set amount outside object. this easy or impossible, depending on how object looks like. if constructor set this: function paymentwindow(options) { this.amount = options.amount; } then it's easy , works propose. attached this becomes public property. however, if constructor set this: function paymentwindow(options) { var amount = options.amount; } then it's impossible, because var amount private constructed object.

spring - Mock MVC - Add Request Parameter to test -

i using spring 3.2 mock mvc test controller.my code is @autowired private client client; @requestmapping(value = "/user", method = requestmethod.get) public string initusersearchform(modelmap modelmap) { user user = new user(); modelmap.addattribute("user", user); return "user"; } @requestmapping(value = "/byname", method = requestmethod.get) @responsestatus(httpstatus.ok) public @responsebody string getuserbyname(@requestparam("firstname") string firstname, @requestparam("lastname") string lastname, @modelattribute("userclientobject") userclient userclient) { return client.getuserbyname(userclient, firstname, lastname); } and wrote following test: @test public void testgetuserbyname() throws exception { string firstname = "jack"; ...

android - Close Application if no internet connection -

oncreate of "home" activity, want check if there's internet connection, if false close activity showing toast.. but, home activity not first on stack, if set finish(); close activity , show top 1 in activity stack.. so i've written down code, make sense? if(!utils.isonline(mcontext)) if(!movetasktoback(true)) finish(); where utils.isonline() method check internet connection edit : i've created method check internet connection , it's utils.isonline().. i'm not asking how check internet connectio... edit2 : movetasktoback() not best choice achieve target, because yes puts activity onbackground if reopen it, app doesn't check anymore condition (don't know why.. skips oncreate(?)) , shows blank activity.. if want close app can add lines: intent intent = new intent(intent.action_main); intent.addcategory(intent.category_home); intent.setflags(intent.flag_activity_new_task); startactivity...

C++ vector<vector<int>>`select only entries that appear just once -

i have vector<vector<int>> has following entries: 2 3 3 4 2 3 4 5 5 6 i need create vector<vector<int>> entries apeears once. so: 3 4 4 5 5 6 this gives result looking for. using std::map , std::pair #include <iostream> #include <vector> #include <map> int main() { std::map<std::pair<int, int>, int> count_map; std::vector<std::pair<int, int> > v; std::vector<std::pair<int, int> > v2; int a[10] = {2,3,3,4,2,3,4,5,5,6}; for(int = 0; < 10; i++) { int first = a[i]; int second = a[++i]; std::pair<int, int> p = std::make_pair(first, second); v.push_back(p); count_map[p]++; } for(auto = count_map.begin(); != count_map.end(); ++it) { if(it->second != 1) continue; v2.push_back(it->first); std::cout << it->first.first << ", " << it->first.second ...

windows - Is there any way to semi-automatically commit? -

please bear me here, because i'm beginner when comes version control systems. i've decided start simple github app. want (because work in dreamweaver) when save file window pop-up , ask me if want commit, achievable , if so... how? perhaps there's solution uses directory watcher watch changes , prompt? in opinion, isn't solution though - don't want use git "backup" solution, want each commit mini-milestone represents logical group of changes. can't think of single instance first time saved change file commit-worthy. if commit every save, how ever test changes?

jquery: does $(window).load() get fired after css is rendered? -

i reading stackoverflow post: is $(document).ready() css ready? the answer clear: no, $(document).ready() not guarantee complete css rendering. that left me wondering: can ensure full css rendering before jquery function (that relies on rendered css ) executed? there event gets fired once css rendered? $(window).load() solution? $(window).load() seems work fine me , seems developer recommends: http://taitems.tumblr.com/post/780814952/document-ready-before-css-ready (is our assumption) correct? i'd suggest load css in head before call scripts should ideally @ bottom of html document. have been using , never has there been case unstyled content visible.

ios - Expression is not assignable error -

- (void)textfielddidbeginediting:(uitextfield *)textfield { #define koffset_for_keyboard 110.0 textfield.frame.origin.y -= koffset_for_keyboard; textfield.frame.size.height += koffset_for_keyboard; textfield.frame = cgrectmake(textfield.frame.origin.x, (textfield.frame.origin.y - 230.0), textfield.frame.size.width, textfield.frame.size.height); } got code textfield app in ios... plan have in way that, when keyboard appears, textfield goes on top of keyboard , when return key in keyboard pressed, textfield goes original position @ bottom of screen. error, "expression not assignable." how solve this? error mean? you can't assign value origin or height. you'll have assign cgrect frame , update values in new cgrect.

android - Call AsyncTask in a Fragment -

i have class extends fragment. call asynctask class in fragment. doesn't obtain error in mylogcat doesn't display null in listview. below paste code use, code more simple, read json file , insert in custom listview. code works if change class in activity, want transform activity in fragment. thanks in advance. public class myfragment extends fragment { jsonparser jsonparser = new jsonparser(); arraylist<hashmap<string, string>> unilist; jsonarray articles = null; listview list; listuniadapter adapter; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); new loadnews().execute(); } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { linearlayout ll = (linearlayout)inflater.inflate(r.layout.uni_list, container, false); list = (listview) ll.findviewbyid(android.r.id.list); return ll; } class loadnews extends asynctask<string, st...

java - Error Conversion String to Date WebService -

guys, i´m writing app webservice i´ve been facing strange issue. when call w.s receive error: exception description: object [2013-08-04t12:00:00:00], of class [class java.lang.string], mapping [org.eclipse.persistence.oxm.mappings.xmldirectmapping[dateevent-->dateevent/text()]] descriptor [xmldescriptor(br.com.gvt.armanagementapp.service.to.receivableinvoicein --> [databasetable(ns0:receivableinvoicein)])], not converted [class java.util.calendar]. but objet receivableinvoicein there isn´t attribute java.util.calendar there atributte java.util.date has faced issue? my environment weblogic12c maven i found problem. think bug on weblogic12c1.1 when perform simple test webblogic ´s webservice client , puts blank spaces tag this: 1999-12-24t22:00:00 the solution split blank spaces: 1999-12-24t22:00:00

ios - Use string as part of [JSON valueForKeyPath] selector? -

i'm parsing json looks like: {"data":{"items":{"daily":{"2013-07-31":16}}}} i've built date string. e.g: nsdateformatter *format = [[nsdateformatter alloc] init]; [format setdateformat:@"y-mm-d"]; nsdate *now = [[nsdate alloc] init]; nsstring *datestring = [format stringfromdate:now]; how use datestring part of valueforkeypath selector? [json valueforkeypath:@"data.items.daily"]? you can create keypath string using +stringwithformat: method , use it. have (assuming json object parsed json string): nsstring *keypath = [nsstring stringwithformat:@"data.items.daily.%@", datestring]; id valueyoulookfor = [json valueforkeypath: keypath]

ios - Nesting UICollectionViews - how should I handle the data from core data? -

i need add scrolling in both directions uicollectionview - netflix app does. know can add uicollectionview in single-column uicollectionviewcell object, question best way pass data each section in nested uicollectionview ? depending on data structure, easiest way might use 2 separate nsfetchedresultscontroller s.

javascript - IE attach event to checkbox? -

i have html list of checkboxes don't know how 'document.attachevent' find checkboxes on onclick? i wasn't sure if set event model specific ie in document.attachevent create loop goes through every checkbox , handles each one? also, checkboxes of different names can't checkboxname.attachevent unless did each one. my elements dynamics enough tried adding en event broadest ancestor, document use event target , type no avail. much thanks. some fixes code: document.attachevent('onclick', function (e) { var target = e.srcelement; if (target.type === 'checkbox') { if(target.checked){ button.disabled = false; } else { button.disabled = true; } } }); the third argument not used in ie's event handling model. e.srcelement refers clicked element. i'd suggest wrap checkbox(es) in div or other element, , attach event listener wrapper. when page gets larger, che...

sql - If a value contains a certain character then do this or else do this -

i trying write function processes column value , returns value before '@' symbol. i have managed far using following code: create function fnstaffcodeconvert (@staffcode varchar(10)) returns varchar(4) begin declare @staffinitals varchar(4) set @staffinitals = (select substring(@staffcode,0, charindex('@',@staffcode))) return @staffinitials end example result function - parameter in = abc@123 , returns = abc . this works exclusively returns every result column contained @ value , remaining results without @ omitted. i.e. abc@123 returns abc xyz not return anything. how can amend code give me both sets of values? imagine have put 'if' statement in there unsure how write results want. many in advance :) mike you there: alter function fnstaffcodeconvert (@staffcode varchar(10)) returns varchar(4) begin declare @staffinitals varchar(4) if charindex('@',@staffcode) <> 0 set @staffinitals =...

php - ajax returns success but mysql db not updated -

i have javascript loop sends array ajax page update mysql database. i echo result original page , echos success when check db nothing has changed my javascript loop sends array for(var m=0; m<array.length; m++){ $.post("update_page_positions.php",{page_ref:array[m][0], ref:array[m][12], menu_pos:array[m][1], sub_menu_pos:array[m][2], top_menu:array[m][3], pagelink:array[m][4], indexpage:array[m][5], hidden:array[m][6], page_title:array[m][7], page_desc:array[m][8], page_keywords:array[m][9], page_name:array[m][10], deletedpage:array[m][11]}, function(data,status){ alert("data="+data+" status="+status); }); here php ajax page updates db <? include("connect.php"); $ref = $_post['ref']; $page_ref = $_post['page_ref']; $menu_pos = $_post['menu_pos']; $sub_menu_pos = $_post['sub_menu_pos']; $top_menu = $_post['t...

html - How can I prevent the browser from scrolling on top of the page when clicking the checkbox? -

whenever click on checkbox, browser window (firefox) scroll on top of screen. how can prevent behavior when click on checkbox browser window not scroll on top? here code found here http://jsfiddle.net/zafnd/6/ thank you. <html> <head> <title>test</title> <style> div label input { margin-right: 100px; } body { font-family:sans-serif; } #ck-button { margin: 4px; background-color: #efefef; border-radius: 4px; border: 1px solid #d0d0d0; overflow: auto; float: left; } #ck-button { margin: 4px; background-color: #efefef; border-radius: 4px; border: 1px solid #d0d0d0; overflow: auto; float: left; } #ck-bu...

node.js express custom format debug logging -

a seemingly simple question, unsure of node.js equivalent i'm used (say python, or lamp), , think there may not one. problem statement: want use basic, simple logging in express app. maybe want output debug messages, or info messages, or stats log consumption other back-end systems later. 1) want logs message, however, contain fields: remote-ip , request url, example. 2) on other hand, code logs everywhere in app, including deep inside call tree. 3) don't want pass (req,res) down every node in call tree (this creates lot of parameter passing not needed, , complicates code, need pass these async callbacks , timeouts etc.) in other systems, there thread per request, store (req,res) pair (where data need is) in thread-local-storage, , logger read , format message. in node, there 1 thread. alternative here? what's "the request context in specific piece of code running under"? the way can think of achieving looking @ trace, , using reflection @ local...

Misunderstanding Android weights -

i've tried couple different approaches weights, there glaring mis-understanding of how aiming here. attempting do, have imageview take 1/3rd of screen across width, while having layout of textviews take remainder of 2/3rds of screen across width. what ends having try , manipulate however, imageview small , not taking space should be. i've been messing around trying layouts right morning. the answer below has led me following occurring in instance: 0dip layout dimensions <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:weightsum="3"> <imageview ...

javascript - WordPress Language Page -

i've installed wordpress , played while. , got question how can make top page let visitors choose languages. let's there ware 2 languages website, english , japanese. when visitor opens domain root( http://example.com ), selection page appears. if english clicked, redirects page " http://example.com/en ", has been created wordpress's page feature(permalink). if japanese, goes example(dot)com/jp." this kind of page annoying , of time useless. can automatically detect user browser language and/or ip location, or display language switcher anywhere in website. if need anyway, can try wpml plugin (or other free alternative, if find one...). can test if have detected language , if there not, display language chooser.