Posts

Showing posts from July, 2011

parsing - Looking For A Packet Description Language (Preferably With A C# Implementation) -

i in process of developing special-purpose network tool packet sniffing , decoding capabilities. looking languages designed assist in dissection/decoding of arbitrary packet formats. idealy, solution should based on open standards. there related questions on so, deal full lifecycle of packet sniffing (i don't care capture, there other libraries well). in general, i'm looking language , supporting framework declaritive definition of packet formats , corresponding run-time decoding. because problem can generalized non-network binary data, solution arbitrary binary streams in scope. little surprised no such standard exists in mature , robust state (at least find) - though there seem lot of interesting not-quite-right , almost-there projects (see below). perhaps speaks difficulty of problem, or maybe lack of demand. by way of example, i'm interested in technologies , ideas similar following (in no particular order): packet.net - job of converting binary packet repre...

Qt Stylesheet mystery -

my desktop qt app has large stylesheet applied. it's applied qapplication derived class using: this->applystylesheet(":/qss/default.qss"); it works qwidget objects define , use. (using *.ui files). my problem begins when promote 1 of qwidgets in *.ui file i'm using 1 of own qwidget derived classes. when widget qwidget, the following worked , changed background image: qwidget#mywidget { background: transparent; background-image: url(:/images/bg_img.png); background-repeat: repeat-x; } when promoted element custom qwidget derived class , changed to: qmyderivedclass#mywidget { background: transparent; background-image: url(:/images/bg_img.png); background-repeat: repeat-x; } i no longer see background image. missing something. it... hope 1 of knows. my bad. posting people similar problem can find solution: i did not add "paintevent" custom class. (which in case draws nothing enables stylesheet adherence...

ruby on rails - CarrierWave Image URL -

i have model has: mount_uploader :image, imageuploader when uploading image want retrieve width, height , exif data image. in before filter calling self.image.url return like: /uploads/tmp/20110630-1316-10507-7899/emerica_wildinthestreets.jpg the problem when try open image using: image = minimagick::image.open(self.image.url) i "no such file or directory - /uploads/tmp/20110630-1312-10507-6638/emerica_wildinthestreets.jpg" . seems image has been moved tmp folder it's final location self.image.url not reflecting change. i've tried in after_save method result same. ideas? turns out needed append "#{rails.root.to_s}/public/" self.image.url

java - openFileOutput not working properly inside a singleton class - ideas/workarounds? -

as novice android developer, i've faced bit strange problem. want create class, methods other classes-activities-whatever use working files in special way. let`s simplicity logging stuff. if following within activity (in onclick listener example), works fine: fileoutputstream fout = openfileoutput("somefile", mode_private); outputstreamwriter osw = new outputstreamwriter(fout); osw.write("very important foobar"); osw.flush(); osw.close(); but when try enclose class , create singleton that: public class logger extends baseactivity { //baseactivity "init" class extends activity public static final logger instance = new logger(); private logger() { // singleton } public boolean dolog (string whattolog) { try { fileoutputstream fout = openfileoutput("somefile", mode_private); outputstreamwriter osw = new outputstreamwriter(fout); osw.write(whattolog); osw.flush(); osw.close(); } catch (ioexception ioe) { ioe.printstack...

PHP 2 dim Array to 1 dim array -

is there built in function following? $a[] = $b[0]['foo']; $a[] = $b[1]['foo']; $a[] = $b[2]['foo']; etc.. i realize can following: foreach($b $c) { $a[] = $c['foo']; } but curious if there built in array function this. thanks. in short: no. in long: maybe ;) because not "directly built-in" with php5.3 $a = array_map (function ($entry) { return $entry['foo']; }, $b); or before $a = array_map (create_function ('$entry', 'return $entry[\'foo\'];'), $b); at least second solution prefer foreach -loop ;)

How to use the "translate" Xpath function on a node-set -

i have xml document contains items dashes i'd strip e.g. <xmldoc> <items> <item>a-b-c</item> <item>c-d-e</item> <items> </xmldoc> i know can find-replace single item using xpath /xmldoc/items/item[1]/translate(text(),'-','') which return "abc" however, how do entire set? this doesn't work /xmldoc/items/item/translate(text(),'-','') nor translate(/xmldoc/items/item/text(),'-','') is there way @ achieve that? i know can find-replace single item using xpath /xmldoc/items/item[1]/translate(text(),'-','') which return "abc" however, how do entire set? this cannot done single xpath 1.0 expression . use following xpath 2.0 expression produce sequence of strings, each being result of application of translate() function on string value of corresponding node: /xmldoc/...

perl - What if the run time gets dwarfed by the compile time? -

there may situations compilation process takes more time program's run time. should 1 in circumstances? if consider cgi scripts may called hundreds or thousands of times every minute above problem may occur. how avoid these problems? can't skip compilation process. how deal such situations? if looking @ perl-based cgi scripts, consider using mod_perl or fastcgi , address exact issue (among others). a more generic way of doing same thing build sort of "server" application loads once , listen client connections. clients can small lightweight processes connect server , ask server perform whatever work needed.

How to resize multidimensional (2D) array in C#? -

i tried following returns screwed array. t[,] resizearray<t>(t[,] original, int rows, int cols) { var newarray = new t[rows,cols]; array.copy(original, newarray, original.length); return newarray; } most methods in array class work one-dimensional arrays, have perform copy manually: t[,] resizearray<t>(t[,] original, int rows, int cols) { var newarray = new t[rows,cols]; int minrows = math.min(rows, original.getlength(0)); int mincols = math.min(cols, original.getlength(1)); for(int = 0; < minrows; i++) for(int j = 0; j < mincols; j++) newarray[i, j] = original[i, j]; return newarray; } to understand why doesn't work array.copy , need consider layout of multidimensional array in memory. array items not really stored bidimensional array, they're stored contiguously, row after row. array: { { 1, 2, 3 }, { 4, 5, 6 } } is arranged in memory that: { 1, 2, 3, 4, 5, 6...

iphone - Multiple Methods named '-setTransform:' found -

-(void)rotateview:(id)sender { cgaffinetransform rotatetransform = cgaffinetransformrotate(cgaffinetransformidentity, m_pi); [sender settransform:rotatetransform];//the error shown here } i getting caution error shows , says multiple methods named -settransform: found. shows when have #import avfoundation/avfoundation.h in header file. suggestions? thanks cast sender proper class type , warning should go away: [(yourclasshere *)sender settransform:rotatetransform]; as sender passed rotateview: type id xcode cannot know actual class type , method call. edit: coincidentally today matt gallagher of cocoa love fame published article kinds of issues caused calling ambiguous method on id in objective-c.

java - Offline database in Android -

there must better way manage string values have bunch of strings in strings.xml file. i looking database solution, don`t want connect database on internet. need advanced sorting , categorising done all. i not experienced java pardon me if lack knowledge. edit: nice synchronize both database on internet , on user`s smartphone. maybe effect of synchronization can achieved adding additional databases , sending out modified data. you can use sqlite database app. see http://developer.android.com/guide/topics/data/data-storage.html#db

html - Freeze header and footer but with vertical both scroll bars on content visible always -

i have need display large amount of data in small space. have header , footer column names , data in "content" div. "freeze" header , footer allow horizontal scrolling of entire table keep vertical scroll bars of content div visible @ times, despite horizontal scroll position on wrapper. is possible? need dig jquery accomplish this? html: <div id="wrapper"> <div id="header">header</div> <div id="content"> <div id="row">row</div> <div id="alt">alt</div> <div id="row">row</div> <div id="alt">alt</div> <div id="row">row</div> <div id="alt">alt</div> <div id="row">row</div> <div id="alt">alt</div> <div id="row">row</div> <d...

compiler construction - How to program to old game consoles? -

i want know how program old game consoles fun. can use programming language such c? have use assembly? not know console compiler, assembler or api. need compile rom image , test emulators, because not own console. each console has interesting features , play them. atari 2600 (only 128 bytes of ram) nes (only 8-bit) snes (a console, 16-bit) ps1 (3d, complex) game boy (simple, monochromatic) older systems atari, nes, , gameboy typically programmed in assembly or c. there variety of development tools gameboy i've played around such as: rednex gameboy development (asm): http://www.otakunozoku.com/rednex-gameboy-development-system/ gbdk (c): http://gbdk.sourceforge.net/ and while there lot of dead links on it, page has lot of information , links on gameboy development in general: http://www.devrs.com/gb/ for nes there 2 assembly tutorials know of. second tutorial linked first claim superior can't comment second link didn't exist last time intere...

tcl - Why does "exec" gives "child exited abnormally" in this code? -

i running code in tcl:- set version [exec grep "internal version:" mojave.log | sed -n -e "s/internal version: //g" > xor.diff] set p [exec diff ../log.warning.diff ../log.warning.gold >> xor.diff ] for last line gives following error after doing diff:- > rule-311 warning: gdsii layer number 85 datatype 0 has been defined > tcl-11 warning: command "check quartz drc" overridden, quality of > tcl-11 warning: command "delete marker quartz" overridden, quality of > tcl-11 warning: command "import marker quartz" overridden, quality of > tcl-11 warning: command "mojave! run filter log" overridden, quality of > tcl-11 warning: command "run quartz gui" overridden, quality of results > tcl-11 warning: command "ui! mojave draw rectangle" overridden, quality > tcl-11 warning: command "ui! mojave set_context" overridden, quality of > tcl-12 warnin...

iphone - UIPIckerView in UIPopoverController -

i'm not trying resize pickerview's height. i'm fine having default size, believe 320 x 216. created code present pickerview in popovercontroller, however, these messages on console: 2 011-06-30 13:18:28.125 migenome[64357:207] -[uipickerview setframe:]: invalid height value 1024.0 pinned 216.0 2011-06-30 13:18:28.126 migenome[64357:207] -[uipickerview setframe:]: invalid height value 448.0 pinned 216.0 2011-06-30 13:18:28.127 migenome[64357:207] -[uipickerview setframe:]: invalid height value -16.0 pinned 162.0 i don't know why since i'm trying use picker default size in popover. here's code. thanks. - (ibaction)presentsortpopover { uiviewcontroller *sortviewcontroller = [[uiviewcontroller alloc] init]; uipickerview *sortpickerview = [[uipickerview alloc] initwithframe:cgrectmake(0, 0, sortviewcontroller.view.bounds.size.width, sortviewcontroller.view.bounds.size.height)]; sortviewcontroller.view = sortpickerview; sortviewcontr...

javascript - Algorithm/Tool to convert pMathML to cMathML? -

does 1 know of known algorithm and/or open source project converts presentation mathml content mathml? javascript preferable if there open source project. other language appreciated too. if not, have suggestion on how approach problem? thanks, first, may know this, not possible reliably convert presentation mathml content mathml. better start , edit in content mathml because can reliably convert presentation mathml whenever want. the power math packages, mathematica, can conversion presentation mathml content mathml... have guess in cases @ meaning. for open source solution, i'd lookup "computer algebra system"... there several ones out there... perhaps can it, indirectly. the last option embed 1 of editors... example, integre , mathtype both support both presentation , content mathml... so, perhaps 1 can make conversion.

java - Returning a list of audio filetypes -

Image
in answering question: i want make java program in there combobox displays titles of files available in folder another method of implementing answer brought attention; usage of audiosystem.getaudiofiletypes() return supported audio files in specified folder. inexperienced coder , unable integrate method in given answer file somefolder = new file("pathname"); object[] wavfiles = somefolder.listfiles(wavextensionfilenamefilter); jcombobox songcombobox = new jcombobox(wavfiles); can show me how done? the following source show jfilechooser specific file types understood java sound. once user selects sound clip, app. listing of clips in directory , display them in combo. on selecting clip combo., play sound in javax.sound.sample.clip (or other ways using java sound api), instead opt. 1.6+ 'one-liner' of using desktop open file (in system default player). import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.file...

MySQL performance with GROUP BY and JOIN -

after spending lot of time variants question i'm wondering if can me optimize query or indexes. i have 3 temp tables ref1, ref2, ref3 defined below, ref1 , ref2 each having 6000 rows , ref3 3 rows: create temporary table ref1 ( id int not null auto_increment, val int, primary key (id) ) engine = memory; the slow query against table so, 1m rows: create table t1 ( d datetime not null, id1 int not null, id2 int not null, id3 int not null, x int null, primary key (id1, d, id2, id3) ) engine = innodb; the query in question: select id1, sum(x) t1 inner join ref1 on ref1.id = t1.id1 inner join ref2 on ref2.id = t1.id2 inner join ref3 on ref3.id = t1.id3 d between '2011-03-01' , '2011-04-01' group id1; the temp tables used filter result set down items user looking for. explain +----+-------------+-------+--------+---------------+---------+---------+------------------+------+---------------------------------+ | id | select_...

css - chrome - editable divs - line breaks in the middle of words? -

i using content editable divs , have overflow set hidden. in firefox div's correctly displayed , if word longer div rest hidden , no line break occurs. chrome inserting line breaks in middle of words longer div. way fix this? it sounds chrome has 'word-wrap: break-word' style on default. in div, try resetting worp-wrap normal , see if fixes it: <div style="word-wrap: normal;">..</div>

python poplib get attachment -

i trying access pop3 email server. polling messages , downloading attachments each 1 of them. can login , messages cannot figure out how attachment, need parse later. i'm thinking save tmp dir until process it. here's got far: pop = poplib.pop3_ssl(server) pop.user(usr) pop.pass_(pwd) f = open(file_dir, 'w') num_msgs = len(pop.list()[1]) msg_list in range(num_msgs): msg in pop.retr(msg_list+1)[1]: mail = email.message_from_string(msg) part in mail.walk(): f.write(part.get_payload(decode=true)) f.close() this code pieced examples found online no solid example of getting attachment. file i'm writing empty. missing here? in advance. i know old question, in case: value you're passing email.message_from_string list of contents of email, each element line. need join string representation of email: mail = email.message_from_string("".join(msg))

javascript - Simple real time WYSYWIG editor for text box in Jquery -

i know not strictly programming question, think best website ask anyway, please dont down vote me:) anyway, trying create simple textbox editor allows change font colour , size. should visible in real time. far have created div updated in real time in jquery dont know best way rest. there out there can me. prefer not use of advanced wysiwyg editors because implementation difficult. or sensible solution? advice please? var div = $('#mydiv')[0]; $('input').bind('keyup change', function() { div.innerhtml = this.value; }); <form>text here:<input></form> this not you're looking wanted show jsfiddle made quickly i hope gives idea of looking for. <div id="mydiv"></div> <select id="color"> <option></option> <option>red</option> <option>blue</option> </select> <select id="size"> <option></option> ...

mainframe - JCL job depency without scheduler -

i'm trying implement jcl, in jes2 environment, launches set of jobs dependencies in it, example: job_a -> job_b ) job_c -> job_d ) -> job_e in other words, job_e launched when job_b , job_d finished. i can launch job_b , job_d through job internal reader in job_a , job_c can't not create dependencies job_e. i tried explore jcl resource lock lock data set in job_b , job_d job_e needed job_e start when data set's available jcl requests data set in step level , release them afterwards. if jcl request data set before start implement sort of mutex in jobs, example: job_a locks data set dsn_a job_b waits data set dsn_a job_c locks data set dsn_c job_d waits data set dsn_c job_e waits data set dsn_a , dsn_c any ideas , how this? i need test set of jcl's in development environment without access scheduler. i'm wondering why invest precious time test set of jobs, prod set entirely different , handled xyz scheduler. don't mi...

eclipse - EclipseCORBA without compilation? -

i using eclipsecorba, syntax highlighting. i'm wondering if there way turn off idl compiler. reason being doesn't bring valid errors in idl files. alternative eclipse plugins eclipsecorba syntax highlighting idl files (ideally 1 formatter :> ) welcome. :) i don't have solution this, if have ebnf grammar idl - shouldn't difficult find - xtext "easy" way create editor. formatter little work, but...

ios - iPhone / Three20: Adding a dynamic list of labels to a tablecell as a subview -

i'm writing iphone app using three20 framework , i'm struggling figure out how can add dynamic list of uilabel s table cell. i've attempted subclass tttabletextitem , tttabletextitemcell in order display dynamic list, i'm having hard time trying write layoutsubviews , setobject , initwithstyle methods. i've read subclassing here , here , whilst can replicate these simple examples table cells have static number of controls, i've still not had luck attempting recreate number of controls dynamic based on data passed table cell. the data i'm pulling list of employee s, , each employee has nsarray of 1 or more job s (so cell height needs dynamic, list of labels represent jobs). each job has name, , colour associated it. my intention create cells similar following: cell one "employee one" "job-1 colour label" "job-1 name label" "job-2 colour label" "job-2 name label" .... "job...

python - Querying a many-to-many relationship in SQLAlchemy -

i have pretty standard many-to-many relationship, similar blog -> keyword relationship in orm tutorial. i query list of keywords, returning blog posts of them match. however, can't work out if there simple way this. if add multiple filters, repeatedly doing .filter(blog.keywords.any(keyword.name == 'keyword')) then 'and'/'exists' query, such posts have keywords returned. there simple way 'or' query, or need work using join(). thanks help; can't work out whether missing something. i think want .filter(blog.keywords.any(keyword.name.in_(['keyword1', 'keyword2', ...]))) i'm using http://www.sqlalchemy.org/docs/05/ormtutorial.html#common-filter-operators reference

sql server - Why is a T-SQL variable comparison slower than GETDATE() function-based comparison? -

i have t-sql statement running against table many rows. seeing strange behavior. comparing datetime column against precalculated value slower comparing each row against calculation based on getdate() function. the following sql takes 8 secs: set transaction isolation level read uncommitted go declare @timezoneoffset int = -(datepart("hh", getutcdate() - getdate())) declare @lowertime datetime = dateadd("hh", abs(@timezoneoffset), convert(varchar, getdate(), 101) + ' 17:00:00') select top 200 id, eventdate, message events (nolock) eventdate > @lowertime go this alternate strangely returns instantly: set transaction isolation level read uncommitted go select top 200 id, eventdate, message events (nolock) eventdate > getdate()-1 go why second query faster? edited: updated sql accurately reflect other settings using after doing lot of reading , researching, i've discovered issue here parameter sniffing. sql server attempts ...

Overriding the hardware buttons on Android -

is possible override function of hardware button programmically on droid? specifically, i'd able override camera button on phone programmically. possible? how handle camera button events as camera button pressed broadcast message sent applications listening it. need make use of broadcast receivers , abortbroadcast() function. 1) create class extends broadcastreceiver , implement onreceive method. the code inside onreceive method run whenever broadcast message received. in case have written program start activity called myapp. whenever hardware camera button clicked default camera application launched system. may create conflict , block activity. e.g if creating own camera application may fail launch because default camera application using resources. there might other applications listening same broadcast. prevent call function "abortbroadcast()", this tell other programs responding broadcast . public class hdc extends broadcastreceiver { @overr...

c - Pointer to char array -

int main( ){ char a[2]; char *p; p=&a[0]; *(p+5)='g'; } in above program defined pointer pointing char array array 3 bytes only. let me tell more clearly,for instance let assume char array address 1000 takes upto 1003 bytes, using pointer storing ascii value of 'g' @ 1005 location. okay compiler ? memory static alloacted 1 ? or can used again ? value permanently stored in or no? you changing random memory location in program. undefined behavior , have random effects on program such segmentation fault.

ios - Is it possible to have two Table Views in one XIB? -

Image
i need have 2 table views in 1 xib file, there way that? another cleaner way add 2 different uitableviewcontroller xib , set different classes. your xib should this. instead of connecting table view datasource , delegates file's owner, connect own controllers. this way, code clean , easy maintain. later on if want move table different view, it's easy , can done changing ib.

c# - WatiN ie9 confirm dialog is not working -

possible duplicate: watin & ie9 - cant click ok buttons var dialoghandler = new watin.core.dialoghandlers.confirmdialoghandler(); using (new watin.core.dialoghandlers.usedialogonce(browser.dialogwatcher, dialoghandler)) { browser.button(find.byid("btnsave")).clicknowait(); dialoghandler.waituntilexists(); } it's not working on ie 9, javascript confirm use latest version 2.1 confirmdialoghandler confirmhandler = new confirmdialoghandler(); using (new usedialogonce(browser.dialogwatcher, confirmhandler)) { confirmhandler.waituntilexists(); confirmhandler.cancelbutton.click(); } it works on ie7, not on ie 9 drunkenmonkey's answer not working watin-2.1.0.1196

c# - Difference between System.DateTime.Now and System.DateTime.Today -

can explain difference between system.datetime.now , system.datetime.today in c#.net? pros , cons of each if possible. datetime.now returns datetime value consists of local date , time of computer code running. has datetimekind.local assigned kind property. equivalent calling of following: datetime.utcnow.tolocaltime() datetimeoffset.utcnow.localdatetime datetimeoffset.now.localdatetime timezoneinfo.converttime(datetime.utcnow, timezoneinfo.local) timezoneinfo.converttimefromutc(datetime.utcnow, timezoneinfo.local) datetime.today returns datetime value has same year, month, , day components of above expressions, time components set zero. has datetimekind.local in kind property. equivalent of following: datetime.now.date datetime.utcnow.tolocaltime().date datetimeoffset.utcnow.localdatetime.date datetimeoffset.now.localdatetime.date timezoneinfo.converttime(datetime.utcnow, timezoneinfo.local).date timezoneinfo.converttimefromutc(datetime.ut...

c++ - How can I check a function was called by another function? -

i trying make sure member function of 1 class only called member function of class. the architecture imposed , cannot changed, port means logic has done in a.call() before calling b.call() . a.call() therefore calls b.call() simplify things , make sure order respected. i found this answer question. only, problem using classes, , 2 classes have same member function name , #define tries replace occurrences have different prototypes. off top of head, options be: make b.call private , make b add a or a.call friend turn b.call class , put body a private constructor a or a.call friend grep source code b.call , make sure call in a.call , , add comment @ declaration saying "if call function fired" change b.call take @ least 1 of values needs parameter (even if ignores , uses value somewhere else)

java - What are the performance implication of sharing objects among threads? -

i know reading single object across multiple threads safe in java, long object not written to. performance implications of doing instead of copying data per thread? do threads have wait others finish reading memory? or data implicitly copied (the reason of existence of volatile )? memory usage of entire jvm? , how differ when object being read older threads read it, instead of created in lifetime? if know object not change (e.g. immutable objects such string or integer) , have, therefore, avoided using of synchronization constructs ( synchronized , volatile ), reading object multiple threads not have impact on performance. threads access memory object stored in parallel. the jvm may choose, however, cache values locally in each thread performance reasons. use of volatile forbids behaviour - jvm have explicitly , atomically access volatile field each , every time.

dictionary - Updating Dictionaries in Python -

i trying have dictionary continuously update long loop running, x , y values changing needed. how tried before getting error message , coming here. params = urllib.urlencode({'name':'xxxxx', 'pass':'xxxxxxx', 'amount':'x', 'price':'y'}) x = math.floor(first) y = last*1.007-last*.003 params['amount'] = x params['price'] = y` sell = urllib.urlopen("https://sellyourstuffwhatever.com", params) i don't know whole lot python, i'm sure there way this. current method gives me error. "typeerror: 'str' object not support item assignment" edit: need able update price , amount every thirty minutes or so, done automatically script looping. website requires username, password, price , amount. username , password never change, price , amount do. there anyway can continuously update them? urllib.urlencode [docs] returns string, not dictionary. have call after ...

python - Problem in spliting columns in a row if it contains semicolon and double quote in text -

i want import few rows csv file. problem there few columns contain semicolon , double quote in middle of text. and since delimeter ; , csv quote ", splits columns sees ; , " in middle of text. my sample csv file : "hello";"<span onmouseup="__dopostback('bb','')">;</span> <span onmouseup="__dopostback('j','')" style="display: none" enabled="true"> ";"bye" the code read rows are: csv.reader((line.replace('\0','') line in f) , delimiter=';',quotechar = '"') row in reader: print row , prints ;['hello', "<span onmouseup=__dopostback('bb','')>", '</span> <span onmouseup="__dopostback(\'j\',\'\')" style="display: none" enabled="true"> "', 'bye'] i want result : row[0] = hello row[1...

java - Can I draw State-Transition diagrams in JSF2 Web App? -

i'm looking way draw state-transition diagrams in jsf2 project. able load state , transition data , transform them in graph can displayed on web page. i haven't found way yet. charts available primefaces or myfaces projects (i'm using 1st one) dedicated statistics. in addition, it's possible in javascript didn't found example of in google's api's example. any suggestion or appreciated. lot. clément i doubt there components display graphs using plain html, might library generates image can display in page. library wouldn't jsf specific though. edit: maybe jung might of interest you. in addition primefaces' dynaimage might displaying generated graph image.

iphone - undefined symbol for architecture -

how resolve following: undefined symbols architecture i386: "_objc_class_$_rkobjectloaderttmodel", referenced from: objc-class-ref in mygroupviewcontroller.o ld: symbol(s) not found architecture i386 collect2: ld returned 1 exit status the code have is: - (void)createmodel { rkobjectloader* objectloader = [[rkobjectmanager sharedmanager] loadobjectsatresourcepath:@"/groups.json" delegate:nil]; self.model = [rkobjectloaderttmodel modelwithobjectloader:objectloader]; [super createmodel]; } - (void)didloadmodel:(bool)firsttime { [super didloadmodel:firsttime]; if ([self.model iskindofclass:[rkobjectloaderttmodel class]]) { rkobjectloaderttmodel* model = (rkobjectloaderttmodel*) self.model; nsmutablearray* items = [nsmutablearray arraywithcapacity:[model.objects count]]; ttlistdatasource *datasource = [[[ttlistdatasource alloc] init] autorelease]; (group* group in model.objects) { nss...

c# - How to switch between views using DataTemplate + Triggers -

i have requirement where user can switch view hierarchical data either tree or text in datagrid or flowchart. the user can clicking toggle button say: switch mode. want in such way can handled within view viewmodel in 3 cases same. how apply view viewmodel based on trigger. if state of view show saved in enum property use contentcontrol , datatriggers example: <contentcontrol> <contentcontrol.style> <style targettype="{x:type contentcontrol}"> <style.triggers> <datatrigger binding="{binding viewmode}" value="treemode"> <setter property="content"> <setter.value> <uc:treemodeview /> </setter.value> </setter> </datatrigger> <datatrigger binding="{binding viewmode}" v...

NHibernate Merge problem with XMLType -

i have class contains property of type xmlelement. property mapped following: <property name="xamlform" column="xamlform" type="ktn.base.data.types.xmltype, ktn.base.data" /> the xmltype class: [serializable] public class xmltype : iusertype { public new bool equals(object x, object y) { xmlelement xdoc_x = (xmlelement)x; xmlelement xdoc_y = (xmlelement)y; if (xdoc_x == null && xdoc_y == null) return true; if (xdoc_x == null || xdoc_y == null) return false; return xdoc_y.outerxml == xdoc_x.outerxml; } public object nullsafeget(idatareader rs, string[] names, object owner) { if (names.length != 1) throw new invalidoperationexception("names array has more 1 element. can't handle this!"); xmldocument document = new xmldocument(); string val = rs[names[0]] string; if (val != null) { document.loadx...

izpack - Installer not creating instead of compiling install.xml -

i have given following command @ bin directory of izpack this c:\program files\izpack\bin>compile d:\ant\guage install.xml is correct way give ? no, missing arguments. please consult getting started section in izpack online documentation details.

asp.net - What type of project is used for adding Web application in VSS2005? -

i want create web application & want add in vss2005 whether have create "web site" or "web project" . i'm using vs 2010. can create web site selecting file-> website , selecting file->new project , after opening dialog box may select web tab , selecting "asp.net web application" project. 1 should use in situation. can me on problem? urgent... thanks. if question is, 'are there differences in visual studio 2010 between choosing "file -> new -> web site" , "file -> new -> project -> web" then no, end going same web templates - question of whether pick language project type or project type language.

iphone - box2D: move body to the point(touchesEnded) -

i'm new box2d , need move body , sprite center point there contact low rate, tried use projectile-> settransform (b2vec2 (location.x / ptm_ratio, location.y / ptm_ratio), 0); movement fast , no noticeable i dont know try applyforce or applyimpulse property

security - No access to tables remote MySQL database -

i'm trying link in ms access tables in mysql database on remote computer. i'm using system dsn (odbc), when try link tables (link tables dialog) dialog empty. no error message, empty list. i'm sure i've connection because after changing limit connectivity hosts matching field in mysql security tab (mysql workbench) "%" "localhost", error. fields in administrative roles tab checked! a few questions consider: is dsn associated database schema includes tables want linked? does dsn work in opposite direction ... can export access table mysql using dsn? are there provisions in mysql monitor client connections, requests, , forth? i'm grasping @ straws on one. i'm wondering if maybe dsn functional, perhaps not pointing @ mysql location includes tables want. point #2 should tell whether dsn working @ all. if can export, find out exported table wound in mysql , compare location of other tables.

How can I make a dynamic Grails search? -

consider domain class: class house { integer room integer bathroom date builtdate date boughtdate string roadname string getsearch(){ return room + " " + bathroom + " " + builtdate + " " + boughtdate } } i imagine having several fields search mechanism: search room, bathroom, builtdate, boughtdate. the user should able search combination of these paramaters. can use one, or of them. need controller code. i'm sure cannot using hql dynamic finders i'll have use sqls statments. any help/hint appreciated. you want use hibernate criteria. along lines of: if (room && bathroom && builtdate && boughtdate) { house.withcriteria { if (room) { gte 'room', room } // ... } } look @ docs on createcriteria , withcriteria more information.

Google Visualization: Keep data points visible -

i'm wondering if there way keep dots visible each data point on line chart. default behavior dot appears on data point (along tootip) when hover on it. i'd data point dots visible default. there way can go doing this? the pointsize attribute responsible dot size. chart.draw(data, {pointsize: 1}) should make points visible default. (the default setting size 0.) hope helps!

http - Single sign-on not working correctly using different application pools? -

i have found out creating 2 new websites under iis 7 single sign-on authentication doesn't work when run in different application pools. when move applications same pool can login on 1 of them , logged in on other one. when change application pool on 1 of them, don't logged in on second one. is there settings can set in machine.config file allow them share same cookie on application pools? ex. 1: proj1 (app pool .net 2) proj2 (app pool .net 2) = single sign-on works, sharing same auth cookie. ex. 2: proj1 (app pool .net 2) proj2 (app pool .net 4, integrated/classic) = single sign-on not work, not sharing same auth cookie. ex. 2: proj1 (app pool .net 4, integrated/classic) proj2 (app pool .net 4, integrated/classic) = single sign-on works, sharing same auth cookie. original post latest update @ bottom i have 2 projects, 1 asp.net webforms , other mvc 3 project. i followed guide, see @ bottom, , got working on computer. when upload server, ...

database - Relational Design: Column Attributes -

i have system allows person select form type want fill out drop down box. this, rest of fields particular form shown, user fills them out, , submits entry. form table: | form_id | age_enabled | profession_enabled | salary_enabled | name_enabled | this describes metadata of form system know how draw it. each _enabled column boolean true if form should include field filled out column. entry table: | entry_id | form_id | age | profession | salary | name | country | this stores submitted form. age, profession, etc stores actual value filled out in form (or null if didn't exist in form) users can add new forms system on fly. now main question: add ability user designing new form able include list of possible values attribute (e.g. profession drop down list of 20 professions instead of text box when filling out form). can't store global list of possible values each column because each form have different list of values pick from. the solution can come include se...

php - MySQL get a random value between two values -

i have 2 columns in row: min_value , max_value . there way select like: select rand(`min_v`, `max_v`) `foo` [..] i realize rand different thing; closest came (with help) (rand() * (max-min))+min , though produce float number, i'd need round() , wrong. unless can suggest alternative (which useful), go php way. actually, round((rand() * (max-min))+min) best way in mysql you'd like. best way in actionscript, javascript, , python. honestly, prefer php way because more convenient. because don't know how many rows you'll returning, can't advise whether better use php or mysql this, if you're dealing large number of values better off using mysql. addendum so, there question whether better in php or mysql. instead of getting debate on principles, ran following: <pre><?php $c = mysql_connect('localhost', 'root', ''); if(!$c) die('!'); echo mysql_select_db('test', $c)?'connection':...

math - Find point on a path in 3d space, given initial and final position and starting velocity vector -

Image
let's have entity in 3d space , know position vector (x, y, z) , velocity vector (so orientation in space). starting known point want reach known point b in 2 steps: a) turn, following circular path known radius r, until point c b) go straight point c final point b. speed (scalar value) not important. velocity (vector) known, guess should define plane on circle resides, being tangent it, line between , b... i want know how find coordinates (x, y, z) c , velocity vector of entity being there. update: see working demo! if understand correctly, situation (in plane containing a, b , v ) shown in diagram below. points , b given, vector v , distance r . want find point c. well, let vector w = (−v̂ y , v̂ x ) unit vector perpendicular v . o = + r w . now, |c − o| = r , (c − b)·(c − o) = 0 (where · dot product). combine these quadratic equation, can solve find 2 possible positions c. pick 1 right sign (c − b)×(c − o). (there's second choice centre o...

unit testing Freemarker and Spring -

i have freemarker template , want write test checks output given model input. @test public void testprocesstemplatewithmodel() throws exception { final configuration configuration = new configuration(); configuration.setdirectoryfortemplateloading(directoryfortemplateloading); configuration.setobjectwrapper(new defaultobjectwrapper()); final template template = configuration.gettemplate("template.ftl"); final map<string, object> model = new hashmap<string, object>(); /* populate model */ template.process(model, new outputstreamwriter(system.out)); } trouble first line in template is: <#import "spring.ftl" spring /> so get: error [main] freemarker.runtime - error reading imported file spring.ftl error reading imported file spring.ftl problematic instruction: ---------- ==> import "spring.ftl" spring [on line 1, column 1 in template.ftl] ---------- setting import on template seems impossible. ...

oracle - Sqlplus login error when using bash variables: SP2-0306: Invalid option -

i have bash script connects oracle 10g database. in first step takes variables "config" file following command . /path/to/my/configfile.ini in config file there variables: export usrid=myuser export usrid_pass=mypassword export usr_pass="$usrid/$usrid_pass@mydatabase" then connects through sqlplus using command: sqlplus -s $usr_pass terrible security , design issues aside (this script has been around 5 years). doing job in 1 of our unix servers, not in another. when run script bash -x , can see command expanded to: sqlplus -s myuser/mypassword@mydatabase ...which should fine (and working in 1 server), response in failing server is: error: ora-01017: invalid username/password; logon denied sp2-0306: invalid option. usage: conn[ect] [logon] [as {sysdba|sysoper}] ::= [/][@] | sp2-0306: invalid option. i'm guessing has more bash oracle, i'm no bash expert. there configuration or detail i'm missing? edit: try...

Ruby on rails devkit windows -

i having problem in installing devkit of ruby on rails. here's error got c:\devkit>ruby dk.rb review based upon settings in 'config.yml' file generated running 'ruby dk.rb init' , of customizations, devkit functionality injected following rubies when run 'ruby dk.rb install'. c:/ruby192 c:/ruby192/include/ruby-1.9.1 c:\devkit>ruby dk.rb install [info] updating convenience notice gem override 'c:/ruby192' [info] installing 'c:/ruby192/lib/ruby/site_ruby/devkit.rb' [error] unable find rubygems in site_ruby or core ruby. please install rubygems , rerun 'ruby dk.rb install'. please me thanks the error added c:/ruby192/include/ruby-1.9.1 list of ruby installations. by default dk.rb not find , not valid path. please ensure config.yml contains this: - c:/ruby192 the dash important once that, try ruby dk.rb install again.

Android Saving an image on the device -

i have app takes photo. want save jpeg device. there ways this? the closest thing usefull can find on net saving sd card. have @ accepted answer question... how save data camera disk using mediastore on android?

Learning Javascript and would love some direction/help/advice -

im trying head round ins , outs of javascript, point ive learnt fundamentals such variables, loops, functions, loops, arrays etc has been coming out of book im working on 'head first javascript' create mini-project me tie ive learnt far im not sure try , create, have mini-project ideas me moving writing loads of (very rough) javascript code? p.s im focusing on pure javascript learning , no frameworks. thanks kyle maybe start writing basic calculator, field entering formula, , field result? started on input validation, string manipulation, , basic math operations.

autoconf - let ./configure find library files in specific directory -

i'm installing r software on shared space across several servers. after installation found when login on different servers, r not guaranteed run due missing of library files on different machines. here i'm trying do: since installation of r machine-dependent, i'd put missing library files libtermcap.so.2, libg2c.so.1, etc, single directory on shared space, when run ./configure, search directory. since directory shared, installation become machine-independent, won't need add missing files on each server. is there option achieve when run ./configure? thanks. assuming have copied library files /shared/lib/ , header files /shared/include/ , can run ./configure ldflags=-l/shared/lib cppflags=-i/shared/include ...other options... note, however, bound run trouble @ run time, when have convince installation use shared libraries right directory, in case decides upgrade default version on respective host. whole business platform , installation dependent. th...

c# - Perform signed arithmetic on numbers defined as bit ranges of unsigned bytes -

i have 2 bytes. need turn them 2 integers first 12 bits make 1 int , last 4 make other. figure can && 2nd byte 0x0f 4 bits, i'm not sure how make byte correct sign. update: clarify have 2 bytes byte1 = 0xab byte2 = 0xcd and need it var value = 0xabc * 10 ^ 0xd; sorry confusion. thanks of help. ok, let's try again knowing we're shooting for. tried following out in vs2008 , seems work fine, is, both outone , outtwo = -1 @ end. you're looking for? byte b1 = 0xff; byte b2 = 0xff; ushort total = (ushort)((b1 << 8) + b2); short outone = (short)((short)(total & 0xfff0) >> 4); sbyte outtwo = (sbyte)((sbyte)((total & 0xf) << 4) >> 4);

How to set a binary registry value (REG_BINARY) with PowerShell? -

how set binary registry value (reg_binary) powershell? background: i need change properties of asp.net state service using powershell script. unfortunately, built-in powershell cmdlet set-service lets modify service description, startup type, display name, , status. need modify subsequent failures property found on recovery tab (when viewing service's properties). found value stored in registry reg_binary value. an export of value looks this: [hkey_local_machine\system\controlset001\services\aspnet_state] "failureactions"=hex:50,33,01,00,00,00,00,00,00,00,00,00,03,00,00,00,0e,00,00,\ 00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00 in powershell there set-itemproperty cmdlet can set registry value values. string or dword value, can pass string or int. know hex value in array change, can't figure out how set binary value. the following line gives example how create one new-itemproperty -path . -name test -property...

sql - Instead of Trigger for Insert on all tables -

can please provide source on how write generic instead of trigger insert tables in database. want run stored procedure create instead of insert triggers tables in db . without understanding why want instead of trigger on every single table, , else plan in resulting code aside insert supplied values base table (just have happened if there no instead of trigger @ all), here came with. you'll note drops trigger if exists, can run multiple times in same database without "already exists" errors. ignores identity, rowguidcol, computed columns, , timestamp/rowversion columns. @ end show how can inspect, instead of execute (which commented out) output script (up 8k), , cast xml if want see more (up 64k). no guarantees can return whole thing in ssms depending on how many tables/columns there are. if want check and/or run manually may want create table stores value - can pull out app or have you. if want execute automatically can follow yuck's point - save stored p...