Code:
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
int main() {
typeof(5);
return 0;
}
Version of gcc is 4.3.3, command line is "gcc.exe -std=c99 1.c -o 1.exe".
What is the cause of this problem?
Hello
I installed Eclipse and Android ADT. When I create android project and try to run, I get following on main.out.xml file:
This document is empty.
Right click here to insert content
However, main.xml file has xml data for layout.
Please help what I need to do after right clicking. Thanks
Hi!
I'm currently facing the problem, that I import an Excel file to a DataGrid.
This works pretty fine, but after importing the table, I need to know how many rows are invalid.
I have applied several validation rules for the different datatypes, and I have an icon in the row header, that shows up if the row is invalid.
But since I have more that 10.000 rows in the grid, I don't want scroll all the way through it to find the errors.
Any ideas, how to determine the count of invalid rows (and then maybe bind that to a textbox)?
Thx
Hi,
I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example:
#!/bin/bash
cd some_dir
./configure --some-flags
make
make install
So in this case if the script can't change to the indicated directory then it would certainly not want to do a ./configure afterward it fails.
Now I'm well aware that I could have an if check for each command (which I think is a hopeless solution), but is there a global setting to make the script exit if one of the commands fails?
hi all .
I have a problem with my code in C# . if i click in compiler button , I get the following errors
'System.Collections.Generic.LinkedList' does not contain a definition for 'removeFirst' and no extension method 'removeFirst' accepting a first argument of type 'System.Collections.Generic.LinkedList' could be found (are you missing a using directive or an assembly reference?).
and
'System.Collections.Generic.LinkedList' does not contain a definition for 'addLast' and no extension method 'addLast' accepting a first argument of type 'System.Collections.Generic.LinkedList' could be found (are you missing a using directive or an assembly reference?)
This is part of a simple program
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Hanoi
{
public class Sol
{
public LinkedList<int?> t1 = new LinkedList<int?>();
public LinkedList<int?> t2 =new LinkedList<int?>();
public LinkedList<int?> t3 =new LinkedList<int?>();
public int depth;
public LinkedList<Sol> neighbors;
public Sol(LinkedList<int?> t1, LinkedList<int?> t2, LinkedList<int?> t3)
{
this.t1 = t1;
this.t2 = t2;
this.t3 = t3;
neighbors = new LinkedList<Sol>();
}
public virtual void getneighbors()
{
Sol temp = this.copy();
Sol neighbor1 = this.copy();
Sol neighbor2 = this.copy();
Sol neighbor3 = this.copy();
Sol neighbor4 = this.copy();
Sol neighbor5 = this.copy();
Sol neighbor6 = this.copy();
if (temp.t1.Count != 0)
{
if (neighbor1.t2.Count != 0)
{
if (neighbor1.t1.First.Value < neighbor1.t2.First.Value)
{
neighbor1.t2.AddFirst(neighbor1.t1.RemoveFirst());
neighbors.AddLast(neighbor1);
}
}
else
{
neighbor1.t2.AddFirst(neighbor1.t1.RemoveFirst());
neighbors.AddLast(neighbor1);
}
if (neighbor2.t3.Count != 0)
{
if (neighbor2.t1.First.Value < neighbor2.t3.First.Value)
{
neighbor2.t3.AddFirst(neighbor2.t1.RemoveFirst());
neighbors.AddLast(neighbor2);
}
}
else
I hope that you find someone to help me
Hello,
I want to know why the flash movie in the header located here:
http://www.dolphintemplate.com/demo/dolphin7/index.php?skin=dt_firestarter_red
only loads in Firefox but NOT in IE and Chrome..
The flash movie resides in a iframe, this is the code of the iframe:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>header</title>
</head>
<body bgcolor="#000000" topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<object data="header.swf" type="application/x-shockwave-flash" id="myflash" width="988" height="240">
<param name="movie" value="header.swf" />
<param name="bgcolor" value="#000000" />
<param name="height" value="988" />
<param name="width" value="240" />
<param name="quality" value="high" />
<param name="menu" value="false" />
<param name="allowscriptaccess" value="samedomain" />
<p>Adobe <a href="http://get.adobe.com/flashplayer/">Flash Player</a> is required to view this content.</p>
</object>
</body>
</html>
Thanks.
i need to do this.
document.styleSheets[i].rules[1].style.cssText = "cursor: url(images/grabbing.cur), default !important;";
and if i m checking
alert(document.styleSheets[i].rules[1].style.cssText);
its giving "cursor: !important"
why its not setting the whole string in this css.
its a problem in ie only . in firefox its not a problem
Well, when I'm trying to use 'inclusion' in Django, I met some confused problems that I can't solve it by myself.
There is the structures for my project.
MyProject---
App1---
__init__.py
models.py
test.py
urls.py
views.py
App2---
...
template---
App1---
some htmls
App2---
...
templatetags---
__init__.py
inclusion_test.py
manage.py
urls.py
__init__.py
settings.py
I have registered templatetags folder in the settings.py (Both in Installed APPS & TEMPLATE_DIRS).
But when I want to use {% load inclusion_test %} in my html, it raise an exception like this:
'inclusion_cld_tags' is not a valid tag library: Could not load template library from django.templatetags.inclusion_cld_tags, No module named inclusion_cld_tags
I think there is nothing wrong with my import work, how can I do with that?
Thanks for help!
My django version: 1.0+
My Python version: 2.6.4
I'm experiencing the problem outlined in this kb article. http://support.microsoft.com/kb/927917 . Sorry I can't hyperlink cos i don't have enough points!
"This problem occurs because a child container HTML element contains script that tries to modify the parent container element of the child container. The script tries to modify the parent container element by using either the innerHTML method or the appendChild method."
The problem I'm having diagnosing the source of my problem is 2 fold: 1) This is only happening on some client machines (All are running IE8) and not others. How/Why only some? 2) I don't have any scripts which modify the innerHTML or call appendChild on any dom elements.
I do have server side code which modify properties on asp .net server controls. (Essentially all thats happening is a panel control with some more controls is being made visbile or invisible on a button click), would these in turn then set the innerHTML property of the client rendered control(?)
I have this regular expression:
([http://some.url.com/index.php?showtopic=\"]*)([0-9]+(?:\.[0-9]*)?)
its for extracting links to topics from forum
Now when i use it in my script
$url = "([http://some.url.com/index.php?showtopic=\"]*)([0-9]+(?:\.[0-9]*)?)";
preg_match_all spits: "Unknown modifier '('"
Can anyone help me with this obviously stupid problem
There are several guidelines for error reporting, that are usually based on giving to the user useful information when he or she does something wrong, but to give this kind of information you need to be handling the error and know that it can happen. There are also tons of articles about designing 404 error pages. But, what can you do when it's a new, unhandled error provoked by a failure in the shoftware?
Are there some guidelines about how to nicely report totally unexpected errors in a web site, as an unexpected error 500?
What header message should be shown in that case? something like "Sorry, an unexpected error has ocurred" would be enough?
What information should be given?
Should it have mechanisms to help to report the failure to developers? Which ones?
When my page loads it calls the function like below:
<body onLoad='changeTDNodes()'>
And the code it calls is below:
enter code here
<script src='jquery-1.4.2.min.js' type='text/javascript'></script>
<script>
function changeTDNodes() {
var threshValue = 10;
$(".threshold").each(function(elem) {
if($("b",elem).innerText > threshValue) {
elem.addClass("overThreshold");
}
});
});
}
I have the class setup correctly in CSS
.overThreshold {
td{font-size:72px;}
th{font-size:72px;}
}
But no classes are being changed, whats going on?
Thanks for all your help!
Starting with sth's answer to this question:
http://stackoverflow.com/questions/3023760/c-template-specialization
I was wondering how to resolve multiple definition errors if the following code
is put in a header file included multiple times by different .cc files and linked together:
template <typename T>
class C {
static const int K;
static ostream& print(ostream& os, const T& t) { return os << t;}
};
// general case
template <typename T>
const int C<T>::K = 1;
// specialization
template <>
const int C<int>::K = 2;
I had a project that required posting a 2.5 million character QueryString to a web page. The server itself only parsed URI's that were 5,400 characters or less. After trying several different sets of code for WebRequest/WebResponse, WebClient, and Sockets, I finally found the following code that solved my problem:
HttpWebRequest webReq;
HttpWebResponse webResp = null;
string Response = "";
Stream reqStream = null;
webReq = (HttpWebRequest)WebRequest.Create(strURL);
Byte[] bytes = Encoding.UTF8.GetBytes("xml_doc=" + HttpUtility.UrlEncode(strQueryString));
webReq.ContentType = "application/x-www-form-urlencoded";
webReq.Method = "POST";
webReq.ContentLength = bytes.Length;
reqStream = webReq.GetRequestStream();
reqStream.Write(bytes, 0, bytes.Length);
reqStream.Close();
webResp = (HttpWebResponse)webReq.GetResponse();
if (webResp.StatusCode == HttpStatusCode.OK)
{
StreamReader loResponseStream = new StreamReader(webResp.GetResponseStream(), Encoding.UTF8);
Response = loResponseStream.ReadToEnd();
}
webResp.Close();
reqStream = null;
webResp = null;
webReq = null;
So, everyone is really used to the errors that PHP gives you. They look kind of like this:
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 2 bytes) in /path/to/file(437) on line 21
My question is, do you put in the time to make your error pages more useful?
I find that I am able to debug a lot faster using my own error page:
I find this to be a lot better than the PHP errors because it gives me a stack trace, the usual error message, along with the actual location of the error, and more.
Also, are there any downsides from creating your own development error pages. Obviously you wouldn't want to have a user see this page, but what about during development?
I would like to specialize a template method for a class C that is itself
templated by an int parameter.
How do I do this?
template <int D=1>
class C {
static std::string foo () { stringstream ss; ss << D << endl; return ss.str();}
};
template <class X>
void test() { cout << "This is a test" << endl;}
template <>
template <int D>
void test<C<D> > () {cout << C<D>::foo() << endl;}
The specialization for test() fails with "Too many template parameter lists in declaration of void test()".
Hi,
I'm using gdb to connect to a 2.6.31.13 linux kernel patched with KGDB over Ethernet, and when I try to detach the debugger I get this:
(gdb) quit
A debugging session is active.
Inferior 1 [Remote target] will be killed.
Quit anyway? (y or n) y
Bogus trace status reply from target: E22
after that the session is still open, I can keep going on and on with ctrl+d, and the debugger doesn't exit.
I've searched for that message in google and there are just 5 results (and none of them are useful :-/ ).
Any idea of what could it be and how to fix it?
template <typename T>
struct A
{
template <int I>
void f();
};
template <typename T>
void F(A<T> &a)
{
a.f<0>(); // expected primary-expression before ‘)’ token
}
int main()
{
A<int> a;
a.f<0>(); // This one is ok.
}
What it's all about?
Right now I have this-
[code]
- (void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event
{
if (event.type == UIEventSubtypeMotionShake) {
int text = rand() % 12;
switch (text) {
case 0:
textview.text = @"blah." ;
break;[/code]
For some reason, the text has to be selected for it to work. If you just shake it, nothing will happen.