Search Results

Search found 12457 results on 499 pages for 'variable assignment'.

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

  • Bash Color Variable Output

    - by drewrockshard
    I've got a variable, let's say $x and it holds the value of website.com. I want to be able to call the variable and apply shell color to it like so: echo -e '\033[1;32m$x:\033[0m'; The problem is not the color, however, it's how the script it interpretting the output. So the output I'm getting is: $x: I need the output to obviously be the string in the variable, and not the variable name. Is there any way around this issue?

    Read the article

  • please suggest good variable names that represent theirself ( php)

    - by I Like PHP
    Hi all, it may be wrong place to ask this question, but i hope u all programmer must have the interesting naming convention of variables. i have seen many places that some variable names are very good n effective like common variable names $link $db $connect $query $stmt $sql $qry $output $result $list so please suggest me some good names for variable , bcoz all time i have to write $x, $y etc.. if i want to save something instantly on page...that are even not relevant, so please suggest me good variable names

    Read the article

  • ReSharper - Possible Null Assignment when using Microsoft.Contracts

    - by HVS
    Is there any way to indicate to ReSharper that a null reference won't occur because of Design-by-Contract Requires checking? For example, the following code will raise the warning (Possible 'null' assignment to entity marked with 'NotNull' attribute) in ReSharper on lines 7 and 8: private Dictionary<string, string> _Lookup = new Dictionary<string, string>(); public void Foo(string s) { Contract.Requires(!String.IsNullOrEmpty(s)); if (_Lookup.ContainsKey(s)) _Lookup.Remove(s); } What is really odd is that if you remove the Contract.Requires(...) line, the ReSharper message goes away. Update I found the solution through ExternalAnnotations which was also mentioned by Mike below. Here's an example of how to do it for a function in Microsoft.Contracts: Create a directory called Microsoft.Contracts under the ExternalAnnotations ReSharper directory. Next, Create a file called Microsoft.Contracts.xml and populate like so: <assembly name="Microsoft.Contracts"> <member name="M:System.Diagnostics.Contracts.Contract.Requires(System.Boolean)"> <attribute ctor="M:JetBrains.Annotations.AssertionMethodAttribute.#ctor"/> <parameter name="condition"> <attribute ctor="M:JetBrains.Annotations.AssertionConditionAttribute.#ctor(JetBrains.Annotations.AssertionConditionType)"> <argument>0</argument> </attribute> </parameter> </member> </assembly> Restart Visual Studio, and the message goes away!

    Read the article

  • trying to make a simple grid-class, non-lvalue in assignment

    - by Tyrfing
    I'm implementing a simple C++ grid class. One Function it should support is accessed through round brackets, so that I can access the elements by writing mygrid(0,0). I overloaded the () operator and i am getting the error message: "non-lvalue in assignment". what I want to be able to do: //main cGrid<cA*> grid(5, 5); grid(0,0) = new cA(); excerpt of my implementation of the grid class: template class cGrid { private: T* data; int mWidth; int mHeight; public: cGrid(int width, int height) : mWidth(width), mHeight(height) { data = new T[width*height]; } ~cGrid() { delete data; } T operator ()(int x, int y) { if (x >= 0 && x <= mWidth) { if (y >= 0 && y <= mHeight) { return data[x + y * mWidth]; } } } const T &operator ()(int x, int y) const { if (x >= 0 && x <= mWidth) { if (y >= 0 && y <= mHeight) { return data[x + y * mWidth]; } } } The rest of the code deals with the implementation of an iterator and should not be releveant.

    Read the article

  • jsprf.c:644: error: incompatible types in assignment

    - by giantKamote
    Hey guys, Can you help me with this error I encountered while building Spidermonkey in PPC? make -f Makefile.ref cat: ../../dist/Linux_All_DBG.OBJ/nspr/Version: No such file or directory cd editline; make -f Makefile.ref all make[1]: Entering directory `/units/ spidermonkey-1.8-next-wip/src/editline' make[1]: Nothing to be done for `all'. make[1]: Leaving directory `/units/ spidermonkey-1.8-next-wip/src/editline' make -f Makefile.ref Linux_All_DBG.OBJ/libjs.a Linux_All_DBG.OBJ/ libjs.so Linux_All_DBG.OBJ/js Linux_All_DBG.OBJ/jsautocfg.h Linux_All_DBG.OBJ/jscpucfg Linux_All_DBG.OBJ/jscpucfg.o cat: ../../dist/Linux_All_DBG.OBJ/nspr/Version: No such file or directory make[1]: Entering directory `/units/ spidermonkey-1.8-next-wip/src' make[1]: Circular jscpucfg.h <- Linux_All_DBG.OBJ/jsautocfg.h dependency dropped. make[1]: Circular Linux_All_DBG.OBJ/jsautocfg.h <- Linux_All_DBG.OBJ/ jsautocfg.h dependency dropped. /powerpc-750- linux-gnu_gcc-3.4.6/bin/powerpc-750-linux-gnu-gcc -o Linux_All_DBG.OBJ/ jsprf.o -c -Wall -Wno-format -MMD -DGCC_OPT_BUG -g3 -DXP_UNIX -DSVR4 - DSYSV -D_BSD_SOURCE -DPOSIX_SOURCE -DHAVE_LOCALTIME_R -DX86_LINUX - DDEBUG -DDEBUG_build -DEDITLINE -ILinux_All_DBG.OBJ jsprf.c jsprf.c: In function `BuildArgArray': jsprf.c:644: error: incompatible types in assignment make[1]: *** [Linux_All_DBG.OBJ/jsprf.o] Error 1 make[1]: Leaving directory `/units/ spidermonkey-1.8-next-wip/src' make: *** [all] Error 2 I'm using a Redhat-Linux machine. Do I need to have NSPR too to cross-compile spidermonkey? Thanks a lot!!

    Read the article

  • warning: assignment makes pointer from integer without a cast

    - by FILIaS
    Im new in programming c with arrays and files. Im just trying to run the following code but i get warnings like that: warning: assignment makes pointer from integer without a cast Any help? It might be silly... but I cant find what's wrong. FILE *fp; FILE *cw; char filename_game[40],filename_words[40]; int main() { while(1) { /* Input filenames. */ printf("\n Enter the name of the file with the cryptwords array: \n"); gets(filename_game); printf("\n Give the name of the file with crypted words:\n"); gets(filename_words); /* Try to open the file with the game */ if (fp=fopen("crypt.txt","r")!=NULL) { printf("\n Successful opening %s \n",filename_game); fclose(fp); puts("\n Enter x to exit,any other to continue! \n "); if ( (getc(stdin))=='x') break; else continue; } else { fprintf(stderr,"ERROR!%s \n",filename_game); puts("\n Enter x to exit,any other to continue! \n"); if (getc(stdin)=='x') break; else continue; } /* Try to open the file with the names. */ if (cw=fopen("words.txt","r")!=NULL) { printf("\n Successful opening %s \n",filename_words); fclose(cw); puts("\n Enter x to exit,any other to continue \n "); if ( (getc(stdin))=='x') break; else continue; } else { fprintf(stderr,"ERROR!%s \n",filename_words); puts("\n Enter x to exit,any other to continue! \n"); if (getc(stdin)=='x') break; else continue; } } return 0; }

    Read the article

  • c incompatible types in assignment, problem with pointers?

    - by Fantastic Fourier
    Hi I'm working with C and I have a question about assigning pointers. struct foo { int _bar; char * _car[MAXINT]; // this is meant to be an array of char * so that it can hold pointers to names of cars } int foofunc (void * arg) { int bar; char * car[MAXINT]; struct foo thing = (struct foo *) arg; bar = arg->_bar; // this works fine car = arg->_car; // this gives compiler errors of incompatible types in assignment } car and _car have same declaration so why am I getting an error about incompatible types? My guess is that it has something to do with them being pointers (because they are pointers to arrays of char *, right?) but I don't see why that is a problem. when i declared char * car; instead of char * car[MAXINT]; it compiles fine. but I don't see how that would be useful to me later when I need to access certain info using index, it would be very annoying to access that info later. in fact, I'm not even sure if I am going about the right way, maybe there is a better way to store a bunch of strings instead of using array of char *?

    Read the article

  • SQL Distinct keyword in assignment statement

    - by Brandi
    I have a query that works: DECLARE @ProductID int SET @ProductID = '1234' SELECT DISTINCT TOP 12 a.ProductID FROM A a WHERE a.CategoryID IN (SELECT b.CategoryID FROM B b WHERE b.ProductID = @ProductID) AND a.ProductID != @ProductID It returns a list of 12 product numbers, all unique. I need to store these results in a variable, comma separated, because that's what 3rd party stored procedure needs. So I have this: DECLARE @ProductID int DECLARE @relatedprods varchar(8000) SET @ProductID = '1234' SET @relatedprods = '' SELECT TOP 12 @relatedprods = @relatedprods + CONVERT(VARCHAR(20), a.ProductID) + ', ' FROM A a WHERE a.CategoryID IN (SELECT b.CategoryID FROM B b WHERE B.ProductID = @ProductID) AND a.ProductID != @ProductID SELECT @relatedprods Now, none of these are distinct, but it is returning 12 rows. Now I add the 'distinct' back in, like in the first query: DECLARE @ProductID int DECLARE @relatedprods varchar(8000) SET @ProductID = '1234' SET @relatedprods = '' SELECT DISTINCT TOP 12 @relatedprods = @relatedprods + CONVERT(VARCHAR(20), a.ProductID) + ', ' FROM A a WHERE a.CategoryID IN (SELECT b.CategoryID FROM B b WHERE B.ProductID = @ProductID) AND a.ProductID != @ProductID SELECT @relatedprods Only one product is returned in the comma separated list! Does 'distinct' not work in assignment statements? What did I do wrong? Or is there a way to get around this? Thanks in advance!

    Read the article

  • Design for a Debate club assignment application

    - by Amir Rachum
    Hi all, For my university's debate club, I was asked to create an application to assign debate sessions and I'm having some difficulties as to come up with a good design for it. I will do it in Java. Here's what's needed: What you need to know about BP debates: There are four teams of 2 debaters each and a judge. The four groups are assigned a specific position: gov1, gov2, op1, op2. There is no significance to the order within a team. The goal of the application is to get as input the debaters who are present (for example, if there are 20 people, we will hold 2 debates) and assign them to teams and roles with regards to the history of each debater so that: Each debater should debate with (be on the same team) as many people as possible. Each debater should uniformly debate in different positions. The debate should be fair - debaters have different levels of experience and this should be as even as possible - i.e., there shouldn't be a team of two very experienced debaters and a team of junior debaters. There should be an option for the user to restrict the assignment in various ways, such as: Specifying that two people should debate together, in a specific position or not. Specifying that a single debater should be in a specific position, regardless of the partner. etc... If anyone can try to give me some pointers for a design for this application, I'll be so thankful! Also, I've never implemented a GUI before, so I'd appreciate some pointers on that as well, but it's not the major issue right now.

    Read the article

  • Multiple Unpacking Assignment in Python when you don't know the sequence length

    - by doug
    The textbook examples of multiple unpacking assignment are something like: import numpy as NP M = NP.arange(5) a, b, c, d, e = M # so of course, a = 0, b = 1, etc. M = NP.arange(20).reshape(5, 4) # numpy 5x4 array a, b, c, d, e = M # here, a = M[0,:], b = M[1,:], etc. (ie, a single row of M is assigned each to a through e) (My Q is not numpy specfic; indeed, i would prefer a pure python solution.) W/r/t the piece of code i'm looking at now, i see two complications on that straightforward scenario: i usually won't know the shape of M; and i want to unpack a certain number of items (definitely less than all items) and i want to put the remainder into a single container so back to the 5x4 array above, what i would very much like to be able to do is, for instance, assign the first three rows of M to a, b, and c respectively (exactly as above) and the rest of the rows (i have no idea how many there will be, just some positive integer) to a single container, all_the_rest = []. I'm not sure if i have explained this clearly; in any event, if i get feedback i'll promptly edit my Question.

    Read the article

  • Programming methods design phase assignment

    - by Shakir
    Hey, i have an assignment (NCC) which deals with the design phase. The Scenario is that you have four soccer divisions (divisions 1,2,3 and 4) which consist of 22 teams each and hence each team plays 42 games (home and away). The concept is similar to the barclays premier league whereby ranking is based on points or else goal difference or else goals scored by team. The difference is that the top 2 teams are promoted and the bottom 2 are relegated and this includes Div 1 and Div 4 as the top 2 of Div1 are promoted to the national league which is above division 1 regional league and bottom 2 of Div4 are relegated to the local league below Division 4 regional league. Hence there are 3 total leagues and 4 divisions in the regional league (which has 22 teams each). Now the referee has to add the result of the match and thus automatic tables have to be generated now, There are two reports League Tables for 4 divisions List of all results for any chosen team during the season by date it was played on There are a couple of things to be done... i know its gonna be terrible to make everything but atleast explain to me how i should go about drawing these and what things i should include (generally) Logical Data Structure Diagram (DSD) for each report Preliminary Program Structure (PSD) for each report Detailed Program Specification for each report Flowchart for each report There are other things but i think our teacher will give us clear "clues" for it Thanks a lot Update - Project so far: Data Structure Diagram Preliminary Program Structure

    Read the article

  • Javascript function using "this = " gives "Invalid left-hand side in assignment"

    - by Brian M. Hunt
    I am trying to get a Javascript object to use the "this" assignments of another objects' constructor, as well as assume all that objects' prototype functions. Here's an example of what I'm attempting to accomplish: /* The base - contains assignments to 'this', and prototype functions */ function ObjX(a,b) { this.$a = a, $b = b; } ObjX.prototype.getB() { return this.$b; } function ObjY(a,b,c) { // here's what I'm thinking should work: this = ObjX(a, b * 12); /* and by 'work' I mean ObjY should have the following properties: * ObjY.$a == a, ObjY.$b == b * 12, * and ObjY.getB() == ObjX.prototype.getB() * ... unfortunately I get the error: * Uncaught ReferenceError: Invalid left-hand side in assignment */ this.$c = c; // just to further distinguish ObjY from ObjX. } I'd be grateful for your thoughts on how to have ObjY subsume ObjX's assignments to 'this' (i.e. not have to repeat all the this.$* = * assignments in ObjY's constructor) and have ObjY assume ObjX.prototype. My first thought is to try the following: function ObjY(a,b,c) { this.prototype = new ObjX(a,b*12); } Ideally I'd like to learn how to do this in a prototypal way (i.e. not have to use any of those 'classic' OOP substitutes like Base2). It may be noteworthy that ObjY will be anonymous (e.g. factory['ObjX'] = function(a,b,c) { this = ObjX(a,b*12); ... }) -- if I've the terminology right. Thank you.

    Read the article

  • iOS: Assignment to iVar in Block (ARC)

    - by manmal
    I have a readonly property isFinished in my interface file: typedef void (^MyFinishedBlock)(BOOL success, NSError *e); @interface TMSyncBase : NSObject { BOOL isFinished_; } @property (nonatomic, readonly) BOOL isFinished; and I want to set it to YES in a block at some point later, without creating a retain cycle to self: - (void)doSomethingWithFinishedBlock:(MyFinishedBlock)theFinishedBlock { __weak MyClass *weakSelf = self; MyFinishedBlock finishedBlockWrapper = ^(BOOL success, NSError *e) { [weakSelf willChangeValueForKey:@"isFinished"]; weakSelf -> isFinished_ = YES; [weakSelf didChangeValueForKey:@"isFinished"]; theFinishedBlock(success, e); }; self.finishedBlock = finishedBlockWrapper; // finishedBlock is a class ext. property } I'm unsure that this is the right way to do it (I hope I'm not embarrassing myself here ^^). Will this code leak, or break, or is it fine? Perhaps there is an easier way I have overlooked? SOLUTION Thanks to the answers below (especially Krzysztof Zablocki), I was shown the way to go here: Define isFinished as readwrite property in the class extension (somehow I missed that one) so no direct ivar assignment is needed, and change code to: - (void)doSomethingWithFinishedBlock:(MyFinishedBlock)theFinishedBlock { __weak MyClass *weakSelf = self; MyFinishedBlock finishedBlockWrapper = ^(BOOL success, NSError *e) { MyClass *strongSelf = weakSelf; strongSelf.isFinished = YES; theFinishedBlock(success, e); }; self.finishedBlock = finishedBlockWrapper; // finishedBlock is a class ext. property }

    Read the article

  • How are property assignment expressions handled in C#?

    - by Serious
    In C# you can use a property as both an lrvalue and rvalue at the same time like this : int n = N = 1; Here is a complete C# sample : class Test { static int n; static int N { get { System.Console.WriteLine("get"); return n; } set { System.Console.WriteLine("set"); n = value; } } static void Main() { int n = N = 1; System.Console.WriteLine("{0}/{1}", n, N); } } You can't do that in C++/CLI as the resulting type of the assignment expression "N = 1" is void. EDIT: here is a C++/CLI sample that shows this : ref class A { public: static property int N; }; int main() { int n = A::N = 1; System::Console::WriteLine("{0}/{1}", n, A::N); } So what's the magic behind C# syntax allowing a void-expression to be used as a rvalue ? Is this special treatment only available for properties or do you know other C# tricks like this ?

    Read the article

  • Need Help finding an appropriate task assignment algorithm for a college project involving coordinat

    - by Trif Mircea
    I am a long time lurker here and have found over time many answers regarding jquery and web development topics so I decided to ask a question of my own. This time I have to create a c++ project for college which should help manage the workflow of a company providing all kinds of services through in the field teams. The ideas I have so far are: client-server application; the server is a dispatcher where all the orders from clients get and the clients are mobile devices (PDAs) each team in the field having one a order from a client is a task. Each task is made up of a series of subtasks. You have a database with estimations on how long a task should take to complete you also know what tasks or subtasks each team on the field can perform based on what kind of specialists made up the team (not going to complicate the problem by adding needed materials, it is considered that if a member of a team can perform a subtask he has the stuff needed) Now knowing these factors, what would a good task assignment algorithm be? The criteria is: how many tasks can a team do, how many tasks they have in the queue, it could also be location, how far away are they from the place but I don't think I can implement that.. It needs to be efficient and also to adapt quickly is the human dispatcher manually assigns a task. Any help or leads would be really appreciated. Also I'm not 100% sure in the idea so if you have another way you would go about creating such an application please share, even if it just a quick outline. I have to write a theoretical part too so even if the ideas are far more complex that what i outlined that would be ok ; I'd write those and implement what I can. Edit: C++ is the only language I know unfortunately.

    Read the article

  • C++ Pointer member function with templates assignment with a member function of another class

    - by Agusti
    Hi, I have this class: class IShaderParam{ public: std::string name_value; }; template<class TParam> class TShaderParam:public IShaderParam{ public: void (TShaderParam::*send_to_shader)( const TParam&,const std::string&); TShaderParam():send_to_shader(NULL){} TParam value; void up_to_shader(); }; typedef TShaderParam<float> FloatShaderParam; typedef TShaderParam<D3DXVECTOR3> Vec3ShaderParam; In another class, I have a vector of IShaderParams* and functions that i want to send to "send_to_shader". I'm trying assign the reference of these functions like this: Vec3ShaderParam *_param = new Vec3ShaderParam; _param-send_to_shader = &TShader::setVector3; This is the function: void TShader::setVector3(const D3DXVECTOR3 &vec, const std::string &name){ //... } And this is the class with IshaderParams*: class TShader{ std::vector params; public: Shader effect; std::string technique_name; TShader(std::string& afilename):effect(NULL){}; ~TShader(); void setVector3(const D3DXVECTOR3 &vec, const std::string &name); When I compile the project with Visual Studio C++ Express 2008 I recieve this error: Error 2 error C2440: '=' :can't make the conversion 'void (__thiscall TShader::* )(const D3DXVECTOR3 &,const std::string &)' a 'void (__thiscall TShaderParam::* )(const TParam &,const std::string &)' c:\users\isagoras\documents\mcv\afoc\shader.cpp 127 Can I do the assignment? No? I don't know how :-S Yes, I know that I can achieve the same objective with other techniques, but I want to know how can I do this..

    Read the article

  • Command prompt cannot find PATH variable

    - by davidXYZ
    Sometimes, my command prompt cannot find the PATH variable. I have this occasional problem at work where when I open command-prompt and run commands like ipconfig or subst, I get an error saying something like 'ipconfig' is not recognized as an internal or external command. When I try this echo %path%, it prints out %path% instead of the PATH value. If I look at my Environment Variables window, the PATH is defined right there but I don't know why CMD can't find it. At this point, I understand why the other commands were not being recognized since their paths are in PATH variable. However, I cannot understand why the PATH variable is not being found. If I restart the computer, everything is back to normal. In a few days, I might have the same experience again. I tried using this answer. It suggested changing a registry value but mine already had the value that was suggested yet it wasn't working. (The restart step at the end would have solved it as usual but that's not the point.) Any suggestions regarding why the PATH variable may become invisible every now and then and how I can prevent it from happening again?

    Read the article

  • Javascript Square bracket notation for global variables

    - by Yousuf Haider
    I ran into an interesting issue the other day and was wondering if someone could shed light on why this is happening. Here is what I am doing (for the purposes of this example I have dumbed down the example somewhat): I am creating a globally scoped variable using the square bracket notation and assigning it a value. Later I declare a var with the same name as the one I just created above. Note I am not assigning a value. Since this is a redeclaration of the same variable the old value should not be overriden as described here: http://www.w3schools.com/js/js_variables.asp //create global variable with square bracket notation window['y'] = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old The problem is that the old value actually does get overriden and in the above eg. the alert shows 'new' instead of 'old'. Why ? I guess another way to state my question is how is the above code different in terms of semantics from the code below: //create global variable var y = 'old'; //redeclaration of the same variable var y; if (!y) y = 'new'; alert(y); //shows New instead of Old

    Read the article

  • Intentional misspellings to avoid reserved words

    - by Renesis
    I often see code that include intentional misspellings of common words that for better or worse have become reserved words: klass or clazz for class: Class clazz = ThisClass.class kount for count in SQL: count(*) AS kount Personally I find this decreases readability. In my own practice I haven't found too many cases where a better name couldn't have been used — itemClass or recordTotal. However, it's so common that I can't help but wonder if I'm the only one? Anyone have any advice or even better, quoted recommendations from well-respected programmers on this practice?

    Read the article

  • a missing variable in a switch statement ?!!

    - by mechhfly
    hi folks, i have a strange issue. a variable seems to be missing during a pass through a case statement i have a function like so function checklink($var0, $var1, $var2) { switch($var0) { case "case1": print $var2; //code uses $var2 successfully case "case2": print $var2; //variable has disappeared! } } essentially what i am doing is constructing a string from the last variable based on the first. if i run the code in which the first case is true, i get the expected results, but when i run the second case, my variable seems to have vanished. these first two case statements are syntactically the same and the variable is gathered from the $_GET array (hard coded into hyperlink). any light on this issue? if more explanation is needed let me know, its late and my brain is getting mushy. thanks my friends.

    Read the article

  • Constructing an object and calling a method without assignment in VB.Net

    - by mdryden
    I'm not entirely sure what to call what C# does, so I haven't had any luck searching for the VB.Net equivalent syntax (if it exists, which I suspect it probably doesn't). In c#, you can do this: public void DoSomething() { new MyHelper().DoIt(); // works just fine } But as far as I can tell, in VB.Net, you must assign the helper object to a local variable or you just get a syntax error: Public Sub DoSomething() New MyHelper().DoIt() ' won't compile End Sub Just one of those curiosity things I run into from day to day working on mixed language projects - often there is a VB.Net equivalent which uses less than obvious syntax. Anyone?

    Read the article

  • 23warning: assignment makes pointer from integer without a cast

    - by FILIaS
    Im new in programming c with arrays and files. Im just trying to run the following code but i get warnings like that: 23 44 warning: assignment makes pointer from integer without a cast Any help? It might be silly... but I cant find what's wrong. #include<stdio.h> FILE *fp; FILE *cw; char filename_game[40],filename_words[40]; int main() { while(1) { /* Input filenames. */ printf("\n Enter the name of the file with the cryptwords array: \n"); gets(filename_game); printf("\n Give the name of the file with crypted words:\n"); gets(filename_words); /* Try to open the file with the game */ if (fp=fopen("crypt.txt","r")!=NULL) //line23 { printf("\n Successful opening %s \n",filename_game); fclose(fp); puts("\n Enter x to exit,any other to continue! \n "); if ( (getc(stdin))=='x') break; else continue; } else { fprintf(stderr,"ERROR!%s \n",filename_game); puts("\n Enter x to exit,any other to continue! \n"); if (getc(stdin)=='x') break; else continue; } /* Try to open the file with the names. */ if (cw=fopen("words.txt","r")!=NULL) //line 44 { printf("\n Successful opening %s \n",filename_words); fclose(cw); puts("\n Enter x to exit,any other to continue \n "); if ( (getc(stdin))=='x') break; else continue; } else { fprintf(stderr,"ERROR!%s \n",filename_words); puts("\n Enter x to exit,any other to continue! \n"); if (getc(stdin)=='x') break; else continue; } } return 0; }

    Read the article

  • How to pass jQuery variable with AJAX to PHP page

    - by Walden
    Trying to pass the variable "flickrurl" to a PHP page with jQuery/ajax. It works when using a plain text string and not the variable. Am I assigning the variable properly? see the full code in action here: http://is.gd/c9ytI $trash.droppable({ accept: '#gallery > li', activeClass: 'ui-state-highlight', drop: function(ev, ui) { deleteImage(ui.draggable); //set variable equal to src of image tag in #gallery > li var $flickrurl = $item.find('img').attr("src"); //pass variable to php page $.post("updateDB.php", $flickrurl ); } });

    Read the article

  • R error message about variable lengths

    - by Abraham
    I ran the following code in order to recode the variable. Unfortunately, when I move to run an logit model (using the Zelig package), I get an error message that the variable length differ for this variable. ## Independent Variable - Partisanship (ANES 2004) data04$V043114 part <- data04$V043114 attributes(part) summary(part) partb < part partb[part %in% levels(part)[4]] <- NA partb[part %in% levels(part)[5]] <- NA partb[part %in% levels(part)[6]] <- NA partb[part %in% levels(part)[7]] <- NA partb <- factor(partb) attributes(partb) summary(partb) table(partb) table(part, partb) cbind(part, partb) partisan041 <- partb partisan042 <- as.numeric(partb) summary(partisan041) summary(partisan042) ## Regression Model - ANES 2004 ## anes04one <- zelig(trade041a ~ age042 + education042 + personal042 + economy042 + partisan042 + employment042 + union042 + home042 + market042 + race042 + income042 + gender042, model="logit", data=data04) summary(anes04one) #Error in model.frame.default(formula = trade041a ~ age042 + education042 + : # variable lengths differ (found for 'partisan042')

    Read the article

  • Php variable in several files including jquery

    - by vipinsahu
    i created two variable and these two variable are using everywhere . i don't want to store these variable in to database e.g ( $username ,$password and there are 3 files using these variable load.php,index.php and add.php , i am also using jquery to load the add.php as in ajax (to add the user in JSON) $.ajax({ type: "POST", url: "add.php", data: "twitter="+encodeURIComponent(twitter), /* Sending the filled in twitter name */ success: function(msg){ /* PHP returns 1 on success, and 0 on error */ var status = parseInt(msg); if(status) { $('#response').html('Thank you '); $('#twitterName').val(''); } else $('#response').html('<span style="color:red">There is no user.</span>'); } }); how can i use these two variable in a single file to perform the whole operation Thanks

    Read the article

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