Posts

Showing posts from June, 2010

objective c - Augmented reality iphone -

is there sample "augmented reality" app iphone or ipod? you can use wikitude api augmented reality in iphone app , integrating api in application have use api key can registering on here http://w4client.mobilizy.mobi/w4/jsp/keygenerator.jsp (direct link). you can download api http://www.wikitude.org/developers hope integrate augmented reality in application.

sonarqube - Sonar Installation problem -

information installation using embedded database derbis problem : i run bin/windows-x86-32/startsonar.bat , click http://localhost:9000 on clicking this, following error: we're sorry, went wrong. please try in few minutes , contact support if problem persists. <%= link_to "go homepage", home_path %> do know error message. i message when database isn't correctly set (either local has issue, in case try fresh installation). or mysql database can associate has issue (wrong ' sonar.jdbc.username ' or ' sonar.jdbc.password ' in sonar.properties file.). or default port embedded database ( jdbc:derby://localhost:1527/sonar;create=true ) isn't available on server/workstation. if using mysql database (not case), need create first: mysql [localhost] {root} ((none)) > create database if not exists sonar character set utf8 collate utf8_general_ci; query ok, 1 row affected (0.01 sec) mysql [localhost] {root} ((none)...

jquery - Sending a selectbox value to fancy box -

http://jsfiddle.net/cr2sb/15/ please check link above; code there. want send value selectbox fancybox. need people... stuck on problem last 2 days, , have tried variety of stuff. until more info problem, since using jquery anyway recommend getting select element values : href:'index.php?incident_maincateid=' + $('#myselectboxsituation_found option:selected').val() . its cleaner , easier read.

android - Unregister BroadcastReceiver -

in app i've service register broadcastreceiver onstart() method: public void onstart() { if(something....) { intentfilter filter = new intentfilter(intent.action_screen_on); filter.addaction(intent.action_screen_off); screenreceiver = new screenreceiver(); registerreceiver(screenreceiver, filter); } else { if(screenreceiver != null) { unregisterreceiver(screenreceiver); } } } and works correctly. unregister broadcastreceiver within else , receive error: 01-25 09:30:03.730: error/androidruntime(11748): fatal exception: main 01-25 09:30:03.730: error/androidruntime(11748): java.lang.runtimeexception: unable start service com.myservice.service@460ce7d8 intent { cmp=com.myservice/.service (has extras) }: java.lang.illegalargumentexception: receiver not registered: com.myreceiver.screenreceiver@46079370 01-25 09:30:03.730: error/androidruntime(11748): @ android.app.activitythread.handleserviceargs(ac...

dynamics crm - After adding CRM web service reference, Retrieve and RetrieveMultiple seem to return XlmlElement -

i'm working crm 4 server. created simple console application , added web service reference using service resides @ http:///mscrmservices/2007/crmservice.asmx?wsdl now, according sdk, service's retrieve method should return businessentity , rerievemultiple should return businessentitycollection. however, in proxy created on project, these methods return xmlelement... what's problem? doing wrong? thanks! to solve problem had use crm sdk dlls , connect service via them. adding web reference didn't work expected no matter tried.

c - GCC looks for headers in /usr/local/include when compiling, but not for libraries in /usr/local/lib when linking. Why? -

i have installed in /usr/ distribution provided version of sqlite - version 3.4.2. have installed in /usr/local/ sqlite version 3.7.4. /usr/include/sqlite3.h defines sqlite_version_number 3004002 /usr/local/include/sqlite3.h defines sqlite_version_number 3007004 version 3007004 has function sqlite3_initialize(), version 3004002 not. $ nm -d /usr/local/lib/libsqlite3.so | grep sqlite3_initialize 00018e20 t sqlite3_initialize when compile following example program: #include <stdio.h> #include <sqlite3.h> // should fail if including /usr/include/sqlite3.h #if sqlite_version_number != 3007004 #error "sqlite version not 3.7.4" #endif int main() { printf( "%d\n", sqlite_version_number ); sqlite3_initialize(); return 0; } when compiled , linked (with gcc 4.2.4) preprocessor finds sqlite3.h header version 3.7.4 in /usr/local/include/, linker fails it's looking in /usr/lib/libsqlite3.so symbols. $ gcc -wall test.c -o cpp -...

javascript - How to turn this menu into a MultiLevel one? -

i found cool horizontal drop down menu: http://css-tricks.com/examples/diggheader/# and love use it, require multilevel. not clue how it. have searched tutorials on how create multilevel menu, can find downloads , demo previews. :-s can offer suggestions on how go making menu above multilevel? thank you i love css-tricks, can done in few ways. here quick example how suggest go this. html markup; <div id="nav"> <ul> <li> <a href="...">technology</a> <ul> <li><a href="...">apple</a> <ul> <li><a href="...">iphone</a></li> </ul> </li> <li><a href="...">design</a></li> </ul> </li> </ul> </div> notice <ul> within next <a href="...">apple</a> . css method; ...

