Hi, please, what contains the fstream variable? A can find many tutorials on fstream, but no ona actually says what is the fstream file; declaration in the beginning. Thanks.
I'm trying to use a function in assembly in a C project, the function is supposed to call a libc function let's say printf() but I keep getting a segmentation fault.
In the .c file I have the declaration of the function let's say
int do_shit_in_asm()
In the .asm file I have
.extern printf
.section .data
printtext:
.ascii "test"
.section .text
.global do_shit_in_asm
.type do_shit_in_asm, @function
do_shit_in_asm:
pushl %ebp
movl %esp, %ebp
push printtext
call printf
movl %ebp, %esp
pop %ebp
ret
Any pointers would be appreciated.
as func.asm -o func.o
gcc prog.c func.o -o prog
Coming from Eclipse/Java, I noticed that in VisualStudio/C# it is not mandatory to care about Exceptions. While Eclipse forces the user to implement a try-catch-block or to add a throws declaration, this is not the case in Visual Studio.
What is the reason Visual Studio doesn't inform about unhandled exceptions?
Can I configure Visual Studio to force me to implement try-catch-blocks, or at least add a compiler-warning?
I would like to have declaration like this:
void Date::get_days_name(const Date& = this)
which I would understand that if no argument is provided use this object as an argument. For some reason in VS I'm getting err msg:
'Error 1 error C2355: 'this' : can only be referenced inside non-static member '
Any idea what I'm doing wrong?
I am accessing the facebook api and using the json.net library (newtonsoft.json.net)
I declare a Jobject to parse the content and look for the specific elements and get their values. Everything works fine for the first few but then I get this unexplained nullexception error " (Object reference not set to an instance of an object)
Now I took a look at the declaration but cannot see how to change it. Any help appreciated:
Dim jobj as JObject = JObject.Parse(responseData)
Dim message as string = string.empty
message = jobj("message").tostring
The error occurs at the last line above.
Even if I have different modules in my jee application including myproject-web and myproject-ejb; is it possible to call (or inject) my ejb session bean which is in the ejb module from a managed bean which is in the web module?
When I asked before, I see the following declaration:
@EJB private BeanInterface yourbean
However, I wanna learn that whether it is possible or not, to call each other between different contexts (one of it in ejb context, the other one -managed bean- is in web context)?
Any help would be appreciated
Best wishes
Bariscan
I am trying to write a program containing two source files: main program written in C and assembly(x86 32 and 64) module callable from C. The C declaration for the assembly routine looks like this:
void mirrorbmp1(void *img, int width, int height)
The task involves Mirror/flipping a 1 bpp .BMP image horizontally while Handling any image width properly, not only multiples of 8.
I am new to assembly programming and have very little idea about how i should do the ask.
Any help would be appreciated.
I'm in the process of writing a small lisp interpreter in haskell. In the process i defined this datatype, to get a less typed number;
data Number = _Int Integer
| _Rational Rational
| _Float Double
deriving(Eq,Show)
Compiling this fails with the following error:
ERROR "types.hs":16 - Syntax error in data type declaration (unexpected `|')
Line 16 is the line w. the first '|' in the code above.
Apple, for memory management issues, recommend defining outlets on properties, not in the attribute declaration. But, as far as I know, declaring properties exposes the class to external classes, so this could be dangerous.
On UIViewController we have the main view definition and the logic, so MVC is slightly cheated in this cases.
What is the beteer approach, Apples's recommendation for memory-management or armored classes?
I have a LaTeX document. I want to change the font size of all the text, to make it smaller.
Normally I would just change the documentclass part. However I am generating LaTeX files from another programme, and it is setting the documentclass, I can't change that. However I can put things in the preamble.
Is there anyway to change the font size in the preamble, without touching the documentclass declaration.
Happy Monday o/
I'm looking to do the following within a stored proc
select @parameter="fooproc"
drop procedure @parameter
instead of
drop procedure fooproc
But it's choking with a syntax error. Is there some way I can bend this to my will? I would've expected to be able to do this.
I've tried a few permutations of type declaration of @parameter to no avail.
Thoughts?
can any one please let me know the global declaration of php variables..i have seen one among the site like..
for integer start with i, eg: $iItemId
for array start with a, eg: $aItemIds
for string start with s, eg: $sItemName
Hi,
I have a problem with my string that returns (null)
Here's the MainViewController:
NSString *leftWebViewUrl;
MainViewController *mainViewController;
@property (nonatomic, retain) NSString *leftWebViewUrl;
@property (nonatomic, retain) MainViewController *mainViewController;
leftWebViewUrl = [NSString stringWithString:leftWebView.request.URL.absoluteString];
leftSharingViewController.leftWebViewUrl = leftWebViewUrl;
Here's the leftSharingViewController (just the NSString declaration)
NSString *leftWebViewUrl;
@property (nonatomic, retain) NSString *leftWebViewUrl;
From some reason I get (null)
Thanks
I have the following declaration in my build.xml file, in my src folder I have my test package which I don't want to include into my process. How can I force scrdir to read everything from ${src.dir} except test package?
<target name="compile">
<javac srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>
char *sample = "String Value";
&sample is a pointer to the pointer of "String Value"
is the above statement right?
If the above statement right, what is the equivalent of &sample if my declaration is
char sample[] = "String Value"
Hi
About the declaration of ISession.
Should we close the Session everytime we use it, or should we keep it open?
I'm asking this because in manual of NHibernate (nhforge.org) they recommend us to declare it once in Application_Start for example, but i don't know if we should close it everytime we use.
Thanks
Say I have a constant:
#define PI 3.14
Say I have a static library with multiple header and source files. If I declare this in the header file, will its scope apply to all of the source files? Or do the source files need to include the header with the declaration of PI?
Consider the following code:
class Base
{
void f() { }
};
class Derived: public Base
{
public:
};
What can you change in the derived class, such that you can perform the following:
Derived d;
d.f();
If the member is declared as public in the base class, adding a using declaration for Base::f in the derived class public section would've fix the problem. But if it is declared as private in the base class, this doesn't seem to work.
I have a button control. Once the user clicks on it, the click event should fire and then the button should get disabled. How can I do this? I have the option to use JQuery or JavasSript or both.
Here is my button declaration:
<asp:Button
ID="Button1"
runat="server"
Text="Click Me"
onclick="Button1_Click"
/>
On the button click code behind, I have added a Response.Write(). That should get executed and then the button should be disabled
Hello Everyone,
What is the difference between "+" and "-" before the function name interface declaration in an iPhone program. Example:
- (void)continueSpeaking;
+ (NSArray *)availableVoices;
What's the difference?
If you put the aif code presented in onlisp in a package and try to use it in another you run in the problem that packagename:it is not external.
(in-package :packagename)
(defmacro aif (test-form then-form &optional else-form)
‘(let ((it ,test-form))
(if it ,then-form ,else-form)))
wanted call syntax
(in-package :otherpackage)
(aif (do-stuff)
(FORMAT t "~a~%" it)
(FORMAT t "just got nil~%"))
How can I fix this behavior in code, without making the variable it external in the package declaration and beeing able to access it just by it instead of packagename:it?
I am learning c++. Just curious, can only Static and constant varibles be assigned a value from within the class declaration ?? is this mainly why when you assign values to normal members, they have a special way doing it
void myClass::Init():member1(0), member2(1)
{
}
I've seen lots of codes have declaration like Class clazz , where does this originate from ? Is this some kind of convention ? I think 'clazz' is not even a English word , has no meaning at all .
I have the following struct declaration and typedef in my code:
struct blockHeaderStruct {
bool allocated;
unsigned int length;
};
typedef struct blockHeaderStruct blockHeader;
When I do sizeof(blockheader), I get the value of 4 bytes back, but when I do sizeof(blockHeaderStruct), I get 8 bytes.
Why is this happening? Why am I not getting 5 back instead?