Daily Archives

Articles indexed Friday April 2 2010

Page 24/105 | < Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >

  • javascript date and loop check

    - by StealthRT
    Hey all, this is the code i have to check for a day thats equal to the list of days in the comma seperated list: for(var i = 0; i < daysHidden.length; i++){ if (daysHidden[i] == d.getDate()); { alert(daysHidden[i] + '=' + d.getDate()); } } the daysHidden = 1 (its the only thing in the list April 1st is already gone and todays the 2nd so 1 is the only one in the list) and d.getDate() has 1-30 (for april) When i run the code, however, it keeps looping through the if code when it should only loop once (when it finds that 1=1 However, i keep getting the alert box that says: 1=1 1=2 1=3 etc.... 1=30 So i do not know what i am doing incorrect? I already tried putting them as strings: if (daysHidden[i].ToString == d.getDate().ToString); But that doesnt seem to work.... Any help would be great :) David

    Read the article

  • Problem in importing the CSV file containing multiple commas in a sigle field

    - by kakaajee
    Hi Experts, I am having an issue with importing a large(60MB) CSV file in MYSQL DB. The problem arises when an address field has multiple comma seperated values e.g. home no, street no, town etc. I tried to use BigDump for it but, the problem did not solved because of a single field containing multiple comma separated values. Any idea, suggestion or solution from experts how to handle it? Please reply, because I am sick of it. Thanks

    Read the article

  • How to optimize a postgreSQL server for a "write once, read many"-type infrastructure ?

    - by mhu
    Greetings, I am working on a piece of software that logs entries (and related tagging) in a PostgreSQL database for storage and retrieval. We never update any data once it has been inserted; we might remove it when the entry gets too old, but this is done at most once a day. Stored entries can be retrieved by users. The insertion of new entries can happen rather fast and regularly, thus the database will commonly hold several millions elements. The tables used are pretty simple : one table for ids, raw content and insertion date; and one table storing tags and their values associated to an id. User search mostly concern tags values, so SELECTs usually consist of JOIN queries on ids on the two tables. To sum it up : 2 tables Lots of INSERT no UPDATE some DELETE, once a day at most some user-generated SELECT with JOIN huge data set What would an optimal server configuration (software and hardware, I assume for example that RAID10 could help) be for my PostgreSQL server, given these requirements ? By optimal, I mean one that allows SELECT queries taking a reasonably little amount of time. I can provide more information about the current setup (like tables, indexes ...) if needed.

    Read the article

  • What is SIP trunking?

    - by hypnocode
    Can someone explain to me in plain English what SIP trunking is, please? I've read about it on Google, but I don't really grasp it yet. Does it allow a VoIP call to be placed outside of the LAN? So if you had Asterisk setup as the PBX, then IP calls could be made outside of the network? Am I close or am I just saying stupid words?

    Read the article

  • restoring myisam mysql db on a different machine

    - by RainDoctor
    I have copied the web db directory(/var/lib/mysql/data/web/), when mysql is not running. I transferred this directory to another machine, where mysql is running. web db's stuff is myisam based. I am thinking about how to restore this on a different server. The strategy I have on my mind is the following. copy the data directory of web db to the new server. on new server, 'create database web', which creates a directory in /var/lib/mysql/data copy all files from the step to the new directory created in 2. bounce mysql My question: how to deal with information_schema for this new db?

    Read the article

  • GPT partition !! HELP!!

    - by fixxxer
    Hi, I have a GPT partitioned portable HDD which is not being detected by Windows XP and a non working CD Drive.Can I download and use Ubuntu to boot from and access the data? Or is there some other way?

    Read the article

  • [inno setup] Pascal and Delphi Syntax Error?!

    - by neo-nant
    This is the code section from inno setup.My intention is to make two Checkbox where at a time one is being selected. But this code return error. [code] section: procedure CheckBoxOnClick(Sender: TObject); var Box2,CheckBox: TNewCheckBox; begin if CheckBox.Checked then CheckBox.State := cbUnchecked; Box2.State := cbChecked; else //THIS LINE RETURNS AN ERROR: "Identifier Expected." CheckBox.State := cbChecked; Box2.State := cbUnchecked; end; procedure Box2OnClick(Sender: TObject); var Box2,CheckBox: TNewCheckBox; begin if Box2.Checked then CheckBox.State := cbChecked; Box2.State := cbUnchecked; else //same error CheckBox.State := cbUnchecked; Box2.State := cbChecked; end; procedure CreateTheWizardPages; var Page: TWizardPage; Box2,CheckBox: TNewCheckBox; begin { TButton and others } Page := CreateCustomPage(wpWelcome, '', ''); CheckBox := TNewCheckBox.Create(Page); CheckBox.Top :=ScaleY(8)+ScaleX(50); CheckBox.Width := Page.SurfaceWidth; CheckBox.Height := ScaleY(17); CheckBox.Caption := 'Do this'; CheckBox.Checked := True; CheckBox.OnClick := @CheckBoxOnClick; CheckBox.Parent := Page.Surface; Box2 := TNewCheckBox.Create(Page); Box2.Top :=ScaleY(8)+ScaleX(70); Box2.Width := Page.SurfaceWidth; Box2.Height := ScaleY(17); Box2.Caption := 'No,Thanks.'; Box2.Checked := False; Box2.OnClick := @Box2OnClick; Box2.Parent := Page.Surface; end; procedure InitializeWizard(); //var begin { Custom wizard pages } CreateTheWizardPages; end; Please tell me where to change..

    Read the article

  • Exchange Rate From web

    - by Joy
    I have an currency converter application for iphone. But my problem is how can i get the updated exchange rates directly from the web. Looking Forwadr to any kind of help.. Thanks in advance Joy

    Read the article

  • String replacement problem.

    - by fastcodejava
    I want to provide some template for a code generator I am developing. A typical pattern for class is : public ${class_type} ${class_name} extends ${super_class} implements ${interfaces} { ${class_body} } Problem is if super_class is blank or interfaces. I replace extends ${super_class} with empty string. But I get extra spaces. So a class with no super_class and interfaces end up like : public class Foo { //see the extra spaces before {? ${class_body} } I know I can replace multiple spaces with single, but is there any better approach?

    Read the article

  • Display arbitrary size 2d image in opengl

    - by Martin Beckett
    I need to display 2d images in opengl using textures. The image dimensions are not necessarily powers of 2. I thought of creating a larger texture and restricting the display to the part I was using but the image data will be shared with openCV so I don't want to copy data a pixel at a time into a larger texture. EDIT - it turns out that even the simplest Intel on board graphics under Windows supports none-power-of-2 textures.

    Read the article

  • Algorithm for matching partially filled words

    - by adnanhb
    Hello All, I am writing a game which when given a partially filled word, searches a dictionary and returns all the matching words. To that effect, I am trying to find an algorithm that can be used for the said purpose. For example, given - - a -, the algorithm will search a dictionary for all the words which have length 4 and have 'a' as the third letter. Is there such an algorithm already? If not, can somebody given a rough idea of how to design such an algorithm? Thanks in Advance.

    Read the article

  • Wrong root on image_tag

    - by Euwyn
    On my dev setup, the image_tag is mysteriously pointing to my public www server (i.e. computing the image path as http://www.domain.com/images/blah.jpg). Where is this option set?

    Read the article

  • Checking multiple conditions in Ruby (within Rails, which may not matter)

    - by Ev
    Hello rubyists and railers, I have a method which checks over a params hash to make sure that it contains certain keys, and to make sure that certain values are set within a certain range. This is for an action that responds to a POST query by an iPhone app. Anyway, this method is checking for about 10 different conditions - any of which will result in an HTTP error being returned (I'm still considering this, but possibly a 400: bad request error). My current syntax is basically this (paraphrased): def invalid_submission_params?(params) [check one] or [check two] or [check three] or [check four] etc etc end Where each of the check statements returns true if that particular parameter check results in an invalid parameter set. I call it as a before filter with params[:submission] as the argument. This seems a little ugly (all the strung together or statements). Is there a better way? I have tried using case but can't see a way to make it more elegant. Or, perhaps, is there a rails method that lets me check the incoming params hash for certain conditions before handing control off to my action method?

    Read the article

  • Fields of class, are they stored in the stack or heap?

    - by Mirek
    I saw a question yesterday which raised (for me) another question. Please look at the following code: public class Class1 { int A; //as I uderstand, int is value type and therefore lives in the stack } class Class2 { Run() { Class1 instance1 = new Class1(); instance1.A = 10; //it points to value type, but isnt this reference (on heap)? } } Or while creating the instance of Class1, its field types are created on the heap as well? But then I do not understand when it would really be on the stack as almost always you need to create an instance of object in order to use it fields.

    Read the article

  • Using Application Settings and reading defaults from app.config

    - by Peter Goras
    Hi, I need to deploy a Windows Forms application using ClickOnce deployment. (VS2008, .NET 3.5) And I need to provide a configuration file for this app that any user can modify. For this reason, I am using Application Settings instead of standard appSetttings in app.config so I can separate the the user config from app config. see http://msdn.microsoft.com/en-us/library/ms228995(VS.80).aspx Creating a Settings.settings file using VS generated a class with hard-coded default values like this: [global::System.Configuration.DefaultSettingValueAttribute("blahblah")] public string MyProperty ... WTF? I want to read the default values from the app.config! So I created my own class deriving from ApplicationSettingsBase but I cannot get this to read values from the app.config. Any ideas?

    Read the article

  • Varying performance of MSVC release exe

    - by Andrew
    Hello everyone, I am curious what could be the reason for highly varying performance of the same executable. Sometimes, I run it and it takes 20 seconds and sometimes it is 110. Source is compiled with MSVC in Release mode with standard options. The code is here: vector<double> Un; vector<double> Ucur; double *pUn, *pUcur; ... // time marching for (old_time=time-logfreq, time+=dt; time <= end_time; time+=dt) { for (i=1, j=Un.size()-1, pUn=&Un[1], pUcur=&Ucur[1]; i < j; ++i, ++pUn, ++pUcur) { *pUcur = (*pUn)*(1.0-0.5*alpha*( *(pUn+1) - *(pUn-1) )); } Ucur[0] = (Un[0])*(1.0-0.5*alpha*( Un[1] - Un[j] )); Ucur[j] = (Un[j])*(1.0-0.5*alpha*( Un[0] - Un[j-1] )); Un = Ucur; }

    Read the article

  • Are there scenarios where the ViewModel needs to invoke methods on the View w.r.t. MVVM in WPF?

    - by Gishu
    As per the pattern, the ViewModel exposes Properties(with change notification) and Commands (to notify the VM of user actions) that the View binds to. The only communication that flows from the VM to the View is the property change notifications (so that the View can refresh itself with updated data). In MVP or PresentationModel form of the pattern (if I'm not mistaken), the View implements a plain vanilla interface (consisting of methods, properties and/or events). With MVVM, it feels methods on the IView have been outlawed (along with IView itself). One scenario I could think of was to set the focus to a certain control in the View. (When the user does ActionX, the focus should immediately be set to FieldY). In MVP, I'd write this as IView.ActivateField(NameConstant), which the presenter or PM would invoke. In MVVM, this seems to be a fringe case that needs a workaround / little bit of code-behind. The VM implements an ActiveField Property, which it sets to NameConstant. The view picks up the change notification event and in a code-behind event handler, activates the Name control. Is the above just an exception to the norm? Or are there other such scenarios, where the VM needs to invoke a method on the View ?

    Read the article

  • Recommendation for a Strategy Game Engine for .NET?

    - by Fred F.
    Can anyone recommend a strategy game engine for the .net framework. I downloaded XNA, but it is way beyond my needs. I just want to create a turn based strategy game. I have searched and searched, but all I cannnot find any examples. I have asked for something similiar before, but have not gotten any good answers.

    Read the article

  • DotNetZip trouble with coding

    - by Xaver
    I am using DotNetZip. When i am archiving file which have english name all normally. but when i archiving file with russian names in result archive with bad names of file. Some peoplese said that string ZipConstants.DefaultCodePage = 866; But it not compile. I also use zip.UseUnicodeAsNecessary properties, and convert my file names to utf8 and utf7.

    Read the article

  • How to prevent arbitrary code execution vulnerability in our programs?

    - by Calmarius
    You always read in changelogs when your system or browser or any program updates that they fixed a bug that made possible that an attacker can execute any code in your computer with a forged website, or attacking your computer with carefully forged packets, etc... Because you read it so often that means any program can have similar vulnerabilites... What causes this? how to design our programs to prevent similar issues?

    Read the article

  • how to update date using phpmysql

    - by DAFFODIL
    This is how,i insert data into db,but now,i want a particular column to update,how do i do? $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("form", $con); $sql="INSERT INTO Customer (Name, Address, City, Pincode, State, Country, Phone, Mobile, Fax, Email, Website, Notes) VALUES ('$_POST[name]','$_POST[address]','$_POST[city]','$_POST[pincode]','$_POST[state]','$_POST[country]','$_POST[phone]','$_POST[mobile]','$_POST[fax]','$_POST[email]','$_POST[url]','$_POST[notes]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?

    Read the article

  • regex. How can I match the value between '+' and ':' ?

    - by martin
    I have this string: sometext +[value]:- I would like to match the value(1-3 numerical characters) (with regex, javascript) sometext may contain a +sign if i'm unlucky so I don't wanna end up with matching some +text +value:- I sat up last night banging my head against this, so I would be really glad if someone could help me.

    Read the article

< Previous Page | 20 21 22 23 24 25 26 27 28 29 30 31  | Next Page >