PostId
int64
13
11.8M
PostCreationDate
stringlengths
19
19
OwnerUserId
int64
3
1.57M
OwnerCreationDate
stringlengths
10
19
ReputationAtPostCreation
int64
-33
210k
OwnerUndeletedAnswerCountAtPostTime
int64
0
5.77k
Title
stringlengths
10
250
BodyMarkdown
stringlengths
12
30k
Tag1
stringlengths
1
25
Tag2
stringlengths
1
25
Tag3
stringlengths
1
25
Tag4
stringlengths
1
25
Tag5
stringlengths
1
25
PostClosedDate
stringlengths
19
19
OpenStatus
stringclasses
5 values
unified_texts
stringlengths
47
30.1k
OpenStatus_id
int64
0
4
1,600,649
10/21/2009 12:56:09
140,019
07/17/2009 08:49:43
64
2
Split text into words problem PHP, complicated problem
I am trying to split the text into words: $delimiterList = array(" ", ".", "-", ",", ";", "_", ":", "!", "?", "/", "(", ")", "[", "]", "{", "}", "<", ">", "\r", "\n", '"'); $words = mb_split($delimiterList, $string); which works quite fine with strings but I am stuck in some cases where I have to do with numbers. E.g. If I have the text "Look at this.My score is 3.14, and I am happy about it.". Now the array is [0]=>Look, [1]=>at, [2]=>this, [3]=>My, [4]=>score, [5]=>is, [6]=>3, [7]=>14, [8]=>and, .... Then also the 3.14 is divided in 3 and 14 which should not happen in my case. I mean point should divide two strings but not two numbers. It should be like: [0]=>Look, [1]=>at, [2]=>this, [3]=>My, [4]=>score, [5]=>is, [6]=>3.14, [7]=>and, .... But I have no Idea how to avoid this cases! Anybody any idea how to solve this problem? Thanx, Granit
split
php
null
null
null
null
open
Split text into words problem PHP, complicated problem === I am trying to split the text into words: $delimiterList = array(" ", ".", "-", ",", ";", "_", ":", "!", "?", "/", "(", ")", "[", "]", "{", "}", "<", ">", "\r", "\n", '"'); $words = mb_split($delimiterList, $string); which works quite fine with strings but I am stuck in some cases where I have to do with numbers. E.g. If I have the text "Look at this.My score is 3.14, and I am happy about it.". Now the array is [0]=>Look, [1]=>at, [2]=>this, [3]=>My, [4]=>score, [5]=>is, [6]=>3, [7]=>14, [8]=>and, .... Then also the 3.14 is divided in 3 and 14 which should not happen in my case. I mean point should divide two strings but not two numbers. It should be like: [0]=>Look, [1]=>at, [2]=>this, [3]=>My, [4]=>score, [5]=>is, [6]=>3.14, [7]=>and, .... But I have no Idea how to avoid this cases! Anybody any idea how to solve this problem? Thanx, Granit
0
6,996,570
08/09/2011 13:01:48
664,805
03/17/2011 17:24:09
28
1
Actionscript 3 : classic text object in fla file doesn't display numbers and some other characters
I ran in to a problem I could not solve for a very long time - While I was using Actionscript 3 in order to change the text of a classic text object in my .fla flash file, I did not see any change in my text field, and noticed that it doesn't display any numbers and some other characters (just some specific letters DID work). I'll be so glad to help others with my solution, and I hope I could save other people some time, so here is what did work for me: In the properties tab, click on the "embed" button and check the the "upper case" and "lower case" letters, and also the "numeric" option. Good luck!
actionscript-3
null
null
null
null
08/10/2011 11:25:25
not a real question
Actionscript 3 : classic text object in fla file doesn't display numbers and some other characters === I ran in to a problem I could not solve for a very long time - While I was using Actionscript 3 in order to change the text of a classic text object in my .fla flash file, I did not see any change in my text field, and noticed that it doesn't display any numbers and some other characters (just some specific letters DID work). I'll be so glad to help others with my solution, and I hope I could save other people some time, so here is what did work for me: In the properties tab, click on the "embed" button and check the the "upper case" and "lower case" letters, and also the "numeric" option. Good luck!
1
10,180,746
04/16/2012 19:56:52
104,849
05/11/2009 14:59:01
1,191
65
How do I add new columns at runtime?
I need to build an application in Asp.net MVC, where the user will presented with data in a view like a table. Now the user needs to be able to add new columns to the table, then enter data for this new column and save it. My question is how can I add a column dynamically and how should I save this data on the backend? Any suggestions, comment or links to existing projects doing something similar is appreciated.
asp.net
asp.net-mvc
asp.net-mvc-3
null
null
04/16/2012 20:03:44
not a real question
How do I add new columns at runtime? === I need to build an application in Asp.net MVC, where the user will presented with data in a view like a table. Now the user needs to be able to add new columns to the table, then enter data for this new column and save it. My question is how can I add a column dynamically and how should I save this data on the backend? Any suggestions, comment or links to existing projects doing something similar is appreciated.
1
6,486,623
06/26/2011 20:44:04
676,461
03/25/2011 09:43:10
1
1
SyncFramwork And SQl Server
I am using syncframework I have one table. in that i have to sync some columns up and some columns down and some columns up and down..... How can i do this in a single schema for client and server....dbs... Is there any chance... if not possible please tell me how to write different schemas... for each...side and each direction.... following are column in my table **Column Direction** AddressID x both AddressIDpda AccountID x down Line1 x down Line2 x down Line3 x both Line4 x both ApartmentNumber x down City x down StateOrProvince x down PostalCode x down ObjectID x down ObjectType x down CreatedOn x Both ModifiedOn x both MoveToCRM x both twg_PDAupdated x up twg_PDAcreated x up twg_User x up
c#
sql-server-2008
syncframework
null
null
null
open
SyncFramwork And SQl Server === I am using syncframework I have one table. in that i have to sync some columns up and some columns down and some columns up and down..... How can i do this in a single schema for client and server....dbs... Is there any chance... if not possible please tell me how to write different schemas... for each...side and each direction.... following are column in my table **Column Direction** AddressID x both AddressIDpda AccountID x down Line1 x down Line2 x down Line3 x both Line4 x both ApartmentNumber x down City x down StateOrProvince x down PostalCode x down ObjectID x down ObjectType x down CreatedOn x Both ModifiedOn x both MoveToCRM x both twg_PDAupdated x up twg_PDAcreated x up twg_User x up
0
6,029,590
05/17/2011 10:37:19
737,830
05/04/2011 11:00:01
1
0
How to add close button to tabbar?
Below is my code... <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()" xmlns:local="*"> <mx:Style> CustomDividedBox{ dividerAffordance:10; dividerBorderColor:#3387A7; dividerFillColors:#ffffff,#bad2f0; collapseBoxDividerSkin: Embed(source="assets.swf",symbol="CollapseBoxDividerSkin"); expandBoxDividerSkin: Embed(source="assets.swf",symbol="ExpendBoxDividerSkin"); } </mx:Style> <mx:Script> <![CDATA[ import DrawingClasses.Designer; import mx.controls.Alert; import mx.core.DragSource; import mx.core.UIComponent; import mx.events.DragEvent; import mx.events.ListEvent; import mx.managers.DragManager; // import com.dougmccune.containers.tabBarClasses.SuperTab; [Embed(source="Images/twowaysplit.png")] [Bindable] private var defaultImg1:Class; [Embed(source="Images/twowaysplit_down.png")] [Bindable] private var overImg1:Class; [Bindable] private var isOver1:Boolean = false; [Embed(source="Images/threewaysplit.png")] [Bindable] private var defaultImg2:Class; [Embed(source="Images/threewaysplit_down.png")] [Bindable] private var overImg2:Class; [Bindable] private var isOver2:Boolean = false; [Embed(source="Images/read.png")] [Bindable] private var defaultImg3:Class; [Embed(source="Images/read_down.png")] [Bindable] private var overImg3:Class; [Bindable] private var isOver3:Boolean = false; [Embed(source="Images/write.png")] [Bindable] private var defaultImg4:Class; [Embed(source="Images/write_down.png")] [Bindable] private var overImg4:Class; [Bindable] private var isOver4:Boolean = false; [Bindable] [Embed(source="/Images/line.png")] public var linePicture:Class; [Bindable] [Embed(source="/Images/box.png")] public var boxPicture:Class; [Bindable] public var xm:XML = <AbstractComponentTemplate></AbstractComponentTemplate>; public var compType:XML = <ComponentTemplateDescriptor> <Owner>BackTesting</Owner> <Name>Component</Name> <Version>1</Version> </ComponentTemplateDescriptor>; [Bindable] private var cm:ContextMenu; public var xm1:XML; public var loopparent:Array = new Array(); private var mouseTarget:DisplayObject; private var xOff:Number; private var yOff:Number; private var designer:Designer = new Designer(); private var i:int; private var j:int; private function init():void { designer.setDesignArea(designArea); var cmi1:ContextMenuItem = new ContextMenuItem("Properties", true); cmi1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_propertiesSelect); var cmi2:ContextMenuItem = new ContextMenuItem("View XML", true); cmi2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_viewXMLSelect); var cmi3:ContextMenuItem = new ContextMenuItem("Saved Components", true); cmi3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_savedListSelect); cm = new ContextMenu(); cm.hideBuiltInItems(); cm.customItems = [cmi1, cmi2, cmi3]; cm.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect); } private function contextMenu_menuSelect(evt:ContextMenuEvent):void { } private function contextMenuItem_propertiesSelect(evt:ContextMenuEvent):void { //panelRight.width = 260; div1.state = (div1.state == CustomDividedBox.COLLAPSE ? CustomDividedBox.EXPAND : CustomDividedBox.COLLAPSE); //Alert.show("properties"); //vDivProp.moveDivider(0, 400); //accrWinProp.label = "Two Way Split - Properties"; //accrWinProp.selectedIndex = 1; } private function contextMenuItem_viewXMLSelect(evt:ContextMenuEvent):void { viewstack.selectedIndex = 1; } private function contextMenuItem_savedListSelect(evt:ContextMenuEvent):void { accrWinComp.selectedIndex = 1; } [Bindable] private var propValue:String = "Component"; private function itemClickEvent(event:ListEvent):void { var propKey:String = dgProp.selectedItem.@key; if (propKey == "name") { propValue = dgProp.selectedItem.propvalue; } } [Bindable] private var sourceXML:XML = <order> <!--This is a comment. --> <?PROC_INSTR sample ?> <item id='1'> <menuName>burger</menuName> <price>3.95</price> </item> <item id='2'> <menuName>fries</menuName> <price>1.45</price> </item> </order>; [Bindable] private var savedComp:Array=['ComponentTemplate', 'iv85341.EquityCash.v1', 'ra92724.ThreeWaySplit.EU.US.OTHERS.v1', 'ra92724.TwoWaySplit.EU.OTHERS.v1', 'ra92724.TwoWaySplit.US.OTHERS.v1', 'iv85341.VanillaNode.v1', 'iv85341.ReadGmrFs.v1' ]; [Bindable] private var propData:XML = <properties> <prop key="name"> <propvalue>Component</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Version"> <propvalue>1.0</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Owner"> <propvalue>iv85341</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="width"> <propvalue>250</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="height"> <propvalue>300</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="X-Pos"> <propvalue>40</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Y-Pos"> <propvalue>20</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> </properties>; private function rightClick(event:MouseEvent):void { Alert.show("Properties ..." + event.currentTarget, "Open"); } // Draging Code Starts Here private var curDate:Date = new Date(); private var dateList:XMLList = null; public function pictureDragDrop(event:DragEvent):void { //Alert.show (" com = " + event.dragSource.dataForFormat("key")); var nodeName:String = event.dragSource.dataForFormat("key").toString(); var nodeValue:String = ""; if (nodeValue == "") { if (xm == <AbstractComponentTemplate></AbstractComponentTemplate>) { xm.appendChild(compType); dateList = new XMLList("<DateCreated>" + curDate + "</DateCreated>"); xm.appendChild(dateList); dateList = new XMLList("<DateModified>" + curDate + "</DateModified>"); xm.appendChild(dateList); xm1 = XML("<" + nodeName + "></" + nodeName + ">"); xm.appendChild(xm1); } else { i++; xm1 = XML("<" + nodeName + "></" + nodeName + ">"); xm.appendChild(xm1); //loopparent.push(xmlarray:xm1); loopparent[i] = xm1; } } else { var xmlList:XMLList = new XMLList("<" + nodeName + ">" + nodeValue + "</" + nodeName + ">"); if (xm1 == null) { xm.appendChild(xmlList); } else { for (j = i; j>0; j--) { (loopparent[j]).appendChild(xmlList); //Alert.show("alert"); } } } var x:int = event.currentTarget.mouseX - xOff; var y:int = event.currentTarget.mouseY - yOff; if(event.dragSource.dataForFormat("key") == "box") { designer.addBox(x, y); } else if(event.dragSource.dataForFormat("key") == "circle") { designer.addCircle(x, y); } else { designer.addRectangle(x, y); } } // this method gets x and y coordinate of template box image private function myoffset(img:Image):void { xOff = img.mouseX; yOff = img.mouseY; } // this method does acceptable draging box image public function pictureDragEnter(event:DragEvent):void{ DragManager.acceptDragDrop(Canvas(event.target)); } // this method supply drag box when mouse move on the design area private function dragPicture1(event:MouseEvent, img1:Image,format:String):void{ var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); var imageProxy:Image = new Image(); imageProxy.source = img1.source; imageProxy.height= 150; imageProxy.width= 150; ds.addData(format,"key"); DragManager.doDrag(dragInitiator, ds, event,imageProxy, 0, 0, 1.00); } // this method works when click on the line button // it is make enable to draw line public function doDrawEnable():void { designer.setIsDrawEnable(true); } /*private function showCursor():void { CursorManager.setCursor(customCursor,CursorManagerPriority.HIGH,3,2); }*/ private var fileRef:FileReference; public function createXML():void { var fileName:String = "component.xml"; fileRef = new FileReference(); fileRef.browse(); } // Draging code ends here private function onExpand(event:Event):void { if (event.currentTarget == div1) { //Alert.show("hi"); panelRight.width = 0; }else{ panelLeft.width = 200; } // panelLeft.width=this.screen.width-100; } private function onCollapse(event:Event):void{ if(event.currentTarget == div1){ panelRight.width = 260; }else{ panelLeft.width = 0; } // panelLeft.width=(this.width)/60; } ]]> </mx:Script> <mx:Fade id="theEffect"/> <mx:Resize id="resizeEffect" /> <mx:ApplicationControlBar dock="true"> <mx:Image toolTip="Open" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> <mx:Image toolTip="Save" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> <mx:Image toolTip="Undo" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Redo" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Delete" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Print" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Spacer width="100%" /> <mx:Label text="BackTesting" fontWeight="bold" fontSize="16" /> </mx:ApplicationControlBar> <mx:Resize duration="250" id="r1"/> <local:CustomDividedBox id="div1" width="100%" height="100%" direction="horizontal" expand="onExpand(event)" collapse="onCollapse(event)"> <local:CustomDividedBox id="div2" width="100%" height="100%" direction="horizontal" expand="onExpand(event)" collapse="onCollapse(event)"> <mx:VDividedBox id="panelLeft" height="100%" width="20%" resizeEffect="r1"> <mx:Panel title="Drawing Components" width="100%" height="100%" layout="vertical" > <mx:Accordion id="accrWinComp" x="151" y="135" width="100%" height="100%"> <mx:Panel label="Nodes" width="100%" height="100%" layout="vertical" borderThicknessTop="-20" paddingTop = "20" paddingLeft = "20" > <mx:Image id="twowaysplit" source="{isOver1 ? overImg1 : defaultImg1}" mouseOver="isOver1 = true" mouseOut="isOver1 = false" toolTip="TwoWay Split" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, twowaysplit, 'twowaysplit');myoffset(twowaysplit);" width="28" height="28" ></mx:Image> <mx:Image id="threewaysplit" source="{isOver2 ? overImg2 : defaultImg2}" mouseOver="isOver2 = true" mouseOut="isOver2 = false" toolTip="Three Way Split" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, threewaysplit, 'threewaysplit');myoffset(threewaysplit);" width="28" height="28" ></mx:Image> <mx:Image id="reader" source="{isOver3 ? overImg3 : defaultImg3}" mouseOver="isOver3 = true" mouseOut="isOver3 = false" toolTip="Reader" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, reader, 'reader');myoffset(reader);" width="28" height="28" ></mx:Image> <mx:Image id="writer" source="{isOver4 ? overImg4 : defaultImg4}" mouseOver="isOver4 = true" mouseOut="isOver4 = false" toolTip="Writer" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, writer, 'writer');myoffset(writer);" width="28" height="28" ></mx:Image> <!--<mx:Button label="Show Cursor" click="showCursor()" x="10" y="59" width="115"/>--> <!-- <mx:Image id="line" width="28" height="28" source="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Image>--> <mx:Button id="line" width="35" height="30" toggle="true" paddingLeft="12" paddingRight="12" icon="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Button> </mx:Panel> <mx:Panel label="Saved Components" width="100%" height="100%" borderThicknessTop="-20"> <mx:List height="100%" width="100%" dataProvider="{savedComp}" /> </mx:Panel> </mx:Accordion> </mx:Panel> </mx:VDividedBox> <mx:VDividedBox id="mp" height="100%" width="100%"> <mx:HDividedBox width="100%" height="100%"> <mx:Canvas width="100%" height="100%" > <mx:TabBar x="0" y="10" dataProvider="viewstack"/> <mx:ViewStack id="viewstack" width="100%" height="100%" y="32"> <mx:Canvas backgroundColor="#ffffff" borderColor="0xB7BABC" borderStyle="solid" borderThickness="7" label="{propValue}" id="designArea" contextMenu="{cm}" dragEnter="pictureDragEnter(event)" dragDrop="pictureDragDrop(event)" width="100%" height="100%" > </mx:Canvas> <mx:Panel id="pnlXML" label="XML" width="100%" height="100%" showEffect="{theEffect}" > <mx:ControlBar width="100%" barColor="#FF22CC"> <mx:Spacer width="100%"/> <mx:Button id="btnSave" label="Save" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> </mx:ControlBar> <mx:TextArea fontSize="12" wordWrap="false" textIndent="8" id="txtAreaXML" text="{xm}" width="100%" height="100%" editable="false" /> </mx:Panel> </mx:ViewStack> </mx:Canvas> </mx:HDividedBox> </mx:VDividedBox> </local:CustomDividedBox> <mx:VDividedBox id="panelRight" height="100%" width="0" resizeEffect="{resizeEffect}" > <!--<mx:Panel title="Component Properties" width="100%" height="100%" layout="vertical" > <mx:Accordion id="accrWinProp" x="51" y="35" width="100%" height="100%"> --> <mx:Panel id="accrCon2" title="Component Properties" width="100%" height="100%" > <mx:DataGrid id="dgProp" dataProvider="{propData.prop}" height="100%" width="100%" editable="true" itemClick="itemClickEvent(event);"> <mx:columns> <mx:DataGridColumn dataField="@key" headerText="Property" editable="false" /> <mx:DataGridColumn dataField="propvalue" headerText="Value" editable="true" /> </mx:columns> </mx:DataGrid> </mx:Panel> <!--</mx:Accordion> </mx:Panel>--> </mx:VDividedBox> </local:CustomDividedBox> </mx:Application>
flex
flex3
flex4
null
null
05/17/2011 13:04:09
not a real question
How to add close button to tabbar? === Below is my code... <?xml version="1.0" encoding="utf-8"?> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" applicationComplete="init()" xmlns:local="*"> <mx:Style> CustomDividedBox{ dividerAffordance:10; dividerBorderColor:#3387A7; dividerFillColors:#ffffff,#bad2f0; collapseBoxDividerSkin: Embed(source="assets.swf",symbol="CollapseBoxDividerSkin"); expandBoxDividerSkin: Embed(source="assets.swf",symbol="ExpendBoxDividerSkin"); } </mx:Style> <mx:Script> <![CDATA[ import DrawingClasses.Designer; import mx.controls.Alert; import mx.core.DragSource; import mx.core.UIComponent; import mx.events.DragEvent; import mx.events.ListEvent; import mx.managers.DragManager; // import com.dougmccune.containers.tabBarClasses.SuperTab; [Embed(source="Images/twowaysplit.png")] [Bindable] private var defaultImg1:Class; [Embed(source="Images/twowaysplit_down.png")] [Bindable] private var overImg1:Class; [Bindable] private var isOver1:Boolean = false; [Embed(source="Images/threewaysplit.png")] [Bindable] private var defaultImg2:Class; [Embed(source="Images/threewaysplit_down.png")] [Bindable] private var overImg2:Class; [Bindable] private var isOver2:Boolean = false; [Embed(source="Images/read.png")] [Bindable] private var defaultImg3:Class; [Embed(source="Images/read_down.png")] [Bindable] private var overImg3:Class; [Bindable] private var isOver3:Boolean = false; [Embed(source="Images/write.png")] [Bindable] private var defaultImg4:Class; [Embed(source="Images/write_down.png")] [Bindable] private var overImg4:Class; [Bindable] private var isOver4:Boolean = false; [Bindable] [Embed(source="/Images/line.png")] public var linePicture:Class; [Bindable] [Embed(source="/Images/box.png")] public var boxPicture:Class; [Bindable] public var xm:XML = <AbstractComponentTemplate></AbstractComponentTemplate>; public var compType:XML = <ComponentTemplateDescriptor> <Owner>BackTesting</Owner> <Name>Component</Name> <Version>1</Version> </ComponentTemplateDescriptor>; [Bindable] private var cm:ContextMenu; public var xm1:XML; public var loopparent:Array = new Array(); private var mouseTarget:DisplayObject; private var xOff:Number; private var yOff:Number; private var designer:Designer = new Designer(); private var i:int; private var j:int; private function init():void { designer.setDesignArea(designArea); var cmi1:ContextMenuItem = new ContextMenuItem("Properties", true); cmi1.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_propertiesSelect); var cmi2:ContextMenuItem = new ContextMenuItem("View XML", true); cmi2.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_viewXMLSelect); var cmi3:ContextMenuItem = new ContextMenuItem("Saved Components", true); cmi3.addEventListener(ContextMenuEvent.MENU_ITEM_SELECT, contextMenuItem_savedListSelect); cm = new ContextMenu(); cm.hideBuiltInItems(); cm.customItems = [cmi1, cmi2, cmi3]; cm.addEventListener(ContextMenuEvent.MENU_SELECT, contextMenu_menuSelect); } private function contextMenu_menuSelect(evt:ContextMenuEvent):void { } private function contextMenuItem_propertiesSelect(evt:ContextMenuEvent):void { //panelRight.width = 260; div1.state = (div1.state == CustomDividedBox.COLLAPSE ? CustomDividedBox.EXPAND : CustomDividedBox.COLLAPSE); //Alert.show("properties"); //vDivProp.moveDivider(0, 400); //accrWinProp.label = "Two Way Split - Properties"; //accrWinProp.selectedIndex = 1; } private function contextMenuItem_viewXMLSelect(evt:ContextMenuEvent):void { viewstack.selectedIndex = 1; } private function contextMenuItem_savedListSelect(evt:ContextMenuEvent):void { accrWinComp.selectedIndex = 1; } [Bindable] private var propValue:String = "Component"; private function itemClickEvent(event:ListEvent):void { var propKey:String = dgProp.selectedItem.@key; if (propKey == "name") { propValue = dgProp.selectedItem.propvalue; } } [Bindable] private var sourceXML:XML = <order> <!--This is a comment. --> <?PROC_INSTR sample ?> <item id='1'> <menuName>burger</menuName> <price>3.95</price> </item> <item id='2'> <menuName>fries</menuName> <price>1.45</price> </item> </order>; [Bindable] private var savedComp:Array=['ComponentTemplate', 'iv85341.EquityCash.v1', 'ra92724.ThreeWaySplit.EU.US.OTHERS.v1', 'ra92724.TwoWaySplit.EU.OTHERS.v1', 'ra92724.TwoWaySplit.US.OTHERS.v1', 'iv85341.VanillaNode.v1', 'iv85341.ReadGmrFs.v1' ]; [Bindable] private var propData:XML = <properties> <prop key="name"> <propvalue>Component</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Version"> <propvalue>1.0</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Owner"> <propvalue>iv85341</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="width"> <propvalue>250</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="height"> <propvalue>300</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="X-Pos"> <propvalue>40</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> <prop key="Y-Pos"> <propvalue>20</propvalue> <itemRenderer>mx.controls.NumericStepper</itemRenderer> </prop> </properties>; private function rightClick(event:MouseEvent):void { Alert.show("Properties ..." + event.currentTarget, "Open"); } // Draging Code Starts Here private var curDate:Date = new Date(); private var dateList:XMLList = null; public function pictureDragDrop(event:DragEvent):void { //Alert.show (" com = " + event.dragSource.dataForFormat("key")); var nodeName:String = event.dragSource.dataForFormat("key").toString(); var nodeValue:String = ""; if (nodeValue == "") { if (xm == <AbstractComponentTemplate></AbstractComponentTemplate>) { xm.appendChild(compType); dateList = new XMLList("<DateCreated>" + curDate + "</DateCreated>"); xm.appendChild(dateList); dateList = new XMLList("<DateModified>" + curDate + "</DateModified>"); xm.appendChild(dateList); xm1 = XML("<" + nodeName + "></" + nodeName + ">"); xm.appendChild(xm1); } else { i++; xm1 = XML("<" + nodeName + "></" + nodeName + ">"); xm.appendChild(xm1); //loopparent.push(xmlarray:xm1); loopparent[i] = xm1; } } else { var xmlList:XMLList = new XMLList("<" + nodeName + ">" + nodeValue + "</" + nodeName + ">"); if (xm1 == null) { xm.appendChild(xmlList); } else { for (j = i; j>0; j--) { (loopparent[j]).appendChild(xmlList); //Alert.show("alert"); } } } var x:int = event.currentTarget.mouseX - xOff; var y:int = event.currentTarget.mouseY - yOff; if(event.dragSource.dataForFormat("key") == "box") { designer.addBox(x, y); } else if(event.dragSource.dataForFormat("key") == "circle") { designer.addCircle(x, y); } else { designer.addRectangle(x, y); } } // this method gets x and y coordinate of template box image private function myoffset(img:Image):void { xOff = img.mouseX; yOff = img.mouseY; } // this method does acceptable draging box image public function pictureDragEnter(event:DragEvent):void{ DragManager.acceptDragDrop(Canvas(event.target)); } // this method supply drag box when mouse move on the design area private function dragPicture1(event:MouseEvent, img1:Image,format:String):void{ var dragInitiator:Image=Image(event.currentTarget); var ds:DragSource = new DragSource(); var imageProxy:Image = new Image(); imageProxy.source = img1.source; imageProxy.height= 150; imageProxy.width= 150; ds.addData(format,"key"); DragManager.doDrag(dragInitiator, ds, event,imageProxy, 0, 0, 1.00); } // this method works when click on the line button // it is make enable to draw line public function doDrawEnable():void { designer.setIsDrawEnable(true); } /*private function showCursor():void { CursorManager.setCursor(customCursor,CursorManagerPriority.HIGH,3,2); }*/ private var fileRef:FileReference; public function createXML():void { var fileName:String = "component.xml"; fileRef = new FileReference(); fileRef.browse(); } // Draging code ends here private function onExpand(event:Event):void { if (event.currentTarget == div1) { //Alert.show("hi"); panelRight.width = 0; }else{ panelLeft.width = 200; } // panelLeft.width=this.screen.width-100; } private function onCollapse(event:Event):void{ if(event.currentTarget == div1){ panelRight.width = 260; }else{ panelLeft.width = 0; } // panelLeft.width=(this.width)/60; } ]]> </mx:Script> <mx:Fade id="theEffect"/> <mx:Resize id="resizeEffect" /> <mx:ApplicationControlBar dock="true"> <mx:Image toolTip="Open" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> <mx:Image toolTip="Save" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> <mx:Image toolTip="Undo" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Redo" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Delete" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Image toolTip="Print" useHandCursor="true" buttonMode="true" mouseChildren="false" /> <mx:Spacer width="100%" /> <mx:Label text="BackTesting" fontWeight="bold" fontSize="16" /> </mx:ApplicationControlBar> <mx:Resize duration="250" id="r1"/> <local:CustomDividedBox id="div1" width="100%" height="100%" direction="horizontal" expand="onExpand(event)" collapse="onCollapse(event)"> <local:CustomDividedBox id="div2" width="100%" height="100%" direction="horizontal" expand="onExpand(event)" collapse="onCollapse(event)"> <mx:VDividedBox id="panelLeft" height="100%" width="20%" resizeEffect="r1"> <mx:Panel title="Drawing Components" width="100%" height="100%" layout="vertical" > <mx:Accordion id="accrWinComp" x="151" y="135" width="100%" height="100%"> <mx:Panel label="Nodes" width="100%" height="100%" layout="vertical" borderThicknessTop="-20" paddingTop = "20" paddingLeft = "20" > <mx:Image id="twowaysplit" source="{isOver1 ? overImg1 : defaultImg1}" mouseOver="isOver1 = true" mouseOut="isOver1 = false" toolTip="TwoWay Split" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, twowaysplit, 'twowaysplit');myoffset(twowaysplit);" width="28" height="28" ></mx:Image> <mx:Image id="threewaysplit" source="{isOver2 ? overImg2 : defaultImg2}" mouseOver="isOver2 = true" mouseOut="isOver2 = false" toolTip="Three Way Split" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, threewaysplit, 'threewaysplit');myoffset(threewaysplit);" width="28" height="28" ></mx:Image> <mx:Image id="reader" source="{isOver3 ? overImg3 : defaultImg3}" mouseOver="isOver3 = true" mouseOut="isOver3 = false" toolTip="Reader" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, reader, 'reader');myoffset(reader);" width="28" height="28" ></mx:Image> <mx:Image id="writer" source="{isOver4 ? overImg4 : defaultImg4}" mouseOver="isOver4 = true" mouseOut="isOver4 = false" toolTip="Writer" useHandCursor="true" buttonMode="true" mouseMove="dragPicture1(event, writer, 'writer');myoffset(writer);" width="28" height="28" ></mx:Image> <!--<mx:Button label="Show Cursor" click="showCursor()" x="10" y="59" width="115"/>--> <!-- <mx:Image id="line" width="28" height="28" source="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Image>--> <mx:Button id="line" width="35" height="30" toggle="true" paddingLeft="12" paddingRight="12" icon="@Embed(source='Images/line.png')" toolTip="Line" useHandCursor="true" buttonMode="true" click="doDrawEnable()" ></mx:Button> </mx:Panel> <mx:Panel label="Saved Components" width="100%" height="100%" borderThicknessTop="-20"> <mx:List height="100%" width="100%" dataProvider="{savedComp}" /> </mx:Panel> </mx:Accordion> </mx:Panel> </mx:VDividedBox> <mx:VDividedBox id="mp" height="100%" width="100%"> <mx:HDividedBox width="100%" height="100%"> <mx:Canvas width="100%" height="100%" > <mx:TabBar x="0" y="10" dataProvider="viewstack"/> <mx:ViewStack id="viewstack" width="100%" height="100%" y="32"> <mx:Canvas backgroundColor="#ffffff" borderColor="0xB7BABC" borderStyle="solid" borderThickness="7" label="{propValue}" id="designArea" contextMenu="{cm}" dragEnter="pictureDragEnter(event)" dragDrop="pictureDragDrop(event)" width="100%" height="100%" > </mx:Canvas> <mx:Panel id="pnlXML" label="XML" width="100%" height="100%" showEffect="{theEffect}" > <mx:ControlBar width="100%" barColor="#FF22CC"> <mx:Spacer width="100%"/> <mx:Button id="btnSave" label="Save" useHandCursor="true" buttonMode="true" mouseChildren="false" click="createXML()" /> </mx:ControlBar> <mx:TextArea fontSize="12" wordWrap="false" textIndent="8" id="txtAreaXML" text="{xm}" width="100%" height="100%" editable="false" /> </mx:Panel> </mx:ViewStack> </mx:Canvas> </mx:HDividedBox> </mx:VDividedBox> </local:CustomDividedBox> <mx:VDividedBox id="panelRight" height="100%" width="0" resizeEffect="{resizeEffect}" > <!--<mx:Panel title="Component Properties" width="100%" height="100%" layout="vertical" > <mx:Accordion id="accrWinProp" x="51" y="35" width="100%" height="100%"> --> <mx:Panel id="accrCon2" title="Component Properties" width="100%" height="100%" > <mx:DataGrid id="dgProp" dataProvider="{propData.prop}" height="100%" width="100%" editable="true" itemClick="itemClickEvent(event);"> <mx:columns> <mx:DataGridColumn dataField="@key" headerText="Property" editable="false" /> <mx:DataGridColumn dataField="propvalue" headerText="Value" editable="true" /> </mx:columns> </mx:DataGrid> </mx:Panel> <!--</mx:Accordion> </mx:Panel>--> </mx:VDividedBox> </local:CustomDividedBox> </mx:Application>
1
9,072,713
01/31/2012 00:14:51
45,890
12/13/2008 00:30:32
522
15
How to encode png without color profile with Cocoa?
I am trying to remove color profile from pngs. Below is test code to see the result of using <br> [nsBitmapImageRep representationUsingType:NSPNGFileType properties:dict] and\or<br> [nsBitmapImageRep setProperty:NSImageColorSyncProfileData withValue:profileData]. <br> I haven't been able to affect the resulting png via the properties dictionary. I am using Preview.app and od to check the output png. NSString * sourceImageFilepath = @"/Users/phi/Desktop/The-Apollo.jpg"; NSData * sourceData = [NSData dataWithContentsOfFile:sourceImageFilepath]; //NSData * profileData =[[NSColorSpace genericGrayColorSpace] ICCProfileData]; NSData * profileData = [NSData data]; NSBitmapImageRep * sourceRep = [NSBitmapImageRep imageRepWithData:sourceData]; NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity:1]; [dict setObject:profileData forKey:NSImageColorSyncProfileData]; [sourceRep setProperty:NSImageColorSyncProfileData withValue:profileData]; NSString * destFile = @"/Users/phi/Desktop/out.png"; NSData * destData = [sourceRep representationUsingType:NSPNGFileType properties:dict]; [destData writeToFile:destFile atomically:NO];
osx
cocoa
null
null
null
null
open
How to encode png without color profile with Cocoa? === I am trying to remove color profile from pngs. Below is test code to see the result of using <br> [nsBitmapImageRep representationUsingType:NSPNGFileType properties:dict] and\or<br> [nsBitmapImageRep setProperty:NSImageColorSyncProfileData withValue:profileData]. <br> I haven't been able to affect the resulting png via the properties dictionary. I am using Preview.app and od to check the output png. NSString * sourceImageFilepath = @"/Users/phi/Desktop/The-Apollo.jpg"; NSData * sourceData = [NSData dataWithContentsOfFile:sourceImageFilepath]; //NSData * profileData =[[NSColorSpace genericGrayColorSpace] ICCProfileData]; NSData * profileData = [NSData data]; NSBitmapImageRep * sourceRep = [NSBitmapImageRep imageRepWithData:sourceData]; NSMutableDictionary * dict = [NSMutableDictionary dictionaryWithCapacity:1]; [dict setObject:profileData forKey:NSImageColorSyncProfileData]; [sourceRep setProperty:NSImageColorSyncProfileData withValue:profileData]; NSString * destFile = @"/Users/phi/Desktop/out.png"; NSData * destData = [sourceRep representationUsingType:NSPNGFileType properties:dict]; [destData writeToFile:destFile atomically:NO];
0
71,720
09/16/2008 12:29:59
9,631
09/15/2008 19:25:27
1
4
How do I make the lights stay fixed in the world with Direct3D
I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects. In OpenGL light positions get transformed just like everything else with the MODELVIEW matrix, so to get lights fixed in space, you set up your MODELVIEW the way you want for the lights, and call glLightPosition then set it up for your geometry and make geometry calls. In D3D that doesn't help. (Comment -- I eventually figured out the answer to this one, but I couldn't find anything helpful on the web or in the MSDN. It would have saved me a few hours of head scratching if I could have found this answer then.)
directx
d3d
lighting
lights
null
null
open
How do I make the lights stay fixed in the world with Direct3D === I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects. In OpenGL light positions get transformed just like everything else with the MODELVIEW matrix, so to get lights fixed in space, you set up your MODELVIEW the way you want for the lights, and call glLightPosition then set it up for your geometry and make geometry calls. In D3D that doesn't help. (Comment -- I eventually figured out the answer to this one, but I couldn't find anything helpful on the web or in the MSDN. It would have saved me a few hours of head scratching if I could have found this answer then.)
0
7,241,006
08/30/2011 09:14:51
918,265
08/29/2011 17:29:33
1
0
How to display image in preview using asp.net mvc in preview page
How to preview image to view page using asp.net mvc from particular folder
image
mvc
display
null
null
08/30/2011 10:18:54
not a real question
How to display image in preview using asp.net mvc in preview page === How to preview image to view page using asp.net mvc from particular folder
1
9,955,932
03/31/2012 12:40:13
1,149,157
01/14/2012 10:48:02
45
0
Representation of float by matrix
In my algorithm i use **float** variable to identify something. but in some case, this float can exceed 4 byte. someone say me that there are a solution to represente a float variable in matrix and with some mathematical equation i can exceed 4 byte of float. Is it true ?
java
float
infinity
null
null
03/31/2012 15:06:34
not a real question
Representation of float by matrix === In my algorithm i use **float** variable to identify something. but in some case, this float can exceed 4 byte. someone say me that there are a solution to represente a float variable in matrix and with some mathematical equation i can exceed 4 byte of float. Is it true ?
1
10,396,567
05/01/2012 10:40:03
1,367,590
05/01/2012 10:37:02
1
0
Getting the shortest path in a maze
Can someone help me with this problem please I beg you :( Suppose we need to determine whether or not a particular maze can be solved. We will think of the maze as composed of tall thick green hedges surrounding numerous paths. There will be a single entrance to the maze and a place where we want to get: the goal. On the computer, a maze will be a two-dimensional array of characters such: HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH H H H H H H H H HHHHHHH HHHHH H H HHHHHHHHHH H HHHHH HHH HHH H H H H H H H H H H H H H H H H H H HHHHH HHH H H HHH HHHHHHHH H H H HHHHH HHH HHH E H H H H GH H H H H H H HHH HHHHHHH HHHHHHHHH H H H H H HHHHHHH H HHH HHHHH H H H H H H H H H H H H H HHH HHHHH HHHHHHHHH H HH H H H HHHHH HHHHH HHH H H H H H H H H H H H H H HHH H H HHH H H HHH HHH HHHHHHHHHH H HHHHHHH H H H H H H H H H H H H HH H H H H H H H H H H H H H H H H H H H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH Where each 'H' represents the hedge, the 'E' represent the entrance to the maze, the 'G' represents the goal position and the blanks represent the paths between hedges. We will assume that the maze is stored in file called maze. Write an algorithm and the corresponding code to: 1. read in the maze. 2. mark all location tried with a dot "." and print the new maze to a file call mazeout. 3. Print message to say whether there is a path to the goal or not.
java
netbeans
null
null
null
05/03/2012 08:06:03
not a real question
Getting the shortest path in a maze === Can someone help me with this problem please I beg you :( Suppose we need to determine whether or not a particular maze can be solved. We will think of the maze as composed of tall thick green hedges surrounding numerous paths. There will be a single entrance to the maze and a place where we want to get: the goal. On the computer, a maze will be a two-dimensional array of characters such: HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH H H H H H H H H HHHHHHH HHHHH H H HHHHHHHHHH H HHHHH HHH HHH H H H H H H H H H H H H H H H H H H HHHHH HHH H H HHH HHHHHHHH H H H HHHHH HHH HHH E H H H H GH H H H H H H HHH HHHHHHH HHHHHHHHH H H H H H HHHHHHH H HHH HHHHH H H H H H H H H H H H H H HHH HHHHH HHHHHHHHH H HH H H H HHHHH HHHHH HHH H H H H H H H H H H H H H HHH H H HHH H H HHH HHH HHHHHHHHHH H HHHHHHH H H H H H H H H H H H H HH H H H H H H H H H H H H H H H H H H H HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH Where each 'H' represents the hedge, the 'E' represent the entrance to the maze, the 'G' represents the goal position and the blanks represent the paths between hedges. We will assume that the maze is stored in file called maze. Write an algorithm and the corresponding code to: 1. read in the maze. 2. mark all location tried with a dot "." and print the new maze to a file call mazeout. 3. Print message to say whether there is a path to the goal or not.
1
250,118
10/30/2008 13:09:02
27,646
10/13/2008 22:22:06
177
26
What is the best platform to document standard and best practice?
I'm in the process of exploring our next development platform. So far, I have chose asp.net MVC with MS SQL Server for persistence. I want to document the best practice and standard that my team will use. In the process, I want to read about each aspect, make some prototypes and summarize my conclusion. Even after my initial conclusion, I am open to change it if somebody can demonstrate a better way to do it. Because I like to have some feedback from the community, I think it will be fair to let the result public for future referencing. Some of the aspect I want to cover: - layer separation - each layer role - naming convention - Data access - Internationalization - Exception handling - Unit test - etc. What is the best online platform to do it?
documentation
null
null
null
null
02/06/2012 18:28:38
not constructive
What is the best platform to document standard and best practice? === I'm in the process of exploring our next development platform. So far, I have chose asp.net MVC with MS SQL Server for persistence. I want to document the best practice and standard that my team will use. In the process, I want to read about each aspect, make some prototypes and summarize my conclusion. Even after my initial conclusion, I am open to change it if somebody can demonstrate a better way to do it. Because I like to have some feedback from the community, I think it will be fair to let the result public for future referencing. Some of the aspect I want to cover: - layer separation - each layer role - naming convention - Data access - Internationalization - Exception handling - Unit test - etc. What is the best online platform to do it?
4
10,322,282
04/25/2012 19:16:02
581,335
01/18/2011 20:11:03
533
3
Devising 'is_const_iterator' metafunction: evaluate, please
Consider: #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/remove_reference.hpp> template<class t_iterator> struct is_const_iterator { static bool const value = boost::is_const < typename boost::remove_reference<typename t_iterator::reference>::type >::value; }; I feel like the assumption is precise. What do you think? Usage is pretty straightforward: #include <vector> assert(!is_const_iterator<std::vector<int>::iterator>::value); assert(is_const_iterator<std::vector<int>::const_iterator>::value);
c++
types
iterator
const
traits
04/25/2012 20:52:21
off topic
Devising 'is_const_iterator' metafunction: evaluate, please === Consider: #include <boost/type_traits/is_const.hpp> #include <boost/type_traits/remove_reference.hpp> template<class t_iterator> struct is_const_iterator { static bool const value = boost::is_const < typename boost::remove_reference<typename t_iterator::reference>::type >::value; }; I feel like the assumption is precise. What do you think? Usage is pretty straightforward: #include <vector> assert(!is_const_iterator<std::vector<int>::iterator>::value); assert(is_const_iterator<std::vector<int>::const_iterator>::value);
2
9,588,064
03/06/2012 16:44:37
856,753
07/21/2011 19:49:10
69
2
how to verify if a checkbox is checked in query before submission
<select name="status" id='status'> <option value="Submitted">Submitted</option> <option value="Canceled">Canceled</option> </select> <input type="checkbox" id="app_box" name="application_complete" value="checked"> App Complete <script type="text/javascript"> $(function() { $('form.editable').submit(function(){ if ($('#status').val()=='Canceled') { if (!confirm('This information will be discarded! )) { return false; } } }); }); </script> So, I have the above script which works fine. I have to add one more confirmation. When the agent clicks on the submit button , I want to check if the application check box is checked or not. If it is not checked then display another confirmation box saying, you have to check the box. How can this be done in jquery.
jquery
jqueryform
null
null
null
null
open
how to verify if a checkbox is checked in query before submission === <select name="status" id='status'> <option value="Submitted">Submitted</option> <option value="Canceled">Canceled</option> </select> <input type="checkbox" id="app_box" name="application_complete" value="checked"> App Complete <script type="text/javascript"> $(function() { $('form.editable').submit(function(){ if ($('#status').val()=='Canceled') { if (!confirm('This information will be discarded! )) { return false; } } }); }); </script> So, I have the above script which works fine. I have to add one more confirmation. When the agent clicks on the submit button , I want to check if the application check box is checked or not. If it is not checked then display another confirmation box saying, you have to check the box. How can this be done in jquery.
0
8,321,174
11/30/2011 04:29:43
576,146
01/14/2011 20:07:08
1
1
Beginning PHP and MySQL, Jason Gilmore. Thoughts?
Has anyone heard anything about this book? I'm learning PHP starting from scratch. http://www.amazon.com/Beginning-PHP-MySQL-Novice-Professional/dp/1430231149/ref=cm_cr_pr_product_top
php
books
null
null
null
12/01/2011 22:22:59
not constructive
Beginning PHP and MySQL, Jason Gilmore. Thoughts? === Has anyone heard anything about this book? I'm learning PHP starting from scratch. http://www.amazon.com/Beginning-PHP-MySQL-Novice-Professional/dp/1430231149/ref=cm_cr_pr_product_top
4
7,363,286
09/09/2011 14:35:03
773,263
05/27/2011 14:27:52
87
2
Where to find iso Simulator on SDK/Xcode4 download?
I need to use the iso Simulator for a iPad website I'm working on. I have downloaded Xcode4([http://developer.apple.com/devcenter/ios/index.action][1]) [1]: http://developer.apple.com/devcenter/ios/index.action I'm now looking for the Iso simulator and can't find it anywhere. Do I have to launch it via Xcode if so how?
iphone
xcode
osx
ipad
iso
null
open
Where to find iso Simulator on SDK/Xcode4 download? === I need to use the iso Simulator for a iPad website I'm working on. I have downloaded Xcode4([http://developer.apple.com/devcenter/ios/index.action][1]) [1]: http://developer.apple.com/devcenter/ios/index.action I'm now looking for the Iso simulator and can't find it anywhere. Do I have to launch it via Xcode if so how?
0
6,081,529
05/21/2011 11:50:18
604,243
02/05/2011 09:28:23
22
8
Android vs WP7 ? Learn which one?
I have been asked by my company to learn building mobile applications either on Android or on WP7. But i am not able to decide which one should i learn. The mobile applications would be more concerned about the *performance and security* (most of them will be *based on M-Commerce*), and GUI is not our primary concern. I had been working on wpf so i know xaml and java is also not a problem. What i need is a platform which is *easy to learn* and *easy to work* on as I have very limited time to learn. What are the pros and cons of the two OS and learning which one will be **more fruitful in the future**?
android
windows-phone-7
null
null
null
05/21/2011 12:09:05
off topic
Android vs WP7 ? Learn which one? === I have been asked by my company to learn building mobile applications either on Android or on WP7. But i am not able to decide which one should i learn. The mobile applications would be more concerned about the *performance and security* (most of them will be *based on M-Commerce*), and GUI is not our primary concern. I had been working on wpf so i know xaml and java is also not a problem. What i need is a platform which is *easy to learn* and *easy to work* on as I have very limited time to learn. What are the pros and cons of the two OS and learning which one will be **more fruitful in the future**?
2
10,711,653
05/22/2012 23:49:20
1,124,350
12/31/2011 13:34:51
334
16
compile error with class param
Why do I can't make `l->set(new StateB);` in `StateA`? (this line is commented below) It says: main.cpp: In member function ‘virtual void StateA::writeName(Lap*, char*)’: main.cpp:19:4: error: invalid use of incomplete type ‘struct Lap’ main.cpp:3:7: error: forward declaration of ‘struct Lap’ but I cant solve that :( #include <stdio.h> class Lap; class State; class StateB; class StateA; class State { public: virtual void writeName(Lap *l, char *str) = 0; }; class StateB : public State { public: void writeName(Lap *l, char *str) { printf("%s B\n", str); } }; class StateA : public State { public: void writeName(Lap *l, char *str) { printf("%s A\n", str); //l->set(new StateB); } }; class Lap { public: State *ss; Lap(){ printf("[Lap]\n"); set(new StateA); } void set(State *s){ ss = s; } void writeName(char *str){ ss->writeName(this, str); } }; int main() { printf("\n\n"); Lap lap; lap.writeName((char*)"Fulano"); lap.writeName((char*)"Fulano"); printf("\n\n"); return 0; }
c++
homework
g++
null
null
null
open
compile error with class param === Why do I can't make `l->set(new StateB);` in `StateA`? (this line is commented below) It says: main.cpp: In member function ‘virtual void StateA::writeName(Lap*, char*)’: main.cpp:19:4: error: invalid use of incomplete type ‘struct Lap’ main.cpp:3:7: error: forward declaration of ‘struct Lap’ but I cant solve that :( #include <stdio.h> class Lap; class State; class StateB; class StateA; class State { public: virtual void writeName(Lap *l, char *str) = 0; }; class StateB : public State { public: void writeName(Lap *l, char *str) { printf("%s B\n", str); } }; class StateA : public State { public: void writeName(Lap *l, char *str) { printf("%s A\n", str); //l->set(new StateB); } }; class Lap { public: State *ss; Lap(){ printf("[Lap]\n"); set(new StateA); } void set(State *s){ ss = s; } void writeName(char *str){ ss->writeName(this, str); } }; int main() { printf("\n\n"); Lap lap; lap.writeName((char*)"Fulano"); lap.writeName((char*)"Fulano"); printf("\n\n"); return 0; }
0
10,512,902
05/09/2012 09:02:01
333,113
04/05/2009 16:23:30
150
6
Listen to rightclick on svg element with Raphael.js
I need to respond when a user right clicks on an element created with Rapahel.js. I read that you should just attach a click event handler and then decide which mouse button the user clicked. I can't get this to work. <!DOCTYPE html> <html> <head> <script src="http://raphaeljs.com/raphael.js"></script> <script> window.onload = function() { var r = Raphael('demo', 640, 480); r.rect(10, 10, 400, 400).attr({fill: 'red'}).click(function(){ alert('test'); });; }; </script> </head> <body> <div id="demo"></div> </body> </html> The alert box will only show when clicking the left button on the mouse. Any suggestions about how to show the alert box when clicking the right button?
javascript
svg
raphael
null
null
null
open
Listen to rightclick on svg element with Raphael.js === I need to respond when a user right clicks on an element created with Rapahel.js. I read that you should just attach a click event handler and then decide which mouse button the user clicked. I can't get this to work. <!DOCTYPE html> <html> <head> <script src="http://raphaeljs.com/raphael.js"></script> <script> window.onload = function() { var r = Raphael('demo', 640, 480); r.rect(10, 10, 400, 400).attr({fill: 'red'}).click(function(){ alert('test'); });; }; </script> </head> <body> <div id="demo"></div> </body> </html> The alert box will only show when clicking the left button on the mouse. Any suggestions about how to show the alert box when clicking the right button?
0
10,599,817
05/15/2012 11:32:32
504,099
11/11/2010 05:36:06
408
5
very strange error for bad URL
i am getting very strange error of bad URL as url is http://www.xxxxxxxx.com/myxxxxx/api/api.php?func=registerJobSeeker&params[]=Muhammad&params[][email protected]&params[]=fjcjfk&params[]=BE&params[]=5&params[]=766&params[]=25.773285&params[]=55.966731 though url becomes ok but i get following error Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x110247e0 {NSUnderlyingError=0x11024e20 "bad URL", NSLocalizedDescription=bad URL}
iphone
null
null
null
null
05/16/2012 00:57:25
not a real question
very strange error for bad URL === i am getting very strange error of bad URL as url is http://www.xxxxxxxx.com/myxxxxx/api/api.php?func=registerJobSeeker&params[]=Muhammad&params[][email protected]&params[]=fjcjfk&params[]=BE&params[]=5&params[]=766&params[]=25.773285&params[]=55.966731 though url becomes ok but i get following error Error Domain=NSURLErrorDomain Code=-1000 "bad URL" UserInfo=0x110247e0 {NSUnderlyingError=0x11024e20 "bad URL", NSLocalizedDescription=bad URL}
1
5,056,924
02/20/2011 12:10:25
611,078
02/10/2011 04:11:32
5
0
How to implement that please
I added exe to the main bundle of my project , how to call it and pass parameters to it best regards
xcode
ipad
null
null
null
null
open
How to implement that please === I added exe to the main bundle of my project , how to call it and pass parameters to it best regards
0
10,304,865
04/24/2012 19:40:07
1,354,595
04/24/2012 19:31:50
1
0
GridView not returning databound rows when OnClick event fires
I have a GridView that is made up of two database fields populated via a stored procedure and then three fields for user input (two checkbox controls and one textbox) when I click on the save button I can get the information from the three controls but nothing from the two that were populated via the database. How can I get the first two fields? <asp:GridView ID="gvA1" runat="server" AutoGenerateColumns="false" DataKeyNames="CodeNo" AutoGenerateSelectButton="false" EnablePersistedSelection="True" Visible="false"> <Columns> <asp:TemplateField Visible="false" > <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "CodeNo")%> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ItemStyle-Wrap="true" ItemStyle-Width="400px" HeaderText="Violation"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "CodeViolationCited") %> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="A1Accordion_cbPool" runat="server" Text="Pool:" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="A1Accordion_cbSpa" runat="server" Text="Spa:" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Additional Comments" Visible="true"> <ItemTemplate> <asp:TextBox ID="A1Accordion_tb" runat="server" TextMode="MultiLine"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Code Behind: protected void SaveAndCollapseA1(object sender, EventArgs e) { //good stuff CheckBox myCheckBox_1 = gvA1.Rows[0].FindControl("A1Accordion_cbPool") as CheckBox; CheckBox myCheckBox_2 = gvA1.Rows[0].FindControl("A1Accordion_cbSpa") as CheckBox; TextBox myTextBox = gvA1.Rows[0].FindControl("A1Accordion_tb") as TextBox; //not so good stuff String myString1 = gvA1.Rows[0].Cells[0].ToString(); String myString2 = gvA1.Rows[0].Cells[1].ToString(); }
asp.net
gridview
null
null
null
null
open
GridView not returning databound rows when OnClick event fires === I have a GridView that is made up of two database fields populated via a stored procedure and then three fields for user input (two checkbox controls and one textbox) when I click on the save button I can get the information from the three controls but nothing from the two that were populated via the database. How can I get the first two fields? <asp:GridView ID="gvA1" runat="server" AutoGenerateColumns="false" DataKeyNames="CodeNo" AutoGenerateSelectButton="false" EnablePersistedSelection="True" Visible="false"> <Columns> <asp:TemplateField Visible="false" > <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "CodeNo")%> </ItemTemplate> </asp:TemplateField> <asp:TemplateField ItemStyle-Wrap="true" ItemStyle-Width="400px" HeaderText="Violation"> <ItemTemplate> <%#DataBinder.Eval(Container.DataItem, "CodeViolationCited") %> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="A1Accordion_cbPool" runat="server" Text="Pool:" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField> <ItemTemplate> <asp:CheckBox ID="A1Accordion_cbSpa" runat="server" Text="Spa:" /> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="Additional Comments" Visible="true"> <ItemTemplate> <asp:TextBox ID="A1Accordion_tb" runat="server" TextMode="MultiLine"></asp:TextBox> </ItemTemplate> </asp:TemplateField> </Columns> </asp:GridView> Code Behind: protected void SaveAndCollapseA1(object sender, EventArgs e) { //good stuff CheckBox myCheckBox_1 = gvA1.Rows[0].FindControl("A1Accordion_cbPool") as CheckBox; CheckBox myCheckBox_2 = gvA1.Rows[0].FindControl("A1Accordion_cbSpa") as CheckBox; TextBox myTextBox = gvA1.Rows[0].FindControl("A1Accordion_tb") as TextBox; //not so good stuff String myString1 = gvA1.Rows[0].Cells[0].ToString(); String myString2 = gvA1.Rows[0].Cells[1].ToString(); }
0
11,564,438
07/19/2012 15:43:34
1,524,228
07/13/2012 17:30:15
1
0
Add set marker to map using javascipt funtion
Should be fairly easy. Using Google Maps API V3. I want to set a marker on a map with a set location (lat, lng) using a javascript function. Also need to add info to the marker (name, address, csz, phone). Any help is appreciated.
google-maps
google-maps-api-3
google-maps-markers
null
null
07/19/2012 17:54:55
not a real question
Add set marker to map using javascipt funtion === Should be fairly easy. Using Google Maps API V3. I want to set a marker on a map with a set location (lat, lng) using a javascript function. Also need to add info to the marker (name, address, csz, phone). Any help is appreciated.
1
9,145,695
02/04/2012 23:50:58
1,159,819
01/20/2012 02:04:37
13
1
Understanding The BlackBerry App World license models
http://supportforums.blackberry.com/t5/BlackBerry-App-World-Development/The-BlackBerry-App-World-license-models/ta-p/445717 I don't understand the license models that app world provides. I want to release a paid version of my app but I do not have a http server. So I guess I can use a single or pool license model. But what exactly are these license models, do I need to write some code into my app to verify keys? Or is this simply some basic security for downloading from app world? It seems like there is no actual license check in the app? So as soon as a user copies the app from the device they can upload it to some pirate website as it will install on any device? I am writing an app for the playbook for use in the android player.
blackberry
blackberry-playbook
appworld
null
null
02/05/2012 18:33:31
off topic
Understanding The BlackBerry App World license models === http://supportforums.blackberry.com/t5/BlackBerry-App-World-Development/The-BlackBerry-App-World-license-models/ta-p/445717 I don't understand the license models that app world provides. I want to release a paid version of my app but I do not have a http server. So I guess I can use a single or pool license model. But what exactly are these license models, do I need to write some code into my app to verify keys? Or is this simply some basic security for downloading from app world? It seems like there is no actual license check in the app? So as soon as a user copies the app from the device they can upload it to some pirate website as it will install on any device? I am writing an app for the playbook for use in the android player.
2
10,575,296
05/13/2012 21:13:52
1,092,547
12/11/2011 18:12:03
53
2
loading form with no action inside a div
I have a form inside a div tag, but with `action=""`, and i want the result of form submission abppear in the same div, so i created this function: $(document).ready(function() { $('#div1').delegate('form', 'submit', function() { // catch the form's submit events inside the div $.ajax({ // create an AJAX call... data: $(this).serialize(), // get the form data type: $(this).attr('method'), // GET or POST url: $(this).attr('action'), // the file to call success: function(response) { // on success.. //$('#div1').html(response); // update the DIV $('#div1').fadeOut('slow',function() { $('#div1').html(response).fadeIn('slow'); }); } }); return false; // cancel original event to prevent form submitting }); }); however when i submit the form, nothing appears because the form has no action to be loaded, the same function works with other forms having action attribute, so my question is how to handle this case to make the form read the script in the same page when the form action is empty?
javascript
jquery
ajax
jquery-ajax
div
null
open
loading form with no action inside a div === I have a form inside a div tag, but with `action=""`, and i want the result of form submission abppear in the same div, so i created this function: $(document).ready(function() { $('#div1').delegate('form', 'submit', function() { // catch the form's submit events inside the div $.ajax({ // create an AJAX call... data: $(this).serialize(), // get the form data type: $(this).attr('method'), // GET or POST url: $(this).attr('action'), // the file to call success: function(response) { // on success.. //$('#div1').html(response); // update the DIV $('#div1').fadeOut('slow',function() { $('#div1').html(response).fadeIn('slow'); }); } }); return false; // cancel original event to prevent form submitting }); }); however when i submit the form, nothing appears because the form has no action to be loaded, the same function works with other forms having action attribute, so my question is how to handle this case to make the form read the script in the same page when the form action is empty?
0
6,147,493
05/27/2011 03:17:26
539,938
12/12/2010 23:47:37
96
1
Reading from file, sorting and returning. C++
Starting to write a program. I inserted some comments and I'm quite clueless on how I would implement what I'm trying to accomplish. #include <iostream> #include <fstream> #include <iomanip> using namespace std; class Square { int ID; int width; int area; public: Square() {ID = 0; width = 0; } void setWidth(int w) { //1. Writes the body of this function //to set the width to w. width = w; } void setID(int in_id) {ID = in_id;} int getWidth() { return width; } int getID() { return ID; } int getArea() { //2. Writes the body of this function //to return the area of this square. area = width * width; return area; } }; void readfile(Square s[], int &count) { //3. Write the body of this function to perform the following: //- Open the file named width.txt //- Read the pairs of ID and width values //- Save these pairs of values in the ID and width members of the Square object array //- Count and save the number pairs of values in the variable count //- Close the file ifstream redfile; redfile.open("width.txt"); while(!redfile.eof); { getline(redfile,//help); } redfile.close(); } int largest_area(Square s[], int size) { cout << "\nFinding the Square object with the largest area ....\n"; //4. Replace the following statement with the // body of this function to perform the following tasks: //- Find a Square object with the largest area in the array s[] // with "size" number of elements //- Return its subscript in the array. return 0; } int linear_search(Square s[], int size, int value) { cout << "\nLinear Search ....\n"; //5. Replace the following statement with the // body of this function to perform the following tasks: //- Searches the array s[] of Square objects with "size" number of elements, // attempting to locate a Square object whose area = value. //- If it finds a match, the array subscript of // that Square object is returned. //- If it does not find a match, -1 is returned. return -1; } void selection_sort_DecreasingID(Square s[], int size) { cout << "\nSelection Sort the Square object array in decreasing order of ID ....\n"; //6. Write the body of this function to perform the following task: //- using selection sort algorithm, arrange the Square array s[] of // "size" number of elements in order of DECREASING ID. int i, j, first, temp; int numLength = num.length( ); for (i= numLength - 1; i > 0; i--) { first = 0; // initialize to subscript of first element for (j=1; j<=i; j++) // locate smallest between positions 1 and i. { if (num[j] < num[first]) first = j; } temp = num[first]; // Swap smallest found with element in position i. num[first] = num[i]; num[i] = temp; } return; } } void bubble_sort_DecreasingArea(Square arr[], int size) { cout << "\nBubble Sort the Square object array in decreasing order of area ....\n"; //7. Write the body of this function to perform the following task: //- using bubble sort algorithm, arrange the Square array arr[] of // "size" number of elements in order of DECREASING area. int i, j, flag = 1; // set flag to 1 to start first pass int temp; // holding variable int numLength = num.length( ); for(i = 1; (i <= numLength) && flag; i++) { flag = 0; for (j=0; j < (numLength -1); j++) { if (num[j+1] > num[j]) // ascending order simply changes to < { temp = num[j]; // swap elements num[j] = num[j+1]; num[j+1] = temp; flag = 1; // indicates that a swap occurred. } } } return; //arrays are passed to functions by address; nothing is returned } } int binary_search_DecreasingArea(Square s[], int size, int value) { cout << "\nBinary Search a Square array s[] sorted in decreasing area ....\n"; //8. Replace the following statement with the // body of this function to perform the following tasks: //- Use binary search algorithm to search the array s[] of Square objects with // "size" number of elements, attempting to locate a Square object whose area = value. // The array s[] is sorted in DECREASING order of area. //- If it finds a match, the array subscript of // that Square object is returned. //- If it does not find a match, -1 is returned. int i, j, flag = 1; // set flag to 1 to start first pass int temp; // holding variable int numLength = num.length( ); for(i = 1; (i <= numLength) && flag; i++) { flag = 0; for (j=0; j < (numLength -1); j++) { if (num[j+1] > num[j]) // ascending order simply changes to < { temp = num[j]; // swap elements num[j] = num[j+1]; num[j+1] = temp; flag = 1; // indicates that a swap occurred. } } } return -1; //arrays are passed to functions by address; nothing is returned } void writefile(Square s[], int size, char filename[], string msg) { ofstream ofile; ofile.open(filename); cout << "\nWriting the Square array to file \"" << filename << "\" ... \n"; ofile << "There are " << size << " Square objects.\n\n"; ofile << msg << endl; for (int i = 0; i < size; i++) { ofile << " (" << setw(4) << s[i].getID() << "," << setw(4) << s[i].getWidth() << ")"; if (i%10 == 9) ofile << endl; } cout << "Written to file \""<< filename << "\"\n\n"; ofile.close(); } const int MAX = 10000; int main() { Square sqr[MAX]; //Reads the pairs of ID & width values from width.txt //- set the ID & width members in the array sqr[MAX] of Square objects. //- saves the number of pairs of ID & width values in no_sqr int no_sqr; //Stores the number of pairs of ID & width read in from width.txt. readfile(sqr, no_sqr); //Displays the number of pairs of ID & width values. cout << "There are " << no_sqr << " Square objects.\n"; //Writes the unsorted array to out1.txt. writefile(sqr, no_sqr, "out1.txt", "Unsorted array"); ofstream ofile; ofile.open("out2.txt"); int result; //Calls largest_area to find the Square object with the largest area. result = largest_area(sqr, no_sqr); //Display the largest Square object data on console. cout << "\nLargest Square object has the ID of " << sqr[result].getID() << ", width of " << sqr[result].getWidth() << " and area of " << sqr[result].getArea() << ".\n"; //Write the above information in out2.txt ofile << "\nLargest Square object has the ID of " << sqr[result].getID() << ", width of " << sqr[result].getWidth() << " and area of " << sqr[result].getArea() << ".\n\n"; //Calls the selection_sort_DecreasingArea function to sort the Square object array sqr[] //in decreasing order of ID. selection_sort_DecreasingID(sqr, no_sqr); //Writes no_sqr and sorted array to out3.txt. writefile(sqr, no_sqr, "out3.txt", "Sorted array in decreasing order of ID"); //Calls the bubble_sort_DecreasingArea function to sort the Square object array sqr[] //in decreasing order of area. bubble_sort_DecreasingArea(sqr, no_sqr); //Writes no_sqr and sorted array to out4.txt. writefile(sqr, no_sqr, "out4.txt", "Sorted array in decreasing order of area"); int value = 67600; for (int i = 0; i < 2; i++) { //Calls binary_search_DecreasingArea to find a Square object with an area of value. result = binary_search_DecreasingArea(sqr, no_sqr, value); if (result >= 0) { //Display the found Square object data on console. cout << "\nBinary search found the Square with area of " << value << endl; cout << "ID: " << sqr[result].getID() << " "; cout << "width: " << sqr[result].getWidth() << " "; cout << "area: " << sqr[result].getArea() << "\n"; //Write same information to out2.txt. ofile << "\nBinary search found the Square with area of " << value << endl; ofile << "ID: " << sqr[result].getID() << endl; ofile << "width : " << sqr[result].getWidth() << endl; ofile << "area : " << sqr[result].getArea() << "\n\n"; } else { cout << "\nBinary search did not find the square with your specified area of " << value << ".\n"; //Write same information to out2.txt. ofile << "\nBinary search did not find the square with your specified area of " << value << ".\n\n"; } value++; } value = 67600; for (int i = 0; i < 2; i++) { //Calls linear_search to find a Square object with an area of value. result =linear_search(sqr, no_sqr, value); if (result >= 0) { //Display the found Square object data on console. cout << "\nLinear search found the Square with area of " << value << endl; cout << "ID: " << sqr[result].getID() << endl; cout << "width : " << sqr[result].getWidth() << endl; cout << "area : " << sqr[result].getArea() << "\n\n"; //Write same information to out2.txt. ofile << "\nLinear search found the Square with area of " << value << endl; ofile << "ID: " << sqr[result].getID() << endl; ofile << "width : " << sqr[result].getWidth() << endl; ofile << "area : " << sqr[result].getArea() << "\n\n"; } else { cout << "\nLinear search did not find the square with your specified area of " << value << ".\n\n"; //Write same information to out2.txt. ofile << "\nLinear search did not find the square with your specified area of " << value << ".\n\n"; } value++; } ofile.close(); system("PAUSE"); return 0; }
c++
null
null
null
null
05/27/2011 07:31:37
not a real question
Reading from file, sorting and returning. C++ === Starting to write a program. I inserted some comments and I'm quite clueless on how I would implement what I'm trying to accomplish. #include <iostream> #include <fstream> #include <iomanip> using namespace std; class Square { int ID; int width; int area; public: Square() {ID = 0; width = 0; } void setWidth(int w) { //1. Writes the body of this function //to set the width to w. width = w; } void setID(int in_id) {ID = in_id;} int getWidth() { return width; } int getID() { return ID; } int getArea() { //2. Writes the body of this function //to return the area of this square. area = width * width; return area; } }; void readfile(Square s[], int &count) { //3. Write the body of this function to perform the following: //- Open the file named width.txt //- Read the pairs of ID and width values //- Save these pairs of values in the ID and width members of the Square object array //- Count and save the number pairs of values in the variable count //- Close the file ifstream redfile; redfile.open("width.txt"); while(!redfile.eof); { getline(redfile,//help); } redfile.close(); } int largest_area(Square s[], int size) { cout << "\nFinding the Square object with the largest area ....\n"; //4. Replace the following statement with the // body of this function to perform the following tasks: //- Find a Square object with the largest area in the array s[] // with "size" number of elements //- Return its subscript in the array. return 0; } int linear_search(Square s[], int size, int value) { cout << "\nLinear Search ....\n"; //5. Replace the following statement with the // body of this function to perform the following tasks: //- Searches the array s[] of Square objects with "size" number of elements, // attempting to locate a Square object whose area = value. //- If it finds a match, the array subscript of // that Square object is returned. //- If it does not find a match, -1 is returned. return -1; } void selection_sort_DecreasingID(Square s[], int size) { cout << "\nSelection Sort the Square object array in decreasing order of ID ....\n"; //6. Write the body of this function to perform the following task: //- using selection sort algorithm, arrange the Square array s[] of // "size" number of elements in order of DECREASING ID. int i, j, first, temp; int numLength = num.length( ); for (i= numLength - 1; i > 0; i--) { first = 0; // initialize to subscript of first element for (j=1; j<=i; j++) // locate smallest between positions 1 and i. { if (num[j] < num[first]) first = j; } temp = num[first]; // Swap smallest found with element in position i. num[first] = num[i]; num[i] = temp; } return; } } void bubble_sort_DecreasingArea(Square arr[], int size) { cout << "\nBubble Sort the Square object array in decreasing order of area ....\n"; //7. Write the body of this function to perform the following task: //- using bubble sort algorithm, arrange the Square array arr[] of // "size" number of elements in order of DECREASING area. int i, j, flag = 1; // set flag to 1 to start first pass int temp; // holding variable int numLength = num.length( ); for(i = 1; (i <= numLength) && flag; i++) { flag = 0; for (j=0; j < (numLength -1); j++) { if (num[j+1] > num[j]) // ascending order simply changes to < { temp = num[j]; // swap elements num[j] = num[j+1]; num[j+1] = temp; flag = 1; // indicates that a swap occurred. } } } return; //arrays are passed to functions by address; nothing is returned } } int binary_search_DecreasingArea(Square s[], int size, int value) { cout << "\nBinary Search a Square array s[] sorted in decreasing area ....\n"; //8. Replace the following statement with the // body of this function to perform the following tasks: //- Use binary search algorithm to search the array s[] of Square objects with // "size" number of elements, attempting to locate a Square object whose area = value. // The array s[] is sorted in DECREASING order of area. //- If it finds a match, the array subscript of // that Square object is returned. //- If it does not find a match, -1 is returned. int i, j, flag = 1; // set flag to 1 to start first pass int temp; // holding variable int numLength = num.length( ); for(i = 1; (i <= numLength) && flag; i++) { flag = 0; for (j=0; j < (numLength -1); j++) { if (num[j+1] > num[j]) // ascending order simply changes to < { temp = num[j]; // swap elements num[j] = num[j+1]; num[j+1] = temp; flag = 1; // indicates that a swap occurred. } } } return -1; //arrays are passed to functions by address; nothing is returned } void writefile(Square s[], int size, char filename[], string msg) { ofstream ofile; ofile.open(filename); cout << "\nWriting the Square array to file \"" << filename << "\" ... \n"; ofile << "There are " << size << " Square objects.\n\n"; ofile << msg << endl; for (int i = 0; i < size; i++) { ofile << " (" << setw(4) << s[i].getID() << "," << setw(4) << s[i].getWidth() << ")"; if (i%10 == 9) ofile << endl; } cout << "Written to file \""<< filename << "\"\n\n"; ofile.close(); } const int MAX = 10000; int main() { Square sqr[MAX]; //Reads the pairs of ID & width values from width.txt //- set the ID & width members in the array sqr[MAX] of Square objects. //- saves the number of pairs of ID & width values in no_sqr int no_sqr; //Stores the number of pairs of ID & width read in from width.txt. readfile(sqr, no_sqr); //Displays the number of pairs of ID & width values. cout << "There are " << no_sqr << " Square objects.\n"; //Writes the unsorted array to out1.txt. writefile(sqr, no_sqr, "out1.txt", "Unsorted array"); ofstream ofile; ofile.open("out2.txt"); int result; //Calls largest_area to find the Square object with the largest area. result = largest_area(sqr, no_sqr); //Display the largest Square object data on console. cout << "\nLargest Square object has the ID of " << sqr[result].getID() << ", width of " << sqr[result].getWidth() << " and area of " << sqr[result].getArea() << ".\n"; //Write the above information in out2.txt ofile << "\nLargest Square object has the ID of " << sqr[result].getID() << ", width of " << sqr[result].getWidth() << " and area of " << sqr[result].getArea() << ".\n\n"; //Calls the selection_sort_DecreasingArea function to sort the Square object array sqr[] //in decreasing order of ID. selection_sort_DecreasingID(sqr, no_sqr); //Writes no_sqr and sorted array to out3.txt. writefile(sqr, no_sqr, "out3.txt", "Sorted array in decreasing order of ID"); //Calls the bubble_sort_DecreasingArea function to sort the Square object array sqr[] //in decreasing order of area. bubble_sort_DecreasingArea(sqr, no_sqr); //Writes no_sqr and sorted array to out4.txt. writefile(sqr, no_sqr, "out4.txt", "Sorted array in decreasing order of area"); int value = 67600; for (int i = 0; i < 2; i++) { //Calls binary_search_DecreasingArea to find a Square object with an area of value. result = binary_search_DecreasingArea(sqr, no_sqr, value); if (result >= 0) { //Display the found Square object data on console. cout << "\nBinary search found the Square with area of " << value << endl; cout << "ID: " << sqr[result].getID() << " "; cout << "width: " << sqr[result].getWidth() << " "; cout << "area: " << sqr[result].getArea() << "\n"; //Write same information to out2.txt. ofile << "\nBinary search found the Square with area of " << value << endl; ofile << "ID: " << sqr[result].getID() << endl; ofile << "width : " << sqr[result].getWidth() << endl; ofile << "area : " << sqr[result].getArea() << "\n\n"; } else { cout << "\nBinary search did not find the square with your specified area of " << value << ".\n"; //Write same information to out2.txt. ofile << "\nBinary search did not find the square with your specified area of " << value << ".\n\n"; } value++; } value = 67600; for (int i = 0; i < 2; i++) { //Calls linear_search to find a Square object with an area of value. result =linear_search(sqr, no_sqr, value); if (result >= 0) { //Display the found Square object data on console. cout << "\nLinear search found the Square with area of " << value << endl; cout << "ID: " << sqr[result].getID() << endl; cout << "width : " << sqr[result].getWidth() << endl; cout << "area : " << sqr[result].getArea() << "\n\n"; //Write same information to out2.txt. ofile << "\nLinear search found the Square with area of " << value << endl; ofile << "ID: " << sqr[result].getID() << endl; ofile << "width : " << sqr[result].getWidth() << endl; ofile << "area : " << sqr[result].getArea() << "\n\n"; } else { cout << "\nLinear search did not find the square with your specified area of " << value << ".\n\n"; //Write same information to out2.txt. ofile << "\nLinear search did not find the square with your specified area of " << value << ".\n\n"; } value++; } ofile.close(); system("PAUSE"); return 0; }
1
10,807,266
05/29/2012 21:57:08
189,371
10/13/2009 19:25:34
153
5
Change text on start of jQuery sortable
I have a jQuery sortable list. When I begin dragging an item, I want to remove some text while it's being dragged so it only shows the first line while dragging. For example, I have an ol: <ol> <li>Here is some text. <span>Here is a bunch of other text</span> <li>Here is some text also. <span>Here is a bunch of other text as well</span> </ol> When I begin dragging the first li, I would like it to only show "Here is some text" while dragging. Is this possible?
jquery-ui
null
null
null
null
null
open
Change text on start of jQuery sortable === I have a jQuery sortable list. When I begin dragging an item, I want to remove some text while it's being dragged so it only shows the first line while dragging. For example, I have an ol: <ol> <li>Here is some text. <span>Here is a bunch of other text</span> <li>Here is some text also. <span>Here is a bunch of other text as well</span> </ol> When I begin dragging the first li, I would like it to only show "Here is some text" while dragging. Is this possible?
0
7,509,512
09/22/2011 04:19:08
168,752
09/04/2009 19:59:34
103
1
Is there an open source forum with gmail style threads?
Looking for an open source forum project with gmail style threads. Preferably .Net but I'm not that picky.
asp.net
null
null
null
null
09/22/2011 07:59:56
off topic
Is there an open source forum with gmail style threads? === Looking for an open source forum project with gmail style threads. Preferably .Net but I'm not that picky.
2
11,681,856
07/27/2012 05:16:40
1,023,060
11/01/2011 04:09:00
198
2
Html5 audio tag flash fall back
How do you implement a flash fallback for an html5 audio tag? for example I have this audio tag <div class = "div.jp-audio"><audio class ="audio-player" name= "audio-player" src="song.mp3" ></audio></div> How do I enable or create a flash fall back since not all browsers support .mp3 files
flash
html5
audio
null
null
null
open
Html5 audio tag flash fall back === How do you implement a flash fallback for an html5 audio tag? for example I have this audio tag <div class = "div.jp-audio"><audio class ="audio-player" name= "audio-player" src="song.mp3" ></audio></div> How do I enable or create a flash fall back since not all browsers support .mp3 files
0
10,186,318
04/17/2012 06:36:41
924,962
09/02/2011 09:08:06
330
3
What is the best GUI builder for swing
I am using Netbeans IDE for creating my swing GUIs but most of the time I face hard to create a good looking GUI by dragging swing components around. I've heard that some people suggest building swing GUI by coding is it true? or are there any better GUI builders for swing?
java
swing
gui
null
null
04/18/2012 12:11:51
not constructive
What is the best GUI builder for swing === I am using Netbeans IDE for creating my swing GUIs but most of the time I face hard to create a good looking GUI by dragging swing components around. I've heard that some people suggest building swing GUI by coding is it true? or are there any better GUI builders for swing?
4
9,953,389
03/31/2012 05:50:37
917,368
08/29/2011 07:29:35
28
3
Android - failed to get external IP
I followed this link http://stackoverflow.com/questions/6077555/android-get-external-ip . I am connecting to this website http://www.whatismyip.org/ to get my IP address, however, it keep returning a length of -1. Any idea why? I am able to open up this site using my browser and it returns my external IP. I am unable to use other websites as they return a proxy IP or some other IP...
android
ip
null
null
null
04/01/2012 05:54:45
off topic
Android - failed to get external IP === I followed this link http://stackoverflow.com/questions/6077555/android-get-external-ip . I am connecting to this website http://www.whatismyip.org/ to get my IP address, however, it keep returning a length of -1. Any idea why? I am able to open up this site using my browser and it returns my external IP. I am unable to use other websites as they return a proxy IP or some other IP...
2
8,601,669
12/22/2011 09:17:23
1,110,202
12/21/2011 16:00:43
1
1
Removing all spaces on $input files
Just want to remove the spaces of the input file (or the file selected when I browse the files on my computer).
php
remove
space
null
null
12/22/2011 09:57:27
not a real question
Removing all spaces on $input files === Just want to remove the spaces of the input file (or the file selected when I browse the files on my computer).
1
8,887,304
01/16/2012 22:38:58
1,053,178
11/18/2011 05:34:32
65
1
Export Fbx from Blender To Unity
I have a complete blender file which has an animated character with two actions and I want to export it as an fbx so i can view it in unity. I did it and for some reason it is only exporting my actions and not the mesh or camera or anything else only exports the actions. Why is it not exporting my mesh I have everything selected and i have apply modifiers and include animation selected. Thanks for the help
animation
export
unity
blender
fbx
null
open
Export Fbx from Blender To Unity === I have a complete blender file which has an animated character with two actions and I want to export it as an fbx so i can view it in unity. I did it and for some reason it is only exporting my actions and not the mesh or camera or anything else only exports the actions. Why is it not exporting my mesh I have everything selected and i have apply modifiers and include animation selected. Thanks for the help
0
8,122,147
11/14/2011 13:15:37
1,031,915
11/06/2011 06:43:37
3
0
Can this javascript code be optimised?
If the current page URL has an argument 'myid1' or 'myid2' in the querystring, for each link in my webpage with class 'rewrite', I want the link href's querystring to be replaced by the current page URL's querystring. I'm using the code given below. Since I'm new to javascript, I'm not sure if its optimized. I want it to execute as fast as possible. Please help. Thanks in advance :) <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script> <script type="text/javascript"> $(function() { var requestid = gup('myid1'); if (requestid) { $("a.rewrite").each(function() { var base = this.href; var pos = base.indexOf("?"); if (pos != -1) { base = base.substr(0, pos); } this.href = base + "?myid1=" + requestid; }) } var requestid2 = gup('myid2'); if (requestid2) { $("a.rewrite").each(function() { var base = this.href; var pos = base.indexOf("?"); if (pos != -1) { base = base.substr(0, pos); } this.href = base + "?myid2=" + requestid2; }) } }) function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } </script> <a href="http://www.website.com/?someid=1234" class="rewrite">Hyperlink</a>
javascript
jquery
html
css
query
11/14/2011 13:20:59
off topic
Can this javascript code be optimised? === If the current page URL has an argument 'myid1' or 'myid2' in the querystring, for each link in my webpage with class 'rewrite', I want the link href's querystring to be replaced by the current page URL's querystring. I'm using the code given below. Since I'm new to javascript, I'm not sure if its optimized. I want it to execute as fast as possible. Please help. Thanks in advance :) <script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js'></script> <script type="text/javascript"> $(function() { var requestid = gup('myid1'); if (requestid) { $("a.rewrite").each(function() { var base = this.href; var pos = base.indexOf("?"); if (pos != -1) { base = base.substr(0, pos); } this.href = base + "?myid1=" + requestid; }) } var requestid2 = gup('myid2'); if (requestid2) { $("a.rewrite").each(function() { var base = this.href; var pos = base.indexOf("?"); if (pos != -1) { base = base.substr(0, pos); } this.href = base + "?myid2=" + requestid2; }) } }) function gup( name ) { name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]"); var regexS = "[\\?&]"+name+"=([^&#]*)"; var regex = new RegExp( regexS ); var results = regex.exec( window.location.href ); if( results == null ) return ""; else return results[1]; } </script> <a href="http://www.website.com/?someid=1234" class="rewrite">Hyperlink</a>
2
6,269,403
06/07/2011 17:42:22
787,842
06/07/2011 16:21:25
1
0
Suitable file format and tool for 3d modeling pipeline
I'm working on a modeling/reconstruction algorithm for point cloud data. So far I've been developing in Python, and been relatively happy with VPython for my visualization needs. One problem I have is that VPython becomes quite slow when rendering a great many objects (at least on my non-3d accelerated Linux laptop), making visual inspection of complicated models quite difficult. I've been trying to use an external tool for visualization, but the problem is that I'm a bit lost in the sea of possible file formats and available tools. I've been trying MeshLab for instance, which works great for displaying point cloud data in simple ascii formats, but I couldn't decide in which compatible format to export my other types of geometry, to superimpose on the point cloud layer. Here are the requirements for my whole pipeline: - The point cloud data may contain millions of points, stored as simple xyz ascii coords - The modeling primitives are primarily lines and cylinders (i.e. no polygons), numbered in the thousands - The visualization tool should ideally be cross-platform (it must run at least on Linux) - There should be a Python module for easy data import/export of the chosen file format (or the format is simple enough to write a simple converter, if not) I've been googling a lot about this so I have tentative answers for all of these, but none that is 100% satisfying in my context. Any help or advice would be greatly appreciated.. many thanks in advance!
python
3d
file-format
point-clouds
null
null
open
Suitable file format and tool for 3d modeling pipeline === I'm working on a modeling/reconstruction algorithm for point cloud data. So far I've been developing in Python, and been relatively happy with VPython for my visualization needs. One problem I have is that VPython becomes quite slow when rendering a great many objects (at least on my non-3d accelerated Linux laptop), making visual inspection of complicated models quite difficult. I've been trying to use an external tool for visualization, but the problem is that I'm a bit lost in the sea of possible file formats and available tools. I've been trying MeshLab for instance, which works great for displaying point cloud data in simple ascii formats, but I couldn't decide in which compatible format to export my other types of geometry, to superimpose on the point cloud layer. Here are the requirements for my whole pipeline: - The point cloud data may contain millions of points, stored as simple xyz ascii coords - The modeling primitives are primarily lines and cylinders (i.e. no polygons), numbered in the thousands - The visualization tool should ideally be cross-platform (it must run at least on Linux) - There should be a Python module for easy data import/export of the chosen file format (or the format is simple enough to write a simple converter, if not) I've been googling a lot about this so I have tentative answers for all of these, but none that is 100% satisfying in my context. Any help or advice would be greatly appreciated.. many thanks in advance!
0
9,589,038
03/06/2012 17:43:34
300,233
03/23/2010 19:01:29
102
2
WCF: Per-Call sessions timeout
I've got a WCF service with the instance context mode set to PerCall, and using the wsHttpBinding. A poorly coded client has the ability to consume sessions without properly releasing them (ie the client doesn't call Close() on the client proxy). By looking at the "Percent of Max Concurrent Sessions" performance counter, I can see that each connection uses up a session, and doesn't release it. Under normal, well-behaved circumstances, the session is only used for a few moments while the results of the call are returned. I've been trying to find a way to get these bad sessions to timeout and go away, but have been unsuccessful. Since it's not a reliable session, the RecieveTimeout and InactivityTimeout settings do not appear to have any effect. Here's a portion of my current config, which has a number of timeouts set in it, but does not seem to work: <behaviors> <serviceBehaviors> <behavior name="UpdaterBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"/> <serviceCertificate findValue="xxxxxx" x509FindType="FindBySubjectName"/> </serviceCredentials> <serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="SqlRoleProvider"/> <serviceThrottling maxConcurrentCalls="10" maxConcurrentSessions="10" maxConcurrentInstances="10" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="UpdaterBinding" messageEncoding="Mtom" maxReceivedMessageSize="100000000" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"> <reliableSession ordered="true" inactivityTimeout="00:01:00" enabled="false" /> <readerQuotas maxArrayLength="100000000"/> <security> <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBinding> </bindings> I can set the serviceThrottling numbers much higher, but that just hides the problem for a while, and eventually a bad client would use all the sessions up. I want the server to free up any session that's been around for more than a few minutes, since there's no reason anything on this service should take that long. Any suggestions?
wcf
null
null
null
null
null
open
WCF: Per-Call sessions timeout === I've got a WCF service with the instance context mode set to PerCall, and using the wsHttpBinding. A poorly coded client has the ability to consume sessions without properly releasing them (ie the client doesn't call Close() on the client proxy). By looking at the "Percent of Max Concurrent Sessions" performance counter, I can see that each connection uses up a session, and doesn't release it. Under normal, well-behaved circumstances, the session is only used for a few moments while the results of the call are returned. I've been trying to find a way to get these bad sessions to timeout and go away, but have been unsuccessful. Since it's not a reliable session, the RecieveTimeout and InactivityTimeout settings do not appear to have any effect. Here's a portion of my current config, which has a number of timeouts set in it, but does not seem to work: <behaviors> <serviceBehaviors> <behavior name="UpdaterBehavior"> <serviceMetadata httpGetEnabled="true"/> <serviceCredentials> <userNameAuthentication userNamePasswordValidationMode="MembershipProvider"/> <serviceCertificate findValue="xxxxxx" x509FindType="FindBySubjectName"/> </serviceCredentials> <serviceAuthorization principalPermissionMode="UseAspNetRoles" roleProviderName="SqlRoleProvider"/> <serviceThrottling maxConcurrentCalls="10" maxConcurrentSessions="10" maxConcurrentInstances="10" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <wsHttpBinding> <binding name="UpdaterBinding" messageEncoding="Mtom" maxReceivedMessageSize="100000000" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:01:00" sendTimeout="00:01:00"> <reliableSession ordered="true" inactivityTimeout="00:01:00" enabled="false" /> <readerQuotas maxArrayLength="100000000"/> <security> <message clientCredentialType="UserName"/> </security> </binding> </wsHttpBinding> </bindings> I can set the serviceThrottling numbers much higher, but that just hides the problem for a while, and eventually a bad client would use all the sessions up. I want the server to free up any session that's been around for more than a few minutes, since there's no reason anything on this service should take that long. Any suggestions?
0
8,372,697
12/04/2011 02:07:20
540,245
12/13/2010 08:14:12
1,063
95
Is using css classesfor js markup a bad practice?
**The scenario:** - A homepage that is generated with PHP and a template engine. - The page is being redesigned. - The new design is based on JQuerry UI. - The current CMS uses multiple templates: A page template, a article details templates, a comments templates, ... **The problem:** Some templates (like the article details template) generate html fragments that should use jquerry ui elements like tabs. Currently the datasource of the page template does not contain any information which elements should be turned into jquery ui elements in the main jquery call in the documents head. **Possible sollution** Add a css class like "jqTabs" to the html markup of the sub-templates and use the selector ".jqTabs" in the main juerry script. **Question** Is this a bad idea? BTW: "Use a different CMS" is not a valid answer, because this is **not** an option right now (deadline, budget,... you name it -.- ).
php
javascript
jquery
css
null
null
open
Is using css classesfor js markup a bad practice? === **The scenario:** - A homepage that is generated with PHP and a template engine. - The page is being redesigned. - The new design is based on JQuerry UI. - The current CMS uses multiple templates: A page template, a article details templates, a comments templates, ... **The problem:** Some templates (like the article details template) generate html fragments that should use jquerry ui elements like tabs. Currently the datasource of the page template does not contain any information which elements should be turned into jquery ui elements in the main jquery call in the documents head. **Possible sollution** Add a css class like "jqTabs" to the html markup of the sub-templates and use the selector ".jqTabs" in the main juerry script. **Question** Is this a bad idea? BTW: "Use a different CMS" is not a valid answer, because this is **not** an option right now (deadline, budget,... you name it -.- ).
0
8,512,486
12/14/2011 22:16:28
564,089
01/05/2011 14:51:33
1
1
Best/simplest media framework for java
I'm going to make a really really simple program in java. The program is just going to display a video running fullscreen in an eternal loop, and do a playback of a soundfile on a mousebutton event. The problem is that I dont't seem to find an easy way to just play a videofile in java. Most of the frameworks seem old. What framework would you suggest?
java
frameworks
media
null
null
null
open
Best/simplest media framework for java === I'm going to make a really really simple program in java. The program is just going to display a video running fullscreen in an eternal loop, and do a playback of a soundfile on a mousebutton event. The problem is that I dont't seem to find an easy way to just play a videofile in java. Most of the frameworks seem old. What framework would you suggest?
0
2,972,949
06/04/2010 09:41:23
339,500
05/12/2010 15:56:53
1
1
Windows Phone 7 without db support
I'm disappointed in seeing that no DB support has been added to the new MS mobile platform ... what do they think about great and full Sqlite integration in iPhone and/or Android?? I think that in a mobile app a local db is a good good thing.
windows-mobile
microsoft
null
null
null
07/18/2012 02:31:28
not a real question
Windows Phone 7 without db support === I'm disappointed in seeing that no DB support has been added to the new MS mobile platform ... what do they think about great and full Sqlite integration in iPhone and/or Android?? I think that in a mobile app a local db is a good good thing.
1
10,072,851
04/09/2012 11:58:31
1,321,797
04/09/2012 11:53:56
1
0
CAKeyFrameAnimation with path color
I am able to add a path and able to move the pointerImage along with that path, but i want to draw the path also along with the pointer path. Suppose, pointerImage moves to x=0 to x=100, i want to draw the path with a color, please give me some valuable guidance. pointerImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pointer.png"]]; pointerImage.frame = CGRectMake(550, 300, 60, 60); [self.view addSubview:pointerImage]; CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; pathAnimation.duration = 10.0f; pathAnimation.delegate = self; pathAnimation.calculationMode = kCAAnimationPaced; pathAnimation.fillMode = kCAFillModeForwards; pathAnimation.removedOnCompletion = NO; CGMutablePathRef pointPath = CGPathCreateMutable(); CGPathMoveToPoint(pointPath, NULL, pointerImage.frame.origin.x, pointerImage.frame.origin.y); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +68, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +132, pointerImage.frame.origin.y+28); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +205, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +286, pointerImage.frame.origin.y+28); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +355, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +422, pointerImage.frame.origin.y+28); pathAnimation.path = pointPath; CGPathRelease(pointPath); [pointerImage.layer addAnimation:pathAnimation forKey:@"pathAnimation"];
cakeyframeanimation
null
null
null
null
null
open
CAKeyFrameAnimation with path color === I am able to add a path and able to move the pointerImage along with that path, but i want to draw the path also along with the pointer path. Suppose, pointerImage moves to x=0 to x=100, i want to draw the path with a color, please give me some valuable guidance. pointerImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Pointer.png"]]; pointerImage.frame = CGRectMake(550, 300, 60, 60); [self.view addSubview:pointerImage]; CAKeyframeAnimation *pathAnimation = [CAKeyframeAnimation animationWithKeyPath:@"position"]; pathAnimation.duration = 10.0f; pathAnimation.delegate = self; pathAnimation.calculationMode = kCAAnimationPaced; pathAnimation.fillMode = kCAFillModeForwards; pathAnimation.removedOnCompletion = NO; CGMutablePathRef pointPath = CGPathCreateMutable(); CGPathMoveToPoint(pointPath, NULL, pointerImage.frame.origin.x, pointerImage.frame.origin.y); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +68, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +132, pointerImage.frame.origin.y+28); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +205, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +286, pointerImage.frame.origin.y+28); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +355, pointerImage.frame.origin.y-100); CGPathAddLineToPoint(pointPath, NULL, pointerImage.frame.origin.x +422, pointerImage.frame.origin.y+28); pathAnimation.path = pointPath; CGPathRelease(pointPath); [pointerImage.layer addAnimation:pathAnimation forKey:@"pathAnimation"];
0
8,323,358
11/30/2011 09:02:54
1,027,348
11/03/2011 09:36:48
80
4
BitmapSource.Create fails sometimes
I am trying to convert picture(JPEG , BitmapFrame) into the byte array of pixels and later to construct it back with the help of BitmapSource.Create. I am astonished becouse the same code works perfect for some pictures and fail to other. The ONLY difference i found - that at problem pictures pic.PixelHeight != pic.Height and pic.PixelWidth != pic.Width. But I thought there is no problem. Could any one help me?
c#
wpf
null
null
null
11/30/2011 15:11:14
not a real question
BitmapSource.Create fails sometimes === I am trying to convert picture(JPEG , BitmapFrame) into the byte array of pixels and later to construct it back with the help of BitmapSource.Create. I am astonished becouse the same code works perfect for some pictures and fail to other. The ONLY difference i found - that at problem pictures pic.PixelHeight != pic.Height and pic.PixelWidth != pic.Width. But I thought there is no problem. Could any one help me?
1
1,345,485
08/28/2009 07:08:40
2,260
08/21/2008 11:39:22
3,672
165
How to quickly (easy to script) preview 3D vectors / lines?
I am busy reading 3D building models from a tool and thus generating a bunch of `Line(p1, p2)` objects, each consisting of two `Point(x, y, z)` objects. I would like to display these things in a simple 3D viewer, kind of like SVG (which, as I understand, only supports 2D). The reading is done in Python, specifically IronPython. I could use either a .NET viewer library or write out a text/xml/whatnot file with the data to be displayed by manually opening the result in the appropriate program. What format / tool would you use to view the data? (At the moment, this is only for debugging purposes, so it doesn't have to be top-notch. Just a wire-frame will do!) I did check the mathplot library, but that seems to only plot functions...
3d
python
ironpython
.net
null
null
open
How to quickly (easy to script) preview 3D vectors / lines? === I am busy reading 3D building models from a tool and thus generating a bunch of `Line(p1, p2)` objects, each consisting of two `Point(x, y, z)` objects. I would like to display these things in a simple 3D viewer, kind of like SVG (which, as I understand, only supports 2D). The reading is done in Python, specifically IronPython. I could use either a .NET viewer library or write out a text/xml/whatnot file with the data to be displayed by manually opening the result in the appropriate program. What format / tool would you use to view the data? (At the moment, this is only for debugging purposes, so it doesn't have to be top-notch. Just a wire-frame will do!) I did check the mathplot library, but that seems to only plot functions...
0
1,766,836
11/19/2009 21:53:02
17,324
09/18/2008 06:45:00
357
13
Method of simulating views on a SQL Server with read-only access?
I'm trying to do quite a lot of querying against a Microsoft SQL Server that I only have read only access to. My queries are needing to work with the data in very different structure from how the DB architecture is. Since I only have read access, I can't create views, so I'm looking for a solution. What I'm currently doing is using complex queries to return the results as I need them, but this is 4-5 table joins with subqueries. It is rediculously slow and resource intensive. I can see two solutions, but would love to hear about anything I might have missed: - Use some sort of "proxy" that caches the data, and creates views around it. This would need some sort of method to determine the dirtiness of the data. (is there something like this?) - run my own SQL server, and mirror the data from the source SQL server every X minutes, and then load views on my SQL server. Any other ideas? or recommendations on these ideas? Thanks!
sql-server
sql
c#
database
microsoft
null
open
Method of simulating views on a SQL Server with read-only access? === I'm trying to do quite a lot of querying against a Microsoft SQL Server that I only have read only access to. My queries are needing to work with the data in very different structure from how the DB architecture is. Since I only have read access, I can't create views, so I'm looking for a solution. What I'm currently doing is using complex queries to return the results as I need them, but this is 4-5 table joins with subqueries. It is rediculously slow and resource intensive. I can see two solutions, but would love to hear about anything I might have missed: - Use some sort of "proxy" that caches the data, and creates views around it. This would need some sort of method to determine the dirtiness of the data. (is there something like this?) - run my own SQL server, and mirror the data from the source SQL server every X minutes, and then load views on my SQL server. Any other ideas? or recommendations on these ideas? Thanks!
0
4,649,043
01/10/2011 16:34:06
570,105
01/10/2011 16:34:06
1
0
Need advice for Clojure and Scala
I need advice what to learn Lisp or Clojure or Scala based on your opinion for more perspective job in future. Any advice ?
scala
clojure
lisp
common-lisp
null
01/10/2011 17:17:09
not a real question
Need advice for Clojure and Scala === I need advice what to learn Lisp or Clojure or Scala based on your opinion for more perspective job in future. Any advice ?
1
3,101,611
06/23/2010 12:36:54
374,219
06/23/2010 12:36:54
1
0
how to get image size in jQuery that img tag is created dynamically in between div tag?
is there anyone please help me its argent............ :)
jquery
null
null
null
null
10/21/2011 20:15:07
not a real question
how to get image size in jQuery that img tag is created dynamically in between div tag? === is there anyone please help me its argent............ :)
1
6,635,542
07/09/2011 15:04:51
836,808
07/09/2011 15:04:51
1
0
Null pointer exception with FileReader.
ok. So I get a wierd null pointer exception when I try to do FileReader fr = new FileReader(path); Here is the call from the main method: public static void main(String[] args) throws IOException { String rentPath = "C:\\RentPaid.txt"; try { ReadFiles file = new ReadFiles (rentPath); System.out.println("Will this work?"); String[] aryLines = file.OpenFile(); int i; for (i=0; i < aryLines.length; i++) { System.out.println(aryLines[i]); } } catch (IOException e) { System.out.println(e.getMessage()); } } And here is the actual OpenFile method that I am calling. I will put ****Error**** where I believe where the error is. I will explain this later when I post the output from the program. public String[] OpenFile() throws IOException { System.out.println("Does it work at all?"); FileReader fr = new FileReader(path); ****Error**** System.out.println("Is is a problem with bufferedreader?"); BufferedReader textReader = new BufferedReader(fr); System.out.println("Is is a problem with readlines()?"); int numberOfLines = readLines(); String[] textData = new String[numberOfLines]; int i = 0; while (i < numberOfLines) { textData[i] = textReader.readLine(); i++; } System.out.println("Open File"); textReader.close(); return textData; } And Finally we have the output of the program. run: Constructor Will this work? Exception in thread "main" java.lang.NullPointerException Does it work at all? at java.io.FileInputStream.<init>(FileInputStream.java:116) at java.io.FileInputStream.<init>(FileInputStream.java:79) at java.io.FileReader.<init>(FileReader.java:41) at budget.calculator.ReadFiles.OpenFile(ReadFiles.java:18) at budget.calculator.BudgetCalculator.main(BudgetCalculator.java:22) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds) I think that the problem is the FileReader fr = new FileReader(path); because I have played with it and I've played with the call and I cannot get it to work, but the timing of the error suggests that it is the call. I dunno. Any help would be appreciated.
java
filereader
null
null
null
null
open
Null pointer exception with FileReader. === ok. So I get a wierd null pointer exception when I try to do FileReader fr = new FileReader(path); Here is the call from the main method: public static void main(String[] args) throws IOException { String rentPath = "C:\\RentPaid.txt"; try { ReadFiles file = new ReadFiles (rentPath); System.out.println("Will this work?"); String[] aryLines = file.OpenFile(); int i; for (i=0; i < aryLines.length; i++) { System.out.println(aryLines[i]); } } catch (IOException e) { System.out.println(e.getMessage()); } } And here is the actual OpenFile method that I am calling. I will put ****Error**** where I believe where the error is. I will explain this later when I post the output from the program. public String[] OpenFile() throws IOException { System.out.println("Does it work at all?"); FileReader fr = new FileReader(path); ****Error**** System.out.println("Is is a problem with bufferedreader?"); BufferedReader textReader = new BufferedReader(fr); System.out.println("Is is a problem with readlines()?"); int numberOfLines = readLines(); String[] textData = new String[numberOfLines]; int i = 0; while (i < numberOfLines) { textData[i] = textReader.readLine(); i++; } System.out.println("Open File"); textReader.close(); return textData; } And Finally we have the output of the program. run: Constructor Will this work? Exception in thread "main" java.lang.NullPointerException Does it work at all? at java.io.FileInputStream.<init>(FileInputStream.java:116) at java.io.FileInputStream.<init>(FileInputStream.java:79) at java.io.FileReader.<init>(FileReader.java:41) at budget.calculator.ReadFiles.OpenFile(ReadFiles.java:18) at budget.calculator.BudgetCalculator.main(BudgetCalculator.java:22) Java Result: 1 BUILD SUCCESSFUL (total time: 0 seconds) I think that the problem is the FileReader fr = new FileReader(path); because I have played with it and I've played with the call and I cannot get it to work, but the timing of the error suggests that it is the call. I dunno. Any help would be appreciated.
0
10,858,769
06/02/2012 00:06:35
1,431,777
06/01/2012 23:49:58
1
0
Dynamic drop-down lists in Perl
I'm new to web programming, but recently I've been given some scripting assignments as part of a summer internship. I've been working with Perl to create CGI scripts for my employer's internal website, mainly to be used by the developers there (non-critical). The problem I am currently working on is generating reports based on a chosen directory on the server. The user should be able to choose an option from a drop-down box, and in turn, another drop-down box should have sub-options. These must be dynamic; if the first box is changed, the options in the second must be re-generated. Can Perl achieve this? Would PHP or JavaScript be a better tool to solve this?
php
javascript
perl
forms
dynamic
06/04/2012 18:57:40
not constructive
Dynamic drop-down lists in Perl === I'm new to web programming, but recently I've been given some scripting assignments as part of a summer internship. I've been working with Perl to create CGI scripts for my employer's internal website, mainly to be used by the developers there (non-critical). The problem I am currently working on is generating reports based on a chosen directory on the server. The user should be able to choose an option from a drop-down box, and in turn, another drop-down box should have sub-options. These must be dynamic; if the first box is changed, the options in the second must be re-generated. Can Perl achieve this? Would PHP or JavaScript be a better tool to solve this?
4
4,118,118
11/07/2010 14:21:25
274,299
02/16/2010 11:16:32
731
36
erlang application
Now i learn erlang and i have question about kind of running and testing erlang applications. We have some views of running and test erlang program: 1. We can run erlang shell and test in there our function 2. We can compile some files with our erlang code, than create .app file, and than again run erlang shell and call application:start(AppName) My question: Can we make binary executable file from erlang code? Like C code. What would i can run programm in erlang without erlang shell. That's i run program, input something command and after that calls anything erlang functions for this command? Thank you.
application
erlang
null
null
null
null
open
erlang application === Now i learn erlang and i have question about kind of running and testing erlang applications. We have some views of running and test erlang program: 1. We can run erlang shell and test in there our function 2. We can compile some files with our erlang code, than create .app file, and than again run erlang shell and call application:start(AppName) My question: Can we make binary executable file from erlang code? Like C code. What would i can run programm in erlang without erlang shell. That's i run program, input something command and after that calls anything erlang functions for this command? Thank you.
0
84,132
09/17/2008 14:56:58
13,030
09/16/2008 16:43:20
21
1
Uninstall Sharepoint Infrastructure Update
I installed WSS Infrastructure Update and MOSS Infrastructure Update (http://technet.microsoft.com/en-us/office/sharepointserver/bb735839.aspx) and now I can't restore the content database on an older version. Do you know if there is a way to uninstall it ?
sharepoint
moss
wss
null
null
03/27/2012 16:14:06
off topic
Uninstall Sharepoint Infrastructure Update === I installed WSS Infrastructure Update and MOSS Infrastructure Update (http://technet.microsoft.com/en-us/office/sharepointserver/bb735839.aspx) and now I can't restore the content database on an older version. Do you know if there is a way to uninstall it ?
2
6,359,332
06/15/2011 14:28:39
786,045
06/06/2011 14:02:17
11
0
New to Maven and Git - need help
I'm new to both maven and git and wanted to get some help in setting a project. Is there a way to define a goal in the pom to push/pull from git during linked to a maven phase? For example, can I pull from git during the maven install phase? If yes, how can that be accomplished? I would appreciate any code examples. Thanks.
git
maven
pom
pom.xml
maven-scm
null
open
New to Maven and Git - need help === I'm new to both maven and git and wanted to get some help in setting a project. Is there a way to define a goal in the pom to push/pull from git during linked to a maven phase? For example, can I pull from git during the maven install phase? If yes, how can that be accomplished? I would appreciate any code examples. Thanks.
0
4,091,070
11/03/2010 19:54:22
147,601
07/30/2009 05:40:08
4,301
29
Windows Phone 7 Loading Widget?
I'm building a wp7 app in Silverlight. Is there some system widget/icon/animation/spinner/etc for when something is loading? Or should I implement my own?
silverlight
windows-phone-7
null
null
null
null
open
Windows Phone 7 Loading Widget? === I'm building a wp7 app in Silverlight. Is there some system widget/icon/animation/spinner/etc for when something is loading? Or should I implement my own?
0
4,358,156
12/05/2010 09:26:05
198,927
10/29/2009 14:01:04
1,277
31
Correlating trialware expiration with date of purchase
It makes intuitive sense that customers who **complete the trial* version** of your software are **more likely** to purchase it, but it cannot be so easily deduced that the converse is true, i.e. that non-finishers are much *less likely* to buy. A potential customer may use your software twice and purchase it immediately, or purchase it much later without ever finishing the trial. However, it would depend on the nature of your software, especially for games and one-use software like importers and converters. Have you, as a software developer, seen any clear correlation between: 1. **Date of first use** or download, 2. **Date of trial expiry** (whether 30 days or 20 uses), which can be inferred from the date of first use if not measured. 3. **Date of purchase** One should also consider the % of buyers who purchased *during* and *after* the trial period. The conclusion drawn from this data would influence the optimal **length of a trial period**, the **extent of crippling** following expiry and the preferred **method of trial limitation**. --- \* fully featured for limited time or uses.
business
trialware
shareware
sales
trial
12/08/2010 01:21:25
off topic
Correlating trialware expiration with date of purchase === It makes intuitive sense that customers who **complete the trial* version** of your software are **more likely** to purchase it, but it cannot be so easily deduced that the converse is true, i.e. that non-finishers are much *less likely* to buy. A potential customer may use your software twice and purchase it immediately, or purchase it much later without ever finishing the trial. However, it would depend on the nature of your software, especially for games and one-use software like importers and converters. Have you, as a software developer, seen any clear correlation between: 1. **Date of first use** or download, 2. **Date of trial expiry** (whether 30 days or 20 uses), which can be inferred from the date of first use if not measured. 3. **Date of purchase** One should also consider the % of buyers who purchased *during* and *after* the trial period. The conclusion drawn from this data would influence the optimal **length of a trial period**, the **extent of crippling** following expiry and the preferred **method of trial limitation**. --- \* fully featured for limited time or uses.
2
6,360,071
06/15/2011 15:17:32
431,582
08/26/2010 07:55:37
57
3
[iphone Dev] productName length cause connection problem
It seems incredible but if I put a productName (not BundleNamethat appears in home screen) longer than 10 chars my app works well except from I'm not able to get response of my connection requets. I mean...for example if I put APPNAME123 in productName I obtain APPNAME123.app and all works fine. If i put APPNAME1234 in productName I obtain APPNAME1234.app and app works except for connections methods...for example if I call www.mydomain.com/example.asp I got no errors, but zero bytes as response!!!! I use NSURLRequest *request=[NSURLRequest requestWithURL:MYURL]; NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; and result is not nil but with zero length while error is nil Of course I tried in various way (both on simulator and device), cleaning and rebuilding project avery time, and of course I tried with other names...same results..if longer than 10 chars I got same problems! I've also created a new project with desired name longer than 10 chars and I got the same problem. That made me crazy for a whole day...because I didn't find a specification for this and the rest of app wiorking good!!! I'd like to know: 1) if anyone else notice this or itis just my problem, maybe some dirty on my mac 2) if there some documentation about this everywhere thanks in advance for your answers
iphone
connection
product
null
null
null
open
[iphone Dev] productName length cause connection problem === It seems incredible but if I put a productName (not BundleNamethat appears in home screen) longer than 10 chars my app works well except from I'm not able to get response of my connection requets. I mean...for example if I put APPNAME123 in productName I obtain APPNAME123.app and all works fine. If i put APPNAME1234 in productName I obtain APPNAME1234.app and app works except for connections methods...for example if I call www.mydomain.com/example.asp I got no errors, but zero bytes as response!!!! I use NSURLRequest *request=[NSURLRequest requestWithURL:MYURL]; NSData *result = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; and result is not nil but with zero length while error is nil Of course I tried in various way (both on simulator and device), cleaning and rebuilding project avery time, and of course I tried with other names...same results..if longer than 10 chars I got same problems! I've also created a new project with desired name longer than 10 chars and I got the same problem. That made me crazy for a whole day...because I didn't find a specification for this and the rest of app wiorking good!!! I'd like to know: 1) if anyone else notice this or itis just my problem, maybe some dirty on my mac 2) if there some documentation about this everywhere thanks in advance for your answers
0
8,532,205
12/16/2011 09:33:51
965,442
09/26/2011 16:30:11
11
0
CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook); count of contact is 0
As it is a daemon app, I think it reads db at /private/var/root/Library/AddressBook/AddressBook.sqlitedb so it gets 0. How can I start the daemon as user mobile ? Or maybe there is something wrong else? I put the code in another app and it gets contacts. Thanks.
iphone
contact
null
null
null
null
open
CFArrayRef results = ABAddressBookCopyArrayOfAllPeople(addressBook); count of contact is 0 === As it is a daemon app, I think it reads db at /private/var/root/Library/AddressBook/AddressBook.sqlitedb so it gets 0. How can I start the daemon as user mobile ? Or maybe there is something wrong else? I put the code in another app and it gets contacts. Thanks.
0
3,476,636
08/13/2010 12:11:09
279,521
02/23/2010 14:04:21
918
31
Pros and Cons related to Pair Programming
Our company has gone through some changes and the new CIO wants to present a case to the other boss about pair programming. I do not have any experience (zip, zero, zilch, nada) with pair programming (which makes this presentation much more FUN). What parts would you highlight in a presentation to upper management? If you have done pair programming, what are the pro's and con's of such an environment? Any personal preferances?
language-agnostic
pair-programming
null
null
null
10/31/2011 14:32:13
not constructive
Pros and Cons related to Pair Programming === Our company has gone through some changes and the new CIO wants to present a case to the other boss about pair programming. I do not have any experience (zip, zero, zilch, nada) with pair programming (which makes this presentation much more FUN). What parts would you highlight in a presentation to upper management? If you have done pair programming, what are the pro's and con's of such an environment? Any personal preferances?
4
4,896,624
02/04/2011 09:53:17
602,930
02/04/2011 09:53:17
1
0
Wrapper without underlying source code, is it possible?
Wrapper without underlying source code, is it possible? I have a program that runs on Windows XP and I want to operate it with a Iphone app. I do not want to see the underlying program as it is not user friendly. Is this possible. It is a very small program.
source-code
wrapper
null
null
null
02/09/2011 01:11:15
not a real question
Wrapper without underlying source code, is it possible? === Wrapper without underlying source code, is it possible? I have a program that runs on Windows XP and I want to operate it with a Iphone app. I do not want to see the underlying program as it is not user friendly. Is this possible. It is a very small program.
1
2,358,228
03/01/2010 18:51:37
157,416
08/16/2009 20:11:22
111
3
Good resource or Book for Internet Start-Ups
Which will cover issues like, things I will need to know in advance, technical difficulties, how to scale/deal with increased load, marketing strategies even?! etc etc. I love [Getting Real][1] by 37signals, your favorites? [1]: http://gettingreal.37signals.com/
resources
startup
null
null
null
03/01/2010 21:23:02
off topic
Good resource or Book for Internet Start-Ups === Which will cover issues like, things I will need to know in advance, technical difficulties, how to scale/deal with increased load, marketing strategies even?! etc etc. I love [Getting Real][1] by 37signals, your favorites? [1]: http://gettingreal.37signals.com/
2
10,712,697
05/23/2012 02:26:46
326,089
04/26/2010 14:35:48
290
3
Looking for a better python Google Calendar API example
I am trying to write an application that can add events to a google calendar. There is this really neat site that lets you play with the API. http://code.google.com/apis/explorer/#_s=calendar&_v=v3&_m=events.insert Using that site, I was able to build a calendar event using the following stuff. I am having difficulty translating that into python. How do I do this with python code? Can anyone provide an example of how to accomplish the same thing with the Python API? Many Thanks! POST https://www.googleapis.com/calendar/v3/calendars/my_calendar_id_string/events?pp=1&key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.ANOTHERBIGSLONGTRINGHEREFfxCTiKMIR_bDui X-JavaScript-User-Agent: Google APIs Explorer { "start": { "dateTime": "2012-05-24T14:00:00-06:00" }, "end": { "dateTime": "2012-05-24T18:00:00-06:00" }, "description": "My Description" }
python
google
google-api
null
null
null
open
Looking for a better python Google Calendar API example === I am trying to write an application that can add events to a google calendar. There is this really neat site that lets you play with the API. http://code.google.com/apis/explorer/#_s=calendar&_v=v3&_m=events.insert Using that site, I was able to build a calendar event using the following stuff. I am having difficulty translating that into python. How do I do this with python code? Can anyone provide an example of how to accomplish the same thing with the Python API? Many Thanks! POST https://www.googleapis.com/calendar/v3/calendars/my_calendar_id_string/events?pp=1&key={YOUR_API_KEY} Content-Type: application/json Authorization: Bearer ya29.ANOTHERBIGSLONGTRINGHEREFfxCTiKMIR_bDui X-JavaScript-User-Agent: Google APIs Explorer { "start": { "dateTime": "2012-05-24T14:00:00-06:00" }, "end": { "dateTime": "2012-05-24T18:00:00-06:00" }, "description": "My Description" }
0
2,633,341
04/13/2010 21:25:27
315,924
04/13/2010 21:25:27
1
0
Multimedia files written over WAN are getting truncated
I use the windows Multimedia API to create .wav files. 1. Open file with mmsioOpen 2. Creates WAVE,frm and data chunks using mmioCreateChunk 3. Write audio data using mmioWrite 4. Ascend out of the chunks using mmioAscend 5. Close file using mmioClose The file is being written into a temporary location, so after it has been closed it gets copied to another location using the CopyFile. This program is written in C++ and works great until the file it is writing resides over a WAN in a different city or country. The end result is a wav file that should be 20-30 seconds long ends up being 4 secodns long. It is always the last bit that is missing, so when you play it back it just stops before then of the recording. I initially thought that maybe I was copying the file too soon so as a test I put in a pause of 30 seconds after closing the file using Sleep(30000), but this made no difference to either it being truncated or by how much. Does anyone have any ideas why this is happening and if there is a work-around to it? I suspect that I may end up having the temporary location on the local drive, but this is quite a big change to the application as well as existing deployments. thanks for everyones time Dean
windows
multimedia
networking
null
null
null
open
Multimedia files written over WAN are getting truncated === I use the windows Multimedia API to create .wav files. 1. Open file with mmsioOpen 2. Creates WAVE,frm and data chunks using mmioCreateChunk 3. Write audio data using mmioWrite 4. Ascend out of the chunks using mmioAscend 5. Close file using mmioClose The file is being written into a temporary location, so after it has been closed it gets copied to another location using the CopyFile. This program is written in C++ and works great until the file it is writing resides over a WAN in a different city or country. The end result is a wav file that should be 20-30 seconds long ends up being 4 secodns long. It is always the last bit that is missing, so when you play it back it just stops before then of the recording. I initially thought that maybe I was copying the file too soon so as a test I put in a pause of 30 seconds after closing the file using Sleep(30000), but this made no difference to either it being truncated or by how much. Does anyone have any ideas why this is happening and if there is a work-around to it? I suspect that I may end up having the temporary location on the local drive, but this is quite a big change to the application as well as existing deployments. thanks for everyones time Dean
0
9,033,760
01/27/2012 13:14:10
241,590
12/31/2009 15:22:26
19,917
978
How can I count records only once within a time range?
I have table with statistical data. I'm trying to count the records grouped by a version, the problem is that the records have another criteria (ref) and should counted only once (per ref). stats sample data to illustrate the issue: id stat_date ref version ------------------------- 1 2012-01-25 1 A 2 2012-01-25 2 B 3 2012-01-25 3 B 4 2012-01-26 8 B 5 2012-01-26 2 B 6 2012-01-26 3 B Simple counting would return SELECT COUNT(*),version FROM stat GROUP BY version 1,A 5,B The problem here is that only the last record with ref=3 (id=6) should be counted and (id=3) has to be ignored. So the question is, how can I filter row (id=3) from the query? I can't figure out what I should insert as condition in the subquery SELECT COUNT(*),version FROM stats WHERE stat_date BETWEEN "2012-01-25" AND "2012-01-26" AND id = (SELECT MAX(id) FROM stats WHERE <condition>) GROUP BY 2
mysql
sql
database
null
null
null
open
How can I count records only once within a time range? === I have table with statistical data. I'm trying to count the records grouped by a version, the problem is that the records have another criteria (ref) and should counted only once (per ref). stats sample data to illustrate the issue: id stat_date ref version ------------------------- 1 2012-01-25 1 A 2 2012-01-25 2 B 3 2012-01-25 3 B 4 2012-01-26 8 B 5 2012-01-26 2 B 6 2012-01-26 3 B Simple counting would return SELECT COUNT(*),version FROM stat GROUP BY version 1,A 5,B The problem here is that only the last record with ref=3 (id=6) should be counted and (id=3) has to be ignored. So the question is, how can I filter row (id=3) from the query? I can't figure out what I should insert as condition in the subquery SELECT COUNT(*),version FROM stats WHERE stat_date BETWEEN "2012-01-25" AND "2012-01-26" AND id = (SELECT MAX(id) FROM stats WHERE <condition>) GROUP BY 2
0
3,912,920
10/12/2010 08:51:06
468,722
10/07/2010 05:19:32
6
0
Tell me some famous javascript libraries.
Tell me some famous javascript libraries.
javascript
null
null
null
null
10/12/2010 08:54:06
not a real question
Tell me some famous javascript libraries. === Tell me some famous javascript libraries.
1
10,024,586
04/05/2012 07:46:59
929,560
09/05/2011 21:01:55
27
0
Does anyone have the source code for the XNA Winforms Series 1 sample?
The XNA creators site is apparently down for maintenance right now, but I could really use that code now. The site where one would go to download it seems to be here: http://create.msdn.com/sample/winforms_series1 That site currently throws a 404. Any help would be greatly appreciated!
c#
winforms
xna
null
null
04/05/2012 09:13:34
not a real question
Does anyone have the source code for the XNA Winforms Series 1 sample? === The XNA creators site is apparently down for maintenance right now, but I could really use that code now. The site where one would go to download it seems to be here: http://create.msdn.com/sample/winforms_series1 That site currently throws a 404. Any help would be greatly appreciated!
1
6,082,609
05/21/2011 15:10:18
484,615
10/22/2010 19:42:46
1
0
Rail's 'Gotchas' and learning curve - will ever stop?
I've been developing a new rails project for a few weeks, and while I am amazed at the awesome plugins and some of the really great features in the frameworks... I am a little disappointed too. And I am worried. I think I made a mistake. Should I press on, or go back to what I was familiar with? (Java/Spring) 1. It seems that unless you are looking for "simple examples", googling for the exceptions to the rule, special cases and so on really hampers productivity and is increasingly becoming the norm for me. 2. Documentation and examples from the main site, blogs, screencasts, etc. are mostly out of date. For ever 5-10 examples that are out there, 1 of them is actually correct. 3. Doing anything new that should "just work" almost never does. I try and following documentation and examples, but my results seem to vary and I discover problems never mentioned in the documentation and examples. This seems to happen all the time actually. 4. My experience with trying out CoffeeCode and it's integration with Rails was a disaster. Not being able to see what the problem is whenever a "compiler error" occurs is beyond frustrating. 5. ActiveRelation is really awesome, until you need to make a query that joins 7 tables. Then it starts to break down. I think it's possible that you can get that 7-table join query done in Hibernate quicker and finished reliably the first time you are learning it. 6. Testing is actually really hard in Rails. There's just too much "Magic" going on. Since Ruby is dynamic, I have no idea what I need to call to test something appropriately. There always seems to be exceptions to the rule. For example, Devise works like you would expect... until you want to test Devise in helpers. It just won't work, so you have to invent the Devise-generated methods in your tests to make the tests pass. You don't need to do this for controllers. 7. Why does images and stylesheets not work properly when you switch to production for? This is insane. Tons of people ask this if you google it... yet the framework doesn't "just work". 8. For some reason, after adding jquery-rails and devise, the authentication token wasn't getting passed during ajax requests. I had to add the 4 lines of javascript code to make it work. This took me 5 hours. In Java, because you have proper sessions, you never even need to think about this type of stuff. 9. Tests run really slow. I have about 780 tests, and it already takes much longer than a Java project which has 1800 tests. 10. Testing the application in the browser is really slow. It takes like 1/4 of a second to render some of the pages... and there isn't even that much ORM action going on! Even for pages with 1 database query, it takes 100-200 milliseconds. This is crazy. 11. Documentation is often out of date. For example, trying to override things in Devise was a pain because the documentation actually told me to do the wrong thing. Only after hours of googling and waiting 48 hours on another forum was I able to have someone tell me what I needed to do. All I wanted to do was have the login form reject a user where User.enabled was false. That's it. It turns out, I was overriding "active?" instead of "active_for_authentication?" - which was an error in the RDoc's. After 2 weeks, the number of "gotchas" hasn't really slowed down. I am really worried and scared. I know Java isn't immune to gotchas and problems, but I generally ran into problems about 2-3 times a month - not 30 in one week. I am almost thinking the lack of agility when using Java/Spring is not much of a burden now when you consider how stable, fast and predictable the platform is. You maybe write a bit more code, but you know exactly what's going on... you never really deal with silent failures... and things do tend to work a lot more reliably. I am starting to question using Rails for this new project.
java
ruby-on-rails
ruby
spring
learning-curve
05/21/2011 15:40:41
not constructive
Rail's 'Gotchas' and learning curve - will ever stop? === I've been developing a new rails project for a few weeks, and while I am amazed at the awesome plugins and some of the really great features in the frameworks... I am a little disappointed too. And I am worried. I think I made a mistake. Should I press on, or go back to what I was familiar with? (Java/Spring) 1. It seems that unless you are looking for "simple examples", googling for the exceptions to the rule, special cases and so on really hampers productivity and is increasingly becoming the norm for me. 2. Documentation and examples from the main site, blogs, screencasts, etc. are mostly out of date. For ever 5-10 examples that are out there, 1 of them is actually correct. 3. Doing anything new that should "just work" almost never does. I try and following documentation and examples, but my results seem to vary and I discover problems never mentioned in the documentation and examples. This seems to happen all the time actually. 4. My experience with trying out CoffeeCode and it's integration with Rails was a disaster. Not being able to see what the problem is whenever a "compiler error" occurs is beyond frustrating. 5. ActiveRelation is really awesome, until you need to make a query that joins 7 tables. Then it starts to break down. I think it's possible that you can get that 7-table join query done in Hibernate quicker and finished reliably the first time you are learning it. 6. Testing is actually really hard in Rails. There's just too much "Magic" going on. Since Ruby is dynamic, I have no idea what I need to call to test something appropriately. There always seems to be exceptions to the rule. For example, Devise works like you would expect... until you want to test Devise in helpers. It just won't work, so you have to invent the Devise-generated methods in your tests to make the tests pass. You don't need to do this for controllers. 7. Why does images and stylesheets not work properly when you switch to production for? This is insane. Tons of people ask this if you google it... yet the framework doesn't "just work". 8. For some reason, after adding jquery-rails and devise, the authentication token wasn't getting passed during ajax requests. I had to add the 4 lines of javascript code to make it work. This took me 5 hours. In Java, because you have proper sessions, you never even need to think about this type of stuff. 9. Tests run really slow. I have about 780 tests, and it already takes much longer than a Java project which has 1800 tests. 10. Testing the application in the browser is really slow. It takes like 1/4 of a second to render some of the pages... and there isn't even that much ORM action going on! Even for pages with 1 database query, it takes 100-200 milliseconds. This is crazy. 11. Documentation is often out of date. For example, trying to override things in Devise was a pain because the documentation actually told me to do the wrong thing. Only after hours of googling and waiting 48 hours on another forum was I able to have someone tell me what I needed to do. All I wanted to do was have the login form reject a user where User.enabled was false. That's it. It turns out, I was overriding "active?" instead of "active_for_authentication?" - which was an error in the RDoc's. After 2 weeks, the number of "gotchas" hasn't really slowed down. I am really worried and scared. I know Java isn't immune to gotchas and problems, but I generally ran into problems about 2-3 times a month - not 30 in one week. I am almost thinking the lack of agility when using Java/Spring is not much of a burden now when you consider how stable, fast and predictable the platform is. You maybe write a bit more code, but you know exactly what's going on... you never really deal with silent failures... and things do tend to work a lot more reliably. I am starting to question using Rails for this new project.
4
5,285,128
03/12/2011 20:04:29
91,729
04/16/2009 16:49:44
978
32
OData service without WCF data services
Is it possible to create an OData compliant RESTful web service on an MS platform without using WCF data services?
wcf
rest
odata
null
null
null
open
OData service without WCF data services === Is it possible to create an OData compliant RESTful web service on an MS platform without using WCF data services?
0
1,789,354
11/24/2009 11:05:16
75,500
03/09/2009 06:16:32
1,517
96
Check if current template is within a ToolTip?
I am using a `DataTemplate` (a `StaticResource`) in several places in my application as in an `ItemsControl`, `ContentControl` and in a `ToolTip`. The template contains an `Expander`, and I want its `IsExpanded` property to be true if the `DataTemplate` is located within a `ToolTip`. Any recommendations?
wpf
xaml
findancestor
binding
null
null
open
Check if current template is within a ToolTip? === I am using a `DataTemplate` (a `StaticResource`) in several places in my application as in an `ItemsControl`, `ContentControl` and in a `ToolTip`. The template contains an `Expander`, and I want its `IsExpanded` property to be true if the `DataTemplate` is located within a `ToolTip`. Any recommendations?
0
163,628
10/02/2008 17:45:04
13,227
09/16/2008 17:43:51
434
14
Making email addresses safe from bots on a webpage?
When placing email addresses on a webpage do you place them as text like this: [email protected] or use a clever trick to try and fool the email address harvester bots? For example: **HTML Escape Characters:** &#106;&#111;&#101;&#46;&#115;&#111;&#109;&#101;&#98;&#111;&#100;&#121;&#64;&#99;&#111;&#109;&#112;&#97;&#110;&#121;&#46;&#99;&#111;&#109; **Javascript Decrypter:** function XOR_Crypt(EmailAddress) { Result = new String(); for (var i = 0; i < EmailAddress.length; i++) { Result += String.fromCharCode(EmailAddress.charCodeAt(i) ^ 128); } document.write(Result); } XOR_Crypt("êïå®óïíåâïäùÀãïíðáîù®ãïí"); **Human Decode:** [email protected] joe.somebody AT company.com What do you use or do you even bother?
javascript
html
null
null
null
null
open
Making email addresses safe from bots on a webpage? === When placing email addresses on a webpage do you place them as text like this: [email protected] or use a clever trick to try and fool the email address harvester bots? For example: **HTML Escape Characters:** &#106;&#111;&#101;&#46;&#115;&#111;&#109;&#101;&#98;&#111;&#100;&#121;&#64;&#99;&#111;&#109;&#112;&#97;&#110;&#121;&#46;&#99;&#111;&#109; **Javascript Decrypter:** function XOR_Crypt(EmailAddress) { Result = new String(); for (var i = 0; i < EmailAddress.length; i++) { Result += String.fromCharCode(EmailAddress.charCodeAt(i) ^ 128); } document.write(Result); } XOR_Crypt("êïå®óïíåâïäùÀãïíðáîù®ãïí"); **Human Decode:** [email protected] joe.somebody AT company.com What do you use or do you even bother?
0
8,394,076
12/06/2011 01:06:11
158,049
08/17/2009 21:44:35
802
37
ZMQ pub/sub reliable/scalable design
I'm designin a pub/sub architecture using ZMQ. I need maximum reliability and scalability and am kind of lost in the hell of possibilities provided. At the moment, I got a set a publishers and subscribers, linked by a broker. The broker is a simple forwarder device exposing a frontend for publishers, and a backend for subscribers. I need to handle the case when the broker crashes or disconnects, and improve the overall scalability. Okay, so i thought of adding multiple brokers, the publishers would round robin the broker to send messages to, and the subscribers would just subscribe to all these brokers. Then i needed a way to retrieve the list of possible brokers, so i wrote a name service that provides a list of brokers on demand. Publishers and subscribers ask this service which brokers to connect to. I also wrote a kind of "lazy pirate" (i.e. try/retry one after the other) reliable name service in case the main name service falls. I'm starting to think that i'm designing it wrong since the codebase is non stop increasing in size and complexity. I'm lost in the jungle of possibilities provided by ZMQ. Maybe something router/dealer based would be usable here ? Any advice greatly appreciated !
python
publish-subscribe
messagebroker
zmq
null
null
open
ZMQ pub/sub reliable/scalable design === I'm designin a pub/sub architecture using ZMQ. I need maximum reliability and scalability and am kind of lost in the hell of possibilities provided. At the moment, I got a set a publishers and subscribers, linked by a broker. The broker is a simple forwarder device exposing a frontend for publishers, and a backend for subscribers. I need to handle the case when the broker crashes or disconnects, and improve the overall scalability. Okay, so i thought of adding multiple brokers, the publishers would round robin the broker to send messages to, and the subscribers would just subscribe to all these brokers. Then i needed a way to retrieve the list of possible brokers, so i wrote a name service that provides a list of brokers on demand. Publishers and subscribers ask this service which brokers to connect to. I also wrote a kind of "lazy pirate" (i.e. try/retry one after the other) reliable name service in case the main name service falls. I'm starting to think that i'm designing it wrong since the codebase is non stop increasing in size and complexity. I'm lost in the jungle of possibilities provided by ZMQ. Maybe something router/dealer based would be usable here ? Any advice greatly appreciated !
0
9,469,007
02/27/2012 17:01:52
1,236,078
02/27/2012 16:56:33
1
0
how to insert checkbox values into database?
Can any one Explain How to solve this problem .In my application 10 checkbox fields .If i click one checkbox it will true otherwise false .. so i have to insert into database both values..please explain me how to do that. Thanks
java
mysql
iterator
struts
null
02/27/2012 17:28:57
not a real question
how to insert checkbox values into database? === Can any one Explain How to solve this problem .In my application 10 checkbox fields .If i click one checkbox it will true otherwise false .. so i have to insert into database both values..please explain me how to do that. Thanks
1
8,099,394
11/11/2011 20:13:37
663,246
03/16/2011 20:31:30
315
26
.NET CMS platforms available that are conducive to TDD and SOLID principles?
My company is considering switching to a TDD development process as our codebase is becoming large and unwieldy to modify. We currently use Kentico which is very powerful, but it in combination with ASP.NET webforms makes proper and thorough testing very difficult, especially in terms of unit testing. It's also hard to apply many of the SOLID principles to the development process when writing controls for Kentico. Are there any CMS platforms available built on ASP.NET and cater more to a TDD process and application of SOLID with a feature-set comparable to Kentico's? MVC is not out of the question, nor is MVP though I don't think anyone has built a CMS on top of [Webforms MVP][1]. [1]: http://webformsmvp.com/
asp.net
asp.net-mvc
asp.net-mvc-3
content-management-system
mvp
11/13/2011 01:16:36
not constructive
.NET CMS platforms available that are conducive to TDD and SOLID principles? === My company is considering switching to a TDD development process as our codebase is becoming large and unwieldy to modify. We currently use Kentico which is very powerful, but it in combination with ASP.NET webforms makes proper and thorough testing very difficult, especially in terms of unit testing. It's also hard to apply many of the SOLID principles to the development process when writing controls for Kentico. Are there any CMS platforms available built on ASP.NET and cater more to a TDD process and application of SOLID with a feature-set comparable to Kentico's? MVC is not out of the question, nor is MVP though I don't think anyone has built a CMS on top of [Webforms MVP][1]. [1]: http://webformsmvp.com/
4
10,050,509
04/06/2012 23:53:32
765,306
05/23/2011 01:35:58
1
0
Generic Linked list comparator - segmentation fault
I'm trying to do a Generic Linked List implementation in C. But, when I try to compare two values in the search function, it gives me a Segmentation Fault on this line: if( l->cmp(curr_node->data,data) == 0 ) You can see the entire search function below: int ll_search( ll *l, void *data ) { ll_node *curr_node; if(!l) return 0; for( curr_node = l->head; curr_node; curr_node = (ll_node*)curr_node->next ) { if( l->cmp(curr_node->data,data) == 0 ) return 1; } return 0; } And here is my header file: typedef int (*comparator)( void* a, void* b); typedef struct ll_node { void *data; void *next; } ll_node; typedef struct ll { ll_node *head; size_t size; comparator cmp; }ll; extern int ll_init( ll *, comparator ); extern int ll_add_node( ll *, void* ); extern int ll_search( ll *, void * ); In the main source file I have the compare function and the main where I run some tests: int cmp_func( void*a, void*b) { char *a_str, *b_str; a_str = (char*)a; b_str = (char*)b; return strcmp( a_str, b_str ); } int main() { ll l; char *a = strdup("1"); char *b = strdup("2"); ll_init(&l,cmp_func); ll_add_node(&l,a); printf("Inserted: %s\n",(char*)l.head->data); ll_add_node(&l,b); printf("Inserted: %s\n",(char*)l.head->data); ll_search(&l,a); return 1; } Running valgrind, it shows me this: ==19624== Use of uninitialised value of size 8 ==19624== at 0x100000C32: ll_search (in ./ll) ==19624== by 0x100000D8F: main (in ./ll) ==19624== ==19624== Jump to the invalid address stated on the next line ==19624== at 0x0: ??? ==19624== by 0x100000D8F: main (in ./ll) ==19624== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==19624== ==19624== ==19624== Process terminating with default action of signal 11 (SIGSEGV) ==19624== Bad permissions for mapped region at address 0x0 ==19624== at 0x0: ??? ==19624== by 0x100000D8F: main (in ./ll) ==19624== I tried everything to put this working, but it gives always segmentation fault. What is causing it? Thanks.
c
list
linked
fault
segmentation
04/07/2012 00:09:45
too localized
Generic Linked list comparator - segmentation fault === I'm trying to do a Generic Linked List implementation in C. But, when I try to compare two values in the search function, it gives me a Segmentation Fault on this line: if( l->cmp(curr_node->data,data) == 0 ) You can see the entire search function below: int ll_search( ll *l, void *data ) { ll_node *curr_node; if(!l) return 0; for( curr_node = l->head; curr_node; curr_node = (ll_node*)curr_node->next ) { if( l->cmp(curr_node->data,data) == 0 ) return 1; } return 0; } And here is my header file: typedef int (*comparator)( void* a, void* b); typedef struct ll_node { void *data; void *next; } ll_node; typedef struct ll { ll_node *head; size_t size; comparator cmp; }ll; extern int ll_init( ll *, comparator ); extern int ll_add_node( ll *, void* ); extern int ll_search( ll *, void * ); In the main source file I have the compare function and the main where I run some tests: int cmp_func( void*a, void*b) { char *a_str, *b_str; a_str = (char*)a; b_str = (char*)b; return strcmp( a_str, b_str ); } int main() { ll l; char *a = strdup("1"); char *b = strdup("2"); ll_init(&l,cmp_func); ll_add_node(&l,a); printf("Inserted: %s\n",(char*)l.head->data); ll_add_node(&l,b); printf("Inserted: %s\n",(char*)l.head->data); ll_search(&l,a); return 1; } Running valgrind, it shows me this: ==19624== Use of uninitialised value of size 8 ==19624== at 0x100000C32: ll_search (in ./ll) ==19624== by 0x100000D8F: main (in ./ll) ==19624== ==19624== Jump to the invalid address stated on the next line ==19624== at 0x0: ??? ==19624== by 0x100000D8F: main (in ./ll) ==19624== Address 0x0 is not stack'd, malloc'd or (recently) free'd ==19624== ==19624== ==19624== Process terminating with default action of signal 11 (SIGSEGV) ==19624== Bad permissions for mapped region at address 0x0 ==19624== at 0x0: ??? ==19624== by 0x100000D8F: main (in ./ll) ==19624== I tried everything to put this working, but it gives always segmentation fault. What is causing it? Thanks.
3
9,773,108
03/19/2012 15:36:01
379,008
06/29/2010 12:49:08
2,451
51
Is PHP 5 Object Oriented?
I would like to know if PHP is Object Oriented, I read that from version 5 PHP now support features of OOP world. This means that PHP now became a full OO Language? Do you have any feedback on developing using OO Style on PHP? (Note: I do not have experience with PHP only C#).
php
php-5.3
null
null
null
03/19/2012 15:41:53
not a real question
Is PHP 5 Object Oriented? === I would like to know if PHP is Object Oriented, I read that from version 5 PHP now support features of OOP world. This means that PHP now became a full OO Language? Do you have any feedback on developing using OO Style on PHP? (Note: I do not have experience with PHP only C#).
1
10,662,498
05/19/2012 05:11:20
975,336
10/02/2011 11:35:31
15
0
How to continue switch case program, while asking user, do you want to continue ( yes or no)?
here is the code > import javax.swing.*; > > public class SwitchCase { > > /** * @param args */ public static void main(String[] args) { > > int dec = 0, num, rem, org, pow, length = 0, i = 1, input; > LOOPA:{ input = Integer.parseInt(JOptionPane > .showInputDialog("Press 1 for binary to decimal conversion \n " > + "Press 2 for decimal to binary conversion\n" > + "Press 3 for octal to decimal conversion\n" > + "Press 4 for decimal to octal conversion\n")); > > // switch cases switch (input) { > > // binary to decimal conversion case 1: num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter binary number")); org = num; while (num != 0) { > num = num / 10; > length++; } pow = length - 1; System.out.print("decimal Equivalent is: "); while (pow >= 0) { > rem = org % 10; > dec = dec + (rem * i); > i = i * 2; > pow--; > org = org / 10; } System.out.print(dec); break LOOPA; > > // decimal to binary conversion > > case 2: int addTwo = 2, bin; num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter decimal number")); > > while (num != 0) { > rem = num % 2; > num = num / 2; > > addTwo = (addTwo * 10) + rem; } System.out.print("Binary Equivalent is: "); > > while (addTwo != 2) { > bin = addTwo; > bin = bin % 10; > System.out.print(bin); > addTwo = addTwo / 10; } break LOOPA; > > case 3: // octal to decimal conversion > > num = Integer.parseInt(JOptionPane > .showInputDialog("Enter octal number")); org = num; while (num != 0) { > num = num / 10; > length++; } pow = length - 1; System.out.print("decimal Equivalent is: "); while (pow >= 0) { > rem = org % 10; > dec = dec + (rem * i); > i = i * 8; > pow--; > org = org / 10; } System.out.print(dec); > > break LOOPA; // decimal to octal conversion > > case 4: int addEight = 8, octal; num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter decimal number")); > > while (num != 0) { > rem = num % 8; > num = num / 8; > > addEight = (addEight * 10) + rem; } System.out.print("Octal Equivalent is: "); > > while (addEight != 8) { > octal = addEight; > octal = addEight % 10; > System.out.print(octal); > addEight = addEight / 10; } break; default: System.out.print("do u want to continue"); break LOOPA; // > exit switch cases } } } }
java
null
null
null
null
05/20/2012 12:42:52
not a real question
How to continue switch case program, while asking user, do you want to continue ( yes or no)? === here is the code > import javax.swing.*; > > public class SwitchCase { > > /** * @param args */ public static void main(String[] args) { > > int dec = 0, num, rem, org, pow, length = 0, i = 1, input; > LOOPA:{ input = Integer.parseInt(JOptionPane > .showInputDialog("Press 1 for binary to decimal conversion \n " > + "Press 2 for decimal to binary conversion\n" > + "Press 3 for octal to decimal conversion\n" > + "Press 4 for decimal to octal conversion\n")); > > // switch cases switch (input) { > > // binary to decimal conversion case 1: num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter binary number")); org = num; while (num != 0) { > num = num / 10; > length++; } pow = length - 1; System.out.print("decimal Equivalent is: "); while (pow >= 0) { > rem = org % 10; > dec = dec + (rem * i); > i = i * 2; > pow--; > org = org / 10; } System.out.print(dec); break LOOPA; > > // decimal to binary conversion > > case 2: int addTwo = 2, bin; num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter decimal number")); > > while (num != 0) { > rem = num % 2; > num = num / 2; > > addTwo = (addTwo * 10) + rem; } System.out.print("Binary Equivalent is: "); > > while (addTwo != 2) { > bin = addTwo; > bin = bin % 10; > System.out.print(bin); > addTwo = addTwo / 10; } break LOOPA; > > case 3: // octal to decimal conversion > > num = Integer.parseInt(JOptionPane > .showInputDialog("Enter octal number")); org = num; while (num != 0) { > num = num / 10; > length++; } pow = length - 1; System.out.print("decimal Equivalent is: "); while (pow >= 0) { > rem = org % 10; > dec = dec + (rem * i); > i = i * 8; > pow--; > org = org / 10; } System.out.print(dec); > > break LOOPA; // decimal to octal conversion > > case 4: int addEight = 8, octal; num = > Integer.parseInt(JOptionPane > .showInputDialog("Enter decimal number")); > > while (num != 0) { > rem = num % 8; > num = num / 8; > > addEight = (addEight * 10) + rem; } System.out.print("Octal Equivalent is: "); > > while (addEight != 8) { > octal = addEight; > octal = addEight % 10; > System.out.print(octal); > addEight = addEight / 10; } break; default: System.out.print("do u want to continue"); break LOOPA; // > exit switch cases } } } }
1
11,498,542
07/16/2012 05:28:38
609,149
02/09/2011 03:21:43
325
45
Android ICS 4.0.3 Calendar Event Issues Not solved?
I show No of link relate the issues is that : 1. http://www.slatedroid.com/topic/29083-ics-403-google-calender-sync-not-working/ 2. http://code.google.com/p/android/issues/detail?id=23175 3. https://productforums.google.com/forum/?fromgroups#!topic/calendar/gwrjas-h998 4. http://productforums.google.com/forum/#!topic/gmail/AiydLDDiv9g 5. http://www.fjsoft.at/forum/viewtopic.php?t=16399&sid=b25931762e14bdfaee00064c8ca40939 6. http://community.office365.com/en-us/forums/160/p/51980/183662.aspx 7. http://forum.xda-developers.com/showthread.php?t=1560713 8. http://code.google.com/p/android/issues/detail?id=26847 Please solve the issue and post please.....thanks in advance.
android
null
null
null
null
07/16/2012 14:11:12
not a real question
Android ICS 4.0.3 Calendar Event Issues Not solved? === I show No of link relate the issues is that : 1. http://www.slatedroid.com/topic/29083-ics-403-google-calender-sync-not-working/ 2. http://code.google.com/p/android/issues/detail?id=23175 3. https://productforums.google.com/forum/?fromgroups#!topic/calendar/gwrjas-h998 4. http://productforums.google.com/forum/#!topic/gmail/AiydLDDiv9g 5. http://www.fjsoft.at/forum/viewtopic.php?t=16399&sid=b25931762e14bdfaee00064c8ca40939 6. http://community.office365.com/en-us/forums/160/p/51980/183662.aspx 7. http://forum.xda-developers.com/showthread.php?t=1560713 8. http://code.google.com/p/android/issues/detail?id=26847 Please solve the issue and post please.....thanks in advance.
1
11,381,138
07/08/2012 06:24:58
1,501,496
07/04/2012 11:59:18
1
0
How to refresh rows of Table?
My simple question is Can we Refresh our table after inserting a new row in android application. Please help me.
android
null
null
null
null
07/09/2012 22:04:02
not a real question
How to refresh rows of Table? === My simple question is Can we Refresh our table after inserting a new row in android application. Please help me.
1
10,997,028
06/12/2012 12:51:04
862,132
07/25/2011 18:10:21
138
2
length property not being captured
I know I have to be doing something dumb here. Just need a second set of eyes. Validating if my radio box has been checked: <input type="radio" name="cont_amt" id="cont_amt" value="1000"> //alert(theForm.cont_amt.value); var con_optLength = theForm.cont_amt.length; var chkd=""; for(var i = 0; i < con_optLength; i++) { if(theForm.cont_amt[i].checked) { chkd=theForm.cont_amt[i].value; } } if ( chkd == "" ) { reason += "\t" + "Must select a contribution option" + "\n"; } I'm always hitting my alert because my `length` is always undefined.
javascript
null
null
null
null
null
open
length property not being captured === I know I have to be doing something dumb here. Just need a second set of eyes. Validating if my radio box has been checked: <input type="radio" name="cont_amt" id="cont_amt" value="1000"> //alert(theForm.cont_amt.value); var con_optLength = theForm.cont_amt.length; var chkd=""; for(var i = 0; i < con_optLength; i++) { if(theForm.cont_amt[i].checked) { chkd=theForm.cont_amt[i].value; } } if ( chkd == "" ) { reason += "\t" + "Must select a contribution option" + "\n"; } I'm always hitting my alert because my `length` is always undefined.
0
4,429,196
12/13/2010 13:21:52
538,626
12/10/2010 17:22:12
8
0
fingerprint reader
i have a fingerprint reader device for pc but now i want to connect that fingerprint reader to my android mobile ?anyone help me which is the usb connector for this???
android
null
null
null
null
12/13/2010 18:39:45
off topic
fingerprint reader === i have a fingerprint reader device for pc but now i want to connect that fingerprint reader to my android mobile ?anyone help me which is the usb connector for this???
2
4,040,878
10/28/2010 08:03:40
192,901
10/20/2009 07:37:32
97
8
secure json data transfer ?
I have bunch of screens (asp.net C#) capturing data and transferring it back to a web service using json. How can i encrypt content like passwords and decrypt it back in the C# code?
c#
web-services
json
null
null
null
open
secure json data transfer ? === I have bunch of screens (asp.net C#) capturing data and transferring it back to a web service using json. How can i encrypt content like passwords and decrypt it back in the C# code?
0
7,903,667
10/26/2011 13:56:13
1,014,679
10/26/2011 13:47:45
1
0
PHP script makes my website inaccessible for that user
I've just recently been asked to develop a PHP application that allows mass emailing. To do this, I have a PHP script that simply grabs the email addresses from a MySQLDatabase and loops through them personalising each one, and then sending them. It works absolutely fine, however we have a slight issue in that whilst this PHP script is running (and it obviously takes several minutes to run) the user cannot do anything else on the application. Other people can access it, but the user in question cannot load any other page of the application whilst the emails are sending. Is there some way of dealing with this or is this just something we are going to have to live with? Thanks in advance.
php
apache
email
mass
virtual-server
null
open
PHP script makes my website inaccessible for that user === I've just recently been asked to develop a PHP application that allows mass emailing. To do this, I have a PHP script that simply grabs the email addresses from a MySQLDatabase and loops through them personalising each one, and then sending them. It works absolutely fine, however we have a slight issue in that whilst this PHP script is running (and it obviously takes several minutes to run) the user cannot do anything else on the application. Other people can access it, but the user in question cannot load any other page of the application whilst the emails are sending. Is there some way of dealing with this or is this just something we are going to have to live with? Thanks in advance.
0
10,664,223
05/19/2012 10:09:29
1,404,890
05/19/2012 09:21:22
1
0
PHP: Play sound file from server on client site
Want to play a file that on path like this `/var/spool/sound/dog.wav` present on server.<br> This not having any<br> **1)`URL`**<br> **2) Not even on present in that `website folder`**<br> How i can make my client to listen to that dog.wav ? <br> I am getting file path by using `Tree view` client click on a file, it returns the path of that file being clicked. If you can tell me any tree view that having function to play sound file that it would be a great contribution from you.<br> Thanks a lot<br> GOD BLESS YOU
php
javascript
jquery
html
null
05/22/2012 13:57:22
not a real question
PHP: Play sound file from server on client site === Want to play a file that on path like this `/var/spool/sound/dog.wav` present on server.<br> This not having any<br> **1)`URL`**<br> **2) Not even on present in that `website folder`**<br> How i can make my client to listen to that dog.wav ? <br> I am getting file path by using `Tree view` client click on a file, it returns the path of that file being clicked. If you can tell me any tree view that having function to play sound file that it would be a great contribution from you.<br> Thanks a lot<br> GOD BLESS YOU
1
4,586,730
01/03/2011 17:32:01
201,775
11/03/2009 14:58:29
35
3
real meaning of nofollow links
i'm getting confused what are realy nofollow attributes do. I do believe that they tell search engine spiders to do not follow the target. But my question is: do nofollow links alter the Pagerank? Thanks
google
seo
seo-friendly
null
null
04/27/2011 03:36:20
off topic
real meaning of nofollow links === i'm getting confused what are realy nofollow attributes do. I do believe that they tell search engine spiders to do not follow the target. But my question is: do nofollow links alter the Pagerank? Thanks
2
7,476,040
09/19/2011 19:11:09
117,700
06/04/2009 23:04:34
1,167
19
asp.net: run javascript on click?
i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this? i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?
c#
javascript
asp.net
html
null
null
open
asp.net: run javascript on click? === i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this? i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?i have a form and a button a form: <asp:Button ID="Button1" runat="server" Text="Button" OnClick="SubmitData" /> i have a method in my c# program. the method is called `SubmitData` however i would also like to run a javascript function on this button click as well. how do i do this?
0
7,437,049
09/15/2011 20:26:25
813,040
06/23/2011 20:23:55
317
10
ReadDirectoryChangesW doesn't do anything c++
Am I doing this right? I am trying to find all the changes that took place in a folder called C:\Perl After ReadDirectoryChangesW, it just gets stuck there. It doesn't move forward. Am I missing something obvious? I am trying to achieve: http://stackoverflow.com/questions/7421440/how-can-i-detect-only-deleted-changed-and-created-files-on-a-volume Once everyday, I want to run the backup program, which will backup only the files that were changed under a specific folder. int _tmain(int argc, _TCHAR* argv[]) { TCHAR szBuffer[640] = {0}; DWORD dwOffset = 0; FILE_NOTIFY_INFORMATION* pInfo = NULL; DWORD dwBytes; HANDLE hFolder = CreateFile(L"C:\\Perl", FILE_LIST_DIRECTORY, FILE_SHARE_READ|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); cout<<"Hello"<<endl; ReadDirectoryChangesW(hFolder, szBuffer, sizeof(szBuffer) / sizeof(TCHAR), FALSE, FILE_NOTIFY_CHANGE_FILE_NAME, &dwBytes, NULL, NULL); cout<<"Done"<<endl; do { // Get a pointer to the first change record... pInfo = (FILE_NOTIFY_INFORMATION*) &szBuffer[dwOffset]; // ReadDirectoryChangesW processes filenames in Unicode. We will convert them to a TCHAR format... TCHAR szFileName[MAX_PATH] = {0}; wcout<<pInfo->FileName<<"\t"<<pInfo->Action ; //WideCharToMultiByte(CP_ACP, NULL, pInfo->FileName, pInfo->FileNameLength, szFileName, sizeof(szFileName) / sizeof(TCHAR), NULL, NULL); // Perform your tests here... if (pInfo->Action == FILE_ACTION_ADDED) { } // More than one change may happen at the same time. Load the next change and continue... dwOffset += pInfo->NextEntryOffset; } while (pInfo->NextEntryOffset != 0); }
c++
windows
backup
null
null
null
open
ReadDirectoryChangesW doesn't do anything c++ === Am I doing this right? I am trying to find all the changes that took place in a folder called C:\Perl After ReadDirectoryChangesW, it just gets stuck there. It doesn't move forward. Am I missing something obvious? I am trying to achieve: http://stackoverflow.com/questions/7421440/how-can-i-detect-only-deleted-changed-and-created-files-on-a-volume Once everyday, I want to run the backup program, which will backup only the files that were changed under a specific folder. int _tmain(int argc, _TCHAR* argv[]) { TCHAR szBuffer[640] = {0}; DWORD dwOffset = 0; FILE_NOTIFY_INFORMATION* pInfo = NULL; DWORD dwBytes; HANDLE hFolder = CreateFile(L"C:\\Perl", FILE_LIST_DIRECTORY, FILE_SHARE_READ|FILE_SHARE_DELETE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL); cout<<"Hello"<<endl; ReadDirectoryChangesW(hFolder, szBuffer, sizeof(szBuffer) / sizeof(TCHAR), FALSE, FILE_NOTIFY_CHANGE_FILE_NAME, &dwBytes, NULL, NULL); cout<<"Done"<<endl; do { // Get a pointer to the first change record... pInfo = (FILE_NOTIFY_INFORMATION*) &szBuffer[dwOffset]; // ReadDirectoryChangesW processes filenames in Unicode. We will convert them to a TCHAR format... TCHAR szFileName[MAX_PATH] = {0}; wcout<<pInfo->FileName<<"\t"<<pInfo->Action ; //WideCharToMultiByte(CP_ACP, NULL, pInfo->FileName, pInfo->FileNameLength, szFileName, sizeof(szFileName) / sizeof(TCHAR), NULL, NULL); // Perform your tests here... if (pInfo->Action == FILE_ACTION_ADDED) { } // More than one change may happen at the same time. Load the next change and continue... dwOffset += pInfo->NextEntryOffset; } while (pInfo->NextEntryOffset != 0); }
0
9,759,248
03/18/2012 14:46:37
378,159
06/28/2010 15:25:49
115
5
Doing just one query search, saving it to an array and then search only the array instead of doing multiple sql queries
i have this class PagesController < ApplicationController def index @textos = Texto.all @texto_historia = Texto.where(:title => "História").first.contents @texto_capas_para_sofa = Texto.where(:title => "Capas para Sofá").first.contents @texto_cortinas = Texto.where(:title => "Cortinas").first.contents @texto_almofadas = Texto.where(:title => "Almofadas").first.contents end The SQL output is: <pre> ←[1m←[36mTexto Load (2.0ms)←[0m ←[1mSELECT "textos".* FROM "textos"←[0m ←[1m←[35mTexto Load (1.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Hist├│ria') LIMIT 1 ←[1m←[36mTexto Load (0.0ms)←[0m ←[1mSELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Capas para Sof├í') LIMIT 1←[0m ←[1m←[35mTexto Load (1.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Cortinas') LIMIT 1 ←[1m←[36mTexto Load (1.0ms)←[0m ←[1mSELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Almofadas') LIMIT 1←[0m ←[1m←[35mTexto Load (0.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Informa├º├╡es de Contato') LIMIT 1 </pre> What i want is to do just one query for all "textos" model and then search inside an array or anything like that to get the specific variable.
sql
ruby-on-rails
null
null
null
null
open
Doing just one query search, saving it to an array and then search only the array instead of doing multiple sql queries === i have this class PagesController < ApplicationController def index @textos = Texto.all @texto_historia = Texto.where(:title => "História").first.contents @texto_capas_para_sofa = Texto.where(:title => "Capas para Sofá").first.contents @texto_cortinas = Texto.where(:title => "Cortinas").first.contents @texto_almofadas = Texto.where(:title => "Almofadas").first.contents end The SQL output is: <pre> ←[1m←[36mTexto Load (2.0ms)←[0m ←[1mSELECT "textos".* FROM "textos"←[0m ←[1m←[35mTexto Load (1.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Hist├│ria') LIMIT 1 ←[1m←[36mTexto Load (0.0ms)←[0m ←[1mSELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Capas para Sof├í') LIMIT 1←[0m ←[1m←[35mTexto Load (1.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Cortinas') LIMIT 1 ←[1m←[36mTexto Load (1.0ms)←[0m ←[1mSELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Almofadas') LIMIT 1←[0m ←[1m←[35mTexto Load (0.0ms)←[0m SELECT "textos".* FROM "textos" WHERE ("textos"."title" = 'Informa├º├╡es de Contato') LIMIT 1 </pre> What i want is to do just one query for all "textos" model and then search inside an array or anything like that to get the specific variable.
0
3,499,480
08/17/2010 05:03:49
352,325
05/27/2010 19:52:07
178
38
How many people would not be able to do javascript without jQuery?
Do people actually learn the core concepts anymore or are they "learning" from the library? Can you do the basic jQuery actions from scratch, cross browser, YOURSELF? Or would you be lost without $()? Hope this does not get closed. I am curious.
javascript
null
null
null
null
08/17/2010 05:12:14
not a real question
How many people would not be able to do javascript without jQuery? === Do people actually learn the core concepts anymore or are they "learning" from the library? Can you do the basic jQuery actions from scratch, cross browser, YOURSELF? Or would you be lost without $()? Hope this does not get closed. I am curious.
1
3,241,515
07/13/2010 21:04:37
357,349
06/03/2010 10:26:33
72
1
LG Ally android driver
I am unable to deploy the code on LG Ally mobile , I want to know if someone can find me the Windows platform device driver software for LG Ally . I tried http://www.lgcommunity.com/file_library.aspx but this did not work.
android
null
null
null
null
07/16/2010 05:25:41
off topic
LG Ally android driver === I am unable to deploy the code on LG Ally mobile , I want to know if someone can find me the Windows platform device driver software for LG Ally . I tried http://www.lgcommunity.com/file_library.aspx but this did not work.
2
5,378,118
03/21/2011 13:18:54
571,640
01/11/2011 17:48:04
40
3
Drawing create arrow (Don't know how they did it)
So sudden I have the thought of how to draw the "curving arrow(quite free style)" that shown at some website pointing to certain element or stuff. Can't remember where to show this example but that was nice. Was it some image file or some coding that I can do it?? Much appreciate for the advice and guide.
javascript
jquery
drawing
arrow
null
03/24/2011 00:53:41
off topic
Drawing create arrow (Don't know how they did it) === So sudden I have the thought of how to draw the "curving arrow(quite free style)" that shown at some website pointing to certain element or stuff. Can't remember where to show this example but that was nice. Was it some image file or some coding that I can do it?? Much appreciate for the advice and guide.
2
9,382,755
02/21/2012 18:07:36
1,157,420
01/19/2012 00:15:24
8
0
mysql memory load from javascript live search
I am running a live search through a text box that when a user types it returns matching rows from a mysql database. The problem is this is one of the main features of the site and has really increased the memory load on my mysql database. Because every key stroke sends a request to the php script to query the database. I have php ignore any search term less than 3 characters long, but besides that what else could I do? There are some options here: http://stackoverflow.com/questions/7528050/live-search-optimisation-in-javascript But I was wondering if I should pull from a cached xml sheet, or is there somehow some way to cache mysql itself. What does google, or some of the other large sites that rely on this feature heavily do?
php
javascript
mysql
livesearch
null
null
open
mysql memory load from javascript live search === I am running a live search through a text box that when a user types it returns matching rows from a mysql database. The problem is this is one of the main features of the site and has really increased the memory load on my mysql database. Because every key stroke sends a request to the php script to query the database. I have php ignore any search term less than 3 characters long, but besides that what else could I do? There are some options here: http://stackoverflow.com/questions/7528050/live-search-optimisation-in-javascript But I was wondering if I should pull from a cached xml sheet, or is there somehow some way to cache mysql itself. What does google, or some of the other large sites that rely on this feature heavily do?
0
5,819,649
04/28/2011 13:48:09
483,876
10/22/2010 06:30:57
63
0
Splitting list into n-tuples
How can I split a list into list of tuples/lists of specified length? splitBy :: Int -> [a] -> [[a]] splitBy 2 "asdfgh" should return ["as", "df", "gh"]
haskell
null
null
null
null
null
open
Splitting list into n-tuples === How can I split a list into list of tuples/lists of specified length? splitBy :: Int -> [a] -> [[a]] splitBy 2 "asdfgh" should return ["as", "df", "gh"]
0
6,530,388
06/30/2011 05:38:11
822,396
06/30/2011 05:38:11
1
0
Can we improve gesture recognition using Compressed Sensing?
PAMI has brought out the work of John Wright & Allen Y. Yang which did face recognition efficiently using Compressed sensing.And it was improved using hashing also in another recent paper.Do you think similary gesture recognition can also be improved with the sparse representation?What could be a hint to proceed?
visual-studio-2010
null
null
null
null
07/02/2011 04:36:51
off topic
Can we improve gesture recognition using Compressed Sensing? === PAMI has brought out the work of John Wright & Allen Y. Yang which did face recognition efficiently using Compressed sensing.And it was improved using hashing also in another recent paper.Do you think similary gesture recognition can also be improved with the sparse representation?What could be a hint to proceed?
2
2,551,955
03/31/2010 10:07:41
11,741
09/16/2008 10:49:49
280
61
Simpler array declaration syntax in c++
In the spirit of Go-language, where simpler syntax is considered pretty important, here's a proposal for simpler array declaration in c++: int value; int_1 list; int_2 table; int_3 cube; RECT rect; RECT_1 rects; Using typedefs this can expand to: int value; vector<int> list; vector<int> table; vector<int> cube; RECT rect; vector<RECT> rects; Would you use it, or is there such a thing as too simple syntax?
c++
syntax
null
null
null
05/15/2011 20:51:43
off topic
Simpler array declaration syntax in c++ === In the spirit of Go-language, where simpler syntax is considered pretty important, here's a proposal for simpler array declaration in c++: int value; int_1 list; int_2 table; int_3 cube; RECT rect; RECT_1 rects; Using typedefs this can expand to: int value; vector<int> list; vector<int> table; vector<int> cube; RECT rect; vector<RECT> rects; Would you use it, or is there such a thing as too simple syntax?
2
10,112,876
04/11/2012 19:47:25
158,103
08/18/2009 00:04:08
970
105
Improving on the jQuery ("#tagname")
I've been told that getting elements by getElementbyid or jQuery("#tagname") is considered a "hack". The argument is that is not compiled, and therefore could take a long time to track down a silly typo. Or a better argument: it would take a long time to refactor everything when a certain element id changes. What are some arguments against this "hack" argument? And is there a nice solution around it?
jquery
html
tags
null
null
04/12/2012 00:02:31
not constructive
Improving on the jQuery ("#tagname") === I've been told that getting elements by getElementbyid or jQuery("#tagname") is considered a "hack". The argument is that is not compiled, and therefore could take a long time to track down a silly typo. Or a better argument: it would take a long time to refactor everything when a certain element id changes. What are some arguments against this "hack" argument? And is there a nice solution around it?
4
8,718,357
01/03/2012 20:45:34
667,178
03/19/2011 09:42:41
67
0
What can I use ruby for (besides rails)?
I find ruby to be an extremely fun and effective language to program in. The problem is: Where can I use it? What can I do with it besides making websites (rails)?
ruby-on-rails
ruby
null
null
null
01/03/2012 21:27:29
not constructive
What can I use ruby for (besides rails)? === I find ruby to be an extremely fun and effective language to program in. The problem is: Where can I use it? What can I do with it besides making websites (rails)?
4
11,312,051
07/03/2012 13:32:04
1,498,923
07/03/2012 13:25:33
1
0
storing contents in a particular <div> using preg_split
I want to store the content between the Divs with class 'fb' in an array, I tried using preg_split() but I am not very experienced in regular expressions(regex). Please provide me the necessary php code to do the above task and explain it.
php
regex
preg-split
null
null
07/04/2012 00:33:11
not a real question
storing contents in a particular <div> using preg_split === I want to store the content between the Divs with class 'fb' in an array, I tried using preg_split() but I am not very experienced in regular expressions(regex). Please provide me the necessary php code to do the above task and explain it.
1
9,054,309
01/29/2012 15:28:41
1,021,018
10/30/2011 19:22:04
19
0
Rails ActiveRecord Wildcard + Interpolation Issue
I have been tried the following query and it succeeds (only returns the one record with exact match): def self.search(query) where("name like ?", query) end This query also succeeds (It returns multiple records and there are multiple records with the words 'Game' in their name): def self.search(query) where("name like ?", "%Game%") end However when I attempt place a wildcard character with interpolation: def self.search(query) where("name like ?", "%#{query}%") end It doesn't return anything. Knowing me...probably missing a comma or something. Thanks in advance...
ruby
ruby-on-rails-3
activerecord
null
null
01/29/2012 21:03:09
too localized
Rails ActiveRecord Wildcard + Interpolation Issue === I have been tried the following query and it succeeds (only returns the one record with exact match): def self.search(query) where("name like ?", query) end This query also succeeds (It returns multiple records and there are multiple records with the words 'Game' in their name): def self.search(query) where("name like ?", "%Game%") end However when I attempt place a wildcard character with interpolation: def self.search(query) where("name like ?", "%#{query}%") end It doesn't return anything. Knowing me...probably missing a comma or something. Thanks in advance...
3
10,222,733
04/19/2012 06:29:15
1,277,859
08/19/2011 06:08:07
70
5
REST web services with rails?
I am developing a application to connect with linkedin and pull user inforamtion, this application is done for both web and mobile, so we wanted to go for web services for connecting with linkedin and pull data. i have googled but could not come to a conculsion, hopefully many of you might have done or experienced the same situation. so please suggest me how to go about or where to start with. since i am a new guy to ROR i could not alsoe decide the things fast. Please help me.
ruby-on-rails
web-services
rest
null
null
04/19/2012 13:41:06
not a real question
REST web services with rails? === I am developing a application to connect with linkedin and pull user inforamtion, this application is done for both web and mobile, so we wanted to go for web services for connecting with linkedin and pull data. i have googled but could not come to a conculsion, hopefully many of you might have done or experienced the same situation. so please suggest me how to go about or where to start with. since i am a new guy to ROR i could not alsoe decide the things fast. Please help me.
1
5,374,786
03/21/2011 07:12:45
619,651
02/16/2011 12:43:42
-2
0
c++ polymophishm
which one correct base b= dreived d; drived d= base b;
c++
null
null
null
null
03/21/2011 07:19:31
not a real question
c++ polymophishm === which one correct base b= dreived d; drived d= base b;
1
2,978,439
06/04/2010 23:41:06
210,863
11/14/2009 01:44:39
33
2
Visual foxpro DBF update using php
I am using php to update some tables under VFP 9.0 using ADO COM. I am able to select and update the DBF until i specify any <b>Where</b> clause.<br> The moment i add a where clause to the query, it simply returns or updates 0 rows. $conn = new COM("ADODB.Connection"); $conn->Open('Provider=VFPOLEDB.1;Data Source="C:\\testDB.dbc";'); $query = "UPDATE TABLE1 set COL1 = \"AA\", COL2 = \"Updated value\" "; $conn->Execute($query); $query = "SELECT * FROM TABLE1 "; $rs = $conn->Execute($query) or die("Error in query: $query. " . $conn->ErrorMsg()); while (!$rs->EOF) { echo " Got COL1: " . $rs->Fields("COL1") . " :: COL2: " . $rs->Fields("COL2") . " id: " . $rs->Fields("ID") . "\n"; $rs->MoveNext(); } Result: Got COL1: AA :: COL2: Updated value id: 0 Got COL1: AA :: COL2: Updated value id: 1 Got COL1: AA :: COL2: Updated value id: 2 Code 2: With Where clause $query = "UPDATE TABLE1 set COL1 = \"BB\", COL2 = \"NEW2\" WHERE ID = 1"; $conn->Execute($query); $query = "SELECT * FROM TABLE1 "; $rs = $conn->Execute($query) or die("Error in query: $query. " . $conn->ErrorMsg()); while (!$rs->EOF) { echo " Got COL1: " . $rs->Fields("COL1") . " :: COL2: " . $rs->Fields("COL2") . " id: " . $rs->Fields("ID") . "\n"; $rs->MoveNext(); } Result: Got COL1: AA :: COL2: Updated value id: 0 Got COL1: AA :: COL2: Updated value id: 1 Got COL1: AA :: COL2: Updated value id: 2 The ID column is the key in the above table. <br/> I am relatively new to VFP. I am not sure if this a Visual Foxpro setting or something else which prevents the updates or select if done selectively.
sql
update
dbf
visual-foxpro
null
null
open
Visual foxpro DBF update using php === I am using php to update some tables under VFP 9.0 using ADO COM. I am able to select and update the DBF until i specify any <b>Where</b> clause.<br> The moment i add a where clause to the query, it simply returns or updates 0 rows. $conn = new COM("ADODB.Connection"); $conn->Open('Provider=VFPOLEDB.1;Data Source="C:\\testDB.dbc";'); $query = "UPDATE TABLE1 set COL1 = \"AA\", COL2 = \"Updated value\" "; $conn->Execute($query); $query = "SELECT * FROM TABLE1 "; $rs = $conn->Execute($query) or die("Error in query: $query. " . $conn->ErrorMsg()); while (!$rs->EOF) { echo " Got COL1: " . $rs->Fields("COL1") . " :: COL2: " . $rs->Fields("COL2") . " id: " . $rs->Fields("ID") . "\n"; $rs->MoveNext(); } Result: Got COL1: AA :: COL2: Updated value id: 0 Got COL1: AA :: COL2: Updated value id: 1 Got COL1: AA :: COL2: Updated value id: 2 Code 2: With Where clause $query = "UPDATE TABLE1 set COL1 = \"BB\", COL2 = \"NEW2\" WHERE ID = 1"; $conn->Execute($query); $query = "SELECT * FROM TABLE1 "; $rs = $conn->Execute($query) or die("Error in query: $query. " . $conn->ErrorMsg()); while (!$rs->EOF) { echo " Got COL1: " . $rs->Fields("COL1") . " :: COL2: " . $rs->Fields("COL2") . " id: " . $rs->Fields("ID") . "\n"; $rs->MoveNext(); } Result: Got COL1: AA :: COL2: Updated value id: 0 Got COL1: AA :: COL2: Updated value id: 1 Got COL1: AA :: COL2: Updated value id: 2 The ID column is the key in the above table. <br/> I am relatively new to VFP. I am not sure if this a Visual Foxpro setting or something else which prevents the updates or select if done selectively.
0
6,843,882
07/27/2011 11:56:37
865,311
07/27/2011 11:56:37
1
0
Replace a Substring of a String in Velocity Template Language
I want to replace a part of a string in Velocity Template Language with another string.. For Example : #set($a = "Hello") #set($b = "+") I want to replace ll in Hello with ++ ..The output should be He++o Please help me Thanks Kishore
vtl
null
null
null
null
null
open
Replace a Substring of a String in Velocity Template Language === I want to replace a part of a string in Velocity Template Language with another string.. For Example : #set($a = "Hello") #set($b = "+") I want to replace ll in Hello with ++ ..The output should be He++o Please help me Thanks Kishore
0
10,556,813
05/11/2012 18:36:33
1,339,482
04/17/2012 18:17:39
16
0
syntax error.... reall missing something here
heres my code: import random v1={"emo":"buy","adsum": "to be present","amo":"To love"} a=random.randint(0,2) b= v1.keys() print a print b question= b[a] answer=v1[b[a]] c=raw_input("What is %d" %b[a] if c == answer: print "Well done correct" else: print "Oh dear..." I'm getting an syntax error relating to the colon in the line if c == answer: but I have no idea what is wrong...... Thanks sorted ignore me!!! Missing brackets!
python
syntax
null
null
null
null
open
syntax error.... reall missing something here === heres my code: import random v1={"emo":"buy","adsum": "to be present","amo":"To love"} a=random.randint(0,2) b= v1.keys() print a print b question= b[a] answer=v1[b[a]] c=raw_input("What is %d" %b[a] if c == answer: print "Well done correct" else: print "Oh dear..." I'm getting an syntax error relating to the colon in the line if c == answer: but I have no idea what is wrong...... Thanks sorted ignore me!!! Missing brackets!
0
7,993,191
11/03/2011 10:16:25
1,027,404
11/03/2011 10:11:03
1
0
SugarCRM not integrating with Prestashop
i have SugarPshop module for prestashop but i am not able to install the module and further work on it when i click on complete installation it gives errors. errors are as follows: - Failure to create relationship between the newsletter PrestaShop and his subscription list. - Failure to create relationship between the newsletter PrestaShop and his unsubscription list. - Failure to create relationship between the newsletter PrestaShop and his test list. - Failure to create relationship between the newsletter offers partners and his subscription list. - Failure to create relationship between the newsletter offers partners and his unsubscription list. - Failure to create relationship between the newsletter offers partners and his test list. - If data could not be written to the file sugarpshop/function/parameters.php, verify that you have the write permissions for this file. Click again on Finish installation to use sugarpshop.
prestashop
null
null
null
null
11/03/2011 14:04:51
off topic
SugarCRM not integrating with Prestashop === i have SugarPshop module for prestashop but i am not able to install the module and further work on it when i click on complete installation it gives errors. errors are as follows: - Failure to create relationship between the newsletter PrestaShop and his subscription list. - Failure to create relationship between the newsletter PrestaShop and his unsubscription list. - Failure to create relationship between the newsletter PrestaShop and his test list. - Failure to create relationship between the newsletter offers partners and his subscription list. - Failure to create relationship between the newsletter offers partners and his unsubscription list. - Failure to create relationship between the newsletter offers partners and his test list. - If data could not be written to the file sugarpshop/function/parameters.php, verify that you have the write permissions for this file. Click again on Finish installation to use sugarpshop.
2
7,953,745
10/31/2011 12:31:47
838,586
07/11/2011 09:26:00
709
2
Wordpress programming video tutorials
I am a beginner in Wordpress programming. I am basically looking out for video tutorials that teach Wordpress programming and specifically creation of plugins and such advanced things. Are there any good video tutorials which teach such sort of stuff? or any courses from training companies like pluralsight. I know pluralsight is not into PHP but are there any other sites? I am even willing to pay for videos. The video tutorials need not be free however free is always welcome. Thanks in advance :)
php
wordpress
php5
null
null
11/01/2011 04:34:45
off topic
Wordpress programming video tutorials === I am a beginner in Wordpress programming. I am basically looking out for video tutorials that teach Wordpress programming and specifically creation of plugins and such advanced things. Are there any good video tutorials which teach such sort of stuff? or any courses from training companies like pluralsight. I know pluralsight is not into PHP but are there any other sites? I am even willing to pay for videos. The video tutorials need not be free however free is always welcome. Thanks in advance :)
2