Search Results

Search found 3459 results on 139 pages for 'if modified since'.

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

  • Freezing a dual-mode (GUI and console) application using cx_Freeze

    - by Mridang Agarwalla
    Hi, I've developed a Python application that runs both in the GUI mode and the console mode. If any arguments are specified, it runs in a console mode else it runs in the GUI mode. I've managed to freeze this using cx_Freeze. I had some problems hiding the black console window that would pop up with wxPython and so I modified my setup.py script like this: import sys from cx_Freeze import setup, Executable base = None if sys.platform == "win32": base = "Win32GUI" setup( name = "simple_PyQt4", version = "0.1", description = "Sample cx_Freeze PyQt4 script", executables = [Executable("PyQt4app.py", base = base)]) This works fine but now when I try to open up my console and run the executable from there, it doesn't output anything. I don't get any errors or messages so it seems that cx_Feeze is redirecting the stdout somewhere else. Is is possible to get it to work with both mode? Nothing similar to this seems to be documented anywhere. :( Thanks in advance. Mridang

    Read the article

  • ASP.NET MVC Head Verb and Selenium RC

    - by Rob
    Selenium (RC) is being used to test an ASP.NET 1.1 site. When we make a request via Selenium RC (and then in turn via Firefox or other configured browser) the http verb is "HEAD". We have several form action methods that have separate POST and GET methods decorated with AcceptVerbs(HttpVerbs.Get). These methods are returning a 404 and logging a "a public action method could not be found" error message. Questions: When writing separate Get/Post action methods what is the best practice for handling the Head verb? Should we always decorate with an AcceptVerbs(HttpVerbs.Get | HttpVerbs.Head)? The only time we've seen HEAD verbs is from Selenium and from some crawlers. We created robots.txt entries for the crawlers. Does anyone know why HEAD verbs are issued via Selenium (instead of an If-Modified-Since header)? Are there mainstream crawlers that use the HEAD verb? Does it affect SEO ranking to not have it?

    Read the article

  • Modify on-the-fly verbose_name in a model field on django admin

    - by PerroVerd
    Hi I have this sample model working with the admin class Author(models.Model): name = models.CharField(_('Text in here'), max_length=100) with verbose_name set as ugettext_lazy 'Text in here', but sometimes, depending on the site_id i want to present a diferent verbose name, so I modified the init in this way def __init__(self, *args, **kwargs): super(Author, self).__init__(*args, **kwargs) #some logic in here self._meta.get_field('name').verbose_name = _('Other text') It works, displaying the 'Other text' instead the 'Text in here'... except for the very first time the author/add view is used. ¿Is it the right way to do it? ¿How can i fix the first time problem? Thanks in advance

    Read the article

  • Setting outbound 'Expires:' in Squid server's HTTP header

    - by IkeaPimp
    I'm having a problem where items served by my Squid server are being cached by Limelight for too long, sometimes days. It happens when a piece of content has been static for a long time (weeks) and then undergoes numerous changes in a matter of hours. Limelight gets its content from our Squid server and I'm told that if I can add 'Expires: 15m' in the HTTP header the Squid server sends, Limelight will not cache the image for more than 15 min. Unfortunately, I can fond no setting in Squid that will allow me to add this to the header. Here's the HTTP header as presently being sent: HTTP/1.0 200 OK Date: Tue, 15 Dec 2009 23:57:33 GMT Server: nginx/0.5.26 Content-Type: image/jpeg Content-Length: 83843 Last-Modified: Tue, 15 Dec 2009 23:52:00 GMT Accept-Ranges: bytes Age: 450 X-Cache: HIT from squid01.prod.mydomain X-Cache-Lookup: HIT from squid01.prod.mydomain:3128 Via: 1.0 squid01.prod.mydomain:3128 (squid/2.6.STABLE14) Connection: close

    Read the article

  • Entity Framework - Optimistic Concurrency Issue

    - by Cranialsurge
    I have a windows service that runs every 10 seconds ... each time it runs, it takes some test data, modifies it and persists it to the database using the EntityFramework. However, on every second run, when I try to persist the change I get the following Optimistic Concurrency Exception:- Store update, insert, or delete statement affected an unexpected number of rows (0). Entities may have been modified or deleted since entities were loaded. Refresh ObjectStateManager entries I know for a fact that there is nothing else writing to that DB but my service which updates records every 10 seconds. What could be causing the concurrency exception here ?

    Read the article

  • Java parsing UTF8

    - by Jack
    I have the following issue with a UTF8 files structured as following: FIELD1§FIELD2§FIELD3§FIELD4 Looking at hexadecimal values of the file it uses A7 to codify §. So according to this codify it should be UTF8, but it's strange because A7 7F so 1 byte shouldn't be enough to codify §. So I tried using directly a BufferedReader with a specified charset: BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(input), utf8)) but when I try to tokenize the string with SmartTokenizer st = new SmartTokenizer(toTokenize, "§") (the SmartTokenizer is a modified version of the StringTokenizer that keeps empty tokens) no splitting occurs, and if I try to print the string I obtain FIELD1?FIELD2?FIELD3?... so § used in the file is different from the one specified as a the delimiter, and it's not able to print out it too. So what's the problem here? Maybe the original file should use 2 bytes to store §?

    Read the article

  • Running mongod as a windows service

    - by andreas
    Hello, i have installed mongodb on win32 and i am trying to run it as a service. I have followed the instructions posted here: http://www.deltasdevelopers.com/post/Running-MongoDB-as-a-Windows-Service.aspx but when when windows tries to 'load'/'run' the service there is a problem. I see the service under the services control banner constantly in the 'starting' state. The result: the service is not started and windows is constantly trying to start it without success. The instructions i have followed are: At the command line C:\mongodb\mongod -install then C:\mongodb\mongod -service Then i modified the Win Registry Entry for the MongoDB Service by setting the ImagePath key to the value of C:\mongodb\mongodb.exe -service Any advice? What am i doing wrong?

    Read the article

  • Using WeakReference to resolve issue with .NET unregistered event handlers causing memory leaks.

    - by Eric
    The problem: Registered event handlers create a reference from the event to the event handler's instance. If that instance fails to unregister the event handler (via Dispose, presumably), then the instance memory will not be freed by the garbage collector. Example: class Foo { public event Action AnEvent; public void DoEvent() { if (AnEvent != null) AnEvent(); } } class Bar { public Bar(Foo l) { l.AnEvent += l_AnEvent; } void l_AnEvent() { } } If I instantiate a Foo, and pass this to a new Bar constructor, then let go of the Bar object, it will not be freed by the garbage collector because of the AnEvent registration. I consider this a memory leak, and seems just like my old C++ days. I can, of course, make Bar IDisposable, unregister the event in the Dispose() method, and make sure to call Dispose() on instances of it, but why should I have to do this? I first question why events are implemented with strong references? Why not use weak references? An event is used to abstractly notify an object of changes in another object. It seems to me that if the event handler's instance is no longer in use (i.e., there are no non-event references to the object), then any events that it is registered with should automatically be unregistered. What am I missing? I have looked at WeakEventManager. Wow, what a pain. Not only is it very difficult to use, but its documentation is inadequate (see http://msdn.microsoft.com/en-us/library/system.windows.weakeventmanager.aspx -- noticing the "Notes to Inheritors" section that has 6 vaguely described bullets). I have seen other discussions in various places, but nothing I felt I could use. I propose a simpler solution based on WeakReference, as described here. My question is: Does this not meet the requirements with significantly less complexity? To use the solution, the above code is modified as follows: class Foo { public WeakReferenceEvent AnEvent = new WeakReferenceEvent(); internal void DoEvent() { AnEvent.Invoke(); } } class Bar { public Bar(Foo l) { l.AnEvent += l_AnEvent; } void l_AnEvent() { } } Notice two things: 1. The Foo class is modified in two ways: The event is replaced with an instance of WeakReferenceEvent, shown below; and the invocation of the event is changed. 2. The Bar class is UNCHANGED. No need to subclass WeakEventManager, implement IWeakEventListener, etc. OK, so on to the implementation of WeakReferenceEvent. This is shown here. Note that it uses the generic WeakReference that I borrowed from here: http://damieng.com/blog/2006/08/01/implementingweakreferencet I had to add Equals() and GetHashCode() to his class, which I include below for reference. class WeakReferenceEvent { public static WeakReferenceEvent operator +(WeakReferenceEvent wre, Action handler) { wre._delegates.Add(new WeakReference<Action>(handler)); return wre; } public static WeakReferenceEvent operator -(WeakReferenceEvent wre, Action handler) { foreach (var del in wre._delegates) if (del.Target == handler) { wre._delegates.Remove(del); return wre; } return wre; } HashSet<WeakReference<Action>> _delegates = new HashSet<WeakReference<Action>>(); internal void Invoke() { HashSet<WeakReference<Action>> toRemove = null; foreach (var del in _delegates) { if (del.IsAlive) del.Target(); else { if (toRemove == null) toRemove = new HashSet<WeakReference<Action>>(); toRemove.Add(del); } } if (toRemove != null) foreach (var del in toRemove) _delegates.Remove(del); } } public class WeakReference<T> : IDisposable { private GCHandle handle; private bool trackResurrection; public WeakReference(T target) : this(target, false) { } public WeakReference(T target, bool trackResurrection) { this.trackResurrection = trackResurrection; this.Target = target; } ~WeakReference() { Dispose(); } public void Dispose() { handle.Free(); GC.SuppressFinalize(this); } public virtual bool IsAlive { get { return (handle.Target != null); } } public virtual bool TrackResurrection { get { return this.trackResurrection; } } public virtual T Target { get { object o = handle.Target; if ((o == null) || (!(o is T))) return default(T); else return (T)o; } set { handle = GCHandle.Alloc(value, this.trackResurrection ? GCHandleType.WeakTrackResurrection : GCHandleType.Weak); } } public override bool Equals(object obj) { var other = obj as WeakReference<T>; return other != null && Target.Equals(other.Target); } public override int GetHashCode() { return Target.GetHashCode(); } } It's functionality is trivial. I override operator + and - to get the += and -= syntactic sugar matching events. These create WeakReferences to the Action delegate. This allows the garbage collector to free the event target object (Bar in this example) when nobody else is holding on to it. In the Invoke() method, simply run through the weak references and call their Target Action. If any dead (i.e., garbage collected) references are found, remove them from the list. Of course, this only works with delegates of type Action. I tried making this generic, but ran into the missing where T : delegate in C#! As an alternative, simply modify class WeakReferenceEvent to be a WeakReferenceEvent, and replace the Action with Action. Fix the compiler errors and you have a class that can be used like so: class Foo { public WeakReferenceEvent<int> AnEvent = new WeakReferenceEvent<int>(); internal void DoEvent() { AnEvent.Invoke(5); } } Hopefully this will help someone else when they run into the mystery .NET event memory leak!

    Read the article

  • Pre-commit hooks getting partial committed file list

    - by Rex Xia
    I know running git-diff and other tools can identify the changes in the repository, but when I do a partial commit, I need to pass only the committed files (rather than the entire set of files that are touched) to the pre-commit hook. For example, I modified three files and commit only two, and I want the pre-commit hook to know the name of the two files. git status --porcelain M A.c M B.c M C.h then I execute: git commit -m "two files only" A.c B.c How can the pre-commit hook get hold of the list of the two files only?

    Read the article

  • C# & Adding Dynamic META Tags

    - by Bry4n
    I have this code protected void Page_Load(object sender, EventArgs e) { DataSet.DestinationsDataTable GetDestinations = (DataSet.DestinationsDataTable)dta.GetData(); Page.Title = GetDestinations.Rows[0]["Meta_Title"].ToString(); HtmlMeta hm = new HtmlMeta(); HtmlHead head = (HtmlHead)Page.Header; hm.Name = GetDestinations.Rows[0]["Meta_Desc"].ToString(); hm.Content = GetDestinations.Rows[0]["Meta_Key"].ToString(); head.Controls.Add(hm); } And it's returning this error (on a content page) The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>). Thoughts?

    Read the article

  • Grafting Scala 2.8 into a Netbeans NBAndroid Project...What steps am I missing?

    - by Michael Kohout
    Hi All; Due to Apple's recent T+C hijinks, I've become interested in developing for Android. Anyways, I'm trying to get a mixed-language Android 2.1 project going in Netbeans 6.8 (with the NBAndroid 0.10 plugin). The two languages being Java and Scala(2.8 head build). To give you a basic idea of what the app does right now, it's just a simple "Hello World" app. To get this to build, I've modified the projects's build.xml file: -- -injars ${scala-library}(!META-INF/MANIFEST.MF,!library.properties) -outjars "${build.classes.dir}/classes.min.jar" -libraryjars "${file.reference.android.jar}" -dontwarn -dontoptimize -dontobfuscate -keep public class * extends android.app.Activity -keep public class scala.xml.include.sax.Main** I've gotten the project so that it'll build, but it errors on startup in my Android Emulator(inside the emulator Android tells me my application has stopped unexpectedly). So my questions are: Does anyone see what I may be doing wrong? And is there any way to get access to the logs that the emulator must create? thanks Mike Kohout

    Read the article

  • Using Glassfish libraries in proprietary software

    - by Lóránt Pintér
    I would like to use some parts of Glassfish in a proprietary software that are under a CDDL + GPLv2 license. Am I allowed to do that? I haven't modified anything in the code of these libraries, so is this OK, or my software, because it uses these libraries, is still considered derivative work, and thus a big no-no? I mean, according to https://jaxb.dev.java.net/, JAXB is also under CDDL + GPLv2, but I know I can freely use that in proprietary software. Is this because CDDL + GPLv2 actually allows that, or is it distributed under a different license when bundled with the JRE?

    Read the article

  • ASP.NET Development Server - Empty webResource.axd after conversion from 2.0 to 3.5

    - by David Casey
    I have moved a project from asp.net 2.0 to 3.5. The original project was using the atlas ajax extensions so I have modified the code to use the built in ajax features in 3.5. When running the project within the dev environemnt (VS2008 on Vista Business SP1) and using the asp.net dev server I receive javascript errors such as WebForm_PostBackOptions which point to a missing handler/module. If I deploy the project and run it stand alone within IIS or if I use Fiddler2 while running in VS2008 I do not see the errors and fiddler shows that the axd files are being downloaded correctly. Also deploying to a 2003 server does not show any issues. I could just carry on and forget this as it works when deployed but I would like to understand what is happening. Has anyone got an ideas as to what is going on here and how to get the same results accross all environments?

    Read the article

  • unable to connect to ASP.Net development server issue

    - by George2
    Hello everyone, I am debugging codeplex simple project = http://www.codeplex.com/sl2videoplayer. I am using VSTS 2008 + C# + Windows Vista x86 Enterprise. I have not modified any code of this codeplex project, and just press F5 to run VideoPlayerWeb project. The current issue I met with is error message -- "Unable to connect to ASP.Net Development Server". Here is my screen snapshots when clicking F5. Any ideas what is wrong? http://i42.tinypic.com/15xs6jd.jpg http://i39.tinypic.com/2d8rf3t.jpg thanks in advance, George

    Read the article

  • Getting a specific number of JSON items with jQuery from tumblr feed

    - by Kevin Whitaker
    Hello all. I'm trying to populate a page with X entries from my tumblr feed, and I'm wondering how I can only pull that X number from the JSON object it returns. Here's my code, pulled from another Stack Overflow post and modified: //Tumblr retrieval $.getJSON("http://tumblr-address/api/read/json?callback=?", function(data) { $.each(data.posts, function(i,posts){ var title = this["regular-title"]; var type = this.type; var date = this.date; var url = this["url-with-slug"]; $('#sideRail ol').prepend('<li><p><a href=' +url +'>' + title + '</a></p><p>' + date + '</p></li>'); }); }); I've tried using a while loop with a counter, but it just repeats everything X times before moving on to the next item in the list. Thanks for any help.

    Read the article

  • Git on windows :|

    - by Sonic Soul
    i've been experimenting with git as my personal code rep.. and it has been a bit of a disaster with windows. i've used Subversion, CVS, and Perforce in the past.. none were as annoying to use as git. i've figured out the PGP part (for github), although my workstation no longer lets me check in, and after searching around it turns out that git bash is using putty which is not that reliable and should be configured with something else.. i was not able to configure it with windows shell extension for a nice visual of what is part of the repository, what is modified, and easy check ins, and easy pushes.. has anyone successfully configured some kind of windows shell client and can efficiently and quickly synchronize various machines? It just seems to be more pain to use than it is worth..

    Read the article

  • How to time-delay email deliveries?

    - by Michael D
    I'm currently learning about the Drupal email functions, such as drupal_mail and hook_mail, and hook_mail_alter, and I have a problem before me where I'll need to be able to queue emails for delayed delivery. For example, an event signup notification that needs to wait for an hour after the event was registered by a user. And that email has user specific data, so can't be just a generic template email... I'm using the MailQ module, mainly for it's logging capabilities, but I wonder if it (or something else) could be modified to add a configurable delay function? Any ideas?

    Read the article

  • Dataset field DBNull -> int?

    - by BobClegg
    SQLServer int field. Value sometimes null. DataAdapter fills dataset OK and can display data in DatagridView OK. When trying to retrieve the data programmatically from the dataset the Dataset field retrieval code throws a StronglyTypedException error. [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] public int curr_reading { get { try { return ((int)(this[this.tableHistory.curr_readingColumn])); } catch (global::System.InvalidCastException e) { throw new global::System.Data.StrongTypingException("The value for column \'curr_reading\' in table \'History\' is DBNull.", e); } Got past this by checking for DBNull in the get accessor and returning null but... When the dataset structure is modified (Still developing) my changes (unsurprisingly) are gone. What is the best way to handle this situation? It seems I am stuck with dealing with it at the dataset level. Is there some sort of attribute that can tell the auto code generator to leave the changes in place?

    Read the article

  • ASP.NET - dynamically creating database connection in datasets

    - by Foo
    I am currently using datasets for my data access layer. I currently store the connection string in the web.config file. I need the ability to change the connection to another database before any queries are processed. Is there an event that is triggered or a base class that can be modified that intercepts the process of retrieving the connection string from the web.config file? Is there any way to handle multiple database connections using the same code base and also take advantage of the connection pooling? I understand the best method is to get rid of datasets and use custom data objects. Any ideas?

    Read the article

  • The machine-default permission settings do not grant Local Activation permission for the COM Server

    - by subash
    when i was trying to visit my webapplication(developed in asp.net & c#.net) in internet explorer ,i was not able to see the page. when i went event viewer the events ocurred,it was showing the error as below " The machine-default permission settings do not grant Local Activation permission for the COM Server application with CLSID {BC866CF2-5486-41F7-B46B-9AA49CF3EBB1} to the user SAAD-DEV9\ASPNET SID (S-1-5-21-1757981266-1644491937-839522115-1007). This security permission can be modified using the Component Services administrative tool. " how to overcome this and see my application page

    Read the article

  • RegEx for a date format

    - by Ivan
    Say I have a string like this: 07-MAY-07 Hello World 07-MAY-07 Hello Again So the pattern is, DD-MMM-YY, where MMM is the three letter format for a month. What Regular Expression will break up this string into: 07-MAY-07 Hello World 07-MAY-07 Hello Again Using Jason's code below modified for C#, string input = @"07-MAY-07 Hello World 07-MAY-07 Hello Again"; string pattern = @"(\d{2}-[A-Z]{3}-\d{2}\s)(\D*|\s)"; string[] results = Regex.Split(input, pattern); results.Dump(); Console.WriteLine("Length = {0}", results.Count()); foreach (string split in results) { Console.WriteLine("'{0}'", split); Console.WriteLine(); } I get embedded blank lines? Length = 7 '' '07-MAY-07 ' 'Hello World ' '' '07-MAY-07 ' 'Hello Again' '' I don't even understand why I am getting the blank lines...?

    Read the article

  • WinForms form freezes

    - by andrew
    On a form (F1) i have a button, from which if i create another form (lets call it F2) and show it there's no problem but i'd like to do something like this Some thread in my app is running a connection and listens for messages from a server. when a message arrives, my main form is registered to get an event that runs a function. From that function i'm trying to create and show the F2 type form (empty, nothing modified in it): it shows it but then it freezes my application. more exactly: public partial class Form1 : Form { public Form1() { InitializeComponent(); ConnectionManagerThread.getResponseListener().MessageReceived += Form1_OnMessageReceived; } private void Form1_OnMessageReceived(object sender, MessageEventArgs e) { Form2 f2 = new Form2(); f2.Show(); } }

    Read the article

  • Source control products that support linked/shared files?

    - by Ian Boyd
    We're interested in moving from a source control system that supports the concept of shared or linked files. A shared file means: a file modified in one project, is automatically updated changed in every other project that uses that same file. It does this without a developer having to request it, reverse-integrate it, ask for it, or even want it. We're trying to see if any other commonly used source-control systems can meet our needs, and include linked or shared files. My limited research shows that: Team Foundation Server doesn't support sharing files Subversion doesn't support sharing files (including Externals) CVS doesn't support sharing files (including Modules) Anything else? (besides our current source control product, obviously) References Subversion and shared files across repositories/projects? How to share files between CVS projects? Will TFS ever support shared files for projects under source control?

    Read the article

  • Modifing settings in Django

    - by Cato Johnston
    I'm trying to get Django's manage.py to run with modified settings files. I have three settings files settings.py preview.py live.py settings.py contains my base settings but on live & preview sites I point the ['DJANGO_SETTINGS_MODULE'] to live or preview which in turn load the base file and any settings specific to that environment. This works fine, until I try to run migrations using manage.py I updated the manage.py file to import settings.preview but now when I try to run syncdb or migrate I get this error: django.core.exceptions.ImproperlyConfigured: You haven't set the DATABASE_ENGINE setting yet. My settings file has this in it though: DATABASE_ENGINE = 'mysql' How can I get this to work?

    Read the article

  • [Python] Detect destination of shortened, or "tiny" url

    - by conradlee
    I have just scraped a bunch of Google Buzz data, and I want to know which Buzz posts reference the same news articles. The problem is that many of the links in these posts have been modified by URL shorteners, so it could be the case that many distinct shortened URLs actually all point to the same news article. Given that I have millions of posts, what is the most efficient way (preferably in python) for me to detect whether a url is a shortened URL (from any of the many URL shortening services, or at least the largest) Find the "destination" of the shortened url, i.e., the long, original version of the shortened URL. Does anyone know if the URL shorteners impose strict request rate limits? If I keep this down to 100/second (all coming form the same IP address), do you think I'll run into trouble?

    Read the article

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