Posts

Showing posts from April, 2012

asp.net - on click for asp:textbox? -

asp.net - on click for asp:textbox? - im looking way have textbox contain bit of text until users clicks come in own text. search field , client wants textbox have "search stock" in textbox, when users clicks in it, becomes null can come in own criteria. cant see onclick or similar in designview textbox though, hints? thanks <asp:textbox runat="server" value="search stock" id="textbox1" onfocus="if (this.value == 'search stock') this.value = ''; " onblur="if (this.value == '') this.value ='search stock'; " /> asp.net visual-studio-2010

Why is my android device resetting itself? -

Why is my android device resetting itself? - i have semc x10 mini pro, has tendency randomly reset no apparent reason. i inspect android scheme log file prior reset, unsure how this. i have tried app "log collector", however, logs produced app contain info lastly start-up, ie don't contain logging i'm interested in - before "last start-up", around "last shutdown". any advice out there? you improve luck on android stack exchange, unless looking programmatically. in case take through log collector source code , see if can modify save txt file persist through restart can go through 1 time device rebooted. android

matlab - plot matrices in desired colors -

matlab - plot matrices in desired colors - how possible assign color value matrix. illustration have 10by10 matrix values 0 9. afterwards i'd "chess board" 0 = white, 1 = black, 2 = blue...etc... 2nd question if run operations matrices alter each loop , run let's 10 lops (k = 10) - possible create video out of 10 plot pictures i'll getting after each loop. (i'm programming kind of cellular automaton, i'd see how situation changes on time). thanks consider example: %# lets create 10-by-10 matrix, of values in range [0,9] m = fspecial('gaussian',10,2.5); m = (m-min(m(:))) ./ range(m(:)); m = round(m*9); %# prepare video output vid = videowriter('vid.avi'); vidobj.quality = 100; vid.framerate = 5; open(vid); %# display matrix h = imagesc(m); axis square caxis([0 10]) colormap(jet(10)) colorbar %# capture frame writevideo(vid,getframe); %# iterate changing matrix i=1:50 m = rem(m+1,10); %# circular increme...

Java inheritance in Android -

Java inheritance in Android - i trying utilize code depicted in thread android: software keyboard shown? as can see author using class inherits linearlayout. , later initialize new instance follows: linearlayoutthatdetectssoftkeyboard mainlayout = (linearlayoutthatdetectssoftkeyboard)findviewbyid(r.id.main); is possible?i getting classcastexception. , explains here downcasting first need reference parent child. yes thats possible. did declare custom linearlayout correctly in main.xml layout? like: <com.yourpackage.linearlayoutthatdetectssoftkeyboard></com.yourpackage.linearlayoutthatdetectssoftkeyboard> java android inheritance casting

php - Cakephp Minimum value query -

