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
7,760,226
10/13/2011 20:46:48
994,193
10/13/2011 19:24:00
1
0
Any online resources available to learn PHP?
Would appreciate your input on my request for suggestions. I would like to know of any online resources available to learn PHP ? Look forward to hear from all. Thanks.
php
null
null
null
null
10/13/2011 20:52:15
not constructive
Any online resources available to learn PHP? === Would appreciate your input on my request for suggestions. I would like to know of any online resources available to learn PHP ? Look forward to hear from all. Thanks.
4
8,827,564
01/11/2012 22:21:52
1,100,889
12/15/2011 22:29:25
1
0
Good book or website for Active Directory and .Net 4.0 programming
Can anyone suggest a good reference for active direcotry accessing with .Net 4.0? Thanks
active-directory
null
null
null
null
01/12/2012 01:37:06
not constructive
Good book or website for Active Directory and .Net 4.0 programming === Can anyone suggest a good reference for active direcotry accessing with .Net 4.0? Thanks
4
1,393,692
09/08/2009 12:20:53
4,685
09/05/2008 07:49:27
6,557
201
Are there any DirectX 11 programming books?
Anyone know any DirectX 11 programming books that have been printed already? or there will be soon? I'd like to buy one or preorder but haven't found one anywhere ...
books
directx
directx-11
null
null
09/27/2011 14:57:25
not constructive
Are there any DirectX 11 programming books? === Anyone know any DirectX 11 programming books that have been printed already? or there will be soon? I'd like to buy one or preorder but haven't found one anywhere ...
4
3,041,263
06/14/2010 22:01:37
366,733
06/14/2010 22:01:37
1
0
concatenation in php and html
$sun=$_POST["name"]; print "<ul>"; for(0;0<$sun;$sun++) { print "the value is".$sun."<input type="text" name="nam">"; } print "</ul>"; is it correct............?if it is false ,plz solve correct answer.....
html
null
null
null
null
06/15/2010 02:05:37
not a real question
concatenation in php and html === $sun=$_POST["name"]; print "<ul>"; for(0;0<$sun;$sun++) { print "the value is".$sun."<input type="text" name="nam">"; } print "</ul>"; is it correct............?if it is false ,plz solve correct answer.....
1
4,197,436
11/16/2010 18:09:03
509,638
11/16/2010 14:42:36
1
0
Too many sub-namespaces in Asp.Net? CS0234
Working on an Asp.Net project, adding a new control (ascx), run into a bizarre CS0234 issue. Basically, the compiler can't find a fully qualified namespace. What makes it *really* bizarre is that sometimes it can find it, and sometimes it can't. Each time I do a build it fails to find it in different files. That is, sometimes it builds. Sometimes it finds it in files a and b, but not c an d. Sometimes it finds the namespace in a, b, and c, but not d. And every other permutation. Add a new control defined in class ClassName (ClassName.ascx and ClassName.ascx.cs files). The path is: c:\..\Project\WebuserControls\ControlType The namespace is Project.WebUserControls.ControlType Throughout the project I call `Project.WebUserControls.ControlType.ClassName.SomeMethod();` When I compile I get error "CS0234 The type or namespace name 'Project.WebUserControls.ControlType' does not exist in the class or namespace 'Project.WebUserControls' (are you missing an assembly reference?)" even though it most certainly does exist in that namespace. Also, Intellisense can't find the namespace, or anything in it. The c# file is of the form namespace Project.WebUserControls.ControlType { using System ...etc public partial class ClassName : System.Web.UI.UserControl { After much googling about I find [this][1] , which maybe leads to a solution. In web.config: <system.web> ... <pages> ... <namespaces> <add namespace="Project.WebUserControls" /> Interestingly, if I replace `namespace="Project.WebUserControls"` with `namespace="Project.WebUserControls.ControlType"` it won't compile. This fix works for about half an hour, and several builds, but has now stopped working. No, I didn't change any code to make it stop working. Any ideas? [1]: http://stackoverflow.com/questions/4161948/net-extension-method-this-string-foo-only-partially-visible
c#
asp.net
web-config
null
null
null
open
Too many sub-namespaces in Asp.Net? CS0234 === Working on an Asp.Net project, adding a new control (ascx), run into a bizarre CS0234 issue. Basically, the compiler can't find a fully qualified namespace. What makes it *really* bizarre is that sometimes it can find it, and sometimes it can't. Each time I do a build it fails to find it in different files. That is, sometimes it builds. Sometimes it finds it in files a and b, but not c an d. Sometimes it finds the namespace in a, b, and c, but not d. And every other permutation. Add a new control defined in class ClassName (ClassName.ascx and ClassName.ascx.cs files). The path is: c:\..\Project\WebuserControls\ControlType The namespace is Project.WebUserControls.ControlType Throughout the project I call `Project.WebUserControls.ControlType.ClassName.SomeMethod();` When I compile I get error "CS0234 The type or namespace name 'Project.WebUserControls.ControlType' does not exist in the class or namespace 'Project.WebUserControls' (are you missing an assembly reference?)" even though it most certainly does exist in that namespace. Also, Intellisense can't find the namespace, or anything in it. The c# file is of the form namespace Project.WebUserControls.ControlType { using System ...etc public partial class ClassName : System.Web.UI.UserControl { After much googling about I find [this][1] , which maybe leads to a solution. In web.config: <system.web> ... <pages> ... <namespaces> <add namespace="Project.WebUserControls" /> Interestingly, if I replace `namespace="Project.WebUserControls"` with `namespace="Project.WebUserControls.ControlType"` it won't compile. This fix works for about half an hour, and several builds, but has now stopped working. No, I didn't change any code to make it stop working. Any ideas? [1]: http://stackoverflow.com/questions/4161948/net-extension-method-this-string-foo-only-partially-visible
0
11,514,193
07/16/2012 23:45:34
936,715
09/09/2011 12:01:04
35
7
Tip: Apache Cordova and Android: Unable to instantiate activity ComponentInfo
This one really got my nerves. After 2-3 days of going through the various sources, I found a solution to a common problem that arises. The context is based on the PhoneGap demo provided using Android <a>http://j.mp/MB1pTM</a>. The demo itself, failed for me while doing the exact setup for Android 4.0.3 using PhoneGap API documentation. I get the below error message: 07-16 23:01:58.485: E/AndroidRuntime(778): FATAL EXCEPTION: main 07-16 23:01:58.485: E/AndroidRuntime(778): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.test.shreyas.main/com.test.shreyas.main.HelloCordovaActivity}: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.access$600(ActivityThread.java:123) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Handler.dispatchMessage(Handler.java:99) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Looper.loop(Looper.java:137) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.main(ActivityThread.java:4424) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invokeNative(Native Method) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invoke(Method.java:511) 07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.NativeStart.main(Native Method) 07-16 23:01:58.485: E/AndroidRuntime(778): Caused by: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity 07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871) 07-16 23:01:58.485: E/AndroidRuntime(778): ... 11 more
android
apache
cordova
eclipse-adt
null
null
open
Tip: Apache Cordova and Android: Unable to instantiate activity ComponentInfo === This one really got my nerves. After 2-3 days of going through the various sources, I found a solution to a common problem that arises. The context is based on the PhoneGap demo provided using Android <a>http://j.mp/MB1pTM</a>. The demo itself, failed for me while doing the exact setup for Android 4.0.3 using PhoneGap API documentation. I get the below error message: 07-16 23:01:58.485: E/AndroidRuntime(778): FATAL EXCEPTION: main 07-16 23:01:58.485: E/AndroidRuntime(778): java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.test.shreyas.main/com.test.shreyas.main.HelloCordovaActivity}: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1880) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1981) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.access$600(ActivityThread.java:123) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1147) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Handler.dispatchMessage(Handler.java:99) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.os.Looper.loop(Looper.java:137) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.main(ActivityThread.java:4424) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invokeNative(Native Method) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.reflect.Method.invoke(Method.java:511) 07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784) 07-16 23:01:58.485: E/AndroidRuntime(778): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551) 07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.NativeStart.main(Native Method) 07-16 23:01:58.485: E/AndroidRuntime(778): Caused by: java.lang.ClassNotFoundException: com.test.shreyas.main.HelloCordovaActivity 07-16 23:01:58.485: E/AndroidRuntime(778): at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:61) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:501) 07-16 23:01:58.485: E/AndroidRuntime(778): at java.lang.ClassLoader.loadClass(ClassLoader.java:461) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.Instrumentation.newActivity(Instrumentation.java:1023) 07-16 23:01:58.485: E/AndroidRuntime(778): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1871) 07-16 23:01:58.485: E/AndroidRuntime(778): ... 11 more
0
5,603,597
04/09/2011 07:39:46
627,820
02/22/2011 06:27:41
23
0
Opengl compressed texture with lwjgl
I have a DXT1 texture loaded in a ByteBuffer and I'm trying to load it with Opengl int tID = glGenTextures(); glBindTexture(GL_TEXTURE_2D, tID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, imageData); System.out.println(gluErrorString(glGetError())); It's giving me the error "Invalid Operation" on the glCompressedTexImage2D call. Can't seem to figure out why.
opengl
textures
lwjgl
null
null
null
open
Opengl compressed texture with lwjgl === I have a DXT1 texture loaded in a ByteBuffer and I'm trying to load it with Opengl int tID = glGenTextures(); glBindTexture(GL_TEXTURE_2D, tID); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glCompressedTexImage2D(GL_TEXTURE_2D, 0, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, w, h, 0, imageData); System.out.println(gluErrorString(glGetError())); It's giving me the error "Invalid Operation" on the glCompressedTexImage2D call. Can't seem to figure out why.
0
5,991,241
05/13/2011 11:33:19
402,186
07/26/2010 11:05:44
56
0
ASP.NET and PHP Aug-Sep (2010) statictics
I was looking at the framework usage statistics at: http://trends.builtwith.com/framework to compare ASP.NET usage in the industry with PHP and other technologies available. I noticed the major share in the WEB industry is shared by both with PHP 10% higher than ASP. However when i looked into the individual statistics of the both, that shows the industry adoption of the technologies over the period of time, I noticed that between August-2010 and September-2010 the graph of ASP suddenly decreased and it is exactly in this time, when the graph of PHP increased. individual graphs can be found at: ASP: http://trends.builtwith.com/framework/ASP.NET PHP: http://trends.builtwith.com/framework/PHP any ideas what happened between Aug-2010 to Sep-2010 that could have caused this? Any new technologies introduced in the industry that was compatible with one and not the other? or may be some thing else?
php
asp.net
statistics
null
null
05/13/2011 14:02:16
off topic
ASP.NET and PHP Aug-Sep (2010) statictics === I was looking at the framework usage statistics at: http://trends.builtwith.com/framework to compare ASP.NET usage in the industry with PHP and other technologies available. I noticed the major share in the WEB industry is shared by both with PHP 10% higher than ASP. However when i looked into the individual statistics of the both, that shows the industry adoption of the technologies over the period of time, I noticed that between August-2010 and September-2010 the graph of ASP suddenly decreased and it is exactly in this time, when the graph of PHP increased. individual graphs can be found at: ASP: http://trends.builtwith.com/framework/ASP.NET PHP: http://trends.builtwith.com/framework/PHP any ideas what happened between Aug-2010 to Sep-2010 that could have caused this? Any new technologies introduced in the industry that was compatible with one and not the other? or may be some thing else?
2
6,926,291
08/03/2011 12:14:56
853,479
07/20/2011 07:56:28
1
0
Restricting users to use un-paid wordpress Plugin
I am developing a Wordpress Plug-in, which I wish to sell on a set price and also I want to restrict the use of the Plugin to the users who have paid for it. I would like to know the different ways of implementing this functionality. Any help will be highly appreciated. Thanks, G
wordpress
plugins
null
null
null
08/03/2011 18:37:29
not constructive
Restricting users to use un-paid wordpress Plugin === I am developing a Wordpress Plug-in, which I wish to sell on a set price and also I want to restrict the use of the Plugin to the users who have paid for it. I would like to know the different ways of implementing this functionality. Any help will be highly appreciated. Thanks, G
4
5,412,854
03/23/2011 23:14:58
647,146
03/06/2011 17:44:54
3
0
Java - Help with parsing file into arrayList
I need another set of eyes to tell me a better way to do this: //break the input file down into lines of text using line.separator as a delimiter public void readFromFile(String file) { try { String inFile = file; Scanner scanner = new Scanner(new File(inFile)); scanner.useDelimiter(System.getProperty("line.separator")); //(";"); while (scanner.hasNext()) { addLine(scanner.next()); } scanner.close(); } catch (FileNotFoundException ex) { Logger.getLogger(ContactBook.class.getName()).log(Level.SEVERE, null, ex); } } //break the lines of text down into individual objects using a comma as a delimiter public void addLine(String line) { Scanner scan = new Scanner(line); scan.useDelimiter(":"); while (scan.hasNext()) { int index = 0; Object lName = scan.next(); Object fName = scan.next(); Object mName = scan.next(); Object streetName = scan.next(); Object cityName = scan.next(); Object stateName = scan.next(); Object zipCode = scan.next(); Object hPhone = scan.next(); Object cPhone = scan.next(); //CONSTRUCT OBJECTS address = new Address(streetName, cityName, stateName, zipCode); person = new Person(lName, fName, mName); friend = new Friend(lName, fName, mName, streetName, cityName, stateName, zipCode, hPhone, cPhone); addToList(friend); index++; }//end while loop scan.close(); }//end addContact method Its for an AddressBook program as part of a homework assignment. it all works but I have gotten advice saying this isn't the best way to parse file input. Any advice would be helpful.
java
io
null
null
null
03/25/2011 13:24:32
not a real question
Java - Help with parsing file into arrayList === I need another set of eyes to tell me a better way to do this: //break the input file down into lines of text using line.separator as a delimiter public void readFromFile(String file) { try { String inFile = file; Scanner scanner = new Scanner(new File(inFile)); scanner.useDelimiter(System.getProperty("line.separator")); //(";"); while (scanner.hasNext()) { addLine(scanner.next()); } scanner.close(); } catch (FileNotFoundException ex) { Logger.getLogger(ContactBook.class.getName()).log(Level.SEVERE, null, ex); } } //break the lines of text down into individual objects using a comma as a delimiter public void addLine(String line) { Scanner scan = new Scanner(line); scan.useDelimiter(":"); while (scan.hasNext()) { int index = 0; Object lName = scan.next(); Object fName = scan.next(); Object mName = scan.next(); Object streetName = scan.next(); Object cityName = scan.next(); Object stateName = scan.next(); Object zipCode = scan.next(); Object hPhone = scan.next(); Object cPhone = scan.next(); //CONSTRUCT OBJECTS address = new Address(streetName, cityName, stateName, zipCode); person = new Person(lName, fName, mName); friend = new Friend(lName, fName, mName, streetName, cityName, stateName, zipCode, hPhone, cPhone); addToList(friend); index++; }//end while loop scan.close(); }//end addContact method Its for an AddressBook program as part of a homework assignment. it all works but I have gotten advice saying this isn't the best way to parse file input. Any advice would be helpful.
1
5,816,259
04/28/2011 09:11:18
384,201
07/06/2010 05:51:35
32
6
how to set session in phpbb ?
please help me in setting session in phphbb ? thanks in advance
php
phpbb3
null
null
null
04/28/2011 09:26:06
not a real question
how to set session in phpbb ? === please help me in setting session in phphbb ? thanks in advance
1
11,473,090
07/13/2012 15:01:34
1,510,439
07/08/2012 18:55:49
1
0
I accidentally deleted the pch file in my C++ project. How can I recreate it?
Please send me a step by step procedure to recereaqte the deleted pch file
c++
null
null
null
null
07/16/2012 14:20:27
not a real question
I accidentally deleted the pch file in my C++ project. How can I recreate it? === Please send me a step by step procedure to recereaqte the deleted pch file
1
10,684,293
05/21/2012 11:23:39
1,407,685
05/21/2012 10:55:29
1
0
Hidden Field value returns null when i access it from javascript function on the same page
**what i wrote in my aspx form ::** <%@ Page Title="Sector Composition" Language="C#" MasterPageFile="~/UIPages/ApexM.Master" AutoEventWireup="true" CodeFile="Sector_Composition.aspx.cs" Inherits="Anonymous_Sector_Composition" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> <script type="text/javascript"> var browserData = []; var versionsData = []; var chart; function OnPageLoad() { var oJSON_DataTable_DataHolder = document.getElementById("JSON_DataTable_DataHolder"); var oJSON = eval("(" + oJSON_DataTable_DataHolder.value + ")"); var colors = Highcharts.getOptions().colors; for (var i = 0; i < oJSON.TABLE[0].ROW.length; i++) { for (var j = 0; j < oJSON.TABLE[0].ROW[i].COL.length; j++) { // add browser data browserData.push({ name: oJSON.TABLE[0].ROW[i].COL[1].DATA, y: oJSON.TABLE[0].ROW[i].COL[2].DATA, color: colors[i].color }); // add browser data versionsData.push({ name: oJSON.TABLE[0].ROW[i].COL[1].DATA, y: oJSON.TABLE[0].ROW[i].COL[4].DATA, color: colors[i].color }); } } // Build the data arrays // Create the chart chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'pie' }, title: { text: 'Browser market share, April, 2011' }, yAxis: { title: { text: 'Total percent market share' } }, plotOptions: { pie: { shadow: false } }, tooltip: { formatter: function () { return '<b>' + this.point.name + '</b>: ' + this.y + ' %'; } }, series: [{ name: 'Browsers', data: browserData, size: '60%', dataLabels: { formatter: function () { return this.y > 5 ? this.point.name : null; }, color: 'white', distance: -30 } }, { name: 'Versions', data: versionsData, innerSize: '60%', dataLabels: { formatter: function () { // display only if larger than 1 return this.y > 1 ? '<b>' + this.point.name + ':</b> ' + this.y + '%' : null; } } }] }); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server"> <div id="Container"> </div> <div> <asp:HiddenField ID="JSON_DataTable_DataHolder" runat="server" /> </div> </asp:Content> **In my Code behind :::** protected void Page_Load(object sender, EventArgs e) { psp_Chart_Composition_MktCapTableAdapter composition = new psp_Chart_Composition_MktCapTableAdapter(); DataTable compositions = composition.GetData(); JSON_Class Object_JSON_Class = new JSON_Class(); ///////// JSON String with Rows And Cols//////////////////////////// JSON_DataTable_DataHolder.Value = Object_JSON_Class.JSON_DataTable(compositions); } what is the problem with the code ?? i could not get the value of the hidden field in the javascript function. i have tried with function call window.onload= OnPageLoad; and also of a button onclientclick event.
javascript
json
hidden
null
null
null
open
Hidden Field value returns null when i access it from javascript function on the same page === **what i wrote in my aspx form ::** <%@ Page Title="Sector Composition" Language="C#" MasterPageFile="~/UIPages/ApexM.Master" AutoEventWireup="true" CodeFile="Sector_Composition.aspx.cs" Inherits="Anonymous_Sector_Composition" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server"> <script type="text/javascript"> var browserData = []; var versionsData = []; var chart; function OnPageLoad() { var oJSON_DataTable_DataHolder = document.getElementById("JSON_DataTable_DataHolder"); var oJSON = eval("(" + oJSON_DataTable_DataHolder.value + ")"); var colors = Highcharts.getOptions().colors; for (var i = 0; i < oJSON.TABLE[0].ROW.length; i++) { for (var j = 0; j < oJSON.TABLE[0].ROW[i].COL.length; j++) { // add browser data browserData.push({ name: oJSON.TABLE[0].ROW[i].COL[1].DATA, y: oJSON.TABLE[0].ROW[i].COL[2].DATA, color: colors[i].color }); // add browser data versionsData.push({ name: oJSON.TABLE[0].ROW[i].COL[1].DATA, y: oJSON.TABLE[0].ROW[i].COL[4].DATA, color: colors[i].color }); } } // Build the data arrays // Create the chart chart = new Highcharts.Chart({ chart: { renderTo: 'container', type: 'pie' }, title: { text: 'Browser market share, April, 2011' }, yAxis: { title: { text: 'Total percent market share' } }, plotOptions: { pie: { shadow: false } }, tooltip: { formatter: function () { return '<b>' + this.point.name + '</b>: ' + this.y + ' %'; } }, series: [{ name: 'Browsers', data: browserData, size: '60%', dataLabels: { formatter: function () { return this.y > 5 ? this.point.name : null; }, color: 'white', distance: -30 } }, { name: 'Versions', data: versionsData, innerSize: '60%', dataLabels: { formatter: function () { // display only if larger than 1 return this.y > 1 ? '<b>' + this.point.name + ':</b> ' + this.y + '%' : null; } } }] }); } </script> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="cphContent" runat="Server"> <div id="Container"> </div> <div> <asp:HiddenField ID="JSON_DataTable_DataHolder" runat="server" /> </div> </asp:Content> **In my Code behind :::** protected void Page_Load(object sender, EventArgs e) { psp_Chart_Composition_MktCapTableAdapter composition = new psp_Chart_Composition_MktCapTableAdapter(); DataTable compositions = composition.GetData(); JSON_Class Object_JSON_Class = new JSON_Class(); ///////// JSON String with Rows And Cols//////////////////////////// JSON_DataTable_DataHolder.Value = Object_JSON_Class.JSON_DataTable(compositions); } what is the problem with the code ?? i could not get the value of the hidden field in the javascript function. i have tried with function call window.onload= OnPageLoad; and also of a button onclientclick event.
0
8,253,334
11/24/2011 07:09:11
51,115
01/03/2009 08:11:29
350
18
Problems with logging setup in bootstrapped Pyramid
I am trying to do simple file logging config in pyramid, with python 2.7.2 and pyramid 1.2.3 It isn't working at all how I expected. It looks like even though i'm bootstrapping into pyramid, it isn't loading the right logs. Specific problems below within test.py: test.py from pyramid.paster import bootstrap env = bootstrap('../test.ini') import logging logging.basicConfig() #this apparently makes no difference log=logging.getLogger('root') print log.handlers >>> [] That's weird! no handlers? Apparently it's not the log I am thinking of. print log >>> logging.Logger shouldn't it be a RootLogger? print log.parent >>> [<logging.RootLogger>] hmm so the parent of getLogger('root') is the real RootLogger? let's see what its handlers are: print log.parent.handlers >>> [<logging.StreamHandler>] that's weird. test.ini: [app:proj] use = egg:proj sqlalchemy.url = mysql+mysqldb://proj_staging:pw@localhost/proj_staging?charset=utf8 # This apparently helps avoid mysql gone away errors sqlalchemy.pool_recycle = 3600 [pipeline:main] pipeline = proj [loggers] keys = root, proj, scraper [handlers] keys = console, file [formatters] keys = generic [logger_root] level = INFO handlers = file [logger_proj] level = DEBUG handlers = qualname = proj [logger_scraper] level = INFO handlers = [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [handler_file] class = FileHandler args=('../logs/proj.log','a') formatter = generic level = INFO [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
python
pyramid
null
null
null
null
open
Problems with logging setup in bootstrapped Pyramid === I am trying to do simple file logging config in pyramid, with python 2.7.2 and pyramid 1.2.3 It isn't working at all how I expected. It looks like even though i'm bootstrapping into pyramid, it isn't loading the right logs. Specific problems below within test.py: test.py from pyramid.paster import bootstrap env = bootstrap('../test.ini') import logging logging.basicConfig() #this apparently makes no difference log=logging.getLogger('root') print log.handlers >>> [] That's weird! no handlers? Apparently it's not the log I am thinking of. print log >>> logging.Logger shouldn't it be a RootLogger? print log.parent >>> [<logging.RootLogger>] hmm so the parent of getLogger('root') is the real RootLogger? let's see what its handlers are: print log.parent.handlers >>> [<logging.StreamHandler>] that's weird. test.ini: [app:proj] use = egg:proj sqlalchemy.url = mysql+mysqldb://proj_staging:pw@localhost/proj_staging?charset=utf8 # This apparently helps avoid mysql gone away errors sqlalchemy.pool_recycle = 3600 [pipeline:main] pipeline = proj [loggers] keys = root, proj, scraper [handlers] keys = console, file [formatters] keys = generic [logger_root] level = INFO handlers = file [logger_proj] level = DEBUG handlers = qualname = proj [logger_scraper] level = INFO handlers = [handler_console] class = StreamHandler args = (sys.stderr,) level = NOTSET formatter = generic [handler_file] class = FileHandler args=('../logs/proj.log','a') formatter = generic level = INFO [formatter_generic] format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s
0
9,616,013
03/08/2012 10:18:29
431,657
08/26/2010 09:09:41
1,066
60
Integrating Visio exported XAML into Silverlight application
It is possible to export Microsoft Visio drawings as a Website containing Silverlight content. This is described on this [blog-post][1]. The output of such an export are the following: - xaml_1.xaml (contains the structure of the control) - data.xml (contains all text content such as labels, etc) - several java-script files - *.htm pages with a Silverlight container - other files such as *.css and images I would like to integrate the exported XAML code into another existing Silverlight application. I found this [blog-post][2] telling me how to load XAML code dynamically during runtime. What I would like to know is how to "merge" the XAML-file and the data.xml and how I can get a reference to the items of the XAML code, in order to change certain texts... [1]: http://visualsignals.typepad.co.uk/vislog/2009/08/visio-2010-save-as-silverlight.html [2]: http://blogs.silverlight.net/blogs/msnow/archive/2008/10/09/silverlight-tip-of-the-day-60-how-to-load-a-control-straight-from-xaml.aspx
silverlight
visio
null
null
null
null
open
Integrating Visio exported XAML into Silverlight application === It is possible to export Microsoft Visio drawings as a Website containing Silverlight content. This is described on this [blog-post][1]. The output of such an export are the following: - xaml_1.xaml (contains the structure of the control) - data.xml (contains all text content such as labels, etc) - several java-script files - *.htm pages with a Silverlight container - other files such as *.css and images I would like to integrate the exported XAML code into another existing Silverlight application. I found this [blog-post][2] telling me how to load XAML code dynamically during runtime. What I would like to know is how to "merge" the XAML-file and the data.xml and how I can get a reference to the items of the XAML code, in order to change certain texts... [1]: http://visualsignals.typepad.co.uk/vislog/2009/08/visio-2010-save-as-silverlight.html [2]: http://blogs.silverlight.net/blogs/msnow/archive/2008/10/09/silverlight-tip-of-the-day-60-how-to-load-a-control-straight-from-xaml.aspx
0
11,396,997
07/09/2012 14:23:08
1,215,923
02/17/2012 10:02:15
3
0
websql phoegap app
I'm upgrading my android/phonegap app in the google market store. Due to an oversight on my part, I need to start again and will need to delete existing user data stored in websql and start again capturing it in the correct format. What's the best way to do this to ensure the data is deleted the first time the app is upgraded on the users phone and doesn't do it each time the app is launched? thanks
javascript
android
web-sql
null
null
null
open
websql phoegap app === I'm upgrading my android/phonegap app in the google market store. Due to an oversight on my part, I need to start again and will need to delete existing user data stored in websql and start again capturing it in the correct format. What's the best way to do this to ensure the data is deleted the first time the app is upgraded on the users phone and doesn't do it each time the app is launched? thanks
0
10,546,212
05/11/2012 06:04:41
1,330,803
04/13/2012 05:48:27
21
0
what is the use onClose() in blackberry
` public boolean onClose() { if (isRequireSettle()) Dialog.alert("close??"); else close(); return true; } }` what happens on the screen if onClose() method calls
java
blackberry
user-interface
blackberry-jde
null
07/22/2012 02:46:46
not a real question
what is the use onClose() in blackberry === ` public boolean onClose() { if (isRequireSettle()) Dialog.alert("close??"); else close(); return true; } }` what happens on the screen if onClose() method calls
1
7,211,498
08/26/2011 23:32:22
587,706
01/24/2011 15:34:08
26
0
XNA Rhythm(Music) Based Game
What's the best way to program a rhythm based game in XNA? (Some sort of game like Dance Dance Revolution) Would you use the built in GameTime? What logic would you use to make sure the game constantly stays in sync to the music? Any tips would be much appreciated!
xna
music
null
null
null
08/30/2011 03:16:12
off topic
XNA Rhythm(Music) Based Game === What's the best way to program a rhythm based game in XNA? (Some sort of game like Dance Dance Revolution) Would you use the built in GameTime? What logic would you use to make sure the game constantly stays in sync to the music? Any tips would be much appreciated!
2
9,888,435
03/27/2012 11:09:41
279,738
02/23/2010 18:27:37
588
28
Proven paradigms for lightweight GUI API construction
**This question is NOT about "effective user interface design" i.e. end-user usability.** It is about designing an efficient lightweight UI API by leveraging known/existing UI API paradigms which offer maximum programmer usability with minimum effort. In developing games, I've often felt my knowledge of UI class and API construction to be lacking. I would like to gather more knowledge on effective paradigms used to implement UI APIs extant in the wild. Assuming no language/platform in particular, I ask for your suggestions on eminently usable, lightweight APIs, and what it is that makes them so. Ideal answer format would be: [API name] [pros] [cons] *OR* [Approach] [pros] [cons] I do not mention any of those APIs/approaches I am presently aware of / familiar with, because I don't wish to exclude any potential answers -- I'd like as varied a set of responses as possible so I can get a broader overview.
gui
game-engine
api-design
lightweight
null
03/28/2012 15:47:57
not constructive
Proven paradigms for lightweight GUI API construction === **This question is NOT about "effective user interface design" i.e. end-user usability.** It is about designing an efficient lightweight UI API by leveraging known/existing UI API paradigms which offer maximum programmer usability with minimum effort. In developing games, I've often felt my knowledge of UI class and API construction to be lacking. I would like to gather more knowledge on effective paradigms used to implement UI APIs extant in the wild. Assuming no language/platform in particular, I ask for your suggestions on eminently usable, lightweight APIs, and what it is that makes them so. Ideal answer format would be: [API name] [pros] [cons] *OR* [Approach] [pros] [cons] I do not mention any of those APIs/approaches I am presently aware of / familiar with, because I don't wish to exclude any potential answers -- I'd like as varied a set of responses as possible so I can get a broader overview.
4
4,883,483
02/03/2011 07:33:18
601,123
02/03/2011 07:33:18
1
0
How is Ubuntu? Is it better to put that instead of Windows.
I currently have Windows and was thinking of migrating to Ubuntu fully. I have used ubuntu quite some many times but had some questions. 1. Can you install adobe photoshop and dreamweaver and flash on ubuntu. 2. What can you do that you cant do on Windows 3. Can you show me how you have made your background of Ubuntu would love it. Also would you suggest a few things to be installed once ubuntu is setup Like Wine.. What else guys. Need suggestions so i can transform my laptop today to Ubuntu
windows
open-source
ubuntu
null
null
02/03/2011 07:40:45
off topic
How is Ubuntu? Is it better to put that instead of Windows. === I currently have Windows and was thinking of migrating to Ubuntu fully. I have used ubuntu quite some many times but had some questions. 1. Can you install adobe photoshop and dreamweaver and flash on ubuntu. 2. What can you do that you cant do on Windows 3. Can you show me how you have made your background of Ubuntu would love it. Also would you suggest a few things to be installed once ubuntu is setup Like Wine.. What else guys. Need suggestions so i can transform my laptop today to Ubuntu
2
6,558,212
07/02/2011 16:27:22
825,133
07/01/2011 15:29:01
1
0
Java Program Error
While i, was learning a book , i came across a java example. when i compiled it , i had no error . but when i ran it , it showed "Exception in thread "main" java.lang.NoSuchMethodError: main" since i am beginner in java , i dont know what it is. the program is import java.awt.*; import java.awt.event.*; class Party{ public void buildInvite(){ Frame f = new Frame(); Label l = new Label("Party at Tim's"); Button B = new Button("You Bet"); Button c = new Button("Shoot me"); Panel p = new Panel(); p.add(l); } } so help me to overcome it !!!
java
application
null
null
null
07/04/2011 14:04:49
not constructive
Java Program Error === While i, was learning a book , i came across a java example. when i compiled it , i had no error . but when i ran it , it showed "Exception in thread "main" java.lang.NoSuchMethodError: main" since i am beginner in java , i dont know what it is. the program is import java.awt.*; import java.awt.event.*; class Party{ public void buildInvite(){ Frame f = new Frame(); Label l = new Label("Party at Tim's"); Button B = new Button("You Bet"); Button c = new Button("Shoot me"); Panel p = new Panel(); p.add(l); } } so help me to overcome it !!!
4
11,733,359
07/31/2012 04:58:45
1,386,445
05/10/2012 07:37:56
6
0
how to uninstall sql 2008 multiple instances without restarting server ?
how to uninstall sql 2008 multiple instances without restarting server ? SQl installer failing with error : server need restart after one instance uninstalled . Its not practical for us to restrart the server to uninstall every single instance, thank you .
sql
sql-server-2008-r2
null
null
null
07/31/2012 15:16:25
off topic
how to uninstall sql 2008 multiple instances without restarting server ? === how to uninstall sql 2008 multiple instances without restarting server ? SQl installer failing with error : server need restart after one instance uninstalled . Its not practical for us to restrart the server to uninstall every single instance, thank you .
2
7,226,859
08/29/2011 06:31:06
704,307
04/12/2011 14:39:47
18
0
allocation and dealocatipn ogf Object
I created object *Obj = [[Obj alloc] init]; What happened? After I release it, the object is deallocated.Then What may happen? If I try to create the object again, what will happen?
iphone
null
null
null
null
08/29/2011 13:24:39
not constructive
allocation and dealocatipn ogf Object === I created object *Obj = [[Obj alloc] init]; What happened? After I release it, the object is deallocated.Then What may happen? If I try to create the object again, what will happen?
4
4,760,302
01/21/2011 15:04:44
579,616
01/18/2011 08:34:25
1
0
Is it possible to cast a FxCop.SDK.TypeNode to a System.Type
Is it possible to cast a FxCop.SDK.TypeNode in Microsoft.FxCop.Sdk to an System.Type ?
fxcop
null
null
null
null
null
open
Is it possible to cast a FxCop.SDK.TypeNode to a System.Type === Is it possible to cast a FxCop.SDK.TypeNode in Microsoft.FxCop.Sdk to an System.Type ?
0
636,179
03/11/2009 20:18:48
48,465
12/22/2008 20:24:42
801
36
How to use Generic Handlers (ASHX) in ASP.NET MVC?
I need a image generator in my ASP.NET MVC application, but I don't know if it is possible to use ASHX in ASP.NET MVC. If there is an class similar to IHttpHandler that inherits IViewDataContainer, then I could use ViewData.Model on my ASHX. I read a [blog post about it](http://www.marklio.com/marklio/CommentView,guid,df8d6471-83fd-4f66-a799-ef8274979f0e.aspx) but it seem outdated from the info I got in the [ASP.NET forum](http://forums.asp.net/t/1233238.aspx) Any ideas?
.net
asp.net
asp.net-mvc
http-handler
ashx
null
open
How to use Generic Handlers (ASHX) in ASP.NET MVC? === I need a image generator in my ASP.NET MVC application, but I don't know if it is possible to use ASHX in ASP.NET MVC. If there is an class similar to IHttpHandler that inherits IViewDataContainer, then I could use ViewData.Model on my ASHX. I read a [blog post about it](http://www.marklio.com/marklio/CommentView,guid,df8d6471-83fd-4f66-a799-ef8274979f0e.aspx) but it seem outdated from the info I got in the [ASP.NET forum](http://forums.asp.net/t/1233238.aspx) Any ideas?
0
8,746,159
01/05/2012 16:39:52
753,341
05/14/2011 05:48:17
1,248
23
How do I delete *ALL* files and directories from a git repository?
I have a repo on github and I need to complete reset it , i.e start uploading from scratch. How exactly do I remove all files and directories in the repository using git?
git
github
null
null
null
null
open
How do I delete *ALL* files and directories from a git repository? === I have a repo on github and I need to complete reset it , i.e start uploading from scratch. How exactly do I remove all files and directories in the repository using git?
0
5,768,905
04/24/2011 05:52:03
719,617
04/21/2011 20:20:08
1
1
dup keys from keytool?
So, I generate a key-pair on computer A and submit a CSR to a CA. I do the same thing on computer B. Extend this to N folks who run the Key generation tool locally and submit CSR to CA. Is there a possibility of generating duplicate public keys? If Yes, does CA catches this duplication when CSR is submitted? OR how can keygen type tools which run locally to create the key-pair ensure unique public keys? If one were to just create self-signed certs (no signature from CA) in the above scenario, I have the same question on uniqueness of public keys.
key
pki
null
null
null
04/25/2011 14:36:21
off topic
dup keys from keytool? === So, I generate a key-pair on computer A and submit a CSR to a CA. I do the same thing on computer B. Extend this to N folks who run the Key generation tool locally and submit CSR to CA. Is there a possibility of generating duplicate public keys? If Yes, does CA catches this duplication when CSR is submitted? OR how can keygen type tools which run locally to create the key-pair ensure unique public keys? If one were to just create self-signed certs (no signature from CA) in the above scenario, I have the same question on uniqueness of public keys.
2
2,278,777
02/17/2010 06:36:00
1,470,997
12/28/2009 11:31:32
95
6
JQuery Session problem
I using jquery session in my master page. Anything i am missing. Code. <script type="text/javascript" language="javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $.session("lnkID","A1") }); </script> Error: Microsoft JScript runtime error: Object doesn't support this property or method
jquery-session
asp.net
null
null
null
null
open
JQuery Session problem === I using jquery session in my master page. Anything i am missing. Code. <script type="text/javascript" language="javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { $.session("lnkID","A1") }); </script> Error: Microsoft JScript runtime error: Object doesn't support this property or method
0
6,431,485
06/21/2011 20:20:32
809,207
06/21/2011 20:20:32
1
0
Fibonchi Recursion.
Alright, so I've tried to search for it, and yes, I found the answer, but not the explanation of it, I'd like to know the explanation of the following result: float fib(int num) { float result; if (num==1) result=0; else { if (num==2) result=1; else result=fib(num-1)+fib(num-2); } return result; Thanks alot!
c#
null
null
null
null
06/21/2011 20:23:12
not a real question
Fibonchi Recursion. === Alright, so I've tried to search for it, and yes, I found the answer, but not the explanation of it, I'd like to know the explanation of the following result: float fib(int num) { float result; if (num==1) result=0; else { if (num==2) result=1; else result=fib(num-1)+fib(num-2); } return result; Thanks alot!
1
10,074,743
04/09/2012 14:30:19
1,322,043
04/09/2012 14:21:48
1
0
Java code to find the repeating and missing numbers and inlude the missing sequence number
Please help me... Hi, i am new this blog. But, i have seen lot of really important responses. So, I am requesting help as I am in need of it. I want a program to find the repeated and missing number in the list and replace it with the right sequence number. Note: Maximum length of list is 10. Example1: 1, 1, 2, 3, 4, 5 should display as: 1, 2, 3, 4, 5, 6 Example2: 1, 2, 2, 3, 4, 5 should display as: 1, 2, 3, 4, 5, 6 Example3: 2, 3, 4, 5 should display as: 2, 3, 4, 5 Thanks in advance.
java
null
null
null
null
04/09/2012 18:28:39
not a real question
Java code to find the repeating and missing numbers and inlude the missing sequence number === Please help me... Hi, i am new this blog. But, i have seen lot of really important responses. So, I am requesting help as I am in need of it. I want a program to find the repeated and missing number in the list and replace it with the right sequence number. Note: Maximum length of list is 10. Example1: 1, 1, 2, 3, 4, 5 should display as: 1, 2, 3, 4, 5, 6 Example2: 1, 2, 2, 3, 4, 5 should display as: 1, 2, 3, 4, 5, 6 Example3: 2, 3, 4, 5 should display as: 2, 3, 4, 5 Thanks in advance.
1
2,130,780
01/25/2010 07:17:22
193,133
10/20/2009 13:52:13
189
1
sharepoint 2007 -where is the layouts directory i cant find it ?
i have moss 2007 . i cant find any _layouts directory where is it ? do i have to create it or do some configuration ? i need it because i have to add a javascript file .js file to it according to this link [http://weblogs.asp.net/wesleybakker/archive/2009/03/05/select-multiple-list-items-in-sharepoint-feature.aspx][1] any help appreciated [1]: http://weblogs.asp.net/wesleybakker/archive/2009/03/05/select-multiple-list-items-in-sharepoint-feature.aspx
sharepoint
null
null
null
null
null
open
sharepoint 2007 -where is the layouts directory i cant find it ? === i have moss 2007 . i cant find any _layouts directory where is it ? do i have to create it or do some configuration ? i need it because i have to add a javascript file .js file to it according to this link [http://weblogs.asp.net/wesleybakker/archive/2009/03/05/select-multiple-list-items-in-sharepoint-feature.aspx][1] any help appreciated [1]: http://weblogs.asp.net/wesleybakker/archive/2009/03/05/select-multiple-list-items-in-sharepoint-feature.aspx
0
9,601,134
03/07/2012 12:01:17
985,289
10/08/2011 11:18:41
71
1
Eclipse autocomplete not working when using .class package
I've generated .class files from a web service. Now I want to use them in a project that I have. For that I included the .class in a package. The problem is that Eclipse simply doesn't autocomplete when I try to call the methods wihtin the .class files...in fact for what I could understand it didn't even seem to recognize the package had something in it. If I use the .java files everything works fine but I'd prefer to use the already compiled and smaller .class files. How can I do it?
java
eclipse
autocomplete
null
null
null
open
Eclipse autocomplete not working when using .class package === I've generated .class files from a web service. Now I want to use them in a project that I have. For that I included the .class in a package. The problem is that Eclipse simply doesn't autocomplete when I try to call the methods wihtin the .class files...in fact for what I could understand it didn't even seem to recognize the package had something in it. If I use the .java files everything works fine but I'd prefer to use the already compiled and smaller .class files. How can I do it?
0
671,656
03/22/2009 21:43:24
64,672
02/10/2009 17:12:14
391
9
Is agile scientifically proven?
Are there any scientific studies that have compared agile to other software development methodologies? I think agile is a nice way of working, but is there any scientific basis for it? I'm looking for something like [this][1], except this study only deals with TDD. Have there been studies about agile in general? I'm asking this because I met a agile-zealot who claimed the agile way of working produces better software than all the other ways of working. He presented this as a fact, which I don't think it is. [1]: http://www.infoq.com/news/2009/03/TDD-Improves-Quality
agile
methodology
null
null
null
null
open
Is agile scientifically proven? === Are there any scientific studies that have compared agile to other software development methodologies? I think agile is a nice way of working, but is there any scientific basis for it? I'm looking for something like [this][1], except this study only deals with TDD. Have there been studies about agile in general? I'm asking this because I met a agile-zealot who claimed the agile way of working produces better software than all the other ways of working. He presented this as a fact, which I don't think it is. [1]: http://www.infoq.com/news/2009/03/TDD-Improves-Quality
0
4,334,506
12/02/2010 11:34:27
527,002
12/01/2010 18:45:44
1
1
Hash and sign a message with RSA algo in c# for compact framework
Hy everybody, I try to sign one message with RSA algorithm, i'm working to compact Framwork this is my Code: private void Signer_Click(object sender, EventArgs e) { ///cle de string ver byte[] string clePriveeFile = @"\Program Files\PrivateKey.pem"; StreamReader reader = new StreamReader(clePriveeFile); string contenuKeyPrivate = reader.ReadToEnd(); byte[] keyByte = Certification.DecodeOpenSSLPrivateKey(contenuKeyPrivate); string Data = "Salut tout le monde"; byte[] DataBytes = System.Text.Encoding.UTF8.GetBytes(Data);//.UTF7.GetBytes(Data); //Hasher le message SHA1Managed sha1 = new SHA1Managed(); byte[] hash = sha1.ComputeHash(DataBytes); string hach = Convert.ToBase64String(hash); RSACryptoServiceProvider Rsa = Certification.DecodeRSAPrivateKey(keyByte); byte[] sign = Rsa.SignHash(hash, CryptoConfig.MapNameToOID("SHA1")); string resultat = Convert.ToBase64String(sign); this.label1.Text = this.resultat; } with 'DecodeOpenSSLPrivateKey' and 'DecodeRSAPrivateKey' it's the sames functions use here: http://www.jensign.com/opensslkey/index.html for the result of my Hash i obtain: hash = "I4t474liO6H+p8SeDsoIkxmi8b0=" if i do same things with openSSL command: $ echo "Salut tout le monde"| openssl dgst -sha1 | openssl enc -base64 I obtain this: "NjFlOWI4Y2NjN2U2MzFkNTQwNTRmZjE1ZGUyYzk2MDczYTM2ZjRjZAo=" same with my sign result, with this command: $ echo "Salut tout le monde"| openssl dgst -sha1 -sign PrivateKey.pem | openssl enc -base64 I Have a signature like this: "V6c6XNK7O8+IKKuGTGENdZwoWxhQLIEFHW7XSdoXzMAp1gLu8B5UxXi0lr6JhVDW6SI8p8PtlT+fxEoafY+ZCigIq4xW6e32f6hxYWeYi7silh44I1m7LF7JYR1lfcegnO0Cw+YPqLPRrZUbdcrvMo1ijUGH3SuK+iot2lait9s=" with My Code I obtain this: result = "YlbnppFDP5ejdYOPoUI/1W6i+ClrKrxbIdA24IqllGDRWGBrWLtGwlfNkh4+B+gzcrX8HI7PkNP1Pq2ud1jE4EhfUVjBkZJwXj/ZYI3fPF41oiIMdF63lZiR/SEHQ5rMTbdsfQtkkBmFTr8udCJNnmnSimRQ458nZvIsYOUW6j4=" I can't to find my error :( can someone help me?
c#
compact-framework
null
null
null
null
open
Hash and sign a message with RSA algo in c# for compact framework === Hy everybody, I try to sign one message with RSA algorithm, i'm working to compact Framwork this is my Code: private void Signer_Click(object sender, EventArgs e) { ///cle de string ver byte[] string clePriveeFile = @"\Program Files\PrivateKey.pem"; StreamReader reader = new StreamReader(clePriveeFile); string contenuKeyPrivate = reader.ReadToEnd(); byte[] keyByte = Certification.DecodeOpenSSLPrivateKey(contenuKeyPrivate); string Data = "Salut tout le monde"; byte[] DataBytes = System.Text.Encoding.UTF8.GetBytes(Data);//.UTF7.GetBytes(Data); //Hasher le message SHA1Managed sha1 = new SHA1Managed(); byte[] hash = sha1.ComputeHash(DataBytes); string hach = Convert.ToBase64String(hash); RSACryptoServiceProvider Rsa = Certification.DecodeRSAPrivateKey(keyByte); byte[] sign = Rsa.SignHash(hash, CryptoConfig.MapNameToOID("SHA1")); string resultat = Convert.ToBase64String(sign); this.label1.Text = this.resultat; } with 'DecodeOpenSSLPrivateKey' and 'DecodeRSAPrivateKey' it's the sames functions use here: http://www.jensign.com/opensslkey/index.html for the result of my Hash i obtain: hash = "I4t474liO6H+p8SeDsoIkxmi8b0=" if i do same things with openSSL command: $ echo "Salut tout le monde"| openssl dgst -sha1 | openssl enc -base64 I obtain this: "NjFlOWI4Y2NjN2U2MzFkNTQwNTRmZjE1ZGUyYzk2MDczYTM2ZjRjZAo=" same with my sign result, with this command: $ echo "Salut tout le monde"| openssl dgst -sha1 -sign PrivateKey.pem | openssl enc -base64 I Have a signature like this: "V6c6XNK7O8+IKKuGTGENdZwoWxhQLIEFHW7XSdoXzMAp1gLu8B5UxXi0lr6JhVDW6SI8p8PtlT+fxEoafY+ZCigIq4xW6e32f6hxYWeYi7silh44I1m7LF7JYR1lfcegnO0Cw+YPqLPRrZUbdcrvMo1ijUGH3SuK+iot2lait9s=" with My Code I obtain this: result = "YlbnppFDP5ejdYOPoUI/1W6i+ClrKrxbIdA24IqllGDRWGBrWLtGwlfNkh4+B+gzcrX8HI7PkNP1Pq2ud1jE4EhfUVjBkZJwXj/ZYI3fPF41oiIMdF63lZiR/SEHQ5rMTbdsfQtkkBmFTr8udCJNnmnSimRQ458nZvIsYOUW6j4=" I can't to find my error :( can someone help me?
0
11,725,905
07/30/2012 16:45:06
1,563,457
07/30/2012 15:59:02
1
0
Create a dict of lists
Hopefully I've explained it well enough in the title but here is what I have: Input data: Mushroom Kingdom, Mario Hyrule, Link Mushroom Kingdom, Bowser Zebes, Samus Zebes, Metroid And I want to run something like this, # The next three lines establish that I'll be reading proc as a file import subprocess cmd = 'external command that returns the above data' proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) homeworlds = {} while True: line = proc.stdout.readline().split() if line: # If line isn't empty homeword = line[0] person = line[1] homeworlds[homeword] = list.append[person] # Good logic? Bad syntax? else: break The goal is that I'll be able to call: print homeworlds['Mushroom Kingdom'] and return the list Mario, Bowser
python
python-2.6
null
null
null
null
open
Create a dict of lists === Hopefully I've explained it well enough in the title but here is what I have: Input data: Mushroom Kingdom, Mario Hyrule, Link Mushroom Kingdom, Bowser Zebes, Samus Zebes, Metroid And I want to run something like this, # The next three lines establish that I'll be reading proc as a file import subprocess cmd = 'external command that returns the above data' proc = subprocess.Popen(cmd, stdout=subprocess.PIPE) homeworlds = {} while True: line = proc.stdout.readline().split() if line: # If line isn't empty homeword = line[0] person = line[1] homeworlds[homeword] = list.append[person] # Good logic? Bad syntax? else: break The goal is that I'll be able to call: print homeworlds['Mushroom Kingdom'] and return the list Mario, Bowser
0
6,866,988
07/28/2011 23:28:35
868,460
07/28/2011 23:28:35
1
0
Only run server if a user connects?
I run a Minecraft server on Windows 7 64-bit from my house (via a windows batch file). It works well, but it uses more and more RAM as it is used, which is not cleared when a user disconnects. I want my users to be able to connect to the server whenever they like, but I want to have my RAM available when no one is playing as well. So, what I'm looking into doing is running the server inside a script that listens for someone trying to connect, and it launches the server if and only if it receives data from that user. Minecraft clients connect through random ports between 50000 and 54000. Furthermore, I'd like to have a way to close the app if it hasn't received any data for a few minutes- say, five minutes. This way, the server will close a few minutes after a user has disconnected. Does anyone know of a way that this can be accomplished within windows? I am willing to use command prompt, python, bash via cygwin, or even a vb script; Anything you need to do to make this possible. The Minecraft server itself is launched from the batch file as follows: java -Xms512m -Xmx1024m -jar craftbukkit-0.0.1-SNAPSHOT.jar minecraft_server.jar Bonus points go to anyone who can also accomplish this behavior when users connect via the web to view the dynamic map hosted on port 80 at suchipi.zapto.org.
ping
windows-7-x64
minecraft
null
null
07/29/2011 11:55:50
not a real question
Only run server if a user connects? === I run a Minecraft server on Windows 7 64-bit from my house (via a windows batch file). It works well, but it uses more and more RAM as it is used, which is not cleared when a user disconnects. I want my users to be able to connect to the server whenever they like, but I want to have my RAM available when no one is playing as well. So, what I'm looking into doing is running the server inside a script that listens for someone trying to connect, and it launches the server if and only if it receives data from that user. Minecraft clients connect through random ports between 50000 and 54000. Furthermore, I'd like to have a way to close the app if it hasn't received any data for a few minutes- say, five minutes. This way, the server will close a few minutes after a user has disconnected. Does anyone know of a way that this can be accomplished within windows? I am willing to use command prompt, python, bash via cygwin, or even a vb script; Anything you need to do to make this possible. The Minecraft server itself is launched from the batch file as follows: java -Xms512m -Xmx1024m -jar craftbukkit-0.0.1-SNAPSHOT.jar minecraft_server.jar Bonus points go to anyone who can also accomplish this behavior when users connect via the web to view the dynamic map hosted on port 80 at suchipi.zapto.org.
1
7,568,523
09/27/2011 11:42:10
744,404
05/09/2011 01:24:52
14
0
Direct Copy from Unix/Linux to Desktop
Is there any Command in Unix or linux to copy a file direct from Linux to Windows. I want to copy a file from unix without using any third party tool. like winscp, Xftp Can SFTP do the same?.. … i tried below command in unix server to my desktop id cp scr.txt sunil@10.52.6.105:/sunil But the file is not came. the above ip is my desktop ip. and i am using my unix server directly no virtual ip is using. please help me....
linux
unix
null
null
null
09/27/2011 12:02:42
off topic
Direct Copy from Unix/Linux to Desktop === Is there any Command in Unix or linux to copy a file direct from Linux to Windows. I want to copy a file from unix without using any third party tool. like winscp, Xftp Can SFTP do the same?.. … i tried below command in unix server to my desktop id cp scr.txt sunil@10.52.6.105:/sunil But the file is not came. the above ip is my desktop ip. and i am using my unix server directly no virtual ip is using. please help me....
2
9,635,079
03/09/2012 13:48:27
1,259,385
03/09/2012 13:26:37
1
0
JAXB inheritance issue - namespace corruption
We're facing an issue when marshalling an object to xml with JAXB. In our code example (**https://github.com/fbe/JaxbIssueTracker**, simple maven project, test-case demonstrates what's going wrong) we have three types: - parent - hijacked - concrete **XSDs can be found here: [github][1]** The parent type is abstract, concrete extends the parent, parent references the hijacked type in a sequence. From these xsd-files the JAVA files are being generated by JAXB (xjc) without any warn- or error-messages. When marshalling a concrete type the following xml-output is being generated by JAXB: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:concreteType xmlns:ns2="http://www.felixbecker.name/parent" xmlns="http://www.felixbecker.name/hijacked" xmlns:ns3="http://www.felixbecker.name/concrete"> <ns2:hijacked> <value>foobar</value> </ns2:hijacked> </ns3:concreteType> As you can see the hijacked-type is falsely using the ns2-prefix which refers to the namespace of the parent type - but instead it should use the default namespace which refers to the hijacked namespace. JAXB is not able to unmarshal this generated xml although it is generated by itself with activated schema validation. What is going wrong here? Is the xml-schema broken? Or is JAXB not able to deal with inheritance correctly? Removing the abstract-attribute from the parent.xsd did not have any effect on the faced issue. Any help would be highly appreciated! :-) Used versions (both broken): - JAXB from JDK 1.6 - JAXB-RI 2.2.5 Regards, fbe & ollinux [1]: https://github.com/fbe/JaxbIssueTracker/tree/a4df9bd53d803cb078d3982336a012ae1fc9f1a5/src/main/resources
java
xml
inheritance
namespaces
jaxb
null
open
JAXB inheritance issue - namespace corruption === We're facing an issue when marshalling an object to xml with JAXB. In our code example (**https://github.com/fbe/JaxbIssueTracker**, simple maven project, test-case demonstrates what's going wrong) we have three types: - parent - hijacked - concrete **XSDs can be found here: [github][1]** The parent type is abstract, concrete extends the parent, parent references the hijacked type in a sequence. From these xsd-files the JAVA files are being generated by JAXB (xjc) without any warn- or error-messages. When marshalling a concrete type the following xml-output is being generated by JAXB: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <ns3:concreteType xmlns:ns2="http://www.felixbecker.name/parent" xmlns="http://www.felixbecker.name/hijacked" xmlns:ns3="http://www.felixbecker.name/concrete"> <ns2:hijacked> <value>foobar</value> </ns2:hijacked> </ns3:concreteType> As you can see the hijacked-type is falsely using the ns2-prefix which refers to the namespace of the parent type - but instead it should use the default namespace which refers to the hijacked namespace. JAXB is not able to unmarshal this generated xml although it is generated by itself with activated schema validation. What is going wrong here? Is the xml-schema broken? Or is JAXB not able to deal with inheritance correctly? Removing the abstract-attribute from the parent.xsd did not have any effect on the faced issue. Any help would be highly appreciated! :-) Used versions (both broken): - JAXB from JDK 1.6 - JAXB-RI 2.2.5 Regards, fbe & ollinux [1]: https://github.com/fbe/JaxbIssueTracker/tree/a4df9bd53d803cb078d3982336a012ae1fc9f1a5/src/main/resources
0
2,438,027
03/13/2010 10:40:40
23,590
09/29/2008 20:05:23
1,708
107
Giving proper credit to a projects contributors
I've recently been working with an opensource library for a commercial product. The opensource code is distributed from the website of the company who sells the proprietary product as a zip file. The library is a (direct) port to C# of the original library which is in Java. As such, it uses methods instead of getter/setter properties. The code contains copyright notices to the supplier of the product. The C# port was originally provided to the company by a 3rd party individual. I have modified the source to be more C# like and added a couple of small features. I want to put my version of the code out there (Google code or where ever) so that C# users of the software can benefit from a more native feeling library. How can I and/or how should I amend the copyright notice to give proper credit to 1. The comercial owner of the original source 2. The guy who provided the original C# port 3. Myself and anyone else who contributes to the project in the future The source is provided under the LGPL V2.1,
copyright
lgpl
opensource
null
null
null
open
Giving proper credit to a projects contributors === I've recently been working with an opensource library for a commercial product. The opensource code is distributed from the website of the company who sells the proprietary product as a zip file. The library is a (direct) port to C# of the original library which is in Java. As such, it uses methods instead of getter/setter properties. The code contains copyright notices to the supplier of the product. The C# port was originally provided to the company by a 3rd party individual. I have modified the source to be more C# like and added a couple of small features. I want to put my version of the code out there (Google code or where ever) so that C# users of the software can benefit from a more native feeling library. How can I and/or how should I amend the copyright notice to give proper credit to 1. The comercial owner of the original source 2. The guy who provided the original C# port 3. Myself and anyone else who contributes to the project in the future The source is provided under the LGPL V2.1,
0
5,729,866
04/20/2011 12:01:01
392,646
07/15/2010 11:51:26
48
1
What is the best Linux distro to work with Ruby on Rails?
I use a Mac to develop in RoR, but a crisme of mine needs a Linux machine to develop. I've tried to install Rails on Ubuntu and Debian 4 times each, but i got all kind of errors you can imagine. Do someone have any distro that simply work with Rails? Or any tutorial to make this work on Ubuntu or Debian?
ruby-on-rails
linux
null
null
null
03/21/2012 18:50:54
not constructive
What is the best Linux distro to work with Ruby on Rails? === I use a Mac to develop in RoR, but a crisme of mine needs a Linux machine to develop. I've tried to install Rails on Ubuntu and Debian 4 times each, but i got all kind of errors you can imagine. Do someone have any distro that simply work with Rails? Or any tutorial to make this work on Ubuntu or Debian?
4
11,237,224
06/28/2012 02:11:33
1,114,227
12/24/2011 02:58:38
15
1
Cropping an image with PHP or Javascript
I have an image called 'progressbar.png'. Is there a way that I could crop this image, with PHP or Javascript, each time the page loads the image will crop depending on the progress percentage and be loaded into the page. For example, if the image was 200px wide, at 25% progress the image would be cropped to only 50px wide.
php
javascript
image
load
crop
06/28/2012 07:14:01
not constructive
Cropping an image with PHP or Javascript === I have an image called 'progressbar.png'. Is there a way that I could crop this image, with PHP or Javascript, each time the page loads the image will crop depending on the progress percentage and be loaded into the page. For example, if the image was 200px wide, at 25% progress the image would be cropped to only 50px wide.
4
659,564
03/18/2009 18:32:32
52,996
01/08/2009 16:41:36
18
0
Visual Studio Debugger. ASP.NET Click events not firing.
When clicking button in debug mode, the page reloads but the break points inside of the click event are never reached. However, breakpoints in the page_load work just fine. Basically, it's as if code inside of the button's click event is not being executed. I checked the site into source control and another developer tried it on his computer. The click events worked just fine there, catching the break points inside. I tried another site on my computer and it has the same issue. So it's something specific to my computer, and not specific to any site. Is there some setting I may have mistakenly changed that could cause click events to stop working while debugging? Any help would be appreciated.
asp.net
visual-studio
null
null
null
null
open
Visual Studio Debugger. ASP.NET Click events not firing. === When clicking button in debug mode, the page reloads but the break points inside of the click event are never reached. However, breakpoints in the page_load work just fine. Basically, it's as if code inside of the button's click event is not being executed. I checked the site into source control and another developer tried it on his computer. The click events worked just fine there, catching the break points inside. I tried another site on my computer and it has the same issue. So it's something specific to my computer, and not specific to any site. Is there some setting I may have mistakenly changed that could cause click events to stop working while debugging? Any help would be appreciated.
0
2,073,982
01/15/2010 18:54:55
105,035
05/11/2009 21:40:38
671
14
C# help to set a Row Css class of a Grid View
I need to alternate row colors in a grid, but not on every other row. I have a variable _AddDate that I can check on the GridRowBound event. If it hasn't changed, I want to apply one css class and if it has I want to apply a different class. The code I have does almost exactly what I want but I am setting the class on the row when the value changes and each concurrent row that should be the same class is having the incorrect class applied. Its definitely something wrong with my method. Can anyone point me in the right direction? Also is there a name for these types of functions. I have to do things like this from time to time and they can be tricky to figure out the correct algorithm. Here is what I have. private void GridRowBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.CssClass = SetRowColor(); } } private DateTime _dateToSwitch; private string SetRowColor() { var tmpDate = _AddDate; var doSwitch = (tmpDate == _dateToSwitch); if (!doSwitch) { _dateToSwitch = tmpDate; return "commentRow"; } return "altCommentRow"; } I have another function that correctly sets _AddDate to the appropriate value so it is always current when it is evaluated. Any help is appreciated. Happy Friday! Cheers, ~ck in San Diego
algorithm
c#
asp.net
data-binding
null
null
open
C# help to set a Row Css class of a Grid View === I need to alternate row colors in a grid, but not on every other row. I have a variable _AddDate that I can check on the GridRowBound event. If it hasn't changed, I want to apply one css class and if it has I want to apply a different class. The code I have does almost exactly what I want but I am setting the class on the row when the value changes and each concurrent row that should be the same class is having the incorrect class applied. Its definitely something wrong with my method. Can anyone point me in the right direction? Also is there a name for these types of functions. I have to do things like this from time to time and they can be tricky to figure out the correct algorithm. Here is what I have. private void GridRowBound(object sender, GridViewRowEventArgs e) { if(e.Row.RowType == DataControlRowType.DataRow) { e.Row.CssClass = SetRowColor(); } } private DateTime _dateToSwitch; private string SetRowColor() { var tmpDate = _AddDate; var doSwitch = (tmpDate == _dateToSwitch); if (!doSwitch) { _dateToSwitch = tmpDate; return "commentRow"; } return "altCommentRow"; } I have another function that correctly sets _AddDate to the appropriate value so it is always current when it is evaluated. Any help is appreciated. Happy Friday! Cheers, ~ck in San Diego
0
2,363,033
03/02/2010 12:28:18
243,837
01/05/2010 10:38:57
139
2
List of about thirty colors
I'm looking for a list of about thirty colors (RGB values) that are sufficently different so that when used in a bar chart the user can match each bar to that color in the legend. Does anyone have such a list of colors? Thanks, AJ
colors
general
wpf
delphi
web
03/02/2010 13:41:55
off topic
List of about thirty colors === I'm looking for a list of about thirty colors (RGB values) that are sufficently different so that when used in a bar chart the user can match each bar to that color in the legend. Does anyone have such a list of colors? Thanks, AJ
2
10,699,980
05/22/2012 10:11:44
647,587
03/07/2011 03:53:36
722
23
Change the margin on the csv Using it in a UIWebView [iPad]
I am using this code to show the epub book on my ipad .. now the problem is I want to show some margin on left side . .. I tried to change the margin here but it dint work . NSString *varMySheet = @"var mySheet = document.styleSheets[0];"; NSString *addCSSRule = @"function addCSSRule(selector, newRule) {" "if (mySheet.addRule) {" "mySheet.addRule(selector, newRule);" // For Internet Explorer "} else {" "ruleIndex = mySheet.cssRules.length;" "mySheet.insertRule(selector + '{' + newRule + ';}', ruleIndex);" // For Firefox, Chrome, etc. "}" "}"; NSString *insertRule1 = [NSString stringWithFormat:@"addCSSRule('html', 'padding: 0px; height: %fpx; -webkit-column-gap: 0px; -webkit-column-width: %fpx;')", webView.frame.size.height, webView.frame.size.width/2]; NSString *insertRule2 = [NSString stringWithFormat:@"addCSSRule('p', 'text-align: justify;')"]; NSString *setTextSizeRule = [NSString stringWithFormat:@"addCSSRule('body', '-webkit-text-size-adjust: %d%%;')", currentTextSize]; NSString *setHighlightColorRule = [NSString stringWithFormat:@"addCSSRule('highlight', 'background-color: yellow;')"]; NSString *setImageRule = [NSString stringWithFormat:@"addCSSRule('img', 'max-width: %fpx; height:auto;')", webView.frame.size.width/2 *0.75]; NSString *setFontRule = [NSString stringWithFormat:@"addCSSRule('body', 'font-family: Arial;' , 'font-name: Arial-BoldItalicMT;')"];
iphone
css
ipad
csv
null
null
open
Change the margin on the csv Using it in a UIWebView [iPad] === I am using this code to show the epub book on my ipad .. now the problem is I want to show some margin on left side . .. I tried to change the margin here but it dint work . NSString *varMySheet = @"var mySheet = document.styleSheets[0];"; NSString *addCSSRule = @"function addCSSRule(selector, newRule) {" "if (mySheet.addRule) {" "mySheet.addRule(selector, newRule);" // For Internet Explorer "} else {" "ruleIndex = mySheet.cssRules.length;" "mySheet.insertRule(selector + '{' + newRule + ';}', ruleIndex);" // For Firefox, Chrome, etc. "}" "}"; NSString *insertRule1 = [NSString stringWithFormat:@"addCSSRule('html', 'padding: 0px; height: %fpx; -webkit-column-gap: 0px; -webkit-column-width: %fpx;')", webView.frame.size.height, webView.frame.size.width/2]; NSString *insertRule2 = [NSString stringWithFormat:@"addCSSRule('p', 'text-align: justify;')"]; NSString *setTextSizeRule = [NSString stringWithFormat:@"addCSSRule('body', '-webkit-text-size-adjust: %d%%;')", currentTextSize]; NSString *setHighlightColorRule = [NSString stringWithFormat:@"addCSSRule('highlight', 'background-color: yellow;')"]; NSString *setImageRule = [NSString stringWithFormat:@"addCSSRule('img', 'max-width: %fpx; height:auto;')", webView.frame.size.width/2 *0.75]; NSString *setFontRule = [NSString stringWithFormat:@"addCSSRule('body', 'font-family: Arial;' , 'font-name: Arial-BoldItalicMT;')"];
0
5,329,664
03/16/2011 18:02:37
604,864
02/06/2011 00:17:42
78
1
Is this correct object orientated programing in php?
Could this be classified as correct OOP programing? class greeting { public $greet = array('Hi','Hello', 'Howzit', 'Ola', 'Whats up'); function __construct($name) { $this->name = $name; shuffle($this->greet); } } $hi = new greeting('INSERTNAMEHERE');/*NAME OF PERSON GOES HERE*/ echo $hi->greet[1] .' '. $hi->name;
php
oop
null
null
null
05/24/2012 12:18:32
not constructive
Is this correct object orientated programing in php? === Could this be classified as correct OOP programing? class greeting { public $greet = array('Hi','Hello', 'Howzit', 'Ola', 'Whats up'); function __construct($name) { $this->name = $name; shuffle($this->greet); } } $hi = new greeting('INSERTNAMEHERE');/*NAME OF PERSON GOES HERE*/ echo $hi->greet[1] .' '. $hi->name;
4
695,320
03/29/2009 20:29:05
55,408
01/15/2009 12:49:22
292
30
Good books on cartography/GIS programming?
I'm looking for some recommendations on good books that cover cartography and GIS from a programming perspective. I'm **not** talking about books that concentrate on some concrete GIS technology or GIS product. Ideally the book should cover stuff like - map projections - coordinate systems - image rectification and georeferencing (GeoTIFF, world files...) - digital elevation models - colors models - various geometric and geographic algorithms and formulas (distances, polyline reductions, label placement etc.) - etc The book should contain a lot of example source code, preferably in an object-oriented language (although plain old C would suffice). I already own [Elements Of Cartography][1], and while it is a fine book, it does not really address software development issues. Maybe I'm asking for too much, I don't know. The thing is that I while developing my [Kosmos][2] software I had to do a lot of Google-research to find relevant stuff I needed. I would like to have some good reference book that would contain at least some of these things in one place. Recommendations on good internet resources would also be appreciated. I can give some myself: - [Map Projections - A Working Manual (USGS PP 1395, John P. Snyder, 1987)][3] - [comp.graphics.algorithms FAQ][4] - [Topographic Maps With SVG][5] [1]: http://www.amazon.com/Elements-Cartography-Arthur-H-Robinson/dp/0471555797/ref=sr_1_1?ie=UTF8&s=books&qid=1238357831&sr=1-1 [2]: http://wiki.openstreetmap.org/index.php/Kosmos [3]: http://onlinepubs.er.usgs.gov/djvu/PP/PP_1395.pdf [4]: http://www.cgafaq.info/wiki/Main_Page [5]: http://www.svgopen.org/2004/papers/TopographicMapsWithSVG/
gis
maps
books
cartography
null
10/02/2011 00:44:07
not constructive
Good books on cartography/GIS programming? === I'm looking for some recommendations on good books that cover cartography and GIS from a programming perspective. I'm **not** talking about books that concentrate on some concrete GIS technology or GIS product. Ideally the book should cover stuff like - map projections - coordinate systems - image rectification and georeferencing (GeoTIFF, world files...) - digital elevation models - colors models - various geometric and geographic algorithms and formulas (distances, polyline reductions, label placement etc.) - etc The book should contain a lot of example source code, preferably in an object-oriented language (although plain old C would suffice). I already own [Elements Of Cartography][1], and while it is a fine book, it does not really address software development issues. Maybe I'm asking for too much, I don't know. The thing is that I while developing my [Kosmos][2] software I had to do a lot of Google-research to find relevant stuff I needed. I would like to have some good reference book that would contain at least some of these things in one place. Recommendations on good internet resources would also be appreciated. I can give some myself: - [Map Projections - A Working Manual (USGS PP 1395, John P. Snyder, 1987)][3] - [comp.graphics.algorithms FAQ][4] - [Topographic Maps With SVG][5] [1]: http://www.amazon.com/Elements-Cartography-Arthur-H-Robinson/dp/0471555797/ref=sr_1_1?ie=UTF8&s=books&qid=1238357831&sr=1-1 [2]: http://wiki.openstreetmap.org/index.php/Kosmos [3]: http://onlinepubs.er.usgs.gov/djvu/PP/PP_1395.pdf [4]: http://www.cgafaq.info/wiki/Main_Page [5]: http://www.svgopen.org/2004/papers/TopographicMapsWithSVG/
4
9,406,413
02/23/2012 02:43:08
1,023,065
11/01/2011 04:10:29
12
0
How can I avoid vote spam on my PHP site
I am doing a voting system on my website. Visitors not need to login to vote the product they like. But how can I prevent them from clicking the like or dislike button many times for one product ? I intend to detech Ip of the visitor to avoid them vote spam. Is that a good way? Thanks for any suggestion!
php
null
null
null
null
02/24/2012 02:55:20
not a real question
How can I avoid vote spam on my PHP site === I am doing a voting system on my website. Visitors not need to login to vote the product they like. But how can I prevent them from clicking the like or dislike button many times for one product ? I intend to detech Ip of the visitor to avoid them vote spam. Is that a good way? Thanks for any suggestion!
1
5,960,090
05/11/2011 06:24:02
407,318
07/31/2010 06:08:12
77
6
Connect / node.js - creating a simple server
I'm trying to get connect / node.js to work together nicely and simply. I have the following (in coffeescript) https://gist.github.com/966005 But keep getting the following error: TypeError: Cannot call method 'listeners' of undefined It seems the server is not being initialized in time for the socket to start listening..
node.js
connect
coffeescript
socket.io
null
null
open
Connect / node.js - creating a simple server === I'm trying to get connect / node.js to work together nicely and simply. I have the following (in coffeescript) https://gist.github.com/966005 But keep getting the following error: TypeError: Cannot call method 'listeners' of undefined It seems the server is not being initialized in time for the socket to start listening..
0
8,617,201
12/23/2011 14:30:41
370,296
06/18/2010 12:44:44
735
13
How can I reload reload modules from one open work environment to affect another working environment
I have my PowerShell project broken into modules. But because they are modules I have to reload them every time I change them. So I wrote a loop that has a FileSystemWatcher and if one of the .psm1 file changes it will either reload or import that module. The problem is that the above loop isn't going to let me run other scripts in its working environment, so a new environment will not have the same modules loaded/reloaded for it. I need to keep these modules out of the primary default PowerShell modules folder(s). Is there a way to run the script that reloads the modules when they change in the same environment or affect a certain environment?
powershell
powershell-module
null
null
null
null
open
How can I reload reload modules from one open work environment to affect another working environment === I have my PowerShell project broken into modules. But because they are modules I have to reload them every time I change them. So I wrote a loop that has a FileSystemWatcher and if one of the .psm1 file changes it will either reload or import that module. The problem is that the above loop isn't going to let me run other scripts in its working environment, so a new environment will not have the same modules loaded/reloaded for it. I need to keep these modules out of the primary default PowerShell modules folder(s). Is there a way to run the script that reloads the modules when they change in the same environment or affect a certain environment?
0
3,096,953
06/22/2010 20:38:16
373,609
06/22/2010 20:38:16
1
0
Difference between two time intervals in Python
I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online and I would imagine it would have something to do with the datetime and/or time modules. I can't get it to work properly and keep finding only how to do this when a date is involved. I'm using Python 2.6.5 on Windows XP. Thanks.
python
time
null
null
null
null
open
Difference between two time intervals in Python === I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online and I would imagine it would have something to do with the datetime and/or time modules. I can't get it to work properly and keep finding only how to do this when a date is involved. I'm using Python 2.6.5 on Windows XP. Thanks.
0
4,427,573
12/13/2010 09:51:15
352,555
05/28/2010 03:47:32
632
34
Open Source C++ Crawler?
What open source c++ web crawlers for parsing html do you know and use? Thank you!
c++
html
open-source
web-crawler
html-parsing
null
open
Open Source C++ Crawler? === What open source c++ web crawlers for parsing html do you know and use? Thank you!
0
6,738,876
07/18/2011 20:16:49
850,355
07/18/2011 15:58:05
6
0
how is work with str_replace to array?
why not worked str_replace? what do i do? $date = $this->convert_date->JalaliToGregorian('1390','04','20'); ->> this output with json_encode -> [2011,7,11] $da = str_replace(",","/",$date); echo json_encode ($da) ->> output Array ["2011","7","11"]
php
arrays
php5
str-replace
json-encode
07/20/2011 14:48:45
not a real question
how is work with str_replace to array? === why not worked str_replace? what do i do? $date = $this->convert_date->JalaliToGregorian('1390','04','20'); ->> this output with json_encode -> [2011,7,11] $da = str_replace(",","/",$date); echo json_encode ($da) ->> output Array ["2011","7","11"]
1
6,649,494
07/11/2011 11:34:32
517,066
11/23/2010 06:29:47
1,888
279
Regular expression to match Date
I am trying to validate fallowing date format through **regExp**, but still i didn't get ant working solution- ex.- OCT-12-2011 FEB-06-1995 how can i do it using regexp. Thanks in advance!!
javascript
regex
null
null
null
null
open
Regular expression to match Date === I am trying to validate fallowing date format through **regExp**, but still i didn't get ant working solution- ex.- OCT-12-2011 FEB-06-1995 how can i do it using regexp. Thanks in advance!!
0
8,425,572
12/08/2011 02:58:22
656,985
03/12/2011 21:34:52
82
2
Is it "OK" to add JSP/Tomcat support to an existing LAMP web server?
Is it possible to add JSP/Tomcat support to an existing LAMP web server? I never tried to do this before and was wondering if this was ok to do in a production environment or if it went against best practices. I have a Debian webserver with a LAMP stack running Apache2. I have a few PHP websites but I would like to add a Java/JSP powered website like so: /var/www/myphpsite /var/www/myjspsite /var/www/etc etc. Thanks, Jason
php
linux
apache
jsp
tomcat
null
open
Is it "OK" to add JSP/Tomcat support to an existing LAMP web server? === Is it possible to add JSP/Tomcat support to an existing LAMP web server? I never tried to do this before and was wondering if this was ok to do in a production environment or if it went against best practices. I have a Debian webserver with a LAMP stack running Apache2. I have a few PHP websites but I would like to add a Java/JSP powered website like so: /var/www/myphpsite /var/www/myjspsite /var/www/etc etc. Thanks, Jason
0
6,801,895
07/23/2011 16:53:49
859,509
07/23/2011 16:53:49
1
0
action script 2 character selection
please I havent been able to make a character selection in as2 so please can someone give me an example that if I click on this button a movieclip comes out in this frame
button
movieclip
actionscript-2
null
null
null
open
action script 2 character selection === please I havent been able to make a character selection in as2 so please can someone give me an example that if I click on this button a movieclip comes out in this frame
0
8,330,086
11/30/2011 17:15:14
1,073,871
11/30/2011 17:09:17
1
0
Regex .NET Multiline Capture
I would like to capture the word "ABADDON", up to (not including ABAFT). I would then like to repeat this capture with "ABAFT", up to the next word (not including the next word). The words are capitalized. ABADDON A*bad"don, n. Etym: [Heb. abaddon destruction, abyss, fr. abad to be lost, to perish.] 1. The destroyer, or angel of the bottomless pit; -- the same as Apollyon and Asmodeus. 2. Hell; the bottomless pit. [Poetic] In all her gates, Abaddon rues Thy bold attempt. Milton. ABAFT A*baft", prep. Etym: [Pref. a-on + OE. baft, baften, biaften, AS. beæftan; be by + æftan behind. See After, Aft, By.] (Naut.) Defn: Behind; toward the stern from; as, abaft the wheelhouse. Abaft the beam. See under Beam.
regex
null
null
null
null
12/01/2011 03:55:55
not a real question
Regex .NET Multiline Capture === I would like to capture the word "ABADDON", up to (not including ABAFT). I would then like to repeat this capture with "ABAFT", up to the next word (not including the next word). The words are capitalized. ABADDON A*bad"don, n. Etym: [Heb. abaddon destruction, abyss, fr. abad to be lost, to perish.] 1. The destroyer, or angel of the bottomless pit; -- the same as Apollyon and Asmodeus. 2. Hell; the bottomless pit. [Poetic] In all her gates, Abaddon rues Thy bold attempt. Milton. ABAFT A*baft", prep. Etym: [Pref. a-on + OE. baft, baften, biaften, AS. beæftan; be by + æftan behind. See After, Aft, By.] (Naut.) Defn: Behind; toward the stern from; as, abaft the wheelhouse. Abaft the beam. See under Beam.
1
11,106,104
06/19/2012 17:21:40
430,062
08/24/2010 21:37:20
2,260
100
Is this a good way to handle Exception messages?
I wanted some system where I didn't have to keep looking at the Exception class and copying either status codes or text all at once. I also didn't want to have to keep writing plain English error messages after catching exceptions. This seems to accomplish both, plus allows for easy IDE auto-completion! Here's some demo code: <?php class Thrive_URL_Exception extends Thrive_PrettyException { const MISSING_CURL = "The cURL PHP extension must be enabled."; const MISSING_URL = "A URL has not been supplied or set."; const INVALID_URL = "The URL '%s' is not valid."; const BLANK_URL = "The URL '%s' contained no data. It is probably invalid."; const CONNECTION_TIMED_OUT = "The connection timed out."; const FILE_NOT_FOUND = "404: '%s' could not be found."; const NOT_ACCESSIBLE = "%d: '%s' is not currently accessible."; const PERMISSION_DENIED = "Permission denied."; } class Thrive_URL_Downloader { public function fetch($url) { // Make sure the URL is valid. if (!self::isURLValid($url)) { throw new Thrive_URL_Exception(Thrive_URL_Exception::INVALID_URL, array($url)); } $ch = curl_init(); curl_setopt_array($ch, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADERFUNCTION => array($this, 'captureHeader'), CURLOPT_TIMEOUT => 30, ) ); $data = curl_exec($ch); curl_close($ch); if ($data === false || is_null($data) || $data == '') { throw new Thrive_URL_Exception(Thrive_URL_Exception::BLANK_URL, array($url)); } // TODO: Need to handle HTTP error messages, such as 404 and 502. $info = $this->getUrlInfo($ch); if ($info->httpCode == 401) { throw new Thrive_URL_Exception(Thrive_URL_Exception::PERMISSION_DENIED); } if ($info->httpCode == 404) { throw new Thrive_URL_Exception(Thrive_URL_Exception::FILE_NOT_FOUND, array($url)); } if (in_array($info->httpCode, array(400, 401, 402, 403, 500, 501, 502, 503))) { throw new Thrive_URL_Exception(Thrive_URL_Exception::NOT_ACCESSIBLE, array($info->httpCode, $url)); } $urlContent = new Thrive_Model_URLContent; $urlContent->url = $url; $urlContent->headers = $this->headers; $urlContent->info = $info; $urlContent->content = $data; return $urlContent; } } My question is whether there's an obviously better way to do this sort of thing??
php
php5
exception-handling
null
null
06/20/2012 02:57:17
off topic
Is this a good way to handle Exception messages? === I wanted some system where I didn't have to keep looking at the Exception class and copying either status codes or text all at once. I also didn't want to have to keep writing plain English error messages after catching exceptions. This seems to accomplish both, plus allows for easy IDE auto-completion! Here's some demo code: <?php class Thrive_URL_Exception extends Thrive_PrettyException { const MISSING_CURL = "The cURL PHP extension must be enabled."; const MISSING_URL = "A URL has not been supplied or set."; const INVALID_URL = "The URL '%s' is not valid."; const BLANK_URL = "The URL '%s' contained no data. It is probably invalid."; const CONNECTION_TIMED_OUT = "The connection timed out."; const FILE_NOT_FOUND = "404: '%s' could not be found."; const NOT_ACCESSIBLE = "%d: '%s' is not currently accessible."; const PERMISSION_DENIED = "Permission denied."; } class Thrive_URL_Downloader { public function fetch($url) { // Make sure the URL is valid. if (!self::isURLValid($url)) { throw new Thrive_URL_Exception(Thrive_URL_Exception::INVALID_URL, array($url)); } $ch = curl_init(); curl_setopt_array($ch, array(CURLOPT_URL => $url, CURLOPT_RETURNTRANSFER => 1, CURLOPT_HEADERFUNCTION => array($this, 'captureHeader'), CURLOPT_TIMEOUT => 30, ) ); $data = curl_exec($ch); curl_close($ch); if ($data === false || is_null($data) || $data == '') { throw new Thrive_URL_Exception(Thrive_URL_Exception::BLANK_URL, array($url)); } // TODO: Need to handle HTTP error messages, such as 404 and 502. $info = $this->getUrlInfo($ch); if ($info->httpCode == 401) { throw new Thrive_URL_Exception(Thrive_URL_Exception::PERMISSION_DENIED); } if ($info->httpCode == 404) { throw new Thrive_URL_Exception(Thrive_URL_Exception::FILE_NOT_FOUND, array($url)); } if (in_array($info->httpCode, array(400, 401, 402, 403, 500, 501, 502, 503))) { throw new Thrive_URL_Exception(Thrive_URL_Exception::NOT_ACCESSIBLE, array($info->httpCode, $url)); } $urlContent = new Thrive_Model_URLContent; $urlContent->url = $url; $urlContent->headers = $this->headers; $urlContent->info = $info; $urlContent->content = $data; return $urlContent; } } My question is whether there's an obviously better way to do this sort of thing??
2
3,971,759
10/19/2010 19:06:18
3,333
08/28/2008 00:32:00
41,572
1,120
Need a web-embedded editor that doesn't save in HTML
Our clients are able to edit some text on our "admin" web site, which then displays to their customers on another "client" web site. They now want the ability to add mark-up like bold, italic, underline (and combinations of the above) plus links to web pages. Unfortunately, because we use a web framework that passes the stored text through a XSLT decoder (don't ask), we can't just save their changes as HTML because otherwise it will screw up the XSLT step. I was thinking that what I need is something like a Markdown or BBCode editor that stores the text in the database with the Markdown or BBCode markup, and then some javascript on the client side that interprets the markup into HTML. Is there such a thing?
javascript
client-side
markdown
bbcode
null
null
open
Need a web-embedded editor that doesn't save in HTML === Our clients are able to edit some text on our "admin" web site, which then displays to their customers on another "client" web site. They now want the ability to add mark-up like bold, italic, underline (and combinations of the above) plus links to web pages. Unfortunately, because we use a web framework that passes the stored text through a XSLT decoder (don't ask), we can't just save their changes as HTML because otherwise it will screw up the XSLT step. I was thinking that what I need is something like a Markdown or BBCode editor that stores the text in the database with the Markdown or BBCode markup, and then some javascript on the client side that interprets the markup into HTML. Is there such a thing?
0
7,218,651
08/28/2011 02:20:13
909,184
08/24/2011 08:16:55
5
0
what do I need to start writing in machine language?
I want to start learning the machine language, you know the 0010011 type language. What program if any, can I use to write in machine language? please, I know you guys are going to tell me that "there are better languages out there or why would you want to learn that" kind of comments. I am aware of that so please don't post any of those comments. thanks.
coding-style
language
code-sample
machine-language
null
08/28/2011 12:03:18
not a real question
what do I need to start writing in machine language? === I want to start learning the machine language, you know the 0010011 type language. What program if any, can I use to write in machine language? please, I know you guys are going to tell me that "there are better languages out there or why would you want to learn that" kind of comments. I am aware of that so please don't post any of those comments. thanks.
1
11,596,180
07/21/2012 22:04:05
1,174,510
01/27/2012 22:32:37
92
2
Should I realse my app to IOS App store ? Free or Not free?
Finally, I have an IOS game for release. I have 2 questions: 1. Should I release my product now? I can still perfect my app adding more features. Do you recommend releasing it and see people's reaction and then come up with major updates addressing those? Or should I spend another 1 week perfecting it every day and make sure I have a unique product? Note: that in the same time I can come up with major updates if I release the product now and I learn. The problem is that I really need some people's feedback. I am confused! 2. My game is a puzzle like game.. should I put it for $.99 or give it out for free! And use an advertising approach. How many people actually buy puzzle games?...Myself I like every app to be free in the appstore. I appreciate any insight. Note my game can use some sound effect, I can enable sharing and all cool or I can release these features as a major update! I don't consider myself a business person, But I am sure there are enough experienced people in here that can help me sort of get a sense of how I should proceed.
iphone
ios5
app-store
null
null
07/21/2012 22:30:16
not constructive
Should I realse my app to IOS App store ? Free or Not free? === Finally, I have an IOS game for release. I have 2 questions: 1. Should I release my product now? I can still perfect my app adding more features. Do you recommend releasing it and see people's reaction and then come up with major updates addressing those? Or should I spend another 1 week perfecting it every day and make sure I have a unique product? Note: that in the same time I can come up with major updates if I release the product now and I learn. The problem is that I really need some people's feedback. I am confused! 2. My game is a puzzle like game.. should I put it for $.99 or give it out for free! And use an advertising approach. How many people actually buy puzzle games?...Myself I like every app to be free in the appstore. I appreciate any insight. Note my game can use some sound effect, I can enable sharing and all cool or I can release these features as a major update! I don't consider myself a business person, But I am sure there are enough experienced people in here that can help me sort of get a sense of how I should proceed.
4
4,582,184
01/03/2011 05:10:04
560,850
01/03/2011 04:55:07
1
0
How did the iPhone Alarm Bug possibly happen?
iPhone alarms didn't work in the new year of 2011! http://www.engadget.com/2010/12/31/psa-iphone-alarms-not-working-come-new-years-day-2011/ But only on January 1st. And January 2nd. And only if there were single-event alarms. (Recurring alarms still sounded.) How did this possibly happen? What contortions of code lead to this outcome? What absurd algorithms give rise to this inscrutable behavior? Is it related to November's daylight saving time related alarm foul-up? I don't know, and odds are, the only people who do aren't talking. For this question, don't be silent just because you're not positive. Guesses encouraged. Tales of similar mistakes strongly encourage. **Extra points for pseudocode.**
iphone
calendar
timezone
null
null
01/03/2011 05:35:52
not a real question
How did the iPhone Alarm Bug possibly happen? === iPhone alarms didn't work in the new year of 2011! http://www.engadget.com/2010/12/31/psa-iphone-alarms-not-working-come-new-years-day-2011/ But only on January 1st. And January 2nd. And only if there were single-event alarms. (Recurring alarms still sounded.) How did this possibly happen? What contortions of code lead to this outcome? What absurd algorithms give rise to this inscrutable behavior? Is it related to November's daylight saving time related alarm foul-up? I don't know, and odds are, the only people who do aren't talking. For this question, don't be silent just because you're not positive. Guesses encouraged. Tales of similar mistakes strongly encourage. **Extra points for pseudocode.**
1
9,208,452
02/09/2012 09:43:34
228,916
12/10/2009 15:38:38
570
31
WPF Toolkit Datagrid , Styling the SelectorAll
I want to style the upper left element of this Datagrid that selects all rows but I don't know how. Does anyone have an example for me or does anyone know which element I need to style ? My Datagrid comes from the WPF Toolkit btw. ![enter image description here][1] [1]: http://i.stack.imgur.com/2woSD.png
wpf
xaml
datagrid
wpftoolkit
null
null
open
WPF Toolkit Datagrid , Styling the SelectorAll === I want to style the upper left element of this Datagrid that selects all rows but I don't know how. Does anyone have an example for me or does anyone know which element I need to style ? My Datagrid comes from the WPF Toolkit btw. ![enter image description here][1] [1]: http://i.stack.imgur.com/2woSD.png
0
7,877,457
10/24/2011 14:46:39
814,395
06/24/2011 16:15:56
1
1
fulltext index being ignored in Boolean Mode when used with number of words conditional
fulltext match is ignoring its index when I add a number of words conditional for its bolean word. The selects are as follows: explain select * from seeds WHERE MATCH(text) AGAINST ("mount cameroon" IN BOOLEAN MODE); outputs +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | seeds | fulltext | text | text | 0 | | 1 | Using where | +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ the same query with a number of words conditional explain select * from seeds WHERE MATCH(text) AGAINST ("mount cameroon" IN BOOLEAN MODE) = 4; outputs +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | seeds | ALL | NULL | NULL | NULL | NULL | 9607 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ surely this cant be correct behaviour?
mysql
full-text-search
null
null
null
null
open
fulltext index being ignored in Boolean Mode when used with number of words conditional === fulltext match is ignoring its index when I add a number of words conditional for its bolean word. The selects are as follows: explain select * from seeds WHERE MATCH(text) AGAINST ("mount cameroon" IN BOOLEAN MODE); outputs +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | seeds | fulltext | text | text | 0 | | 1 | Using where | +----+-------------+-------+----------+---------------+------+---------+------+------+-------------+ the same query with a number of words conditional explain select * from seeds WHERE MATCH(text) AGAINST ("mount cameroon" IN BOOLEAN MODE) = 4; outputs +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ | 1 | SIMPLE | seeds | ALL | NULL | NULL | NULL | NULL | 9607 | Using where | +----+-------------+-------+------+---------------+------+---------+------+------+-------------+ surely this cant be correct behaviour?
0
1,598,469
10/21/2009 02:41:04
187,408
10/09/2009 19:50:38
16
2
Rails Idiom for Post-Update Notification
All/Anyone, Curious what the prevalent Rails idiom is for indicating the success/failure of a particular action to the end user? For example, let's say you have a restful User resource and update is invoked on said User resource; once the update has completed and I've routed the user back to edit.html.erb - I'd like to indicate whether or not the action was successful (which one would say == the absence of errors). That said, three approaches come quickly to mind: 1. if @user.errors.blank? then show 'success'. This doesn't work on the inital display of edit.html.erb 2. Update flash to indicate success/failure based on the results of @user.save/update_attributes. if flash[:status] == :success then show 'success'. 3. set an instance variable in the update action - much like flash - @success == true. if @success then show 'success' Am I missing something? Perhaps there's a method on AR that I'm just not seeing? If @user.updated? Thanks! Cory Wilkerson
rails
ruby-on-rails
null
null
null
null
open
Rails Idiom for Post-Update Notification === All/Anyone, Curious what the prevalent Rails idiom is for indicating the success/failure of a particular action to the end user? For example, let's say you have a restful User resource and update is invoked on said User resource; once the update has completed and I've routed the user back to edit.html.erb - I'd like to indicate whether or not the action was successful (which one would say == the absence of errors). That said, three approaches come quickly to mind: 1. if @user.errors.blank? then show 'success'. This doesn't work on the inital display of edit.html.erb 2. Update flash to indicate success/failure based on the results of @user.save/update_attributes. if flash[:status] == :success then show 'success'. 3. set an instance variable in the update action - much like flash - @success == true. if @success then show 'success' Am I missing something? Perhaps there's a method on AR that I'm just not seeing? If @user.updated? Thanks! Cory Wilkerson
0
4,044,042
10/28/2010 14:51:25
36,620
11/11/2008 16:11:55
659
15
new XmlSerializer(typeof(MyClass)) Causing Memory corruption?
I've got an application that loads an assembly dynamically: Assembly asm = Assembly.Load("MyClass.DLL"); Type type = asm.GetType("MyClass"); MyClass runningAssembly = (MyClass)Activator.CreateInstance(type); runningAssembly.start(); Once loaded and the start() method is called, this line of code is executed: XmlSerializer deserializer = new XmlSerializer(typeof(MyClass)); And the following exception is thrown: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I've been stumbling on the cause of this and haven't been able to get a grasp on it. Does anyone have any tips? I also cannot seem to trap this error... it blows right through the try/catch. By the way, the error doesn't *always* happen. Sometimes in debug mode it works fine, but it seems like once it starts, it'll always happen even after restarting Visual Studio. A reboot clears it up and allows it to work at least once. It also happens when running from the compiled EXE.
c#
asp.net
null
null
null
null
open
new XmlSerializer(typeof(MyClass)) Causing Memory corruption? === I've got an application that loads an assembly dynamically: Assembly asm = Assembly.Load("MyClass.DLL"); Type type = asm.GetType("MyClass"); MyClass runningAssembly = (MyClass)Activator.CreateInstance(type); runningAssembly.start(); Once loaded and the start() method is called, this line of code is executed: XmlSerializer deserializer = new XmlSerializer(typeof(MyClass)); And the following exception is thrown: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt." I've been stumbling on the cause of this and haven't been able to get a grasp on it. Does anyone have any tips? I also cannot seem to trap this error... it blows right through the try/catch. By the way, the error doesn't *always* happen. Sometimes in debug mode it works fine, but it seems like once it starts, it'll always happen even after restarting Visual Studio. A reboot clears it up and allows it to work at least once. It also happens when running from the compiled EXE.
0
6,796,900
07/22/2011 22:48:18
858,608
07/22/2011 20:09:49
1
0
english to english dictionary
I found some dictionary that translate english to other language , but I am still cant find dictionary for english to english . could you please introduce me some dictionary to show me a synonym for words
api
dictionary
english
synonym
null
07/22/2011 23:32:26
off topic
english to english dictionary === I found some dictionary that translate english to other language , but I am still cant find dictionary for english to english . could you please introduce me some dictionary to show me a synonym for words
2
7,318,024
09/06/2011 09:52:48
616,643
02/14/2011 18:18:02
504
17
jQuery validation plugin - numbers only, min & max length - space issue
I'm using jQuery Validation (**[PLUGIN URL][1]**) plugin for most of my form validation: I have following example: **FORM:** <form class="form" id="feedback-form" method="post" action="#"> <label for="phone">Contact number:</label> <input type="text" value="" id="phone" name="phone" class="required"> <br class="clr"> <div class="form-buttons"> <input id="submit" type="submit" value="Submit" class="button" > </div> <br class="clr"> <br /><br /> </form> **jQuery:** $("#feedback-form").validate({ rules: { phone: { number: true, // as space is not a number it will return an error minlength: 6, // will count space maxlength: 9 } } }); **I have two issues, both relating to space usage.** - min & max length will count space as an character - if `number = true` and space is used, it will return error as space is not a number **Is there any workaround this? Have any of you bumped in on the same problem?** Please note I want to keep allowing to type in space (for readability). [1]: http://docs.jquery.com/Plugins/Validation/
jquery
jquery-validate
null
null
null
null
open
jQuery validation plugin - numbers only, min & max length - space issue === I'm using jQuery Validation (**[PLUGIN URL][1]**) plugin for most of my form validation: I have following example: **FORM:** <form class="form" id="feedback-form" method="post" action="#"> <label for="phone">Contact number:</label> <input type="text" value="" id="phone" name="phone" class="required"> <br class="clr"> <div class="form-buttons"> <input id="submit" type="submit" value="Submit" class="button" > </div> <br class="clr"> <br /><br /> </form> **jQuery:** $("#feedback-form").validate({ rules: { phone: { number: true, // as space is not a number it will return an error minlength: 6, // will count space maxlength: 9 } } }); **I have two issues, both relating to space usage.** - min & max length will count space as an character - if `number = true` and space is used, it will return error as space is not a number **Is there any workaround this? Have any of you bumped in on the same problem?** Please note I want to keep allowing to type in space (for readability). [1]: http://docs.jquery.com/Plugins/Validation/
0
7,750,257
10/13/2011 06:33:08
326,439
04/26/2010 23:59:10
472
33
How to move all my data on one firefox to another
All, I have one firefox installation at work that has specific add-ons, each add-on having it's own preferences and history/data. Is there a tool/steps to move the entire data to my personal PC, so that I do not have to set-up everything all over again? My workstation is Windows XP SP3 and my personal PC is Windows 7, professional, 64bit. Thanks
firefox
firefox-addon
null
null
null
10/13/2011 16:18:05
off topic
How to move all my data on one firefox to another === All, I have one firefox installation at work that has specific add-ons, each add-on having it's own preferences and history/data. Is there a tool/steps to move the entire data to my personal PC, so that I do not have to set-up everything all over again? My workstation is Windows XP SP3 and my personal PC is Windows 7, professional, 64bit. Thanks
2
11,676,478
07/26/2012 19:16:00
1,555,787
07/26/2012 19:06:53
1
0
How to make a gridview which adds row at runtime and can fetch data from database on textchanged function from a textbox inside the gridview?
in a webpage i need to have a gridview, which at start will contain a single row. there are 3 columns (2 textbox and 1 label). one of these textbox has autocomplete feature, so whn i write a item name in that textbox and in the other textbox put a quantity, i need to display the item's price from database * the quantity in the label. also i need to add another row and do the similar for that row also. at the end i need to display the sum of all the amounts that has been displayed in each rows in a label outside the gridview. How do i do this?? please help..
asp.net
c#-4.0
asp.net-ajax
null
null
07/30/2012 06:34:34
not a real question
How to make a gridview which adds row at runtime and can fetch data from database on textchanged function from a textbox inside the gridview? === in a webpage i need to have a gridview, which at start will contain a single row. there are 3 columns (2 textbox and 1 label). one of these textbox has autocomplete feature, so whn i write a item name in that textbox and in the other textbox put a quantity, i need to display the item's price from database * the quantity in the label. also i need to add another row and do the similar for that row also. at the end i need to display the sum of all the amounts that has been displayed in each rows in a label outside the gridview. How do i do this?? please help..
1
9,015,384
01/26/2012 08:18:06
941,939
09/13/2011 06:39:56
24
2
Close the port using c#
Using socket programming some time it gives error that port is already in use is there anyway to release/close the port? e.g 5657 is my port no. can i release the port manually ? using c# Thanks
c#
c#-4.0
c#-3.0
c#-2.0
null
01/26/2012 15:23:39
not a real question
Close the port using c# === Using socket programming some time it gives error that port is already in use is there anyway to release/close the port? e.g 5657 is my port no. can i release the port manually ? using c# Thanks
1
6,015,443
05/16/2011 09:33:46
615,960
02/14/2011 09:24:06
36
0
To set background image to GLpaint App
i am beginner for opengles ,i just dnt get how to background image to opengl view please provide some sample code start with in GlPaint app.
iphone
null
null
null
null
05/16/2011 11:08:07
not a real question
To set background image to GLpaint App === i am beginner for opengles ,i just dnt get how to background image to opengl view please provide some sample code start with in GlPaint app.
1
8,699,717
01/02/2012 10:24:29
1,111,705
12/22/2011 12:19:51
1
1
Getting Webdriver ElementNotVisibleException when trying to click on sub-menu buttons that appear on hovering the mouse over menu buttons
How to make selenium server 2.0 identify the sub-menu buttons that appear on hovering the mouse over menu buttons. For example, there is a menu button. On hovering the mouse over it, 2 sub-menu buttons appear. I want to click on the sub-menu button. How to make selenium server 2.0 identify the sub-menu button and click it?
selenium2
null
null
null
null
null
open
Getting Webdriver ElementNotVisibleException when trying to click on sub-menu buttons that appear on hovering the mouse over menu buttons === How to make selenium server 2.0 identify the sub-menu buttons that appear on hovering the mouse over menu buttons. For example, there is a menu button. On hovering the mouse over it, 2 sub-menu buttons appear. I want to click on the sub-menu button. How to make selenium server 2.0 identify the sub-menu button and click it?
0
10,719,130
05/23/2012 11:36:48
1,404,727
05/19/2012 06:15:26
1
0
Geocoding and reverse geocoding
I am trying a simple app where i need to display a map.And when i click on any location it should return the address of that location.Can u please guide me as how to proceed with this.
android
google-geocoder
null
null
null
05/24/2012 12:16:32
not a real question
Geocoding and reverse geocoding === I am trying a simple app where i need to display a map.And when i click on any location it should return the address of that location.Can u please guide me as how to proceed with this.
1
5,384,842
03/21/2011 23:10:52
670,131
03/21/2011 20:30:14
1
0
Android 3.0 Use Physical Keyboard Setting
Background: I recently purchased a Motorola XOOM Tablet along with the Desktop Dock and Bluetooth Keyboard accessories. The dock and keyboard work great, but when I take the tablet off the dock to move away from my desk, the keyboard still remains paired with the device and I have to manually change the settings to use the soft keyboard. The same goes for when I set it back on the dock, I need to manually switch it back. It's not a _huge_ problem, but it would be nice not to have to think about it. So I tried downloading an app from the market that simply toggled Bluetooth on and off when connected or disconnected from a power source, which worked well for a while, but the background service would die after period and become useless until I manually restarted that. TO THE POINT: I'm trying to write a little app/service for my tablet that will recognize when it has been docked/undocked and switch the "Use Physical Keyboard" setting accordingly. I have started with a BroadcastReciever to recognize the Dock State: <pre> public class DockBroadcastReciever extends BroadcastReceiver { private final String DOCK_STATE_LABEL = "android.intent.extra.DOCK_STATE"; @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); String message = (extras.getInt(DOCK_STATE_LABEL) == Intent.EXTRA_DOCK_STATE_UNDOCKED) ? "Undocked" : "Docked"; Toast toast = Toast.makeText(context, message, Toast.LENGTH_LONG); toast.show(); } } </pre> But I'm having trouble figuring out the best way to update the setting after the event is fired. I've poked around some examples using _InputMethodManager_, but all the methods seem to need a specific _EditText_ or some other input to bind to. Furthermore, I can't seem to find a corresponding constant that represents that setting anywhere in the docs, but graphically, it is located here: http://i.stack.imgur.com/esFaw.png Can anyone help me out with this? I would like for there to be a solution for changing the setting, but I am open to other ideas as well.
android
keyboard
settings
input-devices
null
null
open
Android 3.0 Use Physical Keyboard Setting === Background: I recently purchased a Motorola XOOM Tablet along with the Desktop Dock and Bluetooth Keyboard accessories. The dock and keyboard work great, but when I take the tablet off the dock to move away from my desk, the keyboard still remains paired with the device and I have to manually change the settings to use the soft keyboard. The same goes for when I set it back on the dock, I need to manually switch it back. It's not a _huge_ problem, but it would be nice not to have to think about it. So I tried downloading an app from the market that simply toggled Bluetooth on and off when connected or disconnected from a power source, which worked well for a while, but the background service would die after period and become useless until I manually restarted that. TO THE POINT: I'm trying to write a little app/service for my tablet that will recognize when it has been docked/undocked and switch the "Use Physical Keyboard" setting accordingly. I have started with a BroadcastReciever to recognize the Dock State: <pre> public class DockBroadcastReciever extends BroadcastReceiver { private final String DOCK_STATE_LABEL = "android.intent.extra.DOCK_STATE"; @Override public void onReceive(Context context, Intent intent) { Bundle extras = intent.getExtras(); String message = (extras.getInt(DOCK_STATE_LABEL) == Intent.EXTRA_DOCK_STATE_UNDOCKED) ? "Undocked" : "Docked"; Toast toast = Toast.makeText(context, message, Toast.LENGTH_LONG); toast.show(); } } </pre> But I'm having trouble figuring out the best way to update the setting after the event is fired. I've poked around some examples using _InputMethodManager_, but all the methods seem to need a specific _EditText_ or some other input to bind to. Furthermore, I can't seem to find a corresponding constant that represents that setting anywhere in the docs, but graphically, it is located here: http://i.stack.imgur.com/esFaw.png Can anyone help me out with this? I would like for there to be a solution for changing the setting, but I am open to other ideas as well.
0
2,083,535
01/18/2010 02:07:28
194,319
10/22/2009 05:12:17
69
5
Delphi Indy Invalid Proxy Checking..
I have the following code in my program. When I try to check if the proxy is a valid proxy or not it crashes my program. Any ideas how to fix this? I'm using indy 10. <pre><code> if checkproxy('http://www.google.com') label1.text:='Good' else label1.text:='bad'; </pre></code> <pre><code> function checkproxy(sURL : ansistring) : boolean; var sstream : Tstringstream; httpcon : TIdHTTP; antifreeze : TIdAntiFreeze; begin result := true; try antifreeze := TIdAntiFreeze.Create(nil); httpcon := TIdHTTP.create; //I tried with this code here, and it crashes, and then I tried the code at // http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1187&lngWId=7 // which does not seem to fix the issue. //httpcon.ProxyParams.BasicAuthentication:=true; //httpcon.ProxyParams.ProxyPassword:='234'; //httpcon.ProxyParams.ProxyPort:=80; //httpcon.ProxyParams.ProxyServer:='21.34.34.33'; //httpcon.ProxyParams.ProxyUsername:='notreal'; // httpcon.HandleRedirects := true; antifreeze.Active := true; HttpCon.Request.ProxyConnection:='21.34.34.33';//Purposely a bad address; HttpCon.Get(sURL,sstream); httpCon.Disconnect; except on E: EIdException do begin result:=false; end; On E:exception do begin showmessage('External error:' + #13#10 + E.Message); result:=false; end; end; antifreeze.Active := false; freeandnil(httpcon); freeandnil(antifreeze); end; </pre></code>
indy
delphi
proxy
null
null
null
open
Delphi Indy Invalid Proxy Checking.. === I have the following code in my program. When I try to check if the proxy is a valid proxy or not it crashes my program. Any ideas how to fix this? I'm using indy 10. <pre><code> if checkproxy('http://www.google.com') label1.text:='Good' else label1.text:='bad'; </pre></code> <pre><code> function checkproxy(sURL : ansistring) : boolean; var sstream : Tstringstream; httpcon : TIdHTTP; antifreeze : TIdAntiFreeze; begin result := true; try antifreeze := TIdAntiFreeze.Create(nil); httpcon := TIdHTTP.create; //I tried with this code here, and it crashes, and then I tried the code at // http://www.planetsourcecode.com/vb/scripts/ShowCode.asp?txtCodeId=1187&lngWId=7 // which does not seem to fix the issue. //httpcon.ProxyParams.BasicAuthentication:=true; //httpcon.ProxyParams.ProxyPassword:='234'; //httpcon.ProxyParams.ProxyPort:=80; //httpcon.ProxyParams.ProxyServer:='21.34.34.33'; //httpcon.ProxyParams.ProxyUsername:='notreal'; // httpcon.HandleRedirects := true; antifreeze.Active := true; HttpCon.Request.ProxyConnection:='21.34.34.33';//Purposely a bad address; HttpCon.Get(sURL,sstream); httpCon.Disconnect; except on E: EIdException do begin result:=false; end; On E:exception do begin showmessage('External error:' + #13#10 + E.Message); result:=false; end; end; antifreeze.Active := false; freeandnil(httpcon); freeandnil(antifreeze); end; </pre></code>
0
8,073,595
11/10/2011 00:22:25
1,038,719
11/09/2011 23:17:59
1
0
How to pass GUID in JSON format?
We are trying a JSON request from a web service. We are sending GUID in the format "currentUserId": "9a63882f-1f0e-4515-adca-54c447923d31", If I try it on Fiddler, it gives an error. The value '' cannot be parsed as the type 'Guid'.'. Can you please tell me how to pass a guid type in JSON?
json
guid
null
null
null
11/10/2011 10:56:47
not a real question
How to pass GUID in JSON format? === We are trying a JSON request from a web service. We are sending GUID in the format "currentUserId": "9a63882f-1f0e-4515-adca-54c447923d31", If I try it on Fiddler, it gives an error. The value '' cannot be parsed as the type 'Guid'.'. Can you please tell me how to pass a guid type in JSON?
1
10,222,411
04/19/2012 05:57:37
1,091,688
12/10/2011 21:42:22
153
5
using partials with express in node.js
I am trying to render partials using node.js. Here is my code. app.js: var express = require('express') , routes = require('./routes'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(__dirname + '/public')); }); app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ app.use(express.errorHandler()); }); // Routes app.get('/', routes.index); var products = require('./products.js'); app.get('/products', function(req, res) { res.render('products/index', {locals: { products: products.all } }); }); app.listen(3000); When I go to localhost:3000/products it should render index.jade which is in the products folder which is in the views folder.Above I set the views directory using `app.set('views', __dirname + '/views');` index.jade: h1 Products: #products!= partial('partials/product', {collection: products}) This should render the partial equivalent to (partials/product.jade) because jade is my view engine. I am getting an error back saying "partial is not defined" Any help would be great. thanks
javascript
node.js
express
jade
partials
null
open
using partials with express in node.js === I am trying to render partials using node.js. Here is my code. app.js: var express = require('express') , routes = require('./routes'); var app = module.exports = express.createServer(); // Configuration app.configure(function(){ app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.bodyParser()); app.use(express.methodOverride()); app.use(app.router); app.use(express.static(__dirname + '/public')); }); app.configure('development', function(){ app.use(express.errorHandler({ dumpExceptions: true, showStack: true })); }); app.configure('production', function(){ app.use(express.errorHandler()); }); // Routes app.get('/', routes.index); var products = require('./products.js'); app.get('/products', function(req, res) { res.render('products/index', {locals: { products: products.all } }); }); app.listen(3000); When I go to localhost:3000/products it should render index.jade which is in the products folder which is in the views folder.Above I set the views directory using `app.set('views', __dirname + '/views');` index.jade: h1 Products: #products!= partial('partials/product', {collection: products}) This should render the partial equivalent to (partials/product.jade) because jade is my view engine. I am getting an error back saying "partial is not defined" Any help would be great. thanks
0
9,253,844
02/12/2012 23:45:38
250,993
01/14/2010 18:54:23
317
11
Gem rb-inotify causing libffi errors
[Gemfile][1] -- I'm trying to use guard on my system. With the Gemfile as is, I'm only using - `gem 'libnotify', '0.5.9'` - `gem 'guard-rspec', '0.5.5'` When I run guard `bundle exec guard`, I get this [error][2]: > /usr/local/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/lib/ffi.rb:11:in > `require': ffi_prep_cif failed. status=0x2 (fatal) I can however still run my tests via `bundle exec rspec spec/requests/static_pages_spec.rb`. Now if I use the gem `gem 'rb-inotify', '0.8.8'` as I'm supposed to according to [this Ruby on Rails tutorial][3], and try to run my tests, they fail with the same error as above (ffi_prep_cif failed). When I do a ls on `/usr/local/lib`, I see a few `libffi` files. Could this be a problem? Can anyone explain what's going on here & why `rb-inotify` is acting up? [1]: http://pastebin.com/nQPympJA [2]: http://pastebin.com/2bJxZ43P [3]: http://ruby.railstutorial.org/chapters/static-pages?version=3.2#sec:guard
ruby-on-rails
ruby
guard
null
null
null
open
Gem rb-inotify causing libffi errors === [Gemfile][1] -- I'm trying to use guard on my system. With the Gemfile as is, I'm only using - `gem 'libnotify', '0.5.9'` - `gem 'guard-rspec', '0.5.5'` When I run guard `bundle exec guard`, I get this [error][2]: > /usr/local/lib/ruby/gems/1.9.1/gems/ffi-1.0.11/lib/ffi.rb:11:in > `require': ffi_prep_cif failed. status=0x2 (fatal) I can however still run my tests via `bundle exec rspec spec/requests/static_pages_spec.rb`. Now if I use the gem `gem 'rb-inotify', '0.8.8'` as I'm supposed to according to [this Ruby on Rails tutorial][3], and try to run my tests, they fail with the same error as above (ffi_prep_cif failed). When I do a ls on `/usr/local/lib`, I see a few `libffi` files. Could this be a problem? Can anyone explain what's going on here & why `rb-inotify` is acting up? [1]: http://pastebin.com/nQPympJA [2]: http://pastebin.com/2bJxZ43P [3]: http://ruby.railstutorial.org/chapters/static-pages?version=3.2#sec:guard
0
7,116,509
08/19/2011 03:02:30
734,962
05/02/2011 18:59:34
1
0
Counting number of checked checkboxes in PHP
I don't need to know which ones are checked, just how many. I'd like to know what to name each checkbox and how to get and count the values using the get method.
php
null
null
null
null
08/19/2011 15:02:42
not a real question
Counting number of checked checkboxes in PHP === I don't need to know which ones are checked, just how many. I'd like to know what to name each checkbox and how to get and count the values using the get method.
1
9,732,775
03/16/2012 06:14:25
1,191,501
02/06/2012 03:30:47
1
0
Android store recorded audio using input text?
I have an app that records and stores the audio on the sdcard. It records and saves it in the right place, but saves it as android.widget.EditText@random number. I was using an EditText to get the filename. Does anyone know how I can let the user enter some text and save the file as that. I thought I was onto something with the code below, but no... try { //Set user input as filename String filename = getInput.toString(); // set the storage directory to SDcard File storageDir = new File(Environment.getExternalStorageDirectory(), "audio"); storageDir.mkdir(); Log.d(APP_TAG, "Storage directory set to " + storageDir); outfile = File.createTempFile(filename, ".3gp", storageDir); //show filename System.out.println("File is: "+outfile.getAbsolutePath()); // initiate recorder recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(outfile.getAbsolutePath()); } catch (IOException e) { Log.w(APP_TAG, "File not accessible ", e); } catch (IllegalArgumentException e) { Log.w(APP_TAG, "Illegal argument ", e); } catch (IllegalStateException e) { Log.w(APP_TAG, "Illegal state, call reset/restore", e); } startRecord(); } else { stopRecord();
android
audio-recording
file-rename
null
null
null
open
Android store recorded audio using input text? === I have an app that records and stores the audio on the sdcard. It records and saves it in the right place, but saves it as android.widget.EditText@random number. I was using an EditText to get the filename. Does anyone know how I can let the user enter some text and save the file as that. I thought I was onto something with the code below, but no... try { //Set user input as filename String filename = getInput.toString(); // set the storage directory to SDcard File storageDir = new File(Environment.getExternalStorageDirectory(), "audio"); storageDir.mkdir(); Log.d(APP_TAG, "Storage directory set to " + storageDir); outfile = File.createTempFile(filename, ".3gp", storageDir); //show filename System.out.println("File is: "+outfile.getAbsolutePath()); // initiate recorder recorder.setAudioSource(MediaRecorder.AudioSource.MIC); recorder.setOutputFormat(MediaRecorder.OutputFormat.THREE_GPP); recorder.setAudioEncoder(MediaRecorder.AudioEncoder.AMR_NB); recorder.setOutputFile(outfile.getAbsolutePath()); } catch (IOException e) { Log.w(APP_TAG, "File not accessible ", e); } catch (IllegalArgumentException e) { Log.w(APP_TAG, "Illegal argument ", e); } catch (IllegalStateException e) { Log.w(APP_TAG, "Illegal state, call reset/restore", e); } startRecord(); } else { stopRecord();
0
7,156,810
08/23/2011 05:53:39
838,902
07/11/2011 12:48:50
389
60
Apple Mach-O Linker (Id) Error : While calling c++ file from .m file
I have some cpp file where my functions are written. I want to call that functions in my iPhone app? How can i call c++ methods in my .m file??? Here is my .cpp file int add(int a, int b) { return a+b; } Now in my viewDidLoad event i am using following code just to fetch the result and display in a Label. NSNumber *n = [[NSNumber alloc] initWithInt:add(5,7)]; [myLabel setText:[NSString stringWithFormat:@"%@",n]]; I received the following Error while compiling: Undefined symbols for architecture i386: "_add", referenced from: -[usingc__ViewController viewDidLoad] in usingc__ViewController.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status Where is the error in the code?? What edit is necessary for this??
iphone
c++
objective-c
xcode4
objective-c++
null
open
Apple Mach-O Linker (Id) Error : While calling c++ file from .m file === I have some cpp file where my functions are written. I want to call that functions in my iPhone app? How can i call c++ methods in my .m file??? Here is my .cpp file int add(int a, int b) { return a+b; } Now in my viewDidLoad event i am using following code just to fetch the result and display in a Label. NSNumber *n = [[NSNumber alloc] initWithInt:add(5,7)]; [myLabel setText:[NSString stringWithFormat:@"%@",n]]; I received the following Error while compiling: Undefined symbols for architecture i386: "_add", referenced from: -[usingc__ViewController viewDidLoad] in usingc__ViewController.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status Where is the error in the code?? What edit is necessary for this??
0
8,899,093
01/17/2012 17:35:20
509,706
11/16/2010 15:42:11
87
4
Query on ID using Google App Engine models
I have an entity in my datastore: In [38]: i1 Out[38]: <my_app.models.Infospot at 0x4255a90> In [39]: i1.key().id() Out[39]: 162L But I can't query based on its ID: In [41]: Infospot.get_by_id(162L) is None Out[41]: True In [45]: Infospot.get(Key.from_path('Infospot', 162L)) is None Out[45]: True What am I doing wrong?
python
google-app-engine
null
null
null
null
open
Query on ID using Google App Engine models === I have an entity in my datastore: In [38]: i1 Out[38]: <my_app.models.Infospot at 0x4255a90> In [39]: i1.key().id() Out[39]: 162L But I can't query based on its ID: In [41]: Infospot.get_by_id(162L) is None Out[41]: True In [45]: Infospot.get(Key.from_path('Infospot', 162L)) is None Out[45]: True What am I doing wrong?
0
1,090,620
07/07/2009 06:06:11
5,475
09/09/2008 21:50:17
698
35
Special methods in Python
What are all the special methods in Python? The `__xxx__` methods, that is. I'm often looking for a way to override something which I know is possible to do through one of these methods, but I'm having a hard time to find how since as far as I can tell there is no definitive list of these methods, PLUS their names are not really Google friendly. So I think having a list of those here on SO would be a good idea.
python
hidden-features
null
null
null
05/06/2012 16:44:15
not constructive
Special methods in Python === What are all the special methods in Python? The `__xxx__` methods, that is. I'm often looking for a way to override something which I know is possible to do through one of these methods, but I'm having a hard time to find how since as far as I can tell there is no definitive list of these methods, PLUS their names are not really Google friendly. So I think having a list of those here on SO would be a good idea.
4
6,091,866
05/23/2011 00:57:44
136,132
07/10/2009 08:13:44
61
0
How I do create new repository via gitosis + webdav
I want to create new repository via http:// protocol. so I installed gitosis + webdav on ubuntu. I could clone and push from exsiting repository. but, When I create new repository on local and remote add origin http:// ~ and push it, I can not create new repository to server via http:// protocol. but, I can create new repository to server via git protocol. Can I create new repository using with http protocol?
git
webdav
gitosis
null
null
null
open
How I do create new repository via gitosis + webdav === I want to create new repository via http:// protocol. so I installed gitosis + webdav on ubuntu. I could clone and push from exsiting repository. but, When I create new repository on local and remote add origin http:// ~ and push it, I can not create new repository to server via http:// protocol. but, I can create new repository to server via git protocol. Can I create new repository using with http protocol?
0
10,383,516
04/30/2012 12:12:56
780,973
06/02/2011 10:49:39
6
0
calculate how many images will fit horizontally with php
I'm building a small profile page in PHP. How can I calculate how many images will fit within 960px layout given 3px padding around each image and a small margin of say 1px. I should mention the thumbs should be over 100px x 100px. So I guess I need to be able to calculate the size of the thumbs as well so that they fit evenly into the given width of the layout.
php
css
null
null
null
null
open
calculate how many images will fit horizontally with php === I'm building a small profile page in PHP. How can I calculate how many images will fit within 960px layout given 3px padding around each image and a small margin of say 1px. I should mention the thumbs should be over 100px x 100px. So I guess I need to be able to calculate the size of the thumbs as well so that they fit evenly into the given width of the layout.
0
4,634,115
01/08/2011 13:38:57
81,388
03/23/2009 12:09:08
114
8
Change Silverlight DataForm:DataField label value at runtime.
I'm having a dataform which is binded to a property in my view-model in a Silverlight application, I've created my entity classes with WCF RIA Services and every property has the attribute of DisplayName which is shown in the dataform datafield label. what I need to do is to add a ":" at the end of every label in the custom datafields that I create. The reason I need this to happen is because I have a grid in my page which is binded to the list of current objects (e.g. Employees) and I don't want ":" at the end of the grid headers, but I also need ":" when I'm trying to edit or add a new employee. This is what I've done so far, but it's not working. public class CustomDataField : DataField { public CustomDataField() { } public new object Label { get { return base.Label; } set { base.Label = value; if( value is string ) { base.Label = (string)value + ":"; } } } }
silverlight
dataform
datafield
null
null
null
open
Change Silverlight DataForm:DataField label value at runtime. === I'm having a dataform which is binded to a property in my view-model in a Silverlight application, I've created my entity classes with WCF RIA Services and every property has the attribute of DisplayName which is shown in the dataform datafield label. what I need to do is to add a ":" at the end of every label in the custom datafields that I create. The reason I need this to happen is because I have a grid in my page which is binded to the list of current objects (e.g. Employees) and I don't want ":" at the end of the grid headers, but I also need ":" when I'm trying to edit or add a new employee. This is what I've done so far, but it's not working. public class CustomDataField : DataField { public CustomDataField() { } public new object Label { get { return base.Label; } set { base.Label = value; if( value is string ) { base.Label = (string)value + ":"; } } } }
0
10,956,790
06/08/2012 22:35:48
988,445
10/10/2011 21:32:09
2,782
35
Convert any record to a string?
Is there any possible way to convert any `record` type to a single `String` and back? Perhaps a way to load the record into a stream and read it as a String? A search on Google only found me 1 other person asking the same question on another site with no answer.
delphi
type-conversion
delphi-xe2
record
null
null
open
Convert any record to a string? === Is there any possible way to convert any `record` type to a single `String` and back? Perhaps a way to load the record into a stream and read it as a String? A search on Google only found me 1 other person asking the same question on another site with no answer.
0
2,499,372
03/23/2010 11:19:30
293,631
03/15/2010 00:17:10
8
0
C programing txt to XML
How can i make a program that open an txt and convert him to a XML file? regards
c
null
null
null
null
null
open
C programing txt to XML === How can i make a program that open an txt and convert him to a XML file? regards
0
8,323,865
11/30/2011 09:43:24
567,751
01/08/2011 04:06:48
7,235
398
How to aviod sapcing from the first div of each row
I have `DIVs` which comes `side by side` of each other & but there only `fourth DIV` comes in the first `row` & other are shifted too the next `row`. I want each `row` `first div` take no space from `left side` but is not happened. Here is my code http://jsfiddle.net/25pwG/ -------------------------- I know i can do it with giving `class` manual to the `new row DIV` but i didn't want that. i want this with less css & i didn't want to change my `markup` *NOTE*: i want capability till IE8. Thanks in advance :)
html
css
null
null
null
null
open
How to aviod sapcing from the first div of each row === I have `DIVs` which comes `side by side` of each other & but there only `fourth DIV` comes in the first `row` & other are shifted too the next `row`. I want each `row` `first div` take no space from `left side` but is not happened. Here is my code http://jsfiddle.net/25pwG/ -------------------------- I know i can do it with giving `class` manual to the `new row DIV` but i didn't want that. i want this with less css & i didn't want to change my `markup` *NOTE*: i want capability till IE8. Thanks in advance :)
0
11,105,815
06/19/2012 17:02:41
284,750
03/02/2010 20:32:09
118
9
Java PreparedStatement RETURN_GENERATED_KEYS not working
I am trying to get the identity column returned to my java program when doing a SQL insert. I am getting the following error when running the code Uncaught exception thrown in one of the service methods of the servlet: Cocoon. Exception thrown : java.lang.AbstractMethodError: java/sql /Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement; Here is the code I am running. sql.append("insert into cpgusrdtaf (statecd, addr1, addr2, city, state, "); sql.append("zipcode, dependent, shdindic, marstatus, residency, prntatge, "); sql.append("fincome, mincome, pincome, taxspaid, taxreturn, elig1040, "); sql.append("gincome, pcash, inetwrth, bnetwrth, pbenefit, paddlinf, "); sql.append("puntax, pdslcwrk, smstatus, sresidncy, studtr, stud1040, "); sql.append("sadjinc, sincome, spincome, sdslcwrk, studtax, scash, "); sql.append("sinvest, snetwrth, saddlinf, suntax, househld, nmbrsch, "); sql.append("studact, studsat, schools, housing) "); sql.append("values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, "); sql.append("?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); //This line of code is where I get the error pstmt = con.prepareStatement(sql.toString(), Statement.RETURN_GENERATED_KEYS); I am not allowed to use stored procedures, so I cannot go that route. Any help would be greatly appreciated Thanks in advance Doug
java
sql
jdbc
insert
prepared-statement
null
open
Java PreparedStatement RETURN_GENERATED_KEYS not working === I am trying to get the identity column returned to my java program when doing a SQL insert. I am getting the following error when running the code Uncaught exception thrown in one of the service methods of the servlet: Cocoon. Exception thrown : java.lang.AbstractMethodError: java/sql /Connection.prepareStatement(Ljava/lang/String;I)Ljava/sql/PreparedStatement; Here is the code I am running. sql.append("insert into cpgusrdtaf (statecd, addr1, addr2, city, state, "); sql.append("zipcode, dependent, shdindic, marstatus, residency, prntatge, "); sql.append("fincome, mincome, pincome, taxspaid, taxreturn, elig1040, "); sql.append("gincome, pcash, inetwrth, bnetwrth, pbenefit, paddlinf, "); sql.append("puntax, pdslcwrk, smstatus, sresidncy, studtr, stud1040, "); sql.append("sadjinc, sincome, spincome, sdslcwrk, studtax, scash, "); sql.append("sinvest, snetwrth, saddlinf, suntax, househld, nmbrsch, "); sql.append("studact, studsat, schools, housing) "); sql.append("values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?, "); sql.append("?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)"); //This line of code is where I get the error pstmt = con.prepareStatement(sql.toString(), Statement.RETURN_GENERATED_KEYS); I am not allowed to use stored procedures, so I cannot go that route. Any help would be greatly appreciated Thanks in advance Doug
0
7,563,752
09/27/2011 03:02:16
418,569
08/12/2010 15:10:02
102
4
add an email subject prefix with applescript
Im looking for a way to run an applescript that adds a particular email subject prefix when a keystroke is pressed. Seems this applescript may be on the right track, but not quite: [applescript][1] [1]: https://groups.google.com/group/the-hit-list-users/msg/9b62436eb7a93498 Im using a mac and the Mail.app. Any ideas? Thanks!
applescript
apple-mail
null
null
null
null
open
add an email subject prefix with applescript === Im looking for a way to run an applescript that adds a particular email subject prefix when a keystroke is pressed. Seems this applescript may be on the right track, but not quite: [applescript][1] [1]: https://groups.google.com/group/the-hit-list-users/msg/9b62436eb7a93498 Im using a mac and the Mail.app. Any ideas? Thanks!
0
8,151,003
11/16/2011 11:34:19
1,049,528
11/16/2011 11:21:57
1
0
Creating a varbinary column in a mysql database using code first Entity framework 4.1
When I try to create a varbinary column "Data" using the entity framework and a code first method. The problem is that when I run the program the script generated for this table doesnt specify a length for varbinary, which obviously breaks the execution and returns syntax errors from the mysql server. CREATE TABLE `TestAction`( `ID` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `Name` mediumtext NOT NULL, `Data` varbinary, `Tested` datetime NOT NULL, `TestID` int NOT NULL); I have already tried to initiate the byte array and added a max length attribute to the property but with no success. Has anyone succesfully done this? or can help it would be much appreciated
vb.net
entity-framework-4
length
varbinary
null
null
open
Creating a varbinary column in a mysql database using code first Entity framework 4.1 === When I try to create a varbinary column "Data" using the entity framework and a code first method. The problem is that when I run the program the script generated for this table doesnt specify a length for varbinary, which obviously breaks the execution and returns syntax errors from the mysql server. CREATE TABLE `TestAction`( `ID` int NOT NULL AUTO_INCREMENT PRIMARY KEY, `Name` mediumtext NOT NULL, `Data` varbinary, `Tested` datetime NOT NULL, `TestID` int NOT NULL); I have already tried to initiate the byte array and added a max length attribute to the property but with no success. Has anyone succesfully done this? or can help it would be much appreciated
0
11,073,618
06/17/2012 18:08:08
1,218,115
02/18/2012 13:56:20
3
0
Where to start my final year Java project?
First of all I would like to thank you for taking your time to read my post. Let me explain what I am asking here in more detail. For my final year project for uni, I will be implementing an MS Project-like program for a company that will use it to plan flight days. They want to be able to create a flightday plan that shows what planes will attend, the timeslots for each plane, information about planes and pilots etc. The program should, just like MS Project, allow them to drag and drop objects from a menu bar at the top and rearrange them on a timeline to build up the plan for the day. There will be a "current time" line that will start at the left of the screen in the morning (usually 8am) and move to the right as the day progresses (a bit like the timeline on a sound editing program). When the line reaches 12 o'clock noon, the whole background should start moving to the left and the line stays in the middle. Ideally the program should also support different zoom levels for easy visualisation. I am in early stages of the project and haven't actually started coding yet because it is such a massive project that I am not sure where to start from. The program should allow me to save a project and reopen it whenever and to achieve this I was thinking of somehow saving the objects' details to an XML file. A bit like the following: `<control controlID="6" controlTypeID="com.project.my::FormattingToolbar" x="968" y="502" w="248" h="-1" measuredW="270" measuredH="29" zOrder="2" locked="false" isInGroup="-1"/>` **NOTE: The above is some sample code I found online** I know it is hard for you guys to provide me with a lot of detail here but a "push" in the right direction with some sample source code/projects will be extremely helpful. Find attached a sample GUI I put together to show the guys at the company that will be using it. I hope it helps understand what I am trying to achieve here. I couldn't attach the image due to my low reputation so I have uploaded it to here: http://s13.postimage.org/51x4che7r/Flght_Planner.png Thank you one more time for reading this. Fil
java
xml
null
null
null
06/17/2012 18:10:36
not a real question
Where to start my final year Java project? === First of all I would like to thank you for taking your time to read my post. Let me explain what I am asking here in more detail. For my final year project for uni, I will be implementing an MS Project-like program for a company that will use it to plan flight days. They want to be able to create a flightday plan that shows what planes will attend, the timeslots for each plane, information about planes and pilots etc. The program should, just like MS Project, allow them to drag and drop objects from a menu bar at the top and rearrange them on a timeline to build up the plan for the day. There will be a "current time" line that will start at the left of the screen in the morning (usually 8am) and move to the right as the day progresses (a bit like the timeline on a sound editing program). When the line reaches 12 o'clock noon, the whole background should start moving to the left and the line stays in the middle. Ideally the program should also support different zoom levels for easy visualisation. I am in early stages of the project and haven't actually started coding yet because it is such a massive project that I am not sure where to start from. The program should allow me to save a project and reopen it whenever and to achieve this I was thinking of somehow saving the objects' details to an XML file. A bit like the following: `<control controlID="6" controlTypeID="com.project.my::FormattingToolbar" x="968" y="502" w="248" h="-1" measuredW="270" measuredH="29" zOrder="2" locked="false" isInGroup="-1"/>` **NOTE: The above is some sample code I found online** I know it is hard for you guys to provide me with a lot of detail here but a "push" in the right direction with some sample source code/projects will be extremely helpful. Find attached a sample GUI I put together to show the guys at the company that will be using it. I hope it helps understand what I am trying to achieve here. I couldn't attach the image due to my low reputation so I have uploaded it to here: http://s13.postimage.org/51x4che7r/Flght_Planner.png Thank you one more time for reading this. Fil
1
9,172,174
02/07/2012 06:57:18
1,193,999
02/07/2012 06:49:24
1
0
why does everybody code only pseudo conversational programs in cics
when cics supports conversational programs why would anyone write pseudo conversational programs arent conversational programs much easier i am trying to understand the differences please help
cobol
mainframe
cics
null
null
02/10/2012 12:57:58
not a real question
why does everybody code only pseudo conversational programs in cics === when cics supports conversational programs why would anyone write pseudo conversational programs arent conversational programs much easier i am trying to understand the differences please help
1
3,848,866
10/03/2010 06:41:33
453,148
09/02/2010 12:25:11
27
0
C++/CLI code porting problem
I'm trying to port a C++.NET (managed extensions) application to C++/CLI. However I'm not very strong with the syntax yet. What I'm trying to do is to create a wrapper for a C Dll file. To do this I'm using DllImport but I failed to found documentation on it's use. There are some problems due to changes of the syntax but I couldn't find out why yet. The C++.NET line looks like this: [DllImport("my.dll", CharSet = Ansi, CallingConvention = Cdecl, EntryPoint = "#10")] static MY_STATUS CPPInit(MY_HANDLE *pLmxHandle); The idea is to pass a reference of MY_HANDLE to the function which initializes it. One problem is that the keywords Ansi and Cdecl are unknown. I expect I need to put some class infront of them but it's a little hard without docs or samples. The other thing I have is a function which returns a static string: char *MyFunc(); Can I assume that it can be mapped to String^? Thanks in advance.
c++-cli
null
null
null
null
null
open
C++/CLI code porting problem === I'm trying to port a C++.NET (managed extensions) application to C++/CLI. However I'm not very strong with the syntax yet. What I'm trying to do is to create a wrapper for a C Dll file. To do this I'm using DllImport but I failed to found documentation on it's use. There are some problems due to changes of the syntax but I couldn't find out why yet. The C++.NET line looks like this: [DllImport("my.dll", CharSet = Ansi, CallingConvention = Cdecl, EntryPoint = "#10")] static MY_STATUS CPPInit(MY_HANDLE *pLmxHandle); The idea is to pass a reference of MY_HANDLE to the function which initializes it. One problem is that the keywords Ansi and Cdecl are unknown. I expect I need to put some class infront of them but it's a little hard without docs or samples. The other thing I have is a function which returns a static string: char *MyFunc(); Can I assume that it can be mapped to String^? Thanks in advance.
0
11,749,709
07/31/2012 22:06:05
1,017,513
10/28/2011 00:02:44
764
34
sql query help in sorting a field that's got both string and numbers
I've got a text field called source_recid. It stores half string half number like strings in it. Example shop.orders.32442 the syntax is `DATABASENAME.TABLENAME.RECID` My goal is to scan this col and find out the biggest RECID ( the integer) in it. So, in a case like this shop.orders.32442 shop.orders.82000 shop.orders.34452 It would be the record whose source_recid is `shop.orders.82000`. Why? Cause **82000** happens to be the largest integer. What SQL statement would get me that record? One option to this is to create a new column ( the_ids ) and move all the integers in it and then run something like this select source_recid from mytable where source_recid like 'shop.orders.%' order by the_ids DESC LIMIT 1 Is there a way to pull this off without going thru this step?
mysql
sql
query
null
null
null
open
sql query help in sorting a field that's got both string and numbers === I've got a text field called source_recid. It stores half string half number like strings in it. Example shop.orders.32442 the syntax is `DATABASENAME.TABLENAME.RECID` My goal is to scan this col and find out the biggest RECID ( the integer) in it. So, in a case like this shop.orders.32442 shop.orders.82000 shop.orders.34452 It would be the record whose source_recid is `shop.orders.82000`. Why? Cause **82000** happens to be the largest integer. What SQL statement would get me that record? One option to this is to create a new column ( the_ids ) and move all the integers in it and then run something like this select source_recid from mytable where source_recid like 'shop.orders.%' order by the_ids DESC LIMIT 1 Is there a way to pull this off without going thru this step?
0
5,772,487
04/24/2011 18:47:46
87,152
04/04/2009 19:42:27
2,248
5
RSS doesn't work with php
why does [this][1] rss work wrong? I can't understand, it worked before. The content shows like this: header("content-type: application/rss+xml"); // RSS-xml [1]: http://cskamoskva.ru/rss.php
php
rss
null
null
null
04/24/2011 19:01:27
not a real question
RSS doesn't work with php === why does [this][1] rss work wrong? I can't understand, it worked before. The content shows like this: header("content-type: application/rss+xml"); // RSS-xml [1]: http://cskamoskva.ru/rss.php
1
11,065,358
06/16/2012 16:56:39
239,168
12/27/2009 13:28:29
5,277
161
Find attached / bound events of an element using Chrome Development Tools / Firebug / IE Developer Toolbar
When inspecting a page's DOM, I would like to know the attached event(s) of an element quickly For example, if a button has this HTML DOM <button id="button1">Click Me</button> And somewhere (not in a place that I know in advance) it has an event attached, e.g. $("#button1").click(function(){...}); I know it can be done programatically ( http://stackoverflow.com/questions/2008592/can-i-find-events-bound-on-an-element-with-jquery ) but is there a way using just one of the developer tools for Chrome / Firefox / IE to see a list of events? ---------- **Update**: I found out that in the newer Chrome versions I have a tab called **EventListeners** but it seems it doesn't allow easy drill down all the way down to the source of the event, as jQuery wraps the original
jquery
javascript-events
firebug
google-chrome-devtools
ie8-developer-tools
null
open
Find attached / bound events of an element using Chrome Development Tools / Firebug / IE Developer Toolbar === When inspecting a page's DOM, I would like to know the attached event(s) of an element quickly For example, if a button has this HTML DOM <button id="button1">Click Me</button> And somewhere (not in a place that I know in advance) it has an event attached, e.g. $("#button1").click(function(){...}); I know it can be done programatically ( http://stackoverflow.com/questions/2008592/can-i-find-events-bound-on-an-element-with-jquery ) but is there a way using just one of the developer tools for Chrome / Firefox / IE to see a list of events? ---------- **Update**: I found out that in the newer Chrome versions I have a tab called **EventListeners** but it seems it doesn't allow easy drill down all the way down to the source of the event, as jQuery wraps the original
0
6,572,369
07/04/2011 13:47:34
818,718
06/28/2011 07:34:37
13
0
fetching records
private void TxtFarmerCode_TextChanged_1(object sender, EventArgs e) { int intValue = 0; if (int.TryParse(TxtFarmerCode.Text, out intValue)) { using (SqlConnection sqlConn = new SqlConnection("Data Source=TANYA-PC;Initial Catalog=biore1;Integrated Security=True")) //here goes connStrng or the variable of it { sqlConn.Open(); string sqlQuery = @"SELECT farmername,villagename FROM cottonpurchase WHERE farmercode = @code"; using (SqlCommand cmd = new SqlCommand(sqlQuery, sqlConn)) { cmd.Parameters.Add("@code", SqlDbType.Int).Value = intValue; using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { TxtFarmerName.Text = (string)reader[0]; TxtVillageName.Text = (string)reader[1]; //TxtBasicPrice.Text = (string)reader[2]; } else MessageBox.Show("For Farmer Code " + intValue.ToString() + " there is no farmer in the database."); } } can someone help me with this code its annoying before i even finish writting the farmercode its gives me the error message isnt there anyother way i could do it ?
c#-2.0
null
null
null
null
07/04/2011 16:44:46
not a real question
fetching records === private void TxtFarmerCode_TextChanged_1(object sender, EventArgs e) { int intValue = 0; if (int.TryParse(TxtFarmerCode.Text, out intValue)) { using (SqlConnection sqlConn = new SqlConnection("Data Source=TANYA-PC;Initial Catalog=biore1;Integrated Security=True")) //here goes connStrng or the variable of it { sqlConn.Open(); string sqlQuery = @"SELECT farmername,villagename FROM cottonpurchase WHERE farmercode = @code"; using (SqlCommand cmd = new SqlCommand(sqlQuery, sqlConn)) { cmd.Parameters.Add("@code", SqlDbType.Int).Value = intValue; using (SqlDataReader reader = cmd.ExecuteReader()) { if (reader.Read()) { TxtFarmerName.Text = (string)reader[0]; TxtVillageName.Text = (string)reader[1]; //TxtBasicPrice.Text = (string)reader[2]; } else MessageBox.Show("For Farmer Code " + intValue.ToString() + " there is no farmer in the database."); } } can someone help me with this code its annoying before i even finish writting the farmercode its gives me the error message isnt there anyother way i could do it ?
1