Posts

objective c - Handling Pointer-to-Pointer Ownership Issues in ARC -

objective c - Handling Pointer-to-Pointer Ownership Issues in ARC - suppose object a has property: @property (nonatomic, strong) foo * bar; synthesized in implementation as: @synthesize bar = _bar; object b manipulates foo ** , in illustration phone call object a: foo * temp = self.bar; [objb dosomething:&temp]; self.bar = temp; can this, or similar, done legitimately? what right declaration dosomething: method? furthermore, suppose object b may deallocated before have chance set bar property (and take on ownership of instance pointed temp ) - how tell arc hand off owning reference? in other words, if wanted next illustration snippet work, how need handle arc issues? foo * temp = self.bar; // give reference current value [objb dosomething:&temp]; // allow modify reference self.bar = nil; // release whatever have _bar = temp; // since we're getting owning reference, bypass setter what aren't thinking of? ...

reporting services - In SSRS, is it possible to make a context sensitive report containing multiple subreports for dynamics CRM 2011 -

reporting services - In SSRS, is it possible to make a context sensitive report containing multiple subreports for dynamics CRM 2011 - i have designed ssrs study having multiple sub-reports. study working fine displaying info records. need create context sensitive. below query main report. select filterednew_franchisee.new_franchiseeid, filterednew_franchisee.new_name, filterednew_monthlypayment.new_insurance filterednew_franchisee inner bring together filterednew_monthlypayment on filterednew_franchisee.new_franchiseeid = filterednew_monthlypayment.new_franchiseeid (filterednew_monthlypayment.new_yearmonth = @reportyear + @reportmonth) , (filterednew_franchisee.new_franchiseeid in (select new_franchiseeid filterednew_franchisee crmaf_filterednew_franchisee)) sub-reports using fields above query parameter. am missing ? there other approach needs followed? possible design context sensitive study having multiple sub-reports? please help. ...

Rails - How to validate a field only if a another field has a certain value? -

Rails - How to validate a field only if a another field has a certain value? - i'm pretty new rails , came across problem wasn't able solve friend google :) in form have select 3 values: apple, banana , cherry. if take apple select hide select- , text-field javascript, because when apple chosen, there no need fill in these other 2 fields anymore. so have problem validating form when it's submitted. i've found similar problems illustration in case of "only validate field if blank." this problem solved this: validates_presence_of :mobile_number, :unless => :home_phone? so i've tried first thing popped mind: validates_presence_of :state, :granted_at, :if => :type != 1 but when run it, error: undefined method `validate' true:trueclass so didn't find out how can access values object created... give thanks in advance help , hope question isn't obvious sounds :-) because executable code need wrap in lambda...

Simple handlng and logging of Exceptions i ASP.NET MVC? -

Simple handlng and logging of Exceptions i ASP.NET MVC? - hi, i looking simple way log exceptions database in asp.net mvc application. have looked @ "exception management application block" can´t find simple , clear articels how handle in asp.net mvc? maby should grab exception far possible , log database im not sure how in asp.net mvc. in windowsforms there diffrent events(like unexpectedexception) hear can log, there in asp.net mvc? bestregards edit1: found tool called elmah http://code.google.com/p/elmah/ im not sure if solution , if works asp.net mvc. then found article http://www.davidjuth.com/asp-net-mvc-error-handler.aspx looks easy , clear not know if right way go? use elmah, available on nuget. log unhandled exceptions in web app , provide interface view them. can log variety of storage mechanisms including xml , sql databases, can email errors. the solution logging exceptions in asp.net applications (both webforms , mvc). if using elmah ...

java - How to get Apache CLI to handle double-dash? -

java - How to get Apache CLI to handle double-dash? - i've looked @ docs can't see how apache commons cli handle double-hyphen "option" terminates alternative processing. consider next command-line has "-opt" alternative can take optional argument not specified: myprogram -opt -- param1 param2 i want alternative end no arguments in case, apache returns "--" argument. if alternative allowed more 1 argument, or of parameters returned arguments. here sample code illustrating issue: package com.lifetouch.commons.cli; import java.util.arrays; import org.apache.commons.cli.*; public class doublehyphen { private static options options = new options(); public static void main(string args[]) { // 1 required alternative optional argument: @suppresswarnings("static-access") optionbuilder builder = optionbuilder.isrequired(true). withdescription("one optional arg"). witharg...

python - How to check whether virtualenv was created with '--no-site-packages'? -

python - How to check whether virtualenv was created with '--no-site-packages'? - sometimes errors suspect result of django app using globally installed python modules/django apps instead of within virtualenv. is there way check whether app's virtualenv created '--no-site-packages' without having delete it, re-create follows? deactivate rmvirtualenv my_env mkvirtualenv my_env --no-site-packages workon my_env pip install -r requirements.txt surely there must improve way! thanks. there's file in <env>/lib/pythonx.x/ called no-global-site-packages.txt when create virtual environment --no-site-packages . just tried virtualenv 1.7: % virtualenv --no-site-packages env.without % virtualenv --system-site-packages env.with % find env.without | sed 's/env.without//' > files.without % find env.with | sed 's/env.with//' > files.with % diff files.with* 230a231 > /lib/python3.2/no-global-site-packages.txt py...

How to make pycassa silent (make it stop printing to console when i create or change key or column validators) -

How to make pycassa silent (make it stop printing to console when i create or change key or column validators) - the next prints "doubletype(reversed=false)" console; how tell pycassa stop doing that? happens when alter_column too. python 2.7.2+ (default, nov 30 2011, 19:22:03) [gcc 4.6.2] on linux2 type "help", "copyright", "credits" or "license" more information. >>> pycassa.types import compositetype, utf8type, longtype, doubletype, booleantype >>> pycassa.system_manager import systemmanager >>> systemmanager().create_keyspace('test', strategy_options={"replication_factor": "1"}) >>> systemmanager().create_column_family('test', 'testcf', key_validation_class=doubletype()) doubletype(reversed=false) thanks it harmless bug fixed here: https://github.com/pycassa/pycassa/issues/98 the next release won't have issue. pycassa