php - Cakephp Minimum value query - i have issue cakephp can retrieve min value score field cannot seem id same row using grouping aswell. below code. doing wrong? function index() { $this->leaderboard->recursive = 0; $this->set('leaderboards', $this->paginate()); $min = $this->leaderboard->find('all', array( 'fields' => array('min(leaderboard.score) min_score') )); $minimum = $min[0][0]['min_score']; pr($min); echo $minimum; if (!empty($this->data)) { $this->leaderboard->create(); if($this->data['leaderboard']['score'] > $minimum){ if ($this->leaderboard->save($this->data)) { $this->session->setflash(__('the leaderboard has been saved', true)); $this->leaderboard->delete($min[0]['leaderboard']['id']); } else { ...

java - Enforcing security on broadcast receiver without access to calling package -

java - Enforcing security on broadcast receiver without access to calling package - i've been working on android app receives intents several known applications. question whether there way calling bundle when broadcastreceiver receives intent? the situation don't have access calling bundle , cannot manipulate bundle manifest in way. familiar enforcing security using signature or permission phone call receiver isn't possible in instance. is there way this? help appreciated. may not elegant solution start logcat filter in code , start listening sending broadcast events, can retreive bundle info that. java android security broadcastreceiver

c# - using extension methods on int -

c# - using extension methods on int - i'm reading extension methods, , monkeying around them see how work, , tried this: namespace clunk { public static class oog { public static int doubleme(this int x) { homecoming 2 * x; } } class programme { static void main() { console.writeline(5.doubleme()); } } } and worked expected, extending int doubleme method, printing 10. next, beingness old c guy, wondered if this: namespace clunk { public static class boollikec { public static bool operator true(this int i) { homecoming != 0; } public static bool operator false(this int i) { homecoming == 0; } } class programme { static void main() { if ( 7 ) { console.writeline("7 true"); } } } } i think if former work, latter ought work create such int used in boolean context phone call extension metho...

immutability - Does Scala have record update syntax for making modified clones of immutable data structures? -

immutability - Does Scala have record update syntax for making modified clones of immutable data structures? - in mercury can use: a = b^some_field := somevalue to bind a re-create of b, except some_field somevalue instead of whatever in b. believe haskell equivalent like: a = b { some_field = some_value } does scala have "modifying" immutable values. alternative seems to have constructor straight sets every field in instance, isn't ideal (if there invarients constructor should maintaining). plus clunky , much more fragile if had explicitly pass every other value in instance want have modified re-create of. i couldn't find googling, or in brief survey of language reference manual or "scala example" (which have read start-to-finish, haven't absorbed of yet, may in there). i can see feature have weird interactions java-style access protection , subclasses though... you can utilize case classes this, don't have to. case...

php - How does facebook push data to news feed? -

php - How does facebook push data to news feed? - i curious how facebook pushes info browser in news feed. new info shows @ top of feed without reloading page or clicking button facebook accomplish polling server through ajax @ set interval or somehow force new info server client unprovoked? if language or api utilize this? it's called 'long polling', or 'comet'. there different ways perform server push mutual way maintain connection open while receives info (it has drawbacks browser have limit of number of open connections host). facebook had open-sourced tornado web servers, can handle lot of open connections (which can problem have lot of users, using apache example). in moment receive ajax response, perform new request, waiting next response. php javascript ajax polling

objective c - Comparison of Date/Time with unknown format -

objective c - Comparison of Date/Time with unknown format - i have time value in output first := "updated_time" = 1308318422; (unix timestamp, returning "stream" table facebook) second := "created_at" = "thu jul 14 15:24:51 +0000 2011"; ( time of twitter post, don't type of format is). i have compare both date/time. have list recent come first , on. what logic? code preference appreciate :) in advance convert both values nsdate objects , utilize compare: method. the first can converted getting int value of updated_time , using [nsdate datewithtimeintervalsince1970:updatedtimeint] . the sec can converted nsdateformatter object. objective-c ios4

Returning SQL rows with data concated per row in access -

Returning SQL rows with data concated per row in access - in access have table id| rooms | notes| 78| 234| | 3 | 231| key | 78| 195| | 3 | 164| | i want sql query take id , combine them 1 row each like 78 -> 234,195 3->231, 164 -> key i want combine rows in query no new table unfortunately you'll have build function this, thankfully access supports utilize of vba functions within of sql query. for illustration function concatenate rim's based on given id follows: public function myrooms(lngid variant) variant dim rstrooms dao.recordset if isnull(lngid) exit function set rstrooms = "select rooms tblbookings id = " & lngid while rstrooms.eof if myrooms <> "" myrooms = myrooms & "->" myrooms = myrooms & rstrooms!rooms rstrooms.movenext loop rstrooms.close end function now query can this: select id, myrooms([id...

ios - Multiple custom cell types per table UITableView (iPhone) -

ios - Multiple custom cell types per table UITableView (iPhone) - i've been searching everywhere on apple.developer , stackflow , haven't come clear, standard , proper way of handling this. i'm looking how represent more 1 customized cell type in table. also, there other tables in app potentially reuse customized cells. most of time, tables have same cell type repeated on , over. in few cases, have table couple types of complex custom cells. listed below different ways i've learned can this. i've tried each 1 , work i'm unsure of "proper" way , way apple won't reject. 1) programatically - ultimately, best selection performance. if there's way can draw complex customized cells in interface builder, improve choice. i'm trying avoid. 2) a customized cell class separate xib - each customized cell has own header/implementation/xib , subclass of uitableviewcell. single cell in xib has file owner set specific uitableviewcontroll...

android - Is there a way for monkeyrunner to look at call and sms history on a device? -

android - Is there a way for monkeyrunner to look at call and sms history on a device? - is there way me have monkeyrunner able @ phone call , sms history without using sqlite3? before, using popen adb shell "sqlite3 /data/data/com.android.providers.contacts/databases/contacts*.db 'select * calls'" , while works on emulators not work on non rooted devices. is there way similar without rooting device? did seek using monkeyrunner startactivity, broadcastintent. believe using broadcastintent can phone call activity launching com.android.contacts/.dialtactsactivity android sqlite3 monkeyrunner

android - How do I mirror output to HDCP-compatible devices only? -

android - How do I mirror output to HDCP-compatible devices only? - we have client requirement android tablet application used live streaming allow hdcp compatible devices mirroring. if non hdcp compliant device connected application should block hdmi output mirroring. have gone through android developer website , see there drm api can used content management not able determine if same can used checking hdcp compliant. any tips on how can implement helpful. why want stream, let's raw video, hdcp compatible device not benefit hdcp? mean want protect whatever mirror using hdcp , way want hdcp compliant devices decrypt it? if case, should take care of encrypting content hdcp (i dunno if possible on android tablets). rest handled handshaking when there device connected. android tablet drm hdcp

iphone - Stop UIWebView from loading a specific image using its 'id' -

iphone - Stop UIWebView from loading a specific image using its 'id' - hi stop uiwebview loading specific image, problem images url changes, id (id="header1_headerimg") stays same. the html on web page: < img alt="equestria daily" height="350px; " id="header1_headerimg" src="http://4.bp.blogspot.com/-ws5xlbti47e/thdwhulor4i/aaaaaaaaht8/cdqxivfxb9k/s1600/newdefaultbannerappstra.png" style="display: block" width="1100px; "> i want blocked in uiwebview. no cannot edit pages html. thank you. i think reply question [webview stringbyevaluatingjavascriptfromstring:[nsstring stringwithformat:@"document.getelementbyid('header1_headerimg').style.display='none'"]]; iphone html c ios

javascript - Problem with JQGrid in Modal Dialog after reload page -

javascript - Problem with JQGrid in Modal Dialog after reload page - i have give thanks helping me find solution of lastly question: jquery - problem modal dialog after reload page in div. solved using "class identifier" instead of "id". but i'm stuck on problem. in modal dialog have jqgrid: in example.jsp press button "reload". then, in "maincontent", appears button "find", open modal dialog jqgrid working. but if press 1 time again "reload" button , "find" modal dialog appears, jqgrid in doesn't show result! 'cause seemed "creating elements same id" problem, seek phone call jqgrid class identifier, nothing. here code. example.jsp: <script type="text/javascript"> $(document).ready(function() { $('#button1').button().click(function() { $("#maincontent").html('').load("example_1.jsp"); ...

newsletter - How to add word news letter document in the body of the email using Java? -

newsletter - How to add word news letter document in the body of the email using Java? - i trying send news letter includes images , links. have template designed in word document format. there way attach word document in body of email contents using java mail? here illustration of email attachment: http://www.jguru.com/faq/view.jsp?eid=30251 btw if inquire me i'd recommend send email without attachment create email body template have. open template using ms word, save html file. have html template. open , find it. sure find insert text. can implement sort of simple template engine (by replacing kind of marks real text) or utilize ready template engines (like velocity.) result can generate looking email pictures etc , without attachments. remember: 10% of recipient open email , 10% of them open attachment. java newsletter

visual studio - popup a dynamic name file using C# -

visual studio - popup a dynamic name file using C# - i building c# programme store update in notepad (.txt files) , sorting using date used string = string.format("updates-{0:dd-mm-yyyy}.txt", datetime.now); and tring create display function popup file using system.diagnostics.process.start("notepad.exe", "update.txt"); the problem every day update file renamed using new date question :- there function,code or allow me popup file name changing? , um doing using c# console application i @hanks reply absolutely correct, may kind create more precise, or addupted answer, can seek this, "current" file name: string filename = "updates-" + datetime.now.tostring("dd-mm-yyyy") + ".txt"; and after execute system.diagnostics.process.start("notepad.exe", @"complete path text file"); hope helps. c# visual-studio visual-studio-2008

internet explorer - How to use Capybara for IE8 in pure Ruby (without Rails)? -

internet explorer - How to use Capybara for IE8 in pure Ruby (without Rails)? - i've been using next code test run using capybara ie8 in pure ruby, i.e. not rails app every time run script ie8 pops firefox pops , tests run through firefox leaving ie8 sitting in background: $:.unshift(file.dirname(__file__) + '/../../lib') begin require 'rspec/expectations'; rescue loaderror; end require 'rubygems' require 'capybara' require 'capybara/dsl' capybara.run_server = false capybara.app_host = 'http://www.google.com' require 'selenium-webdriver' selenium::webdriver.for :internet_explorer capybara.default_driver = :selenium require 'cukesalad' begin require 'rspec/expectations'; rescue loaderror; require 'spec/expectations'; end this isn't old maybe can find useful info it: run capybara & cucumber features in net explorer on remote windows ruby internet-explorer internet-e...

Python XMl Parser with BeautifulSoup. How do I remove tags? -

Python XMl Parser with BeautifulSoup. How do I remove tags? - for project decided create app helps people find friends on twitter. i have been able grab usernames xml pages. illustration current code can <uri>http://twitter.com/username</uri> xml page, want remove <uri> , </uri> tags using beautiful soup. here current code: import urllib import beautifulsoup doc = urllib.urlopen("http://search.twitter.com/search.atom?q=travel").read() soup = beautifulstonesoup(''.join(doc)) info = soup.findall("uri") don't utilize beautifulsoup parse twitter, utilize api (also don't utilize beautifulsoup, utilize lxml). reply question: import urllib beautifulsoup import beautifulsoup resp = urllib.urlopen("http://search.twitter.com/search.atom?q=travel") soup = beautifulsoup(resp.read()) uri in soup.findall('uri'): uri.extract() python beautifulsoup

MySQL Trigger: Can I use Update? -

MySQL Trigger: Can I use Update? - create trigger history before update on bestbuy each row begin if new.saleprice <> old.saleprice insert history_price (modelnumber,saleprice) values (old.modelnumber,old.saleprice); elseif new.saleprice = old.saleprice set new.saleprice = old.saleprice; end if; end my question: valid utilize create trigger history before replace on bestbuy no, not - valid events insert, update , delete. are sure updating info replace ? - alter that, update insert ... on duplicate key update - trigger run edit address comments take @ insert ... on duplicate key update syntax on mysql site - it's ordinary insert, clause in - think improve performer replace , because not delete record insert again, updates values mysql triggers

How to patch linux kernel to add gyroscope support -

How to patch linux kernel to add gyroscope support - i'm trying utilize mpu3000/3050 invensense embedded linux (arm-based lpc3141 board, embedded artists). found interesting patch on internet https://patchwork.kernel.org/patch/703991/ how can implement in kernel? read this article detailed instructions on how apply patch. warning: kernel patches quite highly specific version of linux developed for, if kernel version different 1 patch made may encounter problems. edit: had @ particular patch , creates new file (mpu3050.c) , modifies drivers/input/misc/makefile , drivers/input/misc/kconfig. if else fails new file should created, , mods existing files can done manually. linux-kernel patch linux-device-driver embedded-linux i2c

ruby on rails - Does anyone know the options for Devises `authenticate_user!`? -

ruby on rails - Does anyone know the options for Devises `authenticate_user!`? - like title says, i'm looking options devises automatic class authenticate_user! , specifically, want redirect_to '/' , not '/users/sign_in' do following: in config/initializers/devise.rb: config.warden |manager| manager.failure_app = customauthenticationfailure end create new file called lib/custom_authentication_failure.rb: class customauthenticationfailure < devise::failureapp protected def redirect_url root_path #or whatever route in app points '/' end end and config/application.rb: config.autoload_paths += %w(#{config.root}/lib) ruby-on-rails authentication user devise

flex3 - How to change an image color in flex 3? -

flex3 - How to change an image color in flex 3? - i have uncertainty in flex 3. i'm trying alter image color in flex 3, can't still. think have alter image color using pixels, don't know how it. can help me out? read bitmap, bitmapdata , colortransform. here's illustration of using colortransform class. hope, help you. flex flex3 bitmap

c# - Make it unable to work in mainscreen when popup is open? -

c# - Make it unable to work in mainscreen when popup is open? - i implementing application, , when start application, have main screen maximized on whole screen, popup appears. want long pop isn't closed, user can't in main screen behind popup (like when have error message or something)? property can't find out. can help me out please? working in wpf , c#. popups not not meant sort of thing think. can utilize normal window , showdialog modal popup. if don't want frame , can style respectively setting allowstransparency true , windowstyle none . c# wpf mvvm popup

how to delete .svn directory in not a working copy -

how to delete .svn directory in not a working copy - i copyd directory working copy, found .svn directory in copyd directory. want delete .svn directory, tried rm -fr .svn, operation not permitted. so, how delete .svn directory? give thanks you if says not permitted means there problem access rights. if can, run root. also, svn keeps .svn directory in each project directory. so, you'll have like sudo find -type d -name "*.svn" | xargs sudo rm -rf note: both uses of sudo above needed when there problems access rights why related access rights? see here. mihai@fomalhault:/tmp$ sudo mkdir test [sudo] password mihai: mihai@fomalhault:/tmp$ rm -rf test/ rm: cannot remove directory `test': operation not permitted running strace gives a unlinkat(at_fdcwd, "test", at_removedir) = -1 eperm (operation not permitted) and what's reported svn

hyperlink - Facebook Dialog link description always includes site description as well as my custom description -

hyperlink - Facebook Dialog link description always includes site description as well as my custom description - i posting message users stream using ios sdk. post includes link picture. when posting provide custom description goes beneath caption. done setting description property detailed on documentation: http://developers.facebook.com/docs/reference/dialogs/feed/. when description appears, followed site details. post links imgur, illustration if message "this image", actual post read: "this image imgur used share photos social networks , online communities, , has funniest pictures on internet." i want post description without imgur website info beingness included. possible? how go doing this? thanks in advance. well i'm not sure how prepare problem ios sdk i'm not ios developer, still may have idea, did seek open graph tags ? use url linter debug: http://developers.facebook.com/tools/lint/ and here's sample snippet: ...

c++ - How do I properly delete an array of doubles through a pointer after the pointer has been iterated? -

c++ - How do I properly delete an array of doubles through a pointer after the pointer has been iterated? - i have created array of doubles using next code: double *points = new double[(ii+1)*(jj+1)*(kk+1)*3]; i realize in order delete array, have is: delete[] points; however; array created in function (called create_points) passes address of first element follows: return &points[0]; the code calls function iterates through address: double *address = create_points(x_dim,y_dim,z_dim); for(int k=0; k<x_dim+1; ++k) for(int j=0; j<y_dim+1; ++j) for(int i=0; i<z_dim+1; ++i) { v[p_count].x = *address; ++address; v[p_count].y = *address; ++address; v[p_count].z = *address; ++address; ++p_count; } now question is, how delete array of doubles address used access? can go delete[] address , or have other way? you cannot delete[] address , doing ...

iphone - Deselecting a row in table view does not animate -

iphone - Deselecting a row in table view does not animate - i have view controller manages table view. understanding table cell deselected automatically if force viewcontroller , pop table view. however, in same class (that utilize few times), there 1 instance of class when cell deselected not animated (it'll turn bluish , normal without animating). why did happen? have few instances of class happens 1 of them. might causing this? from experience cells not automatically deselected if push/pop view controller (at to the lowest degree not when using navigationcontroller), unless add together code te deselect ! may automatically deselected if doing [tableview reloaddata] in viewwill/didappear (or in process started in these methods). did seek add together in viewdidappear ? nsindexpath *indexpath = [tableview indexpathforselectedrow]; if (indexpath != nil) { [tableview deselectrowatindexpath:indexpath animated:yes] } iphone cocoa-touch uitableview ...

html - making images on a website/page unsaveable? -

html - making images on a website/page unsaveable? - i have been trying find way show image on webpage create sure user wont able save it, knows about? you can create difficult, you cannot create impossible. if image shows on screen, can screenshotted. html image

biztalk - Transaction with FTP adapter -

biztalk - Transaction with FTP adapter - i want pull server (no delete), parse file in pipeline component, process file, if goes successfully, want adapter delete file. i thinking enlist parsing pipeline context, way, picturing if file cannot parsed, file not message box, hence deemed failed transaction, question, adapter participate in transaction? in other words, goal instruct adapter delete file server only when pipeline processed (transaction commited), file left untouched on server if pipeline failed (transaction rolled back, no message commited msg box) is achievable? in advance i think little experiment in order. biztalk, part of it's nature, not delete until has been peristed message box. beingness said, persitence might happen before pipeline execution. so, receive adapter receives file, perists message box , deletes file. message might subsequently fail in pipeline. if case, message bad format , have subsequently resubmitted sender. if want mainta...

javascript - Why is this getting "invalid argument" error in IE8? (window.open) -

javascript - Why is this getting "invalid argument" error in IE8? (window.open) - function popuplink(link){ var popup = window.open(link,'facebook share','menubar=0,directories=0,toolbar=0,resizable=1,status=0,location=0,width=500,height=350'); if(!popup){ homecoming true; }else{ homecoming false; } }; popuplink('http://www.facebook.com/sharer.php?u=http%3a%2f%2fmsn.com%2f'); i want pop link... window names cannot include spaces in ie. alter 'facebook share' 'facebookshare' javascript html css templates

What is the correct way to use mongodb on heroku -

What is the correct way to use mongodb on heroku - i have app hosted on heroku on vps. using mongodb on app mongoid. want know right way define database connection in mongoid.yml same file works on both heroku , vps. heroku expects mongohq_url in production database while vps needs default db mapping: correct heroku: production: uri: <%= env['mongohq_url'] %> right vps: production: <<: *defaults host: localhost database: grbr_production pushing mongoid.yml separately heroku , vps real pain. there way can create 1 unified entry works it might easiest add together mongohq_url environment variable vps points mongodb instance on localhost: mongodb://localhost/grbr_production mongodb heroku mongoid

Plugins for Java Spring application -

Plugins for Java Spring application - suppose have java spring -based client application, sends request server , process response. uses command pattern response processing. now find , load these commands in run-time. how implement it? i aware of "plugin" technologies, such jpf , osgi huge overkill me. thinking using spring's autowiring. recommend it? if looking nice, lite , functional plugin framework, have @ java simple plugin framework. have made extensive utilize of , works great. using spring's autowiring, have consider implications around it. eg. can autowire spring beans etc etc. java spring autowired

javascript - how can i use pageLoad function in multiple usercontrols -

javascript - how can i use pageLoad function in multiple usercontrols - i have 3 usercontrols in each used pageload function in javascript , usercontrols in page , page has himself pageload function. pageload function of lastly usercontrol registered in page fired , others not fired <script type="text/javascript"> ... function pageload() { alert('page load - uc1'); ..... } ... please help me how fire functions thanks you may define javascript function each command , execute on application.init , pagerequestmanager.endrequest events: client side: function controlspecificpageloadfunction(){ alert("hello, pageload!"); } code behind: if(!ispostback) { var script = "sys.application.add_init(controlspecificpageloadfunction); sys.webforms.pagerequestmanager.getinstance().add_endrequest(controlspecificpageloadfunction)"; scriptmanager.registerstartupscript(this, this.gettype(), "thiscontrolpagelo...

xml - I get an error that says I am not allowed -

xml - I get an error that says I am not allowed - error code why not allowed?or how can prepare it? file c:\users\randy\documents\school\xml\week5\tutorial.05x\case4\mealstxt.xml not valid. content model of element 'recipes' disallows element 'recipe' @ position. error location: recipes / recipe details vc: element valid: content model of element 'recipes' disallows element 'recipe' @ position. error number 2 file c:\users\randy\documents\school\xml\week5\tutorial.05x\case4\mealstxt.xml not valid. content model of element 'recipes' disallows element 'heading' @ position. error location: recipes / heading details vc: element valid: content model of element 'recipes' disallows element 'heading' @ position. <?xml version="1.0" encoding="utf-8"?> <!-- webchef recipes author: randy white date: 7/10/2011 filename: ...

c# - The model item passed into the dictionary is of type 'MyType', but this dictionary requires a model item of type 'MyType' -

c# - The model item passed into the dictionary is of type 'MyType', but this dictionary requires a model item of type 'MyType' - yes, went through questions similar titles. none of them seem match situation i'm in. it's programmer sending wrong object type view. this exact error message i'm receiving: the model item passed dictionary of type 'is.extensions.models.contactselectlist', dictionary requires model item of type 'is.extensions.models.contactselectlist'. i started moving around views , model classes in our solution in effort create 'framework-like'. mean views/models have used in multiple mvc applications , views/models specific mvc application. issue started áfter moving contactselectlist view. mutual views in project uses razor generator compile them. i have in view: @model is.extensions.models.contactselectlist and when debugging can see model i'm sending renderpartial method of same type: s...

lisp - Lispy dialects with good multi-dimensional array programming support -

lisp - Lispy dialects with good multi-dimensional array programming support - are there lisp or scheme dialects have back upwards array , linear algebraic manipulations. back upwards not mean interfaces blas/lapack, efficient array primitives in language itself. consider efficient if can hold own against numpy, say. have heard stalin fast new lisp , not familiar syntactically convenient manipulation , efficient representation of multi-d arrays in such languages. pointers (no pun intended) appreciated if supported personal experiences. arrays in standard mutual lisp can multi-dimensional. the array dictionary describes available operations. cl-user 12 > (defparameter *a* (make-array '(3 2 4) :initial-element 'foo)) *a* cl-user 13 > *a* #3a(((foo foo foo foo) (foo foo foo foo)) ((foo foo foo foo) (foo foo foo foo)) ((foo foo foo foo) (foo foo foo foo))) cl-user 14 > (setf (aref *a* 1 1 2) 'bar) bar cl-user 15 > *a* #3a(((foo foo fo...

listview - Delphi: Canvas.FillRect in List View -

listview - Delphi: Canvas.FillRect in List View - on alter of text of list view's subitem need brush , fill whole row: procedure tform1.listviewdrawitem(sender: tcustomlistview; item: tlistitem; rect: trect; state: townerdrawstate); begin if item.subitems[2]='done' begin sender.canvas.font.color := clblack; sender.canvas.brush.color := clgreen; sender.canvas.brush.style := bssolid; sender.canvas.fillrect(rect); end; end; but sender.canvas.fillrect(rect) fill rect of subitem. how fill whole row? the question asked on base of operations of delphi: how draw little icons in list view on customdrawitem thanks! first, if have 3 columns, caption , subitems[0] , , subitems[1] , remember? there no subitems[2] ! anyhow, easy. need very, little modification of old code. procedure tform1.listview1drawitem(sender: tcustomlistview; item: tlistitem; rect: trect; state: townerdrawstate); var i: integer; x1, x2: integer; r: t...

classpath - Use existing Java classes from Jython REPL? -

classpath - Use existing Java classes from Jython REPL? - i have massive, unfamiliar java codebase need utilize in 1 of projects, , unfortunately it's 1 of situations nil documented, , few things documented of " setfoo(foo foo) - sets foo. " variety. documentation generated javadoc not helpful be. i'm more of lisp , python guy myself, first thought larn lot interactively playing of relevant classes. come in jython repl. problem can't figure out how set the...the whatever (classpath?) utilize them. assume have 2 directories containing subdirectories containing .java files: ~/project/foo/src/ , ~/project/bar/src/ . thanks in advance. it sounds first need compile java classes (you've referenced src directories in question). once have classes compiled, can reference them via classpath. e.g. >>> import sys >>> sys.path.append(r'c:\temp\sample.jar') >>> org.my.package import myclass more info in ...

Eclipse, Android Plug-in, Install New Software just says "pending" -

Eclipse, Android Plug-in, Install New Software just says "pending" - i'm trying install android plug-in eclipse (32 bit windows 7 - eclipse-java-indigo release), next instructions here. mike plate the problem eclipse says "pending", in install new updates window, nil else seemingly going on, after set in url: google android eclipse this problem proxy settings. if you're behind firewall (or using settings configured under one) go window -> preferences -> general -> network connections , configure properly. android eclipse

Java.lang.throwable and error codes -

Java.lang.throwable and error codes - i have question java.lang.throwable , cover error codes mean if added in web.xml: <error-page> <exception-type>java.lang.throwable</exception-type> <location>/servicenotavailable</location> </error-page> will applicable error codes 400,404,503,500, , don't need create customization them? i think need mix of strategies. using <exception-type>java.lang.throwable</exception-type> grab (not all) of error 500s , none of 404s it hence good practise grab individual errors throwables. you can add together <error-code> tag each of those <error-page> <error-code>404</error-code> <location>/errors/error.jsp</location> </error-page> you'll have define each error-code individually in web.xml. java-ee error-handling web.xml http-status-codes

Late binding in jquery? -

Late binding in jquery? - there table has 1 row: <table> <tr><td><span class="removeitem"></span></td></tr> </table> i utilize bind function class: $('.removeitem').bind('click', function() { $(this).parent().remove(); homecoming false; }); later, add together rows same class name (.removeitem) table: var newrow = '<tr><td><span class="removeitem"></span></td></tr>'; $(table).append(newrow); when click on first row item, removed. dynamically added 1 not. why this? use event delegation placing handler on table delegate() [docs] method: $('table').delegate('.removeitem','click', function() { $(this).closest('tr').remove(); homecoming false; }); ...you'll want place id on table in order narrow selection. now click events bubble table invoke handler if item clic...

winforms - transition between images for picturebox in c# -

winforms - transition between images for picturebox in c# - possible duplicate: transition of images in windows forms image box i utilize code below alter images in picturebox every 5 seconds, it's not looking when changing image: want transition effect between images. used code private void backgroundworker1_dowork(object sender, doworkeventargs e) { bitmap[] pictures = new bitmap[9]; pictures[0] = new bitmap(@"library images\cf3.jpg"); pictures[1] = new bitmap(@"library images\cf4.jpg"); pictures[2] = new bitmap(@"library images\l1.jpg"); pictures[3] = new bitmap(@"library images\l2.jpg"); pictures[4] = new bitmap(@"library images\l3.jpg"); pictures[5] = new bitmap(@"library images\l4.jpg"); pictures[6] = new bitmap(@"library images\l5.jpg"); pictures[7] = new bitmap(@"library images\l6.jpg"); pi...

android - Faster indexing in database and sort with criteria time -

android - Faster indexing in database and sort with criteria time - well have database few tables , not have id. false id using datetime field (yyyy-mm-dd-hh-mm-ss) , field string. works , great sorting...but slow :), slow mean big error 'primary' key string, , connection between tables made according filed. because datetime field unique filed had... how should create faster, mean easy if sql database create foreign key , it. someone might 'why don't utilize integer', have lot of creation , deletions , if utilize int complicated maintain tables ordered , because of frequent deletions ids 1,22,55,79... i mean not know right way , why asking android database sqlite

javascript - Unable to save data set by iframe in Dynamics CRM 2011 -

javascript - Unable to save data set by iframe in Dynamics CRM 2011 - i’m having iframe javascript running, dynamically add together more textboxes page, according how many dates need add. when pushing send button on iframe page i’m able set value on dynamics crm form using: parent.document.forms[0].all.new_running.value = koersler; where koersler info combined textboxes. this works fine, when saving form, info in textbox, new_running, not beingness saved. i have tried set setsubmitmode(“always”) on save event on form, little luck sine dsb_running seem null, though info can seen on page. any hints on how save data??? looking forwards help. could issue of form command not matching attribute data. from sdk: for script development work outside of microsoft dynamics crm, developers may accustomed referring page elements using document.getelementbyid method. microsoft dynamics crm form scripts method not supported. of import recogni...

javascript - Check if text is in a string -

javascript - Check if text is in a string - i want check text in string instance have string str = "car, bycicle, bus" and have string str2 = "car" i want check if str2 in str. i newbie in javascript please bear me :) regards if(str.indexof(str2) >= 0) { ... } or if want go regex route: if(new regexp(str2).test(str)) { ... } however may face issues escaping (metacharacters) in latter, first route easier. javascript

javascript - Invalid JSON Primitive when using a variable -

javascript - Invalid JSON Primitive when using a variable - i have code makes ajax phone call mvc controller method , it'll work without hitch if this: var obj = '{"titlename":"whatever"}'; $.ajax({ type: "post", url: "/titles/yo", contenttype: "application/json; charset=utf-8", datatype: 'json', data: obj, success: function (result) { $("#title_field").html(result.titlename); } }); but if this: var stringed="whatever" var obj = '{"titlename":stringed}'; $.ajax({ type: "post", url: "/titles/yo", contenttype: "application/json; charset=utf-8", datatype: 'json', data: obj, ...

Android : GLSurfaceView sometimes crashes when activity is closed -

Android : GLSurfaceView sometimes crashes when activity is closed - in 9 months of working on project i've had bug 2 or 3 times, rare still know causing it. when close activity (by pressing on home) activity crashes , send me next stack error/androidruntime(2764): fatal exception: glthread 47 error/androidruntime(2764): java.lang.runtimeexception: eglswapbuffers failed: egl_bad_surface error/androidruntime(2764): @ android.opengl.glsurfaceview$eglhelper.throweglexception(glsurfaceview.java:1077) error/androidruntime(2764): @ android.opengl.glsurfaceview$eglhelper.swap(glsurfaceview.java:1035) error/androidruntime(2764): @ android.opengl.glsurfaceview$glthread.guardedrun(glsurfaceview.java:1333) error/androidruntime(2764): @ android.opengl.glsurfaceview$glthread.run(glsurfaceview.java:1116) it seems error coming core glsurfaceview code rather own code. any ideas ? i have been trying identify root cause exception, , related one: egl_bad_alloc. i...

Running Selenium from eclipse + browser says file not found for base url -

Running Selenium from eclipse + browser says file not found for base url - i trying run selenium eclipse. code executing - selenium selenium = new defaultselenium("localhost",4444,"*iexplore","http://www.google.com"); selenium.start(); the browser opens baseurl displays 404 error saying 'file not found' (be website specify). illustration in case, message shown in image - http://i51.tinypic.com/2cpxoio.jpg can please help me out this? proceed statements above - selenium.open("/"); selenium.windowfocus(); selenium file-not-found

ruby - Problem with string -

ruby - Problem with string - i'm doing script in ruby read pack files , see contain. wrote simple script yesterday gives me headache: arch = file.new(*file_name*, "r") z = arch.sysread(1).unpack('h*') puts z content = arch.sysread(32) the variable z above has value of 10. if pass sysread error, yet if define variable x , assign value of 10 , pass in, runs ok. why can't pass z sysread ? read file binary, "rb" instead of "r" , , said gives error, error? anyway, unpack function returns array , in case, hexadecimal number string. want this: content = arch.read(z.first.to_i(16)) . this code makes more sense (if trying think): arch = file.open("filename", "rb") # open file binary z = arch.read(1).bytes.first # first byte integer content = arch.read(z) # read next z bytes ruby string integer fixnum

css - Pseudo-classes for li list -

css - Pseudo-classes for li list - i'm experimenting here pseudo-classes , trying style class. have unordered list multiple sub unordered lists , on. i want create sure first level of li tags been set float left. here html <body> <div id="mainmenu"> <ul id="nav"> <li><a href="#">home</a></li> <li> <a href="#">about</a> <ul> <li><a href="#">the product</a></li> <li><a href="#">meet team</a></li> </ul> </li> <li> <a href="#">contact</a> <ul> <li> <a href="#">business hours</a> <ul> <li><a href="#">...

How to show Silverlight Toolkit Busy Indicator during calculation? -

How to show Silverlight Toolkit Busy Indicator during calculation? - i'm having problems implementing command shows busy indicator, here scenario: have simple view busy indicator , textblock, bind viewmodel (that following). public class viewmodel { private bool _isbusy; public bool isbusy { { homecoming _isbusy; } set { _isbusy=value; onpropertychanged("isbusy"); } } private string _text; public string text { { homecoming _text; } set { _text = value; onpropertychanged("text"); } } public void callme() { isbusy = true; text = static.performcalculation(); isbusy = false; } } so far pretty simple, no?? problem when have method callme(). have show , hide busy indicator while calculation beingness done, thougth reason calculations , isbusy property notifications done on s...

Want to learn graphics using Skia on Ubuntu -

Want to learn graphics using Skia on Ubuntu - i want larn graphics programming, , want utilize skia library. how begin on ubuntu? use r1236 version. newer versions of skia have issues on linux. svn checkout http://skia.googlecode.com/svn/trunk -r1236 // new url: svn checkout http://skia.googlecode.com/svn/trunk_no_commit -r1236 cd trunk skia has font paths hard coded, want alter that. edit src/ports/skfonthost_linux.cpp search "sk_font_file_prefix" change "/usr/share/fonts/truetype/msttcorefonts/" "/usr/share/fonts/ttf/" ./gyp/gyp_skia create you should have libskia.a. #include "skcanvas.h" #include "skgraphics.h" #include "skimageencoder.h" #include "skstring.h" #include "sktemplates.h" #include "sktypeface.h" // g++ main.cpp -wl,-rpath,./ -l. -lskia -iinclude/core -iinclude/config -iinclude/images -lpthread -lfreetype -lpng -o main int main (int argc, ...

html - CSS Odd/Even td nested -

html - CSS Odd/Even td nested - i trying come style rows odd/even styles. row going marked class odd/even style needs apply containing td/th. the reason style can't placed straight on row because applying background colors row instead of td/th causes inconsistent results in browsers. when apply color td/th causes problem in nested scenarios. <html><head><title>nesting</title></head><body> <style type="text/css"> .even td, .even th { background-color: #fbfcfd; } .odd td, .odd th { background-color: #feffff; } </style> <table width="100%"> <tr class="even"> <th>test</th> <td>test</td> </tr> <tr class="odd"> <th>test</th> <td>test</td> </tr> <tr class="even"> <th>test</th> <td...

python - Is there a way to cache the fetch output? -

python - Is there a way to cache the fetch output? - i'm working on closed scheme running in cloud. what need search function uses user-typed-in regexp filter rows in dataset. phrase = re.compile(request.get("query")) info = entry.all().fetch(50000) #this takes around 10s when there 6000 records result = x x in info if phrase.search(x.title) now, database won't alter much, , there no more 200-300 searches day. is there way somehow cache entries (i expect there no more 50.000 of them, each no bigger 500 bytes), retrieving them won't take >10 seconds? or perhaps parallelize it? don't mind 10cpu seconds, mind 10 sec user has wait. to address answers "index , utilize .filter()" - query regexp, , don't know indexing mechanism allow utilize regexp. since there bounded number of entries, can memcache entries , filtering in memory you've outlined. however, note each memcache entry cannot exceed 1mb. can fetch 32mb...

php - How to get the price of my Associated products in Magento -

php - How to get the price of my Associated products in Magento - i using magento 1.4.1 i have configured product set 2 associated products. here\\’s illustration of scenario right now. i have set configurable product named shoe , has associated product big shoe & little shoe. set pricing of configurable product shoe. has price. $80. set $20 cost of associated product big shoe , $10 on little shoe. when seek purchase little shoe, i\\’m getting cost of configurable product shoe , that\\’s $80. same thing when purchased big shoe. want cost of associated product , isn\\’t happening how that? please help me. in advance , have great day! thanks! how cost of associated products sounds need simple configurable products module (scp): http://www.magentocommerce.com/magento-connect/matt+dean/extension/596/simple-configurable-products php magento

C# .NET: Will a BinaryWriter flush when the FileStream buffer is filled? -

C# .NET: Will a BinaryWriter flush when the FileStream buffer is filled? - i'm coming across trivial, appears info flushed disk (out of filestream's buffer) when info i'm buffering hits size of filestream's buffer. //use filestream buffer buffer info written, segments written desired. filestream writestream = new filestream(filename, filemode.append, fileaccess.write, fileshare.none, commandoperationbuffersize); binarywriter binwriter = new binarywriter(writestream); byte[] fullsize = new byte[commandoperationtotalsize]; //the binarywriter flush when filestream buffer nail binwriter.write(fullsize); //data flushes disk here! //if wait, wait 5 seconds if (commandoperation == "writewait" || commandoperation == "appendwait") { thread.sleep(5000); writestream.flush(); thread.sleep(5000); } writestream.close(); writestream.dispose(); binwriter.close(); can confirm case? filestream's buffer actual .flush() when filest...

asp.net mvc - NLog, Elmah + shared library -

asp.net mvc - NLog, Elmah + shared library - i trying come way create mutual library mvc projects. started off simple basecontroller , basemodel classes. easy stuff! now in projects either utilize elmah or nlog logging exceptions and/or tracing info. can give me ideas on best practices writing mutual library back upwards both? i utilize nlog base of operations logging. i've created little target nlog used route exceptions elma. you'll find @ https://github.com/ccellar/nlog-elmah-target. with target able utilize logger.*exception( ... ) log exception , pass elmah. asp.net-mvc elmah nlog

reporting services - SSRS two datasets need to use field from one dataset as a parameter in second? -

reporting services - SSRS two datasets need to use field from one dataset as a parameter in second? - the issue in field has info 1 record in info set pulled set stored proc (not touchable). using parameter in sec dataset. help appreciated. add parameter select parameter visibility hidden go default values: (screenshot of below) select "get values query" (and select first dataset , value field) in dataset 2 filter info new parameter i.e. select * xyz abc in (@param) ssrs-2008 reporting-services

Trying to log into Google Analytics via Python; stuck at 'Target feed is read-only' -

Trying to log into Google Analytics via Python; stuck at 'Target feed is read-only' - i'm trying ga via python , download business relationship info. here steps: assume i've gotten "auth" token , it's been assigned 'auth'. oh, , i'm in python interpreter, not program: >>> accountparams = urllib.urlencode({'auth':auth, 'dxp:tableid':'48085049'}) >>> business relationship = urllib.urlopen('https://www.google.com/analytics/feeds/accounts/default',accountparams) >>> business relationship = account.read() >>> business relationship 'target feed read-only' i recognize fact didn't error means i've achieved kind of limited success; expecting receive richer homecoming message 'target feed read-only' , i'm not sure go here. want this, think: http://code.google.com/p/ga-api-http-samples/source/browse/trunk/src/v2/accountfeedresponse.xml#1 i...

C: odd behaviour with nested loop and array -

C: odd behaviour with nested loop and array - i have array of int terminated '\0' created elsewhere in code. know it's null terminated because i've tested it. say, example, array [7, 8, 9, 11, 12, '\0'] when feed function: int edgesincluster(graph *g, int *nodes) { int count = 0; int = 0; int j = 0; while(nodes[i] != '\0') { while(nodes[j] != '\0') { if(i<j) { printf("%i %i\n", nodes[i], nodes[j]); count += isneighbour(g, nodes[i], nodes[j]); } j++; } i++; } homecoming count; } the printf outputting: 7 7 7 8 7 9 7 11 7 12 when should outputting: 7 8 7 9 7 11 7 12 8 9 8 11 8 12 9 11 9 12 11 12 which means reason either 'i' isn't beingness incremented (but can see is) or nodes[0] == '\0' know isn't true since loop 'j' works fine. so, ideas what's going on?...

asp.net mvc - Unable to disable "...potentially dangerous Request.Path..." in MVC 3 -

asp.net mvc - Unable to disable "...potentially dangerous Request.Path..." in MVC 3 - i'm aware there lot of posts on topic, no matter how hard seek (using detail within such posts) can't remove request validation mvc 3. by way of ugly, simple test have followed these steps:- open vs , create new sample mvc3 net application. above each on controller actions i've placed [validateinput(false)] attribute. edit root web.config <httpruntime requestvalidationmode="2.0" /> in <system.web /> section. whilst means can submit forms thing <script> in field, still can't work out how allow request.paths such http://localhost/mysampleapp/account/logon<script> . if phone call such url still "a potentially unsafe request.path value detected client (<)." does know how remove request validation in mvc 3 on .net 4.0? many thanks, you may find following blog post useful. personal advice avoid using suc...

multithreading - c# Task class and memory leak -

multithreading - c# Task class and memory leak - i have application handles info text file - reads line file handles , puts result in file. after handling 1 row handles next 1 until whole file done. rows file time-consuming handling. decided set handling-logic in separate thread , if handling takes longer 10 sec. kill thread. code this: public class handler { public void handle(string row) { // perform handling } } public class programme { private static bool handlerow(string row) { task task = new task(() => new handler().handle(row)); task.start(); // updated var waitresult = task.wait(timeout); // timeout 10 sec. if(waitresult == false || task.isfaulted) homecoming false; homecoming true; } public static void main() { foreach(var row in getrowstohandle()) handlerow(row); } } but somehow when running programme out of memory exception. seems memory not released properly. know ...