Search Results

Search found 6753 results on 271 pages for 'forward declaration'.

Page 19/271 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • Error in MySQL Workbench Forward Engineered Stored Procedures

    - by colithium
    I am using MySQL Workbench (5.1.18 OSS rev 4456) to forward engineer a SQL CREATE script. For every stored procedure, the automatic process outputs something like: DELIMITER // USE DB_Name// DB_Name// DROP procedure IF EXISTS `DB_Name`.`SP_Name` // USE DB_Name// DB_Name// CREATE PROCEDURE `DB_Name`.`SP_Name` (id INT) BEGIN SELECT * FROM Table_Name WHERE Id = id; END// The two lines that are simply the database name followed by the delimiter are errors and are reported as such when running the script. As long as they are ignored, it looks like everything gets created just fine. But why would it add those lines? I am creating the database in the WAMP environment which uses MySQL 5.1.36

    Read the article

  • Java generics: Illegal forward reference

    - by Arian
    Given a generic interface interface Foo<A, B> { } I want to write an implementation that requires A to be a subclass of B. So I want to do class Bar<A, B super A> implements Foo<A, B> { } // --> Syntax error or class Bar<A extends B, B> implements Foo<A, B> { } // --> illegal forward reference But the only solution that seems to work is this: class Bar<B, A extends B> implements Foo<A, B> { } which is kind of ugly, because it reverses the order of the generic parameters. Are there any solutions or workarounds to this problem?

    Read the article

  • Forward web request for directory index ('/') to an index.htm page in JBoss 4.0.5

    - by The Pretender
    I am using JBoss 4.0.5.GA to run a set of java applications. One of them is a web frontend, using Spring 1.4. URL mappings are configured in a way that 'fake' pages from request URLs are mapped to controllers. That means that when someone requests /index.htm, there's no actual 'index.htm' on disk, and that request maps to a specific conroller which then renders a jsp view. So the problem is as follows: I need to tell JBoss to somehow forward all requests for directory indices to corresponding 'index.htm' URLs like so: / ? /index.htm; /news/ ? /news/index.htm; /foo/bar/baz/ ? /foo/bar/baz/index.htm and so on. I can't use Tomcat's welcome-file-list feature because it looks for those files on disk, while all 'index.htm's are fake and don't actually exist on disk.

    Read the article

  • Forward declaring an enum in c++

    - by szevvy
    Hi guys, I'm trying to do something like the following: enum E; void Foo(E e); enum E {A, B, C}; which the compiler rejects. I've had a quick look on Google and the consensus seems to be "you can't do it", but I can't understand why. Can anyone explain? Many thanks. Clarification 2: I'm doing this as I have private methods in a class that take said enum, and I do not want the enum's values exposed - so, for example, I do not want anyone to know that E is defined as enum E { FUNCTIONALITY_NORMAL, FUNCTIONALITY_RESTRICTED, FUNCTIONALITY_FOR_PROJECT_X } as project X is not something I want my users to know about. So, I wanted to forward declare the enum so I could put the private methods in the header file, declare the enum internally in the cpp, and distribute the built library file and header to people. As for the compiler - it's GCC.

    Read the article

  • Recieve and forward all packets to another port

    - by question
    Debian 5, iptables Server N1 Some video-streaming server without external IP. Server N2 Debian server with ip 1.1.1.1. Server N1 is configured to send videostream to 1.1.1.1:1111. How to forward all recieved packages from 1.1.1.1:1111 to another port on the same server, for example to 1.1.1.1:2222? Something like that? echo 1 > /proc/sys/net/ipv4/ip_forward iptables -t nat -A PREROUTING -i eth1 -p tcp --dport 1111 -j REDIRECT --to-port 2222

    Read the article

  • Apache mod_rewrite - forward domain root to subdirectory

    - by DuFace
    I have what I originally assumed to be a simple problem. I am using shared hosting for my website (so I don't have access to the Apache configuration) and have only been given a single folder to store all my content in. This is all well and good but it means that all my subdomains must have their virtual document root's inside public_html, meaning they effectively become a folder on my main domain. What I'd like to do is organise my public_html something like this: public_html/ www/ index.php ... sub1/ index.php ... some_library/ ... This way, all my web content is still in public_html but only a small fraction of it will be served to the client. I can easily achieve this for all the subdomains, but it's the primary domain that I'm having issues with. I created a .htaccess file in public_html with the following: Options +SymLinksIfOwnerMatch # I'm not allowed to use FollowSymLinks RewriteEngine on RewriteBase / RewriteCond %{REQUEST_URI} !^/www [NC] RewriteRule ^(.*)$ /www/$1 [L] This works fairly well, but for some strange reason www.example.com/stuff is translated into a request for www.example.com/www/stuff and hence a 404 error is given. It was my understanding that unless an 'R' flag was specified, mod_rewrite was purely internal so I can't understand why the request is generated as that implies (to me at least) redirection. I assumed this would be a trivial problem to solve as all I actually want to do is forward all requests for the root of www.example.com to a subdirectory, but I've spent hours searching for answers and none are quite correct. I find it difficult to believe I'm the only person to have this issue. I apologise if this question has been answered on here before, I did search and trawl but couldn't find an appropriate answer. Please could someone shed some light on this?

    Read the article

  • IIS 6.0 Rewrite rules for Wordpress (Forward slash not working and other things)

    - by DigitalBlade
    Hi, I am using Wordpress 3.0.4 on IIS 6.0 and Windows Server 2003, hosted by a company. I was having lots of issues using permalinks. I have fixed most, but now I have an issue with a forward-slash not being added to the address. This would be fine on most websites, but not on IIS for some reason. Specifically, if I go to "mysite.com/wp-admin" I can log-in and get to the dashboard, but as soon as I click anything there i am redirected to a broken link. For example: "mysite.com/post-new.php". If I add the slash at the end it's fine. So I tried to have a rewrite rule to automatically add the slash to such address: RewriteRule /wp-admin /wp-admin/ [L] But it still doesn't work. For your reference, here's the complete file: [ISAPI_Rewrite] RewriteBase / RewriteCond ${REQUEST_FILENAME} !-f RewriteCond ${REQUEST_FILENAME} !-d # For special WordPress folders (e.g. theme, admin, etc.) RewriteRule /wp-admin /wp-admin/ [L] RewriteRule /wp-(.*) /wp-$1 [L] RewriteRule /(.*\.(?:jpg|jpeg|gif|css|txt|xml|html|png|js)) /$1 [I,L] # Rules to ensure that normal content gets through RewriteRule /images/(.*) /images/$1 [L] RewriteRule /favicon.ico /favicon.ico [L] RewriteRule /robots.txt /robots.txt [L] RewriteRule /phpmyadmin/(.*) /phpmyadmin/$1 [L] RewriteRule /phpmyadmin /phpmyadmin/ [L] # For all WordPress pages RewriteRule ^/$ /index.php [L] RewriteRule /(.*) /index.php/$1 [L] Any ideas? Thanks in advance

    Read the article

  • accessing google maps via UIWebView - illegal?

    - by Karin
    New to iPhone development. Working on first app. I'm accessing google maps via UIWebView to forward geocode an address using "http://maps.google.com/maps?q=my address". It works, although it has this quirk of requiring you to hit "Back" button and then the "Detail" button (provided by the navigation bar) to get back to the screen from whence you started. If anyone knows why it does this, I'd love to hear. My real question, however, is this a legal use of google maps? Since I intend this app for commercial use, am I violating Google's rules + regs? If it is illegal, what's my alternative? Thanks.

    Read the article

  • How do I create and append an image with Javascript/jQuery?

    - by Chris Armstrong
    I'm using the following code to create an image element, load it, then append it to the article on load. $('<img />') .attr('src', 'image.png') //actually imageData[0].url .load(function(){ $('article').append( $(this) ); alert('image added'); }); The alert is firing off ok, but the image doesn't appear, and when I inspect the element it has been added without the closing slash <img src='image.png' > Why is the browser removing the forward slash and how do I stop it?

    Read the article

  • Mass 301 redirects mvc

    - by Massive Boisson
    Hi (this is a common problem with few twists). We are on IIS 6, without ISAPI_Rewrite with .net 4 and mvc 2 app. We would like to 301 forward bunch of old urls to matching new urls. (We are deploying a new site and google index will still point to old urls, and we need to map those urls to new urls) a) Is there a way to do this through IIS (but without ISAPI_Rewrite) and how? b) Is there a way to do this through the application code and how? All answers really appreciated, Thanks a lot --MB

    Read the article

  • Two classes and inline functions

    - by klew
    I have two classes and both of them uses some of the other class, on example: // class1.h class Class1; #include "class2.h" class Class1 { public: static Class2 *C2; ... }; // class2.h class Class2; #include "class1.h" class Class2 { public: static Class1 *C1; ... }; And when I define it like in example above, it works (I also have some #ifndef to avoid infinite header recurency). But I also want to add some inline functions to my classes. And I read here that I should put definition of inline function in header file, because it won't work if I'll put them in cpp file and want to call them from other cpp file (when I do it I get undefined reference during linking). But the problem here is with something like this: // class1.h ... inline void Class1::Foo() { C2->Bar(); } I get error: invalid use of incomplete type ‘struct Class2’. So how can I do it?

    Read the article

  • C - Complicated pointer declarations - help understanding

    - by Emmel
    In my burgeoning new self-education in the C language, I've come across a set of declarations that I do not understand how to read. I'd love for someone to break these down. I'll explain at the bottom where I got these examples from. 1. char (*(*x())[])() "x: function returning pointer to array[] of pointer to function returning char" - huh? 2. char (*(*x[3])())[5] "x: array[3] of pointer to function returning pointer to array[5] of char" - come again? 3. char **argv This I understand. "Pointer to pointer to char." But what I don't understand is -- what's the use case for a pointer to a pointer? Follow-up question: does anyone every use declarations this complex or is this just academic fun on the part of the authors of the examples I got this from? These examples are from section 5.12 of the K&R book. This is the first time I'm genuinely stumped by an explanation, in an otherwise well-written classic. Thanks.

    Read the article

  • Global qualification in a class declarations class-head

    - by gf
    We found something similar to the following (don't ask ...): namespace N { struct A { struct B; }; } struct A { struct B; }; using namespace N; struct ::A::B {}; // <- point of interest Interestingly, this compiles fine with VS2005, icc 11.1 and Comeau (online), but fails with GCC: global qualification of class name is invalid before '{' token From C++03, Annex A, it seems to me like GCC is right: the class-head can consist of nested-name-specifier and identifier nested-name-specifier can't begin with a global qualification (::) obviously, neither can identifier ... or am i overlooking something?

    Read the article

  • Java declarations (ordering)

    - by incrediman
    In Java, what's generally the most accepted way to organize a class in terms of the order in which declared data members and methods should be listed in the class file, keeping in mind the following and anything else you can think of for each one: its visibility whether it's a constructor, method, or member if it's a method, does it overload, or override other method(s)?

    Read the article

  • initialising a 2-dim Array in Scala

    - by Stefan W.
    (Scala 2.7.7:) I don't get used to 2d-Arrays. Arrays are mutable, but how do I specify a 2d-Array which is - let's say of size 3x4. The dimension (2D) is fixed, but the size per dimension shall be initializable. I tried this: class Field (val rows: Int, val cols: Int, sc: java.util.Scanner) { var field = new Array [Char](rows)(cols) for (r <- (1 to rows)) { val line = sc.nextLine () val spl = line.split (" ") field (r) = spl.map (_.charAt (0)) } def put (val rows: Int, val cols: Int, c: Char) = todo () } I get this error: :11: error: value update is not a member of Char field (r) = spl.map (_.charAt (0)) If it would be Java, it would be much more code, but I would know how to do it, so I show what I mean: public class Field { private char[][] field; public Field (int rows, int cols, java.util.Scanner sc) { field = new char [rows][cols]; for (int r = 0; r < rows; ++r) { String line = sc.nextLine (); String[] spl = line.split (" "); for (int c = 0; c < cols; ++c) field [r][c] = spl[c].charAt (0); } } public static void main (String args[]) { new Field (3, 4, new java.util.Scanner ("fraese.fld")); } } and fraese.fld would look, for example, like that: M M M M . M I get some steps wide with val field = new Array Array [Char] but how would I then implement 'put'? Or is there a better way to implement the 2D-Array. Yes, I could use a one-dim-Array, and work with put (y, x, c) = field (y * width + x) = c but I would prefer a notation which looks more 2d-ish.

    Read the article

  • How do I find out if the variable is declared in Python?

    - by golergka
    I want to use a module as a singleton referenced in other modules. It looks something like this (that's not actually a code I'm working on, but I simplified it to throw away all unrelated stuff): main.py import singleton import printer def main(): singleton.Init(1,2) printer.Print() if __name__ == '__main__': pass singleton.py variable1 = '' variable2 = '' def Init(var1, var2) variable1 = var1 variable2 = var2 printer.py import singleton def Print() print singleton.variable1 print singleton.variable2 I expect to get output 1/2, but instead get empty space. I understand that after I imported singleton to the print.py module the variables got initialized again. So I think that I must check if they were intialized before in singleton.py: if not (variable1): variable1 = '' if not (variable2) variable2 = '' But I don't know how to do that. Or there is a better way to use singleton modules in python that I'm not aware of :)

    Read the article

  • mixed declarations and codes

    - by gcc
    When I compile function with "gcc -o dene -Wall -ansi -pedantic-errors dene.c",gcc emits no error.(can you look a line which starts with char ....,in if loop,) static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); int len=0;int d=0; int i=0; cmainp[0]=malloc(sizeof(char)*300); len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') if(i==0 || s[i-1]==',') /*look*/ {char *p=malloc(sizeof(char)*3); /*look*/ ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } But,when compile above function being reformatted with gcc,gcc emits that error "dene.c:10: error: ISO C90 forbids mixed declarations and code" static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); /*look*/ cmainp[0]=malloc(sizeof(char)*300); /*look*/ int len=0;int d=0; int i=0; len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') if(i==0 || s[i-1]==',') {char *p=malloc(sizeof(char)*3); ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } And last one,gcc emits following errors dene.c:16: error: expected expression before ‘char’ dene.c:20: error: ‘p1’ undeclared (first use in this function) dene.c:20: error: (Each undeclared identifier is reported only once dene.c:20: error: for each function it appears in.) static void remove_negation(char *s,char *s1) { char **cmainp=malloc(sizeof(char*)*1); /*look*/ cmainp[0]=malloc(sizeof(char)*300); /*look*/ int len=0;int d=0; int i=0; len=strlen(s); for(i=0;i<len;++i) { if(s[i]=='-') /*look*/ char *p=malloc(sizeof(char)*3); /*look*/ if(i==0 || s[i-1]==',') { ++i; p[0]=s[i]; p[1]='\0'; strcat(s1,","); strcat(s1,p); free(p); continue; } cmainp[0][d]=s[i]; ++d; } cmainp[0][d+1]='\0'; strcpy(cmainp[0],s); free(cmainp[0]); } question is why there are differences between them.

    Read the article

  • Is there a standard literal constant that I can use instead of "utf-8" in C# (.Net 3.5)?

    - by Hamish Grubijan
    Hi, I would like to find a better way to do this: XmlNode nodeXML = xmlDoc.AppendChild( xmlDoc.CreateXmlDeclaration( "1.0", "utf-8", String.Empty) ); I do not want to think about "utf-8" vs "UTF-8" vs "UTF8" vs "utf8" as I type code. I would like to make my code less prone to typos. I am sure that some standard library has declatred "utf-8" as a const / readonly string. How can I find it? Also, what about "1.0"? I am assuming that major XML versions have been enumerated somewhere as well. Thanks!

    Read the article

  • How can I declare a pointer structure?

    - by Y_Y
    This probably is one of the easiest questions ever in C programming language... I have the following code: typedef struct node { int data; struct node * after; struct node * before; }node; struct node head = {10,&head,&head}; Is there a way I can make head to be *head [make it a pointer] and still have the availability to use '{ }' [{10,&head,&head}] to declare an instance of head?

    Read the article

  • How to use two parameters pointing to the same structure in one function ?

    - by ZaZu
    Hey guys, I have my code below that consits of a structure, a main, and a function. The function is supposed to display two parameters that have certain values, both of which point to the same structure. The problem I dont know how to add the SECOND parameter onto the following code : #include<stdio.h> #define first 500 #define sec 500 struct trial{ int f; int r; float what[first][sec]; }; int trialtest(trial *test); main(){ trial test; trialtest(&test); } int trialtest(trial *test){ int z,x,i; for(i=0;i<5;i++){ printf("%f,(*test).what[z][x]); } return 0; } I need to add a new parameter test_2 there (IN THE SAME FUNCTION) using this code : for(i=0;i<5;i++){ printf("%f,(*test_2).what[z][x]); How does int trialtest(trial *test) changes ? and how does it change in main ? I know that I should declare test_2 as well, like this : trial test,test_2; But what about passing the address in the function ? I do not need to edit it right ? trialtest(&test); --- This will remain the same ? So please, tell me how would I use test_2 as a parameter pointing to the same structure as test, both in the same function.. Thank you !! Please tell me if you need more clarification

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >