Posts

Showing posts from March, 2011

php - mongodb queries per second -

i have server 64g ram , running script compares 1 million data in csv file against database. if matches found, script prints number of matches @ end of execution. the script when ran, taking 3 minutes finish. tested 50,000, 1 lakh, 3 lakh, 5 lakh data files , performance rate or rate @ script executed proportional. there enough memory free in server. mongostat output when script running pasted below. questions is, believe script executing close 5000 queries per second. have read in many posts, getting average of 50k queries per second. how can achieved? server running ubuntu, 64 bit, , 24 cores. insert query update delete getmore command flushes mapped vsize res faults locked db idx miss % qr|qw ar|aw netin netout conn time *0 3885 *0 *0 0 1|0 0 12g 24.2g 64m 0 db_list_restore:0.0% 0 0|0 1|0 380k 142k 2 03:09:26 *0 4188 *0 *0 0 1|0 0 12g 24.2g 68m ...

xaml - create grid container in JavaScript -

i'm new in javascript, possible create class container "grid" in wpf? it's desirable without jquery etc. need create container grid in xaml code below. <window x:class="wpfapplication1.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" title="mainwindow" height="350" width="525"> <grid x:name="grid1"> <grid.rowdefinitions> <rowdefinition height="30*"></rowdefinition> <rowdefinition height="30*"></rowdefinition> <rowdefinition height="30*"></rowdefinition> </grid.rowdefinitions> <grid.columndefinitions> <columndefinition width="100*"> </columndefinition> </grid.columndefinitions> <grid x:name="grid2" gri...

c++ - How can I use a macro for collecting variable names? -

i simplify following class { int a; int b; int c; std::vector<int*> addrs; public: a() : addrs{ &a, &b, &c } {} }; so don't have write list of fields in 2 places, i.e. declarations , initializer addrs . there way use macro collect declarations , use them later. e.g., class { var_decl(a); var_decl(b); var_decl(c); std::vector<int*> addrs; public: a() : addrs{ var_addresses } {} }; for context intended implementing kind of property introspection system. you using boost preprocessor . #define variables (a)(b)(c) #define declare_member(mar, matype, maid) \ matype maid; #define take_address(mar, maunused, maindex, maid) \ boost_pp_comma_if(maindex) & maid class { boost_pp_seq_for_each(declare_member, int, variables) std::vector<int*> addrs; public: a() : addrs { boost_pp_seq_for_each_i(take_address, %%, variables) } {} }; // can clean up: #undef declare_member #undef take_addre...

jquery - How to add a callback with scrolltop and animate -

for ie8 use code uses jquery animate banner @ bottom of page when user scrolls 250 or more. problem extremely slow , has huge delay, believe because animate event firing many times, need callback written in .stop(); i'm not sure how/where put this. ideas? } else { $(window).scroll(function() { if ($(this).scrolltop() < 250) { if($("#carriage-promo").not(':animated')){ $("#carriage-promo").animate({ height: 0 },100); } } else { if($("#carriage-promo").not(':animated')){ $("#carriage-promo").animate({ height: '40px' },100); } } }); } try this: $(window).scroll(function() { if ($(this).scrolltop() < 250) { if($("#carriage-promo").not(':animated')){ $("#carriage-promo").stop(true,true).animate({ height: 0 },100); } } else { if($("#carriage-...

c++ - range based loop C++11 for range(L,R) -

c++11 hasn't range-based-loop ranged integral sequence. for(auto e : {0..10} ) // wouldn't compile!!! so decided simulate it. template< class t , bool enable = std::is_integral<t>::value > struct range_impl { struct iterator { constexpr t operator * ()const noexcept { return value; } iterator& operator ++()noexcept { ++value; return *this; } friend constexpr bool operator != (const iterator & lhs, const iterator rhs ) noexcept { return lhs.value != rhs.value; } t value; }; constexpr iterator begin()const noexcept { return { first }; } constexpr iterator end ()const noexcept { return { last }; } t first; t last ; }; template< class t > range_impl<t> range(t first , t last) noexcept { return {first, last}; } int main(){ // print numbers in [ 0..10 ), i.e. 0 1 2 3 4 5 6 7 8 9 for(auto e : range(0,10) ) std::cout <...

Installing ruby gem from git repository failed: rake aborted -

i cloned git repository local machine cant install gem.. (i installed rake 10.1.0), dependent gem oauth installed git clone git://github.com/marcel/twurl.git rake gem --trace error message: rake aborted! don't know how build task 'gem' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/task_manager.rb:49:in `[]' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:148:in `invoke_task' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:106:in `top_level' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:106:in `each' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:106:in `top_level' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:115:in `run_with_threads' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:100:in `top_level' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rake/application.rb:78:in `run' /library/ruby/gems/1.8/gems/rake-10.1.0/lib/rak...

javascript - marker-end didn't work with firefox -

i had issue marker-end using d3, used in gwt project,i created file .js in put svg elements including marker-end, , problem when run project in local-host firefox, marker-end displayed correctly, when deploy project in web server, here comes problem, marker-end dispears!! this how use marker-end,no surprise here var link = svg.selectall(".link") .data(links)`` .enter().append("path") .attr("class", "link") .attr("marker-end", "url(#arrowhead)") .attr("d", diagonal); does know why ? !!

authentication - Google+ interactive post - What mechanism are the they using? -

i post google+ throught interactive post feature. how authentication works once allowed app post timeline? don't need access token - setting cookie instead? i believe might misunderstand how interactive post publishes stream. posting entirely controlled user, not done programmatically via rest api. interactive post button require signed in user can oauth token back, independent of posting user.

android - Handling the Click Event in the ListView -

i have listview in there 20 items . 10 items contacts of phone , rest of 10 bookmars url of default browser . want that: 1) when click on contacts(first 10) should take me partular contact in contact app. 2)when click on bookmark url(rest of 10) , should open url in browser . i implemented first requirement of mine following code below : arraylist<hashmap<string, object>> listitem = new arraylist<hashmap<string, object>>(); msharedprefs = preferencemanager .getdefaultsharedpreferences(getapplicationcontext()); boolean contact_check = msharedprefs.getboolean("contact_check", true); boolean bookmark_check = msharedprefs .getboolean("bookmark_check", true); contentresolver cr = getcontentresolver(); cursor cur = cr.query(contactscontract.contacts.content_uri, null, null, null, null); if (contact_check) { if (cur.getcount() > 0)...

C# Windows Service COM exception 80080005 when starting application -

i have created windows service try start application (in case catia). i use following code: private application getapplicationobject(string progid) { application appobject = null; //try allready open instance of application try { appobject = (application)marshal.getactiveobject(progid); } catch { //create new instance of application instead appobject = (application)activator.createinstance(type.gettypefromprogid(progid)); } return appobject; } i following error when service try start application: system.runtime.interopservices.comexception (0x80080005): retrieving com class factory component clsid {87fd6f40-e252-11d5-8040-0010b5fa1031} failed due following error: 80080005. @ system.runtimetypehandle.createinstance(runtimetype type, boolean publiconly, boolean nocheck, bool...

Your PHP installation appears to be missing the MySQL extension which is required by WordPress on Windows Server 2008 R2 -

i'm trying start wordpress remotely on windows server 2008 r2 has installed apache web server 2.4 (i worked on wamp) , port number not 80 8888 (i heard wordpress doesn't run on port 8888 maybe i'm wrong).when start throgh browser message "your php installation appears missing mysql extension required wordpress.".wamp has mysql buid in apache web server 2.4 doesn't, checked php_mysql.dll on php.ini , uncommented, queried mysql on command prompt , fine.any suggestions how fix problem? i had issue on windows install , down this. if don't have extension_dir uncommented on php.ini, wont default 'ext' directory (which extension dlls on windows). therefore, uncommented extensions ignored (and wont see them on phpinfo()) http://php.net/manual/en/install.windows.extensions.php

AngularJS promise chain -

i have application should open popup ask confirmation @ user, make ajax cal , close popup. tried using chain of promise (i've used it, , remember should work in way), seems block after call to reservationservice.confirm($scope.object); . fake service implemented settimeout , $q return promise (in future make ajax call). valid code or didn't undestood how promise works? popup choose angularui , code this: reservationservice.book($scope.object, day) .then(function(){ var dialogopts = {/* dialog options omitted*/} return $dialog.dialog(dialogopts).open(); }) .then(function(result){ console.log('confirmed? ', result); if (result){ //after line doesn't nothing, if promise resolved return reservationservice.confirm($scope.object); } }) .then(function(){ //this function never executed $scope.$emit('ob...

java - Hibernate criteria return page and rowcount -

using hibernate criteria trying achieve pagination problem every page fetch have make 2 db calls 1 results , total records count. there efficient way in single db call can both data or can reduce db calls. criteria criteria=session.createcriteria(student.class); criteria.setresulttransformer(criteria.distinct_root_entity); criteria.add(restrictions.ne("enquirystatus", enquiry.joined)); criteria.setmaxresults(10); criteria.setfirstresult((paginate.getstartindex()-1)*10); criteria.setprojection(projections.rowcount()); //here need fetch total row count , records yes need separate query total result count. query acountquery = session.createquery("select count(s.id) student s s.enquirystatus != :enquirystatus"); acountquery.setparameter("enquirystatus", enquiry.joined); long resultcount = (long)acountquery.uniqueresult(); or criteria criteria=session.createcriteria(student.class); criteria....

javascript inheritance with prototype - redundant object -

i'm reading tutorial inheritance in javascript, , there following statement: for object of rabbit class inherit animal class need: define animal define rabbit inherit rabbit animal: rabbit.prototype = new animal() they approach has disadvantage of need create redundant object. don't understand why need create redundant object? i've tried following , worked without creating redundant objects: function animal() {}; function rabbit() {}; rabbit.prototype = animal.prototype animal.prototype.go = function() {alert("i'm inherited method"}; var r = new rabbit(); r.go(); what missing here? what you're missing code, rabbit , animal share exact same prototype. if added eatcarrot method rabbit every other animal have method too. the tutorial you're using out of date. preferred way subclass instead use object.create create brand new prototype object rabbit chains animal.prototype : rabbit.prototype = object.create(animal...

hibernate - Unexpected error during MassIndexer operation -

i using following code create hibernate search index: ogmconfiguration cfgogm=new ogmconfiguration(); cfgogm.configure("hibernate.cfg.xml"); serviceregistry=new serviceregistrybuilder().applysettings(cfgogm.getproperties()).buildserviceregistry(); sessionfactory=cfgogm.buildsessionfactory(serviceregistry); session session=sessionfactory.getcurrentsession(); fulltextsession fulltextsession = search.getfulltextsession(session); fulltextsession.createindexer(user.class).startandwait(); but thi sexception: error: hsearch000058: hsearch000116: unexpected error during massindexer operation java.lang.nullpointerexception @ org.hibernate.engine.jdbc.internal.proxy.abstractstatementproxyhandler.<init>(abstractstatementproxyhandler.java:57) @ org.hibernate.engine.jdbc.internal.proxy.preparedstatementproxyhandler.<init>(preparedstatementproxyhandler.java:50) @ org.hibernate.engine.jdbc.i...

android - MvvmCross: how to correctly handle rotation when displaying alert/progressbar -

when android device rotated, activity recreated. if display alert/progress bar mvvmcross view model (or else requiring living activity instance), recommended way of handling rotation? -----added example----- currently working using mvp style. presenter has reference view interface, , can call methods view.displaydialog, view.displayerror or view.displayprogress. android implementation this: var dialog = alertdialog.builder(this) or toast.maketext(basecontext, message, toastlength.long); or _progressdialog = new progressdialog(this); _progressdialog.settitle(title); _progressdialog.setmessage(message); _progressdialog.setcancelable(false); _progressdialog.show(); in these cases reference context (i.e. activity) necessary. now, moving mvvm style , mvvmcross, how change kind of code?

android - How to upload any type of file in phonegap and jquery mobile ? -

i creating app in phonegap android in want upload file server. want when user click on upload button option dialog open user select file uploaded , when user click on save button file uploaded. dialog normal window same see when click on attach button in mail in desktop. can tell me how in android mobile? appreciated. thanks in advance. use phonegap file transfer method filetransfer object allows upload or download files , server. properties onprogress: called progressevent whenever new chunk of data transferred. (function) methods upload: sends file server. download: downloads file server. abort: aborts in-progress transfer. sample // !! assumes variable fileuri contains valid uri text file on device var win = function (r) { console.log("code = " + r.responsecode); console.log("response = " + r.response); console.log("sent = " + r.bytessent); } var fail = function (error) { alert("an error has occ...

android - Add custom Animation done in OpenGL to Activities -

i have got animation developed using opengl in android, https://github.com/harism/android_page_curl actually animation in above link, animates images applying page curl animation. wish apply activities instead. i wish implement animation transition between 2 activities, u suggest me, how should proceed it.

how to put reference in method argument not value python -

hi have code this a = 7 def add(number): number+=1 print(number) add(a) print(a) and prints 8 7 as know must change because function takes reference everytime in python whats problem , how can solve it? add not change value of a . number in add new copy object a . can see here different objects, use id(object) returns object identifying number a , nuumber : a = 7 def add(number): number+=1 print("'number' id => {0}".format(id(number))) print(number) print("'a' id => {0}".format(id(a))) add(a) print("'a' id => {0}".format(id(a))) print(a) output, identifiers might different yours: 'a' id => 19295200 'number' id => 19295188 <- different new object different id 8 'a' id => 19295200 7 so changes apply on number not effect a . python way of doing reassign object new value: a = 7 def add(number): number+=1 ...

php - How to render code in phalcon view -

$view->start(); $view->render("products", "list"); $view->finish(); above show how render file, wonder possible render string/code method? $view->start(); $view->renderstring("<?php echo $this->url->get('users/list') ?>"); $view->finish(); you can use 'setcontent' set view content: $view->setcontent('<h1>hello</h1>'); but functions receives final content view. example gave correct use be: $output = 'the link is: <a href="'.$this->url->get('users/list').'">link</a>'; $this->view->setcontent( $output ); echo $this->view->getcontent();

c# - Log exceptions in view -

i display custom-styled error message users, i've built following this post . works fine, i'm wondering how should log these errors in log-file. we've implemented log4net logging. here's template: @model system.web.mvc.handleerrorinfo <div class="span3"></div> <div class="span5"> <div class="well"> <h3>oops!</h3> <div class="alert alert-info alert-block"> <strong>an error has occurred</strong> <p> have logged incident you. should continue occur, please contact support via 1 of following options </p> <br /> <p class="pull-right"><a href="mailto:support@company.com">support@company.com</a></p> <address> <strong>company inc.</strong><br> ...

javascript - How to round an integer number (keeping multiples of 5 as they are) -

i want round integer number, keep multiples of 5 instead of rounding either or down. in first case if 35, after split 30 , 5, 5<=5 result should 35. in second case if 37, after split 30 , 7, 7>5 result should 40. can on this? wish in javascript. try this....i hope looking for.. function getval(x) { return math.round(x% 10 > 5 ? math.round(x/10)*10: math.round(x/10)*10+5); }

How to send request on a URL in Perl -

i want send request of xml on particular url , resposne there .how perl creating module.i new in perl please me . you can try package test::http; use strict; use warnings; use http::request; use lwp::useragent; use http::headers; sub new { $class = shift; $this = {}; bless $this, $class; return $this; } sub send_receive { $this = shift; $args = shift; $this->{pua} = lwp::useragent->new(); $this->{header} = http::headers->new; $this->{header}->header("content-type" => "text/xml", "soapaction" =>""); ($request, $response); $response = {}; eval { local $sig{alrm} = sub {die "timed out"}; alarm 90; $request = http::request->new( "post", $args->{url} , $args->{xml_request}); $response = $this->{pua}->simple_request($request); alarm 0; }; return $response->content; } s...

sql - Using "WHERE" with a variable that has multiple values -

i want know how select columns table column has several possible values. so, example, code return column x table 1 , column b table 2 if column g has value given input. variable input varchar2(60); exec :input := 'c'; select table1.x, table2.b table1, table2 table1.g = :input what if instead, wanted return column x table1 , columnb table2 if columng had value "k" or "c" or "d" without doing where table1.g = "k" or table1.g = "c" or table1.g = "d" how define input such effect? i use: oracle 10g, pl/sql as understood comment @superman answer yes, there way define variable placeholder ('c', 'd', 'k')? you want parametrize in clause. obviously cannot pass :input variable in in clause defined exec :input := 'k,c,d' . mean, technically can, query wont produce desired output because search entire 'k,c,d' string. what can is, can s...

javascript - Adding keyup events to dynamically generated elements using jquery -

i have button creates text boxes dynamically , there button 'clear'. if there no text in of text field clear button disabled or else enabled. works text box created when dom loaded dynamically created textboxes not work. here html <input type="button" value="click me" class="a" /> <input type="button" value="clear" class="a" id="clearbasicsearch" /> <div id="basicsearchfields"> <input type="text" /> </div> javascript $(".a").click(function () { $("#basicsearchfields").append("<input type='text' class='b' />"); }); /*$(".b").live("keyup", function () { //alert('you pressed ' + $(this).val()); $(this).val($(this).val().touppercase()); });*/ var tovalidate = $("#basicsearchfields input[type='text']"); $("#clearbasi...

javascript - How to change attribute of Html.Beginform() on form Submitting -

i have far: <% foreach (object object in collection) { u<% using (html.beginform("actionname", "controller", new { fu = "bar" }, formmethod.post, new { id = "myid"})) {%> <input type="submit" value="submit" /> <%} } %> $('#myid').submit(function() { var url = url.action("actionname", "controllername"); var fu = "newvalueoffu"; // new value fu $('#myid').prop('action', url + "?fu=" + fu); }); i want change value of fu value jquery simplified answer. you using incorrect overload. see overloads list on msdn idea of use. your current overloads expects routing information 3rd parameter. values provide matched against routes defined site. if parameters not match it, added parameters. what trying achieve assign id or attribute form. done using overload allows html attributes de...

php - How to get exact average of n number of order in m number of months? -

example: $difference = strtotime($to) - strtotime($from); $months = ($difference / 86400 / 30 ); problem: way never exact average. because can’t sure 30 days there can 31 , 28 days months also. even tried divide 12 month average can’t work in every month selection cases read first , change according ur own you can number of days month in year using function: php manual - cal_days_in_month you can number of days whole year using, example, solution: finding total number of days in year also, if want number of days current month, can use this: date("t");

java - Sending Options command to SIP UDP server -

i working on program needs figure out if remote sip udp port 5060 reachable client machine. as there no direct method check availability of udp port. want create simple java class send options message sip udp server , server reply client in java. any help/ direction great help! thanks, anupam thanks response, tried below piece of code did not reply server: string message = "options sip:opensips@host;transport=udp sip/2.0\r\ncall-id: 7df5e96c6b1b98af25ad6c7845d48f5d@49.249.132.30\r\ncseq: 1 options\r\nfrom: \"anupam\" <sip:anupam@localhost:5080>;tag=textclientv1.0\r\nto: \"opensips\" <sip:opensips@host>\r\nvia: sip/2.0/udp 49.249.132.30:5080;branch=z9hg4bk-3938-f66aaa8dda2fe3b863b4acde5fbcab67\r\nmax-forwards: 70\r\ncontact: \"anupam\" <sip:anupam@localhost:5080>\r\ncontent-length: 0\r\n\r\n"; system.out.println("message "+ message); byte [] data = message.getbytes(); datagrampacket packet = new datagram...

android - Can Windows Azure Mobile Services provide access to native mobile device functions? -

i have few project requirements hybrid mobile apps. , in quest of best thing came across windows mobile services. concern whether providing api accessing native device function such camera or accelerometer along push notifications. i appreciate if 1 can reply question possible. no. windows azure mobile service client-server communication, implementing data backend, full crud operations, , authentication. windows azure mobile services not cross-platform mobile application development solution. cross platform mobile development helper/sdk/add-in data , authentication . rest, have chose cross platform development environment wide range of such platforms: phonegap , icenium , xamarin name few. please note none of existing platforms (that know) cross-platform development provides services available via windows azure mobile services. if need store data on server, if need authenticate mobile users - have implement these features yourself, or use azure mobile services in ...

fullcalendar - full callendar not showing in IE -

i making agenda in fullcallendar. works fine in browsers except ie. renders entries can see in source-code, not showing them in browser. have made website in expression engine. code use is: <link href='{site_url}ontwerp/intranet/scripts/fullcalendar/fullcalendar.css' rel='stylesheet' /> <link href='{site_url}ontwerp/intranet/scripts/fullcalendar/fullcalendar.print.css' rel='stylesheet' media='print' /> <script src='{site_url}ontwerp/intranet/scripts/jquery-1.10.2.min.js'></script> <script src='{site_url}ontwerp/intranet/scripts/jquery-ui-1.10.3.custom.min.js'> </script> <script src='{site_url}ontwerp/intranet/scripts/fullcalendar/fullcalendar.min.js'></script> <script> $(document).ready(function() { var date = new date(); var d = date.getdate(); var m = date.getmonth(); var y = date.getfullyear(); $('#calendar').fullcalendar({ ...

android - Keyobard won't write numbers on GenyMotion Virtual Keyboard -

i have installed genymotion , seems me emulator! have problem virtual keboard... i followed this answer in order make virtual keyboard appear have edittext android:inputtype="numberdecimal"> , virtualkeyboard doesn't write numbers (it write them if write letter before them). spell checker off... any idea?

c - fread, fwrite for big size video file (about 180MB) -

i want read video file , save binary , write video file again. tested 180mb video. used fread function , occur segmentation fault because array size small video. those questions: i use 160*1024 bytes char array. maximum size of char array? how can solve problem? this program need work as: read 128 bytes of video -> encrypt -> write 128 byte read next 128 bytes -> encrypt -> write next. i can't upload code because of security rule of company. tip appreciated. first use fseek() seek_end , use ftell() determine file size, after allocate needed memory malloc() , write data memory. if understand correctly don't need allocate memory, 128 bytes. char buf[128]; while(/* condition */) { ret = fread(buf, sizeof buf, 1, fp_in); encrypt(buf); ret = fwrite(buf, sizeof buf, 1, fp_out); }

java - JPA Criteria api with CONTAINS function -

i'm trying crete criteria api query contains function(ms sql): select * com.t_person contains(last_name,'xxx') criteriabuilder cb = em.getcriteriabuilder(); criteriaquery<person> cq = cb.createquery(person.class); root<person> root = cq.from(person.class); expression<boolean> function = cb.function("contains", boolean.class, root.<string>get("lastname"),cb.parameter(string.class, "containscondition")); cq.where(function); typedquery<person> query = em.createquery(cq); query.setparameter("containscondition", lastname); return query.getresultlist(); but getting exception: org.hibernate.hql.internal.ast.querysyntaxexception: unexpected ast node: any help? if want stick using contains , should this: //get criteria builder criteriabuilder cb = em.getcriteriabuilder(); //create criteriaquery person object criteriaquery<person> query = cb.createquery(person.class); //from clau...

css - add link to rollover script -

i have pure css rollover script series of images each held in own divs , on hover, background image slides image theoretically changes. is possible add link image though? images contact icons facebook, twitter, website etc. ideally upon hover user can click icon , go link. i figured adding <a ref=........</a> after , before div tags work didn't ie. link isn't recognised , can't clicked on. html <div class="fbook-hover social-slide"></div> css .social-slide { height:300px; width: 250px; margin: 10px; float: left; -webkit-transition: ease 0.3s; -moz-transition: ease 0.3s; -o-transition: ease 0.3s; -ms-transition: ease 0.3s; transition: ease 0.3s; } .social-slide:hover { background-position: 0px -300px; } .fbook-hover { background-image: url('/images/smedia/fbook.png'); } jsfiddle http://jsfiddle.net/26b3h/1/ you doing right, instead of "ref" need use "href" http://jsfiddle.net/jonigiu...

web services - ClassNotFoundException: ObjectServiceDescriptor in OSGi -

i trying develop simple java program calls dfs web services , runtime error: caused by: com.emc.documentum.fs.rt.impl.servicemodel.servicemodelexception: service descriptor class not found: "java.lang.classnotfoundexception: com.emc.documentum.fs.services.core.client.objectservicedescriptor". @ com.emc.documentum.fs.rt.impl.servicemodel.javabeantreefactory.getdescriptor(javabeantreefactory.java:218) @ com.emc.documentum.fs.rt.impl.servicemodel.javabeantreefactory.getmodule(javabeantreefactory.java:41) @ com.emc.documentum.fs.rt.context.servicefactory.makeserviceurl(servicefactory.java:332) @ com.emc.documentum.fs.rt.context.servicefactory.getremoteservice(servicefactory.java:143) @ com.emc.documentum.fs.rt.context.servicefactory.getremoteservice(servicefactory.java:197) @ info.hartmann.dfs.impl.handler.init(handler.java:112) i'm using maven build project , install osgi container of adobe cq5 . tried same code in usual java application in eclipse , worked. the s...

c# - Cutting rectangle not using Rectangle :) -

Image
if have 4 points @ bitmap (left top corner, right top corner, left bottom corner, right bottom corner) how cut bitmap not using rectangle method cut rectangle of points? , save .png? suppose have 4 points: p1, p2, p3, p4 . can draw image part of image in region of polygon made 4 points using clip property of graphics object. here test draws image on form: private void form1_paint(object sender, painteventargs e) { graphicspath gp = new graphicspath(); gp.addpolygon(new []{point.empty, new point(100,10), new point(200,300), new point(30,200) });//add p1,p2,p3,p4 polygon e.graphics.clip = new region(gp); e.graphics.drawimage(yourimage, point.empty); }

c# - How to capture Key press event for a text box? -

i have winform application has 2 text boxes , button. if control focus on of text boxes , user clicks keyboard "enter" button. button event should invoke. the issue couldn't find textbox_keydown capture "enter" key press. in visual studio editor, keydown,keypress,keyup properties empty. a couple things. sounds me need set acceptbutton on form button want clicked when user presses enter . handled automatically you. second, if that's not case, need set keypreview true on form , handle processcmdkey method on form : protected override bool processcmdkey(ref message msg, keys keydata) { if (keydata == keys.enter) { // } else { base.processcmdkey(ref msg, keydata); } }

video - Matlab: How to distribute workload? -

i trying record footage of camera , represent matlab in graphic window using "image" command. problem i'm facing slow redraw of image , of course effects whole script. here's quick pseudo code explain program: figure while(true) frame = acquireimagefromcamera(); % mex, returns current frame image(i); end acquireimagefromcamera() mex coming api camera. without displaying acquired image script grabbs frames coming camera (it records limited framerate). display every image real-time video stream, slows down terribly , therefore frames lost not captured. does have idea how split process of acquiring images , displaying them in order use multiple cores of cpu example? parallel computing first thing pops mind, parallel toolbox works entirely different form want here... edit: i'm student , in faculty's matlab version toolboxes included :) i'm not sure how precise pseudo code is, creating image object takes quite bit...

eclipse - Program crashing on click of a button Android Error -

hey trying make once click button, calculates , changes edittext answer. when clicked button, program crashed! please me, new android. java code: public class areacircle extends activity { textview radiustextview; textview areatextview; edittext radiusedittext; button areabutton; edittext answeredittext; @override public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); setcontentview(r.layout.areacircle); areabutton = (button) findviewbyid(r.id.areabutton); answeredittext = (edittext) findviewbyid(r.id.answeredittext); radiusedittext = (edittext) findviewbyid(r.id.radiusedittext); } public void findarea(){ answeredittext = (edittext) findviewbyid(r.id.answeredittext); double pi = math.pi; double radius = double.parsedouble(radiusedittext.gettext().tostring()); double finalradius = radius * radius *pi; answeredittext.settext(string.valueof(finalradius)); } } here logcat contents: 08-28 14:41...

jquery - HTML arrangement of splitter panes is not right until first resize -

i have 3 kendo().splitters: first vertical, dividing top 10% of screen bottom 90%. then, inside upper pane have horizontal splitter splits left 25% of screen rest; , in lower pane, have horizontal splitter splits left 25% of screen rest. end result 4 panes, top left 10% high , 25% wide, top right 10% high , 75% wide, bottom left 90% high , 25% wide, , bottom right 90% high , 75% wide. i don't know splitters have problem, when page first comes up, not line up. upper pane split, like, 23%/77% while lower pane split 25%/75%. 2 vertical bars not line up. first resize action take (with mouse) causes panes "snap" position where, now, line up. so, question is, how best done cause (otherwise) finally-rendered page 1 more recalculation of parts? assuming happens when resize page. have $(document).ready(function( ) , there should add in there? my environment i.e. 9, telerik controls, mvc4-razor.

ruby - Rspec stub why use at all -

why use stub given should testing real classes anyways? i know there cases don't want test other classes , not go through other associated class methods still think it's better use real methods. i can see benefit when want skip 1 method's other associated tasks , return end result used in tests are there other benefits though should considering? (in addition above think stub risky aswell since code can change evolves , may generate different output generating in tests) it depends on test performing. unit tests, testing single class, stubs beneficial. as example, assume testing class sends email when other object finishes did_it! operation: describe emailer context ".send_email" "sends email if object 'did_it!'" obj = obj.new emailer.send_email(obj).should == true # email sends end end end in case, if obj.did_it! super expensive operation, or fail intermittently, test have issues. however, ...

sql - Foreign Keys Slowing down Delete -

i have table x has auto-incremented id column primary key. have other tables a, b, c , d compliment info in table x. each of these have contain column references id table x. have done , in code (java) , have way of returning id of each entry table x , using when inserting other tables. working well. now, i've been advised assign id columns on tables a, b, c , d foreign keys because "it's right thing do". did that. now deleting rows table x takes incredible amount of time complete . insertion other tables takes longer too. please don't me wrong, know why foreign keys relevant specify relationships of tables on db. it's starting seem ceremonial rather relevant transactions becoming slower. questions: 1. worth lose performance in bid keep relationships officially specified though it's not necessary? 2. there way can speed transactions , still keep foreign key specifications. thanks. replies here how tables created. create tables sql: ...

What is Android Permission WRITE_GSERVICES exactly for? -

my application complains not having permission. i´m doing contact manipulation , i´m not sure problem is. the documentation says "allows application modify google service map." what google service map? don´t use google services right now. it allows application modify google service map. for more google service maps refer developers.google.com

angularjs - $resource and get array -

i have api returns data following form (using tastypie): {"meta":{ "limit": 20, "next": null, "offset": 0, "previous": null, "total_count": 4}, "objects": [ { "id": 1, "name": "name1", "resource_uri": "/api/v1/operator/1", "short_name": "na1" }, { "id": 2, "name": "name2", "resource_uri": "/api/v1/operator/2", "short_name": "na2" }, ... ] } so thought have resource working, should have used: var operator = $resource('http://127.0.0.1:8080\:8080/api/v1/operator/:operatorid', {operatorid:'@id'}, { query: { method: 'get', transfo...

java - Spring Data Neo4j not populating RelationshipEntity -

i creating enties , relationshipentitys point between them. place relationshipentitys within entity , save entity. saves relationshipentity automatically. i know relationship has saved can retrieve both entities , relationshipentitys individually. when retrieve start or end entity relationship set empty. i have tried forcing eager fetching no joy. can see doing wrong here? my entity... @nodeentity public class thing { public thing() { super(); } @graphid private long nodeid; private long uuid; // unique across domains @fetch @relatedtovia(type="some default type", direction = direction.both) set<thingrelationship> relationships = new hashset<thingrelationship>(); @fetch private set<property<?>> properties; public thingrelationship relatedto(thing thing, string relationshiptype){ thingrelationship thingrelationship = new thingrelationship(this, thing, relationshiptype); relationships.add(thingrelationship); return...