Search Results

Search found 405 results on 17 pages for 'danny chen'.

Page 11/17 | < Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How does tomcat set its executable file as a windows service?

    - by Wing C. Chen
    Firstly, I am not at all familiar with windows batch file programing. Recently I am curious about how tomcat sets itself as a windows service using a batch file. I downloaded the service.bat file from tomcat 6. However, I still don't understand some part of it. I guess this is the line that the batch actually register the exe file to the OS, is it right? Is there any syntax explanation? "%EXECUTABLE%" //IS//%SERVICE_NAME% --StartClass org.apache.catalina.startup.Bootstrap --StopClass org.apache.catalina.startup.Bootstrap --StartParams start --StopParams stop And is this used to remove the service? "%EXECUTABLE%" //DS//%SERVICE_NAME% And this is the setting of the parameters? "%EXECUTABLE%" //US//%SERVICE_NAME% --JvmOptions "-Dcatalina.base=%CATALINA_BASE%;-Dcatalina.home=%CATALINA_HOME%;-Djava.endorsed.dirs=%CATALINA_HOME%\endorsed" --StartMode jvm --StopMode jvm Thanks.

    Read the article

  • Default value for public attributes

    - by Danny Chen
    I have a public attribute in some class. I want a default value -1 for this attribute without an private variable like _MyAttr(because too many attributes, i won't add them one by one). public int MyAttr { get; set; } [DefaultValueAttribute] is not working for this issue i think. Any ideas? Thanks.

    Read the article

  • Git is ignoring .git directories in subdirectories

    - by Danny
    I'm using git as a backup tool and 'roaming profile' for my $HOME directory between laptop and desktop. My problem is that under my $HOME I have a Development directory with multiple git projects I'm working on. Git will not allow me to add the subdirectories .git folders. So to commit to these projects I have to push the changes into my $HOME git repo, pull on laptop (where they were created and .git dir exsits) and commit. I've read about submodules, but it's not really what I want. I just want the children .git folders to be treated like any old directory so I can move them around and back them up. Has anyone done this or have an idea how I would?

    Read the article

  • What's the vbs code to schedule a task every time Windows starts up?

    - by Wing C. Chen
    I would like to know how to write up the vbs code to schedule a windows task to start a .exe program every time the Windows starts up. I found the following code online: strComputer = "." Set objWMIService = GetObject("winmgmts:" _ & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set objNewJob = objWMIService.Get("Win32_ScheduledJob") errJobCreated = objNewJob.Create _ ("Notepad.exe", "********123000.000000-420", _ True , 1 OR 4 OR 16, , , JobID) Wscript.Echo errJobCreated But it only tells me how to schedule the task every on some specific days and hours. I thought of creating a windows service. However the following is the story why I must look for an alternative to it. I created a windows service with RunAsService for my java program wrapped with Janel. The Service worked fine when I first installed and started it. However, after restarting my windows xp, a dialog window poped out saying that my janel generated .exe file has crashed, with my RunAsService service kept on going. The service worked fine when I terminated the service and restarted it again manually. Nevertheless, the same crash happens over and over again every time I restart my Windows.

    Read the article

  • What is the proper location for a sqlite3 database file?

    - by Elliot Chen
    Hi, Everyone: I'm using a sqlite3 database to store app's data. Instead of building a database within program, I introduced an existing db file: 'abc.sqlite' into my project and put it under my 'Resources' folder. So, I think this db file should be inside of 'bundle', so at my init function, I used following statement to read it out: NSString *path = [[NSBundle mainBundle] pathForResource:@"abc" ofType:"sqlite"]; if(sqlite3_open([path UTF8String], &database) != SQLITE_OK) ... It's ok that this db can be opened and data can be retrieved from it. BUT, someone told me that it's better to copy this db file into user folder: such as 'Document'. So, my question is: is it ok to use this db from main bundle directly or copy it to user folder then use that copy. Which is better? Thank you very much!

    Read the article

  • How can I get the type I want?

    - by Danny Chen
    There are a lot of such classes in my project (very old and stable code, I can't do many changes to them, maybe slight changes are OK) public class MyEntity { public long ID { get; set; } public string Name { get; set; } public decimal Salary { get; set; } public static GetMyEntity ( long ID ) { MyEntity e = new MyEntity(); // load data from DB and bind to this instance return e; } } For some reasons, now I need to do this: Type t = Type.GetType("XXX"); // XXX is one of the above classes' name MethodInfo staticM= t.GetMethods(BindingFlags.Public | BindingFlags.Static).FirstOrDefault();// I'm sure I can get the correct one var o = staticM.Invoke(...); //returns a object, but I want the type above! If I pass "MyEntity" at beginning, I hope I can get o as MyEntity! Please NOTE that I know the "name of the class" only. MyEntity e = staticM.Invoke(...) as MyEntity; can't be used here.

    Read the article

  • Using the same code in different (partial) views

    - by Danny Chen
    Maybe this question is quite simple because I'm new to MVC2. I have a simple demo MVC project. (1) A weak-typed view: Index.aspx <% Html.RenderPartial("ArticalList", ViewData["AllArticals"] as List<Artical>); %> (2) A strong-typed partical view: ArticalList.ascx <%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<List<Artical>>" %> <% foreach (Artical a in Model) { %> <%= Html.ActionLink(a.Title, "About", new { id = a.ID })%><br /> <%} %> (3) Here is the HomeController.cs public ActionResult Index() { ViewData["AllArticals"] = Artical.GetArticals(); return View(); } public ActionResult ArticalList() { return PartialView(Artical.GetArticals()); } Sorry I'm using a Web-Form "angle", because if I'm using a Web-Form, when I visit Index.aspx, rendering ArticalList.ascx will call public ActionResult ArticalList(). But here I need to write Artical.GetArticals() twice in two actions. How can I put them in one?

    Read the article

  • Hbase schema design -- to make sorting easy?

    - by chen
    I have 1M words in my dictionary. Whenever a user issue a query on my website, I will see if the query contains the words in my dictionary and increment the counter corresponding to them individually. Here is the example, say if a user type in "Obama is a president" and "Obama" and "president" are in my dictionary, then I should increment the counter by 1 for "Obama" and "president". And from time to time, I want to see the top 100 words (most queried words). If I use Hbase to store the counter, what schema should I use? -- I have not come up an efficient one yet. If I use word in my dictionary as row key, and "counter" as column key, then updating counter(increment) is very efficient. But it's very hard to sort and return the top 100. Anyone can give a good advice? Thanks.

    Read the article

  • How to know that a php project is using Zend framework?

    - by Wing C. Chen
    I am writing a piece of small software to go through the folders and files of all the php projects that are passed in and detect if any of them is actually also a Zend project. Is there any particular file that I can immediately read and tell that the current project is a Zend project? or is there any convenient way to tell?

    Read the article

  • Object Oriented Programming Problem

    - by Danny Love
    I'm designing a little CMS using PHP whilst putting OOP into practice. I've hit a problem though. I have a page class, whos constructor accepts a UID and a slug. This is then used to set the properties (unless the page don't exist in which case it would fail). Anyway, I wanted to implement a function to create a page, and I thought ... what's the best way to do this without overloading the constructor. What would the correct way, or more conventional method, of doing this be? My code is below: <?php class Page { private $dbc; private $title; private $description; private $image; private $tags; private $owner; private $timestamp; private $views; public function __construct($uid, $slug) { } public function getTitle() { return $this->title; } public function getDescription() { if($this->description != NULL) { return $this->description; } else { return false; } } public function getImage() { if($this->image != NULL) { return $this->image; } else { return false; } } public function getTags() { if($this->tags != NULL) { return $this->tags; } else { return false; } } public function getOwner() { return $this->owner; } public function getTimestamp() { return $this->timestamp; } public function getViews() { return $this->views; } public function createPage() { // Stuck? } }

    Read the article

  • Confused about GNU `sort(1)` of a numerical sub field

    - by Chen Levy
    I wish to sort a space separated table, with the numerical value that found on the 2nd field. I can assume that the 2nd field is always fooN but the length of N is unknown: antiq. foo11 girls colleaguing foo2 Leinsdorf Cousy foo0 Montgomeryville bowlegged foo1 pollack Chevrier foo10 ill-conceived candlebomb foo3 seventieths autochthony foo101 re-enable beneficiate foo100 osteometric I read man sort(1) and played with all sort of options. On my system I found the line: sort -n -k2.5 table to work. My question is why? According to the man page: -k, --key=POS1[,POS2] start a key at POS1, end it at POS 2 (origin 1) ... POS is F[.C][OPTS], where F is the field number and C the characterposition in the field. OPTS is one or more single-letter ordering options, which override global ordering options for that key. If no key is given, use the entire line as the key. So why sort -n -k2.4 table don't work and sort -n -k.5 does?

    Read the article

  • How to automatically email customers registration keys?

    - by Danny
    I've written a bit of software that I'd like to share with others (a Mac Dashboard widget, specifically), but I'd also like to be compensated a bit for the time I spent on it. I've devised my own simple registration key algorithm, which takes a customer's email address and creates a 12-character alphanumeric key. The software itself is finished, demo limitations, key validation & all. I just need to get the keys to customers. How do I simply alert a key generation script to automatically email a customer a key, upon notification that they paid my account? Can I use PayPal IPN & JavaScript? The simplest solution will do - this is a five dollar widget. :)

    Read the article

  • What data type should I use for my texture coordinates in OpenGL ES?

    - by Matthew Chen
    I notice that the default data type for texture coordinates in the OpenGL docs is GLfloat, but much of the sample code I see written by experienced iphone developers uses GLshort or GLbyte. Is this an optimization? GLfloat vertices[] = { // Upper left x1, y2, // Lower left x1, y1, // Lower right x2, y1, // Upper right x2, y2, }; glTexCoordPointer(2, GL_FLOAT, 0, iconSTs); vs. GLbyte vertices[] = { // Upper left x1, y2, // Lower left x1, y1, // Lower right x2, y1, // Upper right x2, y2, }; glTexCoordPointer(2, GL_BYTE, 0, iconSTs);

    Read the article

  • How to launch a web server and point the browser to it when it finishes?

    - by Wing C. Chen
    I am writing a windows batch file to do the following things: Display a picture in the middle of the screen, showing the beautiful icon of my software. Kick of the launch of the web server. Finish displaying the picture. Point the browser to the start page. I have already know how to do it in step 2 and 4. However, I have the following questions in writing the windows batch file: 1. How do I know that the launch of the web server is finished, taking jetty as the example? 2. How do I display a picture and stop displaying it when I want to? Here is what I have got so far: ::here I would like to display the picture start javaw -jar start.jar ::Starting jetty here ::here I would like to stop displaying the picture start http://localhost:8080/myApp ::Pointing the browser to the page Thank you in advance for your help.

    Read the article

  • Why doesn't ConcurrentQueue<T>.Count return 0 when IsEmpty == true?

    - by DanTup - Danny Tuppeny
    I was reading about the new concurrent collection classes in .NET 4 on James Michael Hare's blog, and the page talking about ConcurrentQueue<T> says: It’s still recommended, however, that for empty checks you call IsEmpty instead of comparing Count to zero. I'm curious - if there is a reason to use IsEmpty instead of comparing Count to 0, why does the class not internally check IsEmpty and return 0 before doing any of the expensive work to count? E.g.: public int Count { get { // Check IsEmpty so we can bail out quicker if (this.IsEmpty) return 0; // Rest of "expensive" counting code } } It seems strange to suggest this if it could be "fixed" so easily with no side-effects?

    Read the article

  • Use ASP.NET MVC for html brochure websites?

    - by Danny
    I have a project that will basically be a large brochure html website. Although some content could possibly be database driven in the future. I use ASP.NET MVC for any database driven websites usually, but not sure whether to use it for brochure html websites.

    Read the article

  • Browser loading strategy, <head>...<body>

    - by Bin Chen
    I am inspecting some interesting behaviors of browser, I don't know it's in standard or not. If I put everythin inside <head></head>, the browser will only begin to render the page after all the resouces in head is retrieved. So I am thinking that put as little as possible things into head is one of the important website optimization techniques, is it right? My question is: If I put script/css in body or other parts of the html, how can I know that script has been loaded successfully so that I will not be calling a undefined function?

    Read the article

  • Trigger the change event of a textbox in jQuery

    - by Danny Chen
    I have an asp:TextBox with asp:RegularExpressionValidator to validate if it's a number. Obviously an onchange event will be attached to this textbox while rendering. Also I add a change event at $(document).ready to make some calculation when the value is changed. <asp:TextBox id="myText" runat="server" /> <asp:regularexpressionvalidator id="myRev" ControlToValidate="myText" runat="server">*</asp:regularexpressionvalidator> $(document).ready(function(){ $('[id$=myText]').bind('change',function(){ //do something }).change(); //force the change event at the very beginning }); My function will be executed later than the .net generated js because of the register time. But the .net js throws an error. I traced in the js: function ValidatorOnChange(event) { ... } and found that all of event.fromElement,event.toElement,event.srcElement are null which causes the exception. Did I do something wrong? Any solutions? Thanks.

    Read the article

  • XForms relation of 'constraint' and 'required' properties

    - by Danny
    As a reference, the most similar question already asked is: http://stackoverflow.com/questions/8667849/making-xforms-enforce-the-constraint-and-type-model-item-properties-only-when-fi The difference is that I cannot use the relevant properties since I do want the field to be visible and accessible. I'm attempting to make a XForms form that has the following properties: It displays a text field named 'information'. (for the example) This field must not be required, since it may not be necessary to enter data. (Or this data will be entered at a later time.) However, if data is entered in this field, it must adhere to the specified constraint. I cannot mark the field as not relevant since this would hide the field and some data may need to be entered in it. The trouble now is that even though the field has no data in it, the constraint is still enforced (i.e. even though it is not marked as 'required'). I have taken a look at the XForms 1.1 specification, however it does not seem to describe how the properties 'required' and 'constraint' should interact. The only option I see, is to add a part to the constraint such that an empty value is allowed. e.g.: . = '' or <actual-constraint However, I don't like this. It feels like a workaround to add this to every such field. Is there any other way to express that non-required fields should not need to match the constraint for that field? (Am I missing something?)

    Read the article

< Previous Page | 7 8 9 10 11 12 13 14 15 16 17  | Next Page >