Search Results

Search found 2894 results on 116 pages for 'michael lucas'.

Page 12/116 | < Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >

  • Android Persistent ContentObserver

    - by Lucas Stark
    Are content observers persistent in Android? If I create a content observer in an activity, will that observer continue to run until I remove the observer. Basically I am creating a service for SMS, where on receive and on send I post the SMS out to a web service, so I can check my messages with out having my phone. If the content observer is tied to the Activity's life, how can I create a ContentObserver that will always receive notifications on content:/sms/

    Read the article

  • How-to index arrays (tags) in CouchDB using couchdb-lucene

    - by Lucas
    The setup: I have a project that is using CouchDB. The documents will have a field called "tags". This "tags" field is an array of strings (e.g., "tags":["tag1","tag2","etc"]). I am using couchdb-lucene as my search provider. The question: What function can be used to get couchdb-lucene to index the elements of "tags"? If you have an idea but no test environment, type it out, I'll try it and give the result here.

    Read the article

  • Stop UITextView from jumping when programatically setting text

    - by Michael Waterfall
    Hi there, I have to update a small amount of text in a scrolling UITextView. I'll only be inserting a character where the cursor currently is, and I'll be doing this on a press of a button on my navigation bar. My problem is that whenever I call the setText method of the text view, it jumps to the bottom of the text. I've tried using contentOffset and resetting the selectedRange but it doesn't work! Here's my example: // Remember offset and selection CGPoint contentOffset = [entryTextView contentOffset]; NSRange selectedRange = [entryTextView selectedRange]; // Update text entryTextView.text = entryTextView.text; // Try and reset offset and selection [entryTextView setContentOffset:contentOffset animated:NO]; [entryTextView setSelectedRange: selectedRange]; Is there any way you can update the text without any scroll movement at all... as if they'd just typed something on the keyboard? Many thanks, Michael Edit: I've tried using the textViewDidChange: delegate method but it's still not scrolling up to the original location. - (void)textViewDidChange:(UITextView *)textView { if (self.programChanged) { [textView setSelectedRange:self.selectedRange]; [textView setContentOffset:self.contentOffset animated:NO]; self.programChanged = NO; } } - (void)changeButtonPressed:(id)sender { // Remember position self.programChanged = YES; self.contentOffset = [entryTextView contentOffset]; self.selectedRange = [entryTextView selectedRange]; // Update text entryTextView.text = entryTextView.text; }

    Read the article

  • NSIS takes ownership of IIS system files

    - by Lucas
    I recently encountered an issue with NSIS that I believe is related to an interaction with UAC, but I am at a loss to explain it and I do not know how to prevent it in the future. I have an installer that creates and removes IIS virtual directories using the NsisIIS plugin. The installer appeared worked correctly on my Windows 7 workstation. When the installer was run on a Windows 2008 R2 server it installed properly, but the uninstaller removed all of the virtual directories and put IIS is an unusable state; to the point that I had to remove the Default Web Site and re-add it. What I eventually found was that all of the IIS configuration files under C:\Windows\System32\inetsrv\config had a lock icon on them. Some investigation seem to indicate that this means a user account has taken ownership of the file, however all the files listed SYSTEM as the file owner. I did check a different server that I have not run the installer on, and it does not have the lock icon applied to the IIS files. I have also seen the same lock icon appear on other files that the NSIS installer creates. For instance, I have a Web.Config.tpl file that is processed using the NSIS ReplaceInFile which also appears with the lock icon after the installer finished. After I explicitly grant another user account access to the file, the lock icon goes away. I run the installer under the local Administrator account on the 2008 R2 server, so I do not get the UAC prompt. Here is the relevant code from the install.nsi file RequestExecutionLevel admin Section "Application" APP_SECTION SectionIn RO Call InstallApp SectionEnd Section "un.Uninstaller Section" Delete "$PROGRAMFILES\${PROGRAMFILESDIR}\Uninstall.exe" Call un.InstallApp SectionEnd Function InstallApp File /oname=Web.Config Web.Config.tpl !insertmacro ReplaceInFile Web.Config %CONNECTION_STRING% $CONNECTION_STRING FunctionEnd Function un.InstallApp ReadRegStr $0 HKLM "Software\${REGKEY}" "VirtualDir" NsisIIS::DeleteVDir "$0" Pop $0 FunctionEnd I have three questions stemming from this incident: How did this happen? How can I fix my installer to prevent it from happening again? How can I repair the permissions on the IIS config files.

    Read the article

  • Quick way to create JSF custom component

    - by michael lucas
    I know of two ways of creating custom JSF components: 1. Native JSF way: creating JSF component class, tag, etc. 2. Facelets way: defining component in a xhtml file and then creating appropriate decrption in facelets taglib. Currently I work on a project in which introducing facelets is unfortunately out of the question. On the other hand, creating custom components the standard JSF way seems like a pain in the ass. Is there maybe a third party library that allows creating custom components in the way similar to facelets but doesn't entail the need of using non-standard renderer?

    Read the article

  • Detection of page refresh / F5 key in ASP.NET MVC 2

    - by Michael
    How would one go about detecting a page refresh / F5 key push on the controller handling the postback? I need to distinguish between the user pressing one of two buttons (e.g., Next, Previous) and when the F5 / page refresh occurs. My scenario is a single wizard page that has different content shown between each invocation of the user pressing the "Next" or "Previous" buttons. The error that I am running into is when the user refreshes the page / presses the F5 key, the browser re-sends the request back to the controller, which is handled as a post-back and the FormCollection type is used to look for the "submitButton" key and obtain its value (e.g., "Next," "Send"). This part was modeled after the post by Dylan Beattie at http://stackoverflow.com/questions/442704/how-do-you-handle-multiple-submit-buttons-in-asp-net-mvc-framework. Maybe I'm trying to bend MVC 2 to where it isn't meant to go but I'd like to stay with the current design in that the underlying database drives the content and order of what is shown. This allows us to add new content into the database without modifying the code the displays the content. Thanks, Michael

    Read the article

  • Problem using Hibernate Projections

    - by Lucas
    Hello! I'm using Richfaces + HibernateQuery to create a data list. I'm trying to use Hibernate Projections to group my query result. Here is the code: final DetachedCriteria criteria = DetachedCriteria .forClass(Class.class, "c") .setProjection(Projections.projectionList() .add(Projections.groupProperty("c.id"))); ... in the .xhtml file i have the following code: <rich:dataTable width="100%" id="dataTable" value="#{myBean.dataModel}" var="row"> <f:facet name="header"> <rich:columnGroup> ...... </rich:columnGroup> </f:facet> <h:column> <h:outputText value="#{row.id}"/> </h:column> <h:column> <h:outputText value="#{row.name}"/> </h:column> But when i run the page it gives me the following error: Error: value="#{row.id}": The class 'java.lang.Long' does not have the property 'id'. If i take out the Projection from the code it works correctly, but it doesn't group the result. So, which mistake could be happening here? EDIT: Here is the full criteria: final DetachedCriteria criteria = DetachedCriteria.forClass(Class.class, "c"); criteria.setFetchMode("e.zzzzz", FetchMode.JOIN); criteria.createAlias("e.aaaaaaaa", "aa"); criteria.add(Restrictions.ilike("aa.information", "informations....")); criteria.setProjection(Projections.distinct(Projections.projectionList() .add(Projections.groupProperty("e.id").as("e.id")))); getDao().findByCriteria(criteria); if i take the "setProjection" line it works fine. I don't understand why it gives that error putting that line.

    Read the article

  • Help matching fields between two classes

    - by Michael
    I'm not too experienced with Java yet, and I'm hoping someone can steer me in the right direction because right now I feel like I'm just beating my head against a wall... The first class is called MeasuredParams, and it's got 40+ numeric fields (height, weight, waistSize, wristSize - some int, but mostly double). The second class is a statistical classifier called Classifier. It's been trained on a subset of the MeasuredParams fields. The names of the fields that the Classifier has been trained on is stored, in order, in an array called reqdFields. What I need to do is load a new array, toClassify, with the values stored in the fields from MeasuredParams that match the field list (including order) found in reqdFields. I can make any changes necessary to the MeasuredParams class, but I'm stuck with Classifier as it is. My brute-force approach was to get rid of the fields in MeasuredParams and use an arrayList instead, and store the field names in an Enum object to act as an index pointer. Then loop through the reqdFields list, one element at a time, and find the matching name in the Enum object to find the correct position in the arrayList. Load the value stored at that positon into toClassify, and then continue on to the next element in reqdFields. I'm not sure how exactly I would search through the Enum object - it would be a lot easier if the field names were stored in a second arrayList. But then the index positions between the two would have to stay matched, and I'm back to using an Enum. I think. I've been running around in circles all afternoon, and I keep thinking there must be an easier way of doing it. I'm just stuck right now and can't see past what I've started. Any help would be GREATLY appreciated. Thanks so much! Michael

    Read the article

  • How to document an XML Schema?

    - by lucas clemente
    I have developed a XML schema for an application I wrote. Now I want to document the valid structure for the end user, however I can't come up with any natural way to do this. I've seen things like xs3p, which essentially converts a xsd schema to a HTML representation, however that doesn't look like good documentation to me; the user shouldn't need to know anything about schemas to understand what he is allowed to do. Any ideas how to document this? Any programs / editors / graphical solutions or simply concepts I can build on?

    Read the article

  • qt on Win CE 5.0 crash

    - by Michael
    Good day all, It's the first time I am using Qt on Windows CE and I ran into an issue. Maybe someone can help me with it. I will describe my set up. I am using XP with Visual Studio 2005 an Qt Add-in version 1.1.2. I downloaded Qt source for Windows CE and followed the instructions on these (http://doc.trolltech.com/4.4/install-wince.html) instructions to build the library for CE. I then used the Visual Studio to create a minimal Qt Windows CE Application. The program runs fine in the CE emulator, but once I try to deploy it on the device it crashes with the following message: Load module: qt_ce_3.exe Load module: QtGui4.dll Load module: msvcr80.dll Load module: QtCore4.dll Load module: CEShell.DLL Load module: OLEAUT32.dll Load module: commctrl.dll.0409.MUI Load module: commctrl.dll Load module: aygshell.dll Load module: WS2.dll Load module: WINSOCK.dll Load module: coredll.dll.0409.MUI Load module: ossvcs.dll Load module: ole32.dll Load module: coredll.dll Load module: MMTimer.dll Data Abort: Thread=8fb09a40 Proc=8c4ecea0 'qt_ce_3.exe' AKY=00040001 PC=012a80b0(qtcore4.dll+0x000680b0) RA=012a8168(qtcore4.dll+0x00068168) BVA=676e4574 FSR=000000f5 Unhandled exception at 0x012a80b0 in qt_ce_3.exe: 0xC0000005: Access violation reading location 0x676e4574. I tried it on two devices from different manufacturers, and the result is the same. Debug version worked on one of them, ran out of memory on the other. Does anyone have any idea what this could be? Thanks in advance, Michael

    Read the article

  • Generic function pointers in C

    - by Lucas
    I have a function which takes a block of data and the size of the block and a function pointer as argument. Then it iterates over the data and performes a calculation on each element of the data block. The following is the essential outline of what I am doing: int myfunction(int* data, int size, int (*functionAsPointer)(int)){ //walking through the data and calculating something for (int n = 0; n < size; n++){ data[n] = (*function)(data[n]); } } The functions I am passing as arguments look something like this: int mycalculation(int input){ //doing some math with input //... return input; } This is working well, but now I need to pass an additional variable to my functionpointer. Something along the lines int mynewcalculation(int input, int someVariable){ //e.g. input = input * someVariable; //... return input; } Is there an elegant way to achieve this and at the same time keeping my overall design idea?

    Read the article

  • C# thread with multiple parameters

    - by Lucas B
    Does anyone know how to pass multiple parameters into a Thread.Start routine? I thought of extending the class, but the C# Thread class is sealed. Here is what I think the code would look like: ... Thread standardTCPServerThread = new Thread(startSocketServerAsThread); standardServerThread.Start( orchestrator, initializeMemberBalance, arg, 60000); ... } static void startSocketServerAsThread(ServiceOrchestrator orchestrator, List<int> memberBalances, string arg, int port) { startSocketServer(orchestrator, memberBalances, arg, port); } Thank you in advance. BTW, I start a number of threads with different orchestrators, balances and ports. Please consider thread safety also.

    Read the article

  • htaccess: how to differentiate document requests from variable requests? ... also, how to allow for

    - by Lucas
    hello, my last post was met by smarmy, unhelpful "answers" (comments), so i'll get right to it: if i have and htaccess file like so: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ - [L] RewriteRule ^([^/]+)/([^/]+)$ /index.php?page=$1&subject=$2 RewriteRule ^([^/]+)$ /index.php?page=$1 [L] how can i allow for other url variable names and values to be handled... say for instance i want to add extra unexpected url vars to this scenario /page/subject?urlvar1=value1&urlvar2=value2 and get the page i want without creating unexpected results? any real help is greatly appreciated. thanks!

    Read the article

  • Visual Studio C++ multi-project solution

    - by Lucas
    I have created an C++ solution in VS2008. The first project contains the model. The second projects is the view. The problem is that i don't get make references to my model classes defined in the first project. The message error is : Error 1 fatal error C1083: Cannot open include file: 'utils/GeradorSistematicoDeAlturaDoPlanoDeCorteStrategy.h': No such file or directory c:\Users\user\Programação em C++\Simulacao\Simulacao_Testes\src\Teste1.cpp 3 Simulacao_Testes Is there any configuration in VS2008 that makes to be made in order to, from the my view (second project) project, i do make references to the first project, the model?

    Read the article

  • Poor LLVM JIT performance

    - by Paul J. Lucas
    I have a legacy C++ application that constructs a tree of C++ objects. I want to use LLVM to call class constructors to create said tree. The generated LLVM code is fairly straight-forward and looks repeated sequences of: ; ... %11 = getelementptr [11 x i8*]* %Value_array1, i64 0, i64 1 %12 = call i8* @T_string_M_new_A_2Pv(i8* %heap, i8* getelementptr inbounds ([10 x i8]* @0, i64 0, i64 0)) %13 = call i8* @T_QueryLoc_M_new_A_2Pv4i(i8* %heap, i8* %12, i32 1, i32 1, i32 4, i32 5) %14 = call i8* @T_GlobalEnvironment_M_getItemFactory_A_Pv(i8* %heap) %15 = call i8* @T_xs_integer_M_new_A_Pvl(i8* %heap, i64 2) %16 = call i8* @T_ItemFactory_M_createInteger_A_3Pv(i8* %heap, i8* %14, i8* %15) %17 = call i8* @T_SingletonIterator_M_new_A_4Pv(i8* %heap, i8* %2, i8* %13, i8* %16) store i8* %17, i8** %11, align 8 ; ... Where each T_ function is a C "thunk" that calls some C++ constructor, e.g.: void* T_string_M_new_A_2Pv( void *v_value ) { string *const value = static_cast<string*>( v_value ); return new string( value ); } The thunks are necessary, of course, because LLVM knows nothing about C++. The T_ functions are added to the ExecutionEngine in use via ExecutionEngine::addGlobalMapping(). When this code is JIT'd, the performance of the JIT'ing itself is very poor. I've generated a call-graph using kcachegrind. I don't understand all the numbers (and this PDF seems not to include commas where it should), but if you look at the left fork, the bottom two ovals, Schedule... is called 16K times and setHeightToAtLeas... is called 37K times. On the right fork, RAGreed... is called 35K times. Those are far too many calls to anything for what's mostly a simple sequence of call LLVM instructions. Something seems horribly wrong. Any ideas on how to improve the performance of the JIT'ing?

    Read the article

  • File-level filesystem change notification in Mac OS X

    - by Paul J. Lucas
    I want my code to be notified when any file under (either directly or indirectly) a given directory is modified. By "modified", I mead I want my code to be notified whenever a file's contents are altered, it's renamed, or it's deleted; or if a new file is added. For my application, there can be thousands of files. I looked as FSEvents, but its Technology Overview says, in part: The important point to take away is that the granularity of notifications is at a directory level. It tells you only that something in the directory has changed, but does not tell you what changed. It also says: The file system events API is also not designed for finding out when a particular file changes. For such purposes, the kqueues mechanism is more appropriate. However, in order to use kqueue on a given file, one has to open the file to obtain a file descriptor. It's impractical to manage thousands of file descriptors (and would probably exceed the maximum allowable number of open file descriptors anyway). Curiously, under Windows, I can use the ReadDirectoryChangesW() function and it does precisely what I want. So how can one do what I want under Mac OS X? Or, asked another way: how would one go about writing the equivalent of ReadDirectoryChangesW() for Mac OS X in user-space (and do so very efficiently)?

    Read the article

< Previous Page | 8 9 10 11 12 13 14 15 16 17 18 19  | Next Page >