What are industry standard best practices for implementing custom exceptions in C#? -

what industry standard best practices implementing custom exceptions in c#? i have checked google , there's great number of recommendations, don't know ones hold more credibility. if has links authoritative articles, helpful. the standard creating custom exceptions derive exception . can introduce own properties/methods , overloaded constructors (if applicable). here basic example of custom connectionfailedexception takes in parameter specific type of exception. [serializable] public class connectionfailedexception : exception { public connectionfailedexception(string message, string connectionstring) : base(message) { connectionstring = connectionstring; } public string connectionstring { get; private set; } } in application used in scenarios application attempting connect database e.g. try { connecttodb(aconnstring); } catch (exception ex) { throw new connectionfailedexception(ex.message, aconnstring); } it...

xslt - Retaining Line Feeds used in xml while transforming the xml using xsl -

i transforming xml using xsl.i xml oracle database.when transform unable see data in format stored.in particular node, line feeds used seen in xml when transform unable t see line feeds.all content in particluar node displayed in line. can 1 me in how include line feeds there in xml??? thanks raghav as suggested above, if you're using msxml check it's configured preserve whitespace. also check stylesheet doesn't use <xsl:strip-space> . also, if using xslt 2.0 whitespace stripped default elements defined in dtd or schema having element-only content. also, it's possible of course stylesheet code doing whitespace text nodes other copying them output.

SQL Server view optimization help (repeated subqueries, case when, and so on...) -

i need optimizing mssql view is, honestly, little complex knowledge. the view working rewrite using less subqueries or better structure in order simplify , use less server resources. the main issue case when same subquery repeated 4 times... tried understand if can put in variable , use case instead of repeating query each time seems not possible me... here's query select dbo.macchine.id_macchina, [...] dbo.view_cantieri.indirizzo, (select top (1) data_fine dbo.manutenzioni (id_macchina = dbo.macchine.id_macchina) order data_fine desc) ultima_manutenzione, datediff(day, (select top (1) data_fine dbo.manutenzioni manutenzioni_1 (id_macchina = dbo.macchine.id_macchina) order data_fine desc), getdate()) data_diff, (case when stato = 0 'grey' when stato = 2 'black' when stato = 1 (case when datediff(day, (select top (1) data_fine ...

How do you validate that a string is a valid MAC address in C? -

example: 12:45:ff:ab:aa:cd valid 45:jj:jj:kk:ui>cd not valid the following code checks valid mac addresses (with or w/o ":" separator): #include <ctype.h> int isvalidmacaddress(const char* mac) { int = 0; int s = 0; while (*mac) { if (isxdigit(*mac)) { i++; } else if (*mac == ':' || *mac == '-') { if (i == 0 || / 2 - 1 != s) break; ++s; } else { s = -1; } ++mac; } return (i == 12 && (s == 5 || s == 0)); } the code checks following: that input string mac contains 12 hexadecimal digits. that, if separator colon : appears in input string, appears after number of hex digits. it works this: i ,which number of hex digits in mac , initialized 0. the while loops on every character in input string until either string ends, or 12 hex digits have been detected. if current character ( *ma...

c# - Deserialize array into complex object -

my xml message looks like: <msg> <reply userid="sales" requestid="2" index="1" pagesize="1000" total="1" type="order"> <order id="12db8625cd4-000" owner="sales"> <qty size="1" working="0"/> <price limit="0.0"/> </order> <order id="12db8636344-000" owner="sales"> <qty size="1000" working="0"/> <price limit="0.0"/> </order> </reply> </msg> how can define order object read reply array? objects looks like: [xmlrootattribute("reply")] public class messagereply { [xmlattribute("userid")] public string userid { get; set; } [xmlattribute("requestid")] public string requestid { get; set; } [xmlattribute(...

c# - free online fileupload api .net -

there several sites fileupload.com,megaupload.com,rapidshare.com give free online space google docs & windows live sky drive good. now, want api through application (windows based) can upload or download files pro grammatically , importantly have log of entire process mailed me timely because if file getting expired or deleted on free servers user can notified mail. well, want because m fed os/hardware failures. so, thought creating background process create online backup of important directories need not everything. please suggest such api. not looking available software, know. thanks. my suggestion use dropbox . have api available, can read here . additionally, there 2 open-source wrapper libraries available c#: https://github.com/dkarzon/dropnet http://sharpbox.codeplex.com/

mvvm - WPF Combobox text binding issue on tab chage -

i working in wpf application follows mvvm. i have used binding in combobox's text property , combo inside tab. when ever switch tabs, combobox's text property cahnged getting fired , text set string.empty. if don't want text ever empty, try: view <combobox text={binding comboxtext} ... /> edit comment: <combobox text={binding comboxtext, targetnullvalue=somevalue} ... /> viewmodel /*inotifypropertychanged property*/ private string comboxtext; public string comboxtext { { return comboxtext; } set { if (value != comboxtext) {// value changed -> if (!string.isnullorwhitespace(value)) {// value not null, empty, whitespace -> comboxtext = value; } /*inpc code*/ } } }

c# - Get every 100th value in a loop -

is there way make cleaner , not use tempvalue have done here? update code had logic bug , didn't show i'm doing. i'm doing: var looptempvalue = noofpackets / 100; for(i=0; < noofpackets; i++) { \\dostuff if (i == looptempvalue) { looptempvalue = looptempvalue + (noofpackets / 100); uploadbackgroundworker.reportprogress(pross); } } update final this how fixed after feedback, thx guys. if (i % (noofpackets / 100) == 0 && != 0) { uploadbackgroundworker.reportprogress(pross); } if (i % 100 == 0 && != 0) { //your code } modulus fantastic checks this. more on modulus - http://www.vias.org/cppcourse/chap04_01.html update: added && != 0 0 case being true. if want use tempvalue instead of hard coding 100, solution: if (i % tempvalue == 0 && != 0) { //your code }

Call native contact insertion activity with a custom Android Account -

i have created own account (with custom account type well) use in combination application when want insert or edit contact through address book application on account, not trigger native activity custom 1 name fields... do know how can trigger full native 1 instead? it not possible. need add own activity. 1 way add profile action , handle it. see here: open activity edit contact in sync adapter . se also: honeycomb sync adapter features editing contacts although there no answer can find useful links found when dealing it in example can find here there edit intent enough replace action action_insert other case

c# - Difference between win32 dll and .net dll in the context of web application? -

my web application, written in wpf( xbap), p/invokes win32 dll ( player.dll written in c , c++). deployed application. when tried running web-application in ie, got error: system.dllnotfoundexception: unable load dll 'player.dll': specified module not found. (exception hresult: 0x8007007e) but when manually copied win32 dll c:\windows\system32 of client pc, worked, though web application uses several other .net dlls , didn't copy them manually. so i'm confused why need copy only win32 dll client pc, while not .net dlls? web-applications access them differently? -- the related topic : dllnotfoundexception when web application p/invokes win32 dll the rules locate assemblies (.net) not same locating native dlls. here 2 rule sets: assemblies: http://msdn.microsoft.com/en-us/library/yx7xezcf.aspx win32 dlls: http://msdn.microsoft.com/en-us/library/ms682586(v=vs.85).aspx

quick question about remote ssh -

i'm wondering if editing remote files via ssh 100% safe on public networks. use software called phpdesigner has remote ssh editing capabilities built in i'm wondering if i'm in coffee shop public wifi if connecting on ssh safe me there. well yes, connection encrypted. unless using own computer, may leaving traces on computer in coffee shop.

Windows hosting solutions (VPS and dedicated) -

i confused on hosting solutions windows. i looking vps dedicated reliable , great customer service. i feeling there few options available windows hosting compare linux. i need suggestion hosting community. have think cloud hosting. since may come virtual service support , expandability better vps

asp.net - combo box ajaxcontrol -

i have filter panel 5-6 combo boxes ajax control tool kit.. i want filter panel visible false default.. , toggle it(show/hide) on client click using java script however when have filter panel visible = false runat=server java script not object and if code behind.. filterpanel.attributes.add("style",display:none) filterpanel.attributes.add("style",visibilty:hidden) the combo box throws runtime error.. i've searched on net says.. combo box difficult render inside panel.. default property false! the problem <select> elements have rendered (but not visible ) in order reliably access dimension properties. so display: none; won't work because elements not rendered, , visibility: hidden; partially work because elements rendered, space allocated them on page, hidden, space remain empty. a third solution render container usual, make absolutely positioned outside of browser viewport: filterpanel.attributes.add("style",...

xamarin.ios - Weird animations when navigating through views or reloading table view contents -

i'm working on monotouch application navigationcontroller, root view imageviews in , standard , customized/subclassed tableviews , tableviewcells. elements located in xib files, others code only. navigation , table contents work fine. however, suffer weird "animation" effects... i'm trying best describe them possible. 1) when navigating , forth on navigation stack, each time view appears, looks items of view re-layouted. when navigating subview root view, it's imageviews start off @ location shouldn't , slide right location. 2) tableviewcells "unfold/reveal" content top bottom when appearing in visible area, when reloading without animation: tableview.reloadsections(new nsindexset(1), uitableviewrowanimation.none); scrolling down table, each cell seems trigger it's own "unfolding" animation separately becomes visible. 3) scroll bars of tableviews slide view view. for example, when tapping cell pushes tableview on stack...

c# - Friends can't see my posts -

i using graph api in myapp post wall. can see automated posts, friends cannot. have tried types of privacy settings: all_friends, everyone, custom, etc. no avail. if manually post status messages, photos or links, there no problem. if use api scan feed, see no difference in privacy settings between manual , automated posts. difference automated posts have "attribution:myapp" tag. why can't friends see automated posts?

c# - Deleting Multiple Rows from an Access Database -

i want delete multiple records access database using array. array loaded dynamically file names. then query database, , see if database column values matching array values, if not delete it, if matches not delete it. the problem that: following code deletes records irrespective of in condition. arrays = directory.getfiles(sdira, "*", searchoption.alldirectories).select(x => path.getfilename(x)).toarray(); fnames.addrange(arrays); here have use loop didnt me out :( for(int u = 0; u < arrays.length; u++) { oledbcommand sqlcmd = new oledbcommand ("delete table1 name not in ("'+arrays[u]+"')",sqlconnection); using 1 foreach(string name in arrays) { oledbcommand sqlcmd = new oledbcommand("delete table1 name not in ('" + name + "')", sqlconnection); sqlcmd.executenonquery(); }` one problem code confusing. string [] = {"" 'a....

delphi - Cancel attached backup service -

my software has make database backups , 1 of expected features backup can canceled. as can think of, have 3 options: use component, such tibbackupservice programmatically call gbak using shellexecute or so programmatically call service using gds32.dll api i tried first 1 , if cancel service keeps running (the backup file built until end , resoureces keep unchanged). the second option smells me , don´t think i´ll able abort operation well. the third option cost hours , i´d know: is there way abort backup operation using first option? the third option viable? if yes, operation abortable? is firebird backup operation cancelable @ all? thanks ps: didn't mention firebird version using. 1) gbak "normal" application connects database, read information, , write backup file. restore process inverse. 2) when use servicesapi backup (option 1 , 3, in example), firebird start "internal" version of gbak job. for of options, if using fi...

android - How to set a title for a context menu? -

when bring context menu on contact in android built-in app, context menu has title (the contact's name). same playlist context menu in music app. i have added context menu imageview (no list item). there no title, options shown. there easy way set title context menu looks built-in apps' ones? you want use setheadertitle(charsequence title) .

Update a row +1 in CakePHP -

i trying update row in database haven't found way in cakephp way (unless query row retrieve , update) . update mytable (field) values (field+1) id = 1 in codeigniter, have been simple as: $this->db->set('field', 'field+1', false); $this->db->where('id', 1); $this->db->update('mytable'); how do without querying row first, retrieve value, updating row information got? i don't think cakephp has similar method doing in normal save() on single row. but updateall() method, updates multiple rows, support sql snippets so: $this->widget->updateall( array('widget.numberfield' => 'widget.numberfield + 1'), array('widget.id' => 1) ); the first param array of fields/values updated, , second param conditions rows update. apart think thing use: $this->widget->query('your sql query here'); which lets query raw sql. [edit: not recommended bypasses orm.] ...

sdk - Will app developed for Symbian s60 3rd edition work on s60 5th edition phones? -

i don't know sdk should download page: http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/s60_all_in_one_sdks.html i want simple app work on many phones possible. ok if download "s60 3rd edition sdk symbian os, feature pack 2"? app work on s60 5th edition , others? applications built on 3rd edition sdk binary compatible 5th edition. won't able take full advantage of 5th edition features such touch input. on other hand, applications built 5th edition sdk can possibly run on 3rd edition device, provided use platform features available there. to best out of both touch , non-touch uis, build 2 versions of application same source tree, appropriate flagging, , distribute separate installation packages each edition.

javascript - CKEditor: Editing templates (e.g. PHP, JSP, ASP, ... i.e. non-standard HTML) -

hi once again ! i'm developing this plugin edit php pages using ckeditor (please watch demo videos further details ;o) . works fine if try insert php code inside <pre> tag render code inside page. the fact need insert php code directly inside code of target web page (well it's php page indeed ...) because idea insert php snippets evaluated , expanded later in server-side. in this demo video can see once insert php code directly inside <div> tag (i.e. in source mode) , switch source mode again whole php block sanitized replaced &nbsp; entity. same happens if plugin tries insert same snippet (i.e. in wysiwyg mode) once ok button pressed. so questions : is possible instruct ckeditor not obfuscate php block ? does has hint or way work around behavior ? thanks in advance ! use config.protectedsource setting, page list how can use php

c++ - OpenMP and STL-style for -

i'm trying parallelize program openmp. program using stl-iterators heavily. said openmp 3.0 can deal this: std::vector<int> n(2*n_max+1); std::vector<int>::const_iterator n,m; #pragma omp parallel for (n=n.begin(); n!=n.end(); ++n){ //task in parallel }; but got following error: error: invalid controlling predicate i'm using gcc 4.5.0, (openmp3 implemented in 4.4.0) , build string is: g++ -o0 -g3 -wall -c -fmessage-length=0 -fopenmp -mmd -mp standard openmp doesn't bear c++ iterators in general. standard requires iterators random access iterators constant time random access. permits < , <= or > , >= in test expressions of loops, not != . if using iterators , stl heavily, might better off thread building blocks .

C# : Convert datetime from string with different format -

if string 26/01/2011 00:14:00 computer set united state format (am:pm) how convert string datetime ? try convert.todatetime() cause error. as others have said, can use datetime.tryparseexact, seem have european culture format in date. might not hurt make attempt use perform conversion: cultureinfo engb = new cultureinfo("en-gb"); string datestring; datetime datevalue; // parse date no style flags. datestring = "26/01/2011 00:14:00"; datetime.tryparseexact(datestring, "g", engb, datetimestyles.none, out datevalue);

Google App Engine: import export blobstore -

using appcfg.py it's quite easy import export datastore. but blobstore? there similar way import/export blobstore? if not libraries so? the goal move blobstore appengine app appengine app thanks! the bulkloader doesn't support uploading or downloading blobs. in order this, you'd have write own code it.

objective c - Help with image processing in an iPhone app -

i'm working image processing tool in matlab. how can convert matlab code objective-c? here of tasks want do: i want rotate oblique line normal. i have algorıthm converts colored image black & white. (how can access pixel color values in objective-c?) in function getrgbfromimage , how can access output of pixel values consol? how can run function ( getrotatedımage ) on each element of array? quartz 2d (aka. core graphics) 2d drawing api in ios. quartz will, likely, you're looking for. recommend checking out quartz 2d programming guide in documentation. specific requests check out these sections: colors , color spaces - color , b&w images transforms - rotating or performing affine transform bitmap images , image masks - information on underlying image data as running function on each element of array, can use block iteration api (as long app can require ios 4.0 or higher). example: [myarray enumerateobjectsusingblock:^(id item, nsuinteg...

paperclip - How do i create a image displaying a email with rails? -

in webapp want display user emails. dont want spam boots steal user emails. have automatic create image displaying there email? best regards, rails beginner creating image 1 way go, remember ocr getting extremely "cheap" operation , isn't guarantee bot wouldn't analyze pictures on site see if contain text looks email addresses. there's plenty of techniques "hide" addresses in plain sight. write them out in character entity format, intersperse empty tags, uses javascript decode encoded form of them , insert page after load, etc...

.net - C# Rich GUI Application -

i want create app declare microprocessor's pin input/output mouse clicks. created mockup - http://i.stack.imgur.com/gohq5.png . think best declare each pin separate class can change state easily, dont know how achieve along graphical representation of it. each square should clickable , changin color. foreach loop iterate throu them , state information of each.should go wpf or silverlight or simple click events? best approach implement in .net? if want website, silverlight. otherwise wpf because easier. i'd image center piece, unless it's going change size, in case draw out of lines , ellipse. use canvas in main window, not grid. make pin class handles state/color/positioning information. can draw square rectangle. don't worry mvvm, that's going more trouble it's worth case.

jquery - Multiple fileuploads with ASP.NET MVC -

hi, i have implemented plugin steve sanders 2008. in solution have 3 buttons 3 uploads , works fine. ist not perfect fit , question if thera better solution me? what need : be able upload multiple files when control action triggered should possible work files the enduser should able cancel uploaded file(this not possible steves plugin far know) easy use asp.net mvc if post done control action , validation error thrown uploads may not disappear. pleas advice how using uploadify ? have used before, , works great. notice needs flash front-end in order work... take @ this stackoverflow question - there you'll find more info of how use asp.net mvc.

c++ - How to get PC Model type? -

is there function or method pc's model type? in case "optiplex 780". until queryd wmi (win32_computersystem), , worked in 99% of cases, sometimes, couldn't retrieve model. wmi isn't option me. i'm looking other way. has idea? thanks. according microsoft's documentation, model must filled in: model data type: string access type: read-only product name manufacturer gives computer. property must have value. perhaps times doesn't work when you're logged in non-administrator account? most access wmi restricted administrator accounts non-administrator accounts have access on local computer.

c# - FileSystemWatcher does not work on files created from windows service -

i'm creating file windows service run under localsystem account. have windows application monitors specified folder file created. i'm using filesystemwatcher doesn't fire. file icon in windows explorer padlock icon. how can create file windows service, accessible windows user account? the filewatcher flaky. there issues if watching folder on network drive. have seen dozen or more applications use filewatcher , of them has more once failed recognize when file created. i backup filewatcher timed event checks new or modified files. way if filewatcher fails recognize event, timer catch it.

Android how to pass a variable to another java file -

in reminder1.java have int hourofday2 , int minute2 variables. these equals hourofday , minute variable of timepickerdialog. in myfile.java want examine value of these variables. how that? one thing i've seen posted here on few times, , i've used global variables, extended application class, so: public class globalvars extends application { private static int hourofday2; private static int minute2; public static int gethourofday() { return hourofday2; } public static int getminute() { return minute2; } public static void sethourofday(int hour) { hourofday2 = hour; } public static void setminute(int minute) { minute2 = minute; } } add application tag in manifest, so: <application android:name=".globalvars" /> then, in main class's oncreate, or wherever necessary, call globalvars.setminute(int) initialize them, can access them same way in other class, int x = ...

javascript - multiple select box jquery and post serialize -

i trying to send form via post multiple select box isn't being sent. how can serialize select box rest of form , send it? here javascript using $('#form-to-submit').empty().append($(fieldsetname).clone()); $('#form-to-submit select').val($('.fieldsetwrapper select').val()); var data = $('#form-to-submit').serialize(); $.post(url,{data,function(data,textstatus){ i fields select in post data. the select serialize if there selections made... see here example serialization , jsonification http://jsfiddle.net/xw2cm/1/

search - Practical Scala reference manual, for searching things like method names -

inspired haskell api search engine begun wonder right way of finding names of things in scala library. example let's assume need string substation, search , replace. stringops has no such thing. google doesn't either, because these terms general, , manually traversing documentation isn't fun. my question is, experts when seeking particular function? this should practical enough use in everyday work. i agree hoogle search engine scala great. until there such tool, another question : i suggest using reference index you can see whole thing @ nightly scaladoc

tiff - Automatic saving a figure as an image file in Matlab -

i'm creating 49 figures in matlab, created automatically 1 after other. want them automatically saved .tif or .jpg images names corresponding figure number. can it? , if so,how? the code creation of figures is: for num_picture=0:48 ... figure (num_picture+1) imshow (screen_im) end the ... part calculations of screen_im are. i want images in order create movie them, if there way can create movie automatically form matlab, also, better. you can save current figure file print of saveas command generating filename using loop counter: saveas(sprintf('img%d.tif',num_picture)) or print('-dtiff','-r300',sprintf('img%d.tif',num_picture))

CodeIgniter session losing data -

i'm not sure why, losing codeigniter session data between pages. , session id changing. cause this? shouldn't accessible page once set? session data set here in configuration page: <?php $config = array( 'power' => $_cookie['power'], 'oemclass4' => $_cookie['class'], 'cooling' => $_cookie['cooling'], 'beam' => $_cookie['beam'], 'wavelength' => $_cookie['wavelength'], 'model_no' => $_cookie['part']); $this->session->set_userdata('config', $config); ?> the user redirected page details of configuration. session userdata still there then. javascript redirected (window.location) login page , userdata gone then. it true while working on local host. specify cookie_domain localhost. retain...

tsql - Return row of every n'th record -

how can return every nth record sub query based on numerical parameter supply? for example, may have following query: select id, key datatable customerid = 1234 order key e.g. the subquery result may following: row id key 1 1 a3231 2 43 c1212 3 243 e1232 4 765 g1232 5 2432 e2325 ... 90 3193 f2312 if pass in number 30, , sub query result set contained 90 records, recieve 30th , 60th , , 90th row. if pass in number 40, , result set contained 90 records, recieve 40th , 80th row. as side note, background information, being used capture key/id of every nth record paging control. this row_number can help. requires order-by clause okay because order-by present (and required guarantee particular order). select t.id, t.key ( select id, key, row_number() on (order key) rownum datatable ) t t.rownum % 30 = 0 -- or % 40 etc order t.key

iphone - create a uiview object from cgrect -

i have custom table view cell create 3 images with: [auiimage drawinrect:somecgrect]; is there way can create 3 uiview objects these images, can access them in touchesbegan method find image touched? or there better way? thanks! i think better way using uibutton instead uiview. need specify image property , size want.

TinyMCE - Adding a <base> tag to the head of the editor document -

i have tinymce editor need add tag in doncument's head. have working adding $(tinymce.activeeditor.getdoc()).children().find('head').append('<base href=\"theurl\">'); to init_instance_callback function. when inspect dom, see added properly. images add editor use new base information. issue existing items loaded editor not use "errored" out before base tag added. any ideas how add tag before document loaded, or how reload document base tag in place? thanks, try use onbeforesetcontent event. way base-tag gets added before editor gets filled initial content. may want set global variable true if base-tag has been added in order check , add once , not on every onbeforesetcontent event.

jquery - How do i create a tooltip using qTip2 that is assigned at run time to page elements -

i'm trying have qtip2 bubble created not displayed @ load time. display under image clicked. please advise best way this. (using qtip solve bubble going out of screen). thanks edit: see problem http://jsfiddle.net/jnbpp/5/ (looking correct way this) well need load on click, e.g.: $('img[title]').live('click', function(event) { $(this).qtip({ overwrite: false, content: { text: $(this).attr('title') , }, position: { my: 'top center', at: 'bottom center', adjust : { screen : true } }, show: { event: event.type, ready: true, solo: true }, hide: 'unfocus', style: { classes: 'ui-tooltip-l...

Webservices method in C# via Javascript -

i trying call webservice method .aspx page thro' javascript & error, have [webmethod] on top of c# method. unknown web method [object object]. parameter name: methodname <h2> <i>unknown web method [object object].<br>parameter name: methodname</i> </h2></span> description: an unhandled exception occurred during execution of current web request. please review stack trace more information error , originated in code. <br><br> <b> exception details: </b>system.argumentexception: unknown web method [object object].<br>parameter name: methodname<br><br> [argumentexception]: unknown web method [object object]. parameter name: methodname @ system.web.script.services.webservicedata.getmethoddata(string methodname) @ system.web.script.services.resthandler.createhandler(webservicedata webservicedata, string methodname) @ system.web.script.se...

Perl IPv6 address expansion/parsing -

i have address 2001:db8::1 in scalar, , expanded form, 2001:0db8:0000:0000:0000:0000:0000:0001 . main perl package ship - in vast forest in /usr/lib/perl5/... - module this? if not, have few lines this? cpan has net::ip can need. here's transcript showing in action: $ cat qq.pl use net::ip; $ip = new net::ip ('2001:db8::1'); print $ip->ip() . "\n"; $ perl qq.pl 2001:0db8:0000:0000:0000:0000:0000:0001

ranking - PercentRank algorithm in VBA -

i have found answer question "how assign rank number array when ties exist" in php , (looked lilke) c++. found couple of answers excel's percentrank in language not know. can me in vba? need calculate percentrank 12 values in access fopr report , cannot use excel. here's example of after: per val %rank 01 80 0.82 02 74 0.45 03 88 1.00 04 60 0.00 05 86 0.91 06 68 0.18 07 64 0.09 08 78 0.64 09 76 0.55 10 72 0.27 11 78 0.64 12 72 0.27 note period 08 , 11 value same. period 10 , 12. read somewhere when there ties function must calculate average of somesort. would please function written in vba? thanks bunch. d. lamarche ties should produce same percentage rank, example shows. if x number not in array, have extrapolate. if you're assured x in array, can simplify this public function prank(vaarray variant, x variant) double dim llower long dim lhigher long ...

.htaccess - Drupal as CMS / integration with existing website, menu path problems -

i have website built on zend framework (which not of relevance problem) , drupal installed in subfolder / drupal . in root of website have following .htaccess setenv application_env development rewriteengine on # handled drupal rewritecond %{request_uri} ^/blog.*$ [or] rewritecond %{request_uri} ^/financing.*$ [or] rewritecond %{request_uri} ^/marketing.*$ rewriterule (^.*$) /drupal/index.php?q=$1 [l] # handled zend framework rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^.*$ index.php [nc,l] i have idea goes this: if access www.example.com/some-url zend framework or static file handled, when www.example.com/blog/some-blog-post, handled drupal , part, ok. 1) problem drupal links absolute path www.example.com/drupal/blog/some-blog-post (of course, alias post blog/some-blog-post , because drupal installed in subfolder, adds /drupal before blog/some-blog-post ). be...

VK_xxx in Java for ~ (tilde), ? (question mark), % (percent), | (vert bar) and " (dbl quote) -

i trying find vk_xxx in keyevent keys can type in on keyboard. can find of them, except above 5. idea why these 5 missing? should using shift mask these? if go route, can use shift mask 2 ( vk_at ), 3 ( vk_number_sign ), 4 ( vk_dollar ), etc., too? the context - reading string file contains arbitrary ascii characters, , trying have awt robot press , release vk's put string somewhere. thank you. http://download.oracle.com/javase/6/docs/api/java/awt/event/keyevent.html it states: not characters have keycode associated them. example, there no keycode question mark because there no keyboard appears on primary layer. vk_dead_tilde, vk_quotedbl. so have capture charcode event, besides keyreleased. a bit unportable shift+5 etc.

web services - Best way to display 60,000 records on a php webpage -

i looking display 60,000 records on webpage php pulling records mysql database on localhost. these 60,000 records may change depending on data input. the records have 5 text fields , due sheer number of records, significant time taken send data mysql server web browser. on localhost, time taking around 15 seconds. during time, page empty. i seek professional opinion on how either 1. display data in alternative method, (which i'm not sure method) or 2. hasten sending of data mysql server web browser using caching technology memcache. in end deploying application on internet lag immensely unacceptable (i.e. > 15 seconds). thank , best regards! i suggest trying ajax pagination. no user able see , analyze 60k records @ 1 time. can have php display first x (however many fit on average screen or two) records fill 2-3 pages, , have javascript listen scroll change. if user starts scrolling down, have automatically query next y records, , add them display list. pos...

php - Stopping a script and then restarting it? -

there's php script run command line. outputs various information terminal chugs along. i want code restart trigger it, when called, (obviously) restarts script. i thinking of making call other file , die() , , have other file call script, want script reload in same terminal. is possible? php has analogue signal c function called "pcntl_signal" lets set signal handlers. in signal handler (e.g. sigusr1 or sigtstp) can restart code. either: a) encode entire body of php script in function, , have signal handler merely call function again b) php script can exec [or exec $argv[0] ] in either case, right after call, should call die

c# - change property of rad controls in form -

how can access property of rad controls in form. code bellow foreach (control ctrl in this.controls) { radcontrol rc = ctrl radcontrol; if (rc != null) { if (rc.gettype() == typeof(telerik.wincontrols.ui.radbutton)) { rc.image = .... } } } thanks in conditional statement want test if (ctrl radcontrol) and want make recursive function go down through control collections in page. private void dosomethingtoradcontrols(controlcollection controls) { if (controls != null && controls.any()) { foreach (control ctrl in controls) { if (ctrl radcontrol) { // } dosomethingtoradcontrols(ctrl.controls); } } }

php - Keep Sql Connection open for iterating many requests? Or close each step? -

hey there -- general operation calling sql server, or requiring open connection @ that. say have anywhere 20 1000 select calls make each item in data being looped. each step, i'll select sql, store data locally in struct, proceed. not expensive call, should keep connection open entire loop? or should open , close every step? how expensive in run time opening connection? think it'd better keep connection open, correct response this. thanks. how expensive in run time opening connection this considers cpu speed , doesn't consider bandwidth. keeping open connection saves on cpu blocks other requests being able use connection. trade off. tough "correct response" without knowing lot more, in either case seems 1 tinkering tolerances instead of nailing nominals that said typically start keeping connection open duration of unit of sql work , close it. although 1 thing seem little sketchy line 20 1000 select calls make each item in data...

asp.net - Any controls like Devexpress ASPX PivotTable/Gride available for Java webapp? -

i've been looking around little @ devexpress pivotgrid/pivottable , wow, i'm impressed (see here example, skip towards end see of functionality). i'm working on java webapp in tabular data presented key part of application, , if implement such devexpress control amazing. there out there?? java webapp uses myfaces framework. any thoughts appreciated! thanks kind words our pivot grid control – have submitted request via our support center... http://devexpress.com/support

asp.net - ListBox.ListItem.Selected always returns false -

this going take little while explain, here goes: 1) created .aspx page placeholder control. 2) use page load "container" usercontrol db: protected override void oninit(eventargs e) { base.oninit(e); try { utility.menuitem menuitem = currentmenuhandler.bycurrentpath(); var clientid = currentclient.id; var userid = currentuser.id; if (menuitem.usercontrolpath.length > 0) { usercontrol control = base.loadcontrol(menuitem.usercontrolpath, 2, clientid, userid, menuitem.id); plcontainercontrol.controls.add(control); } } catch (exception ex) { response.write(ex.tostring()); } } 3) in container control, i'm using devexpress gridview dynamically load user controls when gridview goes "edit" mode. protected override void oninit(eventargs e) { base.oninit(e); ...

virus - Prevent NSIS from appending archive? -

i had bad day when virus infect *.exe including many of nsis installer , stripping them stub (+ virus code). i wonder if there option pack archive inside stub instead? @ least if got infected whole archive (hence installer exe) ve recovered av this mean if file been tampered invalidated pe too. no /ncrc then even if compressed data stored in pe section or resource, virus still strip out when infecting. while chance of data survival better current implementation complicate compilation phase makensis. it open source , free submit patch :)

c# - Entity Framework Code First, foreign key/object should not save -

i have 3 classes, so: [datacontract] public class applicationdto : businessbase<int> { /// <summary> /// gets or sets name. /// </summary> /// <value>the name.</value> [datamember] public string name { get; set; } /// <summary> /// gets or sets description. /// </summary> /// <value>the description.</value> [datamember] public string description { get; set; } /// <summary> /// gets or sets development startdate. /// </summary> /// <value>the development startdate.</value> [datamember] public datetime developmentstartdate { get; set; } /// <summary> /// gets or sets launch date. /// </summary> /// <value>the launch date.</value> [datamember] public datetime launchdate { get; set; } } [datacontract] public class customerdto : businessbase<int> { /// <summary> /// ...

c# - How to generate a list of lists of digits? -

i want generate list of lists 1 below. how in c#? list<list<int>> data = {{0,0,0,0}, {0,0,0,1}, {0,0,0,2}, ..., {9,9,9,9}}; another option... var data = enumerable.range(0, 10000) .select(x => new list<int> { x / 1000, (x / 100) % 10, (x / 10) % 10, x % 10 }) .tolist(); and if want generate arbitrary number of digits can this: int n = 4; // number of digits var data = enumerable.range(0, (int)math.pow(10, n)) .select(x => enumerable.range(1, n) .select(y => (x / (int)math.pow(10, n - y)) % 10) .tolist()) .tolist();

c++ - How can I Always open server? -

i have code (my c++ socket server) don't know how can open. server close. when send client close itself. want wait others client , never closed. how can ? oh use multi-threaded too. please,help me. and here code int main(void) { handle hthread[3]; dword dwid[3]; dword dwretval = 0; hthread[0] = createthread(null,0,(lpthread_start_routine)threadtwo,null,0,&dwid[0]); dwretval = waitformultipleobjects(3, hthread, true, infinite); closehandle(hthread[0]); return 0; } long winapi threadtwo(long lparam) { wsadata wsadata; socket listensocket = invalid_socket, clientsocket = invalid_socket; struct addrinfo *result = null, hints; char recvbuf[default_buflen]; int iresult, isendresult; int recvbuflen = default_buflen; iresult = wsastartup(makeword(2,2), &wsadata); if (iresult != 0) { printf("wsastartup failed error: %d\n", iresult); return 1; } zeromemory(...