Posts

Showing posts from January, 2012

video capture software for iPhone Simulator -

hi all, m looking software/tool, can lead me capture application in simulator.. saw many videos of application, performs functionality of application , capture in video. please suggest me video capturing tool app promotion. suggestions appreciated. regards the perfect tool iphone-simulator-capture simbl plugin install simbl download code modify info.plist key "simbltargetapplications/maxbundleversion" ( and/or "simbltargetapplications/minbundleversion" ) value plist actual version of simulator (240 worked me) ( latest version: 272 ) build place bundle in “~/library/application support/simbl/plugins" relaunch simulator, should have "recording" in menu.

android application running in debug mode only -

friends, android application runs in debug mode if click run button of eclipse or run touching on icon on device. reason this?? has idea it?? is working if uninstall app , click run button of eclipse? if yes, reason android keep data in memory if close app, it's concerning static members, or references not freed gc. under debug new instance of app , it's working it's when uninstall/install it. when click run button of eclipse app might not installed again , data reused. should carefuly manage app data. firstly read article

Ways to implement data versioning in Cassandra -

can share thoughts how implement data versioning in cassandra. suppose need version records in simple address book. (address book records stored rows in columnfamily). expect history: will used infrequently will used @ once present in "time machine" fashion there won't more versions few hundred single record. history won't expire. i'm considering following approach: convert address book super column family , store multiple version of address book records in 1 row keyed (by time stamp) super columns. create new super column family store old records or changes records. such structure follows: { 'address book row key': { 'time stamp1': { 'first name': 'new name', 'modified by': 'user id', }, 'time stamp2': { 'first name': 'new name', 'modified by': 'user id', }, }, 'another address book row key...

sql server ce - Application to be run on a network (shared through a hub) -

i have developed computer based examination application. have designed application when initialized admin. client computers take exam logins. using sql server compact edition. tested small network (shared computers through hub) works well. i not @ networking things. can used same way when client computers more 50? there better alternative? thanks furqan you need provide more information on how application written answer. one thing relevant sql server compact edition limited 256 concurrent connections , need move sql server express if had more 256 client computers @ once.

magento - Favicon.ico on multi-domain sites? -

we’re using add-on domains our multi-site magento setup running off 1 skin file on domain1.com , wondering how go setting favicon each store? we have total of 10 domains time finish setting project want 10 different favicon’s. i’ve tried - http://vanesz.awardspace.info/magento_favicon_tweak/ which works in respect , show’s relevant icon on things google webmaster tools doesn’t work bookmark icon , icon @ top of page on browsers chrome. any on great. here's post that: http://drupal.org/node/17704 basically, this: <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" /> and change href whatever want.

c++ - Dealing with circular inclusion in a parent/child class relationship -

assume i've made class, parent , has composition relation child . parent class holds list of children. i want children hold reference parent, every child holds parent pointer. this cause circular inclusion. refer child in parent.h , refer parent in child.h . therefore parent need include child , needs include parent . what's best way work around this? you'll have use forward declaration: //parent.h class child; //forward declaration class parent { vector<child*> m_children; }; //child.h class parent; //forward declaration class child { parent* m_parent; };

wpfdatagrid - I am using datagrid, whose itemsource is datatable. Can datatable primary key exceptions can be handled and displayed inside datagrid? -

my grid's item source datatable has 1 field id (primary key). have bound field datagrid template column @ runtime when pass duplicate or null value id inside datagrid column, no exception caught , datagridtextbox doesn't show error. code given below; <usercontrol.resources> <style x:key="errorstyle" targettype="{x:type textbox}"> <setter property="padding" value="-2"/> <style.triggers> <trigger property="validation.haserror" value="true"> <setter property="background" value="red"/> <setter property="tooltip" value="{binding relativesource={relativesource self}, path=(validation.errors)[0].errorcontent}"/> </trigger> </style.triggers> </style> </usercontrol.resources> <datagrid autoge...

iphone - How to get matches in iOS using regular expression? -

i got string 'stackoverflow.html' , in regular expression 'stack(. ).html' have value in (. ). i find nspredicate like: nsstring *string = @"stackoverflow.html"; nsstring *expression = @"stack(.*).html"; nspredicate *predicate = [nspredicate predicatewithformat:@"self matches %@", expression]; bool match = [predicate evaluatewithobject:string] but tells got match , doesn't return string, when use nsregularexpression: nsrange range = [string rangeofstring:expression options:nsregularexpressionsearch|nscaseinsensitivesearch]; if (range.location == nsnotfound) return nil; nslog (@"%@", [string substringwithrange:(nsrange){range.location, range.length}]); it give me total string back, stackoverflow.html, interested in whats in (.*). want 'overflow' back. in php easy do, how can accomplish in xcode ios? logically if this: nsinteger firstpartlength = 5; nsinteger secondpartlength = 5; nslog (@...

git cherry-pick -x: link in details instead of in summary -

given commit message "foo", i.e. summary part, git cherry-pick -x the_commit . result new commit message foo (cherry picked commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886) that's not good, because two-line summary, seems bug in git. but how can make git make comment below without editing comment manually? foo (cherry picked commit eb42a6475d2c2e4fff7a1b626ce6e27eec21e886) you're right seems oversight. send email git mailing list , see think! you'll have handle yourself, though. the way deal avoid altogether: make original commit message good. if it's multi-line, blank line in there, appended line cherry-pick not screw format. to work around it, given cherry-picked commit has one-line message, say, can use -e option cherry-pick. if you're using vim, worst case have hit ggo<esc>zz take care of it. or write prepare-commit-msg hook. should need in is: #!/bin/bash sed -i '2s/^(cherry picked/\n&' "$1" ...

java - Simple help on Gervill with SF2 soundbank -

i have download grevill gervill.jar , existing code follow from: http://www.jsresources.org/examples/midiplayer.html could spare little effort write tutorial on loading sf2 soundbank? cry without tutorial on web. new sf2soundbank(new fileinputstream(new file("sb.sf2"))); then load instruments in synthesizer.

Getting HTML from a div by excluding other divs with jQuery -

we need scrape body of blog articles our system (it's legit, swear - have training blog , want display content in dialogs inside system). blogs written on 3rd party platform produces html so: <div class="post"> <h3 class="title">title content</h3> <div class="byline"> byline content </div> <div class="submissions"> submission content </div> <div class="buttons"> </div> <p>post body part 1</p> more post body not in tag, user enters <p>even more post body</p> <div class="tags"> tag content </div> </div> i'm trying html content inside post div, excluding title, byline, submissions, buttons, , tags sections. if run jquery: $(".post").not(".title").not(".byline").not(".submissions").not(".but...

Get element with jquery and selenium IDE 1.0.8 -

i'm trying element jquery , selenium ide 1.0.8. <td>storevalue</td> <td>$('#result').find('img').filter('[alt=&quot;nameofphoto&quot;]').eq(0)</td> <td></td> and in log get [error] element $('#result').find('img').filter('[alt="nameofphoto"]').eq(0) not found when put command in firebug element :/ why doesn't work ? edit: alternatively example can give me code how id of first object whith java tag @ main page of stackoverflow. tag: <a rel="tag" title="show questions tagged 'java'" class="post-tag" href="/questions/tagged/java">java</a> and example result : <div id="question-summary-4303985" class="question-summary narrow"> is: question-summary-4303985 based on other posts tried following , worked. add code below user-extensions.js: function jquery (sel...

Firefox SSL and JQuery UI -

i'm experiencing odd problem page's ssl breaks in firefox if incorporate jquery ui dialog box. works fine in i.e. 8 , chrome. i read issue introduced css base64 image encoding breaking ssl i've tried removing style sheet , problem still occurs. has run this? if not can suggest way progress in hunting cause down? i'm cutting code out , retrying it's painfully slow (easier if static element). the call breaks ssl is... <script type="text/javascript" charset="utf-8"> jquery(document).ready(function() { $( "#dialog" ).dialog(); }); </script> so dialog box id ripped out , moved end of document problem occurs. i think what's going on here jquery-ui-1.8.2.custom.css file referencing images redirecting non-ssl 404 page.

WPF MVVM update collections so that UI updates -

i want update ui. should use backgroundworker? put backgroundworker in mainwindowviewmodel , instantiate repositories again, or put in ordersqueueviewmodel , properties? the ui displays contents of lists created linq. lists observablecollection , properties of ordersqueueviewmodel. have viewmodel mainwindowviewmodel creates collection viewmodels, can bind collection mainwindow.xaml (view). mainwindowviewmodel.cs: public mainwindowviewmodel() { _printqueuerepos = new ordersprintqueuerepository(); _holdqueuerepos = new ordersholdqueuerepository(); _linestopickrepos = new linestopickrepository(); _linesperhourrepos = new linesperhourrepository(); //create instance of viewmodel , add collection ordersqueueviewmodel viewmodel = new ordersqueueviewmodel(_printqueuerepos, _holdqueuerepos, _linestopickrepos, _linesperhourrepos); this.viewmodels.add(viewmodel); } mainwindow.xaml: <window.resources> <d...

c - Access ebp when given eip -

i trying develop runtime stack tracer. have function returns eip address whenever program being traced segfaults. how can ebp of current function (the 1 during program under observation crashed) can start tracing up? there no way convert instruction pointer stack frame pointer. same function may invoked many times (even recursively) different stack addresses; that's whole point of having call stack. if have crash dump file (core file, etc.) should contain dump of registers. if want register values must read them here.

windows - Why will my project not debug? -

i downloaded microsoft visual c++ , trying run simple hello world. however, when go debug, error "unable start program 'c:\users\sterling\documents\visual studio2010\projects\test\debug\test.dll'" and thats it. doesn't why can't start it...it says can't. has experienced this? , know answer? i'm thinking reinstalling it, hoping find easy solution first. there separate program need start .dll files? got laptop week ago may not have yet. on windows 7. thank help. you have built project dll. cannot run dlls standalone. if meant build program (.exe), change project settings. right click project in solution explorer, click properties - edit configuration properties -> general -> configuration type "application (.exe)". if want build (and run) project dll, have write program uses in order to test it. separate 'testdll' exe project in same solution existing dll.

mysql - Most efficient way to retrieve "top x" records using Rails -

we've gotten report request in, , i'm trying find out easiest , efficient way pull numbers. i have deal model 2 attributes: _quantity_purchased_ , price . i've been asked retrieve list of top 100 best selling deals in database. see how deal has done, multiply quantity_purchased price. now, i'm sure write convoluted results, seems such simple operation, there has got easier way of doing it. there in mysql, or using ruby/rails? or stuck finding kind of unpleasant loop? fyi, running rails 2.3. you can pass :limit parameter find method limit number of results returned. combined :order parameter, can 'top' 100 results: deal.find(:all, :order => 'quantity_purchased * price', :limit => 100); note of rails 3, correct way of writing query be deal.order('quantity_purchased * price').limit(100)

python - How to draw floating pie charts on an existing plot with matplotlib -

i plot multiple pie charts on existing plot using absolute coordinates. i went through add_axes method , axesgrid toolikt couldn't find solution. to more specific, want draw pie charts on geographical map using basemap module. this tutorial explains how use matplotlib basemap drawing pie charts on map. simple , gives code examples.

Nhibernate Extension points -

i'm looking more information on extension points within nhibernate. for instance know iusertype , icacheprovider. can't seem find reference of different extension points nhibernate provides? is anyone's google-fu stronger mine :) there no complete references on that... it's not hard @ assembly , find interfaces , base classes: iinterceptor ibatcherfactory icollectiontypefactory iproxyfactoryfactory icacheprovider iconnectionprovider icurrentsessioncontext dialect idriver iidentifiergenerator ituplizer and many more...

mysql - CakePHP Model uses the wrong fields in SQL statements! -

i have bunch of models various associations set between them , seems cakephp @ times executes incorrect sql statement , cause mysql barf. for example, if have 2 models, comment , tag , code this: $this->comment->id = 5; $this->comment->savefield('read_count', 3); yields sql statement: update comments set read_count = 3 tag.id = 3; it doesn't happen time happens since doing in tight loop. please help. makes me question decision go cake since sounds bad. thanks. edit 1 ran problem , here faulty sql: select count(*) `count` `albums_songs` `albumsong` `artistgenre`.`id` = 26482 albumsong , artistgenre 2 separate tables , not related @ all. edit 2 ran failure. code is: $this->song->find('first', array('conditions' => array('song.artist_id' => 30188, 'song.name' => 'pal pal (by.tarkhanz)'), 'fields' => array('song.id'))) while generated sql is: select `song`.`...

tokenize - PHP Tokens From a String -

let's have string looks this: token1 token2 tok3 and want of tokens (specifically strings between spaces), , position (offset) , length). so want result looks this: array( array( 'value'=>'token1' 'offset'=>0 'length'=>6 ), array( 'value'=>'token2' 'offset'=>7 'length'=>6 ), array( 'value'=>'tok3' 'offset'=>14 'length'=>4 ), ) i know can done looping through characters of string , can simpy write function this. i wondering, php have built-in efficiently or @ least part of this? i looking suggestions , appreciate given. thanks you can use preg_match_all preg_offset_capture flag: $str = 'token1 token2 tok3'; preg_match_all('/\s+/', $str, $matches, preg_offset_capture); var_dump($matches); then need replace items in $match...

iphone - What causes this Objective-C compile error: Stray '\235' in Program -

#import "instatwitviewcontroller.h" @implementation instatwitviewcontroller - (nsinteger)numberofcomponentsinpickerview:(uipickerview *) pickerview { return 2; } - (nsinteger)pickerview:(uipickerview *) pickerviewnumberofrowsincomponent :(nsinteger)component { if (component == 0) return [activities count]; else return [feelings count]; } /* // designated initializer. override perform setup required before view loaded. - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil { if ((self = [super initwithnibname:nibnameornil bundle:nibbundleornil])) { // custom initialization } return self; } */ /* // implement loadview create view hierarchy programmatically, without using nib. - (void)loadview { } */ // implement viewdidload additional setup after loading view, typically nib. - (void)viewdidload { [super viewdidload]; activities = [[nsarray alloc] initwithobjects:@”sleeping”, @”eating”, @”working”, @”thinking”,...

serialization - How to handle Java.io.NotSerializableException -

i have created java program works java i/o. have implemented serializable interface, still cause java.io.notserializableexception on following part of code while trying write objects file: oos.writeobject(ep); how possible while implementing serializable? should works besides implementing interface? usually means, object object trying serialize holds reference not serializable. if post code , exceptions stacktrace lot easier tell.

Update xml file with ColdFusion -

i have xml file needs updated. user wants able select year , amount. best way? thanks <root> <sga> <year>2008</year> <amt>940</amt> </sga> <sga> <year>2009</year> <amt>980</amt> </sga> <sga> <year>2010</year> <amt>1000</amt> </sga> </root> you want use 'contains' operator (alejandro points out that's not strict match) match in xpath. execute xpath in coldfusion, use xmlsearch function on xml object. normalize-space() function trims leading , trailing whitespace (fixing, instance cr in 2010 year node). because xpath matching year node directly, use '/..' fetch year node's parent. if wanted operate on of other sibling nodes year (for instance if there "quantity" node or something). <cfxml variable="foo"> <root> <sga> <year>2008</year> <amt>940</amt> </sga...

sockets - See what website the user is visiting in a browser independent way -

i trying build application can inform user website specific information whenever visiting website present in database. must done in browser independent way user see information when visiting website (no matter browser or other tool or using visit website). my first (partially successful) approach looking @ data packets using system.net.sockets.socket class etc. unfortunately discoverd approach works when user has administrator rights. , of course, not want. goal user can install 1 relatively simple program can used right away. after went looking alternatives , found lot winpcap , of it's .net wrappers (did tell programming c# .net already?). winpcap found out must installed on user's pc , there nog way reference dll files , code away. looked @ including winpcap prerequisite in installer cumbersome. well, long story short. want know in application website user visiting @ moment happening. think must done looking @ data packets of network can't find solution this. a...

sql - How do I remove repeated column values from report -

from this: hotel type room guest ------------------------- ------ ---- ----------------------------------------- --------- --------- university inn & suites double 101 george brown 11-sep-10 14-sep-10 university inn & suites double 101 george brown 11-oct-10 13-oct-10 university inn & suites double 102 university inn & suites double 103 university inn & suites double 104 university inn & suites double 105 university inn & suites family 106 george brooks 22-sep-10 27-sep-10 university inn & suites family 107 university inn & suites single 201 sandra williams 15-sep-10 19-sep-10 university inn & suites single 201 liz armstrong 16-sep-10 18-sep-10 university inn & suit...

iis - CScript on x64 Win2003 Server - Cannot find script file -

sanity check, please. solution i'm hearing sounds ill-conceived, may one. from within .hta on .vbs app i'm running cscript c:\windows\system32\iisapp.vbs it works great cli , fails within little app. because i'm on 64 bit box, , calls c:\windows\system32 redirected c:\windows\syswow64, iisapp.vbs script not reside. moving script on there causes microsoft.cmdlib complain needing registered. of understandable , understood. the recommended solution on other forums copy , regsvr32 iisschlp.wsc , cmdlib.wsc syswow64. that works, seems bit heavy-handed. might there unforeseen side-effects of solution? there not more direct solution reregistering these files on wow64-land? thanks. looks need access 64-bit "system32" directory on 64-bit box 32-bit program. easiest way use virtual directory "sysnative" instead of system32 this: cscript c:\windows\sysnative\iisapp.vbs alternatively start 64-bit version of cscript: %windir%\sysnative\...

How do I change the theme on an Android application? -

i'm developing android application , want change color , theme of application. how can this? dev guide explains how apply themes , styles. this: <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:textcolor="#00ff00" android:typeface="monospace" android:text="@string/hello" /> becomes this: <textview style="@style/codefont" android:text="@string/hello" /> by defining xml theme file: <?xml version="1.0" encoding="utf-8"?> <resources> <style name="codefont" parent="@android:style/textappearance.medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textcolor">#00ff00</item> ...

c# - Watin Test works from Visual Studio but not CCNet running as Windows Service -

we have watin test page ajax model popup window. test trying open window, hide reshow it. the test runs fine when run visual studio or our local build scripts. test fails when runs on build server. the build server cruise control.net running windows service (logged in domain account). our build scripts written in nant , running watin tests using method described in this post . the modal ajax popup window implemented using jquery. we using: watin 2.0.20 nunit 2.5.5 windows server 2003 ie7 jquery 1.4.2 here snippet of failing test. _iebrowser.button("btntoggle").click(); _iebrowser.waitforcomplete(); assert.istrue(_iebrowser.button("btnreshow").exists); _iebrowser.button("btnreshow").click(); _iebrowser.waitforcomplete(); _iebrowser.textfield("editbody").waituntilexists(); assert.istrue(_iebrowser.textfield("editbody").text....

c++ - Calling an "external" function from a class method -

i have function want call within class method. function in file called mergesort.cpp. here snippet of .cpp file class implemented in: // other includes #include "mergesort.cpp" // other methods void servers::sortsites() { mergesort(server_sites.begin(), server_sites.end(), sitecompare); } // remaining methods when try compile errors saying mergesort can't found. think because it's trying call servers::mergesort. how go calling external function? you have use "::" external namespace resolutor: ::mergesort(...); this tells compiler function in outer namespace. if particular function defined in namespace or class, have specify explicitly: namespace::mergesort(...); if don't want have resolve name each time use it, can import name current namespace either using: using namespace namespace; or using namespace::mergesort; (where namespace name in mergeshort() defined).

Is there a voting plugin available for rails 3? -

acts_as_voteable , vote_fu don't work on rails 3. there 1 work? they simple set up. here's 1 can start : class object < activerecord::base has_many :votes, :as => :votable has_many :voting_users, :through => :votes, :source => :user #object_controller def vote_up get_vote @vote.value += 1 unless @vote.value == 1 @vote.save respond_to |format| format.html {render :action => 'view'} format.js { render :action => 'vote'} end end private def get_vote current_object = objects.detect{|r| r.id == params[:id].to_i} @object = current_object @vote = current_object.votes.find_by_user_id(current_user.id) unless @vote @vote = vote.create(:user_id => current_user.id, :value => 0) current_object.votes << @vote end end

c# - Windsor Setter Injection in code -

i'm using windsor ioc in our .net project, i'm having difficulties doing setter injection in code. i believe comes fact blanket register components, since i'm hoping legacy project ioc compliant , unit tested (sweet dreams!). here how i'm registering daos: container .register(alltypes.fromassemblynamed("myapp.business") .where(component.isinnamespace("myapp.business.dao")) .withservice.defaultinterface()); and here how i'm registering components using daos: container .register(alltypes.fromassemblynamed("myapp.business") .where(component.isinnamespace("myapp.mycomponentobject"))); i hoping setters picked automatically in components, resources found seem show setters need defined. unfortunately i've found examples of how in configuration xml, not in code. i found how add parameter component in code there seem limitations. looks has string , if that's not case, seems force me decl...

Expose Rails App Environment to Ruby Script -

out of pure curiosity, wondering if it's possible (no doubt is) 'hook into' rails application's environment. example, want create cron script (i don't) operates sort of maintenance on rails app, , want write in ruby , using of nice code have, example, user.find etc. is possible, , if so, how? i'm curious, feel want reason or other. i'm on rails 3 ruby 1.9.1, in case matters. this possible. here writeup on how that: how run rake task cron

xforms - Conditionally include javascript file in xbl -

can conditionally include javascript file , css files. <xbl:script src="/apps/xforms-sandbox/samples/myfile.js" /> can done conditionally? at point, in orbeon forms, can't conditionally include scripts <xbl:script> or css <xbl:style> . include dynamic resources, use html elements <xhtml:script> , <xhtml:style> generate xstl, inside <xbl:template> of xbl component. if can use static resource, should: to avoid duplication — if have multiple instances of component when page loaded, same javascript or css end being included multiple times in page. might say: well, case anyway when using <xbl:script> , <xbl:style> . yes, bug , we'll chance fix soon. to benefit automatic minimization , combination — planning automatically combine , minimize resources references in xbl components, resources used core xforms engine itself. able benefit feature when lands in codebase if use <xbl:script> , <xbl...

visual studio 2010 - How to load test a web page using Windows authentication -

Image
i'm in process of developing load tests internal web application. the problem appears related our use of windows authentication. can access web application if launch browser , nevigate our app. can't, however, access application via webrequest in load test. throws 401 exception, unauthorized. i'm using visual studio 2010 ultimate. how use windows credentials in load test? other ideas? select test main node, , click red marked button set credentials

c++ - How do you delete (or fill with specific values) a static n-dimension array? -

const int rows = 3; const int columns = 4; void fillarray(double a[rows][columns], double value); void deletearray(double a[rows][columns]); int main () { double a[rows][columns]; fillarray(a, 0); deletearray(a); } in c++, how delete (or fill specific values) static n-dimension array? in c++ not use arrays. use std::vector . can use memset or std::fill fill array specific values. btw can use delete on dynamically allocated arrays not on static ones. memset( a, 0 ,rows * columns * sizeof( double )); or std::fill(&a[0][0], &a[0][0]+sizeof(a)/sizeof(double), 0);

iphone - How to increase applicationIconBadgeNumber in background app when localNotification fires? -

how increase value of applicationiconbadgenumber when localnotification fires , app running in background? did uilocalnotification documentation ? there's applicationiconbadgenumber property...

css - How to customize the look and feel of rich faces tab panel -

Image
i want use rich faces tab panel. how customize , feel of tabs. what css classes must override ? it's in richfaces developer guide

c - True Type Font File -

i working on scalable font. wanted know specification of .ttf file or contains of .ttf file , how these contains arranged. question- knows basic structure of .ttf file. how see contains of .ttf binary file. the fontforge documentation has links of relevant font standards. note there no one-true-truetype standard. http://fontforge.sourceforge.net/bibliography.html#formats microsoft's standard: http://www.microsoft.com/typography/specificationsoverview.mspx adobe's opentype standard (an extension normal truetype): http://www.adobe.com/devnet/opentype.html apple's standard: http://developer.apple.com/fonts/ttrefman/ (complete in retro-2002 web) note fontforge self reference implementation.

How to make a F# discriminated union out of another type's union cases? -

imagine discriminated union: type direction = | north | south | east | west now imagine want type accepts tuples of (north, south) or (east, west). perhaps describe train routes run north south, or east west. (north, east) , (south, west) should forbidden, perhaps because trains don't run that. this doesn't work: type trainlines = | north, south | east, west even though doesn't work, perhaps can see i'm trying do. this works, doesn't restrict possibilites (north, south) , (east, west): type trainlines = direction * direction any guidance welcomed. this isn't asked for, think it's type trainlines = | northsouth | eastwest would good. if needed add e.g. member this.directions = match | northsouth -> [north; south] | eastwest -> [east; west]

security - Encrypt Java MIDP Application -

how encrypt java midp application? need encrypt application, not obfuscate, use proguard obfuscate application, classes files still can decompiled. i have tried using classguard encrypt mobile aplication, classguard not support midp application. support java desktop application. encryption, in addition obfuscation, makes program harder hack. it 's having police standing outside vault door. doesn 't make impossible; makes harder. consequently, when obfuscate still have class files, though class files might a.class, , b.class , c.class still present in jar , can decompile them easily. with encryption like, instance, classguard have a.classx, b.classx, , c.classx in jar. means have go through additional step of dumping class running application. not can do, , harder unzipping class jar file. in opinion, security should applied in layers; class encryption layer makes harder hack java program.

sql - SqlBulkCopy - mirroring failed :( -

i've optimized import application , broke mirroring, i'm pretty sure it's because of it. error , cannot resume it. remote mirroring partner database 'foo', encountered error 3624, status 1, severity 20. database mirroring has been suspended. resolve error on remote server , resume mirroring, or remove mirroring , re-establish mirror server instance. how can use sqlbulkcopy mirroring? please open connect issue, attach errorlog , dump mssql\log*.mdmp (check both principal , mirror's location), corrupted mdf , ldf files mirror. and make sure have both systems patched recent cus. instance there know issue sql server 2008 fixed in cu10/sp1 , cu1/sp2: fix: error message may occur when run "bulk insert" query on database uses "bulk_logged" or "simple" recovery model in sql server 2008 (although not issue, since must have full recovery mode mirroring).

python - Adding custom header on serving static files with Apache -

is possible send additional custom headers (for example wsgi app) before apache serves static content (image/js/css) ? use apache mod_headers module. http://httpd.apache.org/docs/2.2/mod/mod_headers.html no way of doing using mod_wsgi. you mod_python if had to, better off trying builtin apache modules.

testing - How to interpret merge information in TFS log output (or: how can I know which changesets is part of a build?) -

first question, background. we're using visual studio 2008, c# 3.0 , .net 3.5, , tfs 2008 our vcs. if execute command against our tfs database, show information merge commit: tf changeset 13469 /noprompt i output (redacted): changeset: 13469 user: lasse date: 12. november 2010 14:06:06 comment: text here. items: merge, edit $/path/to/target/filename.txt ... more merged files ... blurb reviewer texts, etc. nothing important/useful here this merged different path in same database, information not available here. for instance, if merged $/path/to/main/ down $/path/to/branch/ , path main project not available in merge changeset. (note, please don't i'm merging wrong way, doesn't matter in case made simple.) so, question this: there way can find out changeset merged from? branch came from? ... and changeset originated in branch (like 13468? 13462? 13453? ...) background we haven't used branching , merging far, except simple stuff ...

c# - Instance variables vs parameter passing? Is there an argument? -

so, i have been working on re-factoring legacy code , have found myself questioning validity of of re-factoring decisions have been making. 1 such query has been use of instance variables object sharing between methods within object. specifically, there number of places constructors & methods have been split , local variables promoted instance variables, allowing access separate methods. this, me, seems wrong. breaks encapsulation, alters scope , can affect life cycle, however, of these classes performance related , wonder implication of re-factoring these methods use parameter passing instead may be? more point wonder whether assumptions hold water? parameter passing of objects preferable instance variables when comes sharing between private methods? on plus site way wont have pass arguments other methods. when method has more 3 arguments (according robert martin's clean code ) readability of code starts decrease fast. think should mix these 2 methods bet be...

java - Dynamic required validation for different buttons? -

i'm learning jsf 2.0 core jsf 2.0 book + glassfish + cdi. i have question validation feature of jsf. let's have simple login application, has simple layout : userid : (input field userid - using required="true") password : (input secret password - using required="true") loginbutton + registerbutton(using immediate="true") + checkuseridavailabilitybutton now, let's loginbutton pressed, , userid , password left empty, validation error occur on both of fields, , that's working intended. and when registerbutton pressed, doesnt care whether userid or password filled user, since it's using immediate="true", bypassing validation , command gets executed @ apply request value phase, , that's still working intended. and here comes problem .. when checkuseridavailabilitybutton pressed, expect userid filled, , dont need care whether password field filled or not, password field throw error saying it's required fi...

iphone - Static library -L not found -

i importing static libraries project. works fine there compiler warnings "... following -l not found". seen in every static library import. how resolve error? thank you i having issue codebase didn't originate on machine. stuck in folder space in name, seemed confuse header search paths. closing project, taking space out of folder name , restarting fixed linker.

xaml - Behaviour of SendResponse in WF4 -

Image
at top of template workflow put receiverequest / sendreply block i'd perform synchronous operations, enabling user client receive timely response of workflow being started. client calls wf via wcf. client knows status of current request status of entry on application database. for example, create order, call placeorderwf, set status of order on db "accepted". client can perform whatever wants while wf doing checks, controls, etc, ..., setting final value of order "completed" or "error". i expect client receive response after sendresponse block. doesn't seem work way, waits kind of "event" release client. unfortunately, have no evidence of events triggering behaviour. to test it, put delay activity after sendresponde activity , should able reproduce behaviour talking about. any hints on how avoid unwanted error? the workflow continue , execute as can on current thread , result doesn't return caller right away....

Using MYSQL conditional statements and variables within a query -

hi cant seem construct mysql query im after. say have result of 2 columns: 1) browser name , 2) browser count. where gets complicated want once 90% of total count has been reached rename other browsers others , mark left on percentage accordingly. i know can total count variable before begin main statement: select @total := count(id) browser_table start "2010%"; then can group results browser: select browser, count(id) visits browser_table start "2010%" group browser i know need whack in case statement (and counter variable) sort columns not sure of how implement above query: case when counter >= 0.9* @total 'other' else browser end browser; hope makes sense? time.... here's 1 approach... you can calculate running total based on this answer . example: set @rt := 0; select browser, visits, (@rt := @rt + visits) running_total ( select browser, count(id) visits ...

android - HTML prerequisites for mobile website developpement? -

what advised doctype website optimised smartphones? , principal diferences between them. xhtml mobile profile 1.0 <!doctype html public "-//wapforum//dtd xhtml mobile 1.0//en" "http://www.wapforum.org/dtd/xhtml-mobile10.dtd"> or xhtml mobile profile 1.1 <!doctype html public "-//wapforum//dtd xhtml mobile 1.1//en" "http://www.openmobilealliance.org/tech/dtd/xhtml-mobile11.dtd"> or xhtml mobile profile 1.2 <!doctype html public "-//wapforum//dtd xhtml mobile 1.2//en" "http://www.openmobilealliance.org/tech/dtd/xhtml-mobile12.dtd"> when think of smartphones think of ones have listed in tags, iphone , android. since these 2 listed suggest <!doctype> html5. webkit optimized html5 , html renderer android , ios devices.

JSON format for jQuery UI Autocomplete -

the documentation jquery ui autocomplete states source property can set url returns suggested items in json format. however, doesn't elaborate further structure of json result supposed like. post example? thanks! this json format {source: ["milan", "turin", "venice", "florence", "rome"] } or source {source: ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby"]}

Current memory usage in Lisp -

i need find out, within common lisp program, how memory being used. i'm given understand there no portable method (the standard function room prints information standard output in text form instead of returning value), sb-kernel:dynamic-usage works in sbcl. what equivalents in other common lisp implementations? or there way solve problem should looking at? it may not much, anyway: you can capture output of (room) , parse it. (with-output-to-string (*standard-output*) (room)) above returns string output of room. additionally may request memory size of process via external call standard unix command (if on unix).

iphone - How can i move images on touch event? -

i have created image gallery. show images plist file in navigation view. when open image in full view after have in navigation. want move images in scrolling when image in fullview. after open image in full view want swap 1 one next previous... there possible..?? plz give me kind.. regards.... yes thats possible, make fullview scrollview contentsize having same width screen , height being combined height of subviews (put @ least 2 or 3 imageviews in scrollview subviews). can add , remove uiimageviews subviews of uiscrollview user vertically pages through them. need communicate navigation view table status when user returns view though matches up.

How can I find out the validation status of a Silverlight usercontrol? -

i have silverlight usercontrol few fields on bound via ria services database. using notifyonvalidationerror=true, validatesonexceptions=true on these fields , validationsummary control show errors fields. works fine. however, on usercontrol have "save" button call context.submitchanges() when clicked. problem button can clicked (and submitchanges called )even when there still errors present. how determine whether there validation errors still present, or there anyway of binding isenabled property of save button validation status? to stop save button being available when there client side validation errors still in effect try this. in class (code behind or view model) have provides current instance of ria entity working with. public sampleriaentity selectedentity { get; set; } using extension method: public static class riaextensions { public static bool checkvalidation<t>( t riaentity ) t : entity { validationcontext vc = new validationc...

c# - How to ignore model binding from querystring in MVC -

i have form submission doing post back. controller action accepts values parameters. ex: editproduct(int productid, string productname). productid supplied form in hidden field. how can ensure that user not invoke action , pass productid , name queystring , model binding bind vales , product saved in database? you can sign product id secret key on server (using hmacsha512), verify signature in postback. you might want include current date and/or user or session id when signing prevent replay attacks.

Implementing multiple IEnumerables in C# -

i have generic class, class<t> , implements ienumerable<t> . t constrained implement iconvertable . i want class able pretend string-like object, want implement ienumerable<char> . however, ienumerable<t> , ienumerable<char> collide -- happens if t char ? does have suggestions on how accomplish this? edit: here's clarification -- i'd able following: public ienumerator<t> getenumerator() { (var = _offset; < _offset + _length; i++) yield return _array[i]; } public ienumerator<char> getenumerator() { (var = _offset; < _offset + _length; i++) yield return _array[i].tochar(null); } you need class "pretend string-like object". can make string-like behaviour more explicit , avoid implementing ienumerable<char> @ all? public ienumerator<t> getenumerator() { (var = _offset; < _offset + _length; i++) yield return _array[i]; } // either public ienumera...

sql server - Convert columns values into multiple records -

in sql server 2008, have table following columns , data date name colors color1 color2 color3 nov01 john red nov02 mike green blue grey nov03 melissa yellow orange nov10 rita pink red i want make new table or change above table data shown as date name colors nov01 john red nov02 mike green nov02 mike blue nov02 mike grey nov03 melissa yellow nov03 melissa orange nov10 rita pink nov10 rita red thanks or using pivot & unpivot select t.date, unpvt.name, unpvt.color (select name, colors, color1, color2, color3 dbo.mytable) p unpivot (color [date] in (colors, color1, color2, color3) )as unpvt join dbo.mytable t on t.[name] = unpvt.[name] unpvt.color != ''

C struct problem -

i trying learn structs in c, not understand why cannot assign title example: #include <stdio.h> struct book_information { char title[100]; int year; int page_count; }my_library; main() { my_library.title = "book title"; // problem here, why? my_library.year = 2005; my_library.page_count = 944; printf("\ntitle: %s\nyear: %d\npage count: %d\n", my_library.title, my_library.year, my_library.page_count); return 0; } error message: books.c: in function ‘main’: books.c:13: error: incompatible types when assigning type ‘char[100]’ type ‘char *’ lhs array, rhs pointer. need use strcpy put pointed-to bytes array. strcpy(my_library.title, "book title"); take care not copy source data > 99 bytes long here need space string-terminating null ('\0') character. the compiler trying tell wrong in detail: error: incompatible types when assigning type ‘char[100]’ type ‘char *’ look @ original code again , s...

c# - Certificate Install Security Warning Workaround? -

i have c# 4.0 code attempts install ca (.der encoded) certificate "trusted root certification authorities" store current (my) user. little console app runs silently against other stores, store gui popup comes "you install certificate certification authority... windows cannot validate certificate from..... want install certificate?" this messagebox problem because idea automatically deploy app msi , silently right certs in right place. having modal box kill automated deployment. how can installation done without deployment-breaking messagebox? it can sound not logical, have no warning should add certificate not root certificate store of current user, root of local machine instead. can easy verify that certmgr.exe -add -c t.cer -s -r currentuser root produce security warning, but certmgr.exe -add -c t.cer -s -r localmachine root not. so if want import certificate in .net corresponding code following using system; using system.security.cryp...

internet explorer - AJAX calls for database information -

i insert record database making async ajax call. after browser closed , opened access, added properly. problem that, after made call update, later made call select read updated values. still shows old values. why doesn't database updated till close browser? p.s. problem comes ie. works fine chrome. thanks in advance. your page cached. set correct no cache headers on ajax response. see: prevent browser caching of jquery ajax call result

bash - Spread 'sed' command over multiple lines -

i trying spread 1 sed command on several lines in bash file. have multiple patterns sed checks , hoping separate of patterns line change. here current script not work, putting on 1 line works hoping clean bit , split things up. #!/bin/sh -f #files=$(ls -1 | egrep '.avi|.mkv'); #echo $files f in *.mkv *.avi; renf=`echo $f | tr '.' ' ' | sed -e 's/ \([^ ]*\)$/.\1/; s/\ \[sharethefiles\ com\]//i' \ -e 's/\ x264\-ctu//i; s/\ x264\-bia//i; s/\ x264\-fov//i' \ -e 's/\ xvid\-lol//i; s/\ xvid\-xor//i; s/\ xvid\-notv//i; s/\ xvid\-fqm//i; s/\ xvid\-p0w4//i; xvid\-bia//i; s/\ xvid\-chgrp//i; s/\ xvid\-fov//i' \ -e 's/\ pdtv\-fov//i; s/\ pdtv\-river//i; s/\ pdtv\-sfm' \ -e 's/\ dts\-chd//i; s/\ web\-dl//i; s/\ h264\-surfer//i' \ -e 's/\ dsr//; s/\ ws//i; s/\ pdtv//i; s/\ x264//i; s/\ blu\-ray//; s/\ bdrip//i; s/\ bluray//i; s/\ hdtv//i; s/\ dts//i; s/\ ac3//i; s/\ dd5//i; s/\ dualaudio//i; s/\ aac2//i; s/\ xv...

How can I use jQuery UJS to submit a form via AJAX after the change event of a select box fires in Rails? -

how can use jquery ujs submit form after change event of select box fires in rails? my view looks this: <% perm in @permissions %> <%= form_for [@brand,perm], { :remote => true } |f| %> <tr id="permission_<%= perm.id %>"> <td><%= perm.configurable.name %></td> <td><%= f.select :action, ['none', 'read', 'update', 'manage'] %></td> </tr> <% end %> <% end %> pretty straightforward. controller so: class permissionscontroller < applicationcontroller before_filter :authenticate_user! respond_to :html, :js load_and_authorize_resource :brand load_and_authorize_resource :permission, :through => :brand def index end def update @permission = permission.find(params[:id]) @permission.update_attributes(params[:permission]) end end and in application.js: // place application-specific ...