Do you know a js library that implements a generic Iterator class for collections (be it Arrays or some abstract Enumerable) with a full set of features, like the Google Common or the Apache Commons?
How can I generate a class diagram and other related modeling diagrams from source code ?
I am open to any tool (Eclipse plug-in etc) but does Netbeans has a plugin for it too?
For example,
val list = List(1,2,3)
list match{
case a:::b =>
case _ =>
}
you can match head and tail of a List using :::' or tokens of ParseResult using~'. What should I do to create class that can be matched like preceding classes?
What's the best way of parsing the folowing rss feed item into a C# class.
<item>
<fh:FlightHistory FlightHistoryId="189895136" >
<fh:Airline AirlineCode="EI" Name="Aer Lingus" />
</fh:FlightHistory>
</item>
Please provide scenarios/conditions those fail during deserialization when a class & serialized object have same serialVersionUID?
I'm looking scenarios like following
1) If a data type of an instance variable is changed then deserialization will fail
Could you please provide all such scenarios. I couldn't find such scenarios list anywhere in the internet.
Thanks
Hi,
I have the following member of class foo.
foo &foo::bar()
{
return this;
}
But I am getting compiler errors. What stupid thing am I doing wrong?
Compiler error (gcc): error: invalid initialization of non-const reference of type 'foo&' from a temporary of type 'foo* const'
How can I convert a Class to byte array in C#. This is a managed one so the following code is failing
int objsize = System.Runtime.InteropServices.Marshal.SizeOf(objTimeSeries3D);
byte[] arr = new byte[objsize];
IntPtr buff = System.Runtime.InteropServices.Marshal.AllocHGlobal(objsize);
System.Runtime.InteropServices.Marshal.StructureToPtr(objTimeSeries3D, buff, true);
System.Runtime.InteropServices.Marshal.Copy(buff, arr, 0, objsize);
System.Runtime.InteropServices.Marshal.FreeHGlobal(buff);
Thanks
Hello,
gcc 4.4.1 c89
I have the following code and I get a warning:
unless class storage specifier in empty declaration
static enum states
{
ACTIVE,
RUNNING,
STOPPED,
IDLE
}
However, if i remove the static keyword I don't get that warning.
I am compiling with the following flags:
-Wall -Wextra
Many thanks for any suggestions,
I have an object, 'Response' that has a property called 'submitter'. Submitters can be one of several different classes including Student, Teacher, etc...
I would like to be able to execute a criteria query where I select only responses submitted by teachers - so this means putting a class restriction on an associated entity. Any ideas on this? I'd like to stay away from direct SQL or HQL.
intrusive_ptr requires intrusive_ptr_add_ref and intrusive_ptr_release to be defined. Why isn't a base class provided which will do this? There is an example here: http://lists.boost.org/Archives/boost/2004/06/66957.php, but the poster says "I don't necessarily think this is a good idea". Why not?
This compiles well for me - However other people on a different thread are saying that protected classes cannot be declared in c# at top level
Is that the case?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
protected class CsvReader
{
}
}
in java you can create an object directly after the property field like this:
but it seems not working for php:
class Test {
public $object = new Object();
}
you have to create it in the __construct() and assign it to the property?
thanks
Hi, I'm relative new to C++ and my background is in Java. I have to port some code from Java to C++ and some doubts came up relative to the Object Java's class. So, if I want to port this:
void Algorithm::setInputParameter(std::string name, Object object) { ..... }
I believe I should use void* type or templates right? I don't know what's the "standard" procedure to accomplish it.
Thanks
I need to loop through some elements in the page and then, for each one, if it had a class beginning with, for example, "C", do something.
$('#dialog li').each(function(){
if ($(this).hasClass("^C")){
//do something
}
}
It may sound silly, but what selector/method should I use on the if clause?
Thanks in advance.
How do we populate\retrieve information from\into multiple forms in same action class in Struts2 ? With ModelDriven approach, action is tied to one form. With ScopedModelDriven interceptor jsp becomes dirty as one has to write model.property to access form properties. Is there a better way of doing it?
I am having some trouble getting this simple code to work:
class CreateUserView
{
public:
CreateUserView(void);
~CreateUserView(void);
UserController* controller;
void showView();
string name;
string lastname;
string address;
string email;
string dateOfBirth;
};
All i need is to set these attributes in the implementation with getline().
CreateUserView::CreateUserView(void)
{
}
void CreateUserView::showView()
{
cout << endl << " New User" << endl;
cout << "--------------------------" << endl;
cout << " Name\t\t: ";
getline(cin, name);
cout << " Lastname\t: ";
getline(cin, lastname);
cout << " Email\t\t: ";
getline(cin, email);
cout << " ===============================" << endl;
cout << " 1. SAVE 2.CHANGE 3.CANCEL" << endl;
cout << " ===============================" << endl;
cout << " choice: ";
int choice;
cin >> choice;
cin.ignore();
controller->createUser_choice(choice);
}
I keep getting this "Access violation reading location" error at this line:
getline(cin, name);
what's the best way of assigning a value to an std::string attribute of a class?
even name = "whatever" is throwing that error!!
thanks
Hello,
To get the type of a class called myClass I do this
Type myType = (typeof(myClass))
How about, instead of having myClass, I've rather the instanceOfMyClass? How do I get the type?
Let's say I've this
Contact contact = new Contact();
If I want to know which type is contact, how do I do it
Thanks for helping
I am trying to create new object of other class in a for loop. like
for(int i =0;i<10;i++){
Computer p1=new Computer(10,20);
}
and when I try anywhere to reach p1.someAction(); it say you must declare p1. But if I declare it on top of program how can I create again in loop? I also try only Computer p1; but it gave exeption ..
Hi,
I want to exclude certain fields in the init function of a modelform depending on a parameter passed in, how do I do this? I know I can add exclude fields using the meta class of a model form but I need this to be dynamic depending on the variable passed in.
Thanks
I have a C# function that does some processing and needs to return figures about what it has processed, success, failure, etc.
Can anyone tell me if there are any standard framework classes that will handle this (for example, number of records processed, number successful, failed, etc) ?
Alternatively, can anyone say how they usually handle this? Is the best way to create a class, or to use out parameters?
How to make reference from xml-comment of UpdateChanged to Long1 field ?
public sealed class SystemConfiguration
{
public long Long1;
/// <summary>
/// Make reference to Long1
/// </summary>
public bool UpdateChanged;
}