[Core Plot]How to change CPTTextStyle.color's value? - core-plot

I'm working with core plot . When I tried to customize the CPTTextStyle.color's value I found that it's readonly ! Who can tell me how could I change the color property's value ?

Use CPTMutableTextStyle. Core Plot follows the common Cocoa convention of mutable and immutable versions of some classes. Line styles, shadows, and plot ranges also follow this pattern.

Related

Is opencv API cv::cuda::cvtColor() feasible to extend by myself to support UYVY to RGB conversion?

I've found that cv::cuda::cvtColor() doesn't support all the color spaces. It only supports maybe half the color spaces known to be supported by cv::cvtColor()
cv::cvtColor(raw_mat, bgr_mat, cv::COLOR_YUV2BGR_UYVY);
This code above works well, but
cv::cuda::cvtColor(gpu_raw_mat, gpu_bgr_mat, cv::COLOR_YUV2BGR_UYVY);
This code above doesn't work. Because cv::cuda::cvtColor() doesn't include a conversion function for cv::COLOR_YUV2BGR_UYVY.
So I looked other functions for other color spaces like cv::CV_YUV2BGR. It is YUV_to_BGR(). From my seeing this function, I think I could implemet one for cv::COLOR_YUV2BGR_UYVY myself. I guessed it would be similar to YUV_to_BGR().
Can I easily implement it?
For me to do this, don't you have any information I can study? If it is possible I wish I impelemt one and contribute the new API.

Why isn't datatypes showing in blue color in vscode

Why here the int variable is not showing in blue color like the class Transaction color in blue mentioned above.
And its a .dart file for your clarity
There is a small difference between the two. class is a reserved keyword and the data types are types, and as such qualify differently to the code editor.
The class is a reserved language word and is painted as blue here. This includes every other special word that has a particular meaning to the language.
All other are identifier for data types. int, String and all others, even though they're built-in to the language, are used here as a data type that qualifies the identifier they're attached to, and as such have the green coloring in your case. Note that it's the same color as Transaction here, as this is a class definition and a class defines a (custom) type too.
class is a keyword. int is a type - in fact, since everything is an object in Dart, int is also a class, just like Transaction that you defined, so it makes sense to have the same color.
And if you really, really think this is wrong, you could always open an issue about it with the author of the Dart extension.

Idioms/Practices for Implementing Constrained Numeric Types in F#?

Suppose one needs a numeric data type whose allowed values fall within a specified range. More concretely, suppose one wants to define an integral type whose min value is 0 and maximum value is 5000. This type of scenario arises in many situations, such as when modeling a database data type, an XSD data type and so on.
What is the best way to model such a type in F#? In C#, one way to do this would be to define a struct that implemented the range checking overloaded operators, formatting and so on. A analogous approach in F# is described here: http://tomasp.net/blog/fsharp-custom-numeric.aspx/
I don't really need though a fully-fledged custom type; all I really want is an existing type with a constrained domain. For example, I would like to be able to write something like
type MyInt = Value of uint16 where Value <= 5000 (pseudocode)
Is there a shorthand way to do such a thing in F# or is the best approach to implement a custom numeric type as described in the aforementioned blog post?
You're referring to what are called refinement types in type theory, and as pointed out by Daniel, look for F*. But it is a research project.
As far as doing it with F#, in addition to Tomas' post, take a look at the designing with types series.
My suggestion would be to implement a custom struct wrapping your data type (e.g., int), just as you would in C#.
The idea behind creating this custom struct is that it allows you to "intercept" all uses of the underlying data value at run-time and check them for correctness. The alternative is to check all of these uses at compile-time, which is possible with something like F* (as others mentioned), although it's much more difficult and not something you would use for everyday code.

How to specify a range of data when using HighCharts with <table>?

I found this great tutorial on using HighCharts with , very useful but I couldn't find a related API letting me only specify a part of data in the table.
For example, in the case above (I added 2 cols to make it more easy to describe), what should I do if I only want to use HighCharts to display the data in a range (in the red dotted range)
Is there some parameter like datarange:{[0,0,4,4]} or even sometimes I only want to take care of some more complicated ranges (in the second image)
According to documentation:
* table : String|HTMLElement
* A HTML table or the id of such to be parsed as input data. Related options ara startRow,
* endRow, startColumn and endColumn to delimit what part of the table is used.
You can use startColumn/endColumn but data range is unforutnaltey not supported. You can request your suggestion in userVoice http://highcharts.uservoice.com/ system
http://jsfiddle.net/FYtnj/1/
Short description of how data module works you can find in full version of that file.
As you can see you can setup startColumn/startRow and endColumn/endRow. Something like data range isn't supported.
There is columns/rows option, but it works in a different way: http://jsfiddle.net/Y53FZ/

How can I set "999" as the DEFAULT missing value in SPSS/PASW?

I'm importing a very large dataset into SPSS. Many fields in the dataset contain a "999" value, indicating a missing value. I want to instruct SPSS to view them as such. However, default each variable in SPSS is set to having "no missing values". In variable view, you have to define "999" as being the "discrete missing value" for each variable. With hundreds of variables though, this is a lot of work:
Therefore: is there a way to define "discrete missing value 999" as the default missing value for each variable on import? This would save me a lot of work, but I cannot find the answer online (I only get tutorials as to how define 999 as the missing value for each variable seperately, as I am doing now).
Your help is be greatly appreciated!
Edit Now that I think about it: I can easily replace each "999" in the dataset by an empty cell. Aren't empty cells considered missing values by SPSS?
Syntax is your friend here as pointed out for the MISSING VALUES command. But you may have other metadata that is the same for many variables such as value labels or the measurement level. You can set those in syntax for multiple commands, but you might want to investigate the APPLY DICTIONARY command (Data > Copy Data Properties in the menus). Using it you can set up one variable with all the metadata to be shared and then apply all those specifications to a bunch of other variables.
I think you can change it for on variable, than copy that cell, select all other cells in the missing column (in variable view) and paste to all the other cells in once.
(The ctrl-C, ctrl-V shortcuts might not work)
But yes, empty cells are read as missing too.

Resources