When a user clicks a button I need to create a .bmp file on the server. After the .bmp file is created I will load it into the html page. Would Ajax be the best way to accomplish this?
In some library I'm using (written in C) its
StorePGM(image, width, height, filename)
char *image;
int width, height;
char *filename;
{
// something something
}
All functions are defined this way. I never seen such function definitions in my life. They seem to be valid to MSVC but when I compile it as C++ it gives errors.
What is it? some kind of old version C?
Hi All
i have HTML string value and i want to get one attribute(id) value from that html String value
can u help me how to do it??
String msHTMLFile = "<ABBR class='HighlightClass' id='highlight40001' style=\"BACKGROUND-COLOR: yellow\" >Fetal/Neonatal Morbidity and Mortality</ABBR>";
result should come - highlight40001;
I load a piece of html which contains something like:
<em> < input type="text" value="Untitled" name="ViewTitle" id="ViewTitle" runat="server"> </em>
into my control. The html is user defined, do please do not ask me to add them statically on the aspx page.
On my page, I have a placeholder and I can use
LiteralControl target = new LiteralControl ();
// html string contains user-defined controls
target.text = htmlstring
to render it property. My problem is, since its a html piece, even if i know the input box's id, i cannot access it using FindControl("ViewTitle") (it will just return null) because its rendered as a text into a Literal control and all the input controls were not added to the container's control collections. I definitely can use Request.Form["ViewTitle"] to access its value, but how can I set its value?
I understand what the typical access specifiers are, and what they mean. 'public' members are accessible anywhere, 'private' members are accessible only by the same class and friends, etc.
What I'm wondering is what, if anything, this equates to in lower-level terms. Are their any post-compilation functional differences between these beyond the high-level restrictions (what can access what) imposed by the language (c++ in this case) they're used in.
Another way to put it - if this were a perfect world where programmers always made good choices (like not accessing members that may change later and using only well defined members that should stay the same between implementations), would their be any reason to use these things?
I have this construct
public class Constants{
enum SystemA implements Marker{
ConstOne(1), ConstTwo(2), ConstThree(3);
SystemA(int i)
{
number =i;
}
int number;
}
enum SystemB implements Marker{
ConstFour(4), ConstFive(5), ConstSix(6);
SystemB(int i)
{
number =i;
}
int number;
}
}
I have Marker so I can pass to method like this
method(Constants.SystemA) or method(Constants.SystemB)
What is the best way to list all the enum values ?
I also want to make sure that it is not duplicating the number in any of the enums
I have the following HTML snippet
<tr>
<td class="1">...</td>
<td class="2">...</td>
<td class="3">...</td>
<td class="4">...</td>
</tr>
etc...
I basically have N rows, and each row contains 4 TD's each with a unique class.
I would like a simple way to split out all the rows and TD's by class so I can choose what data I want to use.
I expect the easiest way to achieve this would be regex (maybe two). One to split up the TR's then another to split up the TDs (by class preferably)
Thanks
Hey, take this as a challange, my informatics professor made it in less than 10 rows, it work perfectly and its very efficient. I'd like to "surprise" him giving a better/shorted version of it. Ofcourse i wouldn't take the credits, hah, u can trust in me.
It's a simple anagras finder! If you can.. write it in c++! thanks!
By "active" I mean to have the link pointing to the current page classed as "active." This way the link's appearance can be modified using css.
Is it possible to implement an active link navigation without using a server side language? I would like to only use CSS/HTML/jQuery if possible. If there are, what are those methods? Assuming you want to create the following structure:
<ul id="nav">
<li class="active">Home</li>
<li>About</li>
<li>Contact</li>
</ul>
Can anyone please suggest some good C++ coverage tool. I am basically looking tool that really works fine when it comes to unit testing. The tool should work in the linux environment
Hi everyone!
Out of curiosity about reverse engineering, I am thinking of writing a simple program (in C++) that takes an executable as input and produces the names of all the functions that were a part of source program of that executable.
Any pointers on how should I go about it?
Step-by-step approach would be much appreciated!
Is it possible via script/tool to generate a delete statement based on the tables fk relations.
i.e. I have the table: DelMe(ID) and there are 30 tables with fk references to its ID that I need to delete first, is there some tool/script that I can run that will generate the 30 delete statements based on the FK relations for me ?
(btw I know about cascade delete on the relations, I can't use it in this existing db)
I'm using Microsoft SQL Server 2008
#include<stdio.h>
class A { public: int a;};
class B: public A {
public:
static int b;
B(){
b++;
printf("B:%d\n",b);
}
};
int main() {
A* a1 = new B[100];
A* a2 = new B();
return 0;
}
Error:
In function `main':
undefined reference to `B::b'
undefined reference to `B::b'
undefined reference to `B::b'
undefined reference to `B::b'
I was wondering if its possible to change the default "program" class that gets created for any console application to a partial class.
I want to do this because I want better organisation rather than have all methods in 1 file categorized by region. It would make more sense for me to have certain method categories sitting in separate files.
My understanding of a partial class is that it is a class definition in multiple files that during a compile merges the class files into 1 class unit.
I could be wrong, or there could be a better way for me to achieve better organisational structure. Any suggestions would help, and thanks
#include<stdio.h>
#include<math.h>
int main ()
{
FILE *fp;
fp=fopen("output","w");
float t,y=0,x=0,e=5,f=1,w=1;
for (t=0;t<10;t=t+0.01)
{
if( y==inf && y== nan)
break;
fprintf(fp,"%lf\t%lf\n",y,x);
y = y + ((e*(1 - x*x)*y) - x + f*cos(w*t))*t;
x = x + y*t;
}
return (0);
}
why is the ouput giving infinite and NAN values?
In Java, I want to download some data asynchronously in a Thread (or Runnable) object, and have the Thread put it's data into an Object I've declared within my main Thread.
How could I do this please?
Imagine you got a class like this:
class Foo {
string key;
int value;
}
How would you select the Foo with the highest value from an IEnumeralbe<Foo>?
A basic problem is to keep the number of iterations low (i.e. at 1), but that affects readability. After all, the best I could find was something along the lines of this:
IEnumerable<Foo> list;
Foo max = list.Aggregate ((l, r) => l.value > r.value ? l : r);
Can you think of a more better way?
I need to generate a string of 7 chars that is based on the id of the row. So knowing the id of the image and a secret key, i should get the generated string.
the string must contain chars from "a" to "z" and numbers from 0 to 9.
I have a dir that contains photos like this
dir/p3/i2/s21/thumb.jpg
the generated string is p3i2s21, then is used to calculate the path of the image.
I have 40+ TextViews and I want to add click events on them, but I try to do it "shortly" :
final GridLayout myGL;
myGL = (GridLayout) v0725.findViewById( R.id.tab1 );
for( int i = 0; i < myGL.getChildCount(); i++ )
if ( getResources().getResourceEntryName(((TextView) myGL.getChildAt(i)).getId()).indexOf("v")==0 ) {
((TextView) myGL.getChildAt(i)).setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
Log.v("edf", getResources().getResourceEntryName(((TextView) myGL.getChildAt(i)).getId()));
}
});
};
But Eclipse stops me on the Log.v line, because i should be final (but I can't)
any tips?
I am developing a c++ banking system.
I am able to get the float, newbal, values correctly and when I try to write to file, there is no data in the file.
else
{
file>>firstname>>lastname;
cout<<endl<<firstname<<" "<<lastname<<endl;
cout<<"-----------------------------------\n";
string line;
while (getline(file, line))
{
//stringstream the getline for line string in file
istringstream iss(line);
if (iss >> date >> amount)
{
cout<<date<<"\t\t$"<<showpoint<<fixed<<setprecision(2)<<amount<<endl;
famount+=amount;
}
}
cout<<"Your balance is $"<<famount<<endl;
cout<<"How much would you like to deposit today: $";
cin>>amountinput;
float newbal=0;
newbal=(famount+=amountinput);
cout<<"\nYour new balance is: $"<<newbal<<".\n";
file<<date<<"\t\t"<<newbal; //***This should be writing to file
but it doesn't.
file.close();
The text file looks like this:
Tony Gaddis
05/24/12 100
05/30/12 300
07/01/12 -300
//Console Output looks like this
Tony Gaddis
05/24/12 100
05/30/12 300
07/01/12 -300
Your balance is: #1
How much wuld you like to deposit: #2
Your new balance is: #1 + #2
write to file
close file.
//exits to main loop::::
How can I make it write to file and save it, and why is this happening.
I tried doing it with ostringstream as well considering how I used istringstream for the input. But it didn't work either :\
float newbal=0;
newbal=(famount+=amountinput);
ostringstream oss(newbal);
oss<<date<<"\t\t"<<newbal;
I am trying to self teach c++ so any relevant information would be kindly appreciated.