f



Change text color of uicontrol whose 'Enable' property is 'off'

I would like to change the text color of a uicontrol whose 'Enable' property is set to 'off'

Is there a way to do this?
0
10/9/2011 6:34:10 PM
comp.soft-sys.matlab 211265 articles. 25 followers. lunamoonmoon (257) is leader. Post Follow

6 Replies
668 Views

Similar Articles

[PageSpeed] 3

"Nate Jensen" wrote in message <j6spf2$pqn$1@newscl01ah.mathworks.com>...
> I would like to change the text color of a uicontrol whose 'Enable' property is set to 'off'
> 
> Is there a way to do this?

Does being not-enabled specifically prevent this? Are you asking for an automatic method, like whenever you set something's enable to "off" it automatically recolors it too? And are you sure you dont just want to set "enable" to "disabled" (I've never found a good use for enable=off)

f=findobj(gcf,'type','uicontrol','enable','off')
set(f,'color',[1 0 0])
0
n.a (539)
10/10/2011 5:05:26 PM
"matt dash" wrote in message <j6v8km$r3q$1@newscl01ah.mathworks.com>...
> Does being not-enabled specifically prevent this? Are you asking for an automatic method, like whenever you set something's enable to "off" it automatically recolors it too? And are you sure you dont just want to set "enable" to "disabled" (I've never found a good use for enable=off)
> 
> f=findobj(gcf,'type','uicontrol','enable','off')
> set(f,'color',[1 0 0])

Does it?  I did not know that.  Is there a workaround?

I'm not sure exactly what you mean by 'automatic'.  I don't want to change any Matlab defaults.  I just would like to know if there is a way to change the color of the text when the 'Enable' property is set to 'off'.  A simple line of code.

I'm also not sure what you mean by 'disabled'?  Doesn't setting 'Enable' to 'off' disable the uicontrol?

Currently I am using Java to get around this problem.

Thanks for the help.  If you have any suggestions, let me know.
0
10/10/2011 5:45:29 PM

