Search Results

Search found 220 results on 9 pages for 'tyler benson'.

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

  • 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

  • Insert new row with data computed from other rows

    - by Tyler McHenry
    Suppose I have a MySQL table called MyTable, that looks like this: +----+------+-------+ | Id | Type | Value | +----+------+-------+ | 0 | A | 1 | | 0 | B | 1 | | 1 | A | 2 | | 1 | B | 3 | | 2 | A | 5 | | 2 | B | 8 | +----+------+-------+ And, for each Id, I want to insert a new row with type C whose Value is the sum of the type A and B values for the rows of the same Id. The primary key on this table is (Id, Type), so there's no question of duplication of Id,Type pairs. I can create the rows I want with this query: SELECT MyTable_A.Id AS Id, 'C' AS Type, (A_Val + B_Val) AS Value FROM (SELECT Id, Value AS A_Val FROM MyTable WHERE Type='A') AS MyTable_A JOIN (SELECT Id, Value AS B_Val FROM MyTable WHERE Type='B') AS MyTable_B ON MyTable_A.Id = MyTable_B.Id Giving: +----+------+-------+ | Id | Type | Value | +----+------+-------+ | 0 | C | 2 | | 1 | C | 5 | | 2 | C | 13 | +----+------+-------+ But the question is: How do I use this result to insert the generated type-C rows into MyTable? Is there a relatively simple way to do this with a query, or do I need to write a stored procedure? And if the latter, guidance would be helpful, as I'm not too well versed in them.

    Read the article

  • MS SQL 2008 and MySQL Daily Backups

    - by Tyler
    Is there a quick and easy way to backup both MS SQL 2008 and MySQL, all their databases? Right now I have a batch script that runs, but I have to manually add a database each and every time, and I'm sick of maintaining it. So I want to set it up to backup all MS SQL and then all MySQL, I dont care if its two different solutions, just want the ability to backup all the databases without having to type them in. Thank you.

    Read the article

  • How can I display a full designer file in c#?

    - by George Tyler
    So I just got a C# program from someone that compiles and gives me a fully functional application. However, when I want to see the .cs{Design] file it gives me the following error: .ErrorStyle { font-family: tahoma; font-size: 11 pt; .... How can I convert this to an actual Design file? I am working on Visual Studio C#. Thank you very much.

    Read the article

  • What's a unit test? [closed]

    - by Tyler
    Possible Duplicates: What is unit testing and how do you do it? What is unit testing? I recognize that to 95% of you, this is a very WTF question. So. What's a unit test? I understand that essentially you're attempting to isolate atomic functionality but how do you test for that? When is it necessary? When is it ridiculous? Can you give an example? (Preferably in C? I mostly hear about it from Java devs on this site so maybe this is specific to Object Oriented languages? I really don't know.) I know many programmers swear by unit testing religiously. What's it all about? EDIT: Also, what's the ratio of time you typically spend writing unit tests to time spent writing new code?

    Read the article

  • Best ASP.Net Host for Developers [closed]

    - by Tyler
    I would need it to allow me to host subdomains and multiple domains is a huge plus. Required: ASP.NET 2.0, 3.0, 3.5 Subdomain Hosting MS-SQL & MySQL Databases Want Multiple Domain Hosting ASP.NET 4.0 Ability to directly connect to MS SQL using SQL SMS

    Read the article

  • When is it okay to reference WindowsBase.dll?

    - by Tyler
    I've heard/read about people not wanting to reference the assembly because of the Windows component (e.g. "I don't want to reference Windows for my Web App). I'd like to hear what a large community feels about this. For which project types (business, data access, etc.) is it considered acceptable to reference WindowsBase.dll.

    Read the article

  • Update Input Value With jQuery, Old Value Submitted to Form

    - by Tyler DeWitt
    I've got a form with an input with id/name league_id <form accept-charset="UTF-8" action="/user" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="?"><input name="authenticity_token" type="hidden" value="bb92urX83ivxOZZJzWLJMcr5ZSuamowO9O9Sxh5gqKo="></div> <input id="league_id" name="league_id" type="text" value="11"> <select class="sport_selector" id="sport_type_id" name="sport_type_id"><option value="5" selected="selected">Football</option> <option value="25">Women's Soccer</option> <option value="30">Volleyball</option> <option value="10">Men's Soccer</option></select> <input name="commit" type="submit" value="Save changes"> </form> In another part of my page, I have a drop down that, when changed, clears the value of league_id $("#sport_type_id").change -> $("#league_id").val(null) $(this).parents('form:first').submit() If I debug this page, I can see the value get wiped from the text box, but when the form is submitted, my controller always gets the old value. I tried changing the name of the input and got the same results.

    Read the article

  • Android - Display Image Caption Below Images in Gridview

    - by Tyler
    Hello - I am utilizing a version of the "Grid View" example from the Android Developers site: http://developer.android.com/resources/tutorials/views/hello-gridview.html And I would like to display a small text caption below each of the images. Can someone please give an example of how this might be accomplished (i.e. what needs to be edited)? Thanks!

    Read the article

  • How to emulate mod_rewrite in PHP

    - by Tyler Crompton
    I have a few URLs that I want to map to certain files via PHP. Currently, I am just using mod_rewrite in Apache. However, my application is getting too large for the rewriting to be done with regular expressions. So I created a file router.php that does the rewriting. I understand to do a redirect I could just send the Location: header. However, I don't always want to do a redirect. For example, I may want /api/item/ to map to the file /herp/derp.php relative to the document root. I need to preserve the HTTP method as well. "No problem," I thought. I made my .htaccess have the following snippet. RewriteEngine On RewriteRule ^api/item/$ /cgi-bin/router.php [L] And my router.php file looks as follows: <?php $uri = parse_url($_SERVER['REQUEST_URI']); $query = isset($uri['query']) ? $uri['query'] ? array(); // some code that modifies the query require_once "{$_SERVER['DOCUMENT_ROOT']}/herp/derp.php?" . http_build_query($query); ?> However, this doesn't work, because the OS is looking for a file named derp.php?some=query. How can I simulate a rewrite rule such as RewriteRule ^api/item/$ /herp/derp/ [L] in PHP. In other words, how do I tell the server to process a different URL than requested and preserve the query and HTTP method without causing a redirect? Note: Using variables set in router.php is less than desirable and is bad structure since it's only supposed to be responsible for handling URLs. I am open to using a light-weight third party solution.

    Read the article

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