bokeh crashes when to much options in select - bokeh

I am creating some visualization of scientific data, I decided to use bokeh (btw, is the any alternatives, that allow to create controls and plot without so much pain as bokeh?)
I wrote following code:
Select(value="Microtubule-associated protein 4",
title="Protein name:", options=df['Protein Name'].values.tolist()[1:100],
width=400)) # Sorting nexin-3
It works fine, but if I try to pass whole list as options param, it is crashes with error:
File "/home/my/.local/lib/python3.5/site-packages/bokeh/core/properties.py", line 1205, in validate
raise ValueError("expected an element of %s, got seq with invalid items %r" % (self, invalid))
ValueError: expected an element of List(Either(String, Tuple(String, String))), got seq with invalid items [nan, nan, nan, nan, nan, nan, nan]
print(df['Protein Name'].values.tolist() ) works fine

That message is not a case of Bokeh crashing. That message is a validation error, telling you that you are passing invalid data. The message says it fairly directly:
expected an element of List(Either(String, Tuple(String, String)))
To configure the options property for Select widget, you must pass either:
a list of strings: ['foo', 'bar', 'baz']
or a list of tuples of strings
You are trying to configure the options with something that makes no sense:
got seq with invalid items [nan, nan, nan, nan, nan, nan, nan]
Which is to say, the list of whatever things you are trying to pass in as options contains NaN values. This does not, and cannot, make sense, in the context of setting options for a Select widget.
If you disagree with this assessment, you'll have to provide more information, e.g. the entire contents of df['Protein Name'].values.tolist()
As a side comment: Most python libraries will simply fall over with a random exception when bad arguments are passed, Bokeh is somewhat unique in that it provides specific, detailed, and actionable validation errors like this. People work very hard to bring you open source software for free. Perhaps before disparaging that work, you first could take some time to make sure it's not, in fact, a case of user error.

Sorry, my fault, there was wrong piece of data in list.

Related

Xcos throws "Undefined variable: scifunc_block_m" message in console

When I run a Xcos model containing a scifunc_block_m block like shown below
I get an error message relating to data dimensions inconsistency:
"Data dimensions are inconsistent:"
" Variable size=[1,1]"
"Block output size=[100,1]."
But when I double click in the block in order to see what can I change to make the dimensions correct I get a message in the console saying
Undefined variable: scifunc_block_m
What bugs me is that scifunc_block_m is not the name of any variable, but rather the name of the block itself like can be seen in the official docs.
Of course I double checked that nowhere in my function phase_shifter neither anywhere else I have any variable named like that.
I tried with Scilab 6.1.1 and 6.1.0 believing that it might be a bug from apparently not.
In your phase_shifter.sce file generating the input variable,
the signalIn variable does not comply with the From Workspace block requirements, whose documentation says that the input variable
must be a structure with time and values fields
.time must be a column vector, and in your case
.values must also be a column
So,
t = (0:1/fs:Npp/fs - 1/fs); // time vector
signalIn = A*%e^(%i*w*t);
should be replaced with
t = (0:1/fs:Npp/fs - 1/fs)'; // time column vector
signalIn = struct("time",t, "values",A*%e^(%i*w*t));
This fixes the inconsistent dimensions message.
In addition, i am not able to reproduce your issue about Undefined variable: scifunc_block_m. The parameters interface opens as expected.
You may get this kind of messages if you try to run some xcos parts out of xcos, without beforehand loading xcos-related libraries.
Then, we get an unclear "Output should be of complex type." message on the From workspace block.
By the way, you try to plot some complex values. Please have a look to the MATMAGPHI block before entering MUX: https://help.scilab.org/docs/6.1.1/en_US/MATMAGPHI.html

Transform byte flags in error status codes to int

I'm confused in bitmasks, bitflags, and other "bit" stuff.
I have a list of error codes - like [102, 104, 108, 80000000, 8000000, 10000000, 1000000, 0x0008000, ....]. Part of it writing in system logs like bitflags, f.e. "67108864" (and part of them not, and return normal numbers). I need to match them, but I can not find any algorithm. How I can do that? Maybe it used only for codes like "0x0008000"? If it is true how to define which of this?
The problem is deeper. I do not understand byte flags. I understand that flags usually used for boolean states, but here is logged status codes. For example, 102 is (1100110)2. Byte flag for that number is 2+4+32+64 ... It is how I do transform int to binary form, and it is obviously equal 102. So I'm confused.
Thanks for your time!
You have to separate
numbered error/message codes (usually values in some range like 101, 102, 103... or in some ranges) - they just specify what error is occured, this error (like "file isn't found") is fully qualified (at least message creators believe :))
codes containing set of flags (usually written in hex or binary notation if available) - they give us details, every bit contains a piece of information.

abap runtime error program line too long

Good day. The programs function is to take an equipment number (or none), display that number with a description (or all) in alv, and then run IE03 should the user double click on
Program worked fine in client 110, but in 150 a runtime error happens. This morning I tried to make a new program with a shorter name (only lead I had), activated it (window popped up asking me to activate the previous version as well). That didn't work and now the original doesn't work in either.
The program "SAPLSKBH" is terminating because program line is too long, being 78 chars wide which is too much for the internal table "\FUNCTION=K_KKB_FIELDCAT_MERGE\DATA=L_ABAP_SOURCE[]"
It sounds like you are using REUSE_ALV_GRID_DISPLAY for output, is that correct?
Check you source code; somewhere you have a line that is more than 78 characters. The function K_KKB_FIELDCAT_MERGE takes the source code of your program to produce a structure that corresponds to the table/structure you give it. (In the old days, there was a limit of 78 characters width for a line of ABAP code, and this is an old function module).
You can alternatively build a field catalog yourself in code, rather than use this function.

gotoAndStop(label) fails with error 2109

I have two movie clips:
mov1 has frames with labels in such sequence ("item"," btn", "win", "loose")
mov2 has frames with labels in such sequence (" ", "item", "win", "loose")
This is two standardized movie clips, which are ruled by one class MovItem.
In constructor of MovItem I init:
public function MovItem(item_mc:MovieClip )
{
this.item_mc.addEventListener( MouseEvent.CLICK, dispatchEvent );
//this.item_mc.gotoAndStop('btn');
this.item_mc.gotoAndStop(1);
}
In web version all works correctly, but in AIR 2.6 for Android it fails with error:
Error #2109: Frame label btw not found.
on gotoAndStop('btn'); on element which don't have such label.
And when I'm gotoAndStop(1); on this item all works fine.
All should be great, but 'btw' label on second movie clip is situated on second frame.
How can I fix it easily without total rework in .fla resources? Why does it works on web application, but on AIR fails? Thanx for you time.
This is actually happening in both the web version and the AIR version because mov2 has no frame called btn.
On the web version you will get a compiler warning but instead of quitting the application it just ignores the gotoAndStop(). However when compiling to AIR the compiler is in strict mode which converts compiler warnings to errors and won't allow you to compile until they are fixed.
It is bad practice anyway to call a function that you know is erronous (especially in a constructor method) so you should ether pass the frame to the constructor as a parameter (if they are going to different frame numbers) or explicitly give it the frame number e.g. gotoAndStop(2) (if they all go to the same frame number).
Also check you haven't misspelt the frame as you refer to the frame as both btn and btw in your question.

Xcode 4 and wrong "Semantic Issues" - How to deal with them?

I've started using Xcode 4, and I'm really annoyed by some of the "features" especially those semantic warnings which don't seem to be making much sense, for example:
http://coding-journal.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-07-at-8.50.46-PM.png
On line 640, you can see a semantic issue saying that I am passing an incompatible pointer type to a parameter of NSString *, which is just plain wrong because the signature of NSTabViewItems' initWithIdentifier: is:
- (id)initWithIdentifier:(id)identifier
My guess is that Xcode thinks that I am calling initWithIdentifer: on some other object, because when I Cmd+Click the method, it gives me three options:
http://coding-journal.com/wp-content/uploads/2011/08/Screen-Shot-2011-08-07-at-8.50.24-PM.png
And the first one, from NSTableColumn, has the signature
- (id)initWithIdentifier:(NSString *)identifier;
So my question is, what do I do in this situation? I like my code warning-free, but this doesn't seem to be possible when using Xcode 4 :(

Resources