38 Topics

Member Avatar for
Member Avatar for Mr

Till now I was expecting that there in no block level scope in Javascript. But after reading this article I came to know that block-scoped variables are introduced in javascript. Although this article <[Everything you need to know about Javascript variable scope](http://www.coolcoder.in/2014/03/everything-you-need-to-know-about.html) > has a very good explaination about the …

Member Avatar for evaipar
0
255
Member Avatar for hotelsinger

I am a programmer. That's why I'm receiving a paycheck. I sit alone in a small cubicle and do my work. I don't do desktop support and I'm not interested in working closely with users. So my boss says to me today that I am being signed up for a …

Member Avatar for diafol
2
389
Member Avatar for cool_zephyr

how to make a bean application scoped so that it will persist as long as the web application is running??? and how can we access it in our controller?? thank you

Member Avatar for masijade
0
216
Member Avatar for ihatehippies

I stumbled on upon this anomaly in one of my programs and can't figure out why this is happening. I made a small test function that exhibits the same behavoir. It's like the local variables of my function are being saved after the function exits. The exclude_ids variable keeps growing. …

Member Avatar for james.lu.75491856
0
681
Member Avatar for duke.tim

How can an array be accessed from within another function? Here is an example of some code. editarray can not seem to access values of the array from outside of the writetofile function. Is there any way to change the scope of the array? #!/bin/sh writetofile() { templine=`cat /dev/stdin` export …

Member Avatar for Watael
0
244
Member Avatar for NardCake

Hello! So I currently have a class titled Appliciation which contains a method called start. <?php class Application { /* * Application class */ public function __construct($IceTray){ $this->IceTray = $IceTray; } /* Starts application */ public function start(){ /* Confiures error reporting */ $this->IceTray->Error->configure(); $Path = $IceTray->Path; include APPDIR.'/paths.php'; $Path->start(); …

Member Avatar for NardCake
0
289
Member Avatar for singularity~

I have declared a local variable inside of getAddress. When I try to access that variable inside a local function it falls outside its scope. What am I doing wrong? function getAddress(latlon, map) { var data = ""; $("#map-canvas").gmap3({ marker: { latLng: latlon, options:{ draggable:false, }, }, getaddress:{ latLng: latlon, …

Member Avatar for singularity~
0
267
Member Avatar for thunderjuice

Hello, I am new in trying to figure out how to use two classes together. One class is called circle, and is supposed to hold attributes of radius and area. It is also supposed to have the methods of print and computeArea. public class Circle { //global data private double …

Member Avatar for thunderjuice
0
263
Member Avatar for Hopp3r

Ok, so currently I've been trying to recreate missile command, an old atari game. While I've had help from a group in creating the graphics for the game i.e menu, plotter class, etc. I've basically been flying solo as of the game's logic i.e missile detection, health, missiles spawning and …

Member Avatar for ravenous
0
194
Member Avatar for pars99

Can you please help me and tell me what I am doing wrong? I have been looking at the program for two hours and need help. I keep getting this error: 'triangle' was not declared in this scope. Also, that is the only error, so I don't have anymore. Thank …

Member Avatar for pars99
0
2K
Member Avatar for dancks

Based off some stuff from my last thread I tried to write a search results page using maximum 3 parameters. I used a couple of function to try and get everything organized. One: sort_mysql_results has no defined parameters so I can put in as many parameters as needed. The code …

Member Avatar for dancks
0
325
Member Avatar for thompsonSensibl

Hello, I'm in a pickle. (Please observe the code) In the actionPerformed method, I don't know how I can get the value of the variable 'minutes'. I can get 'hours' by e.getActionCommand(), but can't do minutes that way. I need to get both 'hours' and 'minutes' at the same action. …

Member Avatar for thompsonSensibl
0
238
Member Avatar for Pyler

consider public class awah{ private int x=0; private int y; private int w; public awah(int width){ w=width; } public void sety(){ y=(Int)(Math.random()*4);}//meth1 public int gety(){ return y; } public void setx (){ x+=this.gety(); } public int getx(){ return x; } public void showUpdate(){ System.out.println(x); } }//end of awah public static …

Member Avatar for Taywin
0
215
Member Avatar for TheMorphinator

Hello all, I'm new to programming in Objective-C and have some C++ under my belt. As one of my first programs, I'm trying to make a fairly simple app that can record the user's heart rate. I made a class to store all of this information in (called HeartRate), from …

Member Avatar for ChrisPadgham
0
222
Member Avatar for sway1101

Hey all, I have created a mail script in PHP for a contact form on my website. I have a message that displays when the message has been sent. I would like this message to display below my form but am having some trouble with this. The message is currently …

Member Avatar for cereal
0
204
Member Avatar for nexocentric

I'm having a small problem with a variable in one of my PHP scripts. The variable is `$isSubMenu`. It gets set using a function that runs recursively called createNavigationMenu. However, even though I have set it, the interpreter keeps telling me that the variable is undefined. I really don't know …

Member Avatar for nexocentric
0
562
Member Avatar for nchy13

i am ensuring on both pages i have first of all called session_start(); on one page i declared $_SESSION["username"]=$username; the link of another page is on this page. and another page i tried to print it by echo $_SESSION["username"]; but it showed nothing. i am using php 5.4 with apache …

Member Avatar for nchy13
0
192
Member Avatar for crodriguez08

Hey, I get confused when dealing with the static scope and dynamic scope, and for this pseudocode I have to find both. For static I believe it should print out: 9 4 2 3 however, I'm not entirely sure. Any help would be appreciated, thanks. [CODE]Procedure main g:integer procedure B(a …

0
96
Member Avatar for kutchbhi

This is the project I am reading from . [url]https://github.com/sasatomislav/PHP5-OOP-Cart[/url] [CODE] class Cart { <snip> private function __construct() {} /** * Fetch Cart instance * * @return Cart */ public function getInstance() { if (NULL === self::$_instance) { self::$_instance = new self; } return self::$_instance; } } <snip> // initialize …

Member Avatar for pritaeas
0
262
Member Avatar for Labdabeta

I was working on a project when I thought that maybe a ::. operator would look funny in some code. Just for fun I typed that into the global scope area like this: [CODE]::. int main() { //etc...[/CODE] and my code completion software said too many results to display. My …

Member Avatar for Labdabeta
0
190
Member Avatar for tanha

Hello everyone, I am creating UDF using CREATE FUNCTION statement. The question is how can I make them globally accessible to all the databases, rather than specific database? Regards,

Member Avatar for smantscheff
0
144
Member Avatar for learningcpp

Hi Guys, What is the scope of the exception variables when I catch them by reference. [CODE] try{ throw AnExceptionObect("Exception message"); } catch(AnExceptionObect &exp){ logger << exp.what(); //logger is a dummy object throw; //what will happend now? is it going to be throwen by value? and what if I catch …

Member Avatar for learningcpp
0
196
Member Avatar for IMJS

Hello, please can I have some clarification to check I am not doing something very stupid? It seems sensible with all that I have read, but I'm not confident. I suspect I have memory leaks and want to make sure some fundamentals are correct before I start looking deeper. My …

Member Avatar for mrnutty
0
172
Member Avatar for mklein

Dear all I am brand new to C# and have previously only written programs in Javascript, so go easy on me ! I have written an "app launcher" program which reads a text file line by line. Each line is just a path to a program e.g. C:\Users\Matt\Desktop\Gravity.exe So far, …

Member Avatar for mklein
0
198
Member Avatar for Jsplinter

I have a nested class declared as: [CODE]class A { class B { // members }; // members }; [/CODE] Is there a good way to avoid typing A::B every time I need to access B's members? I'd just like to do this in one .cpp file. I tried "using …

Member Avatar for Jsplinter
0
223
Member Avatar for techie1991

Even after looking at a lot of books, I am not able to understand the problem in the following code: [CODE] //1.c static int y=23; void abc(int a){ printf("%d\n",a); } [/CODE] [CODE] //2.c #include<stdio.h> #include "1.c" int main(){ abc(12); printf("\n"); printf("%d\n",y); return 0; } [/CODE] I can understand that the …

Member Avatar for techie1991
0
233
Member Avatar for Labdabeta

Is there any way to implement a scope change for the template keyword? I have a templated class with almost 100 different functions and my code looks disgusting with my external declarations. Is there any way to implement a scope increase for template? EG: [CODE]template <typename Type> class TypeClass { …

Member Avatar for Fbody
0
200
Member Avatar for dare599z

Hello all, I'm taking a intro computer science course, yet somehow I'm much better at c++ than python. My professor is essentially useless. Can anyone show me how to let these variables persist into global scope? I assumed declaring them globally would make them persist, yet it appears to not. …

Member Avatar for dare599z
0
183
Member Avatar for night2night3

Hi, I'm working on a linked list filled with class objects and I've encountered a weird problem that I cannot see how to resolve. I declare 2 self-referential pointers within my 2 classes and the error: In file included from prog2.cpp:16: employeedatalist.cpp: In function âvoid getData(std::fstream&)â: employeedatalist.cpp:15: error: âheadâ was …

Member Avatar for Sky Diploma
0
281
Member Avatar for QuesoTaco

Nevermind, I wanted to delete this post, but did not want to bother emailing the moderator. Sorry.

Member Avatar for QuesoTaco
0
327

The End.