Search Results

Search found 11238 results on 450 pages for 'miserable variable'.

Page 51/450 | < Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >

  • Error after passing variable from jquery to code in c#

    - by Moraru Viorel
    I try to pass variable from jquery to code c# but something is wrong. I have in js this code: <script type="text/javascript"> var mySerial = '12345'; var fooUrl = '@Url.Action("Foo", "Home")'; window.location.href = fooUrl + '?mySerial' + encodeURIComponent(mySerial); </script> in controller : [HttpPost] public ActionResult Foo(string mySerial) { return View(); } After execution I keep this url: http://localhost:2214/@Url.Action("Foo",%20"Home")?mySerial12345 and I don't understand where's the problem, can someone help me?

    Read the article

  • Is an ArrayList automaticaly declared static ,if it is an instance variable?(Java)

    - by Alex
    Hy ,what i`m trying to do is something like this: private class aClass { private ArrayList idProd; aClass(ArrayList prd) { this.idProd=new ArrayList(prd); } public ArrayList getIdProd() { return this.idProd; } } So if i have multiple instances of ArrayLIst (st1 ,st2 ,st3) and I want to make new objects of aClass : { aClass obj1,obj2,obj3; obj1=new aClass(st1); obj2=new aClass(st2); obj3=new aClass(st3); }why all of the aClass objects will return st3 if I access the method getIdProd() for each of them(obj1..obj3)? is an arraylist as a instance variable automatically declared static?

    Read the article

  • should variable be retained or not? iphone-sdk

    - by psebos
    Hi, in the following piece of code I got from a book. The NSString *pPath which is defined in the class as an instance variable. @interface MainViewController : UIViewController { NSString *pPath; } In the implementation after being set it is being retained. I assume that with the assignment the object is automatically retained (because it is an NSString) and there is no need to additionally retain it. - (void) initPrefsFilePath { NSString *documentsDirectory = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]; pPath = [documentsDirectory stringByAppendingPathComponent: @"flippingprefs.plist"]; [pPath retain]; }

    Read the article

  • Global variable not stable after platform changed.

    - by user350555
    Our embedded system is built on a hw/sw platform made by enea. After the platform updated recently, we found some operations on the global variable keep crashing the system. For example, we have a global map structure holding some data. We can insert/iterate the map once or twice, then the address of the elements in the map suddenly changed to some forbidden addresses like 0x0 or 0x1d, the system just crash. The only different before/after the platform update is : 1) sw part: It's a c++ software and We changed the compiler from diab cc to gcc. 2) hw part: we have a new board, but the cpu is still powerpc405s. I tried every possible way but still can't figure out the reason. Any thoughts?

    Read the article

  • Print out the variable name objective-C

    - by vodkhang
    Continued from the last question here: Log method name in Obj-C . I just wondered if there is a way to print out the variable name as well. For example: NSString *name = "vodkhang"; NCLog(@"%@", name); and I hope that the output should be: name: vodkhang Just to summarize the previous post, currently, I can print out the class name, method name and the line number when I call NCLog(@"Hello World"); <ApplicationDelegate:applicationDidFinishLaunching:10>Hello world with #define NCLog(s, ...) NSLog(@"<%@:%d> %@", __FUNCTION__, __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__])

    Read the article

  • Passing variable string to create arrays (Android)

    - by dweebsonduty
    Hello all, I am a newb to Android and Java and want to write a funtion that will display a list based on a varable that I pass to the function. The function is below and the code below creates an array out of a string called type, but what I want to do is pass it a variable string and have it build a list based on that string. So if I wanted the type list I would say list_it("type") But if I try something like getResources().getStringArray(R.array.thelist); it doesn't work. Can someone point me in the right direction? public void list_it(String thelist){ String[] types = getResources().getStringArray(R.array.type); ArrayAdapter<String> mAdapter = new ArrayAdapter<String>(this, R.layout.list_item1, types); setListAdapter(mAdapter); ListView lv = getListView(); lv.setTextFilterEnabled(true); }

    Read the article

  • Passing 2D array with variable dimensions as function argument

    - by TheCrazyProgrammer
    I just saw the following code among the successful submissions at codechef. http://www.codechef.com/viewplaintext/1595846 I used to think that float max(int n,int arr[n][n]) {....} is not allowed in C++ (as 'n' is a variable). My CodeBlocks (on windows) with MinGW [gcc 4.4] gives compile time error. that "error: array bound is not an integer constant. Then how can be such a solution be accepted by CodeChef's judge. Is there any special flag that allows us to do that in C++??? EDIT: A link showing status as AC (accepted) : http://www.codechef.com/viewsolution/1595846

    Read the article

  • c++ variable declaration

    - by swan
    Hello, Im wondering if this code: int main(){ int p; for(int i = 0; i < 10; i++){ p = ...; } return 0 } is exactly the same as that one int main(){ for(int i = 0; i < 10; i++){ int p = ...; } return 0 } in term of efficiency ? I mean, the p variable will be recreated 10 times in the second example ?

    Read the article

  • Dynamic Variable Names

    - by Ross
    I have a function that is called 3 times, I want times to assign it a name. How can I assign dynamic variable names to movieclips or do reference them by name or instancename? var loadedMovie:MovieClip = new MovieClip(); loadedMovie.name = "mymovie"; loadedMovie = loadEvent.currentTarget.content; loadedMovie.x = 0; loadedMovie.y = 0; addChild(loadedMovie); mymovie.x = 20;

    Read the article

  • Python: Importing a variable inside of a infinite loop

    - by Jack
    I have two modules, a host and a scanner. Both loop indefinitely to communicate with the serial ports. I want to import the variable "bestchannel" from scanner into host but by importing it, the while loop inside scanner runs first and loops forever. I want each module to run separately but be able to send each other data in real time. Is this possible? (outside of scanning ram) Example Code: http://pastebin.com/pxUBaima I want minchannel from scanner to be accessible to host.

    Read the article

  • SQL select statement - returning records starting with variable length string

    - by alpheus
    I am using an alphabetical sorting feature and need a SQL statement to return records beginning with a variable length string. However, records also need to be returned if there are periods, spaces, or dashes between any of the characters in the string. For example, the string could be "M" (easy). Or "MA" (in which case it needs to return records starting with "MA", "M.A", "M A", and "M-A"). Or "MAA", and so on. This is the statement I have so far: "SELECT * from table where LEFT(name," + value.Length + ")='" + value + "'" But I can't work out how to get it to return results where there are periods, spaces or dashes in name. Any help constructing the statement would be great.

    Read the article

  • Wpf application variable not changing

    - by Hasan Zubairi
    In my application I need some variables on almost all the pages so I declared them in Application.xaml like <sys:String x:key="First">First</sys:String> and on one page I change the value in code like Resources["First"] = "This is First"; on the second page when I call the variable like String f = (string)this.TryFindResource("First"); MessageBox.Show(f); the out put is "First" and not "This is First". I also tried like. Application.Current.Properties["First"]

    Read the article

  • Please explain this php expression "!$variable"

    - by DogBot
    What does an exclamaton mark in front of a variable mean? And how is it being used in this piece of code? EDIT: From the answers so far I suspect that I also should mention that this code is in a function where one of the parameters is $mytype ....would this be a way of checking if $mytype was passed? - Thanks to all of the responders so far. $myclass = null; if ($mytype == null && ($PAGE->pagetype <> 'site-index' && $PAGE->pagetype <>'admin-index')) { return $myclass; } elseif ($mytype == null && ($PAGE->pagetype == 'site-index' || $PAGE->pagetype =='admin-index')) { $myclass = ' active_tree_node'; return $myclass; } elseif (!$mytype == null && ($PAGE->pagetype == 'site-index' || $PAGE->pagetype =='admin-index')) { return $myclass; }`

    Read the article

  • Error when rendering a partial (RoR) passing the form as a local variable

    - by Dmitriy Likhten
    In my main template I have the following: <%= render :partial => "delivery_date", :collection => @brand.delivery_dates, :locals => {:form => f} %> However when the partial tries to use the form local variable, I get this error Showing app/views/brands/_delivery_date.html.erb where line #2 raised: wrong number of arguments (0 for 1) Extracted source (around line #2): 1: <%= delivery_date.id %> 2: <%= form.text_field :name %> 3: <% new_or_existing = delivery_date.new_record? ? 'new' : 'existing' %> 4: <% prefix = "brand[#{new_or_existing}_delivery_date_attributes][]" %> 5: <% fields_for prefix, delivery_date do |dd_f| %> Does anyone understand what this error means? Actually I want to do <% form.fields_for delivery_date do |dd_f| %> but that fails as well.

    Read the article

  • how to draw a Bitmap to a Canvas with a variable alpha

    - by steelbytes
    Hi, I'm trying to draw a Bitmap to a Canvas with a variable amount of alpha. But I only get nothing (when alpha<255) or the 'full' bitmap (when alpha==255). Have also tried loading as a Drawable, and using drawable.setAlpha, but that gave the same result. my init BitmapFactory.Options opts = new BitmapFactory.Options(); opts.inScaled = false; opts.inSampleSize = 1; Bitmap img = BitmapFactory.decodeResource(getResources(),R.drawable.sample,opts); my onDraw() Paint p = new Paint(Paint.ANTI_ALIAS_FLAG|Paint.FILTER_BITMAP_FLAG); p.setColor((alpha<<24)+0xffffff); // alpha in range 0..255 canvas.drawBitmap(img, null, imgRect, p);

    Read the article

  • cannot set a variable to base on user input post method

    - by user1318960
    Hello i´m trying to set info from a post method into a variable that sets a session named name the value that the user input. I get the following error: Notice: Undefined index: name in F:\xampp\htdocs\Impossible game\index.php on line 18 This is line 18: $session = $_POST['name']; <form action="ms1.php" method="POST"> Name <input type="text" name="name"> <input type="Submit" value="Begin"> </form> <?php $session = $_POST['name']; session_start(); $_SESSION['name'] = $session;

    Read the article

  • Phase REST XML into variable

    - by 001
    I want to get a response from the REST XML web service, and phase it into variables so I can use them in my program. 1) How come this code does not work? I get an empty string... // Get response string ws_response=""; using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) { // Get the response stream StreamReader reader = new StreamReader(response.GetResponseStream()); // web service response string ws_response = reader.ReadToEnd; // <---???? I get an empty string // do phasing here (ie XML element into variable) etc.. // }

    Read the article

  • Assign the results of a stored procedure into a variable in another stored procedure

    - by RHPT
    The title of this question is a bit misleading, but I couldn't summarize this very well. I have two stored procedures. The first stored procedure (s_proc1) calls a second stored procedure (s_proc2). I want to assign the value returned from s_proc2 to a variable in s_proc1. Currently, I'm calling s_proc2 (inside s_proc1) in this manner: EXEC s_proc2 @SiteID, @count = @PagingCount OUTPUT s_proc2 contains a dynamic query statement (for reasons I will not outline here). CREATE dbo.s_proc2 ( @siteID int, @count int OUTPUT ) AS DECLARE @sSQL nvarchar(100) DECLARE @xCount int SELECT @sSQL = 'SELECT COUNT(ID) FROM Authors' EXEC sp_ExecuteSQL @sSQL, N'@xCount int output', @xCount output SET @count = @xCount RETURN @count Will this result in @PagingCount having the value of @count? I ask because the result I am getting from s_proc1 is wonky. In fact, what I do get is two results. The first being @count, then the result of s_proc1 (which is incorrect). So, it makes me wonder if @PagingCount isn't being set properly. Thank you.

    Read the article

  • an error "variable of field declared void"

    - by lego69
    I have this code: header - test.h Inside header I have some class Z and definitions of two functions test and test2 I call function test2 from test void test2(Z z, Z const *za); this is implementation of the function: void test2(Z z, Z const *za){ int i = z; //this row works cout << i << endl; } I call it from test: test2(z1, za1); // za1 is pinter to object and z1 is some object but in my header I receive an 3 errors: Multiple markers at this line - initializer expression list treated as compound expression - `A' was not declared in this scope - variable or field `quiz2' declared void can somebody please explain why? thanks in advance

    Read the article

  • How to create a bash function with variable parameters/arguments to grep several keywords/tags

    - by CornSmith
    I'm using the :!grep "tag1" filename | grep "tag2" filename | grep -n "tag3 or more" filename command in vim to search for my code snippets based on their tags (a simple comment at the top of a snippet) in one big file. I use snippets to remember tricky things. This is painful to write out each time. I'd like to make an alias, or function to do something like this: :!greptag tag1 tag2 ... tag39 And it should search the current doc and return the lines with all the tags on them. Vim is set to interactive shell mode so that it can parse my bashrc for aliases/functions. set shellcmdflag=-ic How can I construct a function that allows for variable arguments like this in bash?

    Read the article

  • How to use Boolean variable in c:if

    - by Patriks
    I am using this code in jsf <c:if test="#{sV.done.booleanValue()}"> <option value="#{sV.id}" selected="selected">#{sV.text}</option> </c:if> <c:if test="#{not sV.done.booleanValue()}"> <option value="#{sV.id}">#{sV.text}</option> </c:if> sv is my class containing data (pojo), done is an Boolean variable, I want to display option tag with selected attribute if sV.done is true. But I couldn't make it. Don't know where I am wrong. Otherwise there can be something worong with c? because c:forEach was not working before some time in my case in same page. it can be the reason? Where I am wrong?

    Read the article

  • Accessing a variable passed by jquery using php

    - by celenius
    How does php access a variable passed by JQuery? I have the following code: $.post("getLatLong.php", { latitude: 500000}, function(data){ alert("Data Loaded: " + data); }); but I don't understand how to access this value using php. I've tried $userLat=$_GET["latitude"]; and $userLat=$_GET[latitude]; and then I try to print out the value (to check that it worked) using: echo $userLat; but it does not return anything. I can't figure out how to access what is being passed to it.

    Read the article

  • Storing a variable into a database

    - by Alekx
    In an attempt to better learn Rails and I'm building a simple Blackjack game, but I'm running into a problem of storing the variable. I understand how to store user-genereated data into the db using form_for, but I'm struggling to create a random number and put it in the db. @hand = rand(9) + 2 I have "hand" as a field in my db, just curious how to store this random number. Any help anyone could provide to point me in the right direction would be very much appreciated. Thanks.

    Read the article

  • variable=@value@ in Makefiles

    - by user1447110
    I understand that @ suppresses printing of a command in a Makefile... http://www.gnu.org/software/make/manual/make.html#Echoing ... and I understand that $@ is the target name... http://www.gnu.org/software/make/manual/make.html#Automatic-Variables ... but I can't find any information on what a line like this might mean: variable=@value@ I'm not trying to fix anything here, just trying to better understand Makefiles. Update: The "Makefile Subsitutions" section of the GNU autoconf manual explains that it's a value that is substituted by autoconf.

    Read the article

< Previous Page | 47 48 49 50 51 52 53 54 55 56 57 58  | Next Page >