Search Results

Search found 15797 results on 632 pages for 'session variables'.

Page 62/632 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • Permanently write variables to a php file with php

    - by Oliver
    I need to be able to permanently change variables in a php file using php. I am creating a multilanguage site using codeigniter and using the language helper which stores the text in php files in variables in this format: $lang['title'] = "Stuff"; I've been able to access the plain text of the files using fopen() etc and I it seems that I could probably locate the areas I want to edit with with regular expressions and rewrite the file once I've made the changes but it seems a bit hacky. Is there any easy way to edit these variables permanently using php? Cheers

    Read the article

  • add several variables to dataframe, based on vector

    - by Andreas
    I am sure this is easy - but I can't figure it out right now. Basically: I have a long vector of variables: names <- c("first","second", "third") I have some data, and I now need to add the variables. I could do: data$first <- NA But since I have a long list, and I would like an automated solution. This doesn't work. for (i in 1:length(names)) (paste("data$", names[i],sep="") <- NA) The reason I want this, is that I need to vertically merge to dataframes, where one doesn't have all the variables it should have. Thanks in advance

    Read the article

  • set and get variables throughout moive - actionscript 3

    - by ed209
    I need to set various variables depending on what a user clicks. Those variables then need to be accessed by other movieclips. The problem is that at the time of clicking, those "other movieclips" don't exist on the timeline yet. What I have done is assign the variable to the parent movieclip, although I guess I could just as easily set them to the root. Then I would grab that value when the relevant clip is initiated. // set - works MovieClip(parent).aMovieClip.someVariable = myVal; // get? - doesn't work getVar = MovieClip(parent).aMovieClip.someVariable; the above doesn't work - what is the correct way to get that value whenever I need it. I guess it's a case of getting and setting global variables

    Read the article

  • How can I collapse a dataframe by some variables, taking mean across others

    - by Alex Holcombe
    I need to summarize a data frame by some variables, ignoring the others. This is sometimes referred to as collapsing. E.g. if I have a dataframe like this: Widget Type Energy egg 1 20 egg 2 30 jap 3 50 jap 1 60 Then collapsing by Widget, with Energy the dependent variable, Energy~Widget, would yield Widget Energy egg 25 jap 55 In Excel the closest functionality might be "Pivot tables" and I've worked out how to do it in python (http://alexholcombe.wordpress.com/2009/01/26/summarizing-data-by-combinations-of-variables-with-python/), and here's an example with R using doBy library to do something very related (http://www.mail-archive.com/[email protected]/msg02643.html), but is there an easy way to do the above? And even better is there anything built into the ggplot2 library to create plots that collapse across some variables?

    Read the article

  • External Javascript file fails to receive variables from previous javascript block

    - by Franc
    I've been searching the net for several hours and can't find an answer in the whole "external js file"-jungle. I hope you guys can help! In short: My external javascript file doesn't seem to get the variables which I defined in the main.php file.. On main.php I define php variables and "transform" them into javascript variables <head>... <script type="text/javascript"> var phpmain_img = <?php echo json_encode($main_img); ?>; var phpvar1_large = <?php echo json_encode($var1_large); ?>; var phpvar2_large = <?php echo json_encode($var2_large); ?>; var phpvar3_large = <?php echo json_encode($var3_large); ?>; var phpvar4_large = <?php echo json_encode($var4_large); ?>; </script> ... <script language="javascript" type="text/javascript" src="/wshop/ext.js"></script> </head> In my ext.js file I want to process those variables. In the ext.js file I defined a the function swapImage() that will be used back in the main PHP: var imgArray = new Array( phpmain_img, phpvar1_large, phpvar2_large, phpvar3_large ); function swapImage(imgID) { var theImage = document.getElementById('theImage'); var newImg; newImg = imgArray[imgID]; theImage.src = newImg; } function preloadImages() { for(var i = 0; i < imgArray.length; i++) { var tmpImg = new Image; tmpImg.src = imgArray[i]; } } Result: The swapImage() in the main.php... doesnt work <div id="image"> <img id="theImage" src="<?=$main_img; ?>" alt="" /> </div> <div id="thumbs"> <?php echo "<img src=\"<$main_img_small\" alt=\"\" onmouseover=\"swapImage(0);\">"; echo "<img src=\"$var1_small\" alt=\"\" onmouseover=\"swapImage(1);\">"; echo "<img src=\"$var2_small\" alt=\"\" onmouseover=\"swapImage(2);\">"; echo "<img src=\"$var3_small\" alt=\"\" onmouseover=\"swapImage(3);\">"; ?> <br /> </div> Any help is greatly appreciated! UPDATE: I don't get a specific error, the swapImage functions doesn't work at mouseover. However, I tried to output the variables with e.g. document.write(phpimg_main) but nothing appears which makes me believe that there's something wrong with the handing over of the variables... here's the source code browser output `<html> <head> <link href="../demo.css" rel="stylesheet" type="text/css" /> <style type="text/css"> .... </style> <script type="text/javascript"> var phpmain_img = {"0":"http:\/\/path\/to\/main\/image.jpg"}; var phpvar1_large = {"0":"http:\/\/path\/to\/image1.jpg"}; var phpvar2_large = {"0":"http:\/\/path\/to\/image2.jpg"}; var phpvar3_large = null; var phpvar4_large = null; </script> <script language="javascript" type="text/javascript" src="/wshop/ext.js"></script> </head> <body onload="preloadImages()"> <div id="image"> <img id="theImage" src="http://path-to-main-image.jpg" alt="" /> </div> <div id="thumbs"> <img src="http://path-to-main-image.jpg" alt="" onmouseover="swapImage(0);"><img src="http://path-to-image1.jpg" alt="" onmouseover="swapImage(1);"><img src="http://path-to-image2.jpg" alt="" onmouseover="swapImage(2);"> <br /> </div> </body> `

    Read the article

  • Get all variables of javascript in JAVA

    - by Parhs
    Hello... I am using rhino and Scripting for the Java Platform in order to allow the user extend my application. However the user can write some cases eg (ASTO.value>440) || (ASTO.bellowNormal) etc... The problem is that before running the script from my JAVA application using ScriptEngine i want to get the names of all the variables! Because i should know which variables are required for the script to run... I know that a regular expression would do the job but i amnt sure... Please i somebody could help me figure out the java regexp to get the variables i would really appriciate it..

    Read the article

  • Assign RegEx submatches to variables or map (C++/C)

    - by Michael
    I need to extract the SAME type of information (e.g. First name, Last Name, Telephone, ...), from numerous different text sources (each with a different format & different order of the variables of interest). I want a function that does the extraction based on a regular expression and returns the result as DESCRIPTIVE variables. In other words, instead of returning each match result as submatch[0], submatch[1], submatch[2], ..., have it do EITHER of the following: 1.) return std::map so that the submatches can be accessed via: submatch["first_name"], submatch["last_name"], submatch["telephone"] 2.) return a variables with the submatches so that the submatches can be accessed via: submatch_first_name, submatch_last_name, submatch_telephone I can write a wrapper class around boost::regex to do #1, but I was hoping there would be a built-in or a more elegant way to do this in C++/Boost/STL/C.

    Read the article

  • Difference between local and instance variables in ruby

    - by fflyer05
    I am working on a script that creates several fairly complex nested hash datastructures and then iterates through them conditionally creating database records. This is a standalone script using active record. After several minutes of running I noticed a significant lag in server responsiveness and discovered that the script, while being set to be nice +19, was enjoying a steady %85 - %90 total server memory. In this case I am using instance variables simply for readability. It helps knowing what is going to be re-used outside of the loop vs. what won't. Is there a reason to not use instance variables when they are not needed? Are there differences in memory allocation and management between local and instance variables? Would it help setting @variable = nil when its no longer needed?

    Read the article

  • Saving variables (not sessions)

    - by james.bcn
    This may be a silly question, but how do I save variables that are not specific to a particular session. An simple example of why you might want to do this would be a visitor counter - a number that increases by one each time someone visits a web page (note - I'm not actually doing that, my application is different, but that is the functionality I need). The only ways I can think of doing this are either writing the variables to a file, or putting the variables into a database. Both seem a bit inelegant. Is there a better way to to this kind of thing?

    Read the article

  • puppet variables

    - by Joey Bagodonuts
    I am trying to use variables in my modules manifest.pp with little luck class mysoftware($version="dev-2011.02.04b") { File { links => follow } file { "/opt/mysoftware": ensure => directory } file { "/opt/mysoftware/share": source => "puppet://puppet/mysoftware/air/$version", recurse => "true", } } This does not seem to be working when I assign this to a node via the nodes.pp file. I am running puppetmaster 2.6.4 puppetd clients are 0.25

    Read the article

  • how do i set c-shell environment variables in tcsh shell script

    - by rambokayambo
    i am trying to set the environment variables in tcsh shell and it is not working. This is the syntax that i am using currently setenv MYSQL_HOME=/opt/mysql/mysql/bin my other question is i have a c-shell script that i am editing. Is setenv the same as a regular set MYSQL=${MYSQL_HOME}/bin/sqlplus? set MYSQL_HOME=/opt/mysql/mysql/bin or should i just set the MYSQL_HOME to where the mysql executable is ?

    Read the article

  • Rsync with a list of variables

    - by EMKA
    I am trying to write a bash script that will rsync only a specific subset of folders. I am trying to figure out a more slick so that I can just add a variables such as FOLDER1='name of folder in home directory' and then rsync -arvz --delete /home/emka/$FOLDER1/ /home/emka/Desktop/Mount/$FOLDER1 Currently I have FOLDER1 through FOLDER13, but I do not want to have the above line thirteen times. Could someone give me a push on how to do this?

    Read the article

  • Spring / Hibernate / JUnit - No Hibernate Session bound to Thread

    - by Marty Pitt
    Hi I'm trying to access the current hibernate session in a test case, and getting the following error: org.hibernate.HibernateException: No Hibernate Session bound to thread, and configuration does not allow creation of non-transactional one here at org.springframework.orm.hibernate3.SpringSessionContext.currentSession(SpringSessionContext.java:63) at org.hibernate.impl.SessionFactoryImpl.getCurrentSession(SessionFactoryImpl.java:574) I've clearly missed some sort of setup, but not sure what. Any help would be greatly appreciated. This is my first crack at Hibernate / Spring etc, and the learning curve is certainly steep! Regards Marty Code follows: The offending class: public class DbUnitUtil extends BaseDALTest { @Test public void exportDtd() throws Exception { Session session = sessionFactory.getCurrentSession(); session.beginTransaction(); Connection hsqldbConnection = session.connection(); IDatabaseConnection connection = new DatabaseConnection(hsqldbConnection); // write DTD file FlatDtdDataSet.write(connection.createDataSet(), new FileOutputStream("test.dtd")); } } Base class: @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations={"classpath:applicationContext.xml"}) public class BaseDALTest extends AbstractJUnit4SpringContextTests { public BaseDALTest() { super(); } @Resource protected SessionFactory sessionFactory; } applicationContext.xml: <?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName"> <value>org.hsqldb.jdbcDriver</value> </property> <property name="url"> <value>jdbc:hsqldb:mem:sample</value> </property> <property name="username"> <value>sa</value> </property> <property name="password"> <value></value> </property> </bean> <bean id="sessionFactory" class="com.foo.spring.AutoAnnotationSessionFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="entityPackages"> <list> <value>com.sample.model</value> </list> </property> <property name="schemaUpdate"> <value>true</value> </property> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.HSQLDialect </prop> <prop key="hibernate.show_sql">true</prop> </props> </property> </bean> </beans>

    Read the article

  • Oracle Enterprise Manager 12c Anniversary at Open World General Session and Twitter Chat using #em12c on October 2nd

    - by Anand Akela
    As most of you will remember, Oracle Enterprise Manager 12c was announced last year at Open World. We are celebrating first anniversary of Oracle Enterprise Manager 12c next week at Open world. During the last year, Oracle customers have seen the benefits of federated self-service access to complete application stacks, elastic scalability, automated metering, and charge-back from capabilities of Oracle Enterprise manager 12c. In this session you will learn how customers are leveraging Oracle Enterprise Manager 12c to build and operate their enterprise cloud. You will also hear about Oracle’s IT management strategy and some new capabilities inside the Oracle Enterprise Manager product family. In this anniversary general session of Oracle Enterprise Manager 12c, you will also watch an interactive role play ( similar to what some of you may have seen at "Zero to Cloud" sessions at the Oracle Cloud Builder Summit ) depicting a fictional company in the throes of deploying a private cloud. Watch as the CIO and his key cloud architects battle with misconceptions about enterprise cloud computing and watch how Oracle Enterprise Manager helps them address the key challenges of planning, deploying and managing an enterprise private cloud. The session will be led by Sushil Kumar, Vice President, Product Strategy and Business Development, Oracle Enterprise Manager. Jeff Budge, Director, Global Oracle Technology Practice, CSC Consulting, Inc. will join Sushil for the general session as well. Following the general session, Sushil Kumar ( Twitter user name @sxkumar ) will join us for a Twitter Chat on Tuesday at 1:00 PM to 2:00 PM.  Sushil will answer any follow-up questions from the general session or any question related to Oracle Enterprise Manager and Oracle Private Cloud . You can participate in the chat using hash tag #em12c on Twitter.com or by going to  tweetchat.com/room/em12c (Needs Twitter credential for participating).  You could pre-submit your questions for Sushil using any of the social media channels mentioned below. Stay Connected: Twitter |  Face book |  You Tube |  Linked in |  Newsletter

    Read the article

  • How to fix a NHibernate lazy loading error "no session or session was closed"?

    - by MCardinale
    I'm developing a website with ASP.NET MVC, NHibernate and Fluent Hibernate and getting the error "no session or session was closed" when I try to access a child object. These are my domain classes: public class ImageGallery { public virtual int Id { get; set; } public virtual string Title { get; set; } public virtual IList<Image> Images { get; set; } } public class Image { public virtual int Id { get; set; } public virtual ImageGallery ImageGallery { get; set; } public virtual string File { get; set; } } These are my maps: public class ImageGalleryMap:ClassMap<ImageGallery> { public ImageGalleryMap() { Id(x => x.Id); Map(x => x.Title); HasMany(x => x.Images); } } public class ImageMap:ClassMap<Image> { public ImageMap() { Id(x => x.Id); References(x => x.ImageGallery); Map(x => x.File); } } And this is my Session Factory helper class: public class NHibernateSessionFactory { private static ISessionFactory _sessionFactory; private static ISessionFactory SessionFactory { get { if(_sessionFactory == null) { _sessionFactory = Fluently.Configure() .Database(MySQLConfiguration.Standard.ConnectionString(MyConnString)) .Mappings(m => m.FluentMappings.AddFromAssemblyOf<ImageGalleryMap>()) .ExposeConfiguration(c => c.Properties.Add("hbm2ddl.keywords", "none")) .BuildSessionFactory(); } return _sessionFactory; } } public static ISession OpenSession() { return SessionFactory.OpenSession(); } } Everything works fine, when I get ImageGallery from database using this code: IImageGalleryRepository igr = new ImageGalleryRepository(); ImageGallery ig = igr.GetById(1); But, when I try to access the Image child object with this code string imageFile = ig.Images[1].File; I get this error: Initializing[Entities.ImageGallery#1]-failed to lazily initialize a collection of role: Entities.ImageGallery.Images, no session or session was closed Someone know how can I fix this? Thank you very much!

    Read the article

  • ASP Classic Session Variable Not Always Getting Set

    - by Mike at KBS
    I have a classic ASP site I'm maintaining and recently we wanted to do special rendering actions if the visitor was coming from one specific set of websites. So in the page where those visitors have to come through to get to our site, I put a simple line setting a session variable: <!-- #include virtual="/clsdbAccess.cs"--> <% set db = new dbAccess %> <html> <head> ... <script language="javascript" type="text/javascript"> ... </script> </head> <body> <% Session("CAME_FROM_NEWSPAPER") = "your local newspaper" ... %> ... html stuff ... </body> </html> Then, in all the following pages, whenever I need to put up nav links, menus, etc., that we don't want to show to those visitors, I test for if that session variable is "" or not, then render accordingly. My problem is that it seems to work great for me in development, then I get it out into Production and it works great sometimes, and other times it doesn't work at all. Sometimes the session variable gets set, sometimes it doesn't. Everything else works great. But our client is seeing inconsistent results on pages rendered to their visitors and this is a problem. I've tried logging on from different PC's and I confirm that I get different, and unpredictable, results. The problem is I can't reproduce it at will, and I can't troubleshoot/trace Production. For now I've solved this by just creating duplicate pages with the special rendering, and making sure those visitors go there. But this is a hack and will eventually be difficult to maintain. Is there something special or inconsistent about session variables in Classic ASP? Is there a better way to approach the problem? TIA.

    Read the article

  • SMTP 552 4.3.1 Session size exceeds fixed maximum session size.

    - by JL
    I'm having a frustrating problem with one of our clients who is running an exchange SMTP server. I have an emailing component that is written in .net and I've specifically used Mono DLL's to ensure that the email component sends the ELO and QUIT command for each message it sends. Each mail I send will never exceed 10MB's including attachments, which is lower than the session size value set in the clients exchange configuration. Still the problem persists. Any ideas where to look?

    Read the article

  • How can I detect upload success/failure in a scripted command-line SFTP session

    - by pkpk
    how can I detect success/failure sftp Batch script on Windows OS? I use %errorlevel% to detect success/failure, sometime the %errorlevel% be returned by 0, but that session is fail and the file is not upload to the server. my script is below how can I detect sftp uploaded correctly? THX so much @echo off (echo cd %4 echo put %2 echo exit)>sftpScript.txt sftp -b sftpScript.txt %3 set result=%errorlevel% if result EQU 0 ( del sftpScript.txt del %2 ) else ( del sftpScript.txt ) exit %result%

    Read the article

  • Consistent PHP _SERVER variables between Apache and nginx?

    - by Alix Axel
    I'm not sure if this should be asked here or on ServerFault, but here it goes... I am trying to get started on nginx with PHP-FPM, but I noticed that the server block setup I currently have (gathered from several guides including the nginx Pitfalls wiki page) produces $_SERVER variables that are different from what I'm used to seeing in Apache setups. After spending the last evening trying to "fix" this, I decided to install Apache on my local computer and gather the variables that I'm interested in under different conditions so that I could try and mimic them on nginx. The Apache setup I've on my computer has only one mod_rewrite rule: RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ /index.php/$1 [L] And these are the values I get for different request URIs (left is Apache, right is nginx): localhost/ - http://www.mergely.com/GnzBHRV1/ localhost/foo/bar/baz/?foo=bar - http://www.mergely.com/VwsT8oTf/ localhost/index.php/foo/bar/baz/?foo=bar - http://www.mergely.com/VGEFehfT/ What configuration directives would allow me to get similar values on requests handled by nginx? My current configuration in nginx is: server { listen 80; listen 443 ssl; server_name default; ssl_certificate /etc/nginx/certificates/dummy.crt; ssl_certificate_key /etc/nginx/certificates/dummy.key; root /var/www/default/html; index index.php index.html; autoindex on; location / { try_files $uri $uri/ /index.php; } location ~ /(?:favicon[.]ico|robots[.]txt)$ { log_not_found off; } location ~* [.]php { #try_files $uri =404; include fastcgi_params; fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_index index.php; fastcgi_split_path_info ^(.+[.]php)(/.+)$; } location ~* [.]ht { deny all; } } And my fastcgi_params file looks like this: fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE $content_type; fastcgi_param CONTENT_LENGTH $content_length; fastcgi_param SCRIPT_NAME $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param REQUEST_URI $request_uri; fastcgi_param DOCUMENT_URI $document_uri; fastcgi_param DOCUMENT_ROOT $document_root; fastcgi_param SERVER_PROTOCOL $server_protocol; fastcgi_param GATEWAY_INTERFACE CGI/1.1; fastcgi_param SERVER_SOFTWARE nginx/$nginx_version; fastcgi_param REMOTE_ADDR $remote_addr; fastcgi_param REMOTE_PORT $remote_port; fastcgi_param SERVER_ADDR $server_addr; fastcgi_param SERVER_PORT $server_port; fastcgi_param SERVER_NAME $server_name; fastcgi_param HTTPS $https; I know that the try_files $uri =404; directive is commented and that it is a security vulnerability but, if I uncomment it, the third request (localhost/index.php/foo/bar/baz/?foo=bar) will return a 404. It's also worth noting that my PHP cgi.fix_pathinfo in On (contrary to what some of the guides recommend), if I try to set it to Off, I'm presented with a "Access denied." message on every PHP request. I'm running PHP 5.4.8 and nginx/1.1.19. I don't know what else to try... Help?

    Read the article

  • Unable to open an ra_local session to URL

    - by AntonAL
    I have repository on my Windows machine, using VisualSVN + TortoiseSVN I want to use this repositories on my Mac with Versions.app I create a new Repository bookmark, choose a repository directory and after clicking "Create", get following error: Unable to open an ra_local session to URL Unable to open repository 'file://localhost/Path/to/my/repositories/MyRepo' Expected FS format '2'; found format '4' I can surf through the repository, using svn ls file://localhost/Path/to/my/repositories/MyRepo Also, when i create local repository, using Versions.app, the bookmark is created well and i can work with it Help!

    Read the article

  • Linux running games in another x-session

    - by mnml
    I have been trying to optimize my settings to the maximum lately and someone told me that running a game in another xsessions w/ another user would increase my perfs. It will also allow me to kill it from the other x session at anytime without having to restart the computer when it gets stuck. Today I have tried to do that in a Xephyr "screen" and I had ten times less fps on glxgears, I haven't tried on a real game ran by wine yet. Just looking for some advices on that.

    Read the article

  • Accessing Network Printers from a Citrix Session:

    - by Harry
    We have an application that uses Active Reports documents. You pass a document the UNC of the printer and away it goes. We have a group that runs this application within a Citrix session and the truly networked printers function perfectly but shared printers that work well outside of Citrix become unreachable. Printers do not need to be defined on the machine running the report for the system to work. There is something in the way Critrix passes the information to the destination UNC that I don’t understand.

    Read the article

  • Wrong java -version being reported

    - by Malachi
    I am running Windows 7 Professional x64 and have the following Java versions installed: x64 C:\Program Files\Java jdk1.6.0_24 jdk1.7.0_04 jdk1.7.0_07 jre6 jre7 x86 C:\Program Files (x86)\Java jre1.6.0_07 jre6 jre7 in my environment variables I have my PATH containing C:\Program Files\Java\jdk1.6.0_24\bin and JAVA_HOME set to C:\Program Files\Java\jdk1.6.0_24\bin However running java -version reports java version "1.7.0_07" Java(TM) SE Runtime Environment (build 1.7.0_07-b10) Java HotSpot(TM) 64-Bit Server VM (build 23.3-b01, mixed mode) How is this the case when there is no reference to this version of Java in my Environment variables. Any help on this issue would be great as I am trying to run Apache ANT using Java 1.6.

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >