Hello All, I have searched every forum and google etc but nothing directed me in right path. Requirement: I am using a COM object which can be initialized only once. But, when I try with webapi the first run goes fine and the rest fails as the COM object does not allow initialization for second time. With the below code, I notice that the new COMClass(); is being triggered everytime there is a GET request. Is there a way I can define the COMClass object to be executed only once and can be re-used by all the GET requests? namespace …

Member Avatar
Member Avatar
+0 forum 6

Hi, When I initialise then access the `g_spMyLog` shared pointer, from within the `CSingleton::CreateLog` member function, it works ok. Accessing the SP from the static member function of `CSingleton::Create()` causes an `access violation` in the original project and an abort in this sample project displayed below. In the original project I think the object is going out of scope somewhere but I don't know where. The factory function is created within a DLL as `return (static_cast<void*>(new CMyLog));` which is then `static_cast` to a `CMylog*` straight into a shared_ptr like this: `g_spMyLog.reset(static_cast<CMyLog*>(CreateVoidObj(is_Binary)));` but that's not included here. // File: CSingleton.h #pragma …

Member Avatar
Member Avatar
+0 forum 2

which include: Search demand User intent Competition Budget Timeframe Goals Profitability Scalability click here for details : http://searchenginewatch.com/article/2325344/8-Deciding-Factors-that-Influence-SEO-Keyword-Prioritization

Member Avatar
Member Avatar
-2 forum 2

Hello Guys, Please help me how to pass a variable to a multiple projects in VB.NET like on VB6. The variables are user ID, user Name, Server Name and server database. In VB6 it can be used on multiple projects while on VB.Net is I don't have any idea. I google'd on some samples but there is none like with what is done on VB6. Thank you. Junaks

Member Avatar
Member Avatar
+0 forum 1

Hi All, I want to get all the IPs of the A RECORDS for **mail.google.com**. The aim is to deny access to these IPs. I learnt that mail.google.com has several IPs. I did the following steps: 1. whois google.com 2. I got the following as its DOMAIN SERVERS: ns3.google.com ns2.google.com ns1.google.com ns4.google.com 3.# dig @ns1.google.com a mail.google.com ;; ANSWER SECTION: mail.google.com. 0 IN CNAME googlemail.l.google.com. googlemail.l.google.com. 300 IN A 74.125.233.86 googlemail.l.google.com. 300 IN A 74.125.233.85 I thought this would give me all the IPs. Currently, in an attempt to get the other IPs I am digging 4.2.2.2 & other free …

Member Avatar
Member Avatar
+0 forum 2

Hi I was taught not to use global variables and one of my friend is using global variable for database handle for his website... could you please explain if there is an issue if he uses global variable for database handle? he is using it to access database from anywhere in the application.. so he doesn't need to connect to db every time but surely if someone has access to this global variable they can wipe the data in the database... could someone please explain if it is possible for someone(hacker) to access global database handle variable and run queries …

Member Avatar
Member Avatar
+0 forum 1

I would like to have a file in my project which contains variables for use by all classes. I this possible to accomplish efficiently. I have heard that using a module with static varibles could work.

Member Avatar
Member Avatar
+0 forum 3

I'm having a bit of a problem with how to code something. Here is how it is in my head. I want a function which is not part of a class to access members of that class, so I want to make the class global. I have done this with other classes by the normal method of `extern Class instance;` In a global.h file and `Class Instance;` In a global.cpp file. The problem arises because the class instance needs to be instantiated after other data is made available globally after another non class function has logged into website, and returned …

Member Avatar
Member Avatar
+0 forum 3

I'm new to c# programming, and I am a little stuck on how to make a variable available across multiple forms. I read that i should make a public static class, however, my code is as follows: private void btnLogin_Click(object sender, EventArgs e) { accountNo = txtBoxAccntNo.Text; valid = validate(); //uses validate() method to check validity if (valid == true && accountNo == "11111111") { ManagerScreen Manager = new ManagerScreen(); this.Hide(); Manager.Show(); } else if (valid == true) { s customer = new s(); this.Hide(); customer.Show(); } else { if (count == 2) { this.Close(); } count += 1; txtBoxAccntNo.Clear(); …

Member Avatar
Member Avatar
+0 forum 6

Programe #1 inside file.h class File { public: static const int var = 9; }; inside main.cpp #include <iostream> #include "file.h" using namespace std; int main() { File f; cout << f.var; return 0; } Programe #2 inside file.h int Globalvar ; class File { public: static const int var = 9; }; inside main.cpp extern int GlobalVar; #include <iostream> #include "file.h" using namespace std; int main() { cout << GlobalVar; return 0 ; } Program#1 is running fine, but program#2 gives linker error: error LNK2005: "int GlobalVar" (?x@@3HA) already defined in file.obj I know the header files are never …

Member Avatar
Member Avatar
+0 forum 4

I have tons of files in this project as I am programming an ARM board. Making a tilt snake game where the snake is controlled by an accelerometer. I am using a timer interupt (handled by timer0.c) to toggle a boolean variable `extern bool toMakeFood;` stored in "includes.h" that tells "main.c" if food should be displayed or not. The problem I am having is that timer0.c throws a "no definition for toMakeFood" error while main.c has no problem. They both have the line #include "include.h" Heres the code although I have ommited irrelevant parts as like I said, this is …

Member Avatar
Member Avatar
+0 forum 4

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 itself doesn't throw any errors but it obviously doesn't work. I tried debugging by adding echo to each function to see what is being executed. I find only one executes. Code: (kinda long, sorry) <?php function get_soundex_query($str,$member) { $ss = sprintf("SELECT *, SOUNDEX('%s') AS src, SOUNDEX(%s) AS src2",$str,$member); $ss = …

Member Avatar
Member Avatar
+0 forum 15

hi, I am recently very curious to know how I can make a connection between two computers which are not in a local network. I googled a lot but there are always solutions for local IPs Now I know that I should make a server and a client to send and recieve , but the problem is global IP Is there anybody to give me a solution ? Thank you ;)

Member Avatar
Member Avatar
+0 forum 10

I am developing in WordPress plugins and I would like to know.if someone could guide Me with this issue. I would like to know what's the easier method.of declaring a global variable that I can use. As of now I am not using classes, mostly because i'm not sure how to just yet. I just have a bunch of functions. I am finding myself writing out the same SQL query in multiple functions. How can I store my database results one time in a variable that I can call like this : Global $results; Similar to how I call global …

Member Avatar
Member Avatar
+0 forum 3

hey all I've searched all over the web and i didn't get a solution! what should i do to take the text from the 'urlT' line edit? is there another way? Nameerror "global name 'self' is not defined" whats wrong with it? [CODE] from PyQt4 import QtCore, QtGui class Ui_MainWindow(object): def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.setWindowModality(QtCore.Qt.NonModal) MainWindow.resize(640, 483) MainWindow.setMinimumSize(QtCore.QSize(640, 483)) MainWindow.setMaximumSize(QtCore.QSize(640, 483)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/logo/welcome-logo.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) MainWindow.setWindowIcon(icon) MainWindow.setTabShape(QtGui.QTabWidget.Triangular) self.centralwidget = QtGui.QWidget(MainWindow) self.centralwidget.setObjectName("centralwidget") self.urlT = QtGui.QLineEdit(self.centralwidget) self.urlT.setEnabled(True) self.urlT.setGeometry(QtCore.QRect(10, 20, 521, 27)) self.urlT.setObjectName("urlT") self.checkurlB = QtGui.QPushButton(self.centralwidget) self.checkurlB.setGeometry(QtCore.QRect(540, 20, 91, 27)) self.checkurlB.setObjectName("checkurlB") QtCore.QObject.connect(self.checkurlB, QtCore.SIGNAL("clicked()"), checkurl()) QtCore.QMetaObject.connectSlotsByName(MainWindow) def checkurl(): import urllib2 url=str(self.urlT.text()) #the …

Member Avatar
Member Avatar
+0 forum 4

My site needs a way to know whether a user is an admin or not in multiple pages. So is it safe to store whether a user is an admin or not in session variable? Or is there a better alternative (Maybe another superglobal variable?), It will only hold a number.

Member Avatar
Member Avatar
+0 forum 3

I am new to python and cant figure out what I am doing wrong with the global variables. Here is an example of the problem I am having. number = 0 def test(): global number number = raw_input("Please type a number.") def prints(): global number if number2 != 1: print "Yes" else: print "NO!" test() prints() In this example it prints YES no matter what number I enter. Any suggestions?

Member Avatar
Member Avatar
+0 forum 2

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 question is what results could it be talking about? Is it possible to define global operators?

Member Avatar
Member Avatar
+0 forum 4

I am attempting to create a global temp table to be used between two sessions being called from a webservice. When I attempt to access the temp table from the second session it can not be found. The reason I am using a global temp table is because the initial session is created on a before event handler which calls the service and then from an after event handler. I have checked that the table is still available after the initial session closes, and I am still able toe query the data. Any help would be greatly appreciated! [CODE] public …

Member Avatar
Member Avatar
+0 forum 1

In the following code : [COde]#!/usr/bin/python # -*- coding: iso-8859-1 -*- import Tkinter import os import threading class Fil (threading.Thread): def __init__ (self): threading.Thread.__init__ (self) print "Init Fil" def f1 (self): print 'f1' #app().ecrit(1) class App(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) print "Init App" self.initialize() ping() def initialize(self): self.grid() self.bouton1L = Tkinter.Label(text="-", bg = "#00ffc0") self.bouton1L.grid(column=0, row=1) self.bouton2L = Tkinter.Label(text="-", bg = "#00ffc0") self.bouton2L.grid(column=1, row=1) self.x = Tkinter.Label(width=32) self.x.grid(column=0, row=2) def ecrit(self, num): if num == 1: self.bouton1L.configure(text="0") elif num == 2: self.bouton2L.configure(text="1") def ping(): for x in xrange ( 2 ): Fil().f1() app.bouton1L.reconfigure(text="A") # app not recognized # ------------------ if __name__ …

Member Avatar
Member Avatar
+0 forum 4

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
Member Avatar
+0 forum 3

[CODE]class Personaje(object): def __init__(self,vida,posicion,velocidad): vida = None posicion = None velocidad = None recibir_ataque = None def recibir_ataque(vida): recibir_ataque in range(1,100) vida - recibir_ataque print "La vida actual del personaje es de", vida, " Luego de haber recibido", recibir_ataque, " de dano" def excepcionVida(vida): if vida <= 0: print "El personaje ya esta muerto..." def moverPosicion(posicion,velocidad): if velocidad >= 1 and velocidad <= 5: print "Te quedas quieto,no puedes movilizarte" if velocidad >= 6: print "A donde deseas movilizarte?" posicion=input("Norte,Sur,Este u Oeste?"), posicion self.posicion=posicion posicion = ["Norte","Sur","Este","Oeste"][/CODE] [B]Hello! :) I'm having a little problem with this code i recently made …

Member Avatar
Member Avatar
+0 forum 1

I am new to python and am making a program with the wxpython module and no matter what I try I get a NameError: global name 'outp' is not defined?? Can someone help? Here is the code, it is fairly complex: [CODE]import wx class jake(wx.Frame): def func1(self,event): global foo foo+="1" global outp outp.append(1) outp=str(outp.strip("[").strip("]")) def func2(self,event): pass def func3(self,event): pass def func4(self,event): pass def func5(self,event): pass def func6(self,event): pass def func7(self,event): pass def func8(self,event): pass def func9(self,event): pass def func0(self,event): pass def decimalfunc(self,event): pass def infofunc(self,event): pass def withdraw(self,event): pass def deposit(self,event): pass def showbalance(self,event): pass def showstatus(self,event): pass def …

Member Avatar
Member Avatar
+0 forum 1

Im creating a time-base site wherein the timestamp should rely on the global time and not to my PC's time (because it can be out-dated somethimes). How can I do that?

Member Avatar
Member Avatar
+0 forum 8

Hello, 1. I have the following script: function selectThis(id){ var locationstring = "process.php?value=" + id; ///// locationstring += "&bs=" + $('#bs_' + id).attr("selectedIndex"); locationstring += "&ad=" + $('#ad_' + id).attr("selectedIndex"); locationstring += "&ns=" + $('#ns_' + id).attr("selectedIndex"); locationstring += "&wt=" + $('#wt_' + id).attr("selectedIndex"); locationstring += "&in=" + $('#in_' + id).attr("selectedIndex"); document.location.href = locationstring; } With it I am getting a string with the value of the clicked button from an array and some other select field values that are listed in the same set of mysql results as the clicked button. BUTTON: <input name="button" type="button" onclick="selectThis('<? echo $rows['id']; ?>');" …

Member Avatar
Member Avatar
+0 forum 2

ok so im making a windows forms application in microsoft visual C# 2010. this is how i got it to change form: [CODE]page_2 page2 = new page_2(); page2.Visible = true; this.Visible = false; page2.SetDesktopLocation(50, 50);[/CODE] the form its on is page_1 and its going to page_2. this works fine, the only problem is that all changes made to page_1 get removed and reset to default when using the same code to return from page_2. a friend of mine said to make page1 and page2 into global variables but i dont really know how to do that. i found another topic …

Member Avatar
Member Avatar
+0 forum 5

Hi all, I am hoping that the DaniWeb community might be willing to assist me in my research efforts. I am a researcher based in University College Cork (Ireland) and I am involved in a research study on the subject of software development in global virtual teams. As part of this study I am conducting a questionnaire. Coordination is often reported as being particularly challenging for global virtual teams engaged in software development. This questionnaire seeks to gather data relating to coordination issues in global virtual software development teams. As experienced practitioners in software development, I would very much welcome …

Member Avatar
Member Avatar
+0 forum 3

I am a total noob at php and I am creating a basic wordpress plugin for a site. I have a function [CODE]function My_Function_2() { ?> [/CODE] Then I have an input inside a div coming from an options page: [CODE]<form method="post" action="options.php"> <?php wp_nonce_field('update-options'); ?> Define Box height <table width="350"> <tr valign="top"> <th width="200" scope="row">Enter Box Height</th> <td width="50"> <input name="Box_height" type="text" id="Box_height" value="<?php echo get_option('Box_height'); ?>" /> (ex. 400)</td> </tr> </table>[/CODE] But when I try to $box_height to use in a url later on, it doesnt work. If I set box_height to a value using an array it …

Member Avatar
Member Avatar
+0 forum 9

Hello , I am stuck on this line of code [CODE]echo $hits[0];[/CODE] i am trying to get it to echo into a text box as an integar. at the moment the code [CODE]<?php $count_my_page = ("hitcounter.txt"); $hits = file($count_my_page); $hits[0] ++; $fp = fopen($count_my_page , "w"); fputs($fp , "$hits[0]"); fclose($fp); echo $hits[0]; ?>[/CODE] when run on [CODE]<?php include ("counter.php"); ?>[/CODE] just gives me a number I have been thinking along trying to get [CODE]<?php include ("counter.php"); ?><HTML><HEAD> </HEAD><BODY><INPUT value="ehco $hits" name="Hit counter"></BODY></HTML>[/CODE] to work , thanks.

Member Avatar
Member Avatar
+0 forum 2

[CODE]<?php include ("counter.php"); ?><HTML><HEAD><?php function sidney() { global $id; include 'counter.php'; } sidney(); echo "$id"; ?><META name=GENERATOR content="MSHTML 8.00.7600.16722"> </HEAD><BODY><INPUT value='[$id]' name="player number"></BODY></HTML>[/CODE] please can you explain why [$id] dos not echo a number ? thanks.

Member Avatar
Member Avatar
+0 forum 2

The End.