Converting Erlang record to binary - erlang

I have a method for which I need to pass a record as a binary. I tried list_to_binary/1 both by passing the record itself in and converting the record to a list first then passing it in. However, I get a bagarg error with either options. Not sure what I'm missing? Can anyone help with this?
Thanks in advance!

If you need a binary, you might consider term_to_binary() and binary_to_term() functions..

Related

how to write blank lines in object ADODB.Stream?

I want to know how to skip a/multiple line(s) in object ADODB.Stream in visual basic code. The only paramater for writing text that I know is stream.WriteText for this object. Parameter:
Write, WriteLine and WriteBlankLines is for object FileSystemObject. So there is no way to type stream.WriteBlankLines under ADODB.Stream. It will pop-out error. If anyone knows, I appreciate your kindness.
Error is caused by stream.vbcrlf, using:
stream.WriteText vbCrLf
should work.
Finally, I found the answer. Just type stream.vbCrLf after stream.WriteText. And it will go down and start at new line.

Is ImageFigure() Constructor present in graphiti.js like draw2d?

i found one method ImageFigure() in draw2d. So i want to know is it presnt in graphiti.js also. If it present in graphiti then it solves my problem on grouping object.
Thanks In advance.
ImageShape or ImageFigure is not part of the current graphiti version. Graphiti tries to implement almost all functions/object from Draw2D......but it requires some time.

inet_addr functionality in erlang

As the question says, is there any function or module that performs the functionality of inet_addr ?
Results from google isnt suggesting any direct way or am i missing something ?
Thanks.
You can use inet_parse:address, and then convert the resuting list to binary. e.g.
16> list_to_binary(tuple_to_list(element(2,inet_parse:address("192.168.42.2")))).
<<192,168,42,2>>

What is a "NullReferenceError" in ASP.NET MVC?

I keep getting "NullReferenceError" in my output, could someone kindly explain what exactly this statement means.
Somewhere in your code, you are trying to access a member of a reference type, but the variable actually is null. Without code and a stacktrace it's impossible to say what exactly happens. It might be because some parameter is expecting a value but isn't supplied one.
If it helps, a decent description of NullReferenceException -- why/when they occur, and how to prevent them -- at http://www.dotnetperls.com/nullreferenceexception

Check whether a variable is an Array

I want to find out whether a variable is an array or not
if (params.writtenLines == ???)
Much appreciated.
More importantly, why do you want to check whether it's an array? If you know the parameter might be a single string or a list, you can now use:
def lines = params.list("writtenLines")
That came with Grails 1.2.
This functionality is already available in pure Java and can therefore be used in Groovy, too:
if (params.writtenLines.class.isArray())
I realize this is a bit late, but what about this:
List.isCase(params.writtenLines)
Wouldn't it be a correct solution, too?

Resources