Search Results

Search found 201 results on 9 pages for 'tyler eaves'.

Page 6/9 | < Previous Page | 2 3 4 5 6 7 8 9  | Next Page >

  • Why is my program printing out the null termination character?

    - by Tyler Pfaff
    When I run this, it will SOMETIMES print out a null termination character. Most of the time it will, and probably 1/5 times it will print just the characters. void cryptogram::Encrypt(){ cout<<"encrypt"<tempS){ len=tempS.length(); int a=0; for(int j=0;j if(j!=len){ //if the word still has more characters j++; a=0; }else{ //if the word is done being scanned cout<<" "; } } } } } } } So that's it and this is the corresponding EXPECTED output that is printed SOMETIMES xvk bkikhxlr wggbtfkj wiylekgbdhx wjjm hko wigbtubxt xvk iwhj uedjkm glctb gvrmdiwhj iebbdielmeggtbx ctb xvtmk gbtubxvk wjjdxdthgbtubodll khvxvk imkbfdik xt xvk bkudth whj gbtfdjk hko tgxdthm whj tggtbxehdxdkm ctb mxejkhxmibdzdhtltur whj pemxdik mxejdkm mxdh cok wbk wlmt gbkgctb cteb hko zdh cgvrmdikjeiwhj qdhkmdtlturzzkjdydtivkzdmxbrw zdh zdjjlkkjeiwhj w jtixtbdh kjeiwjzdhdmxbittgkbodxv mjme whj eimj This is what normally prints though xvkÈ bkikhxlrÈ wggbtfkjÈ wiylekgbdhxÈ wjjmÈ hkoÈ wigbtubxtÈ xvkÈ iwhjÈ uedjkmÈ glctbÈ gvrmdiwhjÈ iebbdielmeggtbxÈ ctbÈ xvtmkÈ gbtubxvkÈ wjjdxdthgbtubodllÈ khvxvkÈ imkbfdikÈ xtÈ xvkÈ bkudthÈ whjÈ gbtfdjkÈ hkoÈ tgxdthmÈ whjÈ tggtbxehdxdkmÈ ctbÈ mxejkhxmibdzdhtlturÈ whjÈ pemxdikÈ mxejdkmÈ mxdhÈ cokÈ wbkÈ wlmtÈ gbkgctbÈ ctebÈ hkoÈ zdhÈ cgvrmdikjeiwhjÈ qdhkmdtlturzzkjdydtivkzdmxbrwÈ zdhÈ zdjjlkkjeiwhjÈ wÈ jtixtbdhÈ kjeiwjzdhdmxbittgkbodxvÈ mjmeÈ whjÈ eimj or some variation of an odd character at the end of each word This is what the cryptogram array is filled with by the way wyijkcuvdpqlzhtgabmxefonrs

    Read the article

  • Passing Variable in load

    - by Tyler
    I have a load action tied to the submit button of a form. jQuery('#content').load("/control/ajxdata/installs.php?country=" + country); jQuery('#content').load("/control/ajxdata/installs.php",{ 'country': country }); The name, and the id of the form element I am trying to utilize is "country" In the error console, I am getting "Error: country is not defined"

    Read the article

  • Can I Move a MediaWiki site to a new virtual folder?

    - by Tyler
    I had MediaWiki installed in as the default site on my server using IIS 6 and I created a virtual directory and pointed it to the Wiki folder. The page loads, but all the links are pointing to the original location that is no longer pointing to the Wiki Folder. Info Server Name: tech Path to Wiki: http://tech/wiki/ Example Links Wrong Link - This is the current link displayed http://tech/index.php?title=Main_Page The link should look like this http://tech/wiki/index.php?title=Main_Page All of the links are not showing the /wiki Any ideas?

    Read the article

  • "Streaming" MJPG using python.

    - by tyler
    I have a webcam that I want to do some image processing on using Python. It's coming through as a Motion-JPEG. I want to try to process the stuff "live," but really what I want to do is this: Open the URL, start data streaming to some buffer... Read x bytes (where x is image size) to an image Process that image Display in result panel Return to number 2 The problem is that, while I do have the resolution, I have no idea how many bytes to read. I've tried googling the M-JPEG specification but can't find anything on if the images are separated by some header or what. Anybody have any ideas?

    Read the article

  • Arrays of different types

    - by Tyler
    Hi - Is it possible to have an array that contains two different types of data? I want to have an array that contains a double and also a string. I attempted: ArrayList<double><String> array; But that didn't work. Sorry for the silly question, but it has been a while since I have used something like this.. Can you refresh my memory on how would I declare and populate such an array? And then to take it a step further, I would like to sort the array by the double if possible? Thanks!

    Read the article

  • postgresql is incrementing an update by 2 ?

    - by John Tyler
    I'm migrating our model to postgresql for the FTS and data integrity update myschema.counters set counter_count= (counter_count+1) where counter_id =? Works as expected in mysql, however in postgres it is incrementing by 2 each time? It is simple int field I believe, I don't have anything special going on.

    Read the article

  • declaring a 2D array of pointer objects

    - by Tyler Stennette
    I'm having a tough time figuring out how to instantiate a 2D array of pointer objects. Here is how I'm doing it: Pieces* chessBoard[9][9]; When I want to set it to an actual object pointer, I'm doing the following: chessBoard[1][1] = new Rook(p1Rook); Rook is a class that inherits attributes from the Pieces class and p1Rook is a char variable set to 'R'. This class also implements virtual functions (not pure virtual) from Pieces such as move() or getPiece() that are unique to the particular chess piece. However, when I compile my program, I get the following error: ChessBoard.cpp:69: error: expected type-specifier before ‘Rook’ ChessBoard.cpp:69: error: cannot convert ‘int*’ to ‘Pieces*’ in assignment Can someone please explain what I should change to get rid of this rather annoying persistent error? I would appreciate it.

    Read the article

  • Can a Site get a Virus from using Curl?

    - by Mark Tyler
    I have a script which uses simple php curl requests to get the contents from rss/atom feeds.... now my question is it possible that by using curl, is there a chance i might get a virus? Let's say I do a php curl request to a rss feed in feedburner (I know this site does not contain any viruses, but this is only an example) and let's say this site has a malicious virus of some kind. Is there a chance that I might inherit that virus too? If yes, what precautions can I do to make sure something like that never happens. This is the php code I am currently using to fetch the RSS $headers [] = 'Connection: Keep-Alive'; $headers [] = 'Content-type: application/x-www-form-urlencoded; charset=utf-8'; $headers [] = 'Accept-Encoding: application/xhtml+xml,application/xml,text/xml,text/html;q=0.9,*/*;q=0.8'; $ch = curl_init($url); //curl_setopt($ch, CURLOPT_USERAGENT,'Phenoix/0.1.3 (Feed Parser Beta; Beta ; Allow like Gecko) Build/20111112'); curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1'); //curl_setopt($ch, CURLOPT_REFERER, "http://google.com/auto/clogger"); //curl_setopt($ch, CURLOPT_ENCODING, 'gzip, deflate' ); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers ); //curl_setopt($channel, CURLOPT_HEADER, 0); curl_setopt($ch, CURLINFO_HEADER_OUT, 1); curl_setopt($ch, CURLOPT_VERBOSE, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_FAILONERROR, 1); //allow cookie $cookie_file = "cookie1.txt"; curl_setopt($ch, CURLOPT_COOKIESESSION, true); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file); $xml = curl_exec($ch); if(curl_error($ch)){ //$text .= "Error while updating. Please try again later"; return array(0, curl_error($ch)); } $info = curl_getinfo($ch); curl_close($ch);

    Read the article

  • How can I solve this NHibernate Querying in an n-tier architecture?

    - by Tyler Wright
    I've hit a wall with trying to decouple NHibernate from my services layer. My architecture looks like this: web - services - repositories - nhibernate - db I want to be able to spawn nhibernate queries from my services layer and possibly my web layer without those layers knowing what orm they are dealing with. Currently, I have a find method on all of my repositories that takes in IList<object[]> criteria. This allows me to pass in a list of criteria such as new object() {"Username", usernameVariable}; from anywhere in my architecture. NHibernate takes this in and creates a new Criteria object and adds in the passed in criteria. This works fine for basic searches from my service layer, but I would like to have the ability to pass in a query object that my repository translates into an NHibernate Criteria. Really, I would love to implement something like what is described in this question: Is there value in abstracting nhibernate criterion. I'm just not finding any good resources on how to implement something like this. Is the method described in that question a good approach? If so, could anyone provide some pointers on how to implement such a solution?

    Read the article

  • Passing a 2D array to a function in C

    - by Tyler Treat
    I have, essentially, a matrix of data (lets say ints) that I would like to store in a 2D array in which the dimensions are not known until runtime (say x columns and y rows). I want to populate the array in a function, so I assume I need to do something like this: int main(int argc, char **argv) { int y = atoi(argv[1]); int x = atoi(argv[2]); int **matrix = malloc(x * sizeof(int*)); populateMatrix(matrix, y, x); return 0; } void populateMatrix(**matrix, int y, int x) { int i, j; for (i = 0; i < y; i++) { for (j = 0; j < x; j++) { matrix[i][j] = i * j; // populated with trivial data to keep it simple } } } Obviously this doesn't work, but I'm not sure how to do what I'm describing exactly.

    Read the article

  • Object responsibilities - list and item

    - by Mark Tyler
    My question is more like a theoretical. Say you have an object, that represents the list of something (articles, pages, accounts etc.) class ObjCollection You have a class, that represents a specific item in collection: class objItem I have a problem thinking of a basic responsibilities of each object. Which class is responsible for creating a new objItem? Which class is responsible for deleting a objItem? Should it delete itself as a method?

    Read the article

  • ASP.Net 4.0 Database Created Pages

    - by Tyler
    I want to create asp.net 4.0 dynamic pages loaded from my MS SQL server. Basically, its a list of locations with informations. For example: Location1 would have the page www.site.com/location/location1.aspx Location44 would have the page www.site.com/location/location44.aspx I dont even know where to start with this, url writting maybe?

    Read the article

  • Auto-complete/suggestion popup menu in GtkTextView

    - by Tyler
    I'm trying to create a system that will allow me to respond to the current text and auto-complete/suggest what should come next. For example if the user starts to type "Batm" then the system would respond with a menu showing the full completed word "Batman". Think of an IDE like Eclipse or Visual Studio and you get the idea. I understand how to create a popup menu in Gtk+ but what I don't understand is the following: How do I grab the word that the user is currently typing from a GtkTextView (or SourceView) so that I can do a lookup and offer suggestions? How do I position the menu in such a way that it sits next to the current text item (like it would in an IDE)? If anyone could offer suggestions or even a link to a tutorial or example on how to do this correctly I would be forever grateful. As always thanks for you help! Programming language: C

    Read the article

  • Rails 3 jQuery UI Slider

    - by Tyler DeWitt
    I'm trying to use the jQuery UI Slider with my rails 3 app. I've downloaded a theme and put the css file in app/assets/stylesheet and I put all the images in app/assets/images. When I load a page with a slider, I get an error that it can't find an image: GET http://10.1.10.100:3000/assets/images/ui-bg_glass_45_0078ae_1x400.png 404 (Not Found) That file is in app/assets/images/ and the css file has been edited to point to ../images/<image> Is there something else I need to do to make a jQuery slider work with Rails 3? gist with the files: https://gist.github.com/2355571

    Read the article

  • Grab triangles within a lower triangle

    - by Tyler Rinker
    I have the need to grab all the thee element triangles that make up the lower triangle of a symmetric matrix. I can not think of how to grab all these pieces in the order of far left column working down and then next column to the right and so on. I know that the numbe rof mini triangles inside of the lower triangle is: n = x(x - 1)/2 where: x = nrow(mats[[i]]) Here I've created three matrices with letters (it's easier for me to conceptualize this way) and the elements in the order I'm looking for: FUN <- function(n) { matrix(LETTERS[1:(n*n)], n) } mats <- lapply(3:5, FUN) So this is the output I'd like to get (I put it in code rather than output format) for each of the matrices created above: list(c("B", "C", "F")) list(c("B", "C", "G"), c("C", "D", "H"), c("G", "H", "L")) list(c("B", "C", "H"), c("C", "D", "I"), c("D", "E", "J"), c("H", "I", "N"), c("I", "J", "O"), c("N", "O", "T")) How can I do this task in the fastest manner possible while staying in base R? Not sure if this visual of what I'm after is helpful but it may be:

    Read the article

  • Best way to do syntax highlighting in GTK+?

    - by Tyler
    I was wondering if someone could point me to an example of (or just their thoughts on) the best way to code syntax highlighting in a C-based GTK+ application. I know that I can use the GtkTextTag to modify text in a GtkTextBuffer but beyond searching out keywords (iteratively or by regexing the string) is there a better way? My only concern is that if I wipe all of the tags and then re-search and apply the tags at every text change event it could really bog down my application. As always thanks for your help!

    Read the article

  • Optimizing a memoization decorator not increase call stack

    - by Tyler Crompton
    I have a very, very basic memoization decorator that I need to optimize below: def memoize(function): memos = {} def wrapper(*args): try: return memos[args] except KeyError: pass result = function(*args) memos[args] = result return result return wrapper The goal is to make this so that it doesn't add on to the call stack. It actually doubles it right now. I realize that I can embed this on a function by function basis, but that is not desired as I would like a global solution for memoizing. Any ideas?

    Read the article

  • Async WebRequest Timeout Windows Phone 7

    - by Tyler
    Hi All, I'm wondering what the "right" way of timing out an HttpWebRequest is on Windows Phone7? I've been reading about ThreadPool.RegisterWaitForSingleObject() but this can't be used as WaitHandles throw a Not implemented exception at run time. I've also been looking at ManualReset events but A) Don't understand them properly and B) Don't understand how blocking the calling thread is an acceptable way to implement a time out on an Async request. Here's my existing code sans timeout, can someone please show me how I would add a timeout to this? public static void Get(Uri requestUri, HttpResponseReceived httpResponseReceivedCallback, ICredentials credentials, object userState, bool getResponseAsString = true, bool getResponseAsBytes = false) { var httpWebRequest = (HttpWebRequest)WebRequest.Create(requestUri); httpWebRequest.Method = "GET"; httpWebRequest.Credentials = credentials; var httpClientRequestState = new JsonHttpClientRequestState(null, userState, httpResponseReceivedCallback, httpWebRequest, getResponseAsString, getResponseAsBytes); httpWebRequest.BeginGetResponse(ResponseReceived, httpClientRequestState); } private static void ResponseReceived(IAsyncResult asyncResult) { var httpClientRequestState = asyncResult.AsyncState as JsonHttpClientRequestState; Debug.Assert(httpClientRequestState != null, "httpClientRequestState cannot be null. Fatal error."); try { var webResponse = (HttpWebResponse)httpClientRequestState.HttpWebRequest.EndGetResponse(asyncResult); } }

    Read the article

  • Paginating data, has to be a better way

    - by John Tyler
    I've read like 10 or so "tutorials", and they all involve the same thing: Pull a count of the data set Pull the relevant data set (LIMIT, OFFSET) IE: SELECT COUNT(*) FROM table WHERE something = ? SELECT * FROM table WHERE something =? LIMIT ? offset ?` Two very similar queries, no? There has to be a better way to do this, my dataset is 600,000+ rows and already sluggish (results are determined by over 30 where clauses, and vary from user to user, but are properly indexed of course).

    Read the article

  • GDI+ Resize Function

    - by Tyler
    So my logic is flawed and I need a better and correct way to resize an image in my c# app I need a function similar to this setup public void ResizeImageForWeb(string OriginalFile, string NewFile, int MaxWidth, int MaxHeight, int Quality) { // Resize Code } Basically, I'm a web designer lost trying to programming a desktop app.

    Read the article

  • Merge computed data from two tables back into one of them

    - by Tyler McHenry
    I have the following situation (as a reduced example). Two tables, Measures1 and Measures2, each of which store an ID, a Weight in grams, and optionally a Volume in fluid onces. (In reality, Measures1 has a good deal of other data that is irrelevant here) Contents of Measures1: +----+----------+--------+ | ID | Weight | Volume | +----+----------+--------+ | 1 | 100.0000 | NULL | | 2 | 200.0000 | NULL | | 3 | 150.0000 | NULL | | 4 | 325.0000 | NULL | +----+----------+--------+ Contents of Measures2: +----+----------+----------+ | ID | Weight | Volume | +----+----------+----------+ | 1 | 75.0000 | 10.0000 | | 2 | 400.0000 | 64.0000 | | 3 | 100.0000 | 22.0000 | | 4 | 500.0000 | 100.0000 | +----+----------+----------+ These tables describe equivalent weights and volumes of a substance. E.g. 10 fluid ounces of substance 1 weighs 75 grams. The IDs are related: ID 1 in Measures1 is the same substance as ID 1 in Measures2. What I want to do is fill in the NULL volumes in Measures1 using the information in Measures2, but keeping the weights from Measures1 (then, ultimately, I can drop the Measures2 table, as it will be redundant). For the sake of simplicity, assume that all volumes in Measures1 are NULL and all volumes in Measures2 are not. I can compute the volumes I want to fill in with the following query: SELECT Measures1.ID, Measures1.Weight, (Measures2.Volume * (Measures1.Weight / Measures2.Weight)) AS DesiredVolume FROM Measures1 JOIN Measures2 ON Measures1.ID = Measures2.ID; Producing: +----+----------+-----------------+ | ID | Weight | DesiredVolume | +----+----------+-----------------+ | 4 | 325.0000 | 65.000000000000 | | 3 | 150.0000 | 33.000000000000 | | 2 | 200.0000 | 32.000000000000 | | 1 | 100.0000 | 13.333333333333 | +----+----------+-----------------+ But I am at a loss for how to actually insert these computed values into the Measures1 table. Preferably, I would like to be able to do it with a single query, rather than writing a script or stored procedure that iterates through every ID in Measures1. But even then I am worried that this might not be possible because the MySQL documentation says that you can't use a table in an UPDATE query and a SELECT subquery at the same time, and I think any solution would need to do that. I know that one workaround might be to create a new table with the results of the above query (also selecting all of the other non-Volume fields in Measures1) and then drop both tables and replace Measures1 with the newly-created table, but I was wondering if there was any better way to do it that I am missing.

    Read the article

  • Trying to implement a method that can compare any two lists but it always returns false

    - by Tyler Pfaff
    Hello like the title says I'm trying to make a method that can compare any two lists for equality. I'm trying to compare them in a way that validates that every element of one list has the same value as every element of another list. My Equals method below always returns false, can anyone see why that is? Thank you! using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; public class IEnumerableComparer<T> : IEqualityComparer<IEnumerable<T>> { public bool Equals(IEnumerable<T> x, IEnumerable<T> y) { for(int i = 0; i<x.Count();i++){ if(!Object.Equals(x.ElementAt(i), y.ElementAt(i))){ return false; } } return true; } public int GetHashCode(IEnumerable<T> obj) { if (obj == null) return 0; return unchecked(obj.Select(e => e.GetHashCode()).Aggregate(0, (a, b) => a + b)); } } Here is my data I'm using to test this Equals method. static void Main(string[] args) { Car car1 = new Car(); car1.make = "Toyota"; car1.model = "xB"; Car car2 = new Car(); car2.make = "Toyota"; car2.model = "xB"; List<Car> l1 = new List<Car>(); List<Car> l2 = new List<Car>(); l1.Add(car1); l2.Add(car2); IEnumerableComparer<Car> seq = new IEnumerableComparer<Car>(); bool b = seq.Equals(l1, l2); Console.Write(b); //always says false Console.Read(); } } Car class class Car { public String make { get; set; } public String model { get; set; } }

    Read the article

  • Why do .NET developers offer 32-bit/64-bit versions of .NET assemblies?

    - by Tyler
    Evey now and then I see both x86 and x64 versions of a .NET assembly. Consider the following web part for SharePoint. Why wouldn't the developer just offer a single version and have let the JIT compiler sort out the rest? When I see these kinds offering is it just that the developer decided to create a native image using a tool like ngen in order to avoid a JIT? Someone please help me out here, I feel like I'm missing something of note. Updated From what I got below, both x86 and x64 builds are offered because one or more of the following reasons: The developer wanted to avoid JITing and created a native image of his code, targeting a given architecture using a tool like ngen.exe. The assembly contains platform specific COM calls and so it makes no point to build it as AnyCPU. In these cases builds that target different platforms may contain different code. The assembly may contain Win32 calls using pinvoke which won't get remapped by a JIT and so the build should target the platform it is bound to.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9  | Next Page >