Posts

Showing posts from June, 2013

android - SoundPool crashes in two scenarios. Code for first scenario crashes -

@ian g. clifton here code first type of soundpool tried. when button load activity program fcs previous activity. code starts here doesn't transfer over:::::: public class soundmanager { private soundpool msoundpool; private hashmap<integer, integer> msoundpoolmap; private audiomanager maudiomanager; private context mcontext; public soundmanager() { } public void initsounds(context thecontext) { mcontext = thecontext; msoundpool = new soundpool(16, audiomanager.stream_music, 0); msoundpoolmap = new hashmap<integer, integer>(); maudiomanager = (audiomanager)mcontext.getsystemservice(context.audio_service); } public void addsound(int index,int soundid) { msoundpoolmap.put(index, msoundpool.load(mcontext, soundid, 1)); } public void playsound(int index) { int streamvolume = maudiomanager.getstreamvolume(audiomanager.stream_music); ...

objective c - Make an Mac app do the CMD + H command -

possible duplicate: cocoa: hide 1 application hey, wondering if it's possible make button cmd + h command on other running apps? this how thinking: the user window force quit window can open clicking on apple logo > force quit. window displays running apps. , instead of having force quit button there hide button. user select app should hided , click on hide button. thank in advance! i know can applescript. like tell application "system events" set visible of process "appname" false i've seen people make scripts , tie quicksilver trigger various things other apps.

google earth - Formula to calculate different coordinates for flight routes in KML -

i need create flight routes in google earth. example point point b, how equivalent middle point both , along point b, there many different coordinates joining line curve. generally should use great-circle distance compute distance of 2 point on surface of sphere, in case earth. wolframalpha uses compute direct travel times. this define midpoint uniquely.

javascript - Sliding panel in the middle of the page. Z-index given not working -

i implementing sliding panel element problem when slide out other div element floating down. i guess , tried give z-index element sliding doesn't seems work. let me put code both div. <div class="vrcontrol"> <div class="slide-out-div"> <a class="handle" href="http://link-for-non-js-users.html">content</a> <h3>contact me</h3> <p>thanks checking out jquery plugin, hope find useful. </p> <p>this can form submit feedback, or contact info</p> </div> this div sliding in , out , beneath code of effective div. <div class="askform"> <p class="titletext">ask expert trade forum</p> <p class="detailtext">wd-40’s leading source diy tips , tricks.</p> <span> <form id="askform" name="askform" action="" method="post"...

c# - Crystal Report: Missing Parameter Values -

i new crystal report, application in asp.net 3.5 , mysql 5.1, going develop report between dates date , date, first page of report shown when tried navigate on page got error missing parameter values same error got in printing , export action in advance public partial class bookingstatement : system.web.ui.page { //dal data access layer class //book reportclass dal obj = new dal(); book bkstmt = new book(); protected void page_load(object sender, eventargs e) { if (!ispostback) { //crvbooking crystal report viewer //reportfill method fill report reportfill(); crvbooking.enableviewstate = true; crvbooking.enableparameterprompt = false; } /* try reportfill() out side !ispostback didn't work */ //check if parmeters have been shown. /* if ((viewstate["parametersshown"] != null) && (viewstate["parametersshown"].tostring() == "true")) { bkstmt.setparametervalu...

java - Why am I getting an InvalidProtocolBufferException when creating a Message.Builder from byte array but not an InputStream? -

i'm working on servlet , trying log requests. crucial part of code causing error following: protected void dopost(httpservletrequest request, httpservletresponse response) throws ioexception { stringwriter writer = new stringwriter(); ioutils.copy(request.getinputstream(), writer); message.builder builder = of type com.google.protobuf.generatedmessage.builder; builder.mergefrom(writer.tostring().getbytes()); } the final line of code above results in following exception: com.google.protobuf.invalidprotocolbufferexception: protocol message tag had invalid wire type. however, when code switched to: protected void dopost(httpservletrequest request, httpservletresponse response) throws ioexception { message.builder builder = of type com.google.protobuf.generatedmessage.builder; builder.mergefrom(request.getinputstream()); } there no error, , works fine. problem be? seem need similar first code snippet because need use input stream second time (onc...

c# - WCF database wrapper -

i need wcf service wrap database access. not want service bind specific database. in fact, receives query , returns dataset. no treatement on data done in service want pure performance need secure too. actually, think using percall session, net.tcp binding , certificate autentification on both side. (it's wan app) still, can give advices on configuration should use?(type of session,type of binding,type of security,etc..) it sounds take advantage of wcf data services . wcf data services (formerly known "ado.net data services") component of .net framework enables create services use open data protocol (odata) expose , consume data on web or intranet using semantics of representational state transfer (rest). odata exposes data resources addressable uris. data accessed , changed using standard http verbs of get, put, post, , delete. odata uses entity-relationship conventions of entity data model expose resources sets of e...

asp.net - Page.Request behaviour -

Image
i have page , few controls. i'm doing normal postback. on initializeculture event of page page.request object contains e.g. controls values - , that's great. but on other hand, when i'm trying access collection on page_load or oninit events, it's way smaller , doesn't have of controls have been there before. can tell me happens page.request between these events? edit: guys, aware of page life cycle term:) , these links indeed helpful. haven't pointed out , but: inside override method initializeculture() page.request full of various controls. right after calling base.initializeculture() , page.request has server variables. values of controls here, can't - controls not initialized yet (so calling request.params.get(somecontrol1.uniqueid) throws error) overriding preinit, init or page_load doesn't @ all. so question , when happens page.request between initializeculture() , next events makes smaller? btw. find http://i.msdn.microsoft.c...

sql server - how to pass table name as a parameter in UD scaller function? -

create function test ( @tblname sysname, @category varchar(50) ) returns int begin declare @val2 int select @val2=val1 @tblname val1=@tblname return @val2 end whats wrong query, it's throwing following error msg 1087, level 15, state 2, procedure test, line 11 must declare table variable "@tblname". you can't parameterise table name. need use dynamic sql (not allowed in functions anyway). you might able use view or cte union all s fixed list of tables , constant whatever trying do. code have posted makes little sense (you want @val2 have same value @tblname if table called value of @tblname contains same value in val1 column?!) like ;with cte ( select 'table1' table_name, val1 table1 union select 'table2' table_name, val1 table2 ) select @val2=val1 cte table_name=@tblname , val1 = @tblname

asp.net mvc - Is current action a ChildAction? -

how can determine if current action childaction or routed main action? should check url , compare action's name? that's not nice, since it's dependent on routing patterns... or should make 2 actions of same name, put childactiononly on 1 of them , have separate logic (mainly returning view() or partialview())? how overloads differentiated? okay, other perspective: how make so, if it's childaction return partialview, otherwise full view? you use ischildaction property: public actionresult index() { if (controllercontext.ischildaction) { // index action invoked child action using // @html.action("index") } ... }

jsp - How to add next and previous buttons to my pager row -

Image
how add next/previous buttons snippet, cause can see ,it display many links needs, if have high number of pages might not best solution <c:choose> <c:when test="${pages >1}"> <div class="pagination art-hiddenfield" > <c:foreach var="i" begin="1"end="${pages}" step="1"> <c:url value="maintenancelistvehicles.htm" var="url"> <c:param name="current" value="${i}"/> </c:url> <c:if test="${i==current}"> <a href="<c:out value="${url}"/> " class="current" > <c:out value="${i}" /></a> </c:if> <c:if test="${i!=current}"> <a...

c - Why isn't my signal handler being called? -

im working on assignment uses signals transfer binary message between 2 processes, goal of learning signals (it strange use indeed). in program, 2 processes communicate code, , 1 transfers message other. sigusr1 represents 0, sigusr2 represents 1. idea process sending message use kill function whichever sigusr message across, , receiving process have signal handler interpret codes. so here problem. have sender start up. sleeps while waits code sent. reciever sends 2 sigint's signify 'password', using pidof(8) find pid of sender. once sender's signal handler has read these signals, recognizes proper password, proceeds send message. the reciever has gone through few functions, , sleeping every second waiting each bit passed via interrupt. problem is, never happens. i have set such sender sending bit(0 in case) so: kill(sigusr1,washingtonpid); where washingtonpid pid of receiver, , have verified correct pid. the receiver's handler hooked so: //i...

Who makes software validation? What are the steps of its? -

fill in x,y,z please. software validation has x,y,z steps. client have provide x,y,z developer before starting write software. when software finished, validation completes doing x,y,z (sign, approval, test pictures, logs etc.). if buy general software invoice management tool or sap module can modify/change every customer, should make software validation? anything supply customer, reponsible unless contract of supply them specifies otherwise. why software product eulas long. have @ of exclusions. there's difference between validation, verification , customer acceptance testing. you'll find customer sign off package being accepted after period of acceptance testing, doesn't mean they'll accept bugs within code. why perform validation , verification testing. if you're using licenced sdk produce product , customer hit finacially due bugs in product you'll need prove isn't code sdk suppliers code if wish avoid litigation. why ...

x86 64 - PC-relative jump in gcc inline assembly -

i have asm loop guaranteed not go on 128 iterations want unroll pc-relative jump. idea unroll each iteration in reverse order , jump far loop needs be. code this: #define __mul(i) \ "movq -"#i"(%3,%5,8),%%rax;" \ "mulq "#i"(%4,%6,8);" \ "addq %%rax,%0;" \ "adcq %%rdx,%1;" \ "adcq $0,%2;" asm("jmp (128-count)*size_of_one_iteration" // need figure jump out __mul(127) __mul(126) __mul(125) ... __mul(1) __mul(0) : "+r"(lo),"+r"(hi),"+r"(overflow) : "r"(a.data),"r"(b.data),"r"(i-k),"r"(k) : "%rax","%rdx"); is possible gcc inline assembly? in gcc inline assembly, can use labels , have assembler sort out jump target you. (contrived example): int max(int a, int b) { int result; __asm__ __volatile__( "movl %1, %0\n" ...

c# - Upgrading Entity Framework 1.0 to 4.0 to include foreign keys -

currently i've been working entity framework 1.0 located under service façade. below 1 of save methods i've created either update or insert device in question. this works but, can't feel bit of hack having set referenced properties null re-attach them insert work. changeddevice holds these values, why need assign them again. so, thought i'll update model ef4. way can directly access foreign keys. however, on doing i've found there doesn't seem easy way add foreign keys except removing entity diagram , re-adding it. don't want i've been through entity properties renaming them db column names. can help? /// <summary> /// saves non network device. /// </summary> /// <param name="nonnetworkdevicedto">the non network device dto.</param> public void savenonnetworkdevice(nonnetworkdevicedto nonnetworkdevicedto) { using (var context = new assetnetworkentities2()) { var...

C#, function to replace all html special characters with normal text characters -

i have characters incoming xml template example: &amp; &gt; does generic function exist in framework replace these normal equivalents? you want use httputility.htmldecode .: converts string has been html-encoded http transmission decoded string.

html5 - webkitNotifications - SECURITY_ERR: DOM Exception 18 - script, OK - button -

i followed http://www.beakkon.com/tutorial/html5/desktop-notification tutorial html 5 desktop notifications. demo on page work me. if copy entire code works so, but... when call method javascript don't display niether notification or permision request. instead raises security_err: dom exception 18 . it seems error raised line creates notification itself. has glue why button works , calling function directly not? my current code: function requestpermission(callback) { window.webkitnotifications.requestpermission(callback); } function notif() { if (window.webkitnotifications.checkpermission() > 0) { requestpermission(notif); } notification = window.webkitnotifications.createhtmlnotification('http://localhost:3000/images/rails.png'); notification.show(); } does not compute: notif(); computes: <button onclick="notif()">notify</button> google chrome: 9.0.597.84 (oficiální sestavení 72991) webkit: 534.13 ...

php - Entering Content Into A MySQL Database Via A Form -

i've been working on creating form submits content database decided rather using drop down menu select date i'd rather use textfield. wondering changes need make table creation file. <?php mysql_connect ('localhost', 'root', 'root') ; mysql_select_db ('tmlblog'); $sql = "create table php_blog ( id int(20) not null auto_increment, timestamp int(20) not null, title varchar(255) not null, entry longtext not null, primary key (id) )"; $result = mysql_query($sql) or print ("can't create table 'php_blog' in database.<br />" . $sql . "<br />" . mysql_error()); mysql_close(); if ($result != false) { echo "table 'php_blog' created."; } ?> it's timestamp need edit enter in via textfield. title , entry being entered via method anyway. whenever use form update database following error message: can't insert table php_blog. insert php_blog (time_...

javascript - jQuery validation plugin - issue with radio buttons -

i using jquery validation plugin validate forms in pages. works smoothly except radio buttons. i have following code: $("#theform").validate({ "rules": { "r1" : "required" }, "messages" : { "r1" : { "required" : "foo" } } }); ............ ............ <input type="radio" name="r1" value="1" /> <input type="radio" name="r1" value="2" /> <input type="radio" name="r1" value="3" /> validation works "foo" message shown between first , second radio button. won't do. want after last radio button. no problem thought, add own label after last radio button: <input type="radio" name="r1" value="1" /> <input type="radio" name="r1" value="2" /> <input type="radio" name=...

database - NHibernate : delete error -

model: have model in 1 installation can contain multiple "computer systems". database: table installations has 2 columns name , description. table computersystems has 3 columsn name, description , installationid. mappings: i have following mapping installation: <?xml version="1.0" encoding="utf-8"?> <hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="myprogram.core" namespace="myprogram"> <class name="installation" table="installations" lazy="true"> <id name="id" column="id" type="int"> <generator class="native" /> </id> <property name="name" column="name" type="string" not-null="true" /> <property name="description" column="description" type="string" /> <bag name="computersyst...

tfs2010 - Are there any TFS 2010 Dashboards that support multi-project queries? -

does know of tfs 2010 dashboard able utilize multi-project queries? our group has several distinct projects must managed @ same time. tfs supports this. excluding project = @project (or whatever) can results we're looking for. our issue find nice dashboard (like telerik work item manager) supports this. as turns out telerik work item manager support (just not default or design). issue default filters on area / iteration. removing filter see need to.

cocoa - Core Graphics: Drawing along a path with a normal gradient -

Image
there number of resources here , elsewhere on web regarding how draw gradient - fill or stroke. however, afaict, none addresses following requirement: how draw path normal gradient, whereby normal means orthogonal path. net effect toothpaste or tube when applied dark->light->dark linear gradient. here idea in case of round rectangle: round-rect tube http://muys.net/cadre_blanc.png (this hand drawn , corners not good). in specific case of round rect, think can achieve effect 4 linear gradients (the sides) , 4 radial gradients (the corners). there better? is there easy solution path? the "easy" solution can think of stroke path multiple times, reducing stroke width , changing color each time, simulate gradient. obviously, expensive operation complex paths want cache result if possible. #define rkrandom(x) (arc4random() % ((nsuinteger)(x) + 1)) @implementation strokeview - (void)drawrect:(nsrect)rect { nsrect bounds = self.bounds; /...

Shortest-path algorithms which use a space-time tradeoff? -

problem: finding shortest paths in unweighted, undirected graph. breadth-first search can find shortest path between 2 nodes, can take o(|v| + |e|) time. precomputed lookup table allow requests answered in o(1) time, @ cost of o(|v|^2) space. what i'm wondering: there algorithm offers space-time tradeoff that's more fine-grained? in other words, there algorithm which: finds shortest paths in more time o(1), faster bidirectional breadth-first search uses precomputed data takes less space o(|v|^2)? on practical side: graph 800,000 nodes , believed small-world network. all-pairs shortest paths table on order of gigabytes -- that's not outrageous these days, doesn't suit our requirements. however, asking question out of curiosity. what's keeping me @ night not "how can reduce cache misses all-pairs lookup table?", "is there different algorithm out there i've never heard of?" the answer may no, , that's okay. yo...

java - Stripes framework unit testing: MockServletContext giving NullPointerException -

edit: can ignore of have written below: i getting null value of context when following in testng code: public void setupnontrivialobjects() { testfixture.context = new mockservletcontext("test"); } am supposed more make mockservletcontext object not null? original: learning use stripes framework testng. i following example here (but adapting own code): http://www.stripesframework.org/display/stripes/unit+testing under heading approach 2 i have test: public class seedsearchactionbeantest { @test public void seedsearchtest() throws exception { // setup servlet engine mockservletcontext ctx = testfixture.getservletcontext(); mockroundtrip trip = new mockroundtrip(ctx, seedsearchactionbean.class); trip.setparameter("input", "sdfs"); trip.execute(); seedsearchactionbean bean = trip.getactionbean(seedsearchactionbean.class); assert.assertequals(bean.getinput(),"sdfs"); assert.assertequal...

c# - Linq to XML Read and output XML generated from lookup list -

i trying use xml created lookup list in sharepoint datasource treeview. in form of : <newdataset> <test_data> <id>1</id> <title>menuitem_1</title> <child_of /> </test_data> <test_data> <id>2</id> <title>subitem_1</title> <action>http://www.google.com</action> <child_of>menuitem_1</child_of> </test_data> <test_data> <id>3</id> <title>subitem_2</title> <action>http://www.google.com</action> <child_of>menuitem_1</child_of> </test_data> <test_data> <id>4</id> <title>menuitem_2</title> <child_of /> </test_data> <test_data> <id>5</id> <title>subitem_2_1</title> <action>http://www.google.com</action> <child_of>menuitem_2</child_of> ...

php - Send mail every n days -

i have php script use send mail customers. how can execute script every 5 days example? can give me idea or links? thanks if have database underneath, store date of last mail in database. script checks, last date in database is. if more n days in past sends new mail , overwrites date in database current date. alternatively use cron-jobs .

How to create ASCII animation in Windows Console application using C#? -

i display non-flickery animation awesome linux command; sl http://www.youtube.com/watch?v=9gymzkwjcyu i appreciate small & stupid example of ... fly. thanks! just use console.setcursorposition moving cursor position, console.write character. before each frame have delete previous 1 overwriting spaces. heres little example built: class program { static void main(string[] args) { char[] chars = new char[] { '.', '-', '+', '^', '°', '*' }; (int = 0; ; i++) { if (i != 0) { // delete previous char setting space console.setcursorposition(6 - (i-1) % 6 - 1, console.cursortop); console.write(" "); } // write new char console.setcursorposition(6 - % 6 - 1, console.cursortop); console.write(chars[i % 6]); system.threading.thread.sleep(100); ...

html - Change the background color and text color with a timer with Javascript -

i'm trying change both background , text color of table , cells timer. have script below before end tag. background thing changes. id of table 'titletable'. thanks <script language="javascript"> <!-- begin titletable.bgcolor='#ffffff'; setinterval("timer()", 500); x=1; function timer() { set=1; if(x==0 && set==1) { titletable.bgcolor='#000000'; titletable.style.color='#ffffff'; x=1; set=0; } if(x==1 && set==1) { titletable.bgcolor='#ffffff'; titletable.style.color='#000000'; x=0; set=0; } } // end --> </script> (function() { var s = document.getelementbyid('titletable').style, f = false, c1 = '#000000', c2 = '#ffffff'; setinterval(function() { s.backgroundcolor = f ? c1 : c2; s.color = f ? c2 : c1; ...

validation - How to Validate with ASP.NET MVC - Model State is Invalid When Form Submitted -

i trying validate form in mvc. i add custom errors model state , invalid when form submitted. when view displayed doesn’t show validation messages nor validation summary. can please let me know doing wrong or point me in right direction if there other way of validating? edit asp.net mvc 1. here's code: following entity namespace dcs.dal.entities { public class group : idataerrorinfo { public int groupid { get; set; } public string groupname { ; set; } public string abouttext { get; set; } public string logourl { get; set; } public string friendlyurl { get; set; } public bool excludefromft { get; set; } public contactinfo contactinfo { get; set; } public string error { { return string.empty; } } public string this[string propname] { { if ((propname == "groupname") && string.isnullorempty(groupname)) ret...

c# - ASP.NET custom role management -

there role management feature in asp.net works on local development machine. for our project need customers admin able create new users , manage roles. so, same aspnet_regsql.exe does. question should develop our own pages , forms or use ready made tool? thanks! sounds need sqlroleprovider . you can plug in own custom role provider (and membership provider). see how to: sample role-provider implementation

parsing - How to parse the page name from a URL? -

i have url, , want final page name out of it. example, if url http://www.mysite.com/mypage.cfm , want value mypage.cfm . tried googling find if there built-in coldfusion functions can me accomplish this, haven't been able find any. so, did @ first implement sort of "endswith" function (which doesn't seem available in coldfusion either) - this: <cfif right(cgi.http_referer, len("mypage.cfm")) eq "mypage.cfm"> ... whatever want if page "mypage.cfm" ... this working well... problem if there's query string appended url won't work. example, if url http://www.mysite.com/mypage.cfm?param=whatever , if statement evaluate false. i can safely accomplish i'm trying checking if url contains page name using findnocase ... however, doesn't seem intuitive or correct. best way strip out page name url in coldfusion? no built in functions per se, list functions should do: <cfset pagename = listfirst(listlast(cg...

Access google news div from chrome extension -

i want create chrome extension show top stories google news page. through permission in menifest able required div of google news page ? you can information on page if request corresponding domain permissions in manifest. instead of parsing google news html easier parse rss feed instead (if there one).

c# - can we access form controls from an external assembly (dll assembly not within the project)? -

i have access label control of running form referenceed assembly change label text dynamically.my application scans files of selected folder.i have show name of file in progress. can access form controls external assembly (dll assembly not within project)? your dll trigger event e.g. fileprocessing whch has information passed (current filename etc) c# application subscribe , way dll doesn't have know application using it, , application can update label each time event raised...here's overview of events c# on msdn edit try code project article "the simplest c# events example imaginable" . says it's designed copy/pasted new project should able quick working example see concept. in regards situation, metronome file system scanner , instead of "tick events", you've have fileprocess/filescan events. listener example c# ui application. way c# app waiting file scanner raise events @ point can use information passed (an example in link) up...

macvim - Remap ⌘S to save a file in VIM -

i have switched using macvim using vim on command line. 1 feature miss being able save file ⌘s rather having go normal mode , :wq i using vim inside iterm2. there way ⌘s save file both in insert , normal mode? it not possible map ⌘ in console version of vim. if want able use ⌘ in mapping you'll need switch macvim.

database - Which NoSQL storage to choose -

according wikipedia nosql article , there lot of nosql implementations. what's difference between document-oriented , key-value storages (as people mention them often)? here's blog post wrote, visual guide nosql systems , illustrates major differences between of popular systems. biggest difference between them of following 2 choose optimize for: consistency, availability, , partition tolerance.

Apply patch line-by-line -

since i'm stuck subversion , shell tools time, git-gui , such out of question. there shell tools apply patch line-by-line interactively? try passing --dry-run option patch . let identify problem hunks , edit patch and/or file being patched appropriately.

C++ Static Initializer - Is it thread safe -

usually, when try initialize static variable class test2 { public: static vector<string> stringlist; private: static bool __init; static bool init() { stringlist.push_back("string1"); stringlist.push_back("string2"); stringlist.push_back("string3"); return true; } }; // implement vector<string> test2::stringlist; bool test2::__init = test2::init(); is following code thread safe, during static variable initialization? is there better way static initialize stringlist, instead of using seperate static function (init)? although initialization shall happen before main function (hence, there can no threads simultaneous access init), concern : i have exe application. my exe application load a.dll, b.dll , c.dll a/b/c.dll, in turn load common.dll. above code inside common.dll i had verify. since 3 dll within single process, referring same static variable (vector). in case, prevent 3 ...

tsql - SQL Server Merge statement issue -

i learning , using sql server 2008 new merge statement, merge statement compare/operate source table , destination table row row ("operate" mean operations performed when matched or not-matched conditions). question whether whole merge process 1 transaction or each row comparison/operation 1 transaction? appreciate if document prove it. thanks in advance, george the merge statement set based operation , such operate on entire set of matching rows. it update or delete. if want (and sounds do), can wrap begin tran , commit data integrity purposes.

php - How not to allow generating selection using comma and tab jquery autosuggest? -

hey guys, i'm using jquery's autosuggest , it's working great, 1 question. if user types , it's not there click comma or tab , adds value. question is, how can disable , allow him select results , nothing else? <script type="text/javascript"> $(function(){ var data = {items: [ <?php $mysql=mysql_connect('localhost','samaniac','ghobisdabomb'); mysql_select_db('jmtdy'); $result=mysql_query("select * users username='".$_session['username']."'") or die(mysql_error()); $dbarray=mysql_fetch_assoc($result); $result2=mysql_query("select * friendship userid='".$dbarray['id']."'"); while($dbarray2=mysql_fetch_assoc($result2)){ $result3=mysql_query("select * users id='".$dbarray2['friendid']."'"); $dbarray3=mysql_fetch_assoc($result3); echo '{value: ...

iphone - Why is my app running -

i have compiled iphone app setting (device, release). i install on test machine , runs no problem. here's problem. app linked c++ library. compilation on simulator has no errors. device compilation produces 568 errors, different visibilities w.r.t appdelegate.o. they like: ql::error::~error()has different visibility (default) in /ql/build/release-iphoneos/libqllibrary.a(abcd.o) , (hidden) in /programming/objc/second/build/second.build/release-iphoneos/fg.build/objects-normal/armv6/appdelegate.o why this, , how can stop errors anyway? you can force visibility with: -fvisibility=hidden

php - including gobal variables from different domains and folders -

i have 5 domains , on these domains have different folders call set of identical php variables. if want change value of these variables have modify 11 files 1 @ time. easier have single file these variables work on domains , folders. how or possible? create general config file projects or use environment variables.

iphone - Core Data and many Entity -

i'm newbie , must save "ranking" , "level" of user. create file ranking.xcdatamodel save "ranking" entity name ranking (property rank, name) can save , show it. but when create entity level (property currentlevel) program crash , show message: unresolved error error domain=nscocoaerrordomain code=134100 userinfo=0x60044b0 "operation not completed. (cocoa error 134100.)", { metadata = { nspersistenceframeworkversion = 248; nsstoremodelversionhashes = { users = ; }; nsstoremodelversionhashesversion = 3; nsstoremodelversionidentifiers = ( ); nsstoretype = sqlite; nsstoreuuid = "41225ad0-b508-4aa7-a5e2-15d6990ff5e7"; "_nsautovacuumlevel" = 2; }; reason = "the model used open store incompatible 1 used create store"; } i don't know how save "le...

xml - android custom listview row formatting question -

Image
i have listview trying customize. issue having eclipse's android plugin not quite sure how format text portions , wrap them around icon. here diagram trying do: i need know, 1. advice on formatting text fit row. top, want 3 different strings fit (what can) own column , ellipsise @ end. easy enough. 2. want similar bottom row give max length. each column can contain 20 characters, including (...) ellipses. may contain 1-7 columns. want overflow go next row , wrap under icon. 3. perhaps has war story custom listview want share? how did fit information in item, or did use alternate view such gridview instead? thank you. for point 1: can use linearlayouts each row, using weight property on each element according needs. point 3: in order make text ellipsise can use property android:singleline="true" although has deprecated, or use android:inputtype with in order not set textmultiline flag true for point 2: cant think of doing in other way...

php - In Drupal how to get tnid or the node id of the translated node? -

i need access id of translated node, if available given node. nid node id. seem tnid id of translated node. however, seem not case. how can id? tried following code, did not work. global $language; $translations = translation_node_get_translations($node->tnid); if ($translations[$language->language]) { $tnode = node_load($translations[$language->language]->nid); echo $tnode->nid; } any suggestions? i need tnid create custom translation-link. thanks. translation_node_get_translations($node->tnid); provides array of corresponding language nodes. did not realize it, that's needed.

javascript - jCarousel not getting drawn inside a hidden div -

i using div populate ul/li list , draw jcarousel out of it. works fine: $('#mycarousel').jcarousel(); here problem: the div containing ul/li items hidden click of button. when div hidden, , re-size browser window, jcarousel attempts redraw itself, since hidden, not able draw properly. result jumbled in list (if click button again make visible). again if re-size window (the jumbled jcarousel not hidden now), redraws correctly. i tried getting ahold of jcarousel instance , reload button clicked make div visible (the way re-sizes when visible , window re-sized). to jcarousel, using: jquery('#mycarousel').data('jcarousel') and returned null. how can jcarousel draw correctly? what makes assume $().jcarousel() call .data() ? better stick api provided plugin anyway, rather guessing @ how works under hood. anyway, answer question... the problem that, when div hidden, has no height or width. use "off-left technique" rather hi...

mysql - Slow query log not logging queries from all databases -

i have dedicated server on have created 2 databases in mysql (there other databases mail, cpanel e.t.c.) one database live site while other development site. i have slow query log enabled , see logs queries live site. why that? may defined somewhere in configuration log queries live site , not development? how can check? thanks

programming languages - Simple IF statement question -

how can below if statements? if ( isset(var1) & isset(var2) ) { if ( (var1 != something1) || (var2 != something2) ) { // ... code ... } } seems condensed 1 if statement not if i'd use , or or boolean varsaresets = isset(var1) & isset(var2); // or other name indicates doing boolean somemeaningfulname = (var1 != something1) || (var2 != something2); // suggest meaningful name don't know accomplishing if ( varsaresets && somemeaningfulname ) { // ... code ... } this makes code readable , helps , whoever reads code understand these checks doing.

svn - How to convert local Subversion repo to hg hosted on bitbucket? -

i have asp.net , c# source code versioned using local debian linux machine on network using subversion. local path repo is: http://carbon.local/svn/main/websites/moodb i want move source code mercurial , have hosted on bitbucket.org. i've set account on bitbucket , want convert local svn hg , upload repo complete history bitbucket. bitbucket repo here: https://bitbucket.org/keymoo/moodb i've done googling , tried in temp working directory (running on windows 7 , have installed tortoisehg): hg convert http://carbon.local/svn/main/websites/moodb this creates .hg folder ran command source code has not been copied. i'm unsure how repo , history bitbucket. please help, want , running repo+history on bitbucket asap. your repository , source code have been copied. can think of .hg directory being repository, subversion server, except it's local. mercurial keeps copy of whole repository locally. reason can't see files because haven't checked out ...

c# - How to identify the name of selected TreeNode whether a namespace or a class? -

i making windows forms application. using treeview display namespaces. var namespaces = assembly.gettypes() .tolookup(ns => ns.namespace); foreach (var subnamespace in namespaces) { treenode assemblynode = multiselectmethodtree.nodes .add(subnamespace.key); } since there huge number of methods , classes in project, thought of displaying classes when user clicks expand('+') namespace, , display methods when class expanded. private void multiselectmethodtree_afterexpand(object sender, treevieweventargs e) { treenode expandednode = e.node; } in afterexpand event, not able identify whether namespace or class. you inherit treenode class create specific types each namespace, class, enum etc. example: public class namespacetreenode : treenode { /* may add suited properties. */ } and instead of creating treenode objec...

flex - How to keep track of objects for garbage collection -

may know proper way keep track of display objects created , hence allow me remove efficiently later, garbage collection. example: for(i=0; i<100; i++){ var dobj = new myclass(); //a sprite addchild(dobj); } from know, flash's garbage collection collect objects without strong references , event listeners attached it. since var dobj referenced new object created, have "nullify" too, correct? should create array keep track of objects created in loop such as: var objectlist:array = new array(); for(i=0; i<100; i++) { var dobj = new myclass(); //a sprite addchild(dobj); objectlist.push(dobj); } //remove children each (var key in objectlist) { removechild(key myclass); } does allow gc collect on sweep? var dobj local variable, after functions, reference gone. @ point, reference fact item on display list (ie, it's being displayed). no work needed garbage collected, need removechil...