Search Results

Search found 4355 results on 175 pages for 'filesystem notification'.

Page 76/175 | < Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >

  • Publish failed using Ant publisher (Eclipse/datanucleus).

    - by aronp
    Dear All, I am being driven mad the following (apparently hard) error from eclipse. Publish failed using Ant publisher Resource is out of sync with the file system: '/MyServlet/build/classes/com/inver/hotzones/database/BaseNetworkData.class'. I have seen comments on similar errors where refreshing eclipses view of the project helps but it is not helping me. Have tried cleaning the project, removing it from the webserver, deleting war files but cant seem to clear it. I have reset my TMPDIR variable so that it uses a directory on the same filesystem as that appeared to be another possible cause. The error occurs on classes which have been enhanced by datanuculeus. I have auto-enhance on the project. The other references to this problem indicate that it is due to Eclipses view of the project being out of step with the filesystem, and I am guessing that this has something to do with thedata nucleus enhancement. Any ideas? Thanks. I am using Eclipse 3.5.2 with latest datanucleus pluggins. Stack trace org.eclipse.core.runtime.CoreException: Resource is out of sync with the file system: '/MyServlet/build/classes/com/inver/hotzones/database/BaseNetworkData.class'. at org.eclipse.jst.server.generic.core.internal.publishers.AbstractModuleAssembler.copyModule(AbstractModuleAssembler.java:172) at org.eclipse.jst.server.generic.core.internal.publishers.WarModuleAssembler.assemble(WarModuleAssembler.java:31) at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.assembleModule(AntPublisher.java:167) at org.eclipse.jst.server.generic.core.internal.publishers.AntPublisher.publish(AntPublisher.java:128) at org.eclipse.jst.server.generic.core.internal.GenericServerBehaviour.publishModule(GenericServerBehaviour.java:82) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModule(ServerBehaviourDelegate.java:949) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publishModules(ServerBehaviourDelegate.java:1039) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:872) at org.eclipse.wst.server.core.model.ServerBehaviourDelegate.publish(ServerBehaviourDelegate.java:708) at org.eclipse.wst.server.core.internal.Server.publishImpl(Server.java:2731) at org.eclipse.wst.server.core.internal.Server$PublishJob.run(Server.java:278) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)

    Read the article

  • Are there scenarios where the ViewModel needs to invoke methods on the View w.r.t. MVVM in WPF?

    - by Gishu
    As per the pattern, the ViewModel exposes Properties(with change notification) and Commands (to notify the VM of user actions) that the View binds to. The only communication that flows from the VM to the View is the property change notifications (so that the View can refresh itself with updated data). In MVP or PresentationModel form of the pattern (if I'm not mistaken), the View implements a plain vanilla interface (consisting of methods, properties and/or events). With MVVM, it feels methods on the IView have been outlawed (along with IView itself). One scenario I could think of was to set the focus to a certain control in the View. (When the user does ActionX, the focus should immediately be set to FieldY). In MVP, I'd write this as IView.ActivateField(NameConstant), which the presenter or PM would invoke. In MVVM, this seems to be a fringe case that needs a workaround / little bit of code-behind. The VM implements an ActiveField Property, which it sets to NameConstant. The view picks up the change notification event and in a code-behind event handler, activates the Name control. Is the above just an exception to the norm? Or are there other such scenarios, where the VM needs to invoke a method on the View ?

    Read the article

  • Compressing xls content with apache deflate module

    - by Clinton Bosch
    I am trying to compress an excel spreadsheet being sent from my application using apache deflate module. I have added the following line to the my sites-enabled file: AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/excel But is seems to make the response data bigger??? Using firebug, without the module I downloaded the xls spreadsheet from the application and it downloaded 100Kb of data, the file size once on the filesystem was also 100Kb as expected. Once I enabled the deflate module as described above and repeated the process, the amount of data downloaded was 295Kb?? but the file was still only 100Kb once save on the filesystem. As an experiment I manually gzipped the saved xls file and it compressed to 20Kb. What am I doing wrong here? Using deflate (Firebug output): 200 OK xxxxxxx.co.za 293 KB 4.43s ParamsHeadersPostPutResponseCacheHTML Response Headers Date Tue, 03 Nov 2009 13:01:43 GMT Server Apache/2.2.4 (Ubuntu) mod_jk/1.2.23 PHP/5.2.3-1ubuntu6.4 mod_ssl/2.2.4 OpenSSL/0.9.8e Content-Disposition attachment; filename="Employee List.xls" Vary Accept-Encoding Content-Encoding gzip Content-Type application/excel Without deflate (Firebug output): 200 OK xxxxxxxx.co.za 100 KB 3.46s ParamsHeadersPostPutResponseCacheHTML Response Headers Date Tue, 03 Nov 2009 13:06:00 GMT Server Apache/2.2.4 (Ubuntu) mod_jk/1.2.23 PHP/5.2.3-1ubuntu6.4 mod_ssl/2.2.4 OpenSSL/0.9.8e Content-Disposition attachment; filename="Employee List.xls" Content-Length 102912 Content-Type application/excel

    Read the article

  • Why does presentModalViewController not always work?

    - by E-Madd
    My application requires data from a server in order to run. The first thing it does is displays a view controller (LoadingViewController) that is responsible for checking if the data is saved to my PersistentStoreCoordinator. If the data isn't cached locally, it gets it from my server and caches it, and posts a notification that the LoadingViewController is listening for. When that notification comes through, LoadingViewController presents the application's MainViewController using the presentModalViewController with a flip animation. So far, so good... no errors. However, if the application loads and determines the data IS cached - the presentModalViewController does not work and the main application view never appears. No errors. I've even gone as far as adding a button to the Loading view that executes the same code when pressed and the damn thing works. I'm suspicious it has something to do with the timing of it all but I'm clueless as to what I can do to ensure the view is displayed with that flipping animation if the data is already cached locally. Any suggestions?

    Read the article

  • Resize view on iPhone when rotating

    - by BCBomb47
    I have an application with many views. I want only a couple of the views to be able to rotate to landscape when the device is rotated. I found out that I couldn't use (BOOL)shouldAutorotateToInterfaceOrientation because that would rotate every view in my app. I found a solution to this problem here on Stack Overflow but now I have another issue to deal with. The view rotates when I turn the device but it still shows the view as if it were still in portrait mode (straight up and down). The top and bottom of the view is cut off. Is there a way to have the view rotate and also adjust its size to fit the new orientation? I also found this but wasn't able to get it to work. Here's my code for that view: @implementation businessBank @synthesize webView, activityIndicator; - (void)viewDidLoad { [super viewDidLoad]; NSString *urlAddress = @"website_url"; NSURL *url = [NSURL URLWithString:urlAddress]; NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; [webView loadRequest:requestObj]; [[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil]; } - (void)didRotate:(NSNotification *)notification { UIDeviceOrientation orientation = [[notification object] orientation]; if (orientation == UIDeviceOrientationLandscapeLeft) { [self.view setTransform:CGAffineTransformMakeRotation(M_PI / 2.0)]; } else if (orientation == UIDeviceOrientationLandscapeRight) { [self.view setTransform:CGAffineTransformMakeRotation(M_PI / -2.0)]; } else if (orientation == UIDeviceOrientationPortraitUpsideDown) { [self.view setTransform:CGAffine TransformMakeRotation(M_PI)]; } else if (orientation == UIDeviceOrientationPortrait) { [self.view setTransform:CGAffineTransformMakeRotation(0.0)]; } }

    Read the article

  • Ruby ICalendar Gem: How to get e-mail reminders working.

    - by Jenny
    I'm trying to work out how to use the icalendar ruby gem, found at: http://icalendar.rubyforge.org/ According to their tutorial, you do something like: cal.event.do # ...other event properties alarm do action "EMAIL" description "This is an event reminder" # email body (required) summary "Alarm notification" # email subject (required) attendees %w(mailto:[email protected] mailto:[email protected]) # one or more email recipients (required) add_attendee "mailto:[email protected]" remove_attendee "mailto:[email protected]" trigger "-PT15M" # 15 minutes before add_attach "ftp://host.com/novo-procs/felizano.exe", {"FMTTYPE" => "application/binary"} # email attachments (optional) end alarm do action "DISPLAY" # This line isn't necessary, it's the default summary "Alarm notification" trigger "-P1DT0H0M0S" # 1 day before end alarm do action "AUDIO" trigger "-PT15M" add_attach "Basso", {"VALUE" => ["URI"]} # only one attach allowed (optional) end So, I am doing something similar in my code. def schedule_event puts "Scheduling an event for " + self.title + " at " + self.start_time start = self.start_time endt = self.start_time title = self.title desc = self.description chan = self.channel.name # Create a calendar with an event (standard method) cal = Calendar.new cal.event do dtstart Program.convertToDate(start) dtend Program.convertToDate(endt) summary "Want to watch" + title + "on: " + chan + " at: " + start description desc klass "PRIVATE" alarm do action "EMAIL" description desc # email body (required) summary "Want to watch" + title + "on: " + chan + " at: " + start # email subject (required) attendees %w(mailto:[email protected]) # one or more email recipients (required) trigger "-PT25M" # 25 minutes before end end However, I never see any e-mail sent to my account... I have even tried hard coding the start times to be Time.now, and sending them out 0 minutes before, but no luck... Am I doing something glaringly wrong?

    Read the article

  • std::locale breakage on MacOS 10.6 with LANG=en_US.UTF-8

    - by fixermark
    I have a C++ application that I am porting to MacOSX (specifically, 10.6). The app makes heavy use of the C++ standard library and boost. I recently observed some breakage in the app that I'm having difficulty understanding. Basically, the boost filesystem library throws a runtime exception when the program runs. With a bit of debugging and googling, I've reduced the offending call to the following minimal program: #include <locale> int main ( int argc, char *argv [] ) { std::locale::global(std::locale("")); return 0; } This program fails when I run this through g++ and execute the resulting program in an environment where LANG=en_US.UTF-8 is set (which on my computer is part of the default bash session when I create a new console window). Clearing the environment variable (setenv LANG=) allows the program to run without issues. But I'm surprised I'm seeing this breakage in the default configuration. My questions are: Is this expected behavior for this code on MacOS 10.6? What would a proper workaround be? I can't really re-write the function because the version of the boost libraries we are using executes this statement internally as part of the filesystem library. For completeness, I should point out that the program from which this code was synthesized crashes when launched via the 'open' command (or from the Finder) but not when Xcode runs the program in Debug mode. edit The error given by the above code on 10.6.1 is: $ ./locale terminate called after throwing an instance of 'std::runtime_error' what(): locale::facet::_S_create_c_locale name not valid Abort trap

    Read the article

  • StreamReader.EndOfStream produces IOException

    - by Ziplin
    I'm working on an application that accepts TCP connections and reads in data until an </File> marker is read and then writes that data to the filesystem. I don't want to disconnect, I want to let the client sending the data to do that so they can send multiple files in one connection. I'm using the StreamReader.EndOfStream around my outter loop, but it throws an IOException when the client disconnects. Is there a better way to do this? private static void RecieveAsyncStream(IAsyncResult ar) { TcpListener listener = (TcpListener)ar.AsyncState; TcpClient client = listener.EndAcceptTcpClient(ar); // init the streams NetworkStream netStream = client.GetStream(); StreamReader streamReader = new StreamReader(netStream); StreamWriter streamWriter = new StreamWriter(netStream); while (!streamReader.EndOfStream) // throws IOException { string file= ""; while (file!= "</File>" && !streamReader.EndOfStream) { file += streamReader.ReadLine(); } // write file to filesystem } listener.BeginAcceptTcpClient(RecieveAsyncStream, listener); }

    Read the article

  • How to use Apache ivy to resolve dependency with multiple files?

    - by Alexander
    Here is my ivy.xml: <?xml version="1.0" encoding="UTF-8"?> <ivy-module version="2.0"> ... <dependencies> <dependency org="spring" name="richclient" rev="1.1.0"/> </dependencies> </ivy-module> And ivy-settings.xml: <property name="ivy.local.default.root" value="/home/---/dev/Java/_libraries/_ivy" override="false"/> <property name="ivy.local.default.ivy.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/> <property name="ivy.local.default.artifact.pattern" value="[organisation]/[module]/[revision]/[type]s/[artifact].[ext]" override="false"/> <resolvers> <filesystem name="local"> <ivy pattern="${ivy.local.default.root}/${ivy.local.default.ivy.pattern}" /> <artifact pattern="${ivy.local.default.root}/${ivy.local.default.artifact.pattern}" /> </filesystem> </resolvers> Ivy try to find /home/---/dev/Java/_libraries/_ivy/spring/richclient/1.1.0/jars/richclient.jar And here is the problem. Library has 4 jar files. How to include all jars in project from one dependency in ivy.xml? Thx

    Read the article

  • Really annoying bug with Topmost property in Windows Forms

    - by Nazgulled
    Hi, I have this Windows Forms application where it sits in the notification area. Clicking on the icon brings it up front, clicking it again (or clicking on the app X icon) sends it back. This is the type of app that having the window always on top is important when it's displayed by clicking the icon, but it's optional. Right-clicking the icon brings up a context menu where one can select to enable the "always on top" option or not. When the application first starts up, the app settings are read from an XML file and I'm 99% that this is working as it should, the Topmost properly is properly read (and written). After some time (minutes, hours, days, whatever, I normally hibernate and rarely shutdown) the Topmost stops working. I don't change the option, I don't think anything is changing the option but I click the notification area icon and app is not brought up front. It shows up (it displays on Alt+Tab) but it's on the background, it's not topmost as it should. I bring up the context menu, disable the option (cause it's enabled) and enable it back and it starts to work after that. The app is now topmost. However, it can lose this ability anytime after while. I can't understand why this happens and how this happens. Does anyone have any idea why? If not, any idea how could I try to debug such behavior?

    Read the article

  • PendingIntents in Notifications

    - by Mariano Kamp
    I would like to show a notification that displays the progress of an ongoing operation. That works well for me. But at the same time the remote view should contain cancel button to stop the ongoing operation. The usual content intent should still do something else, i.e. not cancel the ongoing operation. It seems though that I can only have one intent. I have to specify a contentIntent that is launched when clicking on the notification: If I don't specify that I get something along those lines: E/ActivityManager( 62): Activity Manager Crash E/ActivityManager( 62): java.lang.IllegalArgumentException: contentIntent required ... For the "cancel" button I set another intent: Intent cancelSyncIntent = new Intent("com.xyz.CANCEL_SYNC"); contentView.setOnClickPendingIntent(R.id.cancel_sync, PendingIntent.getBroadcast(context, 0, cancelSyncIntent, 0)); But this never works. I always get the content intent when the button is clicked. It looks like I cannot use buttons in remote views of notifications?! I could probably display a text: "<< Press to cancel operation ", but that seems rather heavy handed.

    Read the article

  • Sharing storage between servers

    - by El Yobo
    I have a PHP based web application which is currently only using one webserver but will shortly be scaling up to another. In most regards this is pretty straightforward, but the application also stores a lot of files on the filesystem. It seems that there are many approaches to sharing the files between the two servers, from the very simple to the reasonably complex. These are the options that I'm aware of Simple network storage NFS SMB/CIFS Clustered filesystems Lustre GFS/GFS2 GlusterFS Hadoop DFS MogileFS What I want is for a file uploaded via one webserver be immediately available if accessed through the other. The data is extremely important and absolutely cannot be lost, so whatever is implemented needs to a) never lose data and b) have very high availability (as good as, or better, than a local filesystem). It seems like the clustered filesystems will also provide faster data access than local storage (for large files) but that isn't of vita importance at the moment. What would you recommend? Do you have any suggestions to add or anything specifically to look out for with the above options? Any suggestions on how to manage backup of data on the clustered filesystems?

    Read the article

  • Is there a reason to use the XML::LibXML::Number-object in my XML::LibXML-example?

    - by sid_com
    In this example I get to times '96'. Is there a possible case where I would need a XML::LibXML-Number-object to to achieve the goal? #!/usr/bin/env perl use warnings; use strict; use 5.012; use XML::LibXML; my $xml_string =<<EOF; <?xml version="1.0" encoding="UTF-8"?> <filesystem> <path> <dirname>/var</dirname> <files> <action>delete</action> <age units="hours">10</age> </files> <files> <action>delete</action> <age units="hours">96</age> </files> </path> </filesystem> EOF #/ my $doc = XML::LibXML->load_xml( string => $xml_string ); my $root = $doc->documentElement; my $result = $root->find( '//files/age[@units="hours"]' ); $result = $result->get_node( 1 ); say ref $result; # XML::LibXML::Element say $result->textContent; # 96 $result = $root->find ( 'number( //files/age[@units="hours"] )' ); say ref $result; # XML::LibXML::Number say $result; # 96

    Read the article

  • Common NSNotification mistakes?

    - by Ben Packard
    A simplification... A building has an array of apartment objects. Each apartment has a single currentTenant. These tenants are of type Person. Note that currentTenant doesn't have a reference to the apartment, so can't send information back up the chain. When a tenant has a plumbing issue he raises an NSNotification: [nc postNotificationName:@"PlumbingIssue" object:self]; Each Apartment observes notifications ONLY FROM it's own current tenant (this is set up when the apartment is built, before there is a current tenant): [nc addObserver:self selector:@selector(alertBuildingManager:) name:@"PlumbingIssue" object:[self currentTenant]; When the apartment receives a notification from it's own currentTenant, it sends it's own notification, "PlumberRequired", along with the apartment number and the currentTenant in an NSDictionary. Apartment observes these notifications, which it will take from any apartment (or other object): [nc addObserver:self selector:@selector(callPlumber) name:@"PlumberRequired" object:nil]; Is there something I could be getting fundamentally wrong here? What's happening is that the apartment is receiving notifications from any and all currentTenants, rather than jus it's own. Sorry that the actual code is a bit too unwieldy to post. Was just wondering if there's a gap in my understanding about observing notifications from a particular sender?

    Read the article

  • Mac OS X and static boost libs -> std::string fail

    - by Ionic
    Hi all, I'm experiencing some very weird problems with static boost libraries under Mac OS X 10.6.6. The error message is main(78485) malloc: *** error for object 0x1000e0b20: pointer being freed was not allocated *** set a breakpoint in malloc_error_break to debug [1] 78485 abort (core dumped) and a tiny bit of example code which will trigger this problem: #define BOOST_FILESYSTEM_VERSION 3 #include <boost/filesystem.hpp> #include <iostream> int main (int argc, char **argv) { std::cout << boost::filesystem::current_path ().string () << '\n'; } This problem always occurs when linking the static boost libraries into the binary. Linking dynamically will work fine, though. I've seen various reports for quite a similar OS X bug with GCC 4.2 and the _GLIBCXX_DEBUG macro set, but this one seems even more generic, as I'm neither using XCode, nor setting the macro (even undefining it does not help. I tried it just to make sure it's really not related to this problem.) Does anybody have any pointers to why this is happening or even maybe a solution (rather than using the dynamic library workaround)? Best regards, Mihai

    Read the article

  • how to load image from file using MFC

    - by Sweety Khan
    **my browse button code is void CFileOpenDlg::OnBnClickedButton1() { // TODO: Add your control notification handler code here CFileDialog dlg(TRUE); int result=dlg.DoModal(); if(result==IDOK) { path=dlg.GetPathName(); UpdateData(FALSE); } } and this is the code for loading an image from resource but tht does not work for loading an image from file. i know LoadImage(); is used for this but how? how can i edit this code to load image from file. Plzz help..... void CFileOpenDlg::OnBnClickedButton2() { // TODO: Add your control notification handler code here CRect r; CBitmap* m_bitmap; CDC dc, *pDC; BITMAP bmp; m_bitmap = new CBitmap(); m_bitmap-LoadBitmapW(IDB_BITMAP1); m_bitmap-GetBitmap(&bmp); pDC = this-GetDC(); dc.CreateCompatibleDC(pDC); dc.SelectObject(m_bitmap); pDC-BitBlt(200, 200, bmp.bmWidth, bmp.bmHeight, &dc,0 , 0, SRCCOPY); m_bitmap-DeleteObject(); m_bitmap-Detach(); } waiting for reply........**

    Read the article

  • Getting wierd issue with TO_NUMBER function in Oracle

    - by Fazal
    I have been getting an intermittent issue when executing to_number function in the where clause on a varchar2 column if number of records exceed a certain number n. I used n as there is no exact number of records on which it happens. On one DB it happens after n was 1 million on another when it was 0.1. million. E.g. I have a table with 10 million records say Table Country which has field1 varchar2 containing numberic data and Id If I do a query as an example select * from country where to_number(field1) = 23 and id 1 and id < 100000 This works But if i do the query select * from country where to_number(field1) = 23 and id 1 and id < 100001 It fails saying invalid number Next I try the query select * from country where to_number(field1) = 23 and id 2 and id < 100001 It works again As I only got invalid number it was confusing, but in the log file it said Memory Notification: Library Cache Object loaded into SGA Heap size 3823K exceeds notification threshold (2048K) KGL object name :with sqlplan as ( select c006 object_owner, c007 object_type,c008 object_name from htmldb_collections where COLLECTION_NAME='HTMLDB_QUERY_PLAN' and c007 in ('TABLE','INDEX','MATERIALIZED VIEW','INDEX (UNIQUE)')), ws_schemas as( select schema from wwv_flow_company_schemas where security_group_id = :flow_security_group_id), t as( select s.object_owner table_owner,s.object_name table_name, d.OBJECT_ID from sqlplan s,sys.dba_objects d It seems its related to SGA size, but google did not give me much help on this. Does anyone have any idea about this issue with TO_NUMBER or oracle functions for large data?

    Read the article

  • Boost link error when using "--layout=system" on VS2005

    - by Kevin
    I'm new to boost, and thought I'd try it out with some realistic deployment scenarios for the .dlls, so I used the following command to compile/install the libraries: .\bjam install --layout=system variant=debug runtime-link=shared link=shared --with-date_time --with-thread --with-regex --with-filesystem --includedir=<my include directory> --libdir=<my bin directory> > installlog.txt That seemed to work, but my simple program (taken right from the "Getting Started" page) fails: #include <boost/regex.hpp> #include <iostream> #include <string> // Place your functions after this line int main() { std::string line; boost::regex pat( "^Subject: (Re: |Aw: )*(.*)" ); while (std::cin) { std::getline(std::cin, line); boost::smatch matches; if (boost::regex_match(line, matches, pat)) std::cout << matches[2] << std::endl; } } This fails with the following linker error: fatal error LNK1104: cannot open file 'libboost_regex-vc80-mt-1_42.lib' I'm sure that both the .lib and the .dlls are in that directory, and named how I want them to be (ie: boost_regex.lib, etc, all unversioned, as the --layout=system says). So why is it looking for the versioned type of it? And how do I get it to look for the unversioned type of the library? I've tried this with more "normal" options, such as below: .\bjam stage --build-type=complete --with-date_time --with-thread --with-filesystem --with-regex > mybuildlog.txt And that works fine. I made sure my compiler saw the "stage\lib" directory, and it compiled and ran fine with nothing beyond having the environment looking into the right lib directory. But when I took those "testing" directories away, and wanted to use these others (unversioned), then it failed. I'm under VS2005 here on XP. Any ideas?

    Read the article

  • How to use data receive event in Socket class?

    - by affan
    I have wrote a simple client that use TcpClient in dotnet to communicate. In order to wait for data messages from server i use a Read() thread that use blocking Read() call on socket. When i receive something i have to generate various events. These event occur in the worker thread and thus you cannot update a UI from it directly. Invoke() can be use but for end developer its difficult as my SDK would be use by users who may not use UI at all or use Presentation Framework. Presentation framework have different way of handling this. Invoke() on our test app as Microstation Addin take a lot of time at the moment. Microstation is single threaded application and call invoke on its thread is not good as it is always busy doing drawing and other stuff message take too long to process. I want my events to generate in same thread as UI so user donot have to go through the Dispatcher or Invoke. Now i want to know how can i be notified by socket when data arrive? Is there a build in callback for that. I like winsock style receive event without use of separate read thread. I also do not want to use window timer to for polling for data. I found IOControlCode.AsyncIO flag in IOControl() function which help says Enable notification for when data is waiting to be received. This value is equal to the Winsock 2 FIOASYNC constant. I could not found any example on how to use it to get notification. If i am write in MFC/Winsock we have to create a window of size(0,0) which was just used for listening for the data receive event or other socket events. But i don't know how to do that in dotnet application.

    Read the article

  • rails not recognizing project

    - by tipu
    I can create a new project using rails and I can use stuff like rails migration ... and i (correctly) get a error because the sqlite gem is missing. but when i try using rails migration ... with a project i checked out from github, it doesn't recognize that it is a rails project i get: Usage: rails new APP_PATH [options] Options: -d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/oracle/postgresql/sqlite3/frontbase/ibm_db) # Default: sqlite3 -O, [--skip-active-record] # Skip Active Record files [--dev] # Setup the application with Gemfile pointing to your Rails checkout -J, [--skip-prototype] # Skip Prototype files -T, [--skip-test-unit] # Skip Test::Unit files -G, [--skip-git] # Skip Git ignores and keeps -b, [--builder=BUILDER] # Path to an application builder (can be a filesystem path or URL) [--edge] # Setup the application with Gemfile pointing to Rails repository -m, [--template=TEMPLATE] # Path to an application template (can be a filesystem path or URL) -r, [--ruby=PATH] # Path to the Ruby binary of your choice # Default: /usr/bin/ruby1.8 [--skip-gemfile] # Don't create a Gemfile and it goes on. any ideas? edit: it's probably an important detail that earlier my rails wasn't working at all. i had to cp /usr/bin/ruby to /usr/bin/local/ruby

    Read the article

  • Restoring dev db from production: Running a set of SQL scripts based on a list stored in a table?

    - by mattley
    I need to restore a backup from a production database and then automatically reapply SQL scripts (e.g. ALTER TABLE, INSERT, etc) to bring that db schema back to what was under development. There will be lots of scripts, from a handful of different developers. They won't all be in the same directory. My current plan is to list the scripts with the full filesystem path in table in a psuedo-system database. Then create a stored procedure in this database which will first run RESTORE DATABASE and then run a cursor over the list of scripts, creating a command string for SQLCMD for each script, and then executing that SQLCMD string for each script using xp_cmdshell. The sequence of cursor-sqlstring-xp_cmdshell-sqlcmd feels clumsy to me. Also, it requires turning on xp_cmdshell. I can't be the only one who has done something like this. Is there a cleaner way to run a set of scripts that are scattered around the filesystem on the server? Especially, a way that doesn't require xp_cmdshell?

    Read the article

  • Misplaced Layout after "home"-button and/or powersave screen

    - by TiGer
    Hi, I have an app which also includes a service with a Notification. Right now I am experiencing the foillowing problem : I start my app which will work fine after couple of minutes the powersave kicks in and I get a black screen I (or hte user) click the Menu-button to dismiss the black screen and to unlock the screenlock Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view... or I start my app which will work fine I press the Home button exiting the app, my service though will (correctly) keep running when selecting my service from the notification-bar I will get once again : -Now my (fullscreen) app will have "moved" like 30-40 pixels downwards, creating an ugly black border or hole. When I move the scrollwheel it will move up and down, and when I press the Menu button (showing my ap''s menu) it will "fix" the view... Any idea what the problem is ? The app is running on a ADP2 with Android 1.6 Thanks in advance ! Ok, after some testing I noticed that if I don't run the Activity on Fullscreen, but just leave the TtileBar away this won't happen... Still this is no solution to me, I want it to be fullscreen... Noticed siomething else, when I have the View with the black bar, and I press the home button it will "refresh" the View correctly just before actually going to the Home Screen :(

    Read the article

  • C#, Can I check on a lock without trying to acquire it?

    - by Biff MaGriff
    Hello, I have a lock in my c# web app that prevents users from running the update script once it has started. I was thinking I would put a notification in my master page to let the user know that the data isn't all there yet. Currently I do my locking like so. protected void butRefreshData_Click(object sender, EventArgs e) { Thread t = new Thread(new ParameterizedThreadStart(UpdateDatabase)); t.Start(this); //sleep for a bit to ensure that javascript has a chance to get rendered Thread.Sleep(100); } public static void UpdateDatabase(object con) { if (Monitor.TryEnter(myLock)) { Updater.RepopulateDatabase(); Monitor.Exit(myLock); } else { Common.RegisterStartupScript(con, AlreadyLockedJavaScript); } } And I do not want to do if(Monitor.TryEnter(myLock)) Monitor.Exit(myLock); else //show processing labal As I imagine there is a slight possibility that it might display the notification when it isn't actually running. Is there an alternative I can use? Edit: Hi Everyone, thanks a lot for your suggestions! Unfortunately I couldn't quite get them to work... However I combined the ideas on 2 answers and came up with my own solution.

    Read the article

  • Form submits but by passing the form validation when button.click is used

    - by Cuty Pie
    I am using form validation plugin as well as html5 attribute=recquired with input type=button or submit and fancybox.when button is clicked ,both validation proceedures work(notification of empty inputs appeare),but instead of this notification ,form is submitted. If I dont use button.click function but use simple submit.then validation works perfectly plugin==http://validatious.org/ javascript function $(document).ready(function() { $('#send').click(function() { $(this).attr("value", 'Applying...'); var id = getParam('ID'); $.ajax({ type:'POST', url:"send.php", data:{option:'catapply', tittle:$('#tittle').val(), aud:aud, con:con, adv:adv, mid:$('#mid').val(), aud2:aud, cid:$('#cid').val(), scid:$('#scname option[selected="saa"]').val(), gtt:$('input[name=gt]:radio:checked').val(), sr:$(":input").serialize() + '&aud=' + aud}, success:function(jd) { $('#' + id).fadeOut("fast", function() { $(this).before("<strong>Success! Your form has been submitted, thanks :)</strong>"); setTimeout("$.fancybox.close()", 1000); }); } }); }); }); AND Html is here <form id="form2" class="validate" style="display: none" > <input type='submit' value='Apply' id="send" class="sendaf validate_any" name="jobforming"/>

    Read the article

  • C# ...extract email address from inside 100's of text files

    - by Developer
    My SMTP server got 100's of errors when sending lots of emails. Now have lots of .BAD files each one containing an error message and somewhere in the middle, the actual email address it was supposed to be sent to. What is the easiest way to extract from each file "just" the "email address", so that I can have a list of the actual failed emails? I can code in C# and any suggestion will be truly welcomed. BAD SAMPLE TEXT: From: [email protected] To: [email protected] Date: Tue, 25 Sep 2012 12:12:09 -0700 MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="9B095B5ADSN=_01CD9B35032DF58000000066my.server.co" X-DSNContext: 7ce717b1 - 1386 - 00000002 - C00402D1 Message-ID: Subject: Delivery Status Notification (Failure) This is a MIME-formatted message. Portions of this message may be unreadable without a MIME-capable mail program. --9B095B5ADSN=_01CD9B35032DF58000000066my.server.co Content-Type: text/plain; charset=unicode-1-1-utf-7 This is an automatically generated Delivery Status Notification. Unable to deliver message to the following recipients, due to being unable to connect successfully to the destination mail server. [email protected] --9B095B5ADSN=_01CD9B35032DF58000000066my.server.com Content-Type: message/delivery-status Reporting-MTA: dns;my.server.com Received-From-MTA: dns;Social Arrival-Date: Tue, 25 Sep 2012 11:45:15 -0700 Final-Recipient: rfc822;[email protected] Action: failed Status: 4.4.7 --9B095B5ADSN=_01CD9B35032DF58000000066my.server.com Content-Type: message/rfc822 Received: from Social ([127.0.0.1]) by my.server.com with Microsoft SMTPSVC(7.5.7601.17514); Tue, 25 Sep 2012 11:45:15 -0700 ====================================== ...and lots more text after ===================== Mainly I want to find the "[email protected]" email right in the middle...

    Read the article

< Previous Page | 72 73 74 75 76 77 78 79 80 81 82 83  | Next Page >