Search Results

Search found 23079 results on 924 pages for 'local variables'.

Page 7/924 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Python - Get Instance Variables

    - by Chris Bunch
    Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code: class hi: def __init__(self): self.ii = "foo" self.kk = "bar" Is there a way for me to do this: >>> mystery_method(hi) ["ii", "kk"] Thanks guys! Edit: I originally had asked for class variables erroneously. Thanks to all who brought this to my attention!

    Read the article

  • Creating AST for shared and local variables

    - by Rizwan Abbasi
    Here is my grammar grammar simulator; options { language = Java; output = AST; ASTLabelType=CommonTree; } //imaginary tokens tokens{ SHARED; LOCALS; BOOL; RANGE; ARRAY; } parse : declaration+ ; declaration :variables ; variables : locals ; locals : (bool | range | array) ; bool :ID 'in' '[' ID ',' ID ']' ('init' ID)? -> ^(BOOL ID ID ID ID?) ; range : ID 'in' '[' INT '..' INT ']' ('init' INT)? -> ^(RANGE ID INT INT INT?) ; array :ID 'in' 'array' 'of' '[' INT '..' INT ']' ('init' INT)? -> ^(ARRAY ID INT INT INT?) ; ID : (('a'..'z' | 'A'..'Z'|'_')('a'..'z' | 'A'..'Z'|'0'..'9'|'_'))* ; INT : ('0'..'9')+ ; WHITESPACE : ('\t' | ' ' | '\r' | '\n' | '\u000C')+ {$channel = HIDDEN;} ; INPUT flag in [down, up] init down pc in [0..7] init 0 CA in array of [0..5] init 0 AST It is having a small problem. Variables (bool, range or array) can be of two abstract types 1. locals (each object will have it's own variable) 2. shared (think of static in java, same for all object) Now the requirements are changed. I want the user to input like this NEW INPUT domains: upDown [up,down] possibleStates [0-7] booleans [true,false] locals: pc in possibleStates init 0 flag in upDown init down flag1 in upDown init down map in array of booleans init false shared: pcs in possibleStates init 0 flag in upDown init down flag1 in upDown init down maps in array of booleans init false Again, all the variables can be of two types (of any domain sepecified) 1. Local 2. Shared In Domains: upDown [up,down] possibleStates [0-7] upDown, up, down and possibleStates are of type ID (ID is defined in my above grammar), 0 and 7 are of type INT Can any body help me how to convert my current grammar to meet new specifications.

    Read the article

  • xampp - can access control panel, cannot access projects/sites on local network

    - by Peter O.
    I've configured xampp and firewall so I can access desktop pc's localhost over my local network through desktop pc's IP. But I'm not able to access auctual projects: I can access: http://192.168.x.x/xampp or http://192.168.x.x/phpMyAdmin But I cannot access: http://192.168.x.x/myWebsite/ I get an error: Server error We're sorry! The server encountered an internal error and was unable to complete your request. Please try again later. error 500

    Read the article

  • Does it make a difference if I declare variables inside or outside a loop in Java?

    - by Puckl
    Does it make a difference if I declare variables inside or outside a loop in Java? Is this for(int i = 0; i < 1000; i++) { int temporaryValue = someMethod(); list.add(temporaryValue) } equal to this (with respect to memory usage)? int temporaryValue = 0; for(int i = 0; i < 1000; i++) { temporaryValue = someMethod(); list.add(temporaryValue) } And what if the temporary variable is for example an ArrayList? for(int i = 0; i < 1000; i++) { ArrayList<Integer> array = new ArrayList<Integer>(); fillArray(array); // do something with the array }

    Read the article

  • Java and dynamic variables

    - by Arvanem
    Hi folks, I am wondering whether it is possible to make dynamic variables in Java. In other words, variables that change depending on my instructions. FYI, I am making a trading program. A given merchant will have an array of items for sale for various prices. The dynamism I am calling for comes in because each category of items for sale has its own properties. For example, a book item has two properties: int pages, and boolean hardCover. In contrast, a bookmark item has one property, String pattern. Here are skeleton snippets of code so you can see what I am trying to do: public class Merchants extends /* certain parent class */ { // only 10 items for sale to begin with Stock[] itemsForSale = new Stock[10]; // Array holding Merchants public static Merchants[] merchantsArray = new Merchants[maxArrayLength]; // method to fill array of stock goes here } and public class Stock { int stockPrice; int stockQuantity; String stockType; // e.g. book and bookmark // Dynamic variables here, but they should only be invoked depending on stockType int pages; boolean hardCover; String pattern; }

    Read the article

  • Does Java have dynamic variables for class members?

    - by Arvanem
    Hi folks, I am wondering whether it is possible to make dynamic variables in Java. In other words, variables that change depending on my instructions. FYI, I am making a trading program. A given merchant will have an array of items for sale for various prices. The dynamism I am calling for comes in because each category of items for sale has its own properties. For example, a book item has two properties: int pages, and boolean hardCover. In contrast, a bookmark item has one property, String pattern. Here are skeleton snippets of code so you can see what I am trying to do: public class Merchants extends /* certain parent class */ { // only 10 items for sale to begin with Stock[] itemsForSale = new Stock[10]; // Array holding Merchants public static Merchants[] merchantsArray = new Merchants[maxArrayLength]; // method to fill array of stock goes here } and public class Stock { int stockPrice; int stockQuantity; String stockType; // e.g. book and bookmark // Dynamic variables here, but they should only be invoked depending on stockType int pages; boolean hardCover; String pattern; }

    Read the article

  • Basic Question on storing variables c# for use in other classes

    - by Calibre2010
    Ok guys I basically have a class which takes in 3 strings through the parameter of one of its method signatures. I've then tried to map these 3 strings to global variables as a way to store them. However, when I try to call these global variables from another class after instantiating this class they display as null values. this is the class which gets the 3 strings through the method setDate, and the mapping.. public class DateLogic { public string year1; public string month1; public string day1; public DateLogic() { } public void setDate(string year, string month, string day) { year1 = year; month1 = month; day1 = day; // getDate(); } public string getDate() { return year1 + " " + month1 + " " + day1; } } After this I try call this class from here public static string TimeLine2(this HtmlHelper helper, string myString2) { DateLogic g = new DateLogic(); string sday = g.day1; string smonth = g.month1; string syr = g.year1; } I've been debugging and the values make it all the way to the global variables but when called from this class here it doesnt show them, just shows null. Is this cause I'm creating a brand new instance, how do i resolve this?

    Read the article

  • persist values/variables from page to page

    - by Todd
    Hello, I'm wondering if there's another solution to my problem, that's considered more the Sharepoint way. FIrstly, my site is an Internet site, not Intranet. The problem is, all I'm trying to do is save values/variables from page to page in Sharepoint. I know the issue with Session Variables, but this seems to be the only way I can see to accomplish this. I know there are webparts that can store this value, but am I wrong in thinking this won't be persisted from page to page? Basically, I'll be extending the Content Query Web Part to dynamically filter it's results based off of a variable/value. The user chooses their 'area' from a dropdown, and the CQWP in the site will change and query results based off of this value (It will be a provincial structure as it is a Canadian site, so if someone chooses the province 'Ontario', this value is saved in a global variable, and these extended CQWP that are throughout the site, will get this value, and query lists flagged as Ontario). Is Session variables the only solution? Thanks everyone!

    Read the article

  • Question regarding the method local innerclasses accesing the local variables of the method

    - by flash
    Hi I was going through the SCJP book about the innerclasses, and found this statement, it goes something like this. "A method local class can only refer to the local variables which are marked final" and in the explanation the reason specified is about the scope and lifetime of the local class object and the local variables on the heap, But I am unable to understand that.am I missing anything here about 'final'??

    Read the article

  • How to send local mail via postfix to another server

    - by scotts
    I have postfix set up for use as an STMP server to send mail for my domain, but I receive email for the domain via gmail/google apps. The reason I use my own postfix is because I send out a lot of transactional emails to my customers using a web app, and the volume would exceed what google allows with its SMTP servers. Everything works fine, except cron & system mail gets routed to local users on the server, not to the appropriate accounts at google mail. How can I route this system mail to the respective google mail accounts instead?

    Read the article

  • what other bash variables are available during execution such as $USER that can assist on my script?

    - by semi-newbie
    This is related to question 19245, in that one of the responders answered the question in an awesome way, and very VERY clear to any newbie. Now here is a question that i can't seem to figure. i wrote a script for starting the vmware firefox plugin (don't worry. i gave that up and now run vBox VERY happily. i left vmware for my servers :) ) I needed to start the plugin as sudo, but i also needed to pass an argument (password) to it, that happen to be the same. So, if my password was Hello123, the command would be: sudo ./myscript.sh hi other Hello123 running from command line, the script would ask for my sudo password and then run. i wanted to capture THAT password and pass it as well. i also wanted to run graphically, so i tried gksudo, and there is an option -p that returns the password for variable assignment. well, that was a nightmare, because i would still get prompted for the original sudo: see below Find UserName vUser=$USER Find password (and hopefully enable sudo) vP=gksudo -p -D somedescriptiontext echo Execute command gksudo ./myscript.sh hi $vUser $vP and i still get prompted twice. so my question is tri-fold: is there a variable i can use for the password, just like there is one for user, $USER? is there a different way i should be assigning the value resulting of the command i have in $vP? i am wondering if executing the way i have it, does it in an uninitiated session and not the current one, since i am getting some addtl warning type errors on some variables blah blah i tried using Zenity to just capture the text, but then of course, i couldn't pass that value to sudo, so i could only use as a parameter, which puts me back in 2 prompts. Thanksssssssssss!

    Read the article

  • In Ruby are there any related applications of the syntax: class << self ... end

    - by pez_dispenser
    class << self attr_accessor :n, :totalX, :totalY end The syntax above is used for defining class instance variables. But when I think about what syntax implies, it doesn't make any sense to me, so I'm wondering if this type of syntax is used for any other types of definitions. My point of confusion here is this: class << self The append operator normally means "add what's on the right to the object on the left". But in the context of this block, how does that add up to "put the contents of this block into the definition of the class instance rather than the instance"? For the same reason I'm confused as to why in one context class << self can define class instance variables while in another it seems to create class variables such as here: class Point # Instance methods go here class << self # Class methods go here end end

    Read the article

  • C++ wrapper for C library

    - by Maximilien
    Hi, Recently I found a C library that I want to use in my C++ project. This code is configured with global variables and writes it's output to memory pointed by static pointers. When I execute my project I would like 2 instances of the C program to run: one with configuration A and one with configuration B. I can't afford to run my program twice, so I think there are 2 options: Make a C++ wrapper: The problem here is that the wrapper-class should contain all global/static variables the C library has. Since the functions in the C library use those variables I will have to create very big argument-lists for those functions. Copy-paste the C library: Here I'll have to adapt the name of every function and every variable inside the C library. Which one is the fastest solution? Are there other possibilities to run 2 instances of the same C source? Thanks, Max

    Read the article

  • How to remove MySQL completely with config and library files?

    - by codeartist
    I tried everything till now: sudo apt-get remove mysql-server mysql-client mysql-common sudo apt-get purge mysql-server mysql-client mysql-common sudo apt-get autoremove and even more commands... But whenever I am trying to locate mysql. I get a no. of files related to mysql command: shell>> locate mysql Output: /etc/mysql /etc/apparmor.d/usr.sbin.mysqld /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/apparmor.d/cache/usr.sbin.mysqld-akonadi /etc/apparmor.d/local/usr.sbin.mysqld /etc/bash_completion.d/mysqladmin /etc/init/mysql.conf /etc/logcheck/ignore.d.paranoid/mysql-server-5_5 /etc/logcheck/ignore.d.server/mysql-server-5_5 /etc/logcheck/ignore.d.workstation/mysql-server-5_5 /etc/logrotate.d/mysql-server /etc/mysql/conf.d /etc/mysql/debian-start /etc/mysql/debian.cnf /etc/mysql/conf.d/mysqld_safe_syslog.cnf /home/pkr/.mysql_history /home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,libqt4-sql-mysql,,349051c3a57da571aa832adb39177aff /home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,cbf77a486cdc80547317981a33144427 /home/pkr/.cache/software-center/piston-helper/rec.ubuntu.com,api,1.0,recommend_app,mysql-client,,de8220dee4d957a9502caa79e8d2fdda /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,libqt4-sql-mysql,page,1,helpful,,17fb2e657321dc51526ee8fe9928da30 /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,any,any,any,mysql-client,page,1,helpful,,a4c1b6e8200f36ab5745c6f81f14da0a /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,libqt4-sql-mysql,page,1,helpful,,c54295fb82b8183350cd34f22c3547ef /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,oneiric,any,mysql-client,page,1,helpful,,fcf201c1abff3f774af89173a84de2cc /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,libqt4-sql-mysql,page,1,helpful,,0cd86648584efeccfb16119012f89540 /home/pkr/.cache/software-center/rnrclient/reviews.ubuntu.com,reviews,api,1.0,reviews,filter,en,ubuntu,precise,any,mysql-client,page,1,helpful,,eb84724e9da7851ff8862a227d8bac59 /home/pkr/.local/share/akonadi/mysql.conf /home/pkr/.local/share/akonadi/db_data/mysql /home/pkr/.local/share/akonadi/db_data/mysql.err /home/pkr/.local/share/akonadi/db_data/mysql.err.old /home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYD /home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.MYI /home/pkr/.local/share/akonadi/db_data/mysql/columns_priv.frm /home/pkr/.local/share/akonadi/db_data/mysql/db.MYD /home/pkr/.local/share/akonadi/db_data/mysql/db.MYI /home/pkr/.local/share/akonadi/db_data/mysql/db.frm /home/pkr/.local/share/akonadi/db_data/mysql/event.MYD /home/pkr/.local/share/akonadi/db_data/mysql/event.MYI /home/pkr/.local/share/akonadi/db_data/mysql/event.frm /home/pkr/.local/share/akonadi/db_data/mysql/func.MYD /home/pkr/.local/share/akonadi/db_data/mysql/func.MYI /home/pkr/.local/share/akonadi/db_data/mysql/func.frm /home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSM /home/pkr/.local/share/akonadi/db_data/mysql/general_log.CSV /home/pkr/.local/share/akonadi/db_data/mysql/general_log.frm /home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYD /home/pkr/.local/share/akonadi/db_data/mysql/help_category.MYI /home/pkr/.local/share/akonadi/db_data/mysql/help_category.frm /home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYD /home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.MYI /home/pkr/.local/share/akonadi/db_data/mysql/help_keyword.frm /home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYD /home/pkr/.local/share/akonadi/db_data/mysql/help_relation.MYI /home/pkr/.local/share/akonadi/db_data/mysql/help_relation.frm /home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYD /home/pkr/.local/share/akonadi/db_data/mysql/help_topic.MYI /home/pkr/.local/share/akonadi/db_data/mysql/help_topic.frm /home/pkr/.local/share/akonadi/db_data/mysql/host.MYD /home/pkr/.local/share/akonadi/db_data/mysql/host.MYI /home/pkr/.local/share/akonadi/db_data/mysql/host.frm /home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYD /home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.MYI /home/pkr/.local/share/akonadi/db_data/mysql/ndb_binlog_index.frm /home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYD /home/pkr/.local/share/akonadi/db_data/mysql/plugin.MYI /home/pkr/.local/share/akonadi/db_data/mysql/plugin.frm /home/pkr/.local/share/akonadi/db_data/mysql/proc.MYD /home/pkr/.local/share/akonadi/db_data/mysql/proc.MYI /home/pkr/.local/share/akonadi/db_data/mysql/proc.frm /home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYD /home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.MYI /home/pkr/.local/share/akonadi/db_data/mysql/procs_priv.frm /home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYD /home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.MYI /home/pkr/.local/share/akonadi/db_data/mysql/proxies_priv.frm /home/pkr/.local/share/akonadi/db_data/mysql/servers.MYD /home/pkr/.local/share/akonadi/db_data/mysql/servers.MYI /home/pkr/.local/share/akonadi/db_data/mysql/servers.frm /home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSM /home/pkr/.local/share/akonadi/db_data/mysql/slow_log.CSV /home/pkr/.local/share/akonadi/db_data/mysql/slow_log.frm /home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYD /home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.MYI /home/pkr/.local/share/akonadi/db_data/mysql/tables_priv.frm /home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYD /home/pkr/.local/share/akonadi/db_data/mysql/time_zone.MYI /home/pkr/.local/share/akonadi/db_data/mysql/time_zone.frm /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYD /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.MYI /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_leap_second.frm /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYD /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.MYI /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_name.frm /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYD /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.MYI /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition.frm /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYD /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.MYI /home/pkr/.local/share/akonadi/db_data/mysql/time_zone_transition_type.frm /home/pkr/.local/share/akonadi/db_data/mysql/user.MYD /home/pkr/.local/share/akonadi/db_data/mysql/user.MYI /home/pkr/.local/share/akonadi/db_data/mysql/user.frm /usr/bin/mysql /usr/bin/mysql_install_db /usr/bin/mysql_upgrade /usr/bin/mysqlcheck /usr/sbin/mysqld /usr/share/mysql /usr/share/app-install/desktop/gmysqlcc:gmysqlcc.desktop /usr/share/app-install/desktop/mysql-client.desktop /usr/share/app-install/desktop/mysql-navigator:mysql-navigator.desktop /usr/share/app-install/desktop/mysql-server.desktop /usr/share/app-install/icons/gmysqlcc-32.png /usr/share/app-install/icons/mysql-navigator.png /usr/share/doc/mysql-client-core-5.5 /usr/share/doc/mysql-server-core-5.5 /usr/share/kde4/apps/katepart/syntax/sql-mysql.xml /usr/share/man/man1/mysql.1.gz /usr/share/man/man1/mysql_install_db.1.gz /usr/share/man/man1/mysql_upgrade.1.gz /usr/share/man/man1/mysqlcheck.1.gz /usr/share/man/man8/mysqld.8.gz /var/cache/apt/archives/akonadi-backend-mysql_1.7.2-0ubuntu1_all.deb /var/cache/apt/archives/libmysqlclient-dev_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/libmysqlclient18_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/libqt4-sql-mysql_4%3a4.8.1-0ubuntu4.1_i386.deb /var/cache/apt/archives/mysql-client-5.5_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/mysql-client-core-5.5_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/mysql-client_5.5.22-0ubuntu1_all.deb /var/cache/apt/archives/mysql-common_5.5.22-0ubuntu1_all.deb /var/cache/apt/archives/mysql-server-5.5_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/mysql-server-core-5.5_5.5.22-0ubuntu1_i386.deb /var/cache/apt/archives/mysql-server_5.5.22-0ubuntu1_all.deb /var/lib/dpkg/info/mysql-client-core-5.5.list /var/lib/dpkg/info/mysql-client-core-5.5.md5sums /var/lib/dpkg/info/mysql-server-5.5.list /var/lib/dpkg/info/mysql-server-5.5.postrm /var/lib/dpkg/info/mysql-server-core-5.5.list /var/lib/dpkg/info/mysql-server-core-5.5.md5sums /var/log/mysql /var/log/mysql.err /var/log/mysql.log /var/log/mysql.log.1.gz /var/log/mysql.log.2.gz /var/log/mysql.log.3.gz /var/log/mysql.log.4.gz /var/log/mysql.log.5.gz /var/log/mysql.log.6.gz /var/log/mysql.log.7.gz /var/log/upstart/mysql.log.1.gz /var/log/upstart/mysql.log.2.gz /var/log/upstart/mysql.log.3.gz /var/log/upstart/mysql.log.4.gz /var/log/upstart/mysql.log.5.gz /var/log/upstart/mysql.log.6.gz /var/log/upstart/mysql.log.7.gz What should I do now? Please help me out in this :( I was trying to find out if there is any way I can remove mysql related every file and then reinstall mysql. I need it for Qt connectivity. I don't understand what to do! Please help :(

    Read the article

  • Seeking enlightenment - global variables in AppEngine (aeoid.get_current_user())

    - by jerd
    Hello This may be a 'Python Web Programming 101' question, but I'm confused about some code in the aeoid project (http://github.com/Arachnid/aeoid). here's the code: _current_user = None def get_current_user(): """Returns the currently logged in user, or None if no user is logged in.""" global _current_user if not _current_user and 'aeoid.user' in os.environ: _current_user = User(None, _from_model_key=os.environ['aeoid.user']) return _current_user But my understanding was that global variables were, ehm, global! And so different requests from different users could (potentially) access and update the same value, hence the need for sessions, in order to store per-user, non-global variables. So, in the code above, what prevents one request from believing the current user is the user set by another request? Sorry if this is basic, it's just not how i thought things worked. Thanks

    Read the article

  • Variables versus constants versus associative arrays in PHP

    - by susmits
    I'm working on a small project, and need to implement internationalization support somehow. I am thinking along the lines of using constants to define a lot of symbols for text in one file, which could be included subsequently. However, I'm not sure if using variables is faster, or if I can get away with using associative arrays without too much of a performance hit. What's better for defining constant values in PHP, performance-wise -- constants defined using define("FOO", "..."), or simple variables like $foo = "...", or associative arrays like $symbols["FOO"]?

    Read the article

  • Passing Flash variables to PHP.

    - by user340553
    Hi, I have a simple standalone application written in Visual Basic that I'm porting to a browser based application using PHP/javascript. The original VB application has some simple embedded flash games with token and point counters. The token and point values are being passed as variables between the application and the game. I'm trying to achieve the same effect in my PHP port without modifying the actionscript code( using the variables in actionscript that already exist). Below is Visual Basic code that's loading a value from a database and posting that value to flash using FlashVars: Private Sub loadPlayer() Try If CtblPoints.CheckPointsByID(mCard) Then objPoints = CtblPoints.GettblPointsByID(mCard) objPlayerAc = CtblPlayerAccount.GettblPlayerAccountByPlayerID(objPoints.AccountId) objPlayer = CtblPlayer.GettblPlayerByID(objPlayerAc.PlayerID) objPlayerBal = CtblPlayerBalance.GettblPlayerBalanceByID(objPlayerAc.PlayerID) objPlayerAcDetail = CtblPlayerAccountDetail.GettblPlayerAccountDetailByAmount(objPoints.AccountId) strTotalPoints = Convert.ToString(objPlayerAc.Points) strTotalWin = Convert.ToString(objPlayerBal.TokenAmount) 'Dim intTokenAmount As Decimal = Convert.ToDecimal(objPlayerBal.TokenAmount) 'strTotalWin = Convert.ToString(Convert.ToInt64(intTokenAmount * 100)) flashPlayer.Size = panelGame.Size flashPlayer.FlashVars = "totalEntries=" & strTotalPoints & "&credit=" & strTotalWin flashPlayer.LoadMovie(0, strGameFile) flashPlayer.Play() Else Me.Close() Dim frmInvCrd As New frmInvalidCard frmInvCrd.ShowDialog() End If Catch ex As Exception End Try I'm trying to recreate this in PHP, but I'm at a loss as to how to begin implementing it. The variables in flash are declared publicly, and global imports used: import com.atticmedia.console.*; import flash.display.*; import flash.events.*; import flash.geom.*; import flash.media.*; import flash.net.*; import flash.system.*; import flash.utils.*; First declaration of variable 'totalEntries' is: public var totalEntries:int = 0; and this is a snip of totalEntries being used in the actionscript public function notifyServerOfUnwonCredits(param1) { var remainder:* = param1; if (this.useServer) { this.targetWinAmount = 0; this.cancelUpdateOverTime = F9.setEnterFrame(this.updateOverTime); fscommand("OverTime", "" + remainder); this.flashVarsUpdatedAction = function () { originalTotalWin = totalWin; return; }// end function ; } else { this.setTotalEntries(100000); this.setTotalWin(0); } return; }// end function Eventually I'll be passing these values back to a mySQL database. Any insight into this would be extremely helpful, Thanks!

    Read the article

  • Defining Makefiles variables from a script

    - by Freddy
    I am creating a Makefile which I want it to be a single file for different architectures, OSes, libraries, etc. To do this I have a build specific XML file which defines the different configuration options for each architecture. The config file is read by Perl (it could be any language) and the Perl output returns something like: var1 := var1_value var2 := var2_value var3 := var3_value What I am trying to do is define this variables in my Makefile. From the makefile I am calling my readconfig script and it is giving the correct output, but I have not been able to get this variables as part of my Makefile. I have tried the use of eval and value, but none of them have work (although it could be an issue of me not knowing how to use them. In overall what I am trying to do is something like: read_config: $(eval (perl '-require "readConfig.pl"')) @echo $(var1) It could be assumed I am using only GNU Make behavior. Things I could not change: Config file is on XML Using Perl as a XML parser

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >