Daily Archives

Articles indexed Monday May 3 2010

Page 20/107 | < Previous Page | 16 17 18 19 20 21 22 23 24 25 26 27  | Next Page >

  • Respond_to in rails

    - by piemesons
    respond_to do |format| format.html format.xml { render :xml => @mah_blogz } end respond_to do |format| format.js end Whats this respond_to, format.html, format.xml and format.js. Whats the purpose, How they work.

    Read the article

  • Multiple repositories, single setup

    - by graham.reeds
    If I use multiple repositories, all located under a single root folder, how can I set it up so that they will use a single master svnconf/passwd file for setup but still allow me to customize each if the need arises? This is on windows but I guess the process would be similar on other systems. Update: I am using svnserve as a service.

    Read the article

  • problem with zsh interactive shell

    - by Jack
    When I use zsh in interactive mode, I get some glitches. This mainly happens when the command spills over onto a new line and I use backspace, with backspace leaving behind some glitches on the screen and moving the cursor to an odd position. It happens in a VT, in xterm and urxvt, although it is most noticeable with my chosen terminal, urxvt. When I use zsh as a login shell, it does not happen at all. What could be causing this?

    Read the article

  • jqGrid formatter and sortable column - doesn't sort

    - by HeavyWave
    I am using a custom formatter for my jqGrid columnModel and I can't get sorting to work with formatter functions. If I remove formatter column sorts normally. colModel: [ { name: 'status', index: 'status', width: 18, sorttype: 'int', align: 'center', formatter: function(cellvalue, options, rowObject) { return cellvalue == 1 ? "<img src='images/agent_green_s.png' alt='Ready' title='Ready' />" : cellvalue == 3 ? "<img src='images/agent_red_s.png' alt='Busy' title='Busy' />" : "<img src='images/agent_orange_s.png' alt='Pending Ready' title='Pending Ready' />"; } How do I get sorting to work properly?

    Read the article

  • Implicit and Explicit implementation of interface.

    - by Amby
    While working on a upgrade i happened to come across a code like this. interface ICustomization { IMMColumnsDefinition GetColumnsDefinition(); } class Customization : ICustomization { private readonly ColumnDefinition _columnDefinition; //More code here. public ColumnsDefinition GetColumnsDefinition() { return _columnDefinition; } ColumnsDefinition ICustomization.GetColumnsDefinition() //redundant { return GetColumnsDefinition(); } } My question is: Is there any need/use of 'explicit' implementation of interface in this piece of code? Will it create any problem if i remove the method (explicit implementation of interface) that i have marked "redundant" above? PS: I understand that explicit implementation of interface is very important, and it can be used when we need to give access to a method at interface level only, and to use two interface with same signature of method.

    Read the article

  • Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax?

    - by Greg
    Hi, Can I use Linq-to-xml to persist my object state without having to use/know Xpath & XSD Syntax? ie. really looking for simple but flexible way to persist a graph of object data (e.g. have say 2 or 3 classes with associations) - if Linq-to-xml were as simple as saying "persist this graph to XML", and then you could also query it via Linq, or load it into memory again/change/then re-save to the xml file.

    Read the article

  • Subclassing QGraphicsItemGroup

    - by onurozcelik
    Hi everyone I have system that has classes derived from QGraphicsWidget. I manage derived class objects in layouts on QGraphicsScene. Now I need a compound item that contain two or more QGraphicsWidget in it and also I need to put that item inside my layout. So I choose QGraphicsItemGroup and write I class like this. class CompositeItem : public QGraphicsItemGroup,public QGraphicsLayoutItem { ... }; I only implemented sizeHint function again. When add CompositeItem instance to layout it does not shown. What may cause this? Where I made wrong?

    Read the article

  • Casting an object using 'as' returns null: myObject = newObject as MyObject; // null

    - by John Russell
    I am trying to create a custom object in AS3 to pass information to and from a server, which in this case will be Red5. In the below screenshots you will see that I am able to send a request for an object from as3, and receive it successfully from the java server. However, when I try to cast the received object to my defined objectType using 'as', it takes the value of null. It is my understanding that that when using "as" your checking to see if your variable is a member of the specified data type. If the variable is not, then null will be returned. This screenshot illustrates that I am have successfully received my object 'o' from red5 and I am just about to cast it to the (supposedly) identical datatype testObject of LobbyData: However, when testObject = o as LobbyData; runs, it returns null. :( Below you will see my specifications both on the java server and the as3 client. I am confident that both objects are identical in every way, but for some reason flash does not think so. I have been pulling my hair out for a long time, does anyone have any thoughts? AS3 Object: import flash.utils.IDataInput; import flash.utils.IDataOutput; import flash.utils.IExternalizable; import flash.net.registerClassAlias; [Bindable] [RemoteClass(alias = "myLobbyData.LobbyData")] public class LobbyData implements IExternalizable { private var sent:int; // java sentinel private var u:String; // red5 username private var sen:int; // another sentinel? private var ui:int; // fb uid private var fn:String; // fb name private var pic:String; // fb pic private var inb:Boolean; // is in the table? private var t:int; // table number private var s:int; // seat number public function setSent(sent:int):void { this.sent = sent; } public function getSent():int { return sent; } public function setU(u:String):void { this.u = u; } public function getU():String { return u; } public function setSen(sen:int):void { this.sen = sen; } public function getSen():int { return sen; } public function setUi(ui:int):void { this.ui = ui; } public function getUi():int { return ui; } public function setFn(fn:String):void { this.fn = fn; } public function getFn():String { return fn; } public function setPic(pic:String):void { this.pic = pic; } public function getPic():String { return pic; } public function setInb(inb:Boolean):void { this.inb = inb; } public function getInb():Boolean { return inb; } public function setT(t:int):void { this.t = t; } public function getT():int { return t; } public function setS(s:int):void { this.s = s; } public function getS():int { return s; } public function readExternal(input:IDataInput):void { sent = input.readInt(); u = input.readUTF(); sen = input.readInt(); ui = input.readInt(); fn = input.readUTF(); pic = input.readUTF(); inb = input.readBoolean(); t = input.readInt(); s = input.readInt(); } public function writeExternal(output:IDataOutput):void { output.writeInt(sent); output.writeUTF(u); output.writeInt(sen); output.writeInt(ui); output.writeUTF(fn); output.writeUTF(pic); output.writeBoolean(inb); output.writeInt(t); output.writeInt(s); } } Java Object: package myLobbyData; import org.red5.io.amf3.IDataInput; import org.red5.io.amf3.IDataOutput; import org.red5.io.amf3.IExternalizable; public class LobbyData implements IExternalizable { private static final long serialVersionUID = 115280920; private int sent; // java sentinel private String u; // red5 username private int sen; // another sentinel? private int ui; // fb uid private String fn; // fb name private String pic; // fb pic private Boolean inb; // is in the table? private int t; // table number private int s; // seat number public void setSent(int sent) { this.sent = sent; } public int getSent() { return sent; } public void setU(String u) { this.u = u; } public String getU() { return u; } public void setSen(int sen) { this.sen = sen; } public int getSen() { return sen; } public void setUi(int ui) { this.ui = ui; } public int getUi() { return ui; } public void setFn(String fn) { this.fn = fn; } public String getFn() { return fn; } public void setPic(String pic) { this.pic = pic; } public String getPic() { return pic; } public void setInb(Boolean inb) { this.inb = inb; } public Boolean getInb() { return inb; } public void setT(int t) { this.t = t; } public int getT() { return t; } public void setS(int s) { this.s = s; } public int getS() { return s; } @Override public void readExternal(IDataInput input) { sent = input.readInt(); u = input.readUTF(); sen = input.readInt(); ui = input.readInt(); fn = input.readUTF(); pic = input.readUTF(); inb = input.readBoolean(); t = input.readInt(); s = input.readInt(); } @Override public void writeExternal(IDataOutput output) { output.writeInt(sent); output.writeUTF(u); output.writeInt(sen); output.writeInt(ui); output.writeUTF(fn); output.writeUTF(pic); output.writeBoolean(inb); output.writeInt(t); output.writeInt(s); } } AS3 Client: public function refreshRoom(event:Event) { var resp:Responder=new Responder(handleResp,null); ncLobby.call("getLobbyData", resp, null); } public function handleResp(o:Object):void { var testObject:LobbyData=new LobbyData; testObject = o as LobbyData; trace(testObject); } Java Client public LobbyData getLobbyData(String param) { LobbyData lobbyData1 = new LobbyData(); lobbyData1.setSent(5); lobbyData1.setU("lawlcats"); lobbyData1.setSen(5); lobbyData1.setUi(5); lobbyData1.setFn("lulz"); lobbyData1.setPic("lulzagain"); lobbyData1.setInb(true); lobbyData1.setT(5); lobbyData1.setS(5); return lobbyData1; }

    Read the article

  • php regex filename

    - by Patrick
    Hi, anyone can help me with a preg_match? I'd like to use php's preg_match to determine if an input is a valid filename or not (only the filename + file extension, not the full path). General rules: 1) filename = a-z, A-Z, 0-9 2) extension = 3 or 4 letters Thank you!

    Read the article

  • Is there a way to catch assignments to or reads from an undefined property in the Spider-Monkey Java

    - by avri
    The Spider-Monkey JavaScript engine implements the noSuchMethod callback function for JavaScript Objects. This function is called whenever JavaScript tries to execute an undefined method of an Object. I would like to set a callback function to an Object that will be called whenever an undefined property in the Object is accessed or assigned to. I haven't found a noSuchProperty function implemented for JavaScript Objects and I am curios if there is any workaround that will achieve the same result.

    Read the article

  • Successive success checks

    - by Stockhausen
    Most of you have probably bumped into a situation, where multiple things must be in check and in certain order before the application can proceed, for example in a very simple case of creating a listening socket (socket, bind, listen, accept etc.). There are at least two obvious ways (don't take this 100% verbatim): if (1st_ok) { if (2nd_ok) { ... or if (!1st_ok) { return; } if (!2nd_ok) { return; } ... Have you ever though of anything smarter, do you prefer one over the other of the above, or do you (if the language provides for it) use exceptions?

    Read the article

  • VSTS Test Edition or HP's LoadRunner?

    - by Edward Leno
    I have had this debate with some peers off and on for a while. I am certified in the HP tools, but have been spending more and more time with VSTS Test Edition 2008. I am looking for opinions on what people think of the future of both products and how they compete. LoadRunner's strengths include its vast array of protocols supported. Unfortunately since HP took over from Mercury, they are beginning to lag behind, especially in the new internet spaces. VSTS Test, once very limited, is now quite impressive, especially in 2010. I don't know if it makes business sense, but I would love for VSTS Test to take on some additional protocols. Many of my clients would like to move away from HP and their licensing costs. Finally, I am looking for good resources for VSTS Test. I have been playing with it, but would like to see some dedicated courses/material, instead of just a part of the larger VSTS. Thanks!

    Read the article

  • C preprocessor vs. C compiler

    - by Sunny209
    If I tell the C preprocessor to #include a file and use CPPFLAGS to help find the needed file, then the file is included already, right? What, if any, use is telling the C compiler about the same include directory with CFLAGS?

    Read the article

  • Diminishing programmer wants to get back to programming

    - by Marcus TV
    I last programmed actively in 2002. It is almost 8 years now. I learned C and then moved to Visual Basic for our thesis project in the university. I would like to ask suggestions on what programming language should I learn and put to profitability use in areas such as desktop applications, web development, and database applications.

    Read the article

  • get me the latest Change from Select Query in below given condition

    - by OM The Eternity
    I have a Table structure as id, trackid, table_name, operation, oldvalue, newvalue, field, changedonetime Now if I have 3 rows for the same "trackid" same "field", then how can i select the latest out of the three? i.e. for e.g.: id = 100 trackid = 152 table_name = jos_menu operation= UPDATE oldvalue = IPL newvalue = IPLcccc field = name live = 0 changedonetime = 2010-04-30 17:54:39 and id = 101 trackid = 152 table_name = jos_menu operation= UPDATE oldvalue = IPLcccc newvalue = IPL2222 field = name live = 0 changedonetime = 2010-04-30 18:54:39 As u can see above the secind entry is the latest change, Now what query I should use to get the only one and Latest row out of many such rows... $distupdqry = "select DISTINCT trackid,table_name from jos_audittrail where live = 0 AND operation = 'UPDATE'"; $disupdsel = mysql_query($distupdqry); $t_ids = array(); $t_table = array(); while($row3 = mysql_fetch_array($disupdsel)) { $t_ids[] = $row3['trackid']; $t_table[] = $row3['table_name']; //$t_table[] = $row3['table_name']; } //echo "<pre>";print_r($t_table);echo "<pre>"; //exit; for($n=0;$n<count($t_ids);$n++) { $qupd = "SELECT * FROM jos_audittrail WHERE operation = 'UPDATE' AND trackid=$t_ids[$n] order by changedone DESC "; $seletupdaudit = mysql_query($qupd); $row4 = array(); $audit3 = array(); while($row4 = mysql_fetch_array($seletupdaudit)) { $audit3[] = $row4; } $updatefield = ''; for($j=0;$j<count($audit3);$j++) { if($j == 0) { if($audit3[$j]['operation'] == "UPDATE") { //$insqry .= $audit2[$i]['operation']." "; //echo "<br>"; $updatefield .= "UPDATE `".$audit3[$j]['table_name']."` SET "; } } if($audit3[$j]['operation'] == "UPDATE") { $updatefield .= $audit3[$j]['field']." = '".$audit3[$j]['newvalue']."', "; } } /*echo "<pre>"; print_r($audit3); exit;*/ $primarykey = "SHOW INDEXES FROM `".$t_table[$n]."` WHERE Key_name = 'PRIMARY'"; $prime = mysql_query($primarykey); $pkey = mysql_fetch_array($prime); $updatefield .= "]"; echo $updatefield = str_replace(", ]"," WHERE ".$pkey['Column_name']." = '".$t_ids[$n]."'",$updatefield); } In the above code I am fetching ou the distinct IDs in which update operation has been done, and then accordingly query is fired to get all the changes done on different fields of the selected distinct ids... Here I am creating the Update query by fetching the records from the initially described table which is here mentioned as audittrail table... Therefore I need the last made change in the field so that only latest change can be selected in the select queries i have used... please go through the code.. and see how can i make the required change i need finally..

    Read the article

  • Drupal CCK Date: how to set datetime field's default value to a fix date?

    - by Daj pan spokój
    Hi, I have a CCK datetime field and would like to set its default value to 31 May 2011. When I go to the configuration of the field I can set the default value to Now, Blank or Relative. Relative is to be set by a PHP's strtotime argument. However, it fails when I set it to 31 May 2011 last day of May 2011 (that should normally work according to http://php.net/manual/en/function.strtotime.php) Do You have any idea how to set it to default to 31 May 2011?

    Read the article

  • MySQL: table is marked as crashed

    - by DrStalker
    After a disk full issue one of the MySQL DBs on the server is coming up with the following error when I try to back it up: [root@mybox ~]# mysqldump -p --result-file=/tmp/dbbackup.sql --database myDBname Enter password: mysqldump: Got error: 145: Table './myDBname/myTable1' is marked as crashed and should be repaired when using LOCK TABLES A bit of investigation shows two tables have this issue. What needs to be done to fix up the damaged tables?

    Read the article

  • My programme is for java

    - by Siddharth Pandey
    I wrote a codding on notepad and i was base on Candidate details i was trying to run the code like for example to say if u r in the school and we need the details for the candidate so all the details like name Id address age dateofbirth and soooo So my exatlly problem is that i have allready created the code and i have written it on the notepad so when ever i am going the command prompt and giving its path and all the details still it always show some problem like class interfierence or expected iw will paste the codding over here and pls if u can help me correct the coding it will be pleasure thank u. import java.swing.*; import javac.awt.*; public CandidateDetails extends JApplets; { JPanel Panel; JLabel LabelStudentID; JLabel LabelStudentNames; JLabel LabelStudentAddress; JLabel LabelStudentAge; JLabel LabelStudentDateofBirth; JLabel LabelStudentMobile no; JLabel LabelStudentCrouse; JTextField textStudentID; JTextField textStudentNames; JTextField textStudentAddress; JTextField textStudentAge; JTextField textStudentDateofBirth; JTextField textStudentMobileNo; JTextField textStudentCrouse; } public void init(); { Label StudentID = new JLabel("Student ID"); Label StudentNames = new JLabel("Student Names"); Label StudentAddress = new JLabel("Student Address"); Label StudentAge = new JLabel("Student Age"); Label StudentDateofBirth = new JLabel("Student DateofBirth"); Label StudentMobileNo = new JLabel("Student MobileNo"); Label StudentCourse = new JLabel("Student Course"); JTextField text("ID"); JTextField text("Names"); JTextField text("Address"); JTextField text("Age"); JTextField text("DateofBirth"); JTextField text("MobileofBirth"); JTextField text("Course"); } { GridBag layourt.NORTHWEST; b1=1; b2=2; gbc.gridconstraint(label Student ID); add.panel(ID); GridBag layourt.NORTHWEST; b1=1; b2=3; gbc.gridconstraint(text Student ID); add.panel(ID); GridBag layourt.NORTHWEST; b1=2; b2=3; gbc.gridconstraint(label Student Names); add.panel(Names); GridBag layourt.NORTHWEST; b1=3; b2=4; gbc.gridconstraint(text Student Names); add.panel(Names); GridBag layourt.NORTHWEST; b1=3; b2=5; gbc.gridconstraint(label Student Address); add.panel(Address); GridBag layourt.NORTHWEST; b1=3; b2=4; gbc.gridconstraint(text Student Address); add.panel(Address); GridBag layourt.NORTHWEST; b1=4; b2=5; gbc.gridconstraint(label Student DateofBirth); add.panel(DateofBirth); GridBag layourt.NORTHWEST; b1=5; b2=6; gbc.gridconstraint(text Student DateofBirth); add.panel(DateofBirth); GridBag layourt.NORTHWEST; b1=5; b2=4; gbc.gridconstraint(label Student MobileNo); add.panel(MobileNo); GridBag layourt.NORTHWEST; b1=5; b2=6; gbc.gridconstraint(text Student MobileNo); add.panel(MobileNo); GridBag layourt.NORTHWEST; b1=6; b2=7; gbc.gridconstraint(label Student Course); add.panel(Course); GridBag layourt.NORTHWEST; b1=7; b2=8; gbc.gridconstraint(text Student Course); add.panel(Course); }

    Read the article

  • changing trigger event of MVC 2 client validation

    - by Muhammad Adeel Zahid
    Hi Everyone i m developing a website using .NET 3.5 with MVC 2.0. For server side validations i m using ComponentModel.DataAnnotations. these validations are reflected to client side by html helper's method Html.EnableClientValidation(). this scheme works fine for except that it triggers the validation on blur event of each form control whereas i want to have it triggered on form's submit event. any suggestions in this regard are highly appreciated regards

    Read the article

  • Deployment Problem after using DataRepeater of MS Visual Bacis power pack

    - by Mohsan
    hi. Microsoft Visual Studio 2008 Service pack 1 comes with Visual Basic Powerpacks which has the DataRepeater control. I used this control in my c# winform application. in my system everything is running fine. now i copied the debug folder to other system which has only .Net Framework 3.5 SP1 installed. in this system is giving me error cannot load dependency Microsoft.VisualBasic.PowerPacks.dll even i set the Copy Local to "true" for "Microsoft.VisualBasic.dll" and "Microsoft.VisualBasic.PowerPacks.Vs.dll" please tell me how to solve this problem

    Read the article

  • Static Libraries on iPhone device

    - by Akusete
    I have two projects, a Cocoa iPhone application and a static library which it uses. I've tested it successfully on the iPhone simulator, but when I try to deploy it to my iPhone device I get (symbol not found) link errors. If I remove the dependancy of the library the project builds/runs fine. I have made sure all the build settings are set to iPhoneOS not the simulator. Im sure its something simple, but has anyone run into similar problems moving from iPhone simulator to device? --EDIT: I have managed to create new projects (one for the application and one for the static library), and successfully get them to run on the iPhone or simulator. But I have a very strange problem... for each specific project I cannot get it working for BOTH the device and the simulator... I have double checked the build settings, made sure the libraries that are being references are for the matching build settings (I believe) but I cannot resolve these linking errors. I think I must be doing something very wrong... all the apple documentation says 'its super simple - one click' but this is giving me a lot of problems. This is probably something to do with xCode build settings, but I cannot seem to understand why selecting the different build platforms and rebuilding the libraries does not work.

    Read the article

  • Singleton constructor question

    - by gillyb
    Hi, I created a Singleton class in c#, with a public property that I want to initialize when the Singleton is first called. This is the code I wrote : public class BL { private ISessionFactory _sessionFactory; public ISessionFactory SessionFactory { get { return _sessionFactory; } set { _sessionFactory = value; } } private BL() { SessionFactory = Dal.SessionFactory.CreateSessionFactory(); } private object thisLock = new object(); private BL _instance = null; public BL Instance { get { lock (thisLock) { if (_instance == null) { _instance = new BL(); } return _instance; } } } } As far as I know, when I address the Instance BL object in the BL class for the first time, it should load the constructor and that should initialize the SessionFactory object. But when I try : BL.Instance.SessionFactory.OpenSession(); I get a Null Reference Exception, and I see that SessionFactory is null... why?

    Read the article

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