Search Results

Search found 775 results on 31 pages for 'mr tamer'.

Page 19/31 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • interactive lua: command line arguments

    - by mr calendar
    I wish to do lua prog.lua arg1 arg2 from the command line Inside prog.lua, I want to say, for instance print (arg1, arg2, '\n') Lua doesn't seem to have argv[1] etc and the methods I've seen for dealing with command line arguments seem to be immature and / or cumbersome. Am I missing something?

    Read the article

  • Core Data confusion: fetch without tableview.

    - by Mr. McPepperNuts
    I have completed and reproduced Core Data tutorials using a tableview to display contents. However, I want to access an Entity through a fetch on a view without a tableview. I used the following fetch code, but the count returned is always 0. The data exists when the database is opened using SQLite tools. NSManagedObject *entryObj; XYZDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; NSManagedObjectContext *managedObjectContext = appDelegate.managedObjectContext; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Quote" inManagedObjectContext:managedObjectContext]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"id" ascending:YES]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [request setEntity: entity]; NSArray *results = [managedObjectContext executeFetchRequest:request error:nil]; if (results == nil) { NSLog(@"No results found"); entryObj = nil; }else { NSLog(@"results %d", [results count]); } [request release]; [sortDescriptors release]; count returned is always 0; it should be 5. Can anyone point me to a reference or tutorial regarding creating a controller not to be used with a tableview.

    Read the article

  • Getting a visitors Facebook page

    - by Mr Carl
    Hey guys, this is more of a question out of curiosity, but is it possible to get somebody's Facebook page after they have visited your site? Was thinking maybe a chain of lookup stuff could be used starting with an IP to eventually perhaps get a name and thus that person's Facebook page. I have also heard you can read somebody's web history, is this true?

    Read the article

  • c++ callback syntax in a class

    - by Mr Bell
    I am trying to figure out the syntax to register a callback with this 3rd party software. I think it is probably a basic question, I just am not too familiar with c++. They have a method for registering a callback function so their code can call a function in my code when an event happens. They provided a working example that registers the callback from the main file, but I want to know how to do it when working inside a class Their method signature: smHTRegisterHeadPoseCallback(smEngineHandle engine_handle, void *user_data, smHTHeadPoseCallback callback_fun); Working example from the main file: void STDCALL receiveHeadPose(void *,smEngineHeadPoseData head_pose, smCameraVideoFrame video_frame) { ... } void main() { ... smHTRegisterHeadPoseCallback(engine_handle,0,receiveHeadPose) ... } But I want to use this from my class MyClass.h class FaceEngine { public: void STDCALL receiveFaceData(void *, smEngineFaceData face_data, smCameraVideoFrame video_frame); ... MyClass.cpp void FaceEngine::Start(void) { rc = smHTRegisterFaceDataCallback(hFaceAPIEngine,0,&FaceEngine::receiveFaceData); ... Results in this compiler error: Error 1 error C2664: 'smHTRegisterFaceDataCallback' : cannot convert parameter 3 from 'void (__stdcall FaceEngine::* )(void *,smEngineFaceData,smCameraVideoFrame)' to 'smHTFaceDataCallback' d:\stuff\programming\visual studio 2008\projects\tut02_vertices\faceengine.cpp 43 Beard If my question isn't clear please let me know how I can clarify.

    Read the article

  • How do i render a web cam filter instead of video file in directshow?

    - by Mr Bell
    How do i render a web cam filter instead of video file? I am looking at the vmr9compositor example included in the directshow sdk. It renders a video file. I would like to stream in the feed from the webcam. It SEEMS like this should be possible, but I dont have much of a grasp on directshow. It uses this method call currently: hr = g_graph->RenderFile( pFileName, NULL ); Looking at the playcap example in the sdk which can display the web cam feed in a window, I see that it uses hr = g_pCapture->RenderStream (&PIN_CATEGORY_PREVIEW, &MEDIATYPE_Video, pSrcFilter, NULL, NULL)); to display the web cam stream. pSrcFilter is an IBaseFilter. How can I can swap the video file in the vmr app with the web cam feed? Windows XP, Visual Studio 2008 C++

    Read the article

  • IIS6, ASP.NET MVC 1 and random slowdowns

    - by Mr Snuffle
    I've recently deployed a MVC application to an IIS6 web server. One strange behaviour I've been having is the load times will randomly blow up to 30sec+ and then return to normal. Our tests have shown this occurring on multiple connections at the same time. Once the wait has passed, the site become responsive again. It's completely random when this will occur, but will probably happen about once every 15 minutes or so. My first thought was the application was being restarted by the web server for some reason, but I determined this wasn't the case because the process recycling is set very infrequently, and I placed some logging in the application startup. It's also nothing to do with the database connection. This slowdown happens simply by moving between static pages too. I've watched the database with a SQL profiler, and nothing is hitting it when these slowdowns occur. Finally, I've placed entry and exit logging on my controller actions, the slowdown always happens outside of the controller. The entry and exit time for a controller action is always appropriately fast. Does anyone have any ideas of what could be causing this? I've tried running it locally on IIS7 and I haven't had the issue. I can only think it's something to do with our hosting provider.

    Read the article

  • How to recive more than 65000 bytes in C++ socket using recv()

    - by Mr.Cool
    I am developing a client server application (TCP) in Linux using C++. I want to send more than 65,000 bytes at the same time. In TCP, the maximum packet size is 65,635 bytes only. How can I send the entire bytes without loss? Following is my code at server side. //Receive the message from client socket if((iByteCount = recv(GetSocketId(), buffer, MAXRECV, MSG_WAITALL)) > 0) { printf("\n Received bytes %d\n", iByteCount); SetReceivedMessage(buffer); return LS_RESULT_OK; } If I use MSG_WAITALL it takes a long time to receive the bytes so how can I set the flag to receive more than 10 lakhs bytes at time.

    Read the article

  • How to post to a request using node.js

    - by Mr JSON
    I am trying to post some json to a URL. I saw various other questions about this on stackoverflow but none of them seemed to be clear or work. This is how far I got, I modified the example on the api docs: var http = require('http'); var google = http.createClient(80, 'server'); var request = google.request('POST', '/get_stuff', {'host': 'sever', 'content-type': 'application/json'}); request.write(JSON.stringify(some_json),encoding='utf8'); //possibly need to escape as well? request.end(); request.on('response', function (response) { console.log('STATUS: ' + response.statusCode); console.log('HEADERS: ' + JSON.stringify(response.headers)); response.setEncoding('utf8'); response.on('data', function (chunk) { console.log('BODY: ' + chunk); }); }); When I post this to the server I get an error telling me that it's not of the json format or that it's not utf8, which they should be. I tried to pull the request url but it is null. I am just starting with nodejs so please be nice.

    Read the article

  • How to create XSD schema from XML with this kind of structure (in .net)?

    - by Mr. Brownstone
    Here's the problem: my input is XML file that looks something like: <BaseEntityClassInfo> <item> <key>BaseEntityClassInfo.SomeField</key> <value>valueData1</value> </item> <item> <key>BaseEntityClassInfo.AdditionalDataClass.SomeOtherField</key> <value>valueData2</value> </item> <item> <key>BaseEntityClassInfo.AdditionalDataClass.AnotherClassInfo.DisplayedText</key> <value>valueData3</value> </item> ... ... </BaseEntityClassInfo> The <key> element somehow describes entity classes fields and relationships (used in some other app that I don't have access to) and the <value> stores the actual data that I need. My goal is to programatically generate a typed Dataset from this XML that could then be used for creating reports. I thought of building some XSD schema from input XML file first and then use this schema to generate Dataset but I'm not sure how to do that. The problem is that I don't want all data in one table, I need several tables with relationships based on the <key> value so I guess I need to infer relational structure from XML <key> data in some way. So what do you think? How could this be done and what would be the best approach? Any advice, ideas, suggestions would be appreciated!

    Read the article

  • How should Application.Run() be called for the main presenter a MVP WinForms app?

    - by Mr Roys
    I'm learning to apply MVP to a simple WinForms app (only one form) in C# and encountered an issue while creating the main presenter in static void Main(). Is it a good idea to expose a View from the Presenter in order to supply it as a parameter to Application.Run()? Currently, I've implemented an approach which allows me to not expose the View as a property of Presenter: static void Main() { IView view = new View(); Model model = new Model(); Presenter presenter = new Presenter(view, model); presenter.Start(); Application.Run(); } The Start and Stop methods in Presenter: public void Start() { view.Start(); } public void Stop() { view.Stop(); } The Start and Stop methods in View (a Windows Form): public void Start() { this.Show(); } public void Stop() { // only way to close a message loop called // via Application.Run(); without a Form parameter Application.Exit(); } The Application.Exit() call seems like an inelegant way to close the Form (and the application). The other alternative would be to expose the View as a public property of the Presenter in order to call Application.Run() with a Form parameter. static void Main() { IView view = new View(); Model model = new Model(); Presenter presenter = new Presenter(view, model); Application.Run(presenter.View); } The Start and Stop methods in Presenter remain the same. An additional property is added to return the View as a Form: public void Start() { view.Start(); } public void Stop() { view.Stop(); } // New property to return view as a Form for Application.Run(Form form); public System.Windows.Form View { get { return view as Form(); } } The Start and Stop methods in View (a Windows Form) would then be written as below: public void Start() { this.Show(); } public void Stop() { this.Close(); } Could anyone suggest which is the better approach and why? Or there even better ways to resolve this issue?

    Read the article

  • NSPredicate confusion. Ignoring spaces.

    - by Mr. McPepperNuts
    NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name contains [cd] %@", passdTextToSearchFor]; I have two entries in name: "Test One" and "Test Two." If I search for "test," I get 0 results. But if I search for "test one" or "test two" I get the proper result. The search is ignoring the space. In reality I want both results if the user searches for "test." Any ideas? I tried contain and like.

    Read the article

  • help understanding the concept of javascript callbacks with node.js, especially in loops

    - by Mr JSON
    hi I am just starting with node.js. I have done a little ajax stuff but nothing too complicated so callbacks are still kind of over my head. I looked at async but all I need is to run a few functions sequentially. I basically have something that pulls some json from an api, creates a new one and then does something with that. obviously i can't just run it because it runs everything at once and has an empty json. mostly they have to go sequentially but if while pulling a json from the api it can pull other json while it's waiting that is fine. I just got confused when putting the callback in a loop. what do I do with the index? i think i have seen some places that use callback inside the loop as kind of a recusive function and don't use for loops at all. simple examples would help alot thanks!

    Read the article

  • Creating standalone, console (shell) for domain-specific operations

    - by mr.b
    Say that I have a system service, and I want to offer a low-level maintenance access to it. For that purpose, I'd like to create a standalone, console application that somehow connects to server process and lets user type in commands, allow it to use auto-completion and auto-suggestion on single/double TAB press (just like linux bash shell, mysql cli, cmd.exe, and countless others), allow command line editing capabilities (history, cursor keys to move around text..), etc. Now, it's not that much of a problem to create something like that by rolling my own from scratch, handling user input, scanning pressed keys, and doing correct actions. But, why reinvent the wheel? Is there some library/framework that helps with this kind of problems, just like readline library that offers improved command-line editing capabilities under linux? Of course, this new "shell" would respond only to valid, domain-specific commands, and would suggest valid arguments, options, switches... Any ideas? Thanks!

    Read the article

  • Java FileFilter

    - by Mr CooL
    public class DocFilter extends FileFilter { public boolean accept(File f) { if (f.isDirectory()) { return true; } String extension = Utils.getExtension(f); if (extension != null) { if (extension.equals(Utils.doc) || extension.equals(Utils.docx) ) { return true; } else { return false; } } return false; } //The description of this filter public String getDescription() { return "Just Document Files"; } } Netbeans compiler warned with the error, "No interface expected here" for above code Anyone has idea what was the problem?? I tried changing the 'extends' to 'implements', however, it didn't seem to work that way. and when I changed to implements, the following code cannot work, chooser.addChoosableFileFilter(new DocFilter()); and with this error, "method addChoosableFileFilter in class javax.swing.JFileChooser cannot be applied to given types required: javax.swing.filechooser.FileFilter" Can anyone help on this? Thanks..

    Read the article

  • load report fail in crystal reports doesn't have solution.

    - by mr-developer
    hi all, i'm using c sharp and crystal reports in visual studio 2008 in my application. the problem is that there is a form that i have crystalreporviewer on, when i call the form from form1 by button click event, the form and the report loads perfect, but when i call the from from another from that i've called from form1, this exception appears "load report fail". how can i solve this problem. i've googled and i didn't find any solution. I think there is a difference between form1 and the other form which i call the form of the report from. this is the code of the report form load try { cryRpt.Load("..\\..\\CrystalReport1.rpt"); crystalReportViewer1.ReportSource = cryRpt; crystalReportViewer1.Refresh(); } catch(Exception ex) { MessageBox.Show(ex.Message); } thanks in advance for any replies

    Read the article

  • iPhone: Error and error handling confusion in comparison.

    - by Mr. McPepperNuts
    NSArray *results = [managedObjectContext executeFetchRequest:request error:&error]; if(results == nil){ NSLog(@"No results found"); searchObj = nil; }else{ if ([[[results objectAtIndex:0] name] caseInsensitiveCompare:passdTextToSearchFor] == 0) { NSLog(@"results %@", [[results objectAtIndex:0] name]); searchObj = [results objectAtIndex:0]; }else { NSLog(@"No results found"); searchObj = nil; } } The code above compares data a user enters to data pulled from a database. If I enter data which is in the database; it works. But if I enter complete gibberish it returns the error below instead of "No results found." *** WebKit discarded an uncaught exception in the webView:shouldInsertText:replacingDOMRange:givenAction: delegate: <NSRangeException> *** -[NSCFArray objectAtIndex:]: index (0) beyond bounds (0) The results array being null should be accounted for during the checks in the above code, no?

    Read the article

  • How can I shuffle an NSArray?

    - by Mr. McPepperNuts
    All examples I find on shuffling arrays are for NSMutableArrays. Copying an NSArray to an NSMutable array, shuffling, then copying back always crashes the application. Is it even possible to shuffle an NSArray? Anything in objective-c similar to Collections.shuffle() (Java)?

    Read the article

  • Fetch Data using predicate. Retrieve single value.

    - by Mr. McPepperNuts
    XYZAppDelegate *appDelegate = [[UIApplication sharedApplication] delegate]; NSManagedObjectContext *managedObjectContext = appDelegate.managedObjectContext; NSFetchRequest *request = [[NSFetchRequest alloc] init]; NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name == %@", entryToSearchFor]; NSEntityDescription *entity = [NSEntityDescription entityForName:@"Entry" inManagedObjectContext:managedObjectContext]; NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"name" ascending:NO]; NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil]; [request setSortDescriptors:sortDescriptors]; [request setEntity: entity]; [request setPredicate: predicate]; NSArray *results = [managedObjectContext executeFetchRequest:request error:nil]; if (results == nil) { NSLog(@"No results found"); }else { NSLog(@"entryToSearchFor %@", entryToSearchFor); NSLog(@"results %@", [results objectAtIndex:0]); } I want to retrieve a single value (String) from "Entry." I believe I must be missing. Can someone point it out? Btw, the NSLog results outputs the following: results <NSManagedObject: 0x3d2d360> (entity: Entry; id: 0x3d13650 <x-coredata://6EA12ADA-8C0B-477F-801C-B44FE6E6C91C/Entry/p3> ; data: <fault>)

    Read the article

  • Finding matching columns in excel

    - by fakaff
    I've never used excel before so I need the simplest solution available, and this is a work assignment due this week so I didn't have time read much of the documentation. Basically, I have two tables, A and B, and they are both thousands of rows long. Description of my task: right now (since I don't know better) I'm manually doing this: Go to row i in table B. Select entries in columns B(a, b, c) of that same row. Look for a row in table A where column A(b) matches row B(a). Paste the entries of columns B(a) of row i at the end of the row found in the last step. Repeat for row i + 1. Example: row B(cat, dog, mouse) matches A(mammal, cat, Mr. Whiskers). So I would paste B after A and have A(mammal, cat, Mr. Whiskers, cat, dog, mouse). Note: I am not joining tables. I am merely extending table A by pasting row A(b) if row A(b) matches row B(a). Also, sometimes entries are spelled slightly differently. Using wildcards to search for candidates would be of help. As the description should let on, this task is very tedious and inefficient if I don't know how to automate some operations (there are thousands of entries). Any quick tips as to how to be more productive is a big help.

    Read the article

  • How many bytes does Oracle use when storing a single character?

    - by Mr-sk
    I tried to look here: http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i3253 And I understand that I have to provide string length for the column, I'm just not able to find out how many bytes oracle uses when storing a character. My limit is 500 characters, so if its 1 byte / character, I can create the column with 500, if its 2 byte / character then 1000, etc. Anyone have a link to the documentation or know for certain? In case it matters, the SQL is being called from PHP, so these are PHP strings I'm inserting into the database. Thanks.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >