Search Results

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

Page 73/632 | < Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >

  • Modify bash variables with sed

    - by Alexander Cska
    I am trying to modify a number of environmental variables containing predefined compiler flags. To do so, I tried using a bash loop that goes over all environmental variables listed with "env". for i in $(env | grep ipo | awk 'BEGIN {FS="="} ; { print $1 } ' ) do echo $(sed -e "s/-ipo/ / ; s/-axAVX/ /" <<< $i) done This is not working since the loop variable $i contains just the name of the environmental variable stored as a character string. I tried searching a method to convert a string into a variable but things started becoming unnecessary complicated. The basic problem is how to properly supply the environmental variable itself to sed. Any ideas how to properly modify my script are welcome. Thanks, Alex

    Read the article

  • How does one refer to the game1 class's variables in XNA

    - by user1149068
    I try to refer to an array in the Game1 class by creating an object of the Game1 class with its definition Game1 gameObject; , its declaration gameObject = new Game1(); in the constructor, and its usage gameObject.tileArray[xInt, yInt].treed = true;. The game1 class itself remains unchanged in its class code other than some methods and variables. When I try to use this code in the TreeRegion class it gives me "Object reference not set to an instance of an object," leading me to believe that the game1 class is null somehow. How might one change the class or object in order to refer to game1's variables? Mind you I am self-taught and still rather new to C#. The class that refers to game1: http://pastebin.com/0chEcKfq Game1 itself http://pastebin.com/zLDVzCca

    Read the article

  • Subprocess with variables & Command from different class

    - by Pastelinux
    source: http://pastebin.com/utL7Ebeq My thinking is that if i run from controller class "main" it will allow me to take the "data" from Class "model", def "filename". It doesn't seem to work. As you can see below what i mean class Controller: def __init__(self): self.model = Model() self.view = View() def main(self): data = self.model.filename() self.view.tcpdump(data) class View: def tcpdump(self, command): subprocess.call(command.split(), shell=False) When i run my code i get this error: subprocess.call(command.split(), shell=False) AttributeError: 'NoneType' object has no attribute 'split' My guess means that its not picking up command (look at source for reference) or that its not getting command with variables. But i know the error when variables are not being picked up so i don't think it is that. My question is, from what i have thus far, how do i from "class view" grab "command" for my subprocesses to run. Thanks~ John Riselvato

    Read the article

  • C++: Switching from MSVC to G++: Global Variables

    - by feed the fire
    I recently switched to Linux and wanted to compile my Visual Studio 2010 C++ source code, which uses only the STL, on G++. My Linux machine currently isn't available but I can try to tell you what is going on, first: As I try to compile my project, all global variables I use in main and which perfectly work on MSVC result in myGlobalVar is not defined in this scope errors. My project is built nearly the same as the example below: // myclass.h class myClass { // .... }; extern myClass globalInstance; // myclass.cpp #include "myclass.h" // myClass functions located here myClass globalInstance; // main.cpp #include "myclass.h" int main( ) { // Accessing globalInstance results in an error: Not defined in this scope } What am I doing wrong? Where are the differences between G++ and MSVC in terms of global variables?

    Read the article

  • character_set_filesystem not present in show variables

    - by Diego
    I'm a little worried about the absence of this variable when I execute the show variables command. This is what I get when I execute show variables like 'char%': character_set_client utf8 character_set_connection utf8 character_set_database utf8 character_set_results utf8 character_set_server utf8 character_set_system utf8 character_sets_dir /usr/share/mysql/charsets/ I wonder why this is happening. What does it mean? can I just add it to the my.cnf file? Thank you... Edit: Sorry, I recently noted that I didn't specify which variable we're talking about (though I said it in the title). The variable is character_set_filesystem. Thanks.

    Read the article

  • passing variables with JQuery

    - by vick
    <script type="text/javascript" charset="utf-8"> $(document).ready(function() { $("a").click(function() { $("#myDiv").load( "job_board_data.php", { pageNo: $(this).text()} ); return false; }); }); </script> <a href="job_board_data.php?p=1">1</a> How can I pass variables to my job_board_data.php script???? I want to pass variables such as page, sort by .. anyone?

    Read the article

  • Storing variables for app access

    - by Pavel
    Hi there everyone. I'm kinda noob to android so please bear with me. I'm currently developing app which uses tabs. My question now is: how to store values of variables so I can access them on the other tabs? I want to create something similar to sessions in PHP where I can save variables on one page and access on the other. Please can someone help me with this? There has to be an easy way to solve this. Thanks in advance!

    Read the article

  • Too many local variables in ASP.NET

    - by Yongwei Xing
    Hi all I wrote a control, and use a tool to do the code analysis. There is a test that I didn't pass. Avoid excessive locals, http://msdn.microsoft.com/library/ms182263(VS.90).aspx. In my CreateChildControls function, I built a big table with lots of field. I need to create a lot of TableRow and TableCell to construct the table. But these are not field or property of control. Thery are local variables in the function, which are created dynamically. Should I make these TableCells and TableRows as fields of the control? Or I just keep them as the local variables in the CreateChildControl function? Best Regards,

    Read the article

  • setting variables and values in html & js

    - by air
    i have one js file in that js file i have following variables var image_path="images"; var style_path="style"; i want to use these variables in html file(s) like in image statement <img src="path from js/logo.gif"> or in style sheet statement <link rel="stylesheet" href="path from js/constant.css" type="text/css" /> Basic idea behind this is: if we change name of image folder or path of image folder we only do change in one JS file not 1000 html files. same for style sheet. or any other way to do same in java script or Jquery Thanks

    Read the article

  • Cannot start session without errors in phpMyAdmin running Nginx with PHP-FPM

    - by Infinity
    Whenever I open phpMyAdmin from my VPS I get the following error: Cannot start session without errors, please check errors given in your PHP and/or webserver log file and configure your PHP installation properly. I have researched it, but cant seem to find a solution, I have done the following: Cleared cache and cookies Checked the php.ini (see below) Checked the logs (found nothing relevant) Given the correct permissions. [by sudo chown -R root:nginx /home/humza/pma] I am running Nginx with PHP-FPM, I have php-mysql and all that working fine but I can't get phpMyAdmin to work. I downloaded it off phpMyAdmin's website and extracted it, that's all. http://pastebin.com/raw.php?i=6n57cW8H - my php.ini sessions bit http://pastebin.com/raw.php?i=VaNP2TLi - my whole php.ini None of my logs have anything relevant. My error logs have other PHP errors but not this one and my access logs don't have anything either. I have checked my nginx logs and my PHP-FPM logs. I tried installing phpMyAdmin via yum and got a whole lot of dependency errors. [root@infinity ~]# yum install phpmyadmin Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package phpMyAdmin.noarch 0:2.11.11.3-1.el5 set to be updated --> Processing Dependency: php-mcrypt >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php >= 4.1.0 for package: phpMyAdmin --> Processing Dependency: php-mbstring >= 4.1.0 for package: phpMyAdmin --> Running transaction check ---> Package php.i386 0:5.1.6-27.el5_5.3 set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php --> Processing Dependency: php-cli = 5.1.6-27.el5_5.3 for package: php ---> Package php-mbstring.i386 0:5.1.6-27.el5_5.3 set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-mbstring ---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated --> Processing Dependency: php-api = 20041225 for package: php-mcrypt --> Running transaction check ---> Package php.i386 0:5.1.6-27.el5_5.3 set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php ---> Package php-cli.i386 0:5.1.6-27.el5_5.3 set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-cli ---> Package php-mbstring.i386 0:5.1.6-27.el5_5.3 set to be updated --> Processing Dependency: php-common = 5.1.6-27.el5_5.3 for package: php-mbstring ---> Package php-mcrypt.i386 0:5.1.6-15.el5.centos.1 set to be updated --> Processing Dependency: php-api = 20041225 for package: php-mcrypt --> Finished Dependency Resolution php-5.1.6-27.el5_5.3.i386 from base has depsolving problems --> Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-5.1.6-27.el5_5.3.i386 (base) php-cli-5.1.6-27.el5_5.3.i386 from base has depsolving problems --> Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-cli-5.1.6-27.el5_5.3.i386 (base) php-mbstring-5.1.6-27.el5_5.3.i386 from base has depsolving problems --> Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-mbstring-5.1.6-27.el5_5.3.i386 (base) php-mcrypt-5.1.6-15.el5.centos.1.i386 from extras has depsolving problems --> Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-15.el5.centos.1.i386 (extras) Error: Missing Dependency: php-api = 20041225 is needed by package php-mcrypt-5.1.6-15.el5.centos.1.i386 (extras) Error: Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-cli-5.1.6-27.el5_5.3.i386 (base) Error: Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-5.1.6-27.el5_5.3.i386 (base) Error: Missing Dependency: php-common = 5.1.6-27.el5_5.3 is needed by package php-mbstring-5.1.6-27.el5_5.3.i386 (base) You could try using --skip-broken to work around the problem You could try running: package-cleanup --problems package-cleanup --dupes rpm -Va --nofiles --nodigest The program package-cleanup is found in the yum-utils package. [root@infinity ~]# Any ideas?

    Read the article

  • Course/Points to include in a educational session on Asp.net MVC 4 to be given to office colleagues

    - by bhuvin
    I am planning to take a educational session on ASP.NET MVC , now in this i am confused what all to include. Actually in office there are very less people who know about it, and are sort of closed to it. So want to take a session over it to give them a "Tip of the Iceberg". Now I want some suggestions to include into the session.And its just a 1 hour session. Dont wanna go about loading nitty gritty details. Just want to make them curious. So want some such content which amazes them. For eg : Catering same code for different devices like for mobiles.

    Read the article

  • How can I get start openbox at login using the GNOME/Openbox session?

    - by skyblue
    I want to be able to run openbox as my window manager in GNOME. If I install openbox, I get the additional choices at the GDM login window of a 'GNOME/Openbox' and an 'openbox session'. If I log in with the 'openbox session', it starts openbox successfully. However, if I log in using the 'GNOME/Openbox' session so that I can run GNOME but just replace metacity with openbox, I find that openbox does not start, and that metacity is managing my application windows. It looks something is not working in the GNOME/Openbox session in 10.04 (and possibly other versions of Ubuntu). I know that I can manually replace metacity with openbox by typing 'openbox --replace', but I want to know the correct way of starting openbox in a GNOME environment automatically at logon.

    Read the article

  • How can I run Openbox using the GNOME/Openbox session?

    - by skyblue
    I want to be able to run openbox as my window manager while running GNOME. If I install openbox, I get the additional choices at the GDM login window of a 'GNOME/Openbox' and an 'openbox session'. If I log in with the 'openbox session', it starts openbox successfully. However, if I log in using the 'GNOME/Openbox' session so that I can run GNOME but just replace metacity with openbox, I find that openbox does not start, and that metacity is managing my application windows. It looks something is not working in the GNOME/Openbox session in 10.04 (and possibly other versions of Ubuntu). I know that I can manually replace metacity with openbox by typing 'openbox --replace', but I want to know the correct way of starting openbox in a GNOME environment automatically at logon.

    Read the article

  • What .NET objects should I use to create a cookie based session in MVC?

    - by makerofthings7
    I'm writing a custom password reset application that uses a validation technique that doesn't fit cleanly with ASP.NET Membership Provider's challenge questions. Namely I need to invoke a workflow and collect information from the end user (backup phone number, email address) after the user logs in using a custom form. The only way I know to create a cookie-based session (without too much "innovation" on my part) is to use WIF. What other standard objects can I use with ASP.NET MVC to create an authenticated session that works with non-windows user stores? Ideally I can store "role" or claim information in the session object such as "admin", "departmentXadmin", "normalUser", or "restrictedUser" The workflow would look like this: User logs in with username and password If the username and pw are correct a (stateless) cookie based session is created The user gets redirected to a HTML form that allows them to enter their backup phone number (for SMS dual factor), or validate it if already set. The user can then change their password using the form provided The "forgot password" would look like this User requests OTP code to be sent to the phone User logs in using username and OTP If the OTP is valid and not expired then create a cookie based session and redirect to a form that allows password reset Show password reset form, and process results.

    Read the article

  • How do I give a Byobu session a name?

    - by Ashimema
    Is there a way to create identifiable Byobu sessions so that when I've got multiple sessions running, the byobu-select-session menu gives me a list of sessions I can recognize, as opposed to non-descript tmux port numbers? In an ideal world, it would be great to be able to both start a session giving it a name and to modify such a session to change a name if it's already running? Is this possible, how?

    Read the article

  • Could not synchronize database state with session

    - by user359427
    Hello all, I'm having trouble trying to persist an entity which ID is a generated value. This entity (A), at persistence time, has to persist in cascade another entity(B). The relationship within A and B is OneToMany, and the property related in B is part of a composite key. I'm using Eclipse, JBOSS Runtime, JPA/Hibernate Here is my code: Entity A: @Entity public class Cambios implements Serializable { private static final long serialVersionUID = 1L; @SequenceGenerator(name="CAMBIOS_GEN",sequenceName="CAMBIOS_SEQ",allocationSize=1) @Id @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CAMBIOS_GEN") @Column(name="ID_CAMBIO") private Long idCambio; //bi-directional many-to-one association to ObjetosCambio @OneToMany(cascade={CascadeType.PERSIST},mappedBy="cambios") private List<ObjetosCambio> objetosCambioList; public Cambios() { } ... } Entity B: @Entity @Table(name="OBJETOS_CAMBIO") public class ObjetosCambio implements Serializable { private static final long serialVersionUID = 1L; @EmbeddedId private ObjetosCambioPK id; //bi-directional many-to-one association to Cambios @ManyToOne @JoinColumn(name="ID_CAMBIO", insertable=false, updatable=false) private Cambios cambios; //bi-directional many-to-one association to Objetos @ManyToOne @JoinColumn(name="ID_OBJETO", insertable=false, updatable=false) private Objetos objetos; public ObjetosCambio() { } ... Entity B PK: @Embeddable public class ObjetosCambioPK implements Serializable { //default serial version id, required for serializable classes. private static final long serialVersionUID = 1L; @Column(name="ID_OBJETO") private Long idObjeto; @Column(name="ID_CAMBIO") private Long idCambio; public ObjetosCambioPK() { } Client: public String generarCambio(){ ServiceLocator serviceLocator = null; try { serviceLocator = serviceLocator.getInstance(); FachadaLocal tcLocal; tcLocal = (FachadaLocal)serviceLocator.getFacadeService("java:comp/env/negocio/Fachada"); Cambios cambio = new Cambios(); Iterator it = objetosLocal.iterator(); //OBJETOSLOCAL IS ALREADY POPULATED OUTSIDE OF THIS METHOD List<ObjetosCambio> ocList = new ArrayList(); while (it.hasNext()){ Objetos objeto = (Objetos)it.next(); ObjetosCambio objetosCambio = new ObjetosCambio(); objetosCambio.setCambios(cambio); //AT THIS TIME THIS "CAMBIO" DOES NOT HAVE ITS ID, ITS SUPPOSED TO BE GENERATED AT PERSISTENCE TIME ObjetosCambioPK ocPK = new ObjetosCambioPK(); ocPK.setIdObjeto(objeto.getIdObjeto()); objetosCambio.setId(ocPK); ocList.add(objetosCambio); } cambio.setObjetosCambioList(ocList); tcLocal.persistEntity(cambio); return "exito"; } catch (NamingException e) { // TODO e.printStackTrace(); } return null; } ERROR: 15:23:25,717 WARN [JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000 15:23:25,717 ERROR [JDBCExceptionReporter] ORA-01400: no se puede realizar una inserción NULL en ("CDC"."OBJETOS_CAMBIO"."ID_CAMBIO") 15:23:25,717 WARN [JDBCExceptionReporter] SQL Error: 1400, SQLState: 23000 15:23:25,717 ERROR [JDBCExceptionReporter] ORA-01400: no se puede realizar una inserción NULL en ("CDC"."OBJETOS_CAMBIO"."ID_CAMBIO") 15:23:25,717 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:94) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:275) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:266) at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:167) at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321) at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50) at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1027) at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:365) at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504) at com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple.beforeCompletion(SynchronizationImple.java:101) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.beforeCompletion(TwoPhaseCoordinator.java:269) at com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator.end(TwoPhaseCoordinator.java:89) at com.arjuna.ats.arjuna.AtomicAction.commit(AtomicAction.java:177) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.commitAndDisassociate(TransactionImple.java:1423) at com.arjuna.ats.internal.jta.transaction.arjunacore.BaseTransaction.commit(BaseTransaction.java:137) at com.arjuna.ats.jbossatx.BaseTransactionManagerDelegate.commit(BaseTransactionManagerDelegate.java:75) at org.jboss.aspects.tx.TxPolicy.endTransaction(TxPolicy.java:170) at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:87) at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:190) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:76) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.tx.NullInterceptor.invoke(NullInterceptor.java:42) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.security.Ejb3AuthenticationInterceptorv2.invoke(Ejb3AuthenticationInterceptorv2.java:186) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.ENCPropagationInterceptor.invoke(ENCPropagationInterceptor.java:41) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.BlockContainerShutdownInterceptor.invoke(BlockContainerShutdownInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.aspects.currentinvocation.CurrentInvocationInterceptor.invoke(CurrentInvocationInterceptor.java:67) at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102) at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:176) at org.jboss.ejb3.session.SessionSpecContainer.invoke(SessionSpecContainer.java:216) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:207) at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:164) at $Proxy298.persistEntity(Unknown Source) at backing.SolicitudCambio.generarCambio(SolicitudCambio.java:521) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146) at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:92) at javax.faces.component.UICommand.broadcast(UICommand.java:332) at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287) at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401) at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95) at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245) at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110) at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:301) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190) at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126) at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) at java.lang.Thread.run(Unknown Source) Caused by: java.sql.BatchUpdateException: ORA-01400: no se puede realizar una inserción NULL en ("CDC"."OBJETOS_CAMBIO"."ID_CAMBIO") Thanks in advance! JM.-

    Read the article

  • PHP session not working with JQuery Ajax?

    - by Bolt_Head
    Update, Solved: After all this I found out that I was calling an old version of my code in the update ajax. 'boardControl.php' instead of 'boardUpdate.php' These are the kinds of mistakes that make programing fun. I'm writing a browser gomoku game. I have the ajax statement that allows the player to play a piece. $(document).ready(function() { $("td").live('click',function(){ var value = $(this).attr('id'); $.get('includes/boardControl.php',{play: value, bid: bid}); }); }); value = board square location bid = board ID Before creating a user login for player identification, the server side php had a temporary solution. It would rotate the piece state for the squares when clicked instead of knowing what player to create them for. After creating login stuff I set a session variable for the player's ID. I was hoping to read the session ID from the php during the ajax request and figure out what player they are from there. session_start(); ... $playerId = $_SESSION['char']; $Query=("SELECT p1, p2 FROM board WHERE bid=$bid"); $Result=mysql_query($Query); $p1 = mysql_result($Result,0,"p1"); $p2 = mysql_result($Result,0,"p2"); $newPiece = 0; //*default no player if($playerId == $p1) $newPiece = 1; if($playerId == $p2) $newPiece = 2; For some reason when I run the full web app, the pieces still cycle though, even after I deleted the code to make them cycle. Furthermore, after logging in If i manually load the php page in the browser, it modifies the database correctly (where it only plays pieces belonging to that player) and outputs the correct results. It seems to me that the session is not being carried over when used with Ajax. Yet Google searches tell me that, sessions do work with Ajax. Update: I'm trying to provide more information. Logging in works correctly. My ID is recognized and I printed it out next to the board to ensure that I was retrieving it correctly. The ajax request does update the board. The values passed are correct and confirmed with firebug's console. However instead of placing pieces only for the player they belong to it cycles though the piece states (0,1,2). When manually browsing to boardUpdate.php and putting in the same values sent from the Ajax the results seen in the echo'ed response indicates that the corresponding piece is played each time as intended. Same results on my laptop after fresh load of firefox. Manually browsing to boardUpdate.php without logging in before hand leave the board unchanged (as intended when no user is found in the session). I've double checked the that session_start() is on the php files and double checked the session ID variables. Hope this extra information helps, i'm running out of ideas what to tell you. Should I load up the full code? Update 2: After checking the Ajax responce in fire-bug I realized that the 'play' request does not get a result, and the board is not updated till the next 'update'. I'm still looking into this but I'll post it here for you guys too. boardUpdate.php Notable places are: Refresh Board(line6) Place Piece(line20) function boardUpdate($turnCount) (line63) <?php session_start(); require '../../omok/dbConnect.php'; //*** Refresh Board *** if(isset($_GET['update'])) { $bid = $_GET['bid']; $Query=("SELECT turn FROM board WHERE bid=$bid"); $Result=mysql_query($Query); $turnCount=mysql_result($Result,0,"turn"); if($_GET['turnCount'] < $turnCount) //** Turn increased { boardUpdate($turnCount); } } //*** Place Piece *** if(isset($_GET['play'])) // turn order? player detect? { $squareID = $_GET['play']; $bid = $_GET['bid']; $Query=("SELECT turn, boardstate FROM board WHERE bid=$bid"); $Result=mysql_query($Query); $turnCount=mysql_result($Result,0,"turn"); $boardState=mysql_result($Result,0,"boardstate"); $turnCount++; $playerId = $_SESSION['char']; $Query=("SELECT p1, p2 FROM board WHERE bid=$bid"); $Result=mysql_query($Query); $p1 = mysql_result($Result,0,"p1"); $p2 = mysql_result($Result,0,"p2"); $newPiece = 0; //*default no player if($playerId == $p1) $newPiece = 1; if($playerId == $p2) $newPiece = 2; // if($newPiece != 0) // { $oldPiece = getBoardSpot($squareID, $bid); $oldLetter = $boardState{floor($squareID/3)}; $slot = $squareID%3; //***function updateCode($old, $new, $current, $slot)*** $newLetter = updateCode($oldPiece, $newPiece, $oldLetter, $slot); $newLetter = value2Letter($newLetter); $newBoard = substr_replace($boardState, $newLetter, floor($squareID/3), 1); //** Update Query for boardstate & turn $Query=("UPDATE board SET boardState = '$newBoard', turn = '$turnCount' WHERE bid = '$bid'"); mysql_query($Query); // } boardUpdate($turnCount); } function boardUpdate($turnCount) { $json = '{"turnCount":"'.$turnCount.'",'; //** turnCount ** $bid = $_GET['bid']; $Query=("SELECT boardstate FROM board WHERE bid='$bid'"); $Result=mysql_query($Query); $Board=mysql_result($Result,0,"boardstate"); $json.= '"boardState":"'.$Board.'"'; //** boardState ** $json.= '}'; echo $json; } function letter2Value($input) { if(ord($input) >= 48 && ord($input) <= 57) return ord($input) - 48; else return ord($input) - 87; } function value2Letter($input) { if($input >= 10) return chr($input += 87); else return chr($input += 48); } //*** UPDATE CODE *** updates an letter with a new peice change and returns result letter. //***** $old : peice value before update //***** $new : peice value after update //***** $current : letterValue of code before update. //***** $slot : which of the 3 sqaures the change needs to take place in. function updateCode($old, $new, $current, $slot) { if($slot == 0) {// echo $current,"+((",$new,"-",$old,")*9)"; return letter2Value($current)+(($new-$old)*9); } else if($slot == 1) {// echo $current,"+((",$new,"-",$old,")*3)"; return letter2Value($current)+(($new-$old)*3); } else //slot == 2 {// echo $current,"+((",$new,"-",$old,")"; return letter2Value($current)+($new-$old); } }//updateCode() //**** GETBOARDSPOT *** Returns the peice value at defined location on the board. //****** 0 is first sqaure increment +1 in reading order (0-254). function getBoardSpot($squareID, $bid) { $Query=("SELECT boardstate FROM board WHERE bid='$bid'"); $Result=mysql_query($Query); $Board=mysql_result($Result,0,"boardstate"); if($squareID %3 == 2) //**3rd spot** { if( letter2Value($Board{floor($squareID/3)} ) % 3 == 0) return 0; else if( letter2Value($Board{floor($squareID/3)} ) % 3 == 1) return 1; else return 2; } else if($squareID %3 == 0) //**1st spot** { if(letter2Value($Board{floor($squareID/3)} ) <= 8) return 0; else if(letter2Value($Board{floor($squareID/3)} ) >= 18) return 2; else return 1; } else //**2nd spot** { return floor(letter2Value($Board{floor($squareID/3)}))/3%3; } }//end getBoardSpot() ?> Please help, I'd be glad to provide more information if needed. Thanks in advance =)

    Read the article

  • Make browser to go back by reloading page 1st and then scrolling it back again too

    - by Marco Demaio
    EXPLAINING WHAT I'M TRYING TO SOLVE: I have a webpage (file_list.php) showing a list of files, and next to each file there is a button to delete it. When user press the DELETE button close to a certain file name, the browser goes to a script called delete_file.php that deletes the file and then it tells browser to go back to the file_list.php delete_file.php uses a simple header("Location: file_list.php”); to go back to file_list.php When browser goes back to file_list.php it reloads the page, but it DOES NOT scroll it back again to where the user was before. So let's say the user scrolled the files list and deleted the last file, when the browser shows again the page file_list.php it won't be scrolled to the bottom of the page again. THE WORKAROUND I CAME OUT WITH: I found a strange way to work around this, basically instead of using header("Location: file_list.php”); in delete_file.php I simply use a javascript call window.history.go(-1). This workaround works perfectly when user is in session (simply using PHP session_start function): the browser RELOADS the file_list.php page and then scrolls it also bask to where it was before. But if the user is NOT in session the browser scrolls the page but IT DOES NOT RELOAD IT before, so the user would still see the file he deleted in the file list. THE QUESTIONS Do you know how to reproduce the behavior of the browser when goes back being in session even if we are not in session? Do you know a way out of this, even another way of solving this matter? Thanks! *I know I could use AJAX to delete the file so I would not have to go every time to delete_file.php, but this is not the answer*.

    Read the article

  • Python: Networked IDLE?

    - by Rosarch
    Is there any existing web app that lets multiple users work with an interactive IDLE type session at once? Something like: IDLE 2.6.4 Morgan: >>> letters = list("abcdefg") Morgan: >>> # now, how would you iterate over letters? Jack: >>> for char in letters: print "char %s" % char char a char b char c char d char e char f char g Morgan: >>> # nice nice If not, I would like to create one. Is there some module I can use that simulates an interactive session? I'd want an interface like this: def class InteractiveSession(): ''' An interactive Python session ''' def putLine(line): ''' Evaluates line ''' pass def outputLines(): ''' A list of all lines that have been output by the session ''' pass def currentVars(): ''' A dictionary of currently defined variables and their values ''' pass (Although that last function would be more of an extra feature.) To formulate my problem another way: I'd like to create a new front end for IDLE. How can I do this?

    Read the article

  • Internet Explorer randomly drops sessions between pages in cakePHP

    - by Emerson Taymor
    Hello everyone, I've come across an extremely unusual bug that my team has literally no idea how to solve. Doing some research, I found some similar solutions that I thought would work, but alas did not. Here is my situation, let me know if I can provide additional insight to help solve the problem. The first step is that someone chooses a country via a flash map. Flash passes this region name (as well as a date) through the URL, which we then convert to a session. The next page contains no Flash and doesn't display the selected region, but it does hold on to it for further down the process. Everything works perfectly in Safari and Firefox; however, in IE sometimes unexpected results occur. Frequently (but not always), the session is dropped completely and no sessions are stored between the first and 2nd pages. Here are the steps that I have taken thus far, unsuccessfully: 1. Changed Security from Medium - Low 2. Changed CheckUserAgent from True - False 3. Changed storing of sessions from PHP - Database Some additional information that may be useful: I have tried printing out the session data in Debug (debug($_SESSION) on my view file and debug set to 2 in config). In Internet Explorer everything prints out as expected EXCEPT when the region and date don't get set. For example: If the region and date don't get set NOTHING is printed out for debug. I don't get the session details at the top, and I don't get the normal dump of calls at the bottom of the page either. I am not using redirection on these pages. Please let me know if you have ANY idea of what is causing this or any solutions. I am beyond frustrated and have tried as much as I can to solve this. Thanks!

    Read the article

  • python global variable not working in apache

    - by Suhail
    I am facing issue with the global variable, when i run in the django development server it works fine, but in apache it doesn't work here is the code below: red= "/foodfolio3/test/" def showAddRecipe(request): #global objc if "userid" in request.session: objc["ErrorMsgURL"]= "" try: urlList= request.POST URL= str(urlList['url']) URL= URL.strip('http://') URL= "http://" + URL recipe= __addRecipeUrl__(URL) if (recipe == 'FailToOpenURL') or (recipe == 'Invalid-website-URL'): #request.session["ErrorMsgURL"]= "Kindly check URL, Please enter a valid URL" objc["ErrorMsgURL"]= "Kindly check URL, Please enter a valid URL" print "here global_context =", objc arurl= HttpResponseRedirect("/foodfolio3/add/import/") arurl['ErrorMsgURL']= objc["ErrorMsgURL"] #return HttpResponseRedirect("/foodfolio3/add/import/") #return render_to_response('addRecipeUrl.html', objc, context_instance = RequestContext(request)) return (arurl) else: objc["recipe"] = recipe return render_to_response('addRecipe.html', objc, context_instance = RequestContext(request)) except: objc["recipe"] = "" return render_to_response('addRecipe.html', objc, context_instance = RequestContext(request)) else: global red red= "/foodfolio3/add/" return HttpResponseRedirect("/foodfolio3/login") def showAddRecipeUrl(request): if "userid" in request.session: return render_to_response('addRecipeUrl.html', objc, context_instance = RequestContext(request)) else: global red red= "/foodfolio3/add/import/" return HttpResponseRedirect("/foodfolio3/login") def showLogin(request): obj = {} obj["error_message"] = "" obj["registered"] = "" if request.method == "POST": if (red == "/foodfolio3/test"): next= '/foodfolio3/recipes' else: next= red try: username = request.POST['username'] password = request.POST['password'] user = authenticate(username=username, password=password) except: user = authenticate(request=request) if user is not None: if user.is_active: login(request, user) request.session["userid"] = user.id # Redirect to a success page. return HttpResponseRedirect(next) this code works fine in django development server, but in apache, the url is getting redirected to '/foodfolio3/recipes'

    Read the article

  • php code works with mamp but not on ubuntu server

    - by user355510
    Hello, I have start looking at a twitter php library http://github.com/abraham/twitteroauth, but i can't get it to work on my ubuntu server, but on my mac, with mamp it works without any problems. This is the code that don't won't to work on my server, but in mamp. Yes i have edit config file <?php /* Start session and load library. */ session_start(); require_once('twitteroauth/twitteroauth.php'); require_once('config.php'); /* Build TwitterOAuth object with client credentials. */ $connection = new TwitterOAuth(CONSUMER_KEY, CONSUMER_SECRET); /* Get temporary credentials. */ $request_token = $connection->getRequestToken(OAUTH_CALLBACK); /* Save temporary credentials to session. */ $_SESSION['oauth_token'] = $token = $request_token['oauth_token']; $_SESSION['oauth_token_secret'] = $request_token['oauth_token_secret']; /* If last connection failed don't display authorization link. */ switch ($connection->http_code) { case 200: /* Build authorize URL and redirect user to Twitter. */ $url = $connection->getAuthorizeURL($token); header('Location: ' . $url); break; default: /* Show notification if something went wrong. */ echo 'Could not connect to Twitter. Refresh the page or try again later.'; } I have enable php session on my ubuntu server, because this code works <?php session_start(); $_SESSION["secretword"] = "hello there"; $secretword = $_SESSION["secretword"] ; ?> <html> <head> <title>A PHP Session Example</title> </head> <body> <?php echo $secretword; ?> </body> </html>

    Read the article

  • PHP session_write_close() keeps sending a set-cookie header

    - by Chiraag Mundhe
    In my framework, I make a number of calls to session_write_close(). Let's assume that a session has been initiated with a user agent. The following code... foreach($i = 0; $i < 3; $i++) { session_start(); session_write_close(); } ...will send the following request header to the browser: Set-Cookie PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ PHPSESSID=bv4d0n31vj2otb8mjtr59ln322; path=/ There should be no Set-Cookie header because, as I stipulated, the session cookie has already been created on the user's end. But every call to session_write_close() after the first one in the script above will result in PHP instructing the browser to set the current session again. This is not breaking my app or anything, but it is annoying. Does anyone have any insight into preventing PHP from re-setting the cookie with each subsequent call to session_write_close? EDIT The problem seems to be that with every subsequent call to session_start(), PHP re-sets the session cookie to its own SID and sends a Set-Cookie response header. But why??

    Read the article

  • How can I get sessions to work if I'm using Google App Engine + Django 1.1?

    - by user341642
    Is there a way for me to get sessions working? I know Django has built in session management, and GAE has some tools for it if you're using their watered down version of Django 0.96, but is there a way to get sessions to work if you're trying to use GAE w/ Django 1.1 (i.e. use_library() call). I assume using a db-backed session doesn't work, and a file system backed one won't work b/c we don't have access to the filesystem if we deploy to the Google production servers. This kinda worked (as in didn't crap out) when I used SessionMiddleware backed by a local-memory backed cache and a non-persistent cache (i.e. setting SESSION_ENGINE to django.contrib.sessions.backends.cache). But the session never seems to persist in this case, no matter how I set the timeouts. A new session key is generated on every page reload. Maybe this is b/c the GAE assumes complete statelessness with each request and blows away my local cache? Apologies in advance, I'm pretty new to Python. Any suggestions would be greatly appreciated.

    Read the article

< Previous Page | 69 70 71 72 73 74 75 76 77 78 79 80  | Next Page >