Creating a cursor by name doesn't compile? - gtkmm3

The doc says "The recommended way to create cursors is to use gdk_cursor_new_from_name()", but when i try :
#include <gdkmm/cursor.h>
...
Gdk::Cursor m_hand_cursor = Gdk::Cursor::new_from_name("pointer");
...
I get this error:
error: ‘new_from_name’ is not a member of ‘Gdk::Cursor’
Gdk::Cursor m_Hand_Cursor = Gdk::Cursor::new_from_name("pointer");
What am i doing wrong?

You should consult the GTKMM documentation, not the C GTK documentation, if you want to use the GTKMM API...
Gdk::Cursor::Create(Gdk::Display::get_default(), "pointer");

Related

Deedle, F# and read csv

I am facing an issue when I try to use the function Deedle.Frame.ReadCsv
I am trying to use the overload here: https://collective2.com/c2explorer_help/html/806c0295-1a9f-1bf4-50eb-a221419abe06.htm
let schemaSource = "dateRep (DateTime),,,,,,,,,"
let dataSource = Deedle.Frame.ReadCsv(path = "data.csv", schema = schemaSource)
When I do so, I get the following error:
error FS0503: A member or object constructor 'ReadCsv' taking 0 arguments is not accessible from this code location. All accessible versions of method 'ReadCsv' take 9 arguments.
What I do not get is that all but path are optional. If I use just:
Deedle.Frame.ReadCsv("data.csv")
It then works...
Any idea? I tried to find some resources on using overloaded functions from other .Net languages with optional parameters but I have not been successful.
I am not sure why the Intellisense/Signature shown in Visual Studio was wrong but using location = works...

F# non-static methods in modules

I am an absolute newbie to coding, but I need to modify a F# script. It always gives me the error "Method or object constructor 'x' is not static". I read that this might be due to the fact that I try to call a non-static method within a module, which is by default static. For example 'x' = Get.Axis():
module Primitives =
let axis1 = Zaber.Motion.Ascii.Device.GetAxis(1)
The manual only provides code in C#: var axis1 = device.GetAxis(1);
If I use static member instead of let, I'll get a 'unexpected keyword static in definition' error, although I checked the indentation as suggested in another question.
Assuming you're using the Zaber Motion Library, I think what you need to do is get an instance of a device first, instead of trying to access the class in a static context.
Their documentation includes an example of how to get a list of devices by opening a serial port:
open Zaber.Motion.Ascii
use connection = Connection.OpenSerialPort("COM3")
let deviceList = connection.DetectDevices()
match deviceList |> Seq.tryHead with // See if we got at least one device
| Some device ->
let axis = device.GetAxis(1)
// TODO: Do whatever you want with the axis here
| None ->
failwith "No Devices Found on COM3"

The method fromQuery(String) gives an error in an eclipse dataflow project. How should I solve it?

The error below is generated:
The method fromQuery(String) is undefined for the type
BigQueryIO.Read.
And, it occurs in the following line :
PCollection<TableRow> somename = p.apply(BigQueryIO.Read.fromQuery("Select * from abc:def.ghi"));
I looks like fromQuery(String) belongs to BigQuery.Read.Bound. You're missing the .Bound.
Try:
PCollection<TableRow> somename = p.apply(BigQueryIO.Read.Bound.fromQuery("Select * from abc:def.ghi"));
Check out the documentation here.

FlowProgram vs. Program

I'm trying to use the FlowGraphsAndClassDiagrams skeleton as provided to TU Eindhoven. For the function buildGraph a FlowProgram should be given. I tried to run the following:
m = createM3FromEclipseProject(|project://eLib|);
FlowProgram p = createOFG(|project://eLib|);
rel[loc from, loc to] relations = buildGraph(p);
This yields the error message: expected FlowProgram, but got Program.
So, the question is, what is a FlowProgram and where is it defined? What is the difference between it and the program as created by createOFG?
There seems to be a version difference. createOFG returns something of type Program which used to be in a previous version FlowProgram. So if you change FlowProgram to Program in your code it will work. Or you could ignore the type completely and use p = createOFG(|project://eLib|); and the type should be inferred for you.
Additional information:
Program is defined in lang::ofg::ast::FlowLanguage as data Program = program(set[Decl] decls, set[Stm] statements);

Cannot convert value to bool : InvalidArgumentException

I am using cakephp 3.3 for my vod application and i want to insert data using following query:
$query=$notifications->query()->insert(['message' ,'status','user_id' ,'video_id' ,'notify_to' ,'notification_type'])
->values([
'message'=>'Congratulations! your video '.$video_name.' has been approved to be uploaded on MM2View by admin.',
'status'=>$status,
'user_id'=>$user_id[0]['users_id'],
'video_id'=>$id,
'notify_to'=>1,
'notification_type'=>3
])
->execute();
But i am getting
Cannot convert value to bool : InvalidArgumentException Error message. I have done some google related to this problem but did not find any correct solution.
Invalid argument exceptions are caused because of type mismatch in operations you written in the code.
Check your model class for the type you given and compare it with the code

Resources