Daily Archives

Articles indexed Friday May 21 2010

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

  • Set Jtable/Column Renderer for booleans

    - by twodayslate
    Right now my Boolean values for my JTable display as JCheckBoxes. This would normally be fine but I would like to display them as either an alternative String or image. I can get them to display as true/false but I would like to display them as a checkmark (?) if true and nothing if false. Possibly an image but lets do a String first...

    Read the article

  • How to apply that resize method?

    - by Qpixo
    I noticed this full flash site and wonderring http://www.houseoforange.nl/site/#/Photographers/Philip%20Riches/editorial%20women/ How can I apply the resize method like the way they did? Any examples might help me a lot.

    Read the article

  • Deploying an HttpHandler web service

    - by baron
    I am trying to build a webservice that manipulates http requests POST and GET. Here is a sample: public class CodebookHttpHandler: IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.Request.HttpMethod == "POST") { //DoHttpPostLogic(); } else if (context.Request.HttpMethod == "GET") { //DoHttpGetLogic(); } } ... public void DoHttpPostLogic() { ... } public void DoHttpGetLogic() { ... } I need to deploy this but I am struggling how to start. Most online references show making a website, but really, all I want to do is respond when an HttpPost is sent. I don't know what to put in the website, just want that code to run. Edit: I am following this site as its exactly what I'm trying to do. I have the website set up, I have the code for the handler in a .cs file, i have edited the web.config to add the handler for the file extension I need. Now I am at the step 3 where you tell IIS about this extension and map it to ASP.NET. Also I am using IIS 7 so interface is slightly different than the screenshots. This is the problem I have: 1) Go to website 2) Go to handler mappings 3) Go Add Script Map 4) request path - put the extension I want to handle 5) Executable- it seems i am told to set aspnet_isapi.dll here. Maybe this is incorrect? 6) Give name 7) Hit OK button: Add Script Map Do you want to allow this ISAPI extension? Click "Yes" to add the extension with an "Allowed" entry to the ISAPI and CGI Restrictions list or to update an existing extension entry to "Allowed" in the ISAPI and CGI Restrictions list. Yes No Cancel 8) Hit Yes Add Script Map The specified module required by this handler is not in the modules list. If you are adding a script map handler mapping, the IsapiModule or the CgiModule must be in the modules list. OK edit 2: Have just figured out that that managed handler had something to do with handlers witten in managed code, script map was to help configuring an executable and module mapping to work with http Modules. So I should be using option 1 - Add Managed Handler. See: http://yfrog.com/11managedhandlerp I know what my request path is for the file extension... and I know name (can call it whatever I like), so it must be the Type field I am struggling with. In the applications folder (in IIS) so far I just have the MyHandler.cs and web.config (Of course also a file with the extension I am trying to create the handler for!) edit3: progress So now I have the code and the web.config set up I test to see If I can browse to the filename.CustomExtension file: HTTP Error 404.3 - Not Found The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. So in IIS7 I go to Handler Mappings and add it in. See this MSDN example, it is exactly what I am trying to follow The class looks like this: using System.Web; namespace HandlerAttempt2 { public class MyHandler : IHttpHandler { public MyHandler() { //TODO: Add constructor logic here } public void ProcessRequest(HttpContext context) { var objResponse = context.Response; objResponse.Write("<html><body><h1>It just worked"); objResponse.Write("</body></html>"); } public bool IsReusable { get { return true; } } } } I add the Handler in as follows: Request path: *.whatever Type: MyHandler (class name - this appears correct as per example!) Name: whatever Try to browse to the custom file again (this is in app pool as Integrated): HTTP Error 500.21 - Internal Server Error Handler "whatever" has a bad module "ManagedPipelineHandler" in its module list Try to browse to the custom file again (this is in app pool as CLASSIC): HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler.

    Read the article

  • Best way to score and sum in Scala?

    - by adam77
    Is there a better way of doing this: val totalScore = set.foldLeft(0)( _ + score(_) ) or this: val totalScore = set.map(score(_)).sum I think it's quite a common operation so was expecting something sleeker like: val totalScore = set.sum( score(_) )

    Read the article

  • Switching languages on a website with PHP

    - by jnkrois
    Hello everybody, I'm just looking for some advice. I'm creating a website that offers (at least) 2 languages. The way I'm setting it up is by using XML files for the language, PHP to retrieve the values in the XML nodes. Say you have any XML file, being loaded as follows: <?php $lang = "en"; $xmlFile = simplexml_load_file("$lang/main.xml"); ?> Once the file contents are available, I just output each node into an HTML tag like so: <li><?php echo $xmlFile->navigation->home; ?></li> which in turn is equal to : <li><a href="#">Home</a></li> as a nav bar link. Now, the way in which I'm switching languages is by changing the value of the "$lang" variable, through a "$_POST", like so: if(isset($_POST['es'])){ $lang = "es"; }elseif(isset($_POST['en'])){ $lang = "en"; } The value of the "$lang" variable is reset and the new file is loaded, loading as well all the new nodes from the new XML file, hence changing the language. I'm just wondering if there is another way to reset the "$lang" variable using something else, other than "$_POST" or "$_GET". I don't want to use query string either. I know I could use JavaScript or jQuery to achieve this, but I'd like to make the site not too dependable on JavaScript. I'd appreciate any ideas or advice. Thanks

    Read the article

  • Is it appropriate to set a value to a "const char *" in the header file

    - by sud
    I have seen people using 2 methods to declare and define char * Medhod-1: The header file has the below const char* COUNTRY_NAME_USA = "USA"; Medhod-2: The header file has the below declaration const char* COUNTRY_NAME_USA; The cpp file has the below defintion : const char* COUNTRY_NAME_USA = "USA"; Is method-2 wrong in some way ? What is the difference between the two ? I understand the difference between "const char * const var" , and "const char * var". If in the above methods if a "const char * const var" is declared and defined in the header as in method 1 will it make sense ?

    Read the article

  • MVVM where does the code to load the data belong?

    - by cody
    As I wrap my head around the mvvm thing, the view is the view, and the viewmodel is 'a modal of a view' and the model are the entities we are dealing with (or at least that is my understanding). But I'm unclear as to what and when the model entities are populated. So for example: Lets say I have app that needs to create a new record in a DB. And that record should have default values to start with. Who is responsible for the new record, and getting the default values. Does this have anything to do with MVVM or is that part of a data access layer? Who calls the the viewmodel? Or for existing records when\where are the records retrieved? And saved if altered? Thanks

    Read the article

  • :confirm option in Rails being ignored.

    - by peehskcalba
    I've got a table of projects in my Rails app, each with a delete link, like so: <%= link_to "Delete", project, :confirm => "Are you sure?", :method => :delete %> However, the delete request is sent even if the user clicks "Cancel" on the dialog box. Any ideas on how to fix this?

    Read the article

  • Copy XP local profile to new domain user profile

    - by Saif Khan
    I just rolled out a new domain controller. I want to join all the PCS to this new domein (the PCs were never on a domain just a regular workgroup). When I join a PC to the new domain it creates a new profile. How can I migrate (or whats an easy way) the local profile to this new domain profile? Can I keep all settings, desktop layout, outlook 2003 settings etc while doing this?

    Read the article

  • Moving FederatedEmail/SystemMailbox from One Store to Another - Exchange 2010

    - by ThaKidd
    Hello all. Just upgraded from Exchange 2003 to 2010. Somehow, I have two mailbox databases on my single Exchange 2010 server. One database contains all of the mailboxes I had moved from the 2003 exchange server; the other contains two SystemMailboxes and one FederatedEmail box. I am just starting to get a grasp on the commands used in the EMS. I was wondering if someone could point me in the right direction to move these three "system" mailboxes into my actual mailbox database so I can eliminate the second database. Just trying to sure up this one server before I role out my backup Exchange server. Thanks in advance! Your help and ideas are greatly appreciated as I try to make this setup as simple as possible.

    Read the article

  • .Net Finalizer Order / Semantics in Esent and Ravendb

    - by mattcodes
    Help me understand. I've read that "The time and order of execution of finalizers cannot be predicted or pre-determined" Correct? However looking at RavenDB source code TransactionStorage.cs I see this ~TransactionalStorage() { try { Trace.WriteLine( "Disposing esent resources from finalizer! You should call TransactionalStorage.Dispose() instead!"); Api.JetTerm2(instance, TermGrbit.Abrupt); } catch (Exception exception) { try { Trace.WriteLine("Failed to dispose esent instance from finalizer because: " + exception); } catch { } } } The API class (which belongs to Managed Esent) which presumable takes handles on native resources presumably using a SafeHandle? So if I understand correctly the native handles SafeHandle can be finalized before TransactionStorage which could have undesired effects, perhaps why Ayende has added an catch all clause around this? Actually diving into Esent code, it does not use SafeHandles. According to CLR via C# this is dangerous? internal static class SomeType { [DllImport("Kernel32", CharSet=CharSet.Unicode, EntryPoint="CreateEvent")] // This prototype is not robust private static extern IntPtr CreateEventBad( IntPtr pSecurityAttributes, Boolean manualReset, Boolean initialState, String name); // This prototype is robust [DllImport("Kernel32", CharSet=CharSet.Unicode, EntryPoint="CreateEvent")] private static extern SafeWaitHandle CreateEventGood( IntPtr pSecurityAttributes, Boolean manualReset, Boolean initialState, String name) public static void SomeMethod() { IntPtr handle = CreateEventBad(IntPtr.Zero, false, false, null); SafeWaitHandle swh = CreateEventGood(IntPtr.Zero, false, false, null); } } Managed Esent (NativeMEthods.cs) looks like this (using Ints vs IntPtrs?): [DllImport(EsentDll, CharSet = EsentCharSet, ExactSpelling = true)] public static extern int JetCreateDatabase(IntPtr sesid, string szFilename, string szConnect, out uint dbid, uint grbit); Is Managed Esent handling finalization/dispoal the correct way, and second is RavenDB handling finalizer the corret way or compensating for Managed Esent?

    Read the article

  • Prevent drop down list options scrolling on Windows in SWT

    - by parxier
    One of the drop down lists in my Java SWT application has 8 fixed options. When I click on it only 5 first options are visible and I have to scroll the list down to view the rest. Is there any way to force it to make all options visible without having to scroll down? There is another similar .NET application that has same drop down list with the same options and they all are visible without having to scroll down!

    Read the article

  • How to make a Stored Procedure that takes in XML and uses that xml as an Update + call this stored p

    - by chobo2
    Hi I am using ms sql server 2005 and I want to do a mass update. I am thinking that I might be able to do it with sending an xml document to a stored procedure. So I seen many examples on how to do it for insert CREATE PROCEDURE [dbo].[spTEST_InsertXMLTEST_TEST](@UpdatedProdData XML) AS INSERT INTO dbo.UserTable(CreateDate) SELECT @UpdatedProdData.value('(/ArrayOfUserTable/UserTable/CreateDate)[1]', 'DATETIME') But I am not sure how it would look like for an update. I am also unsure how do I pass in the xml through ado.net? Do I pass it as a string through a parameter or what? I know sqlDataApater has a batch update method but I am using linq to sql. So I rather keep using it. So if this works I would be able to grab all records with linq to sql and have them as objects. Then manipulate the objects and use xml seralization. Finally I could just use ado.net simple to send the xml to the server. This might be slower then the sqlDataAdapter but I am willing to take that hit if I can keep using objects.

    Read the article

  • Facebook status.get API throws 500 HTTP status code

    - by Charles Prakash Dasari
    I have an APP that calls Facebook status.get method via the REST server - restserver.php using session key method. This app works fine for most of the users, but for one user I consistently receive HTTP 500 status code. Since this doesn't have any specific Facebook error message, it is almost impossible for me to debug this. Anyone faced a similar problem? What could be wrong with this user account? I checked the privacy options that I could think of and they look fine. Also, for the same user, I can use friends.get method without any problem. EDIT: I tried in Facebook forums as well, but it was of no use. Any pointers in the direction towards debugging/troubleshooting this problem are also appreciated.

    Read the article

  • Check Form for child Forms - C#

    - by dimanyuk
    I have main form and some other forms, that can be shown by controls, using ShowDialog(control). Also I have event handler on the main form, that can be handled anytime. How can I check inside it, is there any other dialog forms?

    Read the article

  • Best way to implement some type of ITaggable interface

    - by Jack
    I've got a program I'm creating that reports on another certain programs backup xml files. I've gotten to the point where I need to implement some type of ITaggable interface - but am unsure how to go about it code wise. My idea is that each item (BackupClient, BackupVersion, and BackupFile) should implement an ITaggable interface for highlighting old, out of date, or non-existent files in their HTML or Excel report. The user will be able to specify tags in the settings. My question is this, how can a user dynamically specify a "tag" such as File Date 3 days old? - Background Color = Red. Actually I guess my question is more, how can I, the programmer, implement this dynamically? I was thinking Expression trees, but am unsure this is the way to go as I havn't studied them much. I know my ITaggable interface would have methods such as AddTag(T tag), RemoveTag(T tag), but what exactly specifies the criteria for the tag to be added? I realize this may be subjective, and can be marked as wiki if need be, but I truly am stuck. Any input would be greatly helpful!

    Read the article

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