Search Results

Search found 352 results on 15 pages for 'cam'.

Page 5/15 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Video Game Bots?

    - by cam
    Something I've always wondered, especially since it inspired me to start programming when I was a kid, was how video game bots work? I'm sure there are a lot of different methods, but what about automation for MMORPGs? Or even FPS-type bots?

    Read the article

  • Tic-Tac-Toe AI: How to Make the Tree?

    - by cam
    I'm having a huge block trying to understand "trees" while making a Tic-Tac-Toe bot. I understand the concept, but I can't figure out to implement them. Can someone show me an example of how a tree should be generated for such a case? Or a good tutorial on generating trees? I guess the hard part is generating partial trees. I know how to implement generating a whole tree, but not parts of it.

    Read the article

  • Embedding Perl Interpreter

    - by cam
    Hi, just downloaded ActivePerl. I want to embed the perl interpreter in a C# application (or at least call the perl interpreter from C#). I need to be able to send send out data to Perl from C#, then receive the output back into C#. I just installed ActivePerl, and added MS Script Control 1.0 as a reference. I found this code on the internet, but am having trouble getting it to work. MSScriptControl.ScriptControlClass Interpreter = new MSScriptControl.ScriptControlClass(); Interpreter.Language = @"ActivePerl"; string Program = @"reverse 'abcde'"; string Results = (string)Interpreter.Eval(Program); return Results; Originally, it had 'PerlScript' instead of 'ActivePerl', but neither work for me. I'm not entirely sure what Interpreter.Language expects. Does it require the path to the interpreter? Solved... I'm not sure how, but when I changed it back to PerlScript it works now. Still, I would like to know if MSScript Control is using ActivePerl or another interpreter.

    Read the article

  • Pointer-Safe Objects?

    - by cam
    Would it be smart to have a vector in an object with a list of pointers that point to it? This way when the object is deleted, it could delete all the pointers pointing to it to prevent a null-pointer exception?

    Read the article

  • NCurses-Like System for Windows

    - by cam
    Are there any C++ libraries similar to Ncurses, but for Windows? It seems there are no ports of Ncurses and I need a really good display system like it. Any suggestions? Cross-platform is a plus.

    Read the article

  • Increasing Regex Efficiency

    - by cam
    I have about 100k Outlook mail items that have about 500-600 chars per Body. I have a list of 580 keywords that must search through each body, then append the words at the bottom. I believe I've increased the efficiency of the majority of the function, but it still takes a lot of time. Even for 100 emails it takes about 4 seconds. I run two functions for each keyword list (290 keywords each list). public List<string> Keyword_Search(HtmlNode nSearch) { var wordFound = new List<string>(); foreach (string currWord in _keywordList) { bool isMatch = Regex.IsMatch(nSearch.InnerHtml, "\\b" + @currWord + "\\b", RegexOptions.IgnoreCase); if (isMatch) { wordFound.Add(currWord); } } return wordFound; } Is there anyway I can increase the efficiency of this function? The other thing that might be slowing it down is that I use HTML Agility Pack to navigate through some nodes and pull out the body (nSearch.InnerHtml). The _keywordList is a List item, and not an array.

    Read the article

  • Am I Writing Assembly Or NASM?

    - by cam
    I'm fed up with this. I've been trying to just get a grip on assembly for awhile, but I feel like I'm coding towards my compiler rather than a language. I've been using this tutorial, and so far it's giving me hell. I'm using NASM, which may be the problem, but I figured it was the most popular one. I'm simply trying to learn the most general form of assembly, so I decided to learn x86. I keep running into stupid errors, like not being able to increment a variable. Here's the latest one: not being able to use div. mov bx, 0; mov cx, 0; jmp start; start: inc cx; mov ax, cx; div 3; <-- invalid combination of opcode and operand cmp ah,0; jz totalvalue; mov ax, cx; div 5; <-- invalid combination of opcode and operand cmp ah, 0; jz totalvalue; cmp cx, 1000; jz end; totalvalue: add bx,cx; jmp start; jmp end; end: mov ah,4ch; mov al,00; int 21h; Should I change compilers? It seems like division should be standard. Do I need to read two tutorials (one on NASM, and one on x86?). Any specific help on this problem?

    Read the article

  • RijndaelManaged: IV Generation?

    - by cam
    I want to implement the most secure, and most reliable form of symmetric key cryptography in my application. The user should input a password to encrypt/decrypt, and that's all. For RijndaelManaged, one must enter a key and an IV. I'm not sure how to address the situation. Right now, I have the entered password being hashed by SHA256 and then being used as the key for the Rijndael. What do I use for the IV? Another password?

    Read the article

  • SQLite.Net Issue With BeginTransaction

    - by cam
    I'm trying to use System.Data.Sqlite library, and I'm following the documentation about optimizing inserts so I copied this code directly out of the documentation: using (SQLiteTransaction mytransaction = myconnection.BeginTransaction()) { using (SQLiteCommand mycommand = new SQLiteCommand(myconnection)) { SQLiteParameter myparam = new SQLiteParameter(); int n; mycommand.CommandText = "INSERT INTO [MyTable] ([MyId]) VALUES(?)"; mycommand.Parameters.Add(myparam); for (n = 0; n < 100000; n ++) { myparam.Value = n + 1; mycommand.ExecuteNonQuery(); } } mytransaction.Commit(); } Now, I initialize I connection right before that by using SqlConnection myconnection = new SqlConnection("Data Source=blah"); I have a Database named blah, with the correct tables and values. The problem is when I run this code, it says "Operation is not valid due to the current state of the object" I've tried changing the code around several times, and it still points to BeginTransaction. What gives?

    Read the article

  • Finding the closest object in proxmity to the mouse Coordinates

    - by Cam
    Hey there, i've been working on a problem for a while now, which involves targeting the closest movieClip in relation to the x y coords of the mouse, I've attached a nice little acompanying graphic. Each mc added to the stage has it's own sub-class (HotSpots) which uses Pythag to measure distance from mouse. At this stage i can determine the closest value from my Main class but can't figure out how to reference it back to the movieclip... hope this makes sense. Below are the two Classes. My Main Class which attachs the mcs, and monitors mouse movement and traces closest value package { import flash.display.*; import flash.text.*; import flash.events.*; public class Main extends MovieClip { var pos:Number = 50; var nodeArray:Array; public function Main(){ nodeArray = []; for(var i:int = 0; i < 4; i++) { var hotSpot_mc:HotSpots = new HotSpots; hotSpot_mc.x += pos; hotSpot_mc.y += pos; addChild(hotSpot_mc); nodeArray.push(hotSpot_mc); // set some pos pos += 70; } stage.addEventListener(MouseEvent.MOUSE_MOVE,updateProxmity) } public function updateProxmity(e:MouseEvent):void { var tempArray:Array = new Array(); for(var i:int = 0; i < 4; i++) { this['tf'+[i]].text = String(nodeArray[i].dist); tempArray.push(nodeArray[i].dist); } tempArray.sort(Array.NUMERIC); var minValue:int = tempArray[0]; trace(minValue) } } } My HotSpots Class package { import flash.display.MovieClip; import flash.events.Event; import flash.text.TextField; public class HotSpots extends MovieClip { public var XSide:Number; public var YSide:Number; public var dist:Number = 0; public function HotSpots() { addEventListener(Event.ENTER_FRAME, textUp); } public function textUp(event:Event):void { XSide = this.x - MovieClip(root).mouseX; YSide = this.y - MovieClip(root).mouseY; dist = Math.round((Math.sqrt(XSide*XSide + YSide*YSide))); } } } thanks in advance

    Read the article

  • Depth First Search Basics

    - by cam
    I'm trying to improve my current algorithm for the 8 Queens problem, and this is the first time I'm really dealing with algorithm design/algorithms. I want to implement a depth-first search combined with a permutation of the different Y values described here: http://en.wikipedia.org/wiki/Eight_queens_puzzle#The_eight_queens_puzzle_as_an_exercise_in_algorithm_design I've implemented the permutation part to solve the problem, but I'm having a little trouble wrapping my mind around the depth-first search. It is described as a way of traversing a tree/graph, but does it generate the tree graph? It seems the only way that this method would be more efficient only if the depth-first search generates the tree structure to be traversed, by implementing some logic to only generate certain parts of the tree. So essentially, I would have to create an algorithm that generated a pruned tree of lexigraphic permutations. I know how to implement the pruning logic, but I'm just not sure how to tie it in with the permutation generator since I've been using next_permutation. Is there any resources that could help me with the basics of depth first searches or creating lexigraphic permutations in tree form?

    Read the article

  • Pruning: When to Stop?

    - by cam
    When does pruning stop being efficient in a depth-first search? I've been working on an efficient method to solve the N-Queens problem and I'm looking at pruning for the first time. I've implemented it for the first two rows, but when does it stop being efficient? How far should I prune to?

    Read the article

  • Using Large Lists

    - by cam
    In an Outlook AddIn I'm working on, I use a list to grab all the messages in the current folder, then process them, then save them. First, I create a list of all messages, then I create another list from the list of messages, then finally I create a third list of messages that need to be moved. Essentially, they are all copies of eachother, and I made it this way to organize it. Would it increase performance if I used only one list? I thought lists were just references to the actual item.

    Read the article

  • Upload a file to a web server in cocoa

    - by Cam
    Hello, I was wondering the best way to upload file to a web server in cocoa. I cant seem to get my curl code to work even though it works when run from terminal. curl code: system(@"curl -T /file.txt http://webserevertouploadto.com") Thanks for any help

    Read the article

  • System.XML or Regex.Replace?

    - by cam
    I'm generating a large amount of XML documents from a set of values in an Excel file. The only thing that changes for each XML document is the values. I figured the best way to generate these documents was to make a "XML skeleton" (since the XML format never changes) and then plug in symbols like "&%blahNameblahTest", so then I could just preform a Regex.Replace on each value. I will be handing over this project to another developer and I'm wondering if I should convert the project to generate the XML file manually everytime through the System.XML namespace. The only advantages I see to this is ensuring that the XML document is valid. The current method would be more readable than that method, and way faster since I'm generating around 1500 documents.

    Read the article

  • Error Using PDCurses: Cannot Open File Libc.C

    - by cam
    I'm getting the error: 1>LINK : fatal error LNK1104: cannot open file 'LIBC.lib' Here's my source code: #include <curses.h> int main() { initscr(); /* Start curses mode */ printw("Hello World !!!"); /* Print Hello World */ refresh(); /* Print it on to the real screen */ getch(); /* Wait for user input */ endwin(); /* End curses mode */ return 0; } I've configured the PDcurses library properly (added to Additional Include libraries, added folder to Additional Library Directories). I've looked around for a bit, and I've tried adding Libc.C to the 'Ignore Library' list, which in turn causes about 150 errors. Not sure what to do from here.

    Read the article

  • Why do I need to call new?

    - by cam
    It seems like I could program something without ever using the word 'new', and I would never have to worry about deleting anything either. From what I understand, it's because I would run out of stack memory. Is this correct? I guess my main question is, when should I call 'new'?

    Read the article

  • GUI and Threading

    - by cam
    Isn't there a better way to handle GUI (WinForms) from another thread than creating a delegate for every single method I need to use? It seems like there would be a better way. Here's the current code I use for every single GUI method: private delegate void SetStatusTextDelegate(string set_text); public void SetStatusText(string set_text) { if (status_prog.InvokeRequired) { status_prog.Invoke(new SetStatusTextDelegate(SetStatusText), set_text); } else { status_prog.Text = set_text; } }

    Read the article

  • Singleton Pattern for C#

    - by cam
    I need to store a bunch of variables that need to be accessed globally and I'm wondering if a singleton pattern would be applicable. From the examples I've seen, a singleton pattern is just a static class that can't be inherited. But the examples I've seen are overly complex for my needs. What would be the very simplest singleton class? Couldn't I just make a static, sealed class with some variables inside?

    Read the article

  • Good Source Control Hosting For Privacy?

    - by cam
    I'm looking for a very private source control/hosting solution. Short of hosting my own, and seeing as I'm the only collaborator, what is a good service for this? I'm using Git. The most important aspect is privacy. I don't want anyone to see my code, I'm simply using it for source control/backup. I will be the only developer.

    Read the article

  • Memory Profiling with DotTrace Questions

    - by cam
    I ran dotTrace on my application (which is having some issues). IntPtr System.Windows.Forms.UnsafeNativeMethods.CallWindowProc(IntPtr, IntPtr, Int32, IntPtr, IntPtr) Void System.Windows.Forms.UnsafeNativeMethods.WaitMessage() Are the two main functions that came up, taking about 94% of the application time. Since I didn't know what these two functions were, I ran through my code line by line. It runs smooth and efficiently until a point where it just hangs. "newFrm.Show()". The newFrm only contains a textbox. The larger the file I load into the text box (it's a notepad program), the longer it takes. Now normally this makes sense, but it takes about 30 seconds for a 167 kB file. Now I'm not sure what to do. It runs incredibly slow/stops functioning when you load a textfile and try to resize the window containing the text file too. Then I realized that it is only struggling to open text files with a long string of hex inside (ie) "XX-XX-XX-" etc. With other similarly sized files it struggles with resizing somewhat, but opens within a couple seconds. Does this have something to do with the textbox properties? I've set it to multiline and set maximum characters to 0 (so unlimited). How do I solve this issue? Is there some way I can see what is being called in those functions?

    Read the article

  • iOS 6&7: Storyboard, master detail ViewController when detailViewController is dynamic

    - by Cam
    I'm building an app for iPhone, I want to use storyboard in XCode to do a simple selection from a tableView (let's call it master table view controller with couple rows) then through navigation it goes to next page and shows a detail view for that selection. I have in my code a base class representing my detailViewController, and have 2-3 driver classes of this base class representing what I want to show in detail view controller in second page, can someone give me an idea how to set destination viewController (detailViewController) dynamically to one of my child class based on the selected row in master view controller using storyboard? Usually you assign a class to destination class in storyboard for your detail view controller with using segue, but since my destination class could be a different (child class) how you set this in storyboard? Thank you, Kam

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >