Daily Archives

Articles indexed Thursday April 8 2010

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

  • What are good memory management techniques in Flash/as3

    - by Parris
    Hello! So I am pretty familiar with memory management in Java, C and C++; however, in flash what constructs are there for memory management? I assume flash has a sort of virtual machine like java, and I have been assuming that things get garbage collected when they are set to null. I am not sure if this is actually the case though. Also is there a way to force garbage collection in Flash? Any other tips? Thanks

    Read the article

  • How to make a TableLayout from XML using programmable way ?

    - by user164589
    hi guys, I am trying to add TableLayout to the LinearLayout from resourse(xml) using programmable way. The added TableLayout count is dynamic. It would be between 1 - 10. I think it is better way to make it from resource xml. Because design doesn't break. How to make it ? Actually I don't know how to create a new instance from the XML. Please help. guys. Thanks in advance.

    Read the article

  • Are there tools that would be suitable for maintaining a changelog for a Cabal Haskell package?

    - by Norman Ramsey
    I'm working fast and furiously on a new Haskell package for compiler writers. I'm going through many minor version numbers daily, and the Haskell packaging system, Cabal, doesn't seem to offer any tools for updating version numbers or for maintaining a change log. (Logs are going into git but that's not visible to anyone using the package.) I would kill for something equivalent to Debian's uupdate or dch/debchange tools. Does anyone know of general-purpose tools that could be used to increment version numbers automatically and add an entry to a change log?

    Read the article

  • How does the destructor know when to activate itself? Can it be relied upon?

    - by Robert Mason
    Say for example i have the following code (pure example): class a { int * p; public: a() { p = new int; ~a() { delete p; } }; a * returnnew() { a retval; return(&retval); } int main() { a * foo = returnnew(); return 0; } In returnnew(), would retval be destructed after the return of the function (when retval goes out of scope)? Or would it disable automatic destruction after i returned the address and i would be able to say delete foo; at the end of main()? Or, in a similar vein (pseudocode): void foo(void* arg) { bar = (a*)arg; //do stuff exit_thread(); } int main() { while(true) { a asdf; create_thread(foo, (void*)&asdf); } return 0; } where would the destructor go? where would i have to say delete? or is this undefined behavior? Would the only possible solution be to use the STL referenced-counted pointers? how would this be implemented? Thank you- i've used C++ for a while but never quite been in this type of situation, and don't want to create memory leaks.

    Read the article

  • Rails OpenID Authentication Plugin No Longer Installs Rake Tasks?

    - by Rich Apodaca
    I'm following the Railscasts tutorial on using OpenID with AuthLogic. This command: $ script/plugin install git://github.com/rails/open_id_authentication.git installs the plugin, but I don't see any OpenID Rake tasks (rake -T). In particular, I can no longer run the task: $ rake open_id_authentication:db:create With previous applications, the Rake tasks were installed without a problem, so what's changed with the plugin? Which version of the plugin do I need to get the behavior I'm looking for? Using Rails 2.3.5.

    Read the article

  • Help with mysql sum and group query and managing jquery graph results.

    - by Scarface
    Hey guys, I have a system I am trying to design that will retrieve information from a database, so that it can be plotted in a jquery graph. I need to retrieve the information and somehow put it in the necessary format (for example two coordinates var d = [[1269417600000, 10],[1269504000000, 15]];). My table that I am selecting from is a table that stores user votes with fields: points_id (1=vote up ,2=vote down), user_id, timestamp, and topic_id. What I need to do is select all the votes and somehow group them into respective days and then sum the difference between 1 votes and 2 votes for each day. I then need to somehow display the data in the appropriate plotting format shown earlier. For example April 1, 4 votes. The data needs to be separated by commas, except the last plot entry, so I am not sure how to approach that. I showed an example below of the kind of thing I need but it is not correct, echo "var d=["; $query=mysql_query("SELECT *, SUM(IF(points_id = \"1\", 1,0))-SUM(IF([points_id = \"2\", 1,0)) AS 'total' FROM points LEFT JOIN topic on topic.topic_id=points.topic_id WHERE topic.creator='$user' GROUP by timestamp HAVING certain time interval"); while ($row=mysql_fetch_assoc($query)){ $timestamp=$row['timestamp']; $votes=$row['total']; echo "[$timestamp,$vote],"; } echo "];";

    Read the article

  • Commands to compile programs using .NET

    - by Arjun Vasudevan
    In case I have .NET framework installed in my computer + all the necessary other language support (Perl Interpreter, etc) What are the commands I should give in the console to compile programs in the following languages: 1. C 2. C++ 3. Java 4. Python 5. VB 6. C# 7. Perl 8. Ruby Like we have for VB- *vbc program_name.vb*, what are the commands to compile programs in other languages?

    Read the article

  • Can I pass data into a HashMap<String,Object> from JSP to a JavaBean?

    - by Parris
    Hi Everyone, I am just starting out with JSP, Java, etc web development... I would love to use some sort of framework, but for this project I can't do that. In any case I want to potentially pass essentially limitless data (for flexibility) to my javabeans. My idea was if I can have key value pairs that would really easy. The values will always be strings or integers. HashMap seems ideal in this case. Is this possible? Any ideas? Can I do this with JSP Bean tags or should I write scriptlets? Thanks!!!

    Read the article

  • RadGrid Custom Filter

    - by Aaron
    I'm trying to add a custom filter to my RadGrid. I have a column, vendNum, which I want to allow users to filter on multiple vendNums with a comma-separated list. Basically, I want the same functionality as an "in" statement in SQL (where vendNum in (X,Y,Z)). I followed the tutorial on this site and came up with the following code to place in my RadGrid1_ItemCommand event. protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) { if (e.CommandName == RadGrid.FilterCommandName) { Pair filterPair = (Pair)e.CommandArgument; switch (filterPair.Second.ToString()) { case "vendNum": TextBox tbPattern = (e.Item as GridFilteringItem)["vendNum"].Controls[0] as TextBox; if (tbPattern.Text.Contains(",")) { string[] values = tbPattern.Text.Split(','); if (values.Length >= 2) { e.Canceled = true; StringBuilder newFilter = new StringBuilder(); for (int i = 0; i < values.Length; i++) { if (i == values.Length - 1) newFilter.Append("[vendNum] = " + values[i]); else newFilter.Append("[vendNum] = " + values[i] + " OR "); } if (RadGrid1.MasterTableView.FilterExpression == "") RadGrid1.MasterTableView.FilterExpression = newFilter.ToString(); else RadGrid1.MasterTableView.FilterExpression = "((" + RadGrid1.MasterTableView.FilterExpression + ") AND (" + newFilter.ToString() + "))"; RadGrid1.Rebind(); } } break; default: break; } } } Doing this, though, keeps giving me an error "Expression Expected" when I try to filter with a comma separated list. I'm still able to filter a single vendNum. My FilterExpression does come out as expected. The code is failing on the RadGrid1.Rebind() statement. Has anyone dealt with this before? Any help is greatly appreciated. Thanks, Aaron

    Read the article

  • Themes wont work when using Server Side Tags on an ASP.NET Page

    - by Sumit Sharma
    The code for the asp.net page is: <div class="facebox_content"> <% if (CurrentUser.Role == "Free") { %> <table cellpadding="0" cellspacing="0" style="border-collapse:collapse;width:380px;"> <tr> <td> User Name : </td> <td> Membership Cost : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtUserName" Enabled="false" runat="server" Text="<%= CurrentUser.Name %>"/> </td> <td style="width:190px;"> <asp:TextBox ID="txtCost" Enabled="false" runat="server" Text="2000"/> </td> </tr> <tr> <td> <br /> Cheque / Draft No.: </td> <td> <br /> Bank Drawn On : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtChqNo" runat="server"></asp:TextBox> </td> <td style="width:190px;"> <asp:TextBox ID="txtBankName" runat="server"></asp:TextBox> </td> </tr> <tr> <td> <br /> Date : </td> <td> <br /> City : </td> </tr> <tr> <td style="width:190px;"> <asp:TextBox ID="txtDate" runat="server"></asp:TextBox> </td> <td style="width:190px;"> <asp:TextBox ID="txtCity" runat="server"></asp:TextBox> </td> </tr> </table> <% } else if(CurrentUser.Role == "Pending") { %> <p style="text-align:justify;"> Your Request is pending with our Administrators. Please be patient while your request is processed. Usually it takes 2-4 Days for your request to be processed after the payment has been received. </p> <% } else if(CurrentUser.Role == "Paid") { %> <p style="text-align:justify;"> You are already a Paid Member of Website </p> <% } %> The code for the C# file is: protected void Page_PreInit(object sender, EventArgs e) { this.Theme = CurrentUser.Theme; } protected void Page_Load(object sender, EventArgs e) { txtUserName.Text = CurrentUser.Name; ConfirmButton.Attributes.Add("onclick", "javascript:document.getElementById('" + lblMsg.ClientID + "').style.display='none';"); if (CurrentUser.Role != "Free") ConfirmButton.Visible = false; } The code is giving the following error: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. Stack Trace: [HttpException (0x80004005): The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).] System.Web.UI.ControlCollection.Add(Control child) +8678903 System.Web.UI.PageTheme.SetStyleSheet() +478 System.Web.UI.Page.OnInit(EventArgs e) +8699660 System.Web.UI.Control.InitRecursive(Control namingContainer) +333 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +378 Please some one help me out..!!

    Read the article

  • Why does System.Web.Hosting.ApplicationHost.CreateApplicationHost throw System.IO.FileNotFoundExcept

    - by Scott Langham
    I saw something about needing to have the assembly available for the type of the first argument passed to the function. I think it is, I can't figure out what am I missing. This code is in a service. I was running the service under the 'NETWORK SERVICES' user account, when I changed the account to that of the session I was logged on with it worked ok. But, what's the difference, and how can I get it to work for the NETWORK SERVICES user.

    Read the article

  • SQLAuthority News – Author Visit Review – TechMela Nepal – March 29-30, 2010

    - by pinaldave
    I was very fortunate to attend TechMela at Kathmandu, Nepal on 29th and 30th of March 2010. I would like to thank Allen Bailochan Tuladhar from Microsoft MDP Nepal for inviting me. Allen is a person with seemingly infinite energy and unlimited passion for Microsoft Technology. If you get an opportunity to spend just one hour with him, you will surely be more enthusiastic with regards to Microsoft Technology. And, I was lucky enough that I was able to spend about a total of 9 days with him in Kathmandu, working along with him in the Tech Community. TechMela Nepal Pinal at TechMela, Nepal TechMela is considered as one of the biggest events in Nepal, having been organized by Microsoft MDP Nepal. This event was attended by around 500 students and hundreds of Tech professionals. The event was handled very professionally and at very large scale. Every minor detail was properly planned and obviously thought out well. There were around 50+ volunteers from MS MDP who were monitoring this event systematically to make sure the event would run as smooth as planned. Attendees in Geek T-Shirts During this event, I was delighted to meet David Lim of Microsoft Singapore. He is very passionate in working for Microsoft Technology, as well as building deep relations with the Community. I was fortunate to spend my entire afternoon with him during the sight-seeing trip. We discussed various MS technologies and their community’s adoption as well as the way how each of us can be a part of the community activity. He also delivered excellent keynotes at the event. I must say that this is one of the most enjoyable keynotes I have ever attended. It was interesting and interactive, and I must say that I had the 70s feelings with all the fonts and graphics. I still remember him saying, “Yeah, I was a student and I know you.” Allen Tuladhar, David Lim, Pinal Dave and Guests After the keynote, everybody cheered when Allen came on stage to talk about the event and to introduce the agenda for the next two days. I must say that Allen is one of the most well-known people in Nepal. I was impressed with his popularity, and to prove this, when he got on the stage he had to wait for a long full minute before he was able to greet “Welcome” while the attendees were clapping and cheering. Technology Panelist at Techmela Kathmandu, Nepal This event was blessed with the top-of-the-top officials of various IT industries, Nepal ministries and the US Embassy. All the prominent personalities were present for panel discussion on the stage. The talk was done on various subjects. Also, the energy level which was set by Allen really echoed in the audience as they asked certain questions on different global as well local IT-related questions. The panel discussion really was discussion instead of usual monologue of one person. Pinal Dave presending at TechMela Kathmandu, Nepal This was a two-day event and my session was on either of the day. I had a great participation from the audience on both days. The place where the event was organized had a capacity of around 500+ audience. Both of my sessions were heavily attended and volunteers did a fabulous job helping the attendees find empty seats or arrange some additional seats. I was overwhelmed with the interaction I have received in the large hall. Attendees were not so shy to express their thoughts, so both the sessions were followed up by top notch one-on-one conversations for a couple of hours. Pinal Dave presending at TechMela Kathmandu, Nepal Pinal Dave presending at TechMela Kathmandu, Nepal Pinal Dave presending at TechMela Kathmandu, Nepal There are many questions that I have received during the event, and many of them can be interesting for all of us here so I will write detailed blog posts on these subjects. I also tried to participate in the gaming activities held at the event, but I felt I was kind of lost even if I was only playing for the very first minutes. This made me realize that I am really getting old for video games. Allen presending at TechMela Kathmandu, Nepal Allen’s session on Digital Photography was very impressive as he demonstrated so many features of the Windows Live Product that at one point I felt he is MVP for Windows Live. In fact, he demonstrated how all the Microsoft products work together to give users an excellent desktop experience; no wonder he is an MVP for Windows Desktop Experience. Pinal Dave presending at TechMela Kathmandu, Nepal Any event has two common dilemmas – food and logistics. However, this event had excellent food and state-of-the-art organization. I was very glad that this two-day event turned out to be one of the most successful events in Nepal. I also noticed that almost all attendees rate their experience as beyond expectation and truly exceptional. Pinal Dave and Allen Bailochan Tuladhar If you ever get invited by Allen in any of his event, I strongly suggest that you drop all your plans and scheduled stuff, and accept his invitation. For sure, the event will be a very memorable one and would be your once-in-a-lifetime experience. Reference: Pinal Dave (http://blog.SQLAuthority.com) Filed under: MVP, Pinal Dave, SQL, SQL Authority, SQL Query, SQL Server, SQL Tips and Tricks, SQLAuthority Author Visit, SQLAuthority News, T SQL, Technology

    Read the article

  • Are One Way Links Still Important in Search Engine Optimization?

    Pretty dumb question huh? But people are beginning to wonder considering that Google might change its algorithms again. If you doubt it, do a quick search on the keyword "Google caffeine". This is the new Google search engine and so far, beta testers have stated that it is faster, provides more relevant search engine results and son. Anyways, whatever the case may be, it is important to note that one way links are important right now because the search engines have made them so.

    Read the article

  • JMeter - successfull HTTPS recording?

    Greetings, I'm utilizing Jmeter 2.3, which now supports "attempt HTTPS spoofing" under the Proxy Server element. I've tried on several different servers, and have had no success. Has anyone been able to successfully record from an HTTPS source with this setting? Or barring successfully recording, can anyone share a work-around? When available, I simply have HTTPS turned off at the server level, but this is not always feasible. THoughts?

    Read the article

  • Is it possible to create a flash movie from only actionscript?

    - by Metropolis
    Hey Everyone, Currently I am mostly a PHP/Javascript/CSS/HTML applications programmer. But I would like to start learning how to create flash movies also. However, I do not want to spend the money to get CS4. Can I create flash movies from only Actionscript 3? Or would anyone recommend that I jump straight to air? All of the different adobe products, which do the same thing, confuse me. I just do not want to jump into it and then find out that I have to spend 900 dollars for the IDE. I really just want to code, and not have to use the IDE. Thanks, Metropolis

    Read the article

  • Connecting to 3rd party databse in Joomla!?

    - by Michael
    I need to connect to another database in Joomla! that's on another server. This is for a plugin and I need to pull some data from a table. Now what I don't want is to use this database to run Joomla!, I already have Joomla! installed and running on its own database on its server but I want to connect to another database (ON TOP of the current one) to pull some data, then disconnect from that 3rd party database - all while keeping the original Joomla database connection in tact.

    Read the article

  • How to detect a timeout when using asynchronous Socket.BeginReceive?

    - by James Hugard
    Writing an asynchronous Ping using Raw Sockets in F#, to enable parallel requests using as few threads as possible. Not using "System.Net.NetworkInformation.Ping", because it appears to allocate one thread per request. Am also interested in using F# async workflows. The synchronous version below correctly times out when the target host does not exist/respond, but the asynchronous version hangs. Both work when the host does respond. Not sure if this is a .NET issue, or an F# one... Any ideas? (note: the process must run as Admin to allow Raw Socket access) This throws a timeout: let result = Ping.Ping ( IPAddress.Parse( "192.168.33.22" ), 1000 ) However, this hangs: let result = Ping.AsyncPing ( IPAddress.Parse( "192.168.33.22" ), 1000 ) |> Async.RunSynchronously Here's the code... module Ping open System open System.Net open System.Net.Sockets open System.Threading //---- ICMP Packet Classes type IcmpMessage (t : byte) = let mutable m_type = t let mutable m_code = 0uy let mutable m_checksum = 0us member this.Type with get() = m_type member this.Code with get() = m_code member this.Checksum = m_checksum abstract Bytes : byte array default this.Bytes with get() = [| m_type m_code byte(m_checksum) byte(m_checksum >>> 8) |] member this.GetChecksum() = let mutable sum = 0ul let bytes = this.Bytes let mutable i = 0 // Sum up uint16s while i < bytes.Length - 1 do sum <- sum + uint32(BitConverter.ToUInt16( bytes, i )) i <- i + 2 // Add in last byte, if an odd size buffer if i <> bytes.Length then sum <- sum + uint32(bytes.[i]) // Shuffle the bits sum <- (sum >>> 16) + (sum &&& 0xFFFFul) sum <- sum + (sum >>> 16) sum <- ~~~sum uint16(sum) member this.UpdateChecksum() = m_checksum <- this.GetChecksum() type InformationMessage (t : byte) = inherit IcmpMessage(t) let mutable m_identifier = 0us let mutable m_sequenceNumber = 0us member this.Identifier = m_identifier member this.SequenceNumber = m_sequenceNumber override this.Bytes with get() = Array.append (base.Bytes) [| byte(m_identifier) byte(m_identifier >>> 8) byte(m_sequenceNumber) byte(m_sequenceNumber >>> 8) |] type EchoMessage() = inherit InformationMessage( 8uy ) let mutable m_data = Array.create 32 32uy do base.UpdateChecksum() member this.Data with get() = m_data and set(d) = m_data <- d this.UpdateChecksum() override this.Bytes with get() = Array.append (base.Bytes) (this.Data) //---- Synchronous Ping let Ping (host : IPAddress, timeout : int ) = let mutable ep = new IPEndPoint( host, 0 ) let socket = new Socket( AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp ) socket.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.SendTimeout, timeout ) socket.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout ) let packet = EchoMessage() let mutable buffer = packet.Bytes try if socket.SendTo( buffer, ep ) <= 0 then raise (SocketException()) buffer <- Array.create (buffer.Length + 20) 0uy let mutable epr = ep :> EndPoint if socket.ReceiveFrom( buffer, &epr ) <= 0 then raise (SocketException()) finally socket.Close() buffer //---- Entensions to the F# Async class to allow up to 5 paramters (not just 3) type Async with static member FromBeginEnd(arg1,arg2,arg3,arg4,beginAction,endAction,?cancelAction): Async<'T> = Async.FromBeginEnd((fun (iar,state) -> beginAction(arg1,arg2,arg3,arg4,iar,state)), endAction, ?cancelAction=cancelAction) static member FromBeginEnd(arg1,arg2,arg3,arg4,arg5,beginAction,endAction,?cancelAction): Async<'T> = Async.FromBeginEnd((fun (iar,state) -> beginAction(arg1,arg2,arg3,arg4,arg5,iar,state)), endAction, ?cancelAction=cancelAction) //---- Extensions to the Socket class to provide async SendTo and ReceiveFrom type System.Net.Sockets.Socket with member this.AsyncSendTo( buffer, offset, size, socketFlags, remoteEP ) = Async.FromBeginEnd( buffer, offset, size, socketFlags, remoteEP, this.BeginSendTo, this.EndSendTo ) member this.AsyncReceiveFrom( buffer, offset, size, socketFlags, remoteEP ) = Async.FromBeginEnd( buffer, offset, size, socketFlags, remoteEP, this.BeginReceiveFrom, (fun asyncResult -> this.EndReceiveFrom(asyncResult, remoteEP) ) ) //---- Asynchronous Ping let AsyncPing (host : IPAddress, timeout : int ) = async { let ep = IPEndPoint( host, 0 ) use socket = new Socket( AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.Icmp ) socket.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.SendTimeout, timeout ) socket.SetSocketOption( SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, timeout ) let packet = EchoMessage() let outbuffer = packet.Bytes try let! result = socket.AsyncSendTo( outbuffer, 0, outbuffer.Length, SocketFlags.None, ep ) if result <= 0 then raise (SocketException()) let epr = ref (ep :> EndPoint) let inbuffer = Array.create (outbuffer.Length + 256) 0uy let! result = socket.AsyncReceiveFrom( inbuffer, 0, inbuffer.Length, SocketFlags.None, epr ) if result <= 0 then raise (SocketException()) return inbuffer finally socket.Close() }

    Read the article

  • Sending Facebook notifications

    - by antpaw
    Hey i have a little facebook iframe application written with rails and the facebooker plugin. I can loop through the users friends and see whether they also have this application. To do this I use a fql qeury, and my own html (no fbml). Now i want to create a button right beside every friend who doesn't have this app, that sends an invite massage. Is it possible to do this without this FBML/JS voodoo? I looked through the RESTful api but the only thing i could found was this deprecated method :( Can someone provide me an code example on how to do this? I really don't want to use this FBML stuff because it doesn't fit into the ui concept of the app, but if that the only way, please explain how to do this (every fbml tag I've tried is just invisible :( ) Thanks a lot.

    Read the article

  • Can someone look over the curriculum for this major & give me your thoughts? Computing & Security Te

    - by scottsharpejr
    My goal is to become a good web developer. I'm interested in learning how to build complex websites as well as how to write web applications. I want skills that will enable me to write apps for <--insert hottest web trend here-- (Facebook & iphone apps for example) This is one of my goals as far as Tech. is concerned. I'd also like to have a brod knowledge of different areas of IT. I'm looking into majoring in "Computing & Security Technology". The program is offered by Drexel in conjunction with my CC. It's a 4 year degree. Can someone take a look @ the pdf below. It outlines every course I must take. http://www.drexelatbcc.org/academics/PDF/CST_CT.pdf For degree requirments w/ links to course descriptiongs see drexel.edu/catalog/degree/ct.htm With electives I can go up to Web Development 4. Based on my goals of Web development & wanting a well rounding education in information technology, what do you think of the curriculum? How will I fare entering the job market with this degree? My goals here are a little different. I'd like to work for 2 to 3 companies over the course of 6-7 years. Working with and learning different areas of IT. I'd like to stay with a company an average of 2-3 years before moving on. My end goal is to go into business for myself (IT related). I appreciate any and all advice the community here can give me! :) Could someone also explain to me their interpretation of this major? thanks! P.S. I already know XHTML & CSS. I am just now starting to experiment with PHP.

    Read the article

  • DataGridView's top left cell value is not displayed.

    - by Spike
    I have a DataGridView, without visible row or column headers, and bound to a BindingList. No matter what I try the top left cell (Rows[0].Cells[0]) is always empty. The cell's Visible property is true, but it never displays its contents. If I make some rows and columns invisible, it's still the top left of the visible cells that isn't displayed.

    Read the article

  • CherryPy sessions for same domain, different port

    - by detly
    Consider the script below. It will launch two subprocesses, each one a CherryPy app (hit Ctrl+C or whatever the KeyboardInterrupt combo is on your system to end them both). If you run it with CP 3.0 (taking care to change the 3.0/3.1 specific lines in "StartServer"), then visit: http://localhost:15002/ ...you see an empty dict. Then visit: http://localhost:15002/set?val=10 http://localhost:15002/ ...and you see the newly populated dict. Then visit: http://localhost:15012/ ...and go back to http://localhost:15002/ ...and nothing has changed. If you try the same thing with CP 3.1 (remember the lines in "StartServer"!), when you get to the last step, the dict is now empty. This happens in Windows and Debian, Python 2.5 and 2.6. You can try all sorts of things: changing to file storage, separating the storage paths... the only difference it makes is that the sessions might get merged instead of erased. I've read another post about this as well, and there's a suggestion there to put the session tools config keys in the app config rather than the global config, but I don't think that's relevant to this usage where the apps run independently. What do I do to get independent CherryPy applications to NOT interfere with each other? Note: I originally asked this on the CherryPy mailing list but haven't had a response yet so I'm trying here. I hope that's okay. import os, os.path, socket, sys import subprocess import cgi import cherrypy HTTP_PORT = 15002 HTTP_HOST = "127.0.0.1" site1conf = { 'global' : { 'server.socket_host' : HTTP_HOST, 'server.socket_port' : HTTP_PORT, 'tools.sessions.on' : True, # 'tools.sessions.storage_type': 'file', # 'tools.sessions.storage_path': '1', # 'tools.sessions.storage_path': '.', 'tools.sessions.timeout' : 1440}} site2conf = { 'global' : { 'server.socket_host' : HTTP_HOST, 'server.socket_port' : HTTP_PORT + 10, 'tools.sessions.on' : True, # 'tools.sessions.storage_type': 'file', # 'tools.sessions.storage_path': '2', # 'tools.sessions.storage_path': '.', 'tools.sessions.timeout' : 1440}} class Home(object) : def __init__(self, key): self.key = key @cherrypy.expose def index(self): return """\ <html> <body>Session: <br>%s </body> </html> """ % cgi.escape(str(dict(cherrypy.session))) @cherrypy.expose def set(self, val): cherrypy.session[self.key.upper()] = val return """\ <html> <body>Set %s to %s</body> </html>""" % (cgi.escape(self.key), cgi.escape(val)) def StartServer(conf, key): cherrypy.config.update(conf) print 'Starting server (%s)' % key cherrypy.tree.mount(Home(key), '/', {}) # Start the web server. #### 3.0 # cherrypy.server.quickstart() # cherrypy.engine.start() #### #### 3.1 cherrypy.engine.start() cherrypy.engine.block() #### def Main(): # Start first webserver proc1 = subprocess.Popen( [sys.executable, os.path.abspath(__file__), "1"]) proc2 = subprocess.Popen( [sys.executable, os.path.abspath(__file__), "2"]) proc1.wait() proc2.wait() if __name__ == "__main__": print sys.argv if len(sys.argv) == 1: # Master process Main() elif(int(sys.argv[1]) == 1): StartServer(site1conf, 'magic') elif(int(sys.argv[1]) == 2): StartServer(site2conf, 'science') else: sys.exit(1)

    Read the article

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