"Nate Jensen" <natejensen88@gmail.com> wrote in message 
news:j6vavp$674$1@newscl01ah.mathworks.com...
> "matt dash" wrote in message <j6v8km$r3q$1@newscl01ah.mathworks.com>...
>> Does being not-enabled specifically prevent this? Are you asking for an 
>> automatic method, like whenever you set something's enable to "off" it 
>> automatically recolors it too? And are you sure you dont just want to set 
>> "enable" to "disabled" (I've never found a good use for enable=off)
>>
>> f=findobj(gcf,'type','uicontrol','enable','off')
>> set(f,'color',[1 0 0])
>
> Does it?  I did not know that.  Is there a workaround?
>
> I'm not sure exactly what you mean by 'automatic'.  I don't want to change 
> any Matlab defaults.  I just would like to know if there is a way to 
> change the color of the text when the 'Enable' property is set to 'off'. 
> A simple line of code.
>
> I'm also not sure what you mean by 'disabled'?  Doesn't setting 'Enable' 
> to 'off' disable the uicontrol?

Write a two-line function to do this.

function disableUicontrolAndChangeColor(uicontrolHandle, desiredColor)
set(uicontrolHandle, 'Enable', 'off', 'Color', desiredColor);

Call this function in your code whenever you need to disable a uicontrol and 
change its color. You can write a similar two-line 
enableUicontrolAndChangeColor function to reverse the process. You can, of 
course, make this more elaborate: some things you might want it to do 
include having disableUicontrolAndChangeColor return the color prior to 
disabling the uicontrol, or return an onCleanup object that restores the 
previous color when deleted, or ...

-- 
Steve Lord
slord@mathworks.com
To contact Technical Support use the Contact Us link on 
http://www.mathworks.com 

0
slord (13689)
10/10/2011 6:01:06 PM
"Steven_Lord" <slord@mathworks.com> wrote in message <j6vbt2$9aj$1@newscl01ah.mathworks.com>... 
> Write a two-line function to do this.
> 
> function disableUicontrolAndChangeColor(uicontrolHandle, desiredColor)
> set(uicontrolHandle, 'Enable', 'off', 'Color', desiredColor);
> 
> Call this function in your code whenever you need to disable a uicontrol and 
> change its color. You can write a similar two-line 
> enableUicontrolAndChangeColor function to reverse the process. You can, of 
> course, make this more elaborate: some things you might want it to do 
> include having disableUicontrolAndChangeColor return the color prior to 
> disabling the uicontrol, or return an onCleanup object that restores the 
> previous color when deleted, or ...
> 
> -- 
> Steve Lord
> slord@mathworks.com
> To contact Technical Support use the Contact Us link on 
> http://www.mathworks.com 

Thanks, but there is no property 'Color' for uicontrols.  Also, setting 'ForegroundColor' does not work.  I am using R2011b.  Maybe changes there were changes made to the properties of uicontrols?

h = uicontrol('Style','text','String','a');
set(h,'Enable','off','ForegroundColor','k')

Running the above code does not change the font color.

Thanks for the help though.
0
10/10/2011 8:08:07 PM
"Nate Jensen" wrote in message <j6vjb7$7dj$1@newscl01ah.mathworks.com>...
> "Steven_Lord" <slord@mathworks.com> wrote in message <j6vbt2$9aj$1@newscl01ah.mathworks.com>... 
> > Write a two-line function to do this.
> > 
> > function disableUicontrolAndChangeColor(uicontrolHandle, desiredColor)
> > set(uicontrolHandle, 'Enable', 'off', 'Color', desiredColor);
> > 
> > Call this function in your code whenever you need to disable a uicontrol and 
> > change its color. You can write a similar two-line 
> > enableUicontrolAndChangeColor function to reverse the process. You can, of 
> > course, make this more elaborate: some things you might want it to do 
> > include having disableUicontrolAndChangeColor return the color prior to 
> > disabling the uicontrol, or return an onCleanup object that restores the 
> > previous color when deleted, or ...
> > 
> > -- 
> > Steve Lord
> > slord@mathworks.com
> > To contact Technical Support use the Contact Us link on 
> > http://www.mathworks.com 
> 
> Thanks, but there is no property 'Color' for uicontrols.  Also, setting 'ForegroundColor' does not work.  I am using R2011b.  Maybe changes there were changes made to the properties of uicontrols?
> 
> h = uicontrol('Style','text','String','a');
> set(h,'Enable','off','ForegroundColor','k')
> 
> Running the above code does not change the font color.
> 
> Thanks for the help though.

Sorry, I was mixing up inactive and off, and wrongly calling inactive disabled. Whew. Maybe this will work for you though:

 h = uicontrol('Style','text','String','a');
 set(h,'Enable','inactive','ForegroundColor','c')

Using inactive instead of off lets you still change its appearance...
0
n.a (539)
10/18/2011 5:33:26 PM
"matt dash" wrote in message <j7kd96$69o$1@newscl01ah.mathworks.com>...
> Sorry, I was mixing up inactive and off, and wrongly calling inactive disabled. Whew. Maybe this will work for you though:
> 
>  h = uicontrol('Style','text','String','a');
>  set(h,'Enable','inactive','ForegroundColor','c')
> 
> Using inactive instead of off lets you still change its appearance...

Awesome thanks for coming back and answering that for me.  I appreciate it.  Your answer worked.
0
10/18/2011 5:57:11 PM
Reply:

Similar Artilces:

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked form fields. This never works when doing an APPEND/UPDATE query. It can never find the values of linked form fields, Access always asks for the parameter value of the field(s) in question, or Access comes up with an error 3323 - No recordset. I am sure there are other people that have had this problem. What is the difference between Select queries and append/update queries? the append/update queries never seem to be able to find values in linked form fields. Can anyone shed any light on this or point to a knowledgebase Item, or even recommend a book focusing on this subject, I will go and buy it now. I have been for up 2 nights trying to acomplish this and now considering suicide, please help. Thanks In advance, Aaron. I know of two ways you can accomplish this. 1. You can create the SQL script for you append or update query and run the script with DoCmd.RunSQL. 2. You can create a...

error: expected '=', ',', ';', 'asm' or '__attrib
Hi I'm trying to compile an ADC Driver & come acrosss the following error. I've no experience writing drivers before, and hence have no clue how to fix it. Hope someone out there has encountered the problem & suggesst a fix for the same. The Error is I get is : qadc.c: At top level: qadc.c:97: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'qadc_read' make: *** [qadc.o] Error 1 [root@localhost qadc]# ########################################################################### ADC Driver Code ########################################################################### #define MODULE #define __KERNEL__ #include <linux/config.h> #include <linux/module.h> #include <linux/kernel.h> /* printk */ #include <linux/fs.h> / #include <linux/errno.h> /* error codes */ #include <linux/types.h> /* size_t */ #include <linux/proc_fs.h> /* proc file system */ #include <linux/fcntl.h> #include <asm/system.h> /* cli, flags */ #include <asm/uaccess.h> /* copy from/to user */ /*Registers to get qadc access*/ volatile unsigned short * qadcmcr = (unsigned short *)0x40190000; volatile unsigned short * qacr0 = (unsigned short *)0x4019000a; volatile unsigned short * qacr1 = (unsigned short *)0x4019000c; volatile unsigned short * qacr2 = (unsigned short *)0x4019000e; volatile unsigned short * qasr0 = (unsigned short *)0x40190010; volatile unsigned short * qasr1...

Re: '^=' and '~='?
Duckhye, According to the doc ( http://xrl.us/befwjx ) they, and one other set of characters, and the mnemonic 'NE' all represent 'NOT EQUAL'. Art ------- On Wed, 11 Feb 2009 16:52:40 -0600, Duck-Hye Yang <dyang@CHAPINHALL.ORG> wrote: >Hello, >What is the difference between '^=' and '~='? > >Thanks, >Duckhye ...

'[OFF]' as in 'offensive'???
Hi, given that 'off-topicness' is indicated as '[OT]' and taking a look at those postings that started the threads indicated as '[OFF]' (which may both be seen as being somewhat offensive) may lead to the conclusion that '[OFF]' stands for offensiveness. I don't think that this is the intended meaning so what actually *does* '[OFF]' mean? I never came across that abbreviation before (although I have been around on the USENET for quite some time) but maybe it is worth knowing? Josef 'Jupp' Schugt NOTE: mails >100 KiB are ignored -- German edition of comp.lang.ruby FAQ - http://oss.erdfunkstelle.de/ruby/ Aurox Linux - http://qurl.net/7q | http://qurl.net/7r - Firefox Thunderbird - http://qurl.net/7s | http://qurl.net/7t - Liferea Enigmail - http://qurl.net/7u | http://qurl.net/7v - GnuPG [Josef 'Jupp' Schugt <jupp@gmx.de>, 2004-12-10 23.20 CET] > I don't think that this is the intended meaning so what actually *does* > '[OFF]' mean? Off-topic. ...

replacement for '{' and '}' ?
I am still playing around with what kind of syntax I would like to mark up my documents. Are there equivalent long substitutes for { and } when they are not used to describe arguments to functions? Something like \begin{group} and \end{group}. In other words, if I could force myself to write, say, \begin{group} \it ... \end{group} instead of {\it ... }, then I believe I could identify from the markup context what is an argument that belongs to a just invoked macro and what is text. {Of course, in this context, \textit{...} would be better.} No more ambiguity whether a in \myfunction{a} is an argument or just text. Is there a way to make latex barf when it sees an ordinary '{' in text, rather than \begin{group}, but not barf when I want it (to denote macro arguments)? Regards, /iaw On Aug 16, 6:01=A0pm, "ivo...@gmail.com" <ivo...@gmail.com> wrote: > Is there a way to make latex barf when it sees an ordinary '{' in > text, rather than \begin{group}, but not barf when I want it (to > denote macro arguments)? What do you mean exactly? I don't understand. Do you have in mind your- to-be-new-syntax or just regular latex? Cheers, Tomek ivowel@gmail.com wrote: > I am still playing around with what kind of syntax I would like to > mark up my documents. > > Are there equivalent long substitutes for { and } when they are not > used to describe arguments to functions? Something like \begin{group} > and \end{gr...

Like '' & '' & ''
Having this description column in a table "Cookies, peanut butter sandwich, regular" When using this WHERE clause: WHERE (((Food_Data.Description) Like "*Butter*" & "*Peanut*")); I dont get any results, however when using it this way round WHERE (((Food_Data.Description) Like "*Peanut*" & "*Butter*")); I get the row as expected. I assume that the query looks for them in order. Is there a way i can get around this and make the query search for both keywords no matter which order i ype them in. Thanks Dave [posted and mailed] SkunkDave (dave_casserly@totalise.co.uk) writes: > Having this description column in a table > > "Cookies, peanut butter sandwich, regular" > > > When using this WHERE clause: > > WHERE (((Food_Data.Description) Like "*Butter*" & "*Peanut*")); > > I dont get any results, however when using it this way round > > WHERE (((Food_Data.Description) Like "*Peanut*" & "*Butter*")); > > I get the row as expected. > > I assume that the query looks for them in order. The query looks for a string that matches the pattern "*Peanut**Butter*", so obviously it's not going to match "Butter Peanut". As suggested by Harald Albrech this works: WHERE (Food_Data.Description Like "*Butter*" or Food_Data..Description Like "*Peanut...

Return value of 'each', 'current', 'next', 'end'
These array functions: 'each', 'current', 'next', 'end' They return a reference or a value. let's say I want to modify the last value of an array without iterating through all of them. I would do: <? end($array) ; current($array)="new value" ; ?> is that posible?? Thanks. Hermann.Richter@gmail.com wrote: > These array functions: 'each', 'current', 'next', 'end' > > They return a reference or a value. They return values. > let's say I want to modify the last value of an array without iterating > through all of them. > > I would do: > > <? > end($array) ; > current($array)="new value" ; > ?> > > is that posible?? Try end($array); $array[key($array)] = "new value"; Chung Leong wrote: > Hermann.Richter@gmail.com wrote: > > These array functions: 'each', 'current', 'next', 'end' > > > > They return a reference or a value. > > They return values. > > > let's say I want to modify the last value of an array without iterating > > through all of them. > > > > I would do: > > > > <? > > end($array) ; > > current($array)="new value" ; > > ?> > > > > is that posible?? > > Try > > end($array); > $array[key($array)] = "new value"; $array[(sizeof($array...

'icfb' versus 'seultra'/'sedsm'
The executable for Silicon Ensemble used to be 'seultra' or 'sedsm'. Now there is 'icfb' with a recent version of Cadence I am dealing with. Are the formers embedded within icfb? I cannot get Silicon Ensemble up running alone. Any hint/help? hamidrezah@yahoo.com wrote: > The executable for Silicon Ensemble used to be 'seultra' or 'sedsm'. > Now there is 'icfb' with a recent version of Cadence I am dealing with. > Are the formers embedded within icfb? I cannot get Silicon Ensemble up > running alone. The "icfb" executable does not contain the "seultra" or "sedsm" tool suite. Specifically, the executable "icfb" (custom IC schematic capture, simulation, layout, & physical verification) does not contain "seultra" or "sedsm" (digital place & route). In future releases (e.g., Virtuoso IC61), increasingly A/d floorplanning and custom analog placement, analog synthesis, and device & block custom routing will be added to the "icfb" tool suite ... but in all cases, AFAIK, Silicon Ensemble will not itself ever be "inside" of icfb. It looks like you're missing "seultra" or "sedsm" in your path. Use the "find" command or the GNU locate command to locate the missing executables (or ask your system administrator). Hope that helps, John Gianni -- Nothing I state here is prior reviewed by my employe...

Re: '^=' and '~='? #5
Sorry, I posted under the wrong subject. My friend asked me to post this, she got an error message in processing the XML file. I don't have much experience in working with XML file. Any help is appreciated! On Thu, Feb 12, 2009 at 10:29 AM, Akshaya Nathilvar < akshaya.nathilvar@gmail.com> wrote: > 32 libname erap 'T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008'; > NOTE: Libref ERAP was successfully assigned as follows: > Engine: V9 > Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008 > 33 options nodate nonumber formdlim='-'; > 34 /* Program: E-RAP Load XML to SAS with map v2.sas*/ > 35 > /************************************************************************* > 36 Update path and file name below. > 37 > **************************************************************************/ > 38 %let data_path = T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December > 2008\Raw XML Data; > 39 %let input_file = 035151_12232008.xml; > 40 > **************************************************************************; > 41 > 42 filename xml_lib "&data_path.\&input_file."; > 43 filename SXLEMAP "&data_path.\xml_map_v2.map"; > 44 libname xml_lib xml xmlmap=SXLEMAP access=READONLY; > NOTE: Libref XML_LIB was successfully assigned as follows: > Engine: XML > Physical Name: XML_LIB &g...

Re: '^=' and '~='? #8
32 libname erap 'T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008'; NOTE: Libref ERAP was successfully assigned as follows: Engine: V9 Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008 33 options nodate nonumber formdlim='-'; 34 /* Program: E-RAP Load XML to SAS with map v2.sas*/ 35 /************************************************************************* 36 Update path and file name below. 37 **************************************************************************/ 38 %let data_path = T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008\Raw XML Data; 39 %let input_file = 035151_12232008.xml; 40 **************************************************************************; 41 42 filename xml_lib "&data_path.\&input_file."; 43 filename SXLEMAP "&data_path.\xml_map_v2.map"; 44 libname xml_lib xml xmlmap=SXLEMAP access=READONLY; NOTE: Libref XML_LIB was successfully assigned as follows: Engine: XML Physical Name: XML_LIB 45 libname erap "&data_path"; NOTE: Libref ERAP was successfully assigned as follows: Engine: V9 Physical Name: T:\9SOW\AHRQ_E Rap\Data\E-RAP Data\December 2008\Raw XML Data 46 * Read XML file into SAS data set; 47 data erap.Sabino; 48 set xml_lib.E_rap_episode_record; 49 run; ERROR: There is an illegal character in the entity name. encountered during XMLInput pa...

Re: '^=' and '~='? #2
No difference that I know of ... SAS has all sorts of things you can use as operators. LT,< LE,<= ne, ^=, ~=, <> in some contexts at least eq, = <<< these actually DO have a difference or two, particularly as relates to assignment I don't recall where the full list is, but http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000202951.htm#a000290128has the list of them usable in WHERE statements (which, IIRC, is slightly greater than that of normal code, as it allows for SQL syntax in ways the rest of SAS does not). -Joe On Wed, Feb 11, 2009 at 4:52 PM, Duck-Hye Yang <dyang@chapinhall.org> wrote: > Hello, > What is the difference between '^=' and '~='? > > Thanks, > Duckhye > ...

Re: '^=' and '~='? #9
On Thu, 12 Feb 2009 08:58:21 -0600, Joe Matise <snoopy369@GMAIL.COM> wrote: >Yeah, <> works in PROC SQL, wasn't sure about elsewhere... thanks for >confirmation! Didn't know about the MAX operator, that's interesting. .... hi, In proc SQL, I do get a note saying that: NOTE: The "<>" operator is interpreted as "not equals". In general, i find that we have different sas expressions, mostly identical one another. Still, there remain definite differences among all of these expressions: (1) data step expressions (2) where statement expressions (3) sql-expressions used in proc sql (4) macro expressions this is a less than ideal situation :-) but this may be an inevitable consequence of sas' being around for a long time. cheers, chang ...

Re: '^=' and '~='? #7
SAS was originally based on PL/1, and having programmed in PL/1,=20 I'm inclined to use the PL/1 symbol for not equals, which is the ^=3D (actually it is not the caret on IBM mainframes, but the not symbol which looks like L on its side). =20 -Mary ----- Original Message -----=20 From: ./ ADD NAME=3DData _null_;=20 To: SAS-L@LISTSERV.UGA.EDU=20 Sent: Thursday, February 12, 2009 9:09 AM Subject: Re: '^=3D' and '~=3D'? Maybe good reason to use mnemonic equivalents. 882 data _null_; 883 a =3D .v MIN .z; 884 b =3D .v MAX .z; 885 ax =3D .v >< .z; 886 bx =3D .v <> .z; NOTE: The "<>" operator is interpreted as "MAX". 887 c =3D .A NE .A; 888 put (_all_)(=3D);; 889 run; a=3DV b=3DZ ax=3DV bx=3DZ c=3D0 ...

'image' and 'imagesc'
Why is it, that 'image' and 'imagesc' change the y - direction of my data? Or an even more important question, how do I prevent them from doing so? This is the command I use: imagesc(x_vec,y_vec,rez_fld); with: x_vec = 3:0.5:7.5 y_vec = 1:-0.5:-1 rez_fld = size(x_vec) x size(y_vec) greetz, kai Kai: <SNIP wants it upside down... > Why is it, that 'image' and 'imagesc' change the y - > direction of my data... because: that's how you typically look at pics - top/left to bottom/right % now, img=load('clown'); imagesc(img.X); axis image; % -or- % axis ij; disp('change y'); pause; axis xy; % -or- % set(gca,'ydir','normal'); % then disp('get it all right...') pause; imagesc(flipud(img.X)); axis image; axis xy; % for more information help axis; us ...

'Matlab Code' to 'Embedded Matlab fun code'
Dear friends, I have a Matlab code to process a pure analog signal 'u'. Now I want to implement it in Simulink and I want to use it in 'Embedded Matlab fun block' so i need to transform 'Matlab code' to 'Embedded Matlab fun code' to perform the task. The Matlab code is as follows: %%%%%%%%%%%%%%%%%%%%% u_abs = abs(u); major_th = 1.5e-1; minor_th = 1.8e-2; major_peak_value = []; minor_peak_value = []; pos = 1; pos_max = 1; while ~isempty(pos) [m pos_max(end+1)] = max( u_abs( pos : pos + 10) ); pos_max(end) = pos_max(end) + pos - 1; if m > major_th major_peak_value(end+1) = m; else minor_peak_value(end+1) = m; end % exit the peak pos = find(u_abs(pos:end) < minor_th, 1 , 'first') + pos-1; % Find the beginning of the next peak pos = find(u_abs(pos:end) > minor_th, 1 , 'first') + pos-1; end pos_max(2) = []; plot(u); hold on; plot(pos_max,u(pos_max),'ro'); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% I think i don't need this plot command as I will see the result in the scope directly. Any suggestion will be very useful. Thanking you! Prashant "Prashant Sandhi" wrote in message <jafvj8$soq$1@newscl01ah.mathworks.com>... > Dear friends, > > I have a Matlab code to process a pure analog signal 'u'. Now I want to implement it in Simu...

Formating numbers: I want '9' to be '009' and '19' to be '019'
How can I do this ? This is the number used in invoice. Thanks. formatInvoiceNo: Format([InvoiceNo],"000000000") Open the report (form?) in design view, and set the Format property of this text box to: 000 -- Allen Browne - Microsoft MVP. Perth, Western Australia. Tips for Access users - http://allenbrowne.com/tips.html Reply to group, rather than allenbrowne at mvps dot org. "swingingming" <ming.mge@gmail.com> wrote in message news:1123566670.327279.83700@f14g2000cwb.googlegroups.com... > How can I do this ? This is the number used in invoice. > Thanks. Thanks. I will stay with your solution. It works fine. Because the invoice number actually consists of other Texts. ...

(patch for Bash) 'vcat', 'vset', 'vfile'
These 3 builtin commands are designed to "dump" and "reload" shell variables to/from file, without going through another layer of interpretation or parsing. In addition to reading/writing simple string for ordinary shell variable, the commands can handle positional parameters and array variables (both index and values). vcat [-0A] [name] > file Writes a shell variable NAME to stdout (inverse of 'vset'). If NAME is missing, then positional parameters are printed. Each value of array elements and positional parameters is terminated by '\0', whereas ordinary shell variable is not \0-terminated unless option -0 is given. By default, only the array values are printed, but option -A will print the array index as well. vset [-0A] [name] < file Assigns a shell variable NAME from stdin (inverse of 'vcat'). If NAME is missing, then positional parameters are set. If input data contains '\0', then it is considered array, and NAME will be converted to array variable. By default, only array values are set, but option -A will set the array index as well. If there is only one string with trailing '\0', then option -0 will set it to regular shell variable. vfile -[rw] [-d dir] [-0A] name... Read (-r) or write (-w) shell variables from/to files of the same name. Internally, it uses 'vcat' and 'vset', so full array content is preserved. vcat [-0A] name > name vset [...

Scilab's 'optim' and 'splin'
I've got this really cool application that makes a smoothed line using splines, then fits it to a source line using a nonlinear weighting. I'm currently using SciLab with it's 'optim' and 'splin' function to do this, but now I need to write some embeddable C++ code. The 'splin' function is obvious -- it generates a spline from a number of inflection points. The 'optim' function as I am using it uses a quasi-Newton method, which is working just fine for me. Before I go and write this stuff up by hand, does anyone have any suggestions on where I can find example code to do this? I'm mostly concerned with the optimization -- I'd like to get my hands on something where some one else has already fallen into the pitfalls. TIA. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com Posting from Google? See http://cfaj.freeshell.org/google/ "Applied Control Theory for Embedded Systems" came out in April. See details at http://www.wescottdesign.com/actfes/actfes.html Just a remark : there is a lsq_splin function which try to fit a splin to discrete points (with various weight if needed). May be it can help you at least to find a good starting point for your optimization ? hth Bruno Tim Wescott wrote: > I've got this really cool application that makes a smoothed line using > splines, then fits it to a source line using a nonlinear weighting. Is it important that you u...

Python 'for' as Scheme 'let'
We show that the 'for' operator of Python quite unexpectedly can be represented by a 'let' form of Scheme. What looks in Python like for k in range(1,4): print k looks in Scheme as (breset r (let ((k (range r 1 4))) (display k) (newline) )) This iteration construct uncannily resembles Python. It nests and supports the premature termination and skipping of iterations at any level. We should also emphasize that no intermediate lists are constructed! The 'let' in the above code is the ordinary Scheme let. The macro range has been described in the article: http://google.com/groups?selm=7eb8ac3e.0312172046.6d817907%40posting.google.com The macro range was actually designed to emulate 'range' of Matlab and Octave. The fact it turns out so useful to emulate Python loops was a pleasant surprise. All the code in this article should be considered a continuation of that in the quoted article. It is tested on Petite Chez Scheme, Gauche, Bigloo, Scheme48, and SCM. When we run (breset r (let ((k (range r 1 4))) (display k) (newline) )) we see the numbers 1 through 4 printed (in Matlab/Octave and our range, the range is inclusive). We can do more complex things: (breset r (let* ((k (range r 1 3 9)) (j (+ 10 k))) (display j) (newline) )) which prints the numbers 11, 14, and 17 We can terminate iterations early: (breset out (breset r (let ((k (range r 1 4))) (display k) (newline) (if (> k 2) (...

What is wrong with: str_replace('\\', '\', $content);
Hi all I have text area, where I can edit files - but I have to correct the returned data, for that I use $content=str_replace('\"', '"', $content); and $content=str_replace('\\', '\', $content); by some reason the latter one causes an error: syntax error, unexpected T_VARIABLE in.... Replacing :-) it by $content=str_replace("\\\\", "\\", $content); and it works what is wrong with '\\' ? WBR Sonnich try $content=str_replace("\\'", "'\'", $content); // Anders On 10 Jan, 09:19, jodleren <sonn...@hot.ee> wrote: > Hi all > > I have text area, where I can edit files - but I have to correct the > returned data, for that I use > > $content=str_replace('\"', '"', $content); > and > $content=str_replace('\\', '\', $content); > > by some reason the latter one causes an error: syntax error, > unexpected T_VARIABLE in.... > Replacing :-) it by > > $content=str_replace("\\\\", "\\", $content); > > and it works > > what is wrong with '\\' ? > > WBR > Sonnich On Jan 10, 8:19 am, jodleren <sonn...@hot.ee> wrote: > Hi all > > I have text area, where I can edit files - but I have to correct the > returned data, for that I use > > $content=str_replace('\"', '"', $content); > and > $content=s...

Increment with '#' and decrement with 'b'
Although I've had a lot of practice writing Perl I often feel that I'm not really a Perl programmer because the finer points of Perl style -- the things that really make Perl what it is -- aren't in the front of my mind. I would like help with a simple task which, try though I might, still looks really laborious the way I've written it. I'm turning a standard musical notation for a note into a pitch. The note "A" will be zero, and the other notes on the piano, black and white, will range from 1 (for B flat/A sharp) up to 11 (for A flat/G sharp). A "b" suffix reduces the pitch by 1; "bb" by two. Going the other way, a "#" suffix increases by 1 and "##" by two. So D is pitch 5, Dbb is 3. Equally D## would be 7. So I need to match the following strings to the pitches shown 0 A, Bbb, G## 1 A#, Bb 2 A##, B, Cb ... and so on I can write code lots of ways to do this, but it has no style: it looks like over-cooked potato dumplings, and there's little point in my posting it here. I can extract the basic pitch of the note reasonably elegantly with a hash, like this my %pitches = ( A=>0, B=>2, C=>3, D=>5 ... etc), followed by my $this_pitch = $pitches{ $this_letter }; But every time I try to allow for the accidentals I end up with tedious "if" statements, or multiple increments/decrements like this $self->{pitch}-- if (lc $acc) eq 'b'; ...

sys_context('USERENV','CURRENT_SQL')
Hi I am using an Oracle 10g database. Question:Is there a way to change the default value of sys_context('USERENV','CURRENT_SQL') from 256 to 4000. Thanks for your help. Ian IPower wrote: > Hi I am using an Oracle 10g database. Question:Is there a way to > change the default value of sys_context('USERENV','CURRENT_SQL') from > 256 to 4000. Thanks for your help. > Ian No ... why? -- Daniel A. Morgan University of Washington damorgan@x.washington.edu (replace 'x' with 'u' to respond) ...

Debian 'testing' and 'unstable'
In a previous post I think I got the functions of the testing and unstable branches of Debian arse-backwards. If so, sorry for any confusion, folks. -- Kier On Tue, 15 Jun 2004 22:55:24 +0100, kier wrote: > In a previous post I think I got the functions of the testing and unstable > branches of Debian arse-backwards. If so, sorry for any confusion, folks. Does it really matter? Debian is antiquated, unstable garbage. No wonder it's free. Stephan Simonsen wrote: > On Tue, 15 Jun 2004 22:55:24 +0100, kier wrote: > > >>In a previous post I think I got the functions of the testing and unstable >>branches of Debian arse-backwards. If so, sorry for any confusion, folks. > > > Does it really matter? > > Debian is antiquated, unstable garbage. > No wonder it's free. > Do you have any proof that Debian is unstable?? In article <Aa2dncXDiLo3EVLd4p2dnA@bresnan.com> (Tue, 15 Jun 2004 17:57:41 -0600), GreyCloud wrote: > Do you have any proof that Debian is unstable?? Debian unstable (also known as sid) is quite stable. How's that for proof! Hamilcar Barca wrote: > In article <Aa2dncXDiLo3EVLd4p2dnA@bresnan.com> (Tue, 15 Jun 2004 17:57:41 > -0600), GreyCloud wrote: > > >>Do you have any proof that Debian is unstable?? > > > Debian unstable (also known as sid) is quite stable. How's that for proof! Sounds good to me. Now convince the wintroll. On Tue, 1...

Web resources about - Change text color of uicontrol whose 'Enable' property is 'off' - comp.soft-sys.matlab

Resources last updated: 3/30/2016 4:31:17 PM