Search Results

Search found 3180 results on 128 pages for 'david sauter'.

Page 62/128 | < Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >

  • How do i import AWT?

    - by David
    Im teaching myself java and the book i'm looking at just got around to explaining AWT. here is my source code: java.awt.* class obj { public static void main (String[]arg) { Point blank; blank = new Point (3,4) ; int x = blank.x ; System.out.prinln (x) ; } } here is the error i get while trying to compile it: obj.java:1: 'class' or 'interface' expected java.awt.* ^ 1 error What did i do wrong? / whats going wrong here?

    Read the article

  • Using T4 templates to add custom code to EF4 generated entities?

    - by David Veeneman
    I am getting started with Entity Framework 4, using model-first development. I am building a simple WPF demo app to learn the framework. My app has two entities, Topic and Note. A Topic is a discussion topic; it has Title, Text, and DateRevised properties. Topic also has a Notes collection property. a Note has DateCreated and Text properties. I have used EF4 to create an EDM and data store for the app. Now I need to add just a bit of intelligence to the entities. For example, the property setter for the Topic.Text property needs to update the Topic.DateRevised property, and a Note needs to set its DateCreated property when it is instantiated--pretty simple stuff. I assume that I can't modify the generated classes directly, because my code would be lost if the entities are re-generated. Is this the sort of thing that I can implement by modifying the T4 template that EF4 uses to generate the entities? In other words, can a T4 template be modified to add my code for performing these tasks to the entities that it generates? Can you refer me to a good tutorial or explanation of how to get started? Most of what I have found so far talks about how to add a tt file to an EDM, so I can do that. What I am looking for is a resource that I can use to get to the next level, assuming that a T4 template can be used to customize generated entities as I have described. Thanks for your help.

    Read the article

  • Generic wrapper for System.Web.Caching.Cache functions

    - by David Neale
    I've created a generic wrapper for using the Cache object: public class Cache<T> where T : class { public Cache Cache {get;set;} public CachedKeys Key {get;set;} public Cache(Cache cache, CachedKeys key){ Cache = cache; Key = key; } public void AddToCache(T obj){ Cache.Add(Key.ToString(), obj, null, DateTime.Now.AddMinutes(5), System.Web.Caching.Cache.NoSlidingExpiration, System.Web.Caching.CacheItemPriority.Normal, null); } public bool TryGetFromCache(out T cachedData) { cachedData = Cache[Key.ToString()] as T; return cachedData != null; } public void RemoveFromCache() { Cache.Remove(Key.ToString()); } } The CachedKeys enumeration is just a list of keys that can be used to cache data. The trouble is, to call it is quite convuluted: var cache = new Cache<MyObject>(Page.Cache, CachedKeys.MyKey); MyObject myObject = null; if(!cache.TryGetFromCache(out myObject)){ //get data... cache.AddToCache(data); //add to cache return data; } return myObject; I only store one instance of each of my objects in the cache. Therefore, is there any way that I can create an extension method that accepts the type of object to Cache and uses (via Reflection) its Name as the cache key? public static Cache<T> GetCache(this Cache cache, Type cacheType){ Cache<cacheType> Cache = new Cache<cacheType>(cache, cacheType.Name); } Of course, there's two errors here: Extension methods must be defined in a non-generic static class The type or namespace name 'cacheType' could not be found This is clearly not the right approach but I thought I'd show my working. Could somebody guide me in the right direction?

    Read the article

  • Is is possible to to have a depends on a jQuery remote validation?

    - by David Kethel
    I am using jQuery remote validation to check if the description is already being used. Description: { required: true, maxlength: 20, remote: function () { var newDescription = $("#txtDescription").val(); var dataInput = { geoFenceDescription: newDescription }; var r = { type: "POST", url: "/ATOMWebService.svc/DoesGeoFenceDescriptionExist", data: JSON.stringify(dataInput), contentType: "application/json; charset=utf-8", dataType: "json", dataFilter: function (data) { var x = (JSON.parse(data)).d; return JSON.stringify(!x); } }; return r; } }, The problem I have is that this remote validation occurs when the user has NOT modified the text box and comes back saying the description has been used because it found it self in the database. So is it possible to only run the remote validation if the text field is different to what was originally in it? I noticed the the jQuery required validation has a depends option, but I couldn't get it to work with the remote call.

    Read the article

  • SublimeJava won't react at all on Mac OS X 10.7

    - by David Merz
    today I tried to install and run the SublimeJava Plugin for Sublime Text 2. Here is basically what i've done. Cloning the git Repository https://github.com/quarnster/SublimeJava.git into ~/Library/Application Support/Sublime Text 2/Packages. Created a ProjectFile to test the Plugin. { "folders": [ { // The class files are in the same directory "path": "~/src/path_to_project/" } ], "settings": [ { "sublimejava_classpath": [ "~/src/path_to_project/", "/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Libraries/" ], "sublimejava_enabled":true } ] } Now whenever I type something that should trigger the code-completion, nothing happens. I hope you guys can sort me out here, many thanks in advance!!

    Read the article

  • Stack Overflow-like tag selector for Rails

    - by David Tildon
    I want to use tags for a model in my Rails application, and I'd like to have the same kind of tag selection mechanism that Stack Overflow has when asking a question. I.e. I type in 'rails' and it drops down a list of tags that include 'rails', and I can go on to add more tags from there. Is there a plugin that can do this? I'm comfortable putting together the tag model and migrations myself, that isn't an issue. I just need something to handle the AJAX and javascript. I'm using prototype and Rails 2.3.

    Read the article

  • What's the UITableView index magnifying glass character?

    - by David Grant
    In Apple's iPhone apps (like Contacts), they have a nice magnifying glass icon at the top of the table view index. Since the table view index API is character-based, I assume that this magnifying glass is a Unicode character. So far I've resorted to placing a question mark character there, but that looks lame. Can anyone tell me what character the magnifying glass is?

    Read the article

  • Removing the obstacle that yields the best path from a map after A* traversal

    - by David Titarenco
    I traverse a 16x16 maze using my own A* implementation. This is exactly what my program does: http://www.screenjelly.com/watch/fDQh98zMP0c?showTab=share All is well. However, after the traversal, I would like to find out what wall would give me the best alternative path. Apart from removing every block and re-running A* on the maze, what's a clever solution? I was thinking give every wall node (ignored by A*), a tentative F-value, and change the node structure to also have a n-sized list of node *tentative_parent where n is the number of walls in the maze. Could this be viable?

    Read the article

  • FOR BOUNTY: "QFontEngine(Win) GetTextMetrics failed ()" error on 64-bit Windows

    - by David Murdoch
    I'll add a large bounty to this when Stack Overflow lets me. I'm using wkhtmltopdf to convert HTML web pages to PDFs. This works perfectly on my 32-bit dev server [unfortunately, I can't ship my machine :-p ]. However, when I deploy to the web application's 64-bit server the following errors are displayed: C:\>wkhtmltopdf http://www.google.com google.pdf Loading pages (1/5) QFontEngine::loadEngine: GetTextMetrics failed () ] 10% QFontEngineWin: GetTextMetrics failed () QFontEngineWin: GetTextMetrics failed () QFontEngine::loadEngine: GetTextMetrics failed () QFontEngineWin: GetTextMetrics failed () QFontEngineWin: GetTextMetrics failed () QFontEngineWin: GetTextMetrics failed () QFontEngine::loadEngine: GetTextMetrics failed () ] 36% QFontEngineWin: GetTextMetrics failed () QFontEngineWin: GetTextMetrics failed () // ...etc.... and the PDF is created and saved... just WITHOUT text. All form-fields, images, borders, tables, divs, spans, ps, etc are rendered accurately...just void of any text at all. Server information: Windows edition: Windows Server Standard Service Pack 2 Processor: Intel Xeon E5410 @ 2.33GHz 2.33 GHz Memory: 8.00 GB System type: 64-bit Operating System Can anyone give me a clue as to what is happening and how I can fix this? Also, I wasn't sure what to tag/title this question with...so if you can think of better tags/title comment them or edit the question. :-)

    Read the article

  • pip: dealing with multiple Python versions?

    - by David Wolever
    Is there any way to make pip play well with multiple versions of Python? For example, I want to use pip to explicitly install things to either my site 2.5 installation or my site 2.6 installation. For example, with easy_install, I use easy_install-2.{5,6}. And, yes — I know about virtualenv, and no — it's not a solution to this particular problem.

    Read the article

  • DataReader - hardcode ordinals?

    - by David Neale
    When returning data from a DataReader I would typically use the ordinal reference on the DataReader to grab the relevant column: if (dr.HasRows) Console.WriteLine(dr[0].ToString()); (OR dr.GetString(0); OR (string)dr[0];)... I have always done this because I was advised at an early stage that using dr["ColumnName"] or a more elegant way of indexing causes a performance hit. However, whilst everything is becoming increasingly strongly-typed I feel more uncomfortable with this. I'm also aware that the above does not check for DBNull. How should data be returned from a DataReader?

    Read the article

  • Why are these strange characters appearing in mcrypt?

    - by David
    I Encrypt and Decrypt successfully, but when I decrypt the value, appears strange characters at the final of string "???": The initial $_POST['value'] do not have any blank space or any strange character Any idea to solve this? Encrypt with this: $key='my key'; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $id = mcrypt_generic($td, $_POST['value']); mcrypt_generic_deinit($td); mcrypt_module_close($td); Decrypt with this: $key='my key'; $td = mcrypt_module_open('tripledes', '', 'ecb', ''); $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($td), MCRYPT_RAND); mcrypt_generic_init($td, $key, $iv); $id = mdecrypt_generic($td, $_COOKIE['value']); mcrypt_generic_deinit($td); mcrypt_module_close($td);

    Read the article

  • Invoking methods on objects in java.

    - by David
    If i have a class called Dice which contains this method: public void roll () { this.x = randNum(1, this.sum.length) ; this.sum[x] ++ ; } And i am in a diferent class how do i invoke this method? I am currently trying InstanceOfObjectName.Dice.roll and its not working. What should i do?

    Read the article

  • How to do HTTP authentication with Goliath/Heroku?

    - by David
    I'm using Goliath as my app server, and I am trying to convert "Ruby – Secure staging environment of your public app from users and bots" so it applies to my Goliath application. I am trying to use Rack::Static but I'm not sure how to write the code. I was trying something like: class Application < Goliath::API use(Rack::Lock) But I am not really sure how to translate the link I posted. I'm open to other alternatives, I just need my whole site password protected.

    Read the article

  • 2-step user registration with Django

    - by David S
    I'm creating a website with Django and want a fairly common 2-step user registration. What I mean by this is that the user fills in the some basic user information + some application specific information (sort of like a coupon value). Upon submit, an email is sent to ensure email address is valid. This email should contain a link to click on to "finish" the registration. When the link is clicked, the user is marked as validated and they are directed to a new page to complete optional "user profile" type information. So, pretty basic stuff. I have done some research and found django-registration by James Bennett. I do know who James is and have seen him at PyCons and DjanoCons in the past. There is obviously very few people in the world that know Django better than James (so, I know the quality of the code/app is good). But, it almost seems like a bit of over kill. I've read through the docs and was a bit confused (maybe I'm just being a bit dense today). I believe that if I do use django-registration, I will need to have some custom forms, etc. Is there anything else out there I should evaluate? Or are there any good tutorials or videos on using django-registration? I've done a bit of googling, but haven't found anything. But, I suspect that it might be a case of a lot of very common words that don't really find what you are looking for (django user registration tutorial/example). Or is just a case where it would be just about as easy to build your own solution with Django forms, etc? Here is the tech stack I'm using: Python 2.7.2 Django 1.3.1 PostgreSQL 9.1 psycopg2 2.4.1 Twitter Bootstrap 2.0.2

    Read the article

  • Setting the background color of WPF TabControl inactive tabs

    - by David Veeneman
    Is there a simple way to set the background brush of all inactive tabs in a WPF TabControl? I want to emulate the look of VS 2010 on a TabControl--the background color of the control's inactive tabs should match the background color of the window in which the TabControl is sited, so that you see only the text of the tab, and not the tab itself. I know it will take a ControlTemplate to do it; I am trying to figure out what to put in the control template. Put another way, How do I specify that a particular brush should be applied to all inactive tabs? Thanks for your help.

    Read the article

  • How do I create a scheduled task, via command line, which includes advanced options

    - by David
    I'm trying to create a scheduled task (in WinXP) which runs every 10 minutes, starting at 16:00:00 to 06:00:00, daily, from the command line. Currently, I can create a scheduled task which runs every 10 minutes, starting at 16:00:00, daily, by using the following command: SCHTASKS.EXE /CREATE /SC MINUTE /MO 10 /TN "Scheduled task name" /ST 16:00:00 /SD 01/01/2000 /TR task.bat /RU SYSTEM The question is, how do I modify the previous command so that it stops running at 06:00:00?

    Read the article

  • Would OpenID or OAuth work for authorization/authentication on a distributed web service?

    - by David Eyk
    We're in the early stages of designing a RESTful/resource-oriented web service API for a computational lingustics application. Because many of the resources we plan to serve are rights-encumbered, a key design decision has been to specify the platform so that each resource provider can expose their own web service that complies with the API spec. This way, the rights owner maintains control over their content (and thus the ability to throttle or deny access at will) and a direct relationship with the consumer, while still being able to participate in in the collaborative network. At the same time, to simplify the job of writing a client for this service, we want to allow a client access to the distributed service through one end-point, with the server handling content negotiation and retrieval from the appropriate providers. Right now, we're at an impasse on authentication/authorization schemes. One of our number has argued for the (technical) simplicity of a central authentication registry, but others are concerned about the organizational complexity of such a scheme. It seems to me, based on an albeit limited understanding of the technologies, that a combination of OpenID and OAuth would do the trick, with a client authenticating with the end-point via OpenID, and the server taking action on the user's behalf with the various content providers using OAuth. I've only ever seen implementations (e.g. stackoverflow, twitter, etc.) where a human was present to intervene, and I still need to do more research on these technologies. Would a scheme like this work for an automated web service, or would it make the client too difficult to implement and operate?

    Read the article

  • Ajax and Brower Navigation for Back/Forward

    - by David Rodecker
    I am using a ASP.net form with custom onclick mouse events to modify data values. Upon clicking and updating the values, one div section of the form performs a postback. onclick="__doPostBack('ctl01$phCon1$gridReports','sel1')" This is working well, however when the browser BACK option is selected, the browser opens goes through the history of the DIV ajax/onclick actions prior to going back to the prior URL. I suspect that this may be due to the doPostBack being treated as a browsing operation. Is there a means to perform the necessary ASP.net code events to make the page work, but not have the action stored in the browser history?

    Read the article

  • How to overcome shortcomings in reporting from EAV database?

    - by David Archer
    The major shortcomings with Entity-Attribute-Value database designs in SQL all seem to be related to being able to query and report on the data efficiently and quickly. Most of the information I read on the subject warn against implementing EAV due to these problems and the commonality of querying/reporting for almost all applications. I am currently designing a system where almost all the fields necessary for data storage are not known at design/compile time and are defined by the end-user of the system. EAV seems like a good fit for this requirement but due to the problems I've read about, I am hesitant in implementing it as there are also some pretty heavy reporting requirements for this system as well. I think I've come up with a way around this but would like to pose the question to the SO community. Given that typical normalized database (OLTP) still isn't always the best option for running reports, a good practice seems to be having a "reporting" database (OLAP) where the data from the normalized database is copied to, indexed extensively, and possibly denormalized for easier querying. Could the same idea be used to work around the shortcomings of an EAV design? The main downside I see are the increased complexity of transferring the data from the EAV database to reporting as you may end up having to alter the tables in the reporting database as new fields are defined in the EAV database. But that is hardly impossible and seems to be an acceptable tradeoff for the increased flexibility given by the EAV design. This downside also exists if I use a non-SQL data store (i.e. CouchDB or similar) for the main data storage since all the standard reporting tools are expecting a SQL backend to query against. Do the issues with EAV systems mostly go away if you have a seperate reporting database for querying? EDIT: Thanks for the comments so far. One of the important things about the system I'm working on it that I'm really only talking about using EAV for one of the entities, not everything in the system. The whole gist of the system is to be able to pull data from multiple disparate sources that are not known ahead of time and crunch the data to come up with some "best known" data about a particular entity. So every "field" I'm dealing with is multi-valued and I'm also required to track history for each. The normalized design for this ends up being 1 table per field which makes querying it kind of painful anyway. Here are the table schemas and sample data I'm looking at (obviously changed from what I'm working on but I think it illustrates the point well): EAV Tables Person ------------------- - Id - Name - ------------------- - 123 - Joe Smith - ------------------- Person_Value ------------------------------------------------------------------- - PersonId - Source - Field - Value - EffectiveDate - ------------------------------------------------------------------- - 123 - CIA - HomeAddress - 123 Cherry Ln - 2010-03-26 - - 123 - DMV - HomeAddress - 561 Stoney Rd - 2010-02-15 - - 123 - FBI - HomeAddress - 676 Lancas Dr - 2010-03-01 - ------------------------------------------------------------------- Reporting Table Person_Denormalized ---------------------------------------------------------------------------------------- - Id - Name - HomeAddress - HomeAddress_Confidence - HomeAddress_EffectiveDate - ---------------------------------------------------------------------------------------- - 123 - Joe Smith - 123 Cherry Ln - 0.713 - 2010-03-26 - ---------------------------------------------------------------------------------------- Normalized Design Person ------------------- - Id - Name - ------------------- - 123 - Joe Smith - ------------------- Person_HomeAddress ------------------------------------------------------ - PersonId - Source - Value - Effective Date - ------------------------------------------------------ - 123 - CIA - 123 Cherry Ln - 2010-03-26 - - 123 - DMV - 561 Stoney Rd - 2010-02-15 - - 123 - FBI - 676 Lancas Dr - 2010-03-01 - ------------------------------------------------------ The "Confidence" field here is generated using logic that cannot be expressed easily (if at all) using SQL so my most common operation besides inserting new values will be pulling ALL data about a person for all fields so I can generate the record for the reporting table. This is actually easier in the EAV model as I can do a single query. In the normalized design, I end up having to do 1 query per field to avoid a massive cartesian product from joining them all together.

    Read the article

  • Relative connection string to AzMan XML store when using security application block

    - by David Hall
    Is it possible to specify a relative connection string for an AzMan XML store? My current connection string is connectionString="msxml://c:/azman.xml" but I really need to make that relative so other developers and automated builds can get the latest authorization store. MS documentation seems to suggest that connectionString="msxml://azman.xml" should work but that throws a The request is not supported error. EDIT: I realised that the fact I'm using AzMan through the Enterprise Library Security Application Block was important to the question.

    Read the article

  • Looking for Antlr Grammar syntaxt highlight in VS2010

    - by David Mårtensson
    I am looking for some way to edit antlr grammar files directly within VS2010 with syntax highlight. I have used antlrworks a lot but it has the drawback that I have to start antlrworks separately and then browse to the file I want to edit, do the changed and save. For minor fixes I do not need all the tools in Antlrworks but I still would like the syntax highlight. But I have not been able to get VS2010 to open antlrworks with the right file and I have found no other way to get syntax highlight directly within VS2010 editor, it just opens as plain text. I can get visual studio to open antlrworks but it will open with only the last set of files it had open, not the one I clicked on. So my question(s) are: Is there a way to get antlrworks to open with the right file when I double click in it in visual studio project explorer? Is there any other way to get correct syntax highlight for antlr grammar files within visual studio (or with another editor, preferably not one that costs money, but if there are no free ones a commercial one might be an option).

    Read the article

< Previous Page | 58 59 60 61 62 63 64 65 66 67 68 69  | Next Page >