Posts

Showing posts from February, 2013

XML Schema / Validation Query - Missing Elements -

if have xml schema dictates element has default value, , have xml file following schema omits element still valid? i.e. if element missing validator ok element missing take default value defined in schema , xml valid? so maybe like: <xs:element name="test" type="xs:boolean" default="false"/> then xml file misses out 'example' element together, valid? the reason ask because i've seen many schemas elements using attribute: minoccurs="0" infers if elements missing still validate. question validate if minoccurs not specified there default value specified instead? thanks. minoccurs , default refer 2 different concepts. question needs more context answered completely. minoccurs refers number of times element can occur child of another. default refers string value (sometimes typed - e.g. here boolean). use of default on element invalid . here default attributes (from w3schools) default attribute

c++ - SVG icons not showing up in Qt4 release build in windows -

i have qt4 application svg icons, compiled mingw (in windows), linked qt shared libraries. when application run, svg icons show in debug , release builds in linux, in windows svg icons show in debug build not in release build. all svg icons listed in project.qrc , , project.pro has resources = project.qrc . application uses qtsvg4.dll (version 4.7.0). qt 4.7.0, qt creator 2.0.1, mingw/g++ 4.4.0. solution update: in application directory, create /imageformats/ directory , put qsvg4.dll there instead of application directory itself, or create qt.conf file appropriate path. more information in deploying plugins . most have include plugins qt dir. involves making qt.conf file local app (see here: http://doc.qt.io/qt-4.8/qt-conf.html , more [paths] section), , copy c:\qt\4.x.x\plugins\imageformats*.dll distributable's directory.

generating compiled Tkinter python code -

i've noticed when creating gui using tkinter in python, when running final .py/.pyw file, i'm not presented .pyc file. i'd give application personal usage, without giving him full source code. there anyway of forcing interpreter generate pyc file, or other way nothing python bytecode without using py2exe or cxfreeze or similar things? try: import py_compile py_compile.compile(r'/path/to/your/file.py')

android - No properties tab in layout resource editor -

Image
recently uninstalled , reinstalled eclipse android sdk. don't see properties tab in layout resource editor. suggestions? update: see in "window > open perspective > other" window -> show view -> other -> general -> properties

prototype - Is there a way to use d:DesignData xaml at runtime? -

i building prototype of windows phone 7 app using d:designdata in sampledata folder. same design data appear @ runtime since prototype. there way set datacontext same data xaml designdata @ runtime? if included sample data file in project load @ runtime other xml file. need deserialize or parse though.

asp.net mvc - Overriding OnActionExecuted and Getting Weird IIS Responses -

so, i have mvc 2 site on iis 6 (wildcard application maps/aspnet_isapi.dll hack) want direct people different urls depending on preferred location, let's la.acme.com vs. nyc.acme.com. i not want end @ www.acme.com or acme.com. to accomplish doing following (i'll admit may not best way, why asking question): in base controller, doing following: protected override void initialize(system.web.routing.requestcontext requestcontext) { returnurl = requestcontext.httpcontext.request.url.pathandquery; baseurl = requestcontext.httpcontext.request.url.host; if (!requestcontext.httpcontext.request.url.isdefaultport) { baseurl += ":" + requestcontext.httpcontext.request.url.port; } viewdata["baseurl"] = baseurl; base.initialize(requestcontext); } protected override void onactionexecuted(actionexecutedcontext filtercontext) { var route = filtercontext.requestcontext.routeda

asp.net - automapper, Can I auto assign Guid to UserId of my UserDTO? -

i want assign guid userid of userdto if userid null. possible in createmap or creating formatter?. using automapper attribute on actions in controller. protected override void configure() { mapper.createmap<user, userdto>() .formember(d => d.fullname, o => o.mapfrom(s => s.firstname + " " + s.lastname)); } why not just: public class userdto { string _userid; public string userid { { if (_userid == null) _userid = new guid().tostring(); return _userid; } set { _userid = value; } } }

How to highlight text on focus in windows phone 7? -

how highlight text in textbox control in windows phone 7? can't find property setting on control. is handling onfocus event in code-behind option? you can highlight text using textbox.select(int start, int length).

login - iPhone App Logout -

i've app layout: when open app see login screen. log in , see tabbar 3 tabs. (the loginview displayed presentmodalview in appdelegate of tabbar). in third tab there logout button. want when logout button pressed app delete nsuserdefaults , shows loginview again. , if login again login screen disappear , see first tab of tabbar. how can this? thanks! do follows, 1)place login view in first view controller. 2)place tabbar controller in second view controller. 3)store second viewcontroller instance in appdelegate(this used navigation). 4)now when logout button pressed,use stored instance navigate ur view.

c - Use libfuse in a project, without root access (for installation)? FTP mounts & inotify/kqueue/FSEvents -

i'd application able show directory listing remote ftp (or sftp etc) location. when file/directory changes in remote directory tree, application should update view relevant changes. because traversing entire tree slow , wasteful, i'd use along lines of fsevents (inotify/kqueues on linux), these libraries filesystem-based, , connection ftp server not same mounted filesystem. in order make these libraries work, i'd need mount filesystem backed ftp/sftp on local machine, attach fseventstream (or kqueue etc) local mount. know fuse can this, there way can use fuse without user having first install it? mean, can bundle (mac) application , create mounts without having put user through process of running installer package copy libfuse , kernel modules system? assume /dev/fuse exists, or can live outside /dev/ path, inside application directory? nice mac applications installed simple drag & drop , i'd keep mine way if possible. i'm unclear on if it's

jquery mobile - Wrap text in list items/buttons instead of hiding the overflow -

i'm trying override default behavior of list items , buttons in jquery mobile, has text doesn't fit on 1 line hidden overflow. if view on skinny browser window or iphone you'll see mean: http://m.gizmag.com i'd able wrap text in h3 , p tags of each list item onto new lines. thanks in advance! try setting style of white-space:normal elements. i did anchor ( <a> ) element inside jquery mobile listview-styled li , , worked wrap text expected. used chrome's developer tools determine css attributes coming , interactively changed them make work way wanted. -- derek

ruby on rails - CSS templates recommenced for business web apps? -

a lot of css templates fixed-width, typically 9xx pixels wide... currently building intranet rails app , wonder there source of css templates business apps. requirements are: good both small (1024 x 768) , large (1920 x 1400) screens lots of tables in apps, maximize screen estate (no blank space @ left or right) two columns, fixed width (~160 pixel wide left column navigation, login) vertically, divided header, breadcrumb, content (2-column), footer basically we'd use whole screen displaying data. suggestions? thanks! i @ doing 960 fluid grid system, perfect each of requirements listed: http://www.designinfluences.com/fluid960gs/ there's oldie (but goodie) css layout gala: http://blog.html.it/layoutgala/ - has pretty layout configuration under sun, , not need change markup, include different css files. edit awh heck here's few more: iron myers: http://layouts.ironmyers.com/ design shack: http://designshack.co.uk/articles/free-css-layout-te

java - How to Pass Array from One Servlet to Another Servlet? -

i want pass multiple values 1 servlet 1 servlet. please tell me how pass that? depending if use sessions: store array in session variable using session.setattribute(); retrieve array using session.getattribute(); however variable stay until session dies, overwrite else, or remove it. if forward 1 servlet servlet, can store in request variable: request.setattribute() which can read after forwarding using request.getattribute() after calling requestdispatcher.forward() note not work if you're doing redirect instead of servlet forward.

c++ - compiling for other platforms -

is possible compile (under mac os x using netbeans) c++ code linux architectures? yes, it's possible. it's called cross-compiling. instructions how build , use cross-compiler go here .

javascript - How to get the inner html value -

var str_f = document.getelementbyid("" + j + "").innerhtml; <p> <span style="color: red">advertising cctv/bust</span> <span style="color: red">a</span>tion </p> how can value if want innerhtml of <p> tag give id , use following code <p id="para1"><span style="color: red"> advertising cctv/bust</span><span style="color: red">a</span>tion </p> document.getelementbyid("para1").innerhtml; if want text content inside element can use var elem = document.getelementbyid("para1"); var elementtext = x.innertext || x.textcontent

web services - EWS Managed API when using ExtendedPropertyDefinition displays property in header in lower case? -

exchangeservice service = new exchangeservice(exchangeversion.exchange2007_sp1); service.credentials = new webcredentials("hghgh", "hghg","yuu"); service.autodiscoverurl("rtrtrtrtrtrrrgrgfgfgg@a.com"); emailmessage message = new emailmessage(service); message.subject = "subject"; message.body = "body text comes here"; message.torecipients.add("jack@yahoo.com"); extendedpropertydefinition cuid = new extendedpropertydefinition(defaultextendedpropertyset.internetheaders, "cituid", mapipropertytype.string); message.setextendedproperty(cuid, "id-12345678"); message.sendandsavecopy(); result seen in header of message in ms outlook: ......... cituid:id-12345678 ----> property appearing header in ms outlook headers as know above have created extended property above appear header question : there way header can set display in upper case. there 3rd party p

streaming - How can I flash the latest messages given by users, among multiple users, using PHP, just like Twitter tweets works? -

how can flash latest messages given users, among multiple users, using php, twitter tweets? you need use ajax 1 , shown in common page. algo: send request server check if there updates in (for example) message_table. if there is, return newly added message. send none message if none , return step 1. you can try reading http://en.wikipedia.org/wiki/comet_(programming) optimized way this. or if not, can traditional ajax polling.

c++ - closed source library includes boost distribution -

i'm using closed source library (by activ financial) includes api boost distribution, both boost header files , boost library files. i use boost in existing codebase, , need use activ existing code. some points i can encapsulate use of activ entire activ part amounts single class wrote not expose of activ's headers this single header file not use boost anything in way can ensure activ parts of code use activ's boost hpp files, , code uses boost's hpp files my worry comes in linking. how can ensure activ dependent code links activ's boost, , other code links boost? i'm using g++ now, doing in vs2008. got working in vs2008 before, have no idea how linked. want try make sure it's done correctly. is there way without further encapsulating activ part in dynamic library? edit: for one, final product executable file. two, statically link boost myself. activ library includes both static , dynamic versions of boost object libraries, , plan sta

Prevent Chrome from caching a site's DNS records -

chrome caches dns records , tends ignore changes hosts file after has connected site (barring restart). dns pre-fetching enabled, more pronounced. are there page headers instruct chrome not cache site's dns? cache-control or response status 307 temporary redirect ? this real bug in google chrome. created http://crbug.com/65570 track it, please add additional information can think of bug we're sure understand problem correctly. it sounds though work-around besides closing chrome unplugging network cable , plugging in. when chrome sees such event, drops socket , dns cache. correct solution bug same when see /etc/hosts has changed. if you'd know when bug fixed, go http://crbug.com/65570 , click star next bug number. and, said, please add additional information can bug.

structure - Restructuring XML file -

i have client have drop down list added registration form lists of provinces in world country code. end, gave me this file . unfortunately, structure of data not work need do. below structure i'd have. there way automatically restructure data, perhaps using xslt or similar? thanks! <countries> <country code="us"> <region>alaska</region> <region>california</region> </country> </countries> this accomplished adding single template xslt identity transform: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" indent="yes"/> <xsl:template match="node() | @*"> <xsl:copy> <xsl:apply-templates select="node() | @*" /> </xsl:copy> </xsl:template> <xsl:template match="countries/*"> <country co

codeigniter - min_width and min_height for the upload class? -

is there min_width , min_height upload class? found patch upload class: http://codeigniter.com/forums/viewthread/143418/#730179 but isn’t working me… has tried it? any other solution out there? thanks i've got working. mistake, misspelling when changing upload class. patch works fine. thanks

c - mq_notify not notifying about an event (Linux programming) -

i'm using mq_notify notified events on message queue, registered notifier function not being called. did miss something? i'm pasting code snippet below: static void signotifier(union sigval sv) { printf ("i'm called.\n"); } int main() { mqd_t queueid = 0; message_t msg; int retval; struct mq_attr attr; struct sigevent sev; attr.mq_msgsize = msg_size; attr.mq_maxmsg = 30; errno = 0; queueid = mq_open(msg_queue_name, o_rdonly, 0666, &attr); if (queueid == -1) { printf ("message queue open failed: %d\n", errno); } sev.sigev_notify = sigev_thread; sev.sigev_notify_function = signotifier; sev.sigev_notify_attributes = null; sev.sigev_value.sival_ptr = &queueid; retval = mq_notify(queueid, &sev); if (retval < 0) { printf ("notification failed: %d\n", errno); } while (1); } because code copies man page ask: are sure sending me

caching - Apache Vhost Directives Optimized for Pagespeed -

i use setup in vhost: <location /> setoutputfilter deflate browsermatch ^mozilla/4 gzip-only-text/html browsermatch ^mozilla/4\.0[678] no-gzip browsermatch \bmsi[e] !no-gzip !gzip-only-text/html setenvifnocase request_uri \ \.(?:gif|jpe?g|png)$ no-gzip dont-vary header append vary user-agent env=!dont-vary </location> <directory /> expiresactive on expiresbytype text/html "access plus 5 minutes" expiresbytype text/css "access plus 1 month" expiresbytype application/x-javascript "access plus 1 month" expiresbytype application/javascript "access plus 1 month" expiresbytype text/javascript "access plus 1 month" expiresbytype image/gif "access plus 1 month" expiresbytype image/png "access plus 1 month" expiresbytype image/jpg "access plus 1 month" expiresbytype image/jpeg "access plus 1 month" expiresbytype image/x-icon "access plus 1 mo

.net - DCOM CoCreateInstanceEx failing -

im writing opc client. create instance of com server on remote server. @ first: setting on remote server right. tested 5 opc-example clients, , working fine. when use cocreateinstance code fails, access denied. think because of: coauthinfo coauthinfo = new coauthinfo(); coauthinfo.dwauthnsvc = 0; coauthinfo.dwauthzsvc = 0; coauthinfo.pwszserverprincname = intptr.zero; coauthinfo.dwauthnlevel = 0; coauthinfo.dwimpersonationlevel = 1; coauthinfo.pauthidentitydata = intptr.zero; coauthinfo.dwcapabilities = 0; which constants must write here, anonyoumus access. mean invoke dcom using guid of com server, , name of remote server?

python - dynamic modification of foreign keys sqlalchemy -

i'm creating structure of "elements" dynamically declarative, , i'm not sure if can modify mapper new elements related fk. sorry english, poor. def nuevoelemento(self,nombre_elemento,pos_jerarquia=0,elem_anterior_jerarquia=none): elemento = nombre_elemento.lower().strip() nombre_elemento = "elementos_" + elemento dicc = {'__tablename__':nombre_elemento} id = column(integer,primary_key=true) dicc.update({'id':id}) tipo = column(text) dicc.update({'tipo':tipo}) timestamp = column(text) dicc.update({'timestamp':timestamp}) eid = column(text) dicc.update({'eid':eid}) #baja = relationship();dicc.update({'baja':baja}) if pos_jerarquia > 0: ## no es raiz padre = column(text, foreignkey('elementos_' + elem_anterior_jerarquia + '.id')) dicc.update({'padre':padre}) sube = relationship('elementos_' + el

visual studio - Event handler in vs extensibility -

how can handle events such item added, renamed or deleted in project in visual studio extensibility? this article should have you're looking for: http://www.mztools.com/articles/2005/mz2005009.aspx

actionscript - loop through instances of movieclips flash -

i have bunch of movie clips on layer named s1, s2, s3, .. s16. i need add them array can select random number play. something like: var sparkle:array = new array(); var i:int = new int; for(i=0;i=16;i++) { sparkle[i] = 's'+i; } if know total number of movieclips, don't need store them in array. get random number first var random:int = math.round( math.random() * totalnumber ); then can use function return mc want private function getmovieclip(value:int ):movieclip { var mc:movieclip; for( var i:int ; < totalnumber ; ++i ) { if( this.getchildat(i).name == "s"+ random.tostring() ) { mc = this.getchildat( ) movieclip; break; } } return mc; }

.htaccess - Rewrite URL (Apache): Creating 301 redirects -

i restructured site, moving away querystring parameters friendly urls. url structure used use mysite.com/?site=www.somesite.com/ . using site parameter part of page's path, new url structure being mysite.com/site/www.somesite.com i cannot figure out proper rewrite rule .htaccess file redirect old url structure new put in .htaccess file: rewriteengine on rewritecond %{query_string} ^site=(.*)$ rewriterule .* /site/%1 [l,r=301] edit: in reply comment #3 change rewriterule to: rewriterule .* /site/%1? [l,r=301]

php - alternative to jpGraph -

this first time generating graphs using php. know of alternatives jpgraph? listed in no particular order, here's few charting libraries php chartdirector graphpite libchart pchart teechart

python - __init__.py seemingly not working -

new python. i'm on windows , python2.7. i have confirmed directory setup in pythonpath looking in sys.path idle. import sys print(sys.path) this shows me c:\users\owner\documents\pythonprojects in path. furthermore in directory have .py file can imported idle. the trouble c:\user\owner\documents\pythonprojects\testpackage\test.py not loading. error importerror:no module named testpackage.test. i have tried empty __init__.py __init__.py trivial code inside. __init__.py in pythonprojects folder should be. why getting error? because should in testpackage\ .

java - Future Proofing SQL table? -

i considering creating mysql data base non-mission critical project. thinking scenario when, in case had insert column in table, how can achieve without compromising data integrity of pre-existing columns specify default values of additional columns? i'd answer both sql , java persistence api (jpa). in addition, i'd know how add table within cell of parent table. the addition of column should have no effect on pre-existing data, unless links columns, such creating multi-column index, unique key, or similar. if there no such linkages between new & old columns, add many columns like. go crazy!

c# - Is it possible to share Objects between applications without serialization? -

is possible share objects between c# applications without serialization? i need 3 apps share instance of same object, object doesn't support serialization. the scope is: i'm developing apps create kind of interoperability between svn , tfs repositories. don't want connect tfs server on 3 apps (useless time consuming) since 1 of them set of small utilities, , don't want have slow loading. so thinking of using remotingservices.marshal, registering connection object temporarily in tcp channel, , calling object whenever need in other apps. but here's thing. many objects in teamfoundation.client aren't serializable, error when trying retrieve object. how can solve ? the direct alternative serialization remoting, also requires changes types, isn't going work. rather trying serialize tfs objects, write object model resembles tfs objects (or better: requests etc want perform), , send that . reconstruct needed. shallow dto layer on top of

c++ - Does this code work universaly, or is it just my system? -

#include <iostream> #include <fstream> #include <string> using namespace std; int main() { locale system(""); locale::global(system); wcin.imbue(system); wstring data; getline(wcin,data); wcout.imbue(system); wcout << data << l" length=" << data.length() << endl; locale utffile("en_us.utf-8"); wofstream file("my_utf_file.txt"); file.imbue(utffile); file << data; file << endl; file.close(); return 0; } it's system. locale names not part of c++ standard, "en_us.utf-8" not universally valid. it's not locale similar exists.

rest - Rails views: missing template after render called following failed validation with nested resources -

i'm trying work failed validations in rails 3. i have chapters resource, nested comments. there 1 view in total; show view chapters_controller, contains form post new comment , points comments_controller create action follows (controller code included): http://pastie.org/1338126 when fails validation, incorrectly routes to: '/chapters/1/comments' , displays following on page: template missing missing template http://localhost:3000/chapters/1 {:locale=>[:en, :en], :formats=>[:html], :handlers=>[:rhtml, :rxml, :builder, :erb, :rjs]} in view paths "/app/views", "", "/" cheers paul for in future, had similar problem. i trying render when validation failed address create action: render new_user_address_path(@user) #normally should work redirect_to or link_to render doesn't work way instead should: render 'new' as @ideaasylum mentioned, can't render "named helper" can render

unable to get parallel python (pp) running on python 2.7 -

i working on windows box 8 processors. have run python script mass data processing. when run such, script uses 1 processor. learnt that, harness power of multiple processors, can use parallel python (pp) library. i installed library on machine , followed instructions available @ http://www.parallelpython.com/content/view/15/30/#quicksmp however, code configure pp fails on machine: python 2.7.1 (r271:86832, nov 27 2010, 17:19:03) [msc v.1500 64 bit (amd64)] on win32 type "copyright", "credits" or "license()" more information. >>> import pp >>> job_server = pp.server() traceback (most recent call last): file "<pyshell#1>", line 1, in <module> job_server = pp.server() file "c:\python27\lib\site-packages\pp.py", line 343, in __init__ self.set_ncpus(ncpus) file "c:\python27\lib\site-packages\pp.py", line 503, in set_ncpus range(ncpus - len(self.__workers))]) file "c:

java - What does the accept() method of ASTNode do and how does it use the ASTVisitor? -

what accept method of astnode (the javadoc didn't much...) , when visit(expression node) method called? here example code of how need use it: final list<expression> listi = new arraylist<expression>(); string stringi = opi.generate(entrycontract, true_false_maybe); // stringi representes expression, example "g!=h". parser.setsource(stringi.tochararray()); unit = (compilationunit) parser.createast(null); astnode astroot = unit.getroot(); astroot.accept(new astvisitor() { public boolean visit(expression node) { listi.add(node); return true; } }); thank you i guess expression class subtype of astnode class, , astvisitor class present other visit methods (which surely empty), accepting argument other astnode subclasses. it's implementation of gof visitor design pattern (also described @ wikipedia ). the accept method on astnode invoke visit method on visitor implementation, passing parameter visit method.

java - What does this error means in JSP? (Unknown element (rtexpvalue) in attribute) -

i getting error when running application on line 3 of jsp file.is tld file or jsp file? org.apache.jasper.jasperexception: /displayallorders.jsp(3,62) pwc6106: unknown element (rtexpvalue) in attribute. the tld file: <?xml version="1.0" encoding="utf-8"?> <taglib version="2.0" xmlns="http://java.sun.com/xml/ns/j2ee" lns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/j2ee web-jsptaglibrary_2_0.xsd"> <tlib-version>1.0</tlib-version> <short-name>week07_portfolio</short-name> <uri>/web-inf/tlds/week07_portfolio</uri> <tag> <name>displayorders</name> <tag-class>tags.displayorders</tag-class> <body-content>jsp</body-content> <variable> <name-given>order</name-given> <variable-class>beans.order</variable-class> <declare>true<

formatting - C# convert int to string with padding zeros? -

in c# have integer value need convereted string needs add zeros before: for example: int = 1; when convert string needs become 0001 i need know syntax in c#. i.tostring().padleft(4, '0') - okay, doesn't cover cases i.tostring("0000"); - explicit form i.tostring("d4"); - short form format specifier

javascript - Including jquery.tools.js breaks other jquery functions -

i using jquery rating features , enlarge images on website. working until include: http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js . @ point mozilla error console says $('rating_div').rating(params ..) not function , same enlarge image one. if remove include, works again. if include normal jquery.js file after tools.js one, normal jquery works tools.js 1 doesn't. i have seen other people have had issues cannot find resolution. ideas? thanks. you're including jquery 1.4.2 again file you're including (which erases plugins, since re-defined jquery object), instead of this: http://cdn.jquerytools.org/1.2.5/jquery.tools.min.js use this: http://cdn.jquerytools.org/1.2.5/all/jquery.tools.min.js visit download page (at bottom) full list of cdn files , include.

ruby - Is require File.expand_path(..., __FILE__) the best practice? -

is require file.expand_path(..., __file__) best way require other files within project? in ruby 1.9.2 + require_relative more correct way it. require changed not include '.' directory security reasons. require_relative added provide local-file solution modules relative calling script's path. you can search here on stackoverflow , particularly in " what require_relative in ruby? ", , internets , find usage tricks , why-for messages explaining how came about.

Testing NHibernate with SQLite "No Such Table" - schema is generated -

i'm trying use in-memory sqlite database test data layer provided nhibernate. i've read load of blogs , articles getting setup i'm confused why isn't working. the problem - when run unit test error 'no such table: student'. articles i've read suggest because schema isn't getting generated, or, connection being closed between schemaexport , query. i've checked everywhere can think of , can't see how either of these scenarios occuring. my test output log looks this: open connection drop table if exists "student" drop table if exists "tutor" create table "student" ( id integer, name text, dob datetime, tutorid integer, primary key (id) ) create table "tutor" ( id integer, name text, primary key (id) ) nhibernate: insert "student" (name, dob, tutorid) values (@p0, @p1, @p2); select last_insert_rowid();@p0 = 'text1', @p1 = 01/12/2010 14:55:05, @p2

Is there any different between a Column-oriented DBMS and RDBMS when designing a database schema? -

is there different between these 2 kind of database? if yes, different? thank you. the question isn't answerable because "rdbms" , "column-oriented" refer different aspects of dbms , not mutually exclusive. a rdbms dbms implements relational model. a column-oriented dbms dbms uses columnar storage data. rdbms or else.

objective c - iOS 4 - Using blocks as a member of a class -

i hoping me understand syntax of blocks when used members of class. have code that's working fine: @class structure; typedef void (^structuredeletecallback)(structure *); @interface structurelistdelegate : nrfctabledelegate { structuredeletecallback _structuredeletecallback; } @property (nonatomic, copy) structuredeletecallback structuredeletecallback; @end this works, understand syntax of typedef statement; , whether or not it's required use typedef. what i've read says using typedef in situation recommended because makes code lot clearer; i've been unable compile @ when trying without typedef . understanding of typedef syntax basically: typedef [actual type] [new name type]; such as: typedef double cllocationdegrees; but syntax of typedef statement doesn't match this. questions are: how can syntax of typedef statement different other typedef statements / syntax i'm using mean compiler? is possible have block member of class wi

Is new C++ backward compatible -

i haven't coded in c++ years. discovered during years has changed quite dramatically. i'm not sure changes, that's discussion. i still have c++ code knocking around hard drive. if got out , tried compile nice new c++ compiler, latest version of g++, compile? without warnings (assuming compiled without warnings before)? i did mess around little vc++ 2010 , found things expected work not working, , got different messages depending on context when tried use null. in 1 part of code used null without warning. in general, yes backwards compatible. however, devil in details. find things conventions change, or specific libraries fall or out of use.

winforms - VB.NET Multiple Textboxes Validation -

could show guidance (am not asking homework) validating form multiple text boxes? user informed problematic field. the source of form: private sub btnnewuser_click(byval sender system.object, byval e system.eventargs) handles btnnewuser.click 'if txtemail.text.contains(" "c) or not(instr(txtemail.text, "@")) 'txtemail.clear() 'elseif txtpassword.text.contains(" "c) 'txtpassword.clear() 'elseif txtpin.text ''#uh aryuserrecord(0) = txtemail.text aryuserrecord(1) = txtpassword.text aryuserrecord(2) = txtpin.text ''#consists of letter 2 numbers addnewuser = join(aryuserdata, ",") ''#more source me.dialogresult = dialogresult.ok end sub you can use errorprovider mark problematic fields. you'll want hook validating event each textbox. this: private sub textbox1_validating(byval sender system.object, byval e system.componentmodel.cancelev

iphone - Best way to receive new messages in a IM style app -

at moment querying server every 3 seconds see if there new messages using nsurlrequest , such. if there saves them database , sends nsnotificationcenter notification if there aren't waits 3 seconds , tries again. is best way it? realise (form posts on here , information elsewhere) opening persistant connection server tedius , not reccommended, best way it? my main worry if there no new messages downloading empty (of information, still few bytes big) xml feed, , running every 3 seconds going add , use lot of data. any pointers appreciated. thanks xmpp long-living tcp connection. how using xmpp service?

c# - Build/Rebuild Project VS 2008 using DTE -

how can build , rebuild project csproj using dte.executecommand ? any reference of commands of dte ? for solution, use this: logica.buildtracking.iniciarbuildtrack(); proyecto.dte.executecommand("build.rebuildsolution", ""); while (!logica.buildtracking.buildfinalizado) { application.doevents(); //system.threading.thread.sleep(1000); } i try use this: // todo !!! proyecto.dte.executecommand("build.buildonlyproject", ""); but error: "command \"build.buildonlyproject\" not available." this should started //gets build obj var sb = proyecto.dte.solution.solutionbuild solutionbuild; //sets object build; still figuring out can done one... sb.solutionconfigurations.item(1).activate(); //optional arg if want wait build finish sb.build(true); i'm still pla

vhdl - Modelsim: how to setup 27 MHz clock -

i want setup 27 mhz clock signal in modelsim . setup clock right clicking signal -> clock -> setup period. example, 50 mhz clock -> 20 ns or used force statement. because 27 mhz clock special, not integer period, if setup clock appx value, having timing issues. so, how setup clock? your clocks asynchronous. will have "timing issues" - if 2 clock edges come close each other (as inevitably sometimes) of flops exhibit metastability. you need resynchronise 27 mhz domain signals 50 mhz domain, accept , mitigate fact synchronisation wrong. there techniques reduce value of "occasionally" small value think appropriate system, you'll never rid of it. see fpga-faq 0017, tell me metastability .

html - How to hook a keyboard event handler onto an INPUT element with jQuery? -

Image
i want attach own key event handler input has event handler attached onkeydown . essentially, want receive key event before other handlers , check if user pressed key -- if yes, want perform functions , discard event, if no, want pass along other handler(s). how can jquery? if loading 3rd party script or jquery addon can load script or function first. if can use without mess of unbinding , rebinding event handlers. // possible interceptor code $("#awesome").keydown(function(e) { if (e.keycode < 70) { e.stopimmediatepropagation(); console.log("blocked!!!"); }; }); // possible 3rd party event code loaded after code $("#awesome").keydown(function(e) { console.log("3rd party:"+e.keycode); }); example webpage => http://mikegrace.s3.amazonaws.com/forums/stack-overflow/example-key-event-interception.html example output of firebug console jquery stopimmediatepropagation() documentation

asp.net - Check if file/image is being loaded from cache? -

could recommend tools able see external files / images being loaded from. mean i'm aware external js files / images cached on first load of page. i'd have tool confirms me on subsequent requests these files in fact being loaded users cache rather downloading file again. apologies, if has been answered elsewhere, have tried search no luck. thanks david if using firefox browser, find firebug useful resource helping things, , many others.

php - Array elements not showing? -

i trying print [0] element of array. code below creates array output says 'array' $this->db->select('company_name'); $query = $this->db->get('companies'); $query = $query->result_array(); echo $query['company_name']; what trying echo array itself. if try echo array, php not show contents. when results database, typically 2 dimensional array, is, array data more arrays. if echo data in top-most array's index 1, trying echo array, since located in first array. in order contents, need use 2 indexes; 1 index of array, , 1 index of data in array: <?php $my_array = array(array(8, 2, 4), array(7, 12, 32), array(62, 2, 1)); echo $my_array[1][1] // echos 12 echo $my_array[1] // echos "array" because data @ index 1 array ?> or maybe want see contents of array. if so, print_r() function friend. recursive , lets see contents of arrays inside of arrays: <?php $my_array = array(array(8, 2,

ipad - adding UITabBarItems to the UITabBar -

i hope can explane me how this: i have tabbar , 2 tabbaritems, how can attatch items tabbar. not doing via ib because tabbar fits have of screen because items should on left side. thats how build them: tabbarcontroller = [[uitabbarcontroller alloc] initwithnibname:nil bundle:nil]; tabbarcontroller2 = [[uitabbarcontroller alloc] initwithnibname:nil bundle:nil]; tabbarcontroller.tabbar.frame = cgrectmake(0, 974, 384, 50); tabbarcontroller2.tabbar.frame = cgrectmake(384, 974, 384, 50); uitabbaritem *tbi1 = [[uitabbaritem alloc] initwithtabbarsystemitem:uitabbarsystemitemmostviewed tag:0]; uitabbaritem *tbi2 = [[uitabbaritem alloc] initwithtabbarsystemitem:uitabbarsystemitemmostviewed tag:1]; you don't set tab bar items directly in tab bar. instead, assign tab bar item tabbaritem property each view controller contained tab bar controller. when add view controllers tab bar controller, tab bar controller manage display of tab bar items you. uitabbarcontrolle

visual studio 2008 - WM_DEVICECHANGE Messages Are Not Sent to WndProc - C++ -

my application creates window purpose of handling wm_devicechange windows message. wndproc called several times, until application calls function poll keyboard events, whatever reason not called when remove or insert usb device. this guid usb device. i'm sure it's correct: static const guid _guidforcp210xdevices = { 0xa2a39220, 0x39f4, 0x4b88, 0xae, 0xcb, 0x3d, 0x86, 0xa3, 0x5d, 0xc7, 0x48 }; this how window created: m_hinstance = ::getmodulehandle( null ); if ( m_hinstance == null ) { trace(_t("cnotifywindow::cnotifywindow : failed retrieve module handle.\r\n\terror: %d\r\n\tfile: %s\r\n\tline: %d\r\n"), ::getlasterror(), __wfile__, __line__); throw(::getlasterror()); } m_wcx.cbsize = sizeof(wndclassex); // size of structure m_wcx.style = cs_hredraw | cs_vredraw; // minimized m_wcx.lpfnwndproc = &wndproc; // points window procedure m_wcx.cbclsextra = 0; // no class memory m_wcx.cbwndextra = 0; // no

regex - PHP - preg_match - assign arbitrary value to a matched element -

assuming have regex: preg_match('/\b(xbox|xbox360|360|pc|ps3|wii)\b/i' , $string, $matches); now, whenever regex match ex. one of 3 xbox methods (xbox|xbox360|360) , $matches , should return xbox is possible continuing work in preg_match() context or should use other method? thank's in advance. edited: im doing this: $x = array('xbox360','xbox','360'); if( preg_match('/\b(xbox360|xbox|360|pc|ps3)\b/i', $s, $m ) ) { $t = $m[0]; } if ( in_array($t,$x) ) { $t = 'xbox'; } i'm wondering if there way! your current code looks ok me, if want bit fancier, can try named subpatterns preg_match('/\b((?p<xbox>xbox|xbox360|360)|pc|ps3|wii)\b/i' , $string, $matches); $t = isset($matches['xbox']) ? 'xbox' : $matches[0]; or preg_replac'ing things before matching: $string = preg_replace('~\b(xbox|xbox360|360)\b~', 'xbox', $string); preg_match('/\b(xbox|pc|

Android: crash on drawPicture() call? -

i have application displays series of custom views in linearlayout. linearlayout in scrollview. custom views draw picture, when ondraw method called. works fine. application crashes on drawpicture() call. when crashes, no exception seems thrown, message in logcat: "wrote stack trace 'data/anr/traces.txt'". the contents of traces.txt below: dalvik threads: "main" prio=5 tid=3 native | group="main" scount=1 dscount=0 s=n obj=0x2aac2250 self=0x84d00 | systid=412 nice=0 sched=0/0 cgrp=unknown handle=2130112448 @ android.graphics.canvas.native_drawpicture(native method) @ android.graphics.canvas.drawpicture(canvas.java:1404) @ com.myview.ondraw(pdfpageview.java:100) @ android.view.view.draw(view.java:6534) @ android.view.viewgroup.drawchild(viewgroup.java:1531) @ android.view.viewgroup.dispatchdraw(viewgroup.java:1258) @ android.view.view.draw(view.java:6537) @ android.view.viewgroup.drawchild(viewgroup.java:1531) @ an

css - Internet Explorer showing list vertically when it should be displayed horizontally -

i've got list of 3 buttons need display horizontally. all's in ff ie stacking them directly on top of 1 another. code list items bellow. thanks help <style type="text/css"> #navigation { list-style: none; margin: 0px 0px 0px 278px; padding: 0; text-align:left; z-index:1; } #navigation li { display: inline-block; } #navigation { display: block; width: 140px; height: 15px; background: url("http://aracelid.110mb.com/boton_rollout_08.png") no-repeat; padding: 10px 0.5em; color: #ffffff; text-decoration: none; font-size:12px; text-align: center; } #navigation a:hover { background: url("http://aracelid.110mb.com/boton_rollover_08.png") no-repeat; } #one, #two,#three {background: url("http://aracelid.110mb.com/boton_rollout_08.png") no-repeat 0p

editor - VS 2008 Intellisense missing: the key combination is bound to command which is not currently available -

intellisense has stopped working aspx files, , i've looked @ other questions address issue no solution. when try format aspx document (ctrl-k, ctrl-d) status bar says "the key combination bound command (format document) not available." the outlining no longer showing up. i have tried /resetsettings flag. i'm not using resharper. i've verified settings (tools -> options, text editor) both c#, basic, , html general. how can back? i managed fix switching design mode , clicking on source. strangely, had right-click select design view, since design/split/source options @ bottom of window not present. once switched design view, buttons came back, , when switched source view seems work again. strange.

.net - Capture single row in a datagridview -

i have .net windows app. i have datagridview has few rows in it. had added column containing buttons allow user edit row. pops new form/dialog - edit form. // add cellclick handler handle clicks in button column. dgv.cellclick += new datagridviewcelleventhandler(dgv_cellclick); the code fires is: private void dgv_cellclick(object sender, datagridviewcelleventargs e) { if (e.columnindex == buttoncell) { // id number int number = convert.toint32(dgv.rows[e.rowindex].cells[0].value); editform edit = new editform(number); edit.showdialog(); } } problem my edit form displays (correctly). make changes, , close form. loads again! same number of rows in grid. ie. fires code above once each row in datagrid. how can prevent this? there more elegant solution? i make sure you're not registering cellclick event more once. i.e., you're not calling code more once (like each time add row dgv):

xslt - How can I copy an XML structure into another one except some attributes or nodes -

with xml structure below: <root foo1="bar1" foo2="bar2" foo3="bar3"> <foo1 foo1="bar1" /> <data> <foo1>bar1</foo1> <foo2>bar2</foo2> <foo3>bar3</foo3> </data> </root> i copy xml structure 1 exception on attributes and/or node() names , following result using xslt 1.0: <root foo1="bar1" foo2="bar2"> <data> <foo1>bar1</foo1> <foo3>bar3</foo3> </data> </root> my rules are: 1) copy every root attributes except foo3 2) copy every child nodes() unless ones named foo1 , foo2 my actual xsl stylesheet. managed root attributes restriction working : <xsl:template match="root"> <root> <xsl:for-each select="./@*"> <xsl:variable name="name" select="name()" />

gnu make - Dependencies in Makefiles -

suppose have makefile: all: $(binary) $(binary): $(objs) $(debug_objs) #link objects here $(objs): headers #compile code objects without debug option $(debug_objs): headers #compile code objects debug option headers: #create on-the-fly header files as can see, target headers required both $(objs) , $(debug_objs) . question is, headers called twice? also, below code equal/equivalent above: all: $(binary) $(binary): headers $(objs) $(debug_objs) #link objects here $(objs): #compile code objects without debug option $(debug_objs): #compile code objects debug option headers: #create on-the-fly header files in that, headers called before $(objs) , $(debug_objs) $(binary) ? no, headers done once. you can write simple makefile test it: all: foo bar foo: baz bar: baz baz: echo 'hi' on doing make , hi echoed once. and in 2nd case make sees $(binary) depends on headers first, goes , headers before

flash - Streaming and Recording Protocol -

what open source, well-documented audio (video not required) streaming (from server) protocol supports recording (to server), should use new application? rtmp not option this protocol must have client library ac3/ac2 thanks. why not use shoutcast ? sounds work perfect application. as far recording stream goes, can use streamripper , or wget. no special client library necessary, compatible http. thing have worry client keeping audio buffer around after has been played, there many solutions that, as3.

c# - Change Code Behaviour depending on Context -

i have class can called either gui or form non-graphical environment (batch mode) what convenient best practice way "tell" gui-related parts of code not execute when executed in batch mode. i think of like public mymethod() { [@tag: dothis_only_if_guimode] showpanels(); .... } and gui_mode_activated set true or false on runtime somewhere, depending on program called from i want avoid ugly tracing if/else stuff scattered on code. little thumb tells me aop way go (but if manage find simpler alternative i'll go it) so, simplest , straightforward way ? update: as contributors pointed out, separating gui code business code rule of thumb, still interested in knowing ways if no gui involved (ie, 2 different batch modes 2 different environments, example) i think best bet take gui-specific code out of class , implement events triggered @ key times in class's processing. when called gui, gui code subs