custom-type Questions

4

Solved

I come from a python world where only hashable objects may be used as keys to a dictionary. Is there a similar restriction in C#? Can you use custom types as dictionary keys?
Sinew asked 6/9, 2013 at 8:19

6

Under PostgreSQL, I'm using PersistentDuration for the mapping between the sql type interval & duration but it doesn't work. Another user found the same issue & come with his own class: p...
Dieldrin asked 22/12, 2009 at 10:53

3

Solved

I want to create a custom type in Dart like I would do in typescript. This type should be a subtype of String, accepting only some values. For example, in Typescript I would do: type myType = 'HELL...
Plutocrat asked 30/3, 2022 at 15:2

3

Solved

I need to use custom type, e.g., LunarDate, in my Mojo object: class MyMojo extends AbstractMojo { /** @parameter */ LunarDate lunarDate; } And I want to configure the parameter in <confi...
Maje asked 17/4, 2012 at 9:23

1

In Elm, there's no native way to encode/decode a custom type. This makes send and receive custom-typed values to JS difficult. I was confused for a while and wonder how to handle simple custom type...
Andro asked 17/5, 2020 at 19:58

5

Solved

In phpDoc-generated documentation I can cause phpDoc to generate a link to a custom type definition for a given param using @param CustomType $variablename and that works great. However, the co...
Arnhem asked 3/2, 2012 at 16:35

1

Solved

Does Rust have a feature whereby I can create define potentially non-existent methods on traits? I realize that Option can be used to handle potentially non-existent properties but I don't know ho...
Hell asked 19/8, 2018 at 7:43

1

Solved

I parse a .yaml file and need to unmarshal one of its properties in a custom manner. I am using the "gopkg.in/yaml.v2" package. The property in question is stored like this in my .yaml file: end...
Underrate asked 28/3, 2018 at 9:8

1

Solved

I have made some custom Data types for number representation in Haskell, now I want to implement Eq instances for it, but I am somehow stuck. So I have already made: data Digit = Zero | One | Two...
Granger asked 19/11, 2016 at 16:7

1

I'm developing an API as RESTful as possible (though the HATEOAS constraint is not met thus it is not a REST API per se) I'm versioning the API, and since there are several ways to do this, I think...
Idou asked 18/3, 2015 at 11:48

3

I am trying to test a form type I have creating that uses a field with class entity here is the creation of the form $builder ->add('name', 'text') ->add('description', 'textarea') ->ad...
Mettah asked 2/5, 2013 at 14:50

1

Solved

Having this table structure: CREATE TABLE `tableName` ( `Id` int unsigned NOT NULL AUTO_INCREMENT PRIMARY KEY, `Status` enum('pending','rejected','sent','invalid') NOT NULL, `Body` varchar(255)...
Ofay asked 16/5, 2015 at 15:12

1

Solved

I have the following custom type on Postgres: CREATE TYPE my_custom_type AS ( field_a VARCHAR, field_b NUMERIC(10,3) ); and the following table: CREATE TABLE my_table ( COL1 VARCHAR(120) NO...
Showalter asked 1/4, 2015 at 3:25

4

How do I write a custom Long class to handle long values in Oracle, to avoid the following error? Caused by: java.sql.SQLException: Stream has already been closed. Thanks
Cahoot asked 16/4, 2012 at 13:20

4

Solved

Display posts with 'Product' type ordered by 'Price' custom field: $query = new WP_Query( array ( 'post_type' => 'product', 'orderby' => 'meta_value', 'meta_key' => 'price' ) ); ...
Brede asked 1/10, 2012 at 19:21

7

Solved

Is it possible to make an enum using just numbers in C#? In my program I have a variable, Gain, that can only be set to 1, 2, 4, and 8. I am using a propertygrid control to display and set this val...
Thou asked 1/6, 2010 at 18:19

2

Solved

I have an array A of objects, each with the public field Value (double) which have random doubles between 0 and 1. A is sorted by this field. I create double random = 0.25. Now I want to find the f...
Aeronautics asked 26/2, 2013 at 19:52

2

Solved

I am looking to create a type family that would represent data sizes (Byte, KB...). for that, the idea is to build a base type to have the real sizes based on: type SizeUnit = Int type B = SizeU...
Westfalen asked 18/10, 2012 at 20:39

1

Solved

I'm trying to create a permalink pattern for a Custom Type, that includes one of its taxonomies. The taxonomy name is known from the start (so I'm not trying to add or mix all of its taxonomies, ju...
Metalepsis asked 11/10, 2011 at 8:48

3

Solved

I'm developing an application on the datagridview filtering. I'm using RowFilter property of the dataview for the filtering data. My database table contains int & varchar data type fields. And ...
Repand asked 26/2, 2011 at 6:3

1

Solved

I'd like to know why one is able to create a new attribute ("new" means "not previously defined in the class body") for an instance of a custom type, but is not able to do the same for a built-in t...
Yeeyegg asked 30/7, 2010 at 18:52
1

© 2022 - 2024 — McMap. All rights reserved.