C++ :: Can XML Schema Be Used To Define Meta Data (using Xerces)?
Feb 17, 2013
say I have an xml-file. Now what my program does depends on the "element". Is it possible for xml schemas to define the action that the program should do? Ie is the following possible:
<xs:element name="test" hidden=true action=myActionOnTestElement>
And then when xerces' parser reads elements of name "test" it also stores the action & that this element is "hidden". If this is impossible with xerces, is it possible at all with XML parsers?
View 1 Replies
ADVERTISEMENT
Jun 16, 2014
I would like to know how to make Lynx follow meta refresh links automatically, At the moment it just provides a "clickable" link you can accept the refresh. I would like this to be automatic.
--- Initial problem ---
We have a DB Backup script written in PHP/HTML and uses the page refresh to loop the backup (every 2 minutes). Using a full fledged browser is not really an option on our machine as the resources are very tight. So we tried Lynx and it has the perfect footprint but the only problem is it doesn't refresh the page.
I'm thinking I just need some way to force Lynx to reload the page after the time has elapsed. Maybe create a new function that starts a timer and hold the url until the timer ends then force Lynx to visit that url. Im a PHP Procedural kinda guy and I cant think how to set this timer event safely without corrupting or crashing the program or creating memory leaks.
(source code im using: [URL])
This is the function that handles meta refresh.
Code: /*
* Given a refresh-URL content string, parses the delay time and the URL
* string. Ignore the remainder of the content.
*/
void LYParseRefreshURL(char *content,
char **p_seconds,
char **p_address)
[code].....
View 4 Replies
View Related
Jan 14, 2014
The scenario is that I have an XSD schema; I have generated a C# class using the XSD tool in the Visual studio command line.
I have then created a basic console app, which will populate the first partial class in the generated C# class.
The program will then serialize this data and create an XML in a folder as a proof of concept.
The issue I'm having is working out the best way to populate and serialize all the data from the class, as the XSD it was generated from is quite large.
I would like to be able to randomise the data at a later stage once I have the basic populating and serializing working.
View 6 Replies
View Related
Mar 21, 2013
I program unix sokcet programming , and part of my code is ti open file from server and open it , but i surprised with this wierd error i dont have any reason for it ?
Code:
#include <errno.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/socket.h>
[Code] ....
File name is : myHeader.h
myHeader.h:24:1: error: unknown type name "File"???
View 1 Replies
View Related
Jul 11, 2012
For example, in a header file A.h, I define an abstract class,
Code:
// A.h
class A {
public:
virtual void foo() = 0;
private:
static int _x;
};
How'd I initialize static member data _x?Normally, we initialize a static member data in a cpp file. However, there is not cpp file for A.h. If I intialize _x in header file, there will be linker errors like mulitple defined symbols. What is appropriate way to do that?
View 4 Replies
View Related
Jul 24, 2013
I am trying to understand how to get the following value from a define. The code i am trying to understand is as follows:
Code:
#define RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET {0xF000}
Code:
#define RADIO_CONFIGURATION_DATA {
Radio_Configuration_Data_Array,
RADIO_CONFIGURATION_DATA_CHANNEL_NUMBER,
RADIO_CONFIGURATION_DATA_RADIO_PACKET_LENGTH,
RADIO_CONFIGURATION_DATA_RADIO_STATE_AFTER_POWER_UP,
RADIO_CONFIGURATION_DATA_RADIO_DELAY_CNT_AFTER_RESET,
RADIO_CONFIGURATION_DATA_CUSTOM_PAYLOAD
}
and also have this
Code:
typedef struct {
U8 *Radio_ConfigurationArray;
U8 Radio_ChannelNumber;
U8 Radio_PacketLength;
U8 Radio_State_After_Power_Up;
U16 Radio_Delay_Cnt_After_Reset;
U8 Radio_CustomPayload[RADIO_MAX_PACKET_LENGTH];
}
tRadioConfiguration;
so then in the api i have the following
Code:
for (; wDelay < pRadioConfiguration->Radio_Delay_Cnt_After_Reset; wDelay++); .
so my question is how do i declare my variables, correct terminology ?, to achieve this.
View 7 Replies
View Related
Mar 6, 2015
I have one small doubt in arrays. Is it possible to define arrays like this a[b[10]] ?...
View 6 Replies
View Related
Aug 31, 2013
I want to define variable that is in HEX value & has 64 bits.but I dont know what I can use.....I use unsigned long long but it doesn't useful.
View 2 Replies
View Related
Feb 24, 2013
It is my first time in use lock detect so i didn't now how to start.
how to define the lock detect?
View 4 Replies
View Related
Sep 3, 2014
I nead to define an a negative number a normal posetive number i defined like #define RSSI_UP 1 can i write #define RSSI_DOWN -1???
View 2 Replies
View Related
Aug 9, 2013
First this is my code:
#include <iostream>
#include <vector>
#include <cstdlib>
[Code].....
the blacked content got problems: the error messages are the throat_t::P or throat_t::T is inaccessible.
View 3 Replies
View Related
Sep 16, 2013
I want to define a class, which will have two members, for example, vaporPressureStatus and vaporPressure
enum vpStatus_t {nonesense, unknown, known, saturated};
class pore_t {
public:
vpStatus_t vpStatus;
double vaporPressure;
};
when vpStatus is nonsense and unknown, the vaporPressure should not have a value; and if I calculate out a value for vaporPressure, the vpStatus can be set as known.
I am wondering if there is any set, pair or other structure can hold this two members together, so that when I change one's value, the other guy will also change accordingly.
View 3 Replies
View Related
Apr 29, 2014
Define a class for a type called CounterType. An object of this type is used to count things, so it records a count that is a non-negative whole number.
Include a mutator function that sets the counter to a count given as an argument. Include member functions to increase the count by one and to decrease the count by one. Be sure that no member function allows the value of the counter to become negative.Also, include a member function that returns the current count value and one that outputs the count. Embed your class definition in a test program and run sufficient tests to verify it all works correctly.
View 1 Replies
View Related
Sep 27, 2013
What I'm trying to do :
struct foo {int x; int y;};
foo function_example(int x, int y) {
foo temp;
temp.x = x;
temp.y = y;
return temp;
}
Works as is, however when I try doing it through seperate class files :
//header file for class example_class
struct foo {int x; int y;};
foo function_example(int x, int y);
//source file for example_class
foo example_class::function_example(int x, int y) {
foo temp;
temp.x = x;
temp.y = y;
return temp;
}
I get an error telling me that foo is undefined, and that declaration of function_example(int x, int y) is incompatible with the declaration of it in the header file.
View 1 Replies
View Related
Aug 15, 2013
I want to write encryption algorithm.first af all I need to define variable( binary input ) that it is 256 bit but I dont know what should I use...then I want to XOR this to variable ( a & b ) ( each of them is 256 bit)
View 6 Replies
View Related
Jan 16, 2013
I have written code for a timer. with everything and i want to include this so i dont need to write or copy the reqd code each time. how do i do this?
View 9 Replies
View Related
Apr 15, 2015
If I’m trying to define an optional one to many relationship I need to reference the primary key of the table
e.g
modelBuilder.Entity<TCC_ArchivedIntegrationExceptions>()
.HasRequired(t => t.TCC_TransactionHistory)
.WithOptional(t => t.TCC_ArchivedIntegrationExceptions);
Where TCC_ArchivedIntegrationException is the optional key.. but those models are inheriting their key from a base entity
So do I have to create the key explicitly in the model or is there another way around this?
View 1 Replies
View Related
Oct 7, 2014
When are you creating fields/properties for specific classes and when you are not doing it but creating them inside just lets say straightaway inside some methods within that classes. I mean if i got class where inside i want to create instance of some other class and then pass this instance to another class - should i create a field for it within class i am doing this operation or not? I was always reading that you create field/properties when its belong to class itself. So if i want only to create some instance outside class i am working and pass it to other class and this is not exactly the part of this class shouldnt i create a field for it and just create it inside method?
View 5 Replies
View Related
May 15, 2014
I want a speed of O(1) in search, insertion and deletion.
is std::map<> the way to go?
View 4 Replies
View Related
Jul 14, 2014
In C++ there are a number of primitives that are not defined in terms of other types. By this I'm thinking
int a = 1;
char b = 'M';
float c = 3.45f;
short d = 0xC3A3;
Is it possible to define your own literal? What I would like to do is have a hex literal for a data type where n = sizeof(data_type). If this type were a big integer, then I would want something like:
BigInt e = 0x13CA9B0C98D983E912DA0B0A9F87E0;
My goal is to assign a value from one contingous chunk of bytes and to not do it with a string.
View 1 Replies
View Related
Sep 17, 2013
I just compiled some code I've been working on at a different OS/compiler and realised that Code: sizeof(unsigned long) returns 4 in one pc and 8 in another.
I've heard that bytesize conventions for basic variables were not particularly "universal" before but this is the 1st time I've had a problem with it.
how do I make a typedef that clearly indicates to whatever compiler compiler I want u32 to be an 32bits unsigned and u64 to be 64bits?
View 12 Replies
View Related
Jan 18, 2015
How can I define type MARKS which will be able to hold 4 elements just like array? I want to access it just like normal array elements using brackets []. In the following struct I want to use such type.
Code:
typedef struct {
MARKS ** pointers;
} ARGUMENTS
void main(){
ARGUMENTS arguments;
[Code] ......
Purpose of the struct ARGUMENTS is to hold 4 pointers to string. I want to mark few positions in string so I can simple access them. E.g. name=John
Code:
arguments[0][0]=0; // begin of the param name
arguments[0][1]=3; // end of the param name
arguments[0][2]=5; // begin of the value
arguments[0][3]=8; // end of the value I mean not to save int but the pointer to the corresponding position.
View 8 Replies
View Related
Jan 20, 2013
I am trying to run a simulation with a large number of objects (mainly arrays and vectors). I am not sure where shall I define my objects: inside or outside of the main() function, like the following two structures:
(1) ---------------
//main.cpp
int main(){
array<double, 1000> a_1 = {};
array<double, 1000> a_2 = {};
......
func_1(a_1, a_2, ..., a_100);
return 0;
}
[Code]...
I know there is a question about scope. But besides this question (which seems have no difference between these two structures here), is there any difference in terms of execution performance or security issue?
View 3 Replies
View Related
May 20, 2013
I've been studying "algorithm" by myself by book. And there's this part - vulnerable point of "define" syntax on recursive programming.
Code:
int max_arr2(int arr[], int arr_len) {
int (arr_len == 1)
return arr[0];
else
return max(arr[arr_len-1], max_arr2(arr, arr_len-1);
.
.
This book says, " function 'max_arr2' is just recursive function, without any problem. but if max() is defined like this,
#define max(x,y) ((x)>(y) ? (x):(y))
and if array is just declined, it will take very long time."
I typed this code and run, and actually it really takes long time.
View 1 Replies
View Related
Jan 16, 2013
Is it possible to define and write your own file extension. if so is it an easy process or a complex waste of time. All I want to do is define a source file for a programming language I write.
View 3 Replies
View Related
Jul 11, 2014
I want to overload pure virtual function from 3rd party SDK class to put my debug messages like that:
errorStatus aXsaction(){printf(_T("
abort transaction"));transactionManager->abortTransaction();}
#define transactionManager->abortTransaction() aXsaction()
But compiler complains on the minus sign:
error C2008: '-' : unexpected in macro definition
Is it possible to trick the compiler?
View 4 Replies
View Related