Posts

Showing posts from January, 2015

basic information about holder in android -

i'm searching information "holder" in android...because i've seen code used in using checkbox in gridview...but couldn't find basic information it. i'll happy if can me. here part of code used holder : public view getview(int position, view convertview, viewgroup parent) { viewholder holder; if (convertview == null) { holder = new viewholder(); convertview = minflater.inflate( r.layout.galleryitem, null); holder.imageview = (imageview) convertview.findviewbyid(r.id.thumbimage); holder.checkbox = (checkbox) convertview.findviewbyid(r.id.itemcheckbox); convertview.settag(holder); } else { holder = (viewholder) convertview.gettag(); } holder.checkbox.setid(position); holder.imageview.setid(position); your code might call findviewbyid() during scr...

ruby on rails - Unable to call child methods in model method -

i'm having real struggle this: in student.rb: def subject_avg self.goals.each |goal| goal.subject_id end end this doesn't 'do' - or should doesn't different from def subject_avg self.goals.each |goal| goal.id end end or def subject_avg self.goals.each |goal| goal.goal end end no matter what, returns array of goals belong subject: [ #<goal id: 28, goal: "do on command", subject_id: 10, created_at: "2013-08-25 10:59:35", updated_at: "2013-08-25 10:59:35", default: nil>, #<goal id: 29, goal: "make chunky", subject_id: 10, created_at: "2013-08-25 10:59:35", updated_at: "2013-08-25 10:59:35", default: nil>, #<goal id: 30, goal: "hit mark", subject_id: 10, created_at: "2013-08-25 10:59:35", updated_at: "2013-08-25 10:59:35", default: nil>, #<goal id: 31, goal: "puke , rally...

sass - Susy grid and CSS reset -

i want use compass's global reset module reset default browser styles. configuration sass version: sass 3.2.10 (media mark), compass version: compass 0.12.2 (alnilam), susy grid version: susy-1.0.9. don't want use normalize css nicolas gallagher. have support ie 6 , newer browsers on desktop, tablet, mobile. first time using susy grid , learning. want know global reset module of compass compatiable susy grid ? (please, forgive me poor english.) thanks. any reset or normalization should work susy. yes, compass default compatible.

c# - dates being ignored when type is passed -

any idea when pass type stored proecedure dates being ignored alter procedure [dbo].[hms_getbenefitsbydatetype] ( @id int, @startdate datetime, @enddate datetime, @btype int ) set nocount on; select benefit.emp_no, benefit.record_id, benefit.contract_id, benefit.career_id, benefit.date_from, benefit.date_to, benefit.benefit_type, benefit.monthly_value, benefit.benefit_provider, benefit.level_of_cover, benefit.current_benefit, benefit.previous_monthly_cost, benefit.benefit_change_details, benefit.notes, benefit.level_description, benefit.monthly_annual, benefit.cover_level, benefit.qualifying_reason, benefit_type.desc_ benefit inner join benefit_type on benefit.benefit_type = benefit_type.code (benefit.benefit_type = @btype) or (benefit.emp_no = @id) , (benefit.date_from >= @startdate) , (benefit.date_to <= @enddate) where date 2006-01-01 00:00:00.000 , date 1900-01-01 00:00:00.000 result being produced following 11,4,21,123,2...

java - Handling Unhandled event loop exception in Eclipse Plugin -

we developing product based on eclipse (it's eclipse plugin , have around 60+ plugin projects), using log4j logging framework , using log errors on business logic side. not finding way handle ui errors eclipse throws in case if there bugs in ui, example: caused by: org.eclipse.swt.swtexception: widget disposed i talking these type of errors. how handle exception can log in our log files, bugs can identified. i tried this stackoverflow question, says override public void eventloopexception(throwable exception) workbenchadvisor class. i tried this, in 1 of our ui plugin project this: public class customworkbenchadvisor extends workbenchadvisor { @override public void eventloopexception(throwable exception) { system.out.println("error occured"); super.eventloopexception(exception); } } and delbrately created ui error, when see console, don't see "error occured" displayed instead displays: !message unhandled even...

bash - Some questions of automate the process of iOS builds -

recently,i try automate process of ios builds using bash scripts. i'm building app,code signing file using xcodebuild , , pack project using xcrun . in xcode ,we can set information easily,( summary->ios application target-> ...) but,how can set information without xcode ,i want using bash scripts,like modify info-plist or other configuration files,does works? how can solve question? the second question: because want automate ios builds in server, need import certificates(.p12) clients give me keychain automatically,the question how can export .p12 file automatically keychain when clients give me name of code signing. can provide me information of automating process of ios builds using bash scripts? or have realize function? please give me clues that, or program. you can inject custom build settings passing key=value arguments xcodebuild . can put these info.plist values ${my_build_setting} .

swing - new java table more usefull than JTable -

some days ago have glimpse. with headache comes in moment when need work jtable, , have seen utility of jsplitpane, think idea, sincere, don't know start reach result. the result want, , maybe other people, table created jscrollpane + jpanel + jsplitpane + gridbaglayout + others components, hope can put other components jbutton, images or else want, because phisical cells want jpanel. here example respectable list, in opinion, find on forum: import java.awt.borderlayout; import java.awt.color; import java.awt.dimension; import java.awt.eventqueue; import java.awt.gridbagconstraints; import java.awt.gridbaglayout; import java.awt.event.actionevent; import java.awt.event.actionlistener; import javax.swing.boxlayout; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; import javax.swing.jscrollpane; import javax.swing.swingutilities; import javax.swing.uimanager; import javax.swing.unsupportedlookandfeelexception; ...

android - Using HTTP keep alive to access server behind NAT -

i connect client application running on android devices running on nat'd networks. basically, run own webkey server (www.androidwebkey.com) runs web server on android phone. prefer not run ssh tunnels or vpns if can avoid it. question is, how people 'log me in', 'web key' etc work? have following topology : android \ android --- isp/mno nat -- public web server ----my isp nat --- me (using web browser) android / each android running web server in effect, although vnc server. need able onto them remotely. i have googled , googled struggling find information on it. possible because how web key , log me in work. believe have intiate http connection public server android devices , use 'keep alive' headers, not sure how connect through public web server end client. can connect port on web server assigned particular android handset? can point me in right direction? i realize old, i'll contribute answer since didn't see one. hav...

c# - Dictionary database and real time searching -

i'm writing english dictionary windows phone own purposes, , know if worth store words in database, or maybe should store them in regular txt file. want search matching words in real time ( while user typing word), , worrying, database won't yield me proper efficiency. concerns justifable? i think fine apps android meriam webster, thing should consider size of file because can affect performance of phone doing kind of thing.

testng - Running dependent and independent test methods in expected sequence -

i want execute test methods in sequence. have used classes in testng.xml preserve-order set true. <test name="group-test" preserve-order="true" > <classes> <class name="com.dependency.classa"> <methods> <include name="create"/> <include name="enter"/> <include name="delete"/> </methods> </class> </classes> </test> and test class is public class classa { @test() public void create() throws exception { system.out.println("in method create"); } @test(dependsonmethods= "create") public void enter() throws exception { system.out.println("in method enter"); } @test() public void delete() throws exception { system.out.println("in method delete"); } after executing test output is in method create, in me...

networking - activemq network broker different version -

i have activemq network of broker using activemq 5.4.0. have central server broker , consumer , many client local broker , producer. need upgrade activemq version 5.8.0. upgrading server, in local broker continue see central consumer, messages remain in local broker. for netowork of broker, it's mandatory have same version of activemq? thanks i solved in way: 1) change configuration in network connector broker client 5.4.0 from <networkconnectors> <networkconnector uri="static://(tcp://serverurl:61616)" name="bridge" duplex="true" conduitsubscriptions="true" decreasenetworkconsumerpriority="false"> </networkconnector> </networkconnectors> to <networkconnectors> <networkconnector uri="static://(tcp://serverurl:61616)" ...

How to give the And condition in Generics in java -

we have class structure a<-b<-c<-d<-e<-f ( b extends a, c extends b , on ). i need create method acceptlist(list<> list) in such way can accept list of class a,c,e , not accept list of b,d,f . this question asked me in interview. some trick might work, bear in mind interfaces beat reflection ... if can implement type dependent functions in interfaces directly it. first implementation of classes: public class { public boolean isacceptable() { return true; } static class b extends { @override public boolean isacceptable() { return !super.isacceptable(); } } static class c extends b { @override public boolean isacceptable() { return !super.isacceptable(); } } static class d extends c { @override public boolean isacceptable() { return !super.isacceptable(); } } static class e extends d { @override public boolean isacceptable() { return !super.isacceptable(); ...

python - Calculating stats across 1000 arrays -

i writing python module needs calculate mean , standard deviation of pixel values across 1000+ arrays (identical dimensions). i looking fastest way this. currently looping through arrays , using numpy.dstack stack 1000 arrays rather large 3d array...and calculate mean across 3rd(?) dimension. each array has shape (5000,4000). this approach taking quite long time! would able advise on more efficient method of approaching problem? maybe calculate mean , std in cumulative way (untested): im_size = (5000,4000) cum_sum = np.zeros(im_size) cum_sum_of_squares = np.zeros(im_size) n = 0 filename in filenames: image = read_your_image(filename) cum_sum += image cum_sum_of_squares += image**2 n += 1 mean_image = cum_sum / n std_image = np.sqrt(cum_sum_of_squares / n - (mean_image)**2) this limited how fast can read images disk. not limited memory, since have 1 image in memory @ time. calculation of std in way might suffer numerical problems, since mi...

rails 3 undefined method `+' for nil:NilClass -

i making sorting table in rails , getting error. index.html.erb <table> <tr> <th><%= sortable "name" %></th> <th><%= sortable "city" %></th> <th><%= sortable "country" %></th> <th><%= sortable "street_address" %></th> <th><%= sortable "sector" %></th> <th><%= sortable "telephone" %></th> <th><%= sortable "fax" %></th> </tr> <% company in @companies %> <tr> <td><%= company.name %></td> <td><%= company.city %></td> <td><%= company.country %></td> <td><%= company.street_address %></td> <td><%= company.sector %></td> <td><%= company.telephone %></td> <td><%= company.fax %...

ruby - Rails command working , rails -v shows Rails 4.0.0 , gem list rails shows 3.2.13 -

rails command working . rails -v shows 4.0.0 . gem list rails shows 3.2.13 . want work on rails 3.2.13 , when tried uninstall rails 4.0.0 says gem "rails" not installed .what should rails -v shows 3.2.13 , rails 4 uninstalled ? it's because rails binary loads via railties gem. last 2 lines of /usr/local/bin/rails looks like: gem 'railties', version load gem.bin_path('railties', 'rails', version) you need run: gem uninstall railties -v 4.0.0 assuming have rails & railties 3.2.13 installed, rails -v should return rails 3.2.13 .

Getting sum of rows based on column in oracle -

i want sum of values of 1 column group column. e.g month count jan 5 jan 7 feb 1 feb 2 i want month count status jan 5 jan 7 b jan 12 sum feb 1 feb 2 b feb 3 sum one way rollup . however, because want original data, approach "fake" aggregation rownum rollup: select month, sum(count), (case when rn null 'sum' end) status (select rownum rn, t.* t ) t group month, rollup(rn) i'm not sure mean a , b in status column.

How can I simutaneously perform 'CTRL + Enter ' in Selenium WebDriver? -

how can simultaneously perform ctrl + enter↵ in selenium webdriver? tried one: body1.sendkeys(keys.control + "enter"); but doesn't work. string keyspressed = keys.chord(keys.control, keys.return); element.sendkeys(keyspressed) ; will work you..

xaml - Sliding Navigate Between WP>7 Pages -

Image
lets have 5 xaml pages. page1.xaml page1.cs page2.xaml page2.cs page3.xaml page3.cs page4.xaml page4.cs page5.xaml page5.cs and working separately , can access them via page1.xaml tapping icons!, want make navigating via sliding pages, example if in page2 , slide right left then go page3, if slide right left again go page4, if slide left right return page3. this goal , nice see little part next , previous page in right , left of current page in order know go! keep page1 , delete others. add panoramapage project. pretty sure looking for. to navigate panoramaitem check this question on so . by way, should check pivotpage too.

.net - Reference dll from another project in T4 -

i want able reference assembly in t4 template don't want bind myself debug/release mode version of it. i tried use following include assembly: <#@ assembly name="..\..\otherassy\bin\$(configuration)\otherassy.dll" #> but throws error saying cant find dll. can use configuration property configuration mode e.g. debug/release? or barking wrong tree? yes can, (for transforms within ide @ least), relative path won't work, t4's 'current' directory isn't project folder rather vs's installation folder. so if use $(solutiondir) or $(projectdir) should go. incidentally, full list of variables here on msdn

can we use OAUTH /OPenID in corporate LAN where Social network sites are blocked? -

i developing 1 website,in have implemented google oauth when trying run sample in office there corporate lan giving error code works fine on personal machine @ home. also 1 more question how stackoverflow using google login can access site in office using google login. please give me suggestions/answers on need open internet coonection oauth/openid. or work in corporate lan? thanks is blocked in office? or behind proxy? work puts behind proxy, need account in oauth code (or connect through our approved gateway).

Symfony 2 -> Composer and CloudControl -

i have little problem setup symfony 2 on cloudcontrol, i followed instructions , installed symfony 2 framework, changed document root , on. when try push changes server server, loads dependencies composer.json , failed message : [runtimeexception] not scan classes inside "/srv/tmp/builddir/code/vendor/symfony/symfony/src/symfony/component/httpfoundation/resources/stubs" not appear file nor folder this file vendor package, loaded composer. i have same effect default composer.json file sample project (sf2) localy works well! can 1 give me hint ? got same error after setting "minimum-stability":"dev" , running composer update. for unknown reason symfony/symfony (dev-master ...) kept failing download source being loaded cache. what worked me mix of previous answers: $ rm -rf vendor/symfony $ composer clearcache $ composer install

java - Incompatible types error while trying to create a map of maps -

i trying create map of maps using concurrentskiplistmap . if create simple map example seems fine: map<integer, integer> mmap2 = new concurrentskiplistmap<integer, integer>(); once try create map of maps, incompatible types error: map<integer, map<integer, integer>> mmap = new concurrentskiplistmap<integer, concurrentskiplistmap<integer, integer>>(); if switch definition include concurrentskiplistmap , compiles no problems: map<integer, concurrentskiplistmap<integer, integer>> mmap = new concurrentskiplistmap<integer, concurrentskiplistmap<integer, integer>>(); why cant define map of map's using map interface? i can answer question example. map<integer, map<integer, integer> mmap = new concurrentskiplistmap<integer, concurrentskiplistmap<integer, integer>>(); mmap.put(5, new hashmap<integer, integer>()); in case, expect put line allowed? if not allowed b...

how to insert data from textboxes into mysql database in java-netbeans -

i new programming , trying make small java swing application using netbeans ide , have designed form , created table used following code insert data database form getting many errors please me correct code: import java.sql.*; public class db { static final string jdbc_driver="com.mysql.jdbc.driver"; static final string db_url = "jdbc:mysql://localhost:3306/userdb"; static final string user="root"; static final string pass="toor"; connection conn = null; statement stmt = null; static final string d_unit=jtextfield2.gettext(); static final string d_name=jtextfield3.gettext(); static final string d_dob=jdatechooser2.gettext(); //static final string d_gender="gender"; static final string d_age=jtextfield4.gettext(); static final string d_doorno=jtextfield5.gettext(); static final string d_street=jtextfield6.gettext(); static final string d_vc=jtextfield7.gettext(); static final string d_district=jtextfie...

regex - Perl Regular Expression to extract value from nested html tags -

$match = q(<a href="#google"><h1><b>google</b></h1></a>); if($match =~ /<a.*?href.*?><.?>(.*?)<\/a>/){ $title = $1; }else { $title=""; } print"$title"; output: google</b></h1> it should : google unable extract value link using regex in perl, have 1 more or less nesting: <h1><b><i>google</i></b></h1> please try this: 1) <td><a href="/wiki/unix_shell" title="unix shell">unix shell</a> 2) <a href="http://www.hp.com"><h1><b>hp</b></h1></a> 3) <a href="/wiki/generic_programming" title="generic programming">generic</a></td>); 4) <a href="#cite_note-1"><span>[</span>1<span>]</span></a> output: unix shell hp generic [1] try this: if($match =~ /<a.*?href....

c# - Tcp connection Keep alive -

i creating client server application. server design , in place waiting connection client. in client section keep connection alive throughout th life of application , connection closes when main client application close's or shutdown or server closes it. currently every 10 seconds server closes tcp connection.i tried socket.setsocketoption(socketoptionlevel.tcp, socketoptionname.keepalive, true); but doesn't work me.. below code block public tcpstreamdevice(string remoteipaddress, int remoteport, string sourceipaddress, int sourceportno) { mipaddress = remoteipaddress; mport = remoteport; mclient = new socket(addressfamily.internetwork, sockettype.stream, protocoltype.tcp); system.net.ipendpoint localendpoint = new system.net.ipendpoint(system.net.ipaddress.parse(sourceipaddress), sourceportno); mclient.bind(localendpoint); mdatareceivedcallback = new asynccallback(datareceivedtcpcallback_handler); mbuffer = new byte[1024]; ...

Android FragmentActivity from inside Fragment -

in android application have created simple navigation drawer calls fragments when item clicked. 1 of these fragments, want call fragmentactivity (which make scrollable tabs within 1 of fragments). possible? can please me. similar example i'm trying achieve in play music. has navigation drawer , upon selecting 'my library' creates fragment scrollable tabs whilst still having navdrawer accessible page. regards, import android.app.actionbar; import android.app.fragment; import android.app.fragmenttransaction; import android.os.bundle; import android.view.layoutinflater; import android.view.view; import android.view.viewgroup; import cgg.gov.in.apps.eoffice.source.r; public class testtabsinsidefragment extends fragment { view rootview; public testtabsinsidefragment () { // empty constructor required fragment subclasses } @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { getactivity()....

java - MySQL cascade on delete changes in wrong direction (eclipselink as JPA) -

i ran weird issue: i have table constrainable , table attribute . within attribute table specify constrainable attribute belongs foreign key constraint. added cascade on delete foreign key constraint in attribute table. now if want delete attribute constrainable being deleted too.. should not happening or wrong? using method so: public void remove(idbobject obj) throws dbexception { if (manager != null) { idbobject o = null; try { o = manager.getreference(obj.getclass(), obj.getprimarykey()); } catch (entitynotfoundexception e) { throw new dbexception("entity doesnt exist"); } manager.gettransaction().begin(); manager.remove(o); manager.gettransaction().commit(); return; } throw new dbexception("manager closed or null"); } what reasons behaviour? more detailed outline of db: constrainable-table: | id | attribute-table : | id | co...

c# - Azure - How to access content files of WorkerRole? -

i'm writing worker role sending emails. has email template html files build action = content , copy output = copy always how can access files code of workerrole? i don't want store files in blob because need upload service possible , have able edit email template without wiring code that. edit: guys i'm talking azure. doesn't work regular method of loading folder of current running assembly because give azure host process located in different place. i figured out - here's how it: path.combine(environment.getenvironmentvariable("roleroot") + @"\", @"approot\filetemplates\");

ruby on rails - Match existing user profile with facebook, gmail and twitter -

i have built custom login system. it's working fine, because users forget user login details, want use oauth gmail , facebook access. how can match existing user data facebook or gmail data? if have user , uses facebook or gmail oauth login, can identify looking in current users table e-mail (assuming required e-mail confirmation in system, or else can become real mess). twitter, other hand, doesn't allow see e-mail user, have alternate way. more straight-forward way unite user account external user account ask add bound accounts in first oauth login. forgetting login details doesn't seems best motive use oauth, implement "forgot password/login" feature. oauth supposed improve users experience being connected other services well, , use same "friends" or "share" things in easier way. (this seems personal opinion since have no source , @mischa not agree that). however, noticed, simplify user management if don't want implemen...

javascript - Store multiple values in localStorage when clicked on -

so im trying have jquery remember clicked on. so user clicks on list item , clicks on list item. how store both item classes user clicked on. here have currently $(document).ready(function() { $('#terms-product_cat ul li').on('click', function(event) { $(this).addclass('current-term'); window.localstorage['temp_type'] = $(this).find('label').attr('class'); }); alert(window.localstorage['temp_type']); }); try this: $('#terms-product_cat ul li').on('click', function(event) { $(this).addclass('current-term'); var maybe_string = window.localstorage['temp_type']; var array = maybe_string ? json.parse(maybe_string) : []; array.push($(this).find('label').attr('class')); window.localstorage['temp_type'] = json.stringify(array); });

java - Read HTTPServletRequest's POST body AND then call getParameter in Tomcat -

i in situation application needs inspect content/data/body/payload of post request without changing results of subsequent getparameter calls. reading body inputstream: the body can read using inputstream request.getinputstream or bufferedreader request.getreader . reading post parameters: post requests typically include request parameters in body of request. these can retrieved using getparameter . the problem: the first getparameter call internally parses inputstream , inserts parameters parameter hashmap. requires inputstream still contain contents parsing. 1 cannot inspect content , still have working getparameter call. proposed (but not sufficient) solution create request wrapper caches inputstream , returns cache getinputstream. i've seen solution suggested on web, doesn't work, because getparameter doesn't call getinputstream , refers original inputbuffer buried in request object. i've tried it, both within servlet , using filter the ...

jquery - Setting styles for desktop only (responsive site) -

ok, hope makes sense, here go... i'm building responsive site, desktop version has been done. , have image within div wrapper. has on hover state , displays test. done through css. now on tablet want able create dropdown text rather hover state. problem when hover on div need click on tablet version (max-width: 1024px) content shows. want show onclick jquery. here css site set on site itself: .texthoverwrapone:hover div.block-50_texthoverone, .texthoverwraptwo:hover div.block-50_texthovertwo, .texthoverwrapthree:hover div.block-50_texthoverthree,.texthoverwrapfour:hover div.block-50_texthoverfour, .texthoverwrapfive:hover div.block-50_texthoverfive, .texthoverwrapsix:hover div.block-50_texthoversix{ visibility: visible; opacity: 1; -webkit-transition: 0.4s ease-in-out; -moz-transition: 0.4s ease-in-out; -o-transition: 0.4s ease-in-out; transition: 0.4s ease-in-out; } i want able remove styles tablet , smaller. can't seem clear them. way c...

c# - How to Recycle a Self-Hosted WCF Service -

i'm hosting wcf service in azure woker role this . i'd able "recycle" wcf service host on regular interval. problem is, assume service running it's own app domain, , have no way poll events, nor can share common data between worker role , wcf service. for reference, here's minimum code host: public override void run() { using(var host = new servicehost(typeof(myservice)) { // configure host here... host.open while(true) { sleep(1000); } } } i'd "restart" host somehow every 24 hours, i'm not sure how/what hook accomplish that. the wcf service running in-proc worker role right (ie. running in waworkerhost.exe)? in case can either call roleenvironment.requestrecycle, or let run() method exit. either way cause waworkerhost.exe gracefully shut down, , azure guest agent automatically restart everything.

regex - Windows batch to add/replace entry in hosts file -

i read topic first step usefull begin with. can add several lines hosts file. i trying, without success, search , replace string regular expression. exemple, if host file contains "someip website.com" modify line obtain "newip website.com". i can find if line contains "website.com", don't know (if possible) how line , replace ip address via regular expression pattern. %windir%\system32\find /c /i "website.com" %hostpath% >nul if %errorlevel% neq 0 echo %newline%^%server% website.com>>%hostpath% i'm lost thank answers :) see https://stackoverflow.com/a/16735079/891976 repl.bat dbenham supports regular expression search , replace. type "hosts" | repl "\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b website.com" "newip website.com" m >"hosts.new" move /y hosts.new hosts repl.bat: http://www.dostips.com/forum/viewtopic.php?f=3&t=3855

javascript - AngularJS $http response long execution -

i using angular , $http request data server. mock data in same server directory return response in 20 sec. way long. request executed on application start up. have tried execute same query using jquery $.ajax, , worked in 10 ms. want rid of jquery. why angularjs $http taking long? i using ifeanyi isitor's lazy loading in angularjs example how use require.js angular. loading first view's controller points service query executed. in chrome dev tools network traking see takes less when 10 ms file. using console.time setting before executing query , ending @ success promise logs 20000 ms. can because of lazy loading? why jquery working fast? here code of service define(['appmodule'], function(app) { app.lazy.factory('daoservice', ['$http', function($http) { var ... ... getchanges = function(tablename, modifiedsince, callback) { console.log('data access time starts'); console.time('data access time'); ...

c# - RuntimeBinderException when using dynamic object make debugging "impossible" -

i microsoft.csharp.runtimebinder.runtimebinderexception everytime try property dynamic object. ve read several posts issue can't rid of these exceptions! tried lot of things rid of them i.e. lots of first chance microsoft.csharp.runtimebinderexceptions thrown when dealing dynamics won't work. overlow in debug output , point makes bad start of app slowed down dramatically. it's impossible test in debug if every start needs 2min becouse of exceptions. nice :)

jquery - How do I stop a remote form from submitting? -

i have form can used both remotely , normally. = form_for @comment, html: { class: 'comment-form' }, remote: request.xhr? |f| = f.text_area :body = f.submit i want form submit if body textarea has content: $(document).on 'submit', '.comment-form', (e) -> text = $(this).find('#comment_body').val() false if text.length < 1 that code works when form not ajax. when it's remote, fails , form still submits. why? tried: if text.length < 1 e.preventdefault() false i'm using rails 4 turbolinks. update: tried binding ajax:beforesend event, still submits: $(document).on 'page:load', '.comment-form', -> $(this).bind 'ajax:beforesend', -> alert "hi" i see no alert... you potentially implement handler ajax:beforesend event prevent form being submitted. looks submit stops if event handler returns false . wiki: https://github.com/rails/jquery-ujs/wi...

python - Django log messages not processing correctly. Messages to multiple files -

so have 2 loggers in django project. 1 authentication failures, , 1 includes includes messages when edited (basically have logger command). seem have bit of problem in modules want use both loggers however. 2 loggers defined so: '': { 'handlers': ['file'], 'level': 'info', 'propagate': true, }, 'auth': { 'handlers': ['file_auth'], 'level': 'critical', 'propagate': true, } and handlers are: 'file': { 'level': 'info', 'class': 'logging.filehandler', 'filename': '/home/debug.log', 'formatter': 'simple', }, 'file_auth': { 'level': 'critical', 'class': 'logging.filehandler', 'filename': '/home/debug2.log', 'formatter': 'verbose', }, at top of django view, have import logging logger = lo...

netbeans - How do we apply JML (openJML) to Java Code? -

how apply jml java code? i'm still new in design contracts , quite lost on how apply program. http://jmlspecs.sourceforge.net/ using: openjml netbeans 7.3 java sdk 1.7 i have added openjml jar files classpath of netbeans. tried cofoga google jml version import com.google.java.contract.ensures; import com.google.java.contract.requires can add pre , post conditions how specify pre condition , post condition using openjml in program? i found needed; importing library annotations: import org.jmlspecs.annotation.requires; import org.jmlspecs.annotation.ensures;

c# - How to identify the ValidationError ToolTip Placement in WPF TextBox -

Image
i have added arrow indicate textbox tooltip. works great when textbox far away screen edge. when near screen edge. tooltip placement changes , arrow shown on left. here image correct expected, since textbox in away edges. but when textbox near edges. see this i want see arrow in second image on right side of tooltip. here code <grid grid.column="0" width="10" margin="1,0,-1,0" background="transparent"> <path height="15" stretch="fill" fill="{dynamicresource controlsvalidationbrush}" data="f1 m 287.328,237.333l 319.344,255.818l 319.344,218.849l 287.328,237.333 z " /> </grid> <border grid.column="1" background="{dynamicresource controlsvalidationbrush}" cornerradius="0"> <textblock maxwidth="250" margin="8,7,8,7" foreground...

sqlplus to Access Syntax Issue -

i unable find answer has helped me resolve issue. part of organization @ university requires our students meet attendance criteria per our required meetings each semester. track whether our students meeting criteria or not want create report show me list of students have missed required meetings , how many meetings have missed between dates x , y. the following query wrote works fine when run through sqlplus select s.first_name, s.last_name, s.email, count (a.student_mnumb) attendance_count student_attendance inner join student s on s.student_m=a.student_mnumb inner join event e on e.event_name=a.event_name1 e.event_date>'01-aug-13' , e.event_date<'01-dec-13' , e.student_req='y' , a.attend='n' group s.first_name, s.last_name, s.email having count (a.student_mnumb) > 0; however, when enter query access receive following error: "syntax error (missing operator) in query expression 's.student_m=a.student_mnumb inner join event e ...

node.js - When building blackberry10 cordova/phonegap project many files are missing -

when building blackberry10 cordova/phonegap project, number of files not included in build. number of splash screen images , file "default_bar_name.bar" not included. however, if same process repeated on device (desktop pc) files included. far can tell, both have identical software setups. c:\users\user\hello>cordova emulate blackberry10 [error: error occurred while emulating/deploying blackberry10 project. [build] populating application source [build] parsing config.xml [build] generating output files [warn] failed find debug token. if have existing debug token, please copy %home%/.cordova/blackberry10debugtoken.bar. generate new debug token, execute 'run' command. [error] error: attribute image: file cannot found in list of packaged files: res/screen/blackberry/splash-1280x768.png [error] native packager exception occurred [warn] failed find debug token. if have existing debug token, please copy %home%/.cordova/blackberry10debugtoken.bar. ...

Handling specimen creation inconsistencies between AutoFixture and Moq -

i using automoqcustomization in test conventions. consider code below. works great until add constructor 1 of concrete classes. when do, "could not find parameterless constructor". know autofixture doesn't have issue constructor because delivered me test object one proved assignable ithings... no failure there. must moq. this makes sense because assume builder generated moq , passed getcommands method. think can see control has been passed autofixture moq @ point. that takes care of why, should it? there way instruct moq on how deal thingone or there way instruct autofixture ignore moq ithingbuilders , instead fixtury? public class testclass { public interface ithingbuilders { t1 build<t1>() t1 : ithings; } public interface ithings { } public class thingone : ithings { public thingone(string someparam) { } } public class thingtwo : ithings { } public class some...

python - How do I determine how many times a message has been rejected/re-queued in RabbitMQ? -

i'm using rabbitmq pika (python), , i'm wondering if there's way determine how many times message has been re-queued? the general idea i'd worker able tell message it's dealing has been rejected/re-queued x times before, , take appropriate action error processing , explicitly remove item queue if reaches limit of y retries. i know potentially make copy of the message, increment value of priority property (or increment value in headers), publish copy queue , ack original message (similar approach of this example found), prefer explicitly nack , re-queue message. any ideas?

c++ - CPP- Square Hollow- What is the mistake? -

can please me? worte code compiles fine @ first round when loops doesnt print out properly. cant find mistake.. thank you! when compile xcode first gave right square hollow when input second time did not print out square. #include <iostream> using std::cout; using std::cin; using std::endl; #include <string> using std::string; #include <cstdlib> int main() { int a; int b; int num=0; string buf; //initialize , b = 1; b = 1; // ask user repeat process again @ end of first promt while( true ) { cout << "please enter size of square between #1-20: \n"; cin >> buf; num = atoi (buf.c_str()); cin.ignore(1000, 10); if( num < 1 || num > 20 ) break; //process of printing square while ( num >= a) { b = 1; while ( num >= b ) { if ( == 1 || == num || b == 1 || b == num ) ...

Can highly fragmented indexes cause CPU spike in SQL Server? -

i seeing cpu spikes on database server everyday , found out indexes not rebuilt quite while. reason of spikes? fragmentation might cause little more cpu load not cause spikes. why it? elsewhere. find out queries running during spikes, , @ long-running queries lots of cpu.

java - Apache ivy with eclispe and multiple projects -

how can use ivy resolve dependencys between different eclispe projects? i have 1 project has libarys , base classes want use in project. spring base project , project uses spring. in eclipse there "deploymentassemblies" if use that, got class files in other project, not libarys added, ivy.xml, base project. i hope can me :) you can use ivyde eclipse plugin resolve dependencies in eclipse project. once ivyde installed, have option "add ivy library..." when right click on project's ivy.xml . once configured, ivyde resolve project's dependecies , add them project's classpath.

java - PropertyException when setting Marshaller property with eclipselink.media-type value: application/json -

i'm attempting follow example located here javax.xml.bind.propertyexception. receive exception because of following line of code: marshaller.setproperty("eclipselink.media-type", "application/json"); i have literally copy/pasted example listed above code see there. searching , google has not been helpful, , thought i'd bring geniuses @ help. appreciated, (de)serialization json , xml json.org, jackson, , jaxb has turned black , bottomless pit has consumed month of life. my first impression wasn't specifying eclipselink runtime (as described here) didn't produce solution. stacktrace: exception in thread "main" javax.xml.bind.propertyexception: name: eclipselink.media-type value: application/json @ org.eclipse.persistence.jaxb.jaxbmarshaller.setproperty(jaxbmarshaller.java:528) @ com.dualoutput.dualoutput.main(dualoutput.java:20) sscce you need sure using eclipselink 2.4.0 or above. current version 2.5.0 ...

ubuntu - Error 500 when using "WWW", [notice] caught SIGTERM, shutting down -

i error 500 when try load 1 of sites "www". www.catherinesmith.net without www, works fine. have multiple sites hosted using vhosts. have ruled out vhost config deleting , replacing site working fine, substituting in domain. [wed aug 28 20:56:06 2013] [notice] caught sigterm, shutting down [wed aug 28 20:56:07 2013] [notice] apache/2.2.22 (ubuntu) php/5.3.10-1ubuntu3.7 suhosin-patch configured -- resuming no$ i have ruled out of files in site folder deleting , making index.php "hi" in it. i disabled site vhost, should point main ip (which lists hosted sites). catherinesmith.net loads fine, www.catherinesmith.net still gives error 500! i'm pulling hair out on one. have no idea what's causing or else can try... vhost: <virtualhost *:80> serveradmin webmaster@localhost documentroot /var/www/catherinesmith.net #custom servername catherinesmith.net serveralias www.catherinesmith.net php_admin_value open_basedir /...

javascript - How to merge two object values by keys -

trying see if there javascript library functionality can merge values specific key of 2 json objects var x ={ "student-marks":{'math':1,'physics':5} }; var y ={ "student-marks":{'chemistry':3,'history':2} }; using $.extend , $.merge giving below results $.extend({},x,y) leads { "student-marks":{'chemistry':3,'history':2} } $.merge(x,y) leads { "student-marks":{'math':1,'physics':2} } what looking ‍ { "student-marks":{'math':1,'physics':5, 'chemistry':3,'history':2} }‍ you want deep extend $.extend(true, {}, x, y); see docs jquery.extend([ deep ], target , object1 [, objectn ])

vb.net - How to loop through the weeks in a date range with vba -

i have seen how loop through weeks of year, w1301,w1302,w1303, can week number if loop through + on week number believe there way directly loop weekly vba, hope @ least. dateserial(year(now), month(now), day(now)) dateserial(2013, 3, 1) startdate = #1/1/2013# enddate = #12/31/2013# datelooper = startdate enddate i got function week number date public function isoweeknumber(d1 date) integer attributed daniel maher dim d2 long d2 = dateserial(year(d1 - weekday(d1 - 1) + 4), 1, 3) isoweeknumber = int((d1 - d2 + weekday(d2) + 5) / 7) end function you use dateadd function for = 1 52 debug.print dateadd("ww", i, now()) next

JavaScripts Not Working When Views Are Displayed - Rails 4 Ruby 2 -

i creating new versions of rails 3.2.13 applications using rails 4.0.0 , ruby 2.0.0. using latest version of michael hartl's ruby on rails tutorial guide. not familiar of gems being used such turbolinks. i have several websites have javascript in views in application.html.erb. there times scripts work when view first displayed. other times page display no scripts executed. when happens refresh page , scripts work. happens time time 'new' twitter widgets , widgets weather channel. here have in application.html.erb: <%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %> <%= javascript_include_tag "application", "data-turbolinks-track" => true %> i have not changed other code in views. when run rails 3 version scripts execute when views displayed. when run rails 4 version have refresh pages scripts before execu...

Substring each row of a column in mySQL -

i have table column called menu_name contains string "one|two|three|four|something" i want write 1 time script remove after , including last | so final value "one|two|three|four" if there no | in cell, i.e "something" want set string "" thanks! thanks nanhe kumar getting me close, here's final command: update reports set menu_name = substring(menu_name,1,position(substring_index(menu_name,'|',-1) in menu_name)-2) select substring(menu_name,1,position(substring_index(menu_name,'|',-1) in menu_name)-2) menu table_name;

mysql - Optional variables in an sql query string -

i automating excel , have string read input sheet variable1,2,3,4,5,6 i wish make them optional if left empty query executes usual select left(name, 5) production.product product.name 'variable1' product.brand 'variable2' prodcut.price > 'variable3' prodcut.expirydate > 'variable4' order productid; try this: select left(name, 5) production.product (product.name @variable1 or @variable1 null) , (product.brand @variable2 or @variable2 null) , (product.price > @variable3 or @variable3 null) , (product.expirydate > @variable4 or @variable4 null) order productid;

class - wxFormBuilder with Python: access FlexGridSizer from subclass -

i'm building gui in wxformbuilder , writing code in python. i've noticed widgets i've built assigned self in generated code. example, gui single piece of text might like: class myframe(wx.frame): def __init__(self,parent): wx.frame.__init__(self,parent) self.mystatictext = wx.statictext(self,wx.id_any,'my text',0) so object mystatictext becomes attribute of myframe class. good, because can write new class inherits 1 , perform other functions, such updating mystatictext object: import myfrmae class gui(myframe): def __init_(self,parent): myframe.__init__(self,parent) def updatetext(self): self.statictext.setlabel('my other text') the problem wxformbuilder not append self in front of flexgridsizer objects. generated code looks like: myflexgridsizer = wx.flexgridsizer(3,1,0,0) instead of: self.myflexgridsizer = wx.flexgridsizer(3,1,0,0) as result, cannot access object other class, need d...

PHP parse assoc. array or XML -

how acces assoc array? array ( [order-id] => array ( [0] => 1 [1] => 2 ) ) as result of xml parsing <?xml version="1.0" encoding="utf-8"?> <!doctype request system "http://shits.com/wtf.dtd"> <request version="0.5"> <order-states-request> <order-ids> <order-id>1</order-id> <order-id>2</order-id> ... </order-ids> </order-states-request> </request> $body = file_get_contents('php://input'); $xml = simplexml_load_string($body); $src = $xml->{'order-states-request'}->{'order-ids'}; foreach ($src $order) { echo ' id:'.$order->{'order-id'}; // dont work - echoes id:1, why? } // ok, lets try way... $items = toarray($src); //googled function - see @ bottom print_r($items); // print result - see @ top assoc array // ...

Undo a git rerere resolution that was done in a rebase -

okay, git rerere command. although, haven't used other letting auto-magically record conflicts , resolve them me. however, did mess 1 of conflict resolutions during quite large rebase (rebasing stale feature branch latest release). feature -> - b - c - d release -> e - f - g - h rebase/feature -> e - f - g - h - a' - b' - c' - d' so, instance b' has incorrect merge (thanks me!), , want re-record that. how it? i've seen git checkout --conflict option, mentioned in rerere boat , i'm not clear on how works , if applies here. maybe have checkout merge conflict state , run git rerere once correctly resolve conflict? normally, commit tip of rebase branch, throw away. i'm trying handle conflicts ahead of time, when sync feature team, minimize time takes. make sense? you can tell rerere forget recorded resolution merge re-executing merge , allowing rerere apply recorded resolution in work tree. you can check out a...

java - How to serve local files via browser -

i'm making intranet page users put in information (text). application take text , go through files on shared drive webserver has access to. based on text , logic it'll find file matches. now have full absolute file path of matched file, i'd users able download file page well. however, since file doesn't exist in application can't serve it. all have network share like: \\somenetwork\share\filename.pdf is there way can let users download file (with above path) intranet page? i've tried: <a href="\\somenetwork\share\filename.pdf"> not work. tried prepending file:// link nothing. not open file or give option download. ps: understand should ideally script on command line. i'm trying turn command line script intranet page. this works in chrome , ie. txt file on shared drive (that have access to), opens file in browser. <a href="file://\\server\d$\temp\clipboard.txt">test</a> you have ensure use...

jquery - JCrop in Firefox attaches original image height/width -

we're using jcrop library cropping profile picture. when user changes profile picture, new picture still uses old image dimensions. works in chrome doesn't work in firefox. remove previous image , jcrop using destroy: jcrop_api.destroy(); i have added line of code in attempt clear styles contains width , height. $('#target').removeattr('style'); i have met issue , tried , discovered workaround works me: there must alert() function if using firefox , jcrop destruction , initialization again. // clear selector if (jcropapi) { jcropapi.destroy(); } initcropper(); // if browser firefox, fix bug stretching if (navigator.useragent.tolowercase().indexof('firefox') > -1) { // firefox-related activities alert('file loaded'); // alert necessary if (jcropapi) { jcropapi.destroy(); } initcropper(); }

ruby on rails - Heroku: Compiled slug size is too large (max is 300MB) -

it's been while since last pushed rails 3.2.13 app heroku. push failing because of error: "compiled slug size: 1423.7mb large (max 300mb)". the solutions ive found request me reduce slug size reducing gems , such. there's not can reduce gems. why heroku limiting push? there way around this? update: checked file size each file in app , found 'public' folder had on 1.4gbs of data consisted (in 'uploads' subfolder) of carrierwave file uploads stored app before started using plugged amazon s3. created '.slugignore' file , added '/public/uploads'.

java - How to modify PdfPCell so that you can remove a part of a border (e.g BOTTOM, TOP, LEFT)? -

here example of code: pdfpcell row6cell_1 = new pdfpcell(row6par_1); row6cell_1.setborder(rectangle.no_border); row6cell_1.setborder(rectangle.left); row6cell_1.setborder(rectangle.top); row6cell_1.setborder(rectangle.bottom); row6cell_1.setborderwidth(1.0f); i want modify border of cell right border line of cell not appear. can me this? thank you. you can try this: removing bottom border only. cell = new pdfpcell(new phrase("001")); cell.setborder(rectangle.top | rectangle.right | rectangle.left);

What are the restrictions on Office 365 (SharePoint Online) in SharePoint 2013 Environment -

as there drastic change in architecture sharepoint 2010 2013, know restrictions developer while developing solutions/apps office 365. in sharepoint 2010, sandbox solutions allowed on office 365, in sharepoint 2013 sandbox solutions depreciated , app model introduced. glad if can throw light on allowed , restricted on office 365 in new 2013 environment. sharepoint 2013 game changer, starting fact possible use framework 4.5 and, since new release of visual studio 2013, it's possible use mvc. developing point of view have know there 2 flavors: sharepoint hosted. in case, whole application installed within microsoft servers. because of this, must use client object model , javascript. no server code @ all. configure sites, libraries, lists, etc 365 , access information using sharepoint javascripts libraries. if familiar js ans sp js won't have problem. autohosted. in case can choose between azure or hosting (provider hosted) in both cases can use more traditional ...

c# - Error 112 and Error 113 after adding foreign keys to database -

Image
this table ( part of whole thing , activity table still have other relationships other tables) : after adding foreign key , update model edmx database in visual studio , came 2 error : error 2 error 112: types of properties in dependent role of referential constraint must same corresponding property types in principal role. type of property 'activityid' on entity 'istellarmodel1.singalong' not match type of property 'activityid' on entity 'istellarmodel1.activity' in referential constraint 'fk_singalong_activity'. and error 1 error 113: multiplicity not valid in role 'activity' in relationship 'fk_singalong_activity'. because properties in dependent role nullable, multiplicity of principal role must '0..1'. i checked activityid in singalong have same type activity table's activity id , , don't understand error 113 means , new database , @ first have many tables don'...