Search Results

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

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

  • Testing install procedure of a program requiring administrative privileges

    - by Lucas Meijer
    I'm trying to write automated test, to ensure that the installer for my program works okay. The program can be installed for all users (requires admin privs), or for current user (does not require admin privs). The program can also autoupdate itself, which in some cases requires admin privileges, and in some cases doesn't. I'm looking for a way where I can have an automated test click "Yes, Allow" on the UAC dialogs, so I can write tests for all different scenarios, on many different operating systems, so that I can be confident when I make changes to the installer that I didn't break anything. Obviously, the installer process itself cannot do this. However, I control the complete machine, and could easily start some sort of daemon process with administrative rights, that the testprogram could make a socket connection to, to request it to "please click ok on the UAC now".

    Read the article

  • How to have struct members accessible in different ways

    - by Paul J. Lucas
    I want to have a structure token that has start/end pairs for position, sentence, and paragraph information. I also want the members to be accessible in two different ways: as a start/end pair and individually. Given: struct token { struct start_end { int start; int end; }; start_end pos; start_end sent; start_end para; typedef start_end token::*start_end_ptr; }; I can write a function, say distance(), that computes the distance between any of the three start/end pairs like: int distance( token const &i, token const &j, token::start_end_ptr mbr ) { return (j.*mbr).start - (i.*mbr).end; } and call it like: token i, j; int d = distance( i, j, &token::pos ); that will return the distance of the pos pair. But I can also pass &token::sent or &token::para and it does what I want. Hence, the function is flexible. However, now I also want to write a function, say max(), that computes the maximum value of all the pos.start or all the pos.end or all the sent.start, etc. If I add: typedef int token::start_end::*int_ptr; I can write the function like: int max( list<token> const &l, token::int_ptr p ) { int m = numeric_limits<int>::min(); for ( list<token>::const_iterator i = l.begin(); i != l.end(); ++i ) { int n = (*i).pos.*p; // NOT WHAT I WANT: It hard-codes 'pos' if ( n > m ) m = n; } return m; } and call it like: list<token> l; l.push_back( i ); l.push_back( j ); int m = max( l, &token::start_end::start ); However, as indicated in the comment above, I do not want to hard-code pos. I want the flexibility of accessible the start or end of any of pos, sent, or para that will be passed as a parameter to max(). I've tried several things to get this to work (tried using unions, anonymous unions, etc.) but I can't come up with a data structure that allows the flexibility both ways while having each value stored only once. Any ideas how to organize the token struct so I can have what I want? Attempt at clarification Given struct of pairs of integers, I want to be able to "slice" the data in two distinct ways: By passing a pointer-to-member of a particular start/end pair so that the called function operates on any pair without knowing which pair. The caller decides which pair. By passing a pointer-to-member of a particular int (i.e., only one int of any pair) so that the called function operates on any int without knowing either which int or which pair said int is from. The caller decides which int of which pair. Another example for the latter would be to sum, say, all para.end or all sent.start. Also, and importantly: for #2 above, I'd ideally like to pass only a single pointer-to-member to reduce the burden on the caller. Hence, me trying to figure something out using unions.

    Read the article

  • How to differentiate document requests from variable requests? and how to allow for urls that are no

    - by Lucas
    Hello. My last post was met by smarmy, unhelpful "answers" (comments), so i'll get right to it: if I have an 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

  • Crashing when pushing a XIB based view controller onto navigation controller stack

    - by Michael
    I was attempting to clean up the implementation for a sub-panel on a navigation controller stack, so that the navigation bar could be customized in the XIB instead of doing it manually in the viewDidLoad method. The original (working) setup had the XIB set up with the "File's Owner" class set to the view controller class, and then the view at the top level. This works fine. In the "Interface Builder User Guide", p. 71, it describes the recommended way to build the XIBs for sub-panels ("additional navigation levels"). This approach leaves the "File's Owner" class as NSObject, but adds a UIViewController at the top level, and nests the view (and navigation item) underneath it. The UIViewController's view automatically gets connected to the contained view. When I try to push the controller init'd with this new XIB, the app crashes because of a missing view: SettingsViewController *controller = [[SettingsViewController alloc] initWithNibName:@"SettingsView" bundle:nil]; [self.navigationController pushViewController:controller animated:YES]; 2010-04-23 11:17:37.135 xxxx[1173:207] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "SettingsTestView" nib but the view outlet was not set.' I've double checked everything, and tried building a clean XIB from scratch, but get the same result. I looked through a number of the code sample projects, and NONE of them use the documented/recommended approach--they all use the File's Owner class and manually set up the navigation bar in viewDidLoad like I originally had it. Is it possible to get it working the "recommended" way? Thanks! Michael

    Read the article

  • CouchDB, HDFS, HBase or which is right for my situation?

    - by Lucas
    Hello all, This question is regarding data storage systems such as CouchDB, HDFS and HBase, specifically, which is right. I am looking at making a simple and customized Document Management System for my organization. Basically, we need the ability to store some Word Documents, PDFs and other similar files. I also want to store metadata about these files (e.g., Author, Dates, etc). Usage permissions would also be handy, but that can probably be built using meta-data. I would also need the ability to full-text index. The ability to version, while not required would be extremely useful. I would like the ability to simply add hardware to expand the resources of the system and the system must support Network Attached Storage over the CIFS or NFS protocol(s). I have read about CouchDB, HDFS and HBase. My preferred programming language is C# as all of my end-users will be running Windows machines and I will want to make both web and winforms client implementations. My question is which solution best fits my needs? Based on my research it appears that CouchDB (utilizing the CouchDB-Lounge and CouchDB-Lucene) perfectly fits my needs. However, I am worried that since I have worked with CouchDB that I might be overlooking something useful for my needs in HDFS or HBase or something similar due to a bias. Any and all opinions are welcome as I am looking for the community input as I really do not want to make the wrong choice at the start of my project. Please ask if you need more information. I thank you all for your time, input and assistance.

    Read the article

  • Code to strip diacritical marks using ICU

    - by Paul J. Lucas
    Can somebody please provide some sample code to strip diacritical marks (i.e., replace characters having accents, umlauts, etc., with their unaccented, unumlauted, etc., character equivalents, e.g., every accented é would become a plain ASCII e) from a UnicodeString using the ICU library in C++? E.g.: UnicodeString strip_diacritics( UnicodeString const &s ) { UnicodeString result; // ... return result; } Assume that s has already been normalized. Thanks.

    Read the article

  • FileReader File not Found Java

    - by Lucas Camargo de Carvalho
    I have done everything I know. The file is not a ".filetype.filetype". It is in the same folder as the .settings and the other project files. Why is this not working? Full path isn't working either, but strangely, a Scanner is working. import java.io.FileReader; public class test { public static void main(String[] args) { FileReader testFileReader = new FileReader("hotels.json"); } }

    Read the article

  • Help with ZK component development

    - by Lucas
    I'm developing a simple component. My jar structure is: br/netsoft/zkComponents/Tef.class META-INF/MANIFEST.MF metainfo/zk/lang-addon.xml web/js/br/netsoft/zkComponents.js web/zkComponents/tef.dsp My dsp file is: <c:set var="self" value="${requestScope.arg.self}"/> <span z.type="br.netsoft.zkComponents.Tef" id="${self.uuid}" ${self.outerAttrs}${self.innerAttrs}> <applet archive="tef.jar" id="tefApplet" code="br.netsoft.applets.tef.TEFProxy" width="0px" height="0px" /> <span/> and the language-addon.xml is: <language-addon> <addon-name>componentes</addon-name> <language-name>xul/html</language-name> <component> <component-name>tef</component-name> <component-class>br.netsoft.zkComponents.Tef</component-class> <mold> <mold-name>default</mold-name> <mold-uri>~./zkComponents/tef.dsp</mold-uri> </mold> </component> </language-addon> When i try to test this component, appears a pop-up showing : " /js/br/netsoft/zkComponents.js not found" what is wrong?

    Read the article

  • Check if Django model field choices exists

    - by Justin Lucas
    I'm attempting to check if a value exists in the choices tuple set for a model field. For example lets say I have a Model like this: class Vote(models.Model): VOTE_TYPE = ( (1, "Up"), (-1, "Down"), ) value = models.SmallIntegerField(max_length=1, choices=VOTE_TYPES) Now lets say in a view I have a variable new_value = 'Up' that I would like to use as the value field in a new Vote. How can I first check to see if the value of that variable exists in the VOTE_TYPE tuple? Thank you.

    Read the article

  • Using UNINSTALL_SHORTCUT Intent

    - by Lucas S.
    I am trying to use the following intent action, but i get an ActivityNotFoundException in the fisrt case. And nothing at all in the second case. "com.android.launcher.action.UNINSTALL_SHORTCUT" I try to use it with the following code: Intent i = new Intent ("com.android.launcher.action.UNINSTALL_SHORTCUT"); startActivity(i); Also with the following: Intent i = new Intent ("com.android.launcher.action.UNINSTALL_SHORTCUT"); sendBroadCast(i);

    Read the article

  • .htaccess mod_rewrite is preventing certain files from being served

    - by Lucas
    i have a successful use of mod_rewrite to make a site display as i wish... however, i have migrated the 'mock-up' folder to the root directory and in implementing these rules for the site, some files are not being served in the ^pdfs folder: RewriteCond %{REQUEST_FILENAME} -f RewriteRule ^ - [L] (old directory) RewriteRule ^redesign_03012010/mock-up/([^/]+)/([^/]+)$ /redesign_03012010/mock-up/index.php?page=$1&section=$2 [PT] RewriteRule ^redesign_03012010/mock-up/([^/]+)$ /redesign_03012010/mock-up/index.php?page=$1 [PT,L] (new directory) RewriteRule ^([^/]+)/([^/]+)$ /index.php?test=1&page=$1&section=$2 [PT] RewriteRule ^([^/]+)$ /index.php?test=1&page=$1 [PT,L] ... ^pdfs (aka /pdfs/) is not serving the files... any suggestions?

    Read the article

  • IE7 div floating bug

    - by Michael Frey
    I have the following <div id="border" style="width:100%; border:8px solid #FFF"> <div id="menu" style="width:250px; float:left;" > Some menu </div> <div id="content" style="padding-left:270px; width:520px;" > Main page content </div> </div> This gives me a left aligned menu and the content to the right of it, all surrounded by a border. On all browsers including IE8 it displays correctly. But on IE7 the content only starts below the menu, and leaves a big open space to the right of the menu. I have searched all kind of solutions and tried all kinds of combinations of right, left, none for float. clearing left right both. It always displays different on the browsers. Any help is appreciated. Michael

    Read the article

  • Question about using adaptive layout + print style sheet

    - by Michael
    Hey everyone, In my web design class, we looked at creating different style sheets for different window sizes and using a javascript that detects the window size and loads the right style sheet. In the head, I'm linking to three external style sheets, as well as a link to the javascript file. So the adaptive layout works fine. However... I also need to be able to use a print style sheet with this particular webpage (it's the requirement for this project). The problem is this that the way the javascript was written makes it so that it ignores the print style sheet. When I go to print preview, it ignores the print style sheet and the preview shows me all of my webpage unstyled. It looks like just the html when opened in a browser. I am using the javascript by Kevin Hale at ParticleTree, and I'm sure there are those familiar with this :] http://particletree.com/examples/dynamiclayouts/ I would like to know what needs to be changed so that the print style sheet isn't ignored. I've shown this to my professor. However, her email wasn't clear enough, but I understand that somehow the script is ignoring the print.css and that's why the print preview shows a css-less preview. Since it's the weekend, I won't be able to get an answer until Monday, and I was hoping someone can help me out. Thank you very much! Michael

    Read the article

  • What is difference between my atoi() calls?

    - by Lucas
    I have a big number stored in a string and try to extract a single digit. But what are the differences between those calls? #include <iostream> #include <string> int main(){ std::string bigNumber = "93485720394857230"; char tmp = bigNumber.at(5); int digit = atoi(&tmp); int digit2 = atoi(&bigNumber.at(5)) int digit3 = atoi(&bigNumber.at(12)); std::cout << "digit: " << digit << std::endl; std::cout << "digit2: " << digit2 << std::endl; std::cout << "digit3: " << digit3 << std::endl; } This will produce the following output. digit: 7 digit2: 2147483647 digit3: 57230 The first one is the desired result. The second one seems to me to be a random number, which I cannot find in the string. The third one is the end of the string, but not just a single digit as I expected, but up from the 12th index to the end of the string. Can somebody explain the different outputs to me? EDIT: Would this be an acceptable solution? char tmp[2] = {bigNumber.at(5), '\0'}; int digit = atoi(tmp); std::cout << "digit: " << digit << std::endl;

    Read the article

  • Need to close a popup after javascript completes image upload then load new page

    - by Michael Robinson
    I got a problem. I have a image upload script that runs on a popup up when you select "upload button", after it is complete instead of closing it stays in the uploader.html window. I need it to close and go to a new page. Here is some of the xml that the script uses, can I change the "urlOnUploadSucess" line to close the popup and load a new page on the original page I came from? .....<upload preload="Preloading images:" upload="Uploading images to server:" prepare="Processing and image compression:" of="of" cancel="Cancel" start="Start" warning_empty_required_field="Warning! One of the required fields is empty!" confirm="Will be uploaded:"/> <urls urlToUpload="upload.php?" urlOnUploadSuccess="http://www.baublet.com/purchase.html" urlOnUploadFail="http://www.baublet.com/tryagain.html" urlUpdateFlashPlayer="http://www.baublet.com/flashalternative.html" useMessageBoxesAfterUpload="false" messageOnUploadSuccess="Images were successfully uploaded!" messageOnUploadFail="Error! Images failed to upload!" jsFunctionNameOnUpload=""/> ..... Thanks, Michael

    Read the article

  • python-iptables: Cryptic error when allowing incoming TCP traffic on port 1234

    - by Lucas Kauffman
    I wanted to write an iptables script in Python. Rather than calling iptables itself I wanted to use the python-iptables package. However I'm having a hard time getting some basic rules setup. I wanted to use the filter chain to accept incoming TCP traffic on port 1234. So I wrote this: import iptc chain = iptc.Chain(iptc.TABLE_FILTER,"INPUT") rule = iptc.Rule() target = iptc.Target(rule,"ACCEPT") match = iptc.Match(rule,'tcp') match.dport='1234' rule.add_match(match) rule.target = target chain.insert_rule(rule) However when I run this I get this thrown back at me: Traceback (most recent call last): File "testing.py", line 9, in <module> chain.insert_rule(rule) File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1133, in insert_rule self.table.insert_entry(self.name, rbuf, position) File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1166, in new obj.refresh() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1230, in refresh self._free() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1224, in _free self.commit() File "/usr/local/lib/python2.6/dist-packages/iptc/__init__.py", line 1219, in commit raise IPTCError("can't commit: %s" % (self.strerror())) iptc.IPTCError: can't commit: Invalid argument Exception AttributeError: "'NoneType' object has no attribute 'get_errno'" in <bound method Table.__del__ of <iptc.Table object at 0x7fcad56cc550>> ignored Does anyone have experience with python-iptables that could enlighten on what I did wrong?

    Read the article

  • Mockito verify no more interactions but omit getters

    - by michael lucas
    Mockito api provides method: Mockito.verifyNoMoreInteractions(someMock); but is it possible in Mockito to declare that I don't want more interactions with a given mock with the exceptions of interactions with its getter methods? The simple scenario is the one in which I test that sut changes only certain properties of a given mock and lefts other properties untapped. In example I want to test that UserActivationService changes property Active on an instance of class User but does't do anything to properties like Role, Password, AccountBalance, etc. I'm open to criticism regarding my approach to the problem.

    Read the article

  • JBoss Clustered Service that sends emails from txt file

    - by michael lucas
    I need a little push in the right direction. Here's my problem: I have to create an ultra-reliable service that sends email messages to clients whose addresses are stored in txt file on FTP server. Single txt file may contain unlimited number of entries. Most often the file contains about 300,000 entries. Service exposes interface with just two simple methods: TaskHandle sendEmails(String ftpFilePath); ProcessStatus checkProcessStatus(TaskHandle taskHandle); Method sendEmails() returns TaskHandle by which we can ask for ProcessStatus. For such a service to be reliable clustering is necessary. Processing single txt file might take a long time. Restarting one node in a cluster should have no impact on sending emails. We use JBoss AS 4.2.0 which comes with a nice HASingletonController that ensure one instance of service is running at given time. But once a fail-over happens, the second service should continue work from where the first one stopped. How can I share state between nodes in a cluster in such a way that leaves no possibility of sending some emails twice?

    Read the article

  • Starting and stopping firefox from c#

    - by Lucas Meijer
    When I start /Applications/Firefox.app/Contents/MacOS/firefox-bin on MacOSX using Process.Start() using Mono, the id of the process that gets returned does not match the process that firefox ends up running under. It looks like firefox quickly decides to start another process, and kill the current one. This makes it difficult to stop firefox, and to detect if it is still running. I've tried starting firefox using the -no-remote flag, to no avail. Is there a way to start firefox in such a way that it doesn't do this "I'll quickly make a new process for you" dance? The situation can somewhat be detected by making sure Firefox keeps on running for at least 3 seconds after its start, and when it does not, scan for other firefox processes. However, this technique is shaky at best, as on slow days it might take a bit more than 3 seconds, and then all tests depending on this behaviour fail. It turns out, that this behaviour only happens when asking firefox to start a specific profile using -P MyProfile. (Which I need to do, as I need to start firefox with specific proxyserver settings) If I start firefox "normally" it does stick to its process.

    Read the article

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