global

system crash after declaring global object of the class

hi, i am very new to c++. i am getting system crash (not compilation error) in doing following: i am declaring global pointer of class. BGiftConfigFile *bgiftConfig; class BGiftConfigFile : public EftBarclaysGiftConfig { } in this class i am reading tags from xml file. it is crashing system when this pointer is used to retrieve va...

Need help with android WebView

Hello, I am new to Android and java development. I create a WebView object in the OnCreate function. Now I need to be able to pass this same object to other functions in the code, such as the onOptionsItemSelected function. I currently have it where I just create a new WebView object in each function where I need it, but this slows down ...

In C++, how can I make typedefs visible to every file in my project?

I have a typedef typedef unsigned int my_type; used in a file. I would like to make it visible across all my files, without putting it in a header file included by everything. I don't want to go the header file route because as it stands this will be the only declaration in the header file (and it seems unnecessary to add a file just...

Global declarations are illegal in Verilog 2001 syntax!

I have written something small in verilog: `define LW 6'b100011 `define SW 6'b101011 parameter [3:0] i_fetch = 4'b0001, decode_rr = 4'b0010, mem_addr = 4'b0100, alu_exec = 4'b1000; and i am getting this error: Error: test.v(5): (vlog-2155) Global declarations are illegal in Verilog 2001 syntax. What I am doing wrong...

Create Global ASP.NET Function?

I think this is a pretty easy question...How do I make a asp.net function global? e.g. If I have a function GetUserInfo() defined on default.aspx how do I call this function from mypage2.aspx? ...

Python Django Global Variables

Hi all, I'm looking for simple but recommended way in Django to store a variable in memory only. When Apache restarts or the Django development server restarts, the variable is reset back to 0. More specifically, I want to count how many times a particular action takes place on each model instance (database record), but for performan...

Global variables in jQuery

I have been working on this script: <script type="text/javascript" src="/js/jquery.js"></script> <script type="text/javascript"> $(function(){ compentecy = $('#competency_id'); $('#add_competency').bind('click', function(e){ e.preventDefault(); $.post('/script.php', {competency_id: compentecy.val(), syllabus_id: ...

PHP 5.3 Namespaces should i use every PHP function with backslash?

Hi, im now using namespaces in PHP 5.3 now there is a fallback mechanism for functions which dont exist in the namespace. so php every time checks if the function exists in namespace and then tries to load it from global space. So what about all php internal functions? strstr for example? Should i now use every php internal function wit...

Passing variables in python when using from a import *

How can I make this print "baz" when I run b.py? a.py def foo(): global bar print bar b.py from a import * bar = "baz" foo() ...

Trouble with Unions in C program.

I am working on a C program that uses a Union. The union definition is in FILE_A header file and looks like this... // FILE_A.h**************************************************** xdata union { long position; char bytes[4]; }CurrentPosition; If I set the value of CurrentPosition.position in FILE_A.c and then call a function in FILE_...

gcc does not resolve extern global variables, with or without -c option

Hello everyone! So i have this issue : i am declaring some extern global variables in my C program. If I don't use the -c option for gcc, i get undefined references errors. But with that -c option, the linking is not done, which means that i don't have an executable generated. So how do I solve this? Here is my makefile (written thanks...

iphone global variables accessed from different views

Okay, so ultimately I want a program where the user can input simple data such as their name, date of birth, address, etc. and then have that information stay through multiple views. I am having the user input their information as UITextFields but their are multiple views that they are using to input the data. Is there a way that when ...

How to automatically set and attribute to controller

Maybe the question is not self-explanatory, so I will explain it through. The deal is: I got the variable $conn in the bootstrap class file. I'd like to make it global for every controller so that I just have to call $this->conn in the controller action scope in order to access the data inside. How would I do it? Thx ...

What's the best approach with global variables in ASP.Net applications?

For my global variables and data I find myself in a dilema as to whether to use HttpApplicationState or Static variables - What's the best approach? This document states that one should use static variables over httpapplicationstate: http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312607 However, one thing I like about HttpApp...

update global variable from a function in the javascript

Here is the situation: I have one function which has local variable. I would like to assign that value to global variable and us it's value in another function. Here is the code: global_var = "abc"; function loadpages() { local_var = "xyz"; global_var= local_var; } function show_global_var_value() { alert(global_var); }...

How can I see a variable defined in another php-file?

I use the same constant in all my php files. I do not want to assign the value of this variable in all my files. So, I wanted to create one "parameters.php" file and to do the assignment there. Then in all other files I include the "parameters.php" and use variables defined in the "parameters.php". It was the idea but it does not work. ...

PHP access class inside another class

So I have two classes like this: class foo { /* code here */ } $foo = new foo(); class bar { global $foo; public function bar () { echo $foo->something(); } } I want to access the methods of foo inside all methods bar, without declaring it in each method inside bar, like this: class bar { public function b...

Need advice on OOP philosophy

I'm trying to get the wheels turning on a large project in C#. My previous experience is in Delphi, where by default every form was created at applicaton startup and form references where held in (gasp) global variables. So I'm trying to adapt my thinking to a 100% object oriented environment, and my head is spinning just a little. My ...

Python How to make a cross-module function?

I want to be able to call a global function from an imported class, for example In file PetStore.py class AnimalSound(object): def __init__(self): if 'makenoise' in globals(): self.makenoise = globals()['makenoise'] else: self.makenoise = lambda: 'meow' def __str__(self): return self.makenoise...

Performance impact of calling HttpContext.GetGlobalResourceObject

Hi, I'm wondering what is the performance impact of constantly calling the following methods: HttpContext.GetGlobalResourceObject() HttpContext.GetLocalResourceObject() The current implementatino iterates through the list of strings and translates them by reading the values from the global resource files. On average there are 50-100 ...