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
8,988,853
01/24/2012 14:51:09
1,143,266
01/11/2012 13:16:27
12
0
Reward when a friend accepts app invite
In my facebook game I'm trying to create a system where a user can invite their friend to the game, I want it so that if they accept the invite then they both get rewarded I have read the API docs but not quite sure how to link who invited who. Any help appreciated Thanks, Jack.
php
facebook
facebook-graph-api
null
null
01/25/2012 15:48:33
not a real question
Reward when a friend accepts app invite === In my facebook game I'm trying to create a system where a user can invite their friend to the game, I want it so that if they accept the invite then they both get rewarded I have read the API docs but not quite sure how to link who invited who. Any help appreciated Thanks, Jack.
1
9,676,789
03/13/2012 00:35:18
1,265,360
03/13/2012 00:32:44
1
0
I would like a JavaScript to display a DIV class / ID if the HTML form input has a value?
I would like a JavaScript to display a DIV class if the HTML form input has a value. If there is no value the div is not displayed. I don't want it to display even if the text in the form input is erased by the form user. Thank you in advance.
javascript
html
null
null
null
03/15/2012 09:17:53
not a real question
I would like a JavaScript to display a DIV class / ID if the HTML form input has a value? === I would like a JavaScript to display a DIV class if the HTML form input has a value. If there is no value the div is not displayed. I don't want it to display even if the text in the form input is erased by the form user. Thank you in advance.
1
2,072,354
01/15/2010 14:48:21
115,845
06/02/2009 08:04:59
679
24
Setting up a Buildbot hosting service for multiple projects
I need to set up a buildbot hosting environment which is capable of managing a large number of ***independent*** projects, and ideally provides a web front-end for users to manage their buildbot instance. As far as I can gather, there isn't such a utility available at the moment. I'm planning to roll my own, but could really use some advice before taking on this <strike>foolhardy</strike> task. - Is such a project already available, or is there something similar I could build upon? - Extend buildbot to allow build masters to manage multiple independent projects, or create a new utility to manage multiple instances of build masters? - Anyone interested in collaborating on such an undertaking? Any other advice to steer me down the right path also appreciated. > **Some background info:** > > I'm trying to promote the use of > buildbot within my community but one > of the largest hurdle I face is how > complex the setup can be especially > for the uninitiated. > *N.B. I work in a research environment where Fortran is (and has been for > decades) the language of choice and > Python is still somewhat novel.* > > It looks like the only way I can > promote widespread adoption of > buildbot across the many projects > within my community is to provide a > easy-to-use hosting service for buildbot.
buildbot
hosting
continuous-integration
potential-opensoure-proje
null
null
open
Setting up a Buildbot hosting service for multiple projects === I need to set up a buildbot hosting environment which is capable of managing a large number of ***independent*** projects, and ideally provides a web front-end for users to manage their buildbot instance. As far as I can gather, there isn't such a utility available at the moment. I'm planning to roll my own, but could really use some advice before taking on this <strike>foolhardy</strike> task. - Is such a project already available, or is there something similar I could build upon? - Extend buildbot to allow build masters to manage multiple independent projects, or create a new utility to manage multiple instances of build masters? - Anyone interested in collaborating on such an undertaking? Any other advice to steer me down the right path also appreciated. > **Some background info:** > > I'm trying to promote the use of > buildbot within my community but one > of the largest hurdle I face is how > complex the setup can be especially > for the uninitiated. > *N.B. I work in a research environment where Fortran is (and has been for > decades) the language of choice and > Python is still somewhat novel.* > > It looks like the only way I can > promote widespread adoption of > buildbot across the many projects > within my community is to provide a > easy-to-use hosting service for buildbot.
0
9,182,451
02/07/2012 19:20:19
1,188,930
02/04/2012 05:33:51
58
0
What's the difference between Prolog rules and queries?
I'm new to logical programming and find it difficult to understand the difference between rules and queries, I feel they are basically the same. Any help to clarify this would be greatly appreciated.
query
prolog
rules
null
null
null
open
What's the difference between Prolog rules and queries? === I'm new to logical programming and find it difficult to understand the difference between rules and queries, I feel they are basically the same. Any help to clarify this would be greatly appreciated.
0
5,526,024
04/02/2011 21:31:03
689,139
04/02/2011 18:04:42
1
0
[java, socket] scan all ports from jtextarea
how do scan all ports from jtextarea? whether the port is open or closed? please help me... thanks very much
java
sockets
null
null
null
null
open
[java, socket] scan all ports from jtextarea === how do scan all ports from jtextarea? whether the port is open or closed? please help me... thanks very much
0
795,350
04/27/2009 21:25:25
84,098
03/28/2009 20:33:03
15
0
Google Wildcard Operator (*)
I am using the google ajax rest api and I'd like to get local results by prefix. For example: I type in "sta" and I get "starbucks". I wonder if there is a documented or undocumented wildcard operator that that allows you to find results that *start* with a string. I know that Google does have a wildcard operator but it works on a word-by-word basis. Like this: starbucks * => starbucks coffee Here is a list of Google Search Operators none of which offer the starts-with functionality: http://www.google.com/support/websearch/bin/answer.py?hl=en&answer=13... Thank you.
google
search
null
null
null
null
open
Google Wildcard Operator (*) === I am using the google ajax rest api and I'd like to get local results by prefix. For example: I type in "sta" and I get "starbucks". I wonder if there is a documented or undocumented wildcard operator that that allows you to find results that *start* with a string. I know that Google does have a wildcard operator but it works on a word-by-word basis. Like this: starbucks * => starbucks coffee Here is a list of Google Search Operators none of which offer the starts-with functionality: http://www.google.com/support/websearch/bin/answer.py?hl=en&answer=13... Thank you.
0
2,310,905
02/22/2010 12:49:07
169,492
09/07/2009 04:31:20
186
17
C#: using block: object re-initialization
Re-initialization within "using" block is a bad idea, to be avoided at all times. Still i am going to ask this: Why does "using" call dispose on the original value and not on the last reference or re-initialization (which happens if try finally block is used) MyClass b = new MyClass();// implements Idisposable MyClass c = new MyClass(); MyClass a ; using (a = new MyClass()) { a = b; a = c; } In the above code dispose will be called on original reference and not the newer referenced. This can be easily verified by printing something on console in the dispose method. However with try{} finally code the last reference dispose method is called. try { a = new MyClass(); a = b; a = c; } finally { a.Dispose(); } [MSDN][1] : The using statement ensures that Dispose is called even if an exception occurs while you are calling methods on the object. using (Font font1 = new Font("Arial", 10.0f)) { byte charset = font1.GdiCharSet; } Basically "using" translates to: { Font font1 = new Font("Arial", 10.0f); try { byte charset = font1.GdiCharSet; } finally { if (font1 != null) ((IDisposable)font1).Dispose(); } } [1]: http://msdn.microsoft.com/en-us/library/yh598w02.aspx
c#
using
null
null
null
null
open
C#: using block: object re-initialization === Re-initialization within "using" block is a bad idea, to be avoided at all times. Still i am going to ask this: Why does "using" call dispose on the original value and not on the last reference or re-initialization (which happens if try finally block is used) MyClass b = new MyClass();// implements Idisposable MyClass c = new MyClass(); MyClass a ; using (a = new MyClass()) { a = b; a = c; } In the above code dispose will be called on original reference and not the newer referenced. This can be easily verified by printing something on console in the dispose method. However with try{} finally code the last reference dispose method is called. try { a = new MyClass(); a = b; a = c; } finally { a.Dispose(); } [MSDN][1] : The using statement ensures that Dispose is called even if an exception occurs while you are calling methods on the object. using (Font font1 = new Font("Arial", 10.0f)) { byte charset = font1.GdiCharSet; } Basically "using" translates to: { Font font1 = new Font("Arial", 10.0f); try { byte charset = font1.GdiCharSet; } finally { if (font1 != null) ((IDisposable)font1).Dispose(); } } [1]: http://msdn.microsoft.com/en-us/library/yh598w02.aspx
0
9,327,619
02/17/2012 11:42:22
1,133,066
01/05/2012 20:51:32
1
0
allow upload of .mobi and .epub
I am trying to upload (and then later allow people to download) ebooks from my website. I have setup a custom post type, with custom meta boxes to hold the file information. Wordpress allows me to upload a .doc file and a .pdf file - however it will not let me upload .mobi or .epub files (which are the two main formats for ebooks). Please can someone advise me on how I can allow uploading of these file types? I will be doing the uploading myself, as for the downloading, I suspect this will become a problem also... I need to have files automatically downloaded to a machine (rather than visited in a browswer)
upload
download
epub
null
null
null
open
allow upload of .mobi and .epub === I am trying to upload (and then later allow people to download) ebooks from my website. I have setup a custom post type, with custom meta boxes to hold the file information. Wordpress allows me to upload a .doc file and a .pdf file - however it will not let me upload .mobi or .epub files (which are the two main formats for ebooks). Please can someone advise me on how I can allow uploading of these file types? I will be doing the uploading myself, as for the downloading, I suspect this will become a problem also... I need to have files automatically downloaded to a machine (rather than visited in a browswer)
0
3,487,188
08/15/2010 11:36:17
417,818
08/11/2010 23:08:02
31
0
Pyramid program
One person is standing above the pyramid having 100 steps.He can take 1 or 2 steps at a time to come down.So there are how many possible ways he can come down? I want to solve this problemin c programming language Please Help to solve this problem
c
programming-languages
null
null
null
08/15/2010 15:31:13
not a real question
Pyramid program === One person is standing above the pyramid having 100 steps.He can take 1 or 2 steps at a time to come down.So there are how many possible ways he can come down? I want to solve this problemin c programming language Please Help to solve this problem
1
8,300,361
11/28/2011 18:16:43
608,832
02/08/2011 21:24:49
3
0
Is there a support community around Stanford's "CS 193P iPhone Application Development" anywhere on the web?
Searching Google brought me here: http://stackoverflow.com/questions/1155220/are-the-solutions-to-stanfords-online-iphone-development-course-anywhere-on-the Searching "193p" on Stackoverflow.com did spit out a bunch of results, but they're all outdated and from 2010 or even 2009. I'm working through the class materials and they are absolutely excellent. I've been trying to teach myself iOS programming for about two years now and have tried a bunch of different books... and got nowhere. Since I started this course, watching the lectures, doing the assignments, I've written a ton of code and am feeling a real sense of progress and excitement as I march forward. This beats any book I've ever tried, simply because it's an actual university course. I got through Assignment 1 without much trouble and am happy with my solutions. Since I'm not a Stanford student, however, I have no way of knowing how good or even how correct my solutions really are. Assignment 2 is quite a step up in difficulty, which is welcome as I like a challenge, but I'm already a bit lost on where to even begin. Is there a website anywhere that is dedicated to non-Stanford students working on this course? A forum perhaps, a collection of working solutions, a platform to discuss the assignments and give and get help? As I said... googling only gave me old stuff that pertains to versions of the course from past years. Thanks a lot in advance!
iphone
ipad
ios5
stanford
cs193p
11/28/2011 22:15:35
off topic
Is there a support community around Stanford's "CS 193P iPhone Application Development" anywhere on the web? === Searching Google brought me here: http://stackoverflow.com/questions/1155220/are-the-solutions-to-stanfords-online-iphone-development-course-anywhere-on-the Searching "193p" on Stackoverflow.com did spit out a bunch of results, but they're all outdated and from 2010 or even 2009. I'm working through the class materials and they are absolutely excellent. I've been trying to teach myself iOS programming for about two years now and have tried a bunch of different books... and got nowhere. Since I started this course, watching the lectures, doing the assignments, I've written a ton of code and am feeling a real sense of progress and excitement as I march forward. This beats any book I've ever tried, simply because it's an actual university course. I got through Assignment 1 without much trouble and am happy with my solutions. Since I'm not a Stanford student, however, I have no way of knowing how good or even how correct my solutions really are. Assignment 2 is quite a step up in difficulty, which is welcome as I like a challenge, but I'm already a bit lost on where to even begin. Is there a website anywhere that is dedicated to non-Stanford students working on this course? A forum perhaps, a collection of working solutions, a platform to discuss the assignments and give and get help? As I said... googling only gave me old stuff that pertains to versions of the course from past years. Thanks a lot in advance!
2
6,771,179
07/21/2011 04:14:11
855,164
07/21/2011 04:14:11
1
0
Wordpress Home Page Not Centered
http://stackoverflow.com/questions/2540540/why-is-my-page-0-not-centered-in-my-webpage is the closest I've found yet to the type of problem I'm having. The home page of my site is not centered. When you click on any secondary page it will center. I have Googled at least 100 times for every article on centering a web page with CSS using several search terms. I have even replaced style.css with a freshly downloaded copy of the theme style.css file with no change. I fixed one custom template page that was doing the same thing by adding: <?php get_template_part( 'loop', 'page' ); ?> I tried doing that with the home page but it still did not fix it. The home page will still not center. The theme is supposed to be HTML5, I ran it through a validator and it gives errors for the rel statements, but that should eventually be fixed when they get the validator updated. No relevant CSS seems to be a problem to the validator. When I do clear: left in #primary of the Layout section, it fixes the problem, but the right sidebar widget goes down the page. I also fixed the duplicate #wrapper entry that comes as a default with the Twenty Ten theme. I don't recall having the problem before the Wordpress 3.2.1 update, but then again I may not have noticed it.
wordpress
page
home
null
null
07/21/2011 10:50:13
too localized
Wordpress Home Page Not Centered === http://stackoverflow.com/questions/2540540/why-is-my-page-0-not-centered-in-my-webpage is the closest I've found yet to the type of problem I'm having. The home page of my site is not centered. When you click on any secondary page it will center. I have Googled at least 100 times for every article on centering a web page with CSS using several search terms. I have even replaced style.css with a freshly downloaded copy of the theme style.css file with no change. I fixed one custom template page that was doing the same thing by adding: <?php get_template_part( 'loop', 'page' ); ?> I tried doing that with the home page but it still did not fix it. The home page will still not center. The theme is supposed to be HTML5, I ran it through a validator and it gives errors for the rel statements, but that should eventually be fixed when they get the validator updated. No relevant CSS seems to be a problem to the validator. When I do clear: left in #primary of the Layout section, it fixes the problem, but the right sidebar widget goes down the page. I also fixed the duplicate #wrapper entry that comes as a default with the Twenty Ten theme. I don't recall having the problem before the Wordpress 3.2.1 update, but then again I may not have noticed it.
3
8,118,515
11/14/2011 07:29:18
1,045,126
11/14/2011 07:21:17
1
0
Properties of HTML
Can somebody explain me the following: 1- wrapper in division 2- float property 3- how to add round corner in DIV Regards Muhammad Ali Cutlery
html
stylesheet
css-float
null
null
11/14/2011 22:06:41
not constructive
Properties of HTML === Can somebody explain me the following: 1- wrapper in division 2- float property 3- how to add round corner in DIV Regards Muhammad Ali Cutlery
4
5,664,638
04/14/2011 14:18:52
592,377
01/27/2011 14:53:23
21
0
SmallTalk Challenge
How to boot Windows XP from SmallTalk Virtual Machine?
windows-xp
smalltalk
difficult
null
null
04/15/2011 20:26:44
not a real question
SmallTalk Challenge === How to boot Windows XP from SmallTalk Virtual Machine?
1
8,280,668
11/26/2011 18:40:06
630,908
02/23/2011 19:09:04
644
3
Memory address space of a process
I know that Windows allows for any process about 2 Gigabyte memory address space as a maximum. 2 Gigabytes = 2147483648 bytes. I tried to allocate heap memory much more than 2147483648 bytes and I saw no error or warning, this the code: # include<iostream> int main(){ void *x=malloc(2147489999); free(x); system("pause"); return 0; } what is the reason?
c++
windows
memory-management
memory-allocation
malloc
null
open
Memory address space of a process === I know that Windows allows for any process about 2 Gigabyte memory address space as a maximum. 2 Gigabytes = 2147483648 bytes. I tried to allocate heap memory much more than 2147483648 bytes and I saw no error or warning, this the code: # include<iostream> int main(){ void *x=malloc(2147489999); free(x); system("pause"); return 0; } what is the reason?
0
11,478,558
07/13/2012 21:20:59
214,373
11/19/2009 07:03:16
470
19
FETCH_HEAD not updating after "git fetch"
I have a local repository that pulls from a remote one. Running `git pull` as well as `git fetch; git merge FETCH_HEAD` used to work perfectly and did the same thing as expected. Presently, and unexpectedly, running `git fetch` stopped updating the FETCH_HEAD reference. FETCH_HEAD is now permanently stuck to an old commit and running `git fetch` downloads all changes to remote tracked branches, but FETCH_HEAD remains unchanged. This keeps happening in any branch, regardless if if there are updates pulled or not with `git fetch`. Curiously running `git pull` works perfectly and as expected. However running `git fetch; git merge FETCH_HEAD` will do something different since FETCH_HEAD points to an incorrect commit. Is there any setting or issue that could be messing with git fetch behavior?
git
fetch
null
null
null
null
open
FETCH_HEAD not updating after "git fetch" === I have a local repository that pulls from a remote one. Running `git pull` as well as `git fetch; git merge FETCH_HEAD` used to work perfectly and did the same thing as expected. Presently, and unexpectedly, running `git fetch` stopped updating the FETCH_HEAD reference. FETCH_HEAD is now permanently stuck to an old commit and running `git fetch` downloads all changes to remote tracked branches, but FETCH_HEAD remains unchanged. This keeps happening in any branch, regardless if if there are updates pulled or not with `git fetch`. Curiously running `git pull` works perfectly and as expected. However running `git fetch; git merge FETCH_HEAD` will do something different since FETCH_HEAD points to an incorrect commit. Is there any setting or issue that could be messing with git fetch behavior?
0
5,663,912
04/14/2011 13:21:21
379,693
06/30/2010 05:27:59
3,430
141
Android - popover controller same as ipad
Here is a popover controller of the ipad. ![enter image description here][1] [1]: http://i.stack.imgur.com/0U6zV.png **Any idea on how do we create the same kind of thing in Android? Actually i want to display html file or load webview with URL.**
android
popover
android-popover
null
null
10/21/2011 17:34:41
not a real question
Android - popover controller same as ipad === Here is a popover controller of the ipad. ![enter image description here][1] [1]: http://i.stack.imgur.com/0U6zV.png **Any idea on how do we create the same kind of thing in Android? Actually i want to display html file or load webview with URL.**
1
408,139
01/02/2009 22:04:27
2,077
08/20/2008 07:26:21
1,044
18
How do I make a Flex Chart refresh whenever data is added to its dataProvider?
Now I must be missing something here, as this seems a very basic issue that would be addressed in any "Getting started with Flex charting" tutorial. However, all that I could find was hints that the chart should update automatically whenever the dataProvider changes. Mind you, hints. This is my markup: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="econemon Sensor Simulator"> <!-- ... --> <mx:Script source="SimulatorFunctions.as" /> <mx:HDividedBox left="0" top="0" bottom="0" right="0"> <!-- ... --> <mx:VDividedBox width="75%" height="100%"> <mx:PlotChart width="100%" height="33%" dataProvider="{xmlDataTest}"> <mx:horizontalAxis> <mx:DateTimeAxis dataUnits="seconds" displayLocalTime="true" parseFunction="dtFromUnixtime"/> </mx:horizontalAxis> <mx:series> <mx:LineSeries xField="dt" yField="fltValue" displayName="Testkurve" /> </mx:series> </mx:PlotChart> <mx:Panel width="100%" height="66%"> <mx:Button label="Start" click="vDataStart()" /> <mx:Button label="Stop" click="vDataStop()" /> </mx:Panel> </mx:VDividedBox> </mx:HDividedBox> </mx:WindowedApplication> And this is part of my ActionScript: [Bindable] public var xmlDataTest:Array = [ { dt: "1230908694", fltValue: "50.4" }, // ... { dt: "1230909594", fltValue: "35.4" } ] public var dflt:Number = 10.0; public var timData:Timer = new Timer(3000); // ... public function vDataStart():void { if (!timData.running) { timData.addEventListener(TimerEvent.TIMER, vAppendDatum); timData.start(); } } public function vDataStop():void { if (timData.running) { timData.stop(); } } public function vAppendDatum(evt:Event):void { var dtNew:String; var fltNew:String; var fltT: Number; dtNew = String(Number(xmlDataTest[xmlDataTest.length - 1].dt) + 100); fltT = Number(xmlDataTest[xmlDataTest.length - 1].fltValue); if (fltT < 10.0 || fltT > 70) { dflt *= -1; } fltNew = String(fltT + dflt); xmlDataTest.push({ dt: dtNew, fltValue: fltNew }); //trace("Datenpunkte: " + xmlDataTest.length); } On clicking the "Start" button, the data array is extended every 3 seconds, but the chart on the screen remains the same.
air
flex
charts
null
null
null
open
How do I make a Flex Chart refresh whenever data is added to its dataProvider? === Now I must be missing something here, as this seems a very basic issue that would be addressed in any "Getting started with Flex charting" tutorial. However, all that I could find was hints that the chart should update automatically whenever the dataProvider changes. Mind you, hints. This is my markup: <?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" title="econemon Sensor Simulator"> <!-- ... --> <mx:Script source="SimulatorFunctions.as" /> <mx:HDividedBox left="0" top="0" bottom="0" right="0"> <!-- ... --> <mx:VDividedBox width="75%" height="100%"> <mx:PlotChart width="100%" height="33%" dataProvider="{xmlDataTest}"> <mx:horizontalAxis> <mx:DateTimeAxis dataUnits="seconds" displayLocalTime="true" parseFunction="dtFromUnixtime"/> </mx:horizontalAxis> <mx:series> <mx:LineSeries xField="dt" yField="fltValue" displayName="Testkurve" /> </mx:series> </mx:PlotChart> <mx:Panel width="100%" height="66%"> <mx:Button label="Start" click="vDataStart()" /> <mx:Button label="Stop" click="vDataStop()" /> </mx:Panel> </mx:VDividedBox> </mx:HDividedBox> </mx:WindowedApplication> And this is part of my ActionScript: [Bindable] public var xmlDataTest:Array = [ { dt: "1230908694", fltValue: "50.4" }, // ... { dt: "1230909594", fltValue: "35.4" } ] public var dflt:Number = 10.0; public var timData:Timer = new Timer(3000); // ... public function vDataStart():void { if (!timData.running) { timData.addEventListener(TimerEvent.TIMER, vAppendDatum); timData.start(); } } public function vDataStop():void { if (timData.running) { timData.stop(); } } public function vAppendDatum(evt:Event):void { var dtNew:String; var fltNew:String; var fltT: Number; dtNew = String(Number(xmlDataTest[xmlDataTest.length - 1].dt) + 100); fltT = Number(xmlDataTest[xmlDataTest.length - 1].fltValue); if (fltT < 10.0 || fltT > 70) { dflt *= -1; } fltNew = String(fltT + dflt); xmlDataTest.push({ dt: dtNew, fltValue: fltNew }); //trace("Datenpunkte: " + xmlDataTest.length); } On clicking the "Start" button, the data array is extended every 3 seconds, but the chart on the screen remains the same.
0
2,197,098
02/04/2010 03:15:40
31,671
10/27/2008 01:07:58
7,842
455
How can I tell if a request is made with AJAX in Kohana 3?
I've tried these request::is_ajax() Request::instance()->is_ajax To no avail. I've noticed in the `request` class there is a public property `$is_ajax` but I can't seem to be able to access the property. What am I doing wrong?
kohana
php
ajax
xmlhttprequest
null
null
open
How can I tell if a request is made with AJAX in Kohana 3? === I've tried these request::is_ajax() Request::instance()->is_ajax To no avail. I've noticed in the `request` class there is a public property `$is_ajax` but I can't seem to be able to access the property. What am I doing wrong?
0
11,588,182
07/20/2012 23:30:32
1,316,524
04/06/2012 00:07:51
456
3
PowerShell not recognizing basic commands? the term 'get' is not recognized as a name of a cmdlet (error)
I am trying to learn how to write PowerShell scripts, I tried just typing a basic get command such as: `get help get` and I am getting an error saying "the term 'get' is not recognized as a name of a cmdlet. Pretty much every command I tried typing in gives me a similar error, I was wondering if someone can advise how to fix this problem?
powershell
null
null
null
null
null
open
PowerShell not recognizing basic commands? the term 'get' is not recognized as a name of a cmdlet (error) === I am trying to learn how to write PowerShell scripts, I tried just typing a basic get command such as: `get help get` and I am getting an error saying "the term 'get' is not recognized as a name of a cmdlet. Pretty much every command I tried typing in gives me a similar error, I was wondering if someone can advise how to fix this problem?
0
11,618,822
07/23/2012 19:04:44
1,465,579
06/19/2012 06:44:00
53
5
Using Javascript,if div exist on page,code add new class in div
i need java script code on master page, which try to find if div esist on page then they add new class with div class n also add id in div for example if pages have div: <div id="Top" class="toplink">abc..</div> then javascript code make it exactly like this: <div id="Top" class="toplink adin" id-adi="114">abc..</div> code inside the div should remain the same.
c#
javascript
jquery
html
null
07/23/2012 20:52:40
not a real question
Using Javascript,if div exist on page,code add new class in div === i need java script code on master page, which try to find if div esist on page then they add new class with div class n also add id in div for example if pages have div: <div id="Top" class="toplink">abc..</div> then javascript code make it exactly like this: <div id="Top" class="toplink adin" id-adi="114">abc..</div> code inside the div should remain the same.
1
7,142,801
08/22/2011 03:07:16
881,734
08/06/2011 08:26:52
1
0
Get Weather forecast temperature by search android
I use google api service,for get weather forecast How can i implement for search city name then can show temperature of that city. Thank you in advance
java
android
google-weather-api
null
null
08/22/2011 03:41:13
not a real question
Get Weather forecast temperature by search android === I use google api service,for get weather forecast How can i implement for search city name then can show temperature of that city. Thank you in advance
1
8,231,702
11/22/2011 18:19:25
712,075
04/17/2011 11:35:08
50
1
Java code doesnt work propperly
public boolean CheckCoords(int x, int z) { for (GUISpeler p : speler) { for(GUICoordinate c : p.getCoords()) { if(c.getX() == x && c.getZ() == z){ return false; } else{ return true; } } return false; } for some reason it doesnt always check ? maye you guys see something that i dont see
java
null
null
null
null
11/22/2011 18:46:34
not a real question
Java code doesnt work propperly === public boolean CheckCoords(int x, int z) { for (GUISpeler p : speler) { for(GUICoordinate c : p.getCoords()) { if(c.getX() == x && c.getZ() == z){ return false; } else{ return true; } } return false; } for some reason it doesnt always check ? maye you guys see something that i dont see
1
7,425,955
09/15/2011 04:44:04
945,980
09/15/2011 04:15:05
1
0
Multithread using synchronized method
I want to create two threads in whic one thread makes increment and another thread makes decrement.Synchronized block should used in this. Output put format should look like this 5 classA makes increment 6 classB makes decrement 4 classA makes increment 6 classB makes decrement 4 ................. It goes on like this infinity..How to avoid the java out of memory error in this program ?? help pls import java.io.*; import java.lang.Thread; class classAthread implements Runnable { int count; String a; Thread t; classAthread(String i) { synchronized(this) { a=i; count=Integer.parseInt(a); t=new Thread(this,i); t.start(); } } public void run() { increment(); } public synchronized void increment() { try { if(count!=0) { synchronized(this) { count++; System.out.println("classA makes increment "+count); count--; String p = String.valueOf(count); new classBthread(p); wait(); } } else { System.out.println("Count values cannot be negative"); } wait(); } catch (InterruptedException e) { e.printStackTrace(); } notify(); } } class classBthread implements Runnable { int count; String a; Thread t; classBthread(String i) { a=i; count=Integer.parseInt(a); t=new Thread(this,i); t.start(); } public void run() { decrement(); } public synchronized void decrement() { try { if(count!=0) { synchronized(this) { count--; System.out.println("classB makes decrement "+count); //Thread.sleep(1000); count++; String p = String.valueOf(count); new classAthread(p); wait(); } } else { System.out.println("Count values cannot be negative"); } wait(); } catch (InterruptedException e) { e.printStackTrace(); } notify(); } } public class ThreadPriority extends Thread { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String num = br.readLine(); new classAthread(num); new classBthread(num); } }
java
multithreading
null
null
null
06/22/2012 11:56:39
not a real question
Multithread using synchronized method === I want to create two threads in whic one thread makes increment and another thread makes decrement.Synchronized block should used in this. Output put format should look like this 5 classA makes increment 6 classB makes decrement 4 classA makes increment 6 classB makes decrement 4 ................. It goes on like this infinity..How to avoid the java out of memory error in this program ?? help pls import java.io.*; import java.lang.Thread; class classAthread implements Runnable { int count; String a; Thread t; classAthread(String i) { synchronized(this) { a=i; count=Integer.parseInt(a); t=new Thread(this,i); t.start(); } } public void run() { increment(); } public synchronized void increment() { try { if(count!=0) { synchronized(this) { count++; System.out.println("classA makes increment "+count); count--; String p = String.valueOf(count); new classBthread(p); wait(); } } else { System.out.println("Count values cannot be negative"); } wait(); } catch (InterruptedException e) { e.printStackTrace(); } notify(); } } class classBthread implements Runnable { int count; String a; Thread t; classBthread(String i) { a=i; count=Integer.parseInt(a); t=new Thread(this,i); t.start(); } public void run() { decrement(); } public synchronized void decrement() { try { if(count!=0) { synchronized(this) { count--; System.out.println("classB makes decrement "+count); //Thread.sleep(1000); count++; String p = String.valueOf(count); new classAthread(p); wait(); } } else { System.out.println("Count values cannot be negative"); } wait(); } catch (InterruptedException e) { e.printStackTrace(); } notify(); } } public class ThreadPriority extends Thread { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String num = br.readLine(); new classAthread(num); new classBthread(num); } }
1
8,022,914
11/05/2011 20:04:04
471,607
10/10/2010 16:20:50
1,465
120
could not find kernel image casper vmlinuz
trying to install `ubuntu-11.10-server-i386` on my desktop for which i downloaded `Universal-USB-Installer-1.8.6.8` and followed the step as described on Ubuntu website. I am using a pen drive to install it on my machine.When i started system it showed me following options 1. Run Ubuntu from pen drive 2. Install Ubuntu I when tried to installed it on my desktop nothing happened and the installation option menu keep coming on some more checking i found out that it showing following error could not find kernel image casper vmlinuz after doing goggling i came across the following post could not find kernel image][1] [1]: http://www.pendrivelinux.com/error-could-not-find-kernel-image-linux/ but cross verification showed that everything is fine in files installed on pen drive.i even checked the Md5 check-sum of downloaded iso image and that is correct. Can any one help me to find what exactly is going wrong in the process
ubuntu
ubuntu-11.04
null
null
null
11/05/2011 20:15:22
off topic
could not find kernel image casper vmlinuz === trying to install `ubuntu-11.10-server-i386` on my desktop for which i downloaded `Universal-USB-Installer-1.8.6.8` and followed the step as described on Ubuntu website. I am using a pen drive to install it on my machine.When i started system it showed me following options 1. Run Ubuntu from pen drive 2. Install Ubuntu I when tried to installed it on my desktop nothing happened and the installation option menu keep coming on some more checking i found out that it showing following error could not find kernel image casper vmlinuz after doing goggling i came across the following post could not find kernel image][1] [1]: http://www.pendrivelinux.com/error-could-not-find-kernel-image-linux/ but cross verification showed that everything is fine in files installed on pen drive.i even checked the Md5 check-sum of downloaded iso image and that is correct. Can any one help me to find what exactly is going wrong in the process
2
6,932,760
08/03/2011 20:20:17
570,135
01/10/2011 16:59:47
26
1
Excessive number of attempts to get a connection from pooled datasource
Since some time ago I have been paying attention to some monitoring data of my application. One fact took my attention: in every request my application process, there is a number of attempts to get a pooled connection from datasource. Sometimes just a few attempts are made, sometime more. In the worst case I found there were made almost 500 attempts to get a polled connection. Well, I'm a bit confused about this behavior. Such behavior can be considered normal until which threshold? My application uses the default J2EE stack (JSF + EJB + JPA).
datasource
connection-pooling
null
null
null
null
open
Excessive number of attempts to get a connection from pooled datasource === Since some time ago I have been paying attention to some monitoring data of my application. One fact took my attention: in every request my application process, there is a number of attempts to get a pooled connection from datasource. Sometimes just a few attempts are made, sometime more. In the worst case I found there were made almost 500 attempts to get a polled connection. Well, I'm a bit confused about this behavior. Such behavior can be considered normal until which threshold? My application uses the default J2EE stack (JSF + EJB + JPA).
0
2,285,562
02/18/2010 00:46:33
28,760
10/16/2008 22:36:00
283
5
What are the advantages/disadvantages of the Tomact request handling instance?
What are the advantages/disadvantages with regards to the fact that Tomcat only creates one instance of a Servlet class to handle all requests for a JSP/servlet?
jsp
tomcat
servlets
null
null
null
open
What are the advantages/disadvantages of the Tomact request handling instance? === What are the advantages/disadvantages with regards to the fact that Tomcat only creates one instance of a Servlet class to handle all requests for a JSP/servlet?
0
3,992,341
10/21/2010 21:59:33
325,418
05/09/2009 15:50:29
6,980
184
Is www.facebook.com/share info for doing a Share Button compatible with old and new JS SDK ?
I heard of yet another way to do the share button, which is on http://www.facebook.com/share/ It include this Javascript file: <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> Is it compatible with the old and new Facebook Javascript SDK too?
facebook
facebook-graph-api
null
null
null
null
open
Is www.facebook.com/share info for doing a Share Button compatible with old and new JS SDK ? === I heard of yet another way to do the share button, which is on http://www.facebook.com/share/ It include this Javascript file: <script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script> Is it compatible with the old and new Facebook Javascript SDK too?
0
9,737,914
03/16/2012 13:12:39
394,397
07/17/2010 00:19:36
26
4
What are some unusual problems caused by the use of deprecated code?
If my app will not break and will successfully deliver intended results (security/performance concerns non-withstanding) within the time I myself intend to support the application, what other problems can arise with using working, yet deprecated code?
deprecated
null
null
null
null
03/16/2012 13:18:04
off topic
What are some unusual problems caused by the use of deprecated code? === If my app will not break and will successfully deliver intended results (security/performance concerns non-withstanding) within the time I myself intend to support the application, what other problems can arise with using working, yet deprecated code?
2
5,547,742
04/05/2011 05:49:06
692,261
04/05/2011 05:28:21
1
0
What is a good programming language to start with for an amateur?
I am looking for some advice to help me pick a good language to learn programming. I've done considerable research already on this topic, but I feel that I could use some input from the experts. The purpose for my learning a language is to get a head start on my college studies (next fall) for which I am majoring in Engineering. I have read from various sources that Python, Scheme/Lisp, C (and variations), Java, F#, Haskell, and Lua are all good options, but obviously I don't have time to learn all of these. I'm looking for the one that will provide me with the best foundation, to learn other languages and get started in the right direction.
programming-languages
null
null
null
null
04/05/2011 08:59:20
not a real question
What is a good programming language to start with for an amateur? === I am looking for some advice to help me pick a good language to learn programming. I've done considerable research already on this topic, but I feel that I could use some input from the experts. The purpose for my learning a language is to get a head start on my college studies (next fall) for which I am majoring in Engineering. I have read from various sources that Python, Scheme/Lisp, C (and variations), Java, F#, Haskell, and Lua are all good options, but obviously I don't have time to learn all of these. I'm looking for the one that will provide me with the best foundation, to learn other languages and get started in the right direction.
1
8,079,942
11/10/2011 13:06:17
213,113
11/17/2009 17:44:35
1,440
138
Ext JS: Proper technique to add listeners to DOM created via a template?
We use XTemplates - lots of XTemplates. They are great for displaying read-only content. But have you ever added (Ext JS) listeners to DOM created via a template? Would you care to share your preferred technique for creating these listeners?
javascript
templates
javascript-events
extjs
null
null
open
Ext JS: Proper technique to add listeners to DOM created via a template? === We use XTemplates - lots of XTemplates. They are great for displaying read-only content. But have you ever added (Ext JS) listeners to DOM created via a template? Would you care to share your preferred technique for creating these listeners?
0
1,784,117
11/23/2009 16:04:34
202,335
11/04/2009 04:57:55
211
0
What time does Google use in "Specific date range", GMT or PST?
When you click "Show options", you can specify a particular period, but what time zone does Google use?
google
timezone
null
null
null
11/23/2009 18:26:14
off topic
What time does Google use in "Specific date range", GMT or PST? === When you click "Show options", you can specify a particular period, but what time zone does Google use?
2
9,731,151
03/16/2012 02:47:16
1,263,202
03/12/2012 03:03:38
7
0
Add button function
I just wanna ask you guys here, how to automatically add textbox when user click on add button. Like in page, There are two textboxes; 1 for groceries type, and another 1 is for the price. When user want to add another tow textboxes, he/she will click on the add button. Can somebody tell me how. I would be appreciate it. Looking forward to hear from u guys soon. Thanks :)
c#
asp.net
textbox
null
null
03/16/2012 03:02:48
not a real question
Add button function === I just wanna ask you guys here, how to automatically add textbox when user click on add button. Like in page, There are two textboxes; 1 for groceries type, and another 1 is for the price. When user want to add another tow textboxes, he/she will click on the add button. Can somebody tell me how. I would be appreciate it. Looking forward to hear from u guys soon. Thanks :)
1
9,143,272
02/04/2012 18:25:23
1,013,981
10/26/2011 05:28:16
6
0
TOAD FOR ORACLE ERROR
I am getting this error when I tried to connect to ORACLE 10g using TOAD **Can't initialize OCI. Error -1** kindly help me to resolve this
oracle
toad
oci
null
null
02/04/2012 22:43:49
not a real question
TOAD FOR ORACLE ERROR === I am getting this error when I tried to connect to ORACLE 10g using TOAD **Can't initialize OCI. Error -1** kindly help me to resolve this
1
3,272,509
07/17/2010 17:22:12
329,424
04/12/2010 14:40:29
37
0
Help Regular Expression
please see code : $result = "<b>Associated Names</b>&nbsp;&nbsp;[<a href='http://www.examples.com/authors.html?act=change&id=6141&item=associated'><u>Edit</u></a>]</td> </tr> <tr> <td class='text' align='left'>G&#12539;R<br />G-R<br /> </td>" preg_match_all("/<b>Associated Names.{10,100}<td class='text' align='left'>((.*<br \/>)*).*<\/td>/sU", $result, $assoc); var_dump($assoc); ----------------------------------------------------------- RESULT array 0 => array 0 => string '<b>Associated Names</b></td> </tr> <tr> <td class='text' align='left'>G&#12539;R<br />G-R<br /> </td>' (length=135) 1 => array 0 => string '' (length=0) 2 => array 0 => string '' (length=0) I want it return array( 1 => array 0 => string 'G&#12539;R', 2 => array 0 => string> 'G-R' ) it is a matter of parentheses ((.*<br \/>)*) i want fix it, please help me
php
regex
null
null
null
06/20/2012 05:09:53
not a real question
Help Regular Expression === please see code : $result = "<b>Associated Names</b>&nbsp;&nbsp;[<a href='http://www.examples.com/authors.html?act=change&id=6141&item=associated'><u>Edit</u></a>]</td> </tr> <tr> <td class='text' align='left'>G&#12539;R<br />G-R<br /> </td>" preg_match_all("/<b>Associated Names.{10,100}<td class='text' align='left'>((.*<br \/>)*).*<\/td>/sU", $result, $assoc); var_dump($assoc); ----------------------------------------------------------- RESULT array 0 => array 0 => string '<b>Associated Names</b></td> </tr> <tr> <td class='text' align='left'>G&#12539;R<br />G-R<br /> </td>' (length=135) 1 => array 0 => string '' (length=0) 2 => array 0 => string '' (length=0) I want it return array( 1 => array 0 => string 'G&#12539;R', 2 => array 0 => string> 'G-R' ) it is a matter of parentheses ((.*<br \/>)*) i want fix it, please help me
1
7,236,911
08/29/2011 22:51:08
918,671
08/29/2011 22:32:06
1
0
Javascript, how do I get both the start and end positions of a few refex matches
I just wish to find the start and end positions of the substrings I am searching for. Any Ideas as to how this can be done?
javascript
regex
substrings
null
null
null
open
Javascript, how do I get both the start and end positions of a few refex matches === I just wish to find the start and end positions of the substrings I am searching for. Any Ideas as to how this can be done?
0
8,645,406
12/27/2011 13:55:35
441,786
09/07/2010 19:52:15
8
0
Expert level Java learning Tutorial
I have done a beginner course in Core Java a couple of years ago (studied from Java 2-Herbert Schildt). I wish to **relearn Java** (all concepts like classes, multithreading, AWT, JDBC, File handling, Database, applet) and make my expertise to **intermediate-expert level**. I have a timespan of 2 months. Which are the best books/sites or tutorials for learning Java at intermediate or expert level? P.S: I know C#,C++ and other languages
java
null
null
null
null
12/27/2011 14:06:56
not constructive
Expert level Java learning Tutorial === I have done a beginner course in Core Java a couple of years ago (studied from Java 2-Herbert Schildt). I wish to **relearn Java** (all concepts like classes, multithreading, AWT, JDBC, File handling, Database, applet) and make my expertise to **intermediate-expert level**. I have a timespan of 2 months. Which are the best books/sites or tutorials for learning Java at intermediate or expert level? P.S: I know C#,C++ and other languages
4
8,739,885
01/05/2012 09:02:29
499,863
11/07/2010 13:53:53
11
0
Excel error when i put = in one cell
I want to make a list with some documentacion and in one cell i need to have the next sintaxis = Same like but automaticlly chane it to #¿NAME? how i can tell to excel that i just want to have mi cell with = Same like
excel
null
null
null
null
05/25/2012 11:23:06
off topic
Excel error when i put = in one cell === I want to make a list with some documentacion and in one cell i need to have the next sintaxis = Same like but automaticlly chane it to #¿NAME? how i can tell to excel that i just want to have mi cell with = Same like
2
11,592,976
07/21/2012 14:25:36
1,533,368
07/18/2012 01:45:09
1
0
Non Rectangular Images
I am not sure if this question suits stackoverflow or not. But here it goes, I want to have an image strictly of the shape and size of the main object in the image, there should not be any white or black background, or the background should be transparent so that the real background should be visible. How can I do it? is it possible using photoshop? I want to use these images to create a slideshow in flash.
image
image-processing
null
null
null
07/22/2012 21:54:24
not a real question
Non Rectangular Images === I am not sure if this question suits stackoverflow or not. But here it goes, I want to have an image strictly of the shape and size of the main object in the image, there should not be any white or black background, or the background should be transparent so that the real background should be visible. How can I do it? is it possible using photoshop? I want to use these images to create a slideshow in flash.
1
307,499
11/21/2008 01:10:39
10,470
09/15/2008 23:21:33
240
8
A good ocaml parser?
I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything. I would use haskell, but making llvm bindings for haskell is proving more tiresome than I originally thought. Cheers, Duane
ocaml
parsing
parsec
null
null
07/19/2012 15:09:57
not constructive
A good ocaml parser? === I'm looking for a good ocaml parsing library that isn't a derivative of flex/bison. Ideally, I'd like a monadic combinator library along the lines of parsec, but I can't find anything. I would use haskell, but making llvm bindings for haskell is proving more tiresome than I originally thought. Cheers, Duane
4
11,418,644
07/10/2012 17:25:47
980,799
10/05/2011 16:42:13
15
0
Suppress caching in IIS
I'm looking to suppress caching for all files that end with .appcache in IIS. If I was using Apache, I would drop the file into a directory and add: ExpiresActive On ExpiresDefault "access" How do I control caching headers in IIS? Regards, Chris
iis
iis7
iis6
webserver
null
07/11/2012 00:52:09
off topic
Suppress caching in IIS === I'm looking to suppress caching for all files that end with .appcache in IIS. If I was using Apache, I would drop the file into a directory and add: ExpiresActive On ExpiresDefault "access" How do I control caching headers in IIS? Regards, Chris
2
5,190,398
03/04/2011 06:21:58
644,223
03/04/2011 06:21:58
1
0
problem into heave data loading??
i make a program in asp.net to take excel data into Sql data adaptor but data is too long and system got crashed???
asp.net
sql
xml
excel
null
03/04/2011 08:36:32
not a real question
problem into heave data loading?? === i make a program in asp.net to take excel data into Sql data adaptor but data is too long and system got crashed???
1
10,382,755
04/30/2012 11:14:28
1,365,662
04/30/2012 11:09:54
1
0
ASPX - How to read Lines from a Txt file then store text within a string
Im trying to read a text file using aspx then store whatever line it read in a string ive looked online and cant seem to find a straightforward tutorial can some one help me thank you.
javascript
asp.net
html
null
null
null
open
ASPX - How to read Lines from a Txt file then store text within a string === Im trying to read a text file using aspx then store whatever line it read in a string ive looked online and cant seem to find a straightforward tutorial can some one help me thank you.
0
7,039,794
08/12/2011 12:02:39
627,753
02/22/2011 05:18:01
57
1
android application
i am right now building one application which is used to check some services and some options enabled or not in device in them i don't know these ->check whether Google will remember your search history ->how to check whether the browser remembers form data. ->check whether the browser remembers passwords.
android
application
null
null
null
08/12/2011 12:45:00
not a real question
android application === i am right now building one application which is used to check some services and some options enabled or not in device in them i don't know these ->check whether Google will remember your search history ->how to check whether the browser remembers form data. ->check whether the browser remembers passwords.
1
10,261,836
04/21/2012 18:37:12
258,594
01/25/2010 16:44:36
449
20
flex itemRenderer variables from/to main scope
I'm working on creating a datagrid that has a checkbox column. I have some functions that run within the itemRenderer that creates an array collection containing the item information and weather or not the checkbox is checked or not. Everything seems to be work the way I'd like, but now I just need to access the arraycollection created in the itemRenderer scope in my main application. How can I go about access this? Here's the function that creates the AC within the itemRenderer private function onChange():void { data["isSelected"] = cb.selected; var dp:ArrayCollection = _dataGrid.dataProvider as ArrayCollection; dp.dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)); }
flex
datagrid
scope
actionscript-2
itemrenderer
null
open
flex itemRenderer variables from/to main scope === I'm working on creating a datagrid that has a checkbox column. I have some functions that run within the itemRenderer that creates an array collection containing the item information and weather or not the checkbox is checked or not. Everything seems to be work the way I'd like, but now I just need to access the arraycollection created in the itemRenderer scope in my main application. How can I go about access this? Here's the function that creates the AC within the itemRenderer private function onChange():void { data["isSelected"] = cb.selected; var dp:ArrayCollection = _dataGrid.dataProvider as ArrayCollection; dp.dispatchEvent(new CollectionEvent(CollectionEvent.COLLECTION_CHANGE)); }
0
11,404,439
07/09/2012 23:00:34
1,508,582
07/07/2012 10:39:54
3
0
I have difficulties with my XNA Game Menu
I have created a simple menu in XNA but it doesn't work. I get some error messages but I don't know what to change. **The type or namespace name 'EGameState' could not be found (are you missing a using directive or an assembly reference?)** Could somebody help me, please? I uploaded my project here: http://depositfiles.com/files/lxiffytjr
c#
xna
null
null
null
07/10/2012 02:56:06
too localized
I have difficulties with my XNA Game Menu === I have created a simple menu in XNA but it doesn't work. I get some error messages but I don't know what to change. **The type or namespace name 'EGameState' could not be found (are you missing a using directive or an assembly reference?)** Could somebody help me, please? I uploaded my project here: http://depositfiles.com/files/lxiffytjr
3
10,034,097
04/05/2012 18:39:27
1,292,652
03/26/2012 09:36:37
46
5
Overloading `float()` for a custom Class
## My Class Hi, I was coding my own `Fractions` class (for arbitrarily-high floating-point operation precision). It goes like this (I haven't yet finished it): class Fractions: """My custom Fractions class giving arbitarilly high precision w/ floating-point arithmetic.""" def __init__(self, num = 0, denom = 1): """Fractions(num = 0, denom = 1) -> Fractions object Class implementing rational numbers. In the two-argument form of the constructor, Fraction(8, 6) will produce a rational number equivalent to 4/3. Both arguments must be rational, i.e, ints, floats etc. .The numerator defaults to 0 and the denominator defaults to 1 so that Fraction(3) == 3 and Fraction() == 0. Fractions can also be constructed from: - numeric strings that are valid float constructors (for example, '-2.3' or '1e10') - strings of the form '123/456'""" if '/' in str(num): self.num, self.denom = map(float, num.split('/')) #'x/y' else: self.num, self.denom = float(num), float(denom) #(num, denom) self.normalize() def __repr__(self): print self.num + '/' + self.denom def __invert__(self): self.num, self.denom = self.denom, self.num def normalize(self): num, denom = self.num, self.denom #Converting `num` and `denom` to ints if they're not already if not float(num).is_integer(): decimals = len(str(float(num) - int(num))) - 1 num, denom = num*decimals, denom*decimals if float(denom).is_integer(): decimals = len(str(float(denom) - int(denom))) - 1 num, denom = num*decimals, denom*decimals #Negatives if denom < 0: if num < 0: num, denom = +num, +denom else: num, denom *= -1 #Reducing to the simplest form from MyModules import GCD GCD_ = GCD(num, denom) if GCD_: self.num, self.denom /= GCD_ #Assigning `num` and `denom` self.num, self.denom = num, denom ## The Question Now, I want to implement a method that overloads `float()`, i.e., it is called when an instance of my class is passed to `float()`. How do I do that? At first I thought: def float(self): return self.num/self.denom But that didn't work. Neither did a Google Search or the Python Docs help. Is it even possible to implement it? 10x, this is probably my 1<sup>st</sup> _real_ question! :)
python
floating-point
operator-overloading
null
null
null
open
Overloading `float()` for a custom Class === ## My Class Hi, I was coding my own `Fractions` class (for arbitrarily-high floating-point operation precision). It goes like this (I haven't yet finished it): class Fractions: """My custom Fractions class giving arbitarilly high precision w/ floating-point arithmetic.""" def __init__(self, num = 0, denom = 1): """Fractions(num = 0, denom = 1) -> Fractions object Class implementing rational numbers. In the two-argument form of the constructor, Fraction(8, 6) will produce a rational number equivalent to 4/3. Both arguments must be rational, i.e, ints, floats etc. .The numerator defaults to 0 and the denominator defaults to 1 so that Fraction(3) == 3 and Fraction() == 0. Fractions can also be constructed from: - numeric strings that are valid float constructors (for example, '-2.3' or '1e10') - strings of the form '123/456'""" if '/' in str(num): self.num, self.denom = map(float, num.split('/')) #'x/y' else: self.num, self.denom = float(num), float(denom) #(num, denom) self.normalize() def __repr__(self): print self.num + '/' + self.denom def __invert__(self): self.num, self.denom = self.denom, self.num def normalize(self): num, denom = self.num, self.denom #Converting `num` and `denom` to ints if they're not already if not float(num).is_integer(): decimals = len(str(float(num) - int(num))) - 1 num, denom = num*decimals, denom*decimals if float(denom).is_integer(): decimals = len(str(float(denom) - int(denom))) - 1 num, denom = num*decimals, denom*decimals #Negatives if denom < 0: if num < 0: num, denom = +num, +denom else: num, denom *= -1 #Reducing to the simplest form from MyModules import GCD GCD_ = GCD(num, denom) if GCD_: self.num, self.denom /= GCD_ #Assigning `num` and `denom` self.num, self.denom = num, denom ## The Question Now, I want to implement a method that overloads `float()`, i.e., it is called when an instance of my class is passed to `float()`. How do I do that? At first I thought: def float(self): return self.num/self.denom But that didn't work. Neither did a Google Search or the Python Docs help. Is it even possible to implement it? 10x, this is probably my 1<sup>st</sup> _real_ question! :)
0
8,876,909
01/16/2012 07:32:04
1,056,328
11/20/2011 12:06:17
162
0
jQuery: how to join 2 results of requests to json server?
I wonder if we can do something like var joinedJSON; $.get("server.json?action=type&type=image", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=jpg", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=png", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=tiff", function(json) {joinedJSON +=json ; } while each request will provide us with say such JSON data: [ { "href": "bf051e8675b11c72eec781e855593589a086d2295378b96a8b7269c31b8fa673.user.file", "title": "Привет Мир.jpg", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:11", "is_public": 0, "size": 65516 }, { "href": "abd01be9a0830579d6366e48fc0c48d4c7cc350d80719843ca84c782346626f6.user.file", "title": "", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:19", "is_public": 0, "size": 89782 }, { "href": "0a27fd3b563b2877c3a072648e0f7c2a57539f3aba4ce688c7774eca6b70774e.user.file", "title": "Привет Мир 2.jpg", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:29", "is_public": 1, "size": 58574 } ] Will we get one long array having in mind that some items may repeat (multymap in C++) as result?
javascript
jquery
json
service
request
null
open
jQuery: how to join 2 results of requests to json server? === I wonder if we can do something like var joinedJSON; $.get("server.json?action=type&type=image", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=jpg", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=png", function(json) {joinedJSON +=json ; } $.get("server.json?action=type&type=tiff", function(json) {joinedJSON +=json ; } while each request will provide us with say such JSON data: [ { "href": "bf051e8675b11c72eec781e855593589a086d2295378b96a8b7269c31b8fa673.user.file", "title": "Привет Мир.jpg", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:11", "is_public": 0, "size": 65516 }, { "href": "abd01be9a0830579d6366e48fc0c48d4c7cc350d80719843ca84c782346626f6.user.file", "title": "", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:19", "is_public": 0, "size": 89782 }, { "href": "0a27fd3b563b2877c3a072648e0f7c2a57539f3aba4ce688c7774eca6b70774e.user.file", "title": "Привет Мир 2.jpg", "user_name": "Oleg.Jakushkin@gmail.com", "modified": "2012-01-16 07:24:29", "is_public": 1, "size": 58574 } ] Will we get one long array having in mind that some items may repeat (multymap in C++) as result?
0
3,759,208
09/21/2010 10:04:10
453,763
09/21/2010 10:04:10
1
0
OOP Constructor question C++
Let's say that I have two classes A and B. class A { private: int value; public: A(int v) { value = v; } }; class B { private: A value; public: B() { // Here's my problem } } I guess it's something basic but I don't know how to call A's constructor. Also the compiler demands a default constructor for class A. But if A has a default constructor than wouldn't the default constructor be called whenever I declare a variable of type A. Can I still call a constructor after the default constructor has been called? Or can I declare an instance of a class and then call a constructor later? I think this could be solved using pointers but can that be avoided ? I know that you can do something like this in C#.
c++
oop
constructor
null
null
null
open
OOP Constructor question C++ === Let's say that I have two classes A and B. class A { private: int value; public: A(int v) { value = v; } }; class B { private: A value; public: B() { // Here's my problem } } I guess it's something basic but I don't know how to call A's constructor. Also the compiler demands a default constructor for class A. But if A has a default constructor than wouldn't the default constructor be called whenever I declare a variable of type A. Can I still call a constructor after the default constructor has been called? Or can I declare an instance of a class and then call a constructor later? I think this could be solved using pointers but can that be avoided ? I know that you can do something like this in C#.
0
9,517,892
03/01/2012 14:25:15
1,201,192
02/10/2012 03:42:52
6
1
How to keep if condition to check the browser is IE in extjs?
I have a requirement to check if application is opened using IE then my code should execute or else no..here is sample code.. xtype: 'panel', header: true, if(browser == ie){ height: 160, } height: 150 width: 355, layoutConfig: { align: 'center', padding: 10 }, Thanks, Rajasekhar
extjs
null
null
null
null
null
open
How to keep if condition to check the browser is IE in extjs? === I have a requirement to check if application is opened using IE then my code should execute or else no..here is sample code.. xtype: 'panel', header: true, if(browser == ie){ height: 160, } height: 150 width: 355, layoutConfig: { align: 'center', padding: 10 }, Thanks, Rajasekhar
0
8,712,031
01/03/2012 12:05:05
844,317
07/14/2011 10:19:30
20
0
iPhone : How in set alpha in UIImage on Touches with PIxel?
- I know how set alpha on UIImage but How to set alpha on the pixel in UIImage when touches on that pixel ?
iphone
objective-c
uiimage
pixel
alpha
01/03/2012 18:07:20
not a real question
iPhone : How in set alpha in UIImage on Touches with PIxel? === - I know how set alpha on UIImage but How to set alpha on the pixel in UIImage when touches on that pixel ?
1
10,898,371
06/05/2012 13:37:28
1,101,677
12/16/2011 09:53:21
146
2
Similar type of application like Drop Box
I have seen the app DropBox thats looks good. I want to implement same type of functionality in my app. I want to know how to approach that. Can any one tell me the steps how to approach. Thanks in advance.
iphone
ios
null
null
null
06/06/2012 14:11:09
not constructive
Similar type of application like Drop Box === I have seen the app DropBox thats looks good. I want to implement same type of functionality in my app. I want to know how to approach that. Can any one tell me the steps how to approach. Thanks in advance.
4
10,039,027
04/06/2012 04:09:55
1,316,715
04/06/2012 03:48:20
1
0
can not route packets from one interface to another
i have a system with 2 interfaces eth0, and eth1. eth0 is 192.168.0.250 and connected to gateway 192.168.0.2. eth1 is connected to 192.123.123.10 via a swtich. i am trying to route packets from 192.123.123.10 to gateway 192.168.0.2, which means i need to route 192.123.123.x packets coming into eth1 interface out via eth0 interface. i set ip_forward file to 1. i ran this command: route add -net 192.123.0.0 netmask 255.255.255.0 dev eth0 route add default gw 192.168.0.2 i can ping from 129.123.123.10 to 192.168.0.250, but i can't ping to 192.168.0.2 i think packets are not being forwarded to eth0. my routing table looks something like this: gteway Genmask Flags Ref Iface 192.123.123.0 * 255.255.255.0 U eth1 192.168.0.0 * 255.255.255.0 U eth0 192.123.0.0 * 255.255.255.0 U eth0 default 192.168.0.2 0.0.0.0 UG eth0 can anyone tell me what is missing? thank you in advance.
linux
networking
routing
null
null
04/06/2012 15:51:51
off topic
can not route packets from one interface to another === i have a system with 2 interfaces eth0, and eth1. eth0 is 192.168.0.250 and connected to gateway 192.168.0.2. eth1 is connected to 192.123.123.10 via a swtich. i am trying to route packets from 192.123.123.10 to gateway 192.168.0.2, which means i need to route 192.123.123.x packets coming into eth1 interface out via eth0 interface. i set ip_forward file to 1. i ran this command: route add -net 192.123.0.0 netmask 255.255.255.0 dev eth0 route add default gw 192.168.0.2 i can ping from 129.123.123.10 to 192.168.0.250, but i can't ping to 192.168.0.2 i think packets are not being forwarded to eth0. my routing table looks something like this: gteway Genmask Flags Ref Iface 192.123.123.0 * 255.255.255.0 U eth1 192.168.0.0 * 255.255.255.0 U eth0 192.123.0.0 * 255.255.255.0 U eth0 default 192.168.0.2 0.0.0.0 UG eth0 can anyone tell me what is missing? thank you in advance.
2
9,726,352
03/15/2012 19:00:33
825,547
07/01/2011 21:26:45
102
15
Using php variables across different files
I'm setting variables in one file and using them in another (as shown in the simplified example). index.php: $name = 'Mark'; require('util.php'); print($text); util.php: $text = "Hello " . $name However the IDE I'm using gives a warning since the variables 'seem to be uninitialized'. Usually when IDE's give warnings it's a sign of poor quality code. Is this the case and if yes, what is the better/neater way to do it?
php
include
null
null
null
03/18/2012 01:07:21
not constructive
Using php variables across different files === I'm setting variables in one file and using them in another (as shown in the simplified example). index.php: $name = 'Mark'; require('util.php'); print($text); util.php: $text = "Hello " . $name However the IDE I'm using gives a warning since the variables 'seem to be uninitialized'. Usually when IDE's give warnings it's a sign of poor quality code. Is this the case and if yes, what is the better/neater way to do it?
4
8,766,241
01/07/2012 00:29:21
1,110,749
12/21/2011 22:25:44
5
0
Can C programming language handle 10*100
What is the biggest number that the C programming language data type can handle. If it can handle 10*100 will it be using long double. And what's the maximum number that java programming language can handle and using which data type?
c
null
null
null
null
01/07/2012 04:36:26
not a real question
Can C programming language handle 10*100 === What is the biggest number that the C programming language data type can handle. If it can handle 10*100 will it be using long double. And what's the maximum number that java programming language can handle and using which data type?
1
6,768,188
07/20/2011 20:35:49
618,490
02/15/2011 20:01:19
120
2
Can I reference external .jars when building a .jar file with the command line tool?
Pretty straightforward question. Can it be done without the use of Ants or Maven? (And by that, I mean the command line tool specifically) Please notice that I don't want to create an uberjar, I just want the archived unit to point to the right place.
java
jar
null
null
null
null
open
Can I reference external .jars when building a .jar file with the command line tool? === Pretty straightforward question. Can it be done without the use of Ants or Maven? (And by that, I mean the command line tool specifically) Please notice that I don't want to create an uberjar, I just want the archived unit to point to the right place.
0
11,511,742
07/16/2012 20:05:38
309,852
04/06/2010 08:41:01
1,097
48
Method overloading with Type parameters in .NET
Assume I have a method: void MyMethod(Type type1, Type type2) { // ... } and I want to create an overload, say void MyMethod(Int32, String) What's the best way to do this?
c#
overloading
null
null
null
07/16/2012 20:13:22
not a real question
Method overloading with Type parameters in .NET === Assume I have a method: void MyMethod(Type type1, Type type2) { // ... } and I want to create an overload, say void MyMethod(Int32, String) What's the best way to do this?
1
9,238,259
02/11/2012 06:09:25
637,965
02/28/2011 15:56:22
711
4
practical tutorials for learning yii
My approach to learning a new framework or technology is to read a brief tutorial that goes over how to create a very simple application and then try to build something similar on my own. I've gone through the definitive guide and it's very hard to digest and doesn't suit my style of learning. [These][1] screencasts are excellent but I need more like them! Does anyone know of anything similar those screencasts or some other relatively brief practical tutorials for Yii? [1]: http://www.yiiframework.com/screencasts/
yii
null
null
null
null
02/12/2012 08:10:11
not constructive
practical tutorials for learning yii === My approach to learning a new framework or technology is to read a brief tutorial that goes over how to create a very simple application and then try to build something similar on my own. I've gone through the definitive guide and it's very hard to digest and doesn't suit my style of learning. [These][1] screencasts are excellent but I need more like them! Does anyone know of anything similar those screencasts or some other relatively brief practical tutorials for Yii? [1]: http://www.yiiframework.com/screencasts/
4
4,567,289
12/31/2010 00:27:58
179,362
09/26/2009 02:04:43
206
0
Injecting a repository in a custom role provider gives me DataContext accessed after Dispose error
I am currently building an ASP.NET MVC application and I want to take advantage of the authorize attribute with roles without having to use the default provider and all its tables that are automatically generated. I decided to build my own custom role provider (my class is inheriting from RoleProvider) and implement only one method: public override string[] GetRolesForUser(string username) { Account account = accountRepository.FindByUserName(username); string[] role = new string[] { account.Role }; return role; } My controller looks like: [Authorize(Roles = "Administrator")] public ActionResult Index() { return View(); } I am using Unity to inject the repository into my custom role provider class which works just fine but when the FindByUserName(username) is called the error I am getting is: Cannot access a disposed object. Object name: 'DataContext accessed after Dispose.'. For some reason Linq2Sql does not like what is going and I am a bit at a loss here. Any insight would be tremendously helpful. Also, if anyone has managed to do what I am trying to do without using any role provider please let me know. The account table in my database has a column called role (int) and my code has an enum with my roles. Thanks
asp.net-mvc
linq-to-sql
asp.net-mvc-2
null
null
null
open
Injecting a repository in a custom role provider gives me DataContext accessed after Dispose error === I am currently building an ASP.NET MVC application and I want to take advantage of the authorize attribute with roles without having to use the default provider and all its tables that are automatically generated. I decided to build my own custom role provider (my class is inheriting from RoleProvider) and implement only one method: public override string[] GetRolesForUser(string username) { Account account = accountRepository.FindByUserName(username); string[] role = new string[] { account.Role }; return role; } My controller looks like: [Authorize(Roles = "Administrator")] public ActionResult Index() { return View(); } I am using Unity to inject the repository into my custom role provider class which works just fine but when the FindByUserName(username) is called the error I am getting is: Cannot access a disposed object. Object name: 'DataContext accessed after Dispose.'. For some reason Linq2Sql does not like what is going and I am a bit at a loss here. Any insight would be tremendously helpful. Also, if anyone has managed to do what I am trying to do without using any role provider please let me know. The account table in my database has a column called role (int) and my code has an enum with my roles. Thanks
0
9,440,540
02/25/2012 02:08:48
1,230,167
02/24/2012 07:13:46
1
0
Is this RAID configuration possible?
Do all HDD in a set up have to be in RAID? Is this RAID setup possible? Drive A is 1TB SATA Drive B is 1TB SATA Drive C is 2TB SATA I want drives A and B to be RAID 1. I want drive C to just be an extra drive for backups.
linux
hardware
raid
null
null
02/25/2012 02:32:56
off topic
Is this RAID configuration possible? === Do all HDD in a set up have to be in RAID? Is this RAID setup possible? Drive A is 1TB SATA Drive B is 1TB SATA Drive C is 2TB SATA I want drives A and B to be RAID 1. I want drive C to just be an extra drive for backups.
2
5,400,403
03/23/2011 03:02:20
672,297
03/23/2011 02:39:15
1
0
INSERT query is not firing. Please help me with code.
<?php session_start(); include("config.php"); //if(isset($_SESSION["code"])){ $_SESSION["code"] = rand(1000, 9999); //} if($_POST["Submit"]!="") { $code=$_code["code"]; if ($_SESSION["code"] == $code) { $err=""; if($_POST["title"]=="") $err= ". Title field can't be left Empty.<br>"; if($_POST["roman"]||$_POST["hindi"]=="") $err = ". Either of field is necessary.<br>"; if($_POST["poet"]=="") $err= ". poetfield can't be left Empty.<br>"; if($err=="") { $title=trim($_POST["title"]); $roman=trim($_POST["roman"]); $title3=trim($_POST["title3"]); $hindi=trim($_POST["hindi"]); $poet=trim($_POST["poet"]); $category=trim($_POST["category"]); $sql = "INSERT into tbl_songlist_info (song_title,lyrics_roman,lyrics_hindi,poet_name,song_type) values('$title','$roman','$hindi','$poet','$category') "; $result=mysql_query($sql); header("Location: thanks.php"); } else { $new=mysql_error(); } } else { $msg = 'Your Input code is not valid'; mysql_error(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script language="JavaScript" type="text/javascript"> function valid(f) { !(/^[A-z.!,'"_-]*$/i).test(f.value)?f.value = f.value.replace(/[^A-Za-z.!,'"_-\s]/ig,''):null; } function capitalizeMe(obj) { val = obj.value; newVal = ''; val = val.split(' '); for(var c=0; c < val.length; c++) { newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' '; } obj.value = newVal; } </script> </head> <body> <form action="<?=$_SERVER['PHP_SELF'];?> " method="POST" id="ghazal" name="ghazal"> <table width="461" border="0" align="center" cellpadding="1" cellspacing="2"> <tr> <td width="86">Title :</td> <td><input name="title" type="text" id="title" size="57" onkeyup="valid(this)" onblur="valid(this)"><?=$err;?></td></tr> <tr> <td width="86">search :</td> <td><input name"search" type="text" id="title3" alt="Search Criteria" onkeyup="searchSuggest();" autocomplete="off"/> <div id="layer1"></div></td> </tr> <tr> <td valign="top">Roman :</td> <td><textarea name="roman" id="roman" cols="55" rows="5" onkeyup="valid(this)" onblur="valid(this)"></textarea><?=$err;?></td> </tr> <tr> <td valign="top">Hindi :</td> <td><textarea name="hindi" id="hindi" cols="55" rows="5"></textarea><?=$new;?></td> </tr> <tr> <td>Poet :</td> <td width="365"><input name="poet" type="text" id="poet" size="57" onchange="capitalizeMe(this)"/><?=$err;?></td> </tr> <tr> <td>Category:</td> <td><select name="category" id="category"> <option value="Ghazal or Nazm">Ghazal or Nazm</option> <option value="Other">Other</option> </select></td> </tr> <tr> <td><div align="left">Code:</div></td> <td><input name="code" type="text" id="code" size="4" maxlength="4" /><?=$msg;?> <iframe src="captcha.php" width="75" height="25" scrolling="No" frameborder="0"></iframe></td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="submit" id="submit" value="Submit" /> <input type="submit" name="reset" id="reset" value="Clear" /></td> </tr> </table> </form> </body> </html>
php
null
null
null
null
03/23/2011 04:53:05
too localized
INSERT query is not firing. Please help me with code. === <?php session_start(); include("config.php"); //if(isset($_SESSION["code"])){ $_SESSION["code"] = rand(1000, 9999); //} if($_POST["Submit"]!="") { $code=$_code["code"]; if ($_SESSION["code"] == $code) { $err=""; if($_POST["title"]=="") $err= ". Title field can't be left Empty.<br>"; if($_POST["roman"]||$_POST["hindi"]=="") $err = ". Either of field is necessary.<br>"; if($_POST["poet"]=="") $err= ". poetfield can't be left Empty.<br>"; if($err=="") { $title=trim($_POST["title"]); $roman=trim($_POST["roman"]); $title3=trim($_POST["title3"]); $hindi=trim($_POST["hindi"]); $poet=trim($_POST["poet"]); $category=trim($_POST["category"]); $sql = "INSERT into tbl_songlist_info (song_title,lyrics_roman,lyrics_hindi,poet_name,song_type) values('$title','$roman','$hindi','$poet','$category') "; $result=mysql_query($sql); header("Location: thanks.php"); } else { $new=mysql_error(); } } else { $msg = 'Your Input code is not valid'; mysql_error(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <script language="JavaScript" type="text/javascript"> function valid(f) { !(/^[A-z.!,'"_-]*$/i).test(f.value)?f.value = f.value.replace(/[^A-Za-z.!,'"_-\s]/ig,''):null; } function capitalizeMe(obj) { val = obj.value; newVal = ''; val = val.split(' '); for(var c=0; c < val.length; c++) { newVal += val[c].substring(0,1).toUpperCase() + val[c].substring(1,val[c].length) + ' '; } obj.value = newVal; } </script> </head> <body> <form action="<?=$_SERVER['PHP_SELF'];?> " method="POST" id="ghazal" name="ghazal"> <table width="461" border="0" align="center" cellpadding="1" cellspacing="2"> <tr> <td width="86">Title :</td> <td><input name="title" type="text" id="title" size="57" onkeyup="valid(this)" onblur="valid(this)"><?=$err;?></td></tr> <tr> <td width="86">search :</td> <td><input name"search" type="text" id="title3" alt="Search Criteria" onkeyup="searchSuggest();" autocomplete="off"/> <div id="layer1"></div></td> </tr> <tr> <td valign="top">Roman :</td> <td><textarea name="roman" id="roman" cols="55" rows="5" onkeyup="valid(this)" onblur="valid(this)"></textarea><?=$err;?></td> </tr> <tr> <td valign="top">Hindi :</td> <td><textarea name="hindi" id="hindi" cols="55" rows="5"></textarea><?=$new;?></td> </tr> <tr> <td>Poet :</td> <td width="365"><input name="poet" type="text" id="poet" size="57" onchange="capitalizeMe(this)"/><?=$err;?></td> </tr> <tr> <td>Category:</td> <td><select name="category" id="category"> <option value="Ghazal or Nazm">Ghazal or Nazm</option> <option value="Other">Other</option> </select></td> </tr> <tr> <td><div align="left">Code:</div></td> <td><input name="code" type="text" id="code" size="4" maxlength="4" /><?=$msg;?> <iframe src="captcha.php" width="75" height="25" scrolling="No" frameborder="0"></iframe></td> </tr> <tr> <td><div align="right"></div></td> <td><input type="submit" name="submit" id="submit" value="Submit" /> <input type="submit" name="reset" id="reset" value="Clear" /></td> </tr> </table> </form> </body> </html>
3
1,294,227
08/18/2009 14:24:47
1,968
08/19/2008 15:59:21
41,212
1,068
Inferred wildcard generics in return type
Java can often infer generics based on the arguments (and even on the return type, in contrast to e.g. C#). Case in point: I've got a generic class `Pair<T1, T2>` which just stores a pair of values and can be used in the following way: Pair<String, String> pair = Pair.of("Hello", "World"); The method `of` looks just like this: public static <T1, T2> Pair<T1, T2> of(T1 first, T2 second) { return new Pair<T1, T2>(first, second); } Very nice. However, this no longer works for the following use-case, which requires wildcards: Pair<Class<?>, String> pair = Pair.of((Class<?>) List.class, "hello"); (Notice the explicit cast to make `List.class` the correct type.) The code fails with the following error (provided by Eclipse): > Type mismatch: cannot convert from `TestClass.Pair<Class<capture#1-of ?>,String>` to `TestClass.Pair<Class<?>,String>` However, explicitly calling the constructor still works as expected: Pair<Class<?>, String> pair = new Pair<Class<?>, String>((Class<?>) List.class, "hello"); Can someone explain this behaviour? Is it by design? Is it *wanted*? Am I doing something wrong or did I stumble upon a flaw in the design / bug in the compiler? Wild guess: the “capture#1-of ?” somehow seems to imply that the wildcard is filled in by the compiler on the fly, making the type a `Class<List>`, and thus failing the conversion (from `Pair<Class<?>, String>` to `Pair<Class<List>, String>`). Is this right? Is there a way to work around this? --- For completeness’ sake, here is a simplified version of the `Pair` class: public final class Pair<T1, T2> { public final T1 first; public final T2 second; public Pair(T1 first, T2 second) { this.first = first; this.second = second; } public static <T1, T2> Pair<T1, T2> of(T1 first, T2 second) { return new Pair<T1, T2>(first, second); } }
java
generics
wildcard
null
null
null
open
Inferred wildcard generics in return type === Java can often infer generics based on the arguments (and even on the return type, in contrast to e.g. C#). Case in point: I've got a generic class `Pair<T1, T2>` which just stores a pair of values and can be used in the following way: Pair<String, String> pair = Pair.of("Hello", "World"); The method `of` looks just like this: public static <T1, T2> Pair<T1, T2> of(T1 first, T2 second) { return new Pair<T1, T2>(first, second); } Very nice. However, this no longer works for the following use-case, which requires wildcards: Pair<Class<?>, String> pair = Pair.of((Class<?>) List.class, "hello"); (Notice the explicit cast to make `List.class` the correct type.) The code fails with the following error (provided by Eclipse): > Type mismatch: cannot convert from `TestClass.Pair<Class<capture#1-of ?>,String>` to `TestClass.Pair<Class<?>,String>` However, explicitly calling the constructor still works as expected: Pair<Class<?>, String> pair = new Pair<Class<?>, String>((Class<?>) List.class, "hello"); Can someone explain this behaviour? Is it by design? Is it *wanted*? Am I doing something wrong or did I stumble upon a flaw in the design / bug in the compiler? Wild guess: the “capture#1-of ?” somehow seems to imply that the wildcard is filled in by the compiler on the fly, making the type a `Class<List>`, and thus failing the conversion (from `Pair<Class<?>, String>` to `Pair<Class<List>, String>`). Is this right? Is there a way to work around this? --- For completeness’ sake, here is a simplified version of the `Pair` class: public final class Pair<T1, T2> { public final T1 first; public final T2 second; public Pair(T1 first, T2 second) { this.first = first; this.second = second; } public static <T1, T2> Pair<T1, T2> of(T1 first, T2 second) { return new Pair<T1, T2>(first, second); } }
0
10,613,616
05/16/2012 07:07:26
1,256,630
03/08/2012 09:20:19
1
1
The method of development multidomain (apache) on the local server
I have website in production, multidomain website. I have production server which is running website. I have many domains which connected to one virtualhost in Apache. For example: domain.com domain.ru domain.nl m.domain.com m.domain.ru m.domain.nl *.domain.com *.domain.nl *.domain.ru (where * - can be some subdomain) I'm developing this project in development server but i should test in before publish in production server. So, i did added in hosts (127.0.0.1 *my domain list*) and made virtualhost in apache: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName domain.com ServerAlias domain.ru domain.nl .................... DocumentRoot /var/www/domain/web ...................... But this is bad way, because when i need have a look at website in production, i need delete my hosts and then paste it again. Maybe somebody have other idea how to do this? The best way will be create localhost/domain.com, ... (localhost/*.domain.*), but i don't know hot to do this without creating folder for every domain, it should be in one folder. Sorry for my bad English.
apache
virtualhost
null
null
null
05/18/2012 17:20:14
off topic
The method of development multidomain (apache) on the local server === I have website in production, multidomain website. I have production server which is running website. I have many domains which connected to one virtualhost in Apache. For example: domain.com domain.ru domain.nl m.domain.com m.domain.ru m.domain.nl *.domain.com *.domain.nl *.domain.ru (where * - can be some subdomain) I'm developing this project in development server but i should test in before publish in production server. So, i did added in hosts (127.0.0.1 *my domain list*) and made virtualhost in apache: <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName domain.com ServerAlias domain.ru domain.nl .................... DocumentRoot /var/www/domain/web ...................... But this is bad way, because when i need have a look at website in production, i need delete my hosts and then paste it again. Maybe somebody have other idea how to do this? The best way will be create localhost/domain.com, ... (localhost/*.domain.*), but i don't know hot to do this without creating folder for every domain, it should be in one folder. Sorry for my bad English.
2
11,261,766
06/29/2012 12:26:53
1,336,218
04/16/2012 11:48:40
29
1
Index in a List C#
I have a list that contains the int numbersID of the element. The list doesn't contain duplication and every time i have already the element in the list i have to add the supplierID in the list of the element that is already in the clientList. foreach (EA.Connector link in element.Connectors) { int supplier = link.SupplierID; // target int client = link.ClientID; // source Client node = new Client(client); if (clientList.Contains(client)) { node.addSupplier(supplier); } else { clientList.Add(client); node.addSupplier(supplier); supplierList = node.getSupplierList(); } supplierList = node.getSupplierList(); Console.WriteLine("the connector is:" +link.Type); Console.WriteLine("client"); foreach (int number in clientList) { Console.WriteLine(number); } Console.WriteLine("supplier"); foreach (int number in supplierList) { Console.WriteLine(number); } Console.WriteLine(""); } i get the clientList, but the supplierList i get one element at the time, not the list that i want.
c#
list
index
null
null
06/29/2012 12:32:12
not a real question
Index in a List C# === I have a list that contains the int numbersID of the element. The list doesn't contain duplication and every time i have already the element in the list i have to add the supplierID in the list of the element that is already in the clientList. foreach (EA.Connector link in element.Connectors) { int supplier = link.SupplierID; // target int client = link.ClientID; // source Client node = new Client(client); if (clientList.Contains(client)) { node.addSupplier(supplier); } else { clientList.Add(client); node.addSupplier(supplier); supplierList = node.getSupplierList(); } supplierList = node.getSupplierList(); Console.WriteLine("the connector is:" +link.Type); Console.WriteLine("client"); foreach (int number in clientList) { Console.WriteLine(number); } Console.WriteLine("supplier"); foreach (int number in supplierList) { Console.WriteLine(number); } Console.WriteLine(""); } i get the clientList, but the supplierList i get one element at the time, not the list that i want.
1
11,109,810
06/19/2012 21:35:20
872,344
08/01/2011 07:12:44
636
4
Is there an API for realtime airport information?
I am planning to work on a Airport Navigator application, just not sure if there's any api can provide realtime information such as: flight status delay notification, and gate information? Of course it's better to be free! Thank you
api
airport
null
null
null
06/21/2012 01:11:53
not constructive
Is there an API for realtime airport information? === I am planning to work on a Airport Navigator application, just not sure if there's any api can provide realtime information such as: flight status delay notification, and gate information? Of course it's better to be free! Thank you
4
4,125,108
11/08/2010 15:13:44
317,326
04/15/2010 09:31:48
114
17
Zend_Auth now only works partial
Okay, This is completely a weird situation. When a user logs in, I store some stuff using the following code: $auth->getStorage()->write($authAdapter->getResultRowObject(array( 'username', 'avatar', 'status', 'role', 'id', 'email' ))); Then I use the following code in my bootstrap to get access to the variables: $this->auth = Zend_Auth::getInstance(); $this->view->user = $this->auth->getIdentity(); Okay, and now for the weird part: When I use if($this->user->role == 'Administrator') { In my layout.phtml it works great. But when I use the same code in a index.phtml file which is loaded according to the controller it doesn't work?! The stranger part is that it used to work perfectly and use it t show different options depending of the user's role. Where could I look for mistakes in my code? Really lost on places to check on. Probably changed something somewhere, but everything else seems to work fine. Any tips or directions would be awesome!
zend-framework
storage
zend-auth
null
null
null
open
Zend_Auth now only works partial === Okay, This is completely a weird situation. When a user logs in, I store some stuff using the following code: $auth->getStorage()->write($authAdapter->getResultRowObject(array( 'username', 'avatar', 'status', 'role', 'id', 'email' ))); Then I use the following code in my bootstrap to get access to the variables: $this->auth = Zend_Auth::getInstance(); $this->view->user = $this->auth->getIdentity(); Okay, and now for the weird part: When I use if($this->user->role == 'Administrator') { In my layout.phtml it works great. But when I use the same code in a index.phtml file which is loaded according to the controller it doesn't work?! The stranger part is that it used to work perfectly and use it t show different options depending of the user's role. Where could I look for mistakes in my code? Really lost on places to check on. Probably changed something somewhere, but everything else seems to work fine. Any tips or directions would be awesome!
0
474,547
01/23/2009 21:10:13
43,756
12/05/2008 19:09:10
468
35
Can I recover a file in linux which i accidentally did an "rm" on?
Do you know of any tools/commands by which I recover files which I accidentally removed?
linux
recovery
file-recovery
null
null
01/23/2009 21:35:27
off topic
Can I recover a file in linux which i accidentally did an "rm" on? === Do you know of any tools/commands by which I recover files which I accidentally removed?
2
2,642,802
04/15/2010 04:47:06
92,039
04/17/2009 09:06:52
87
8
Android Layouts Scrolling in Landscaped Mode
I have a strange issue in which on rotating the Screen to Landscaped mode the Views present inside Remain at the same place But I cannot scroll them inside the screen. How can I make them Scroll so that every thing that move out should be displayed properly to the user. Should there be any more attribute to be set for allowing such kind of behavior.
android
null
null
null
null
null
open
Android Layouts Scrolling in Landscaped Mode === I have a strange issue in which on rotating the Screen to Landscaped mode the Views present inside Remain at the same place But I cannot scroll them inside the screen. How can I make them Scroll so that every thing that move out should be displayed properly to the user. Should there be any more attribute to be set for allowing such kind of behavior.
0
9,983,670
04/02/2012 20:53:51
1,308,989
04/02/2012 20:25:48
1
0
Apache, PHP, MySQL Standalone App
My company recently dropped support for Apache and PHP; however, we cannot rewrite a very large PHP project (~1 million lines) to .NET... Too much time invested to drop the project. A consideration is to package Apache, PHP, and MySQL into a unique standalone application for Linux. XAMPP was initially though of, but we cannot have any evidence of Apache or PHP... It must look like a single, new process running. Anyone have any suggestions?
php
mysql
linux
apache
standalone
04/03/2012 11:10:25
too localized
Apache, PHP, MySQL Standalone App === My company recently dropped support for Apache and PHP; however, we cannot rewrite a very large PHP project (~1 million lines) to .NET... Too much time invested to drop the project. A consideration is to package Apache, PHP, and MySQL into a unique standalone application for Linux. XAMPP was initially though of, but we cannot have any evidence of Apache or PHP... It must look like a single, new process running. Anyone have any suggestions?
3
5,136,914
02/27/2011 23:46:18
636,953
02/27/2011 23:46:18
1
0
Keep getting: java.lang.NullPointerException
Exercise 1: Program Bugs is supposed to sum the first ten values on a file and the second ten values on a file. The second ten values are a duplicate of the first ten, so the answers should be the same. The program checks to be sure that the file has been found and halts execution if the file is not found. Program Bugs compiles, says that the file cannot be found, but then crashes. Can you find the problem? Describe it. The program is looking for Bug.dat. That is the first problem. After fixing that I’m still getting an error stating the following: java.lang.NullPointerException at Bugs.main(Bugs.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271) Exercise 2: Correct the problem and rerun the program. The file cannot be found, but now the program halts correctly. Correct the name of the file and rerun the program. I renamed the bug.dat file to bugs.data file and then switched case 1: and case 2: around. This caused the program to come to a hault and get rid of the error message I was getting in exercise 1. I am still not getting the math to run in the program. Exercise 3: What—the program crashes again? Back to the drawing board. Describe the next error you find. Correct the program and run it again. Exercise 4: Now you are getting output, but the answer is wrong for the second sum. When you find this last error, describe it, correct it, and rerun the program. What are the correct totals?
java
null
null
null
null
02/28/2011 02:52:36
not a real question
Keep getting: java.lang.NullPointerException === Exercise 1: Program Bugs is supposed to sum the first ten values on a file and the second ten values on a file. The second ten values are a duplicate of the first ten, so the answers should be the same. The program checks to be sure that the file has been found and halts execution if the file is not found. Program Bugs compiles, says that the file cannot be found, but then crashes. Can you find the problem? Describe it. The program is looking for Bug.dat. That is the first problem. After fixing that I’m still getting an error stating the following: java.lang.NullPointerException at Bugs.main(Bugs.java:30) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at edu.rice.cs.drjava.model.compiler.JavacCompiler.runCommand(JavacCompiler.java:271) Exercise 2: Correct the problem and rerun the program. The file cannot be found, but now the program halts correctly. Correct the name of the file and rerun the program. I renamed the bug.dat file to bugs.data file and then switched case 1: and case 2: around. This caused the program to come to a hault and get rid of the error message I was getting in exercise 1. I am still not getting the math to run in the program. Exercise 3: What—the program crashes again? Back to the drawing board. Describe the next error you find. Correct the program and run it again. Exercise 4: Now you are getting output, but the answer is wrong for the second sum. When you find this last error, describe it, correct it, and rerun the program. What are the correct totals?
1
11,350,484
07/05/2012 18:38:12
1,504,678
07/05/2012 16:45:25
1
0
How to auto post links to users facebook timeline when user is viewing webpage
Lets say I have a site called http://www.foobar.com. In my site user logged via Facebook already. Now user visited the page <site-url>/my-new-page. What I want is when user visit this page, his Facebook timeline should be posted with "XYZ user is viewing <site-url>/my-new-page" Please let me know how I can accomplish this?
php
facebook
null
null
null
07/20/2012 01:51:36
not a real question
How to auto post links to users facebook timeline when user is viewing webpage === Lets say I have a site called http://www.foobar.com. In my site user logged via Facebook already. Now user visited the page <site-url>/my-new-page. What I want is when user visit this page, his Facebook timeline should be posted with "XYZ user is viewing <site-url>/my-new-page" Please let me know how I can accomplish this?
1
9,236,773
02/11/2012 00:45:37
1,195,651
02/07/2012 20:24:36
10
0
mysql connection function pdo
<?php require_once "includes/db_data_inc.php"; try { /* In this way I get a db connection handle */ $DBH = new PDO("mysql:host=$db_host;port=8889;dbname=$db_name",$db_user,$db_pass); } catch (PDOException $pdoe) { error_log($pdoe->getMessage()); die("Failed to connect to the database."); } $DBH->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $DBH->setAttribute(PDO::ATTR_AUTOCOMMIT,false); try { $success_msg = NULL; $unsucess_msg = NULL; $query = "INSERT INTO users (name,surname,address,birth_place,province,birthdate,sex,treatment) VALUES (?)"; $SHT = $DBH->prepare($query); $SHT->bindParam(1, $_POST['name']); $SHT->bindParam(2, $_POST['surname']); $SHT->bindParam(3, $_POST['address']); $SHT->bindParam(4, $_POST['birth_place']); $SHT->bindParam(5, $_POST['province']); $SHT->bindParam(6, $_POST['dt']); $SHT->bindParam(7, $_POST['gender']); $SHT->bindParam(8, $_POST['select']); $DBH->beginTransaction(); if($SHT->execute()) { $DBH->commit(); $success_msg = "The emergency call was correctly sent..."; } else { $unsucess_msg = "It couldn't estabilished a connection to call center..."; } } catch(PDOException $pdoe) { $DBH->rollBack(); } /* Close the db connection */ $DBH = null; ?> here it is my mysql connection function to connect to mysql db and an insert query. The code doesn't work.There is maybe some error?Because I don't receive any error from php console but I don't even see any result in the page.any idea?
php
mysql
pdo
null
null
02/12/2012 07:31:29
too localized
mysql connection function pdo === <?php require_once "includes/db_data_inc.php"; try { /* In this way I get a db connection handle */ $DBH = new PDO("mysql:host=$db_host;port=8889;dbname=$db_name",$db_user,$db_pass); } catch (PDOException $pdoe) { error_log($pdoe->getMessage()); die("Failed to connect to the database."); } $DBH->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $DBH->setAttribute(PDO::ATTR_AUTOCOMMIT,false); try { $success_msg = NULL; $unsucess_msg = NULL; $query = "INSERT INTO users (name,surname,address,birth_place,province,birthdate,sex,treatment) VALUES (?)"; $SHT = $DBH->prepare($query); $SHT->bindParam(1, $_POST['name']); $SHT->bindParam(2, $_POST['surname']); $SHT->bindParam(3, $_POST['address']); $SHT->bindParam(4, $_POST['birth_place']); $SHT->bindParam(5, $_POST['province']); $SHT->bindParam(6, $_POST['dt']); $SHT->bindParam(7, $_POST['gender']); $SHT->bindParam(8, $_POST['select']); $DBH->beginTransaction(); if($SHT->execute()) { $DBH->commit(); $success_msg = "The emergency call was correctly sent..."; } else { $unsucess_msg = "It couldn't estabilished a connection to call center..."; } } catch(PDOException $pdoe) { $DBH->rollBack(); } /* Close the db connection */ $DBH = null; ?> here it is my mysql connection function to connect to mysql db and an insert query. The code doesn't work.There is maybe some error?Because I don't receive any error from php console but I don't even see any result in the page.any idea?
3
5,936,874
05/09/2011 12:28:13
115,873
06/02/2009 09:06:05
595
6
How to make scalable backend API server solution?
We are building a REST API in PHP that needs to support high peak loads. Each API call isn't lightweight and consumes significant amount of memory. What is the best possible solution to make this scalable either time or resource wise? API is hosted on the Ubuntu 10.04 machine with 512MB of RAM. Any ideas will be well appreciated.
rest
null
null
null
null
05/10/2011 11:49:33
not a real question
How to make scalable backend API server solution? === We are building a REST API in PHP that needs to support high peak loads. Each API call isn't lightweight and consumes significant amount of memory. What is the best possible solution to make this scalable either time or resource wise? API is hosted on the Ubuntu 10.04 machine with 512MB of RAM. Any ideas will be well appreciated.
1
9,194,771
02/08/2012 14:00:32
462,949
09/30/2010 14:45:03
36
0
short Dump: Field symbol has not yet been assigned
Im getting a short dump (Field symbol has not yet been assigned) when i run this program. I know that i may get this error when i dont fill `fillcatalog` correctly. As far as i know i have filled the fieldctalog correctly. cant figure out where the problem is..Please help. REPORT Y_ALV1. type-pools slis. tables: scarr. data: t_scarr type table of scarr, t_fieldcat type slis_t_fieldcat_alv. data: wa_fieldcat type slis_fieldcat_alv. select-options: s_carrid for scarr-carrid. start-of-selection. select * into table t_scarr from scarr where carrid in s_carrid. if sy-subrc ne 0. leave list-processing. endif. define fill_fieldcatalog. wa_fieldcat-col_pos = &1. wa_fieldcat-fieldname = &2. wa_fieldcat-tabname = &3. wa_fieldcat-outputlen = &4. append wa_fieldcat to t_fieldcat. end-of-definition. fill_fieldcatalog 1 'carrid' 't_scarr' 10. fill_fieldcatalog 2 'carrname' 't_scarr' 10. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING IT_FIELDCAT = t_fieldcat TABLES T_OUTTAB = t_scarr EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
abap
null
null
null
null
null
open
short Dump: Field symbol has not yet been assigned === Im getting a short dump (Field symbol has not yet been assigned) when i run this program. I know that i may get this error when i dont fill `fillcatalog` correctly. As far as i know i have filled the fieldctalog correctly. cant figure out where the problem is..Please help. REPORT Y_ALV1. type-pools slis. tables: scarr. data: t_scarr type table of scarr, t_fieldcat type slis_t_fieldcat_alv. data: wa_fieldcat type slis_fieldcat_alv. select-options: s_carrid for scarr-carrid. start-of-selection. select * into table t_scarr from scarr where carrid in s_carrid. if sy-subrc ne 0. leave list-processing. endif. define fill_fieldcatalog. wa_fieldcat-col_pos = &1. wa_fieldcat-fieldname = &2. wa_fieldcat-tabname = &3. wa_fieldcat-outputlen = &4. append wa_fieldcat to t_fieldcat. end-of-definition. fill_fieldcatalog 1 'carrid' 't_scarr' 10. fill_fieldcatalog 2 'carrname' 't_scarr' 10. CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY' EXPORTING IT_FIELDCAT = t_fieldcat TABLES T_OUTTAB = t_scarr EXCEPTIONS PROGRAM_ERROR = 1 OTHERS = 2 . IF SY-SUBRC <> 0. MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4. ENDIF.
0
9,937,865
03/30/2012 06:14:03
826,872
07/03/2011 12:32:59
14
0
See if event occurs (true or false) on each day on specific month
I'm trying to highlight the days on my jQuery datepicker calendar which are associated with an event. In my database I have many events with a date field. So if January is selected on the datepicker I want to check the database table to see if: January 1st: Is there an event (true/false) January 2nd: Is there an event (true/false) January 3rd: Is there an event (true/false) ... and so on. I guess I could just create a loop to create 31 queries to do the job. But I was wondering if there's a more efficient way. Thanks Andreas
mysql
null
null
null
null
null
open
See if event occurs (true or false) on each day on specific month === I'm trying to highlight the days on my jQuery datepicker calendar which are associated with an event. In my database I have many events with a date field. So if January is selected on the datepicker I want to check the database table to see if: January 1st: Is there an event (true/false) January 2nd: Is there an event (true/false) January 3rd: Is there an event (true/false) ... and so on. I guess I could just create a loop to create 31 queries to do the job. But I was wondering if there's a more efficient way. Thanks Andreas
0
5,987,540
05/13/2011 05:22:25
231,567
12/14/2009 19:50:12
118
8
visualvm vs JProbe vs JProfiler
There are multiple tools available for CPU and memory profiling, jvisualvm is fairly new among these. Are there any comparison/benchmarking between these tools? Which tool is better than other?
java
performance
profiling
visualvm
jprofiler
06/30/2011 17:21:07
not constructive
visualvm vs JProbe vs JProfiler === There are multiple tools available for CPU and memory profiling, jvisualvm is fairly new among these. Are there any comparison/benchmarking between these tools? Which tool is better than other?
4
10,842,004
05/31/2012 22:11:50
699,978
04/09/2011 13:31:54
3,372
87
Setting up Apache. The var folder cannot be written to
Currently installed the LAMP stack using `tasksel` but I've run into a problem. The location where the website folder is located is not easily writable. It's a pain in the keister to do anything. /var/www Since I'm new to LAMP on Linux, maybe I'm doing things incorrectly. What is the workflow if I want to developer a PHP application and run it locally on Apache? I can't even edit files on the default path, because of permissions from Linux. Any suggestions? Maybe I can create a folder on my Home directory and tell Apache to use that instead? What do the regular's do?
php
linux
apache
permissions
null
06/04/2012 14:13:28
off topic
Setting up Apache. The var folder cannot be written to === Currently installed the LAMP stack using `tasksel` but I've run into a problem. The location where the website folder is located is not easily writable. It's a pain in the keister to do anything. /var/www Since I'm new to LAMP on Linux, maybe I'm doing things incorrectly. What is the workflow if I want to developer a PHP application and run it locally on Apache? I can't even edit files on the default path, because of permissions from Linux. Any suggestions? Maybe I can create a folder on my Home directory and tell Apache to use that instead? What do the regular's do?
2
11,667,261
07/26/2012 10:21:21
1,083,736
12/06/2011 14:56:58
3
5
Disable access to the DB via Windows Authentication.also disable SQL Management Studio
I am deploying my application including database for a client. what i need is to install sql server 2008 **Without SQL Management Studio** so that only i can access the db using my laptop. what should i do for that...?
sql
sql-server
sql-server-2008
null
null
07/30/2012 06:34:44
off topic
Disable access to the DB via Windows Authentication.also disable SQL Management Studio === I am deploying my application including database for a client. what i need is to install sql server 2008 **Without SQL Management Studio** so that only i can access the db using my laptop. what should i do for that...?
2
7,262,426
08/31/2011 19:35:57
682,765
03/29/2011 19:41:45
42
0
camera sensors - smartphones
How do camera sensors work on smartphones. ( I am not looking for the APIs but the technical details). Is it the CCD image sensor that is used or the CMOS sensors? I am looking for both iOS and android devices. Any help/resources appreciated
camera
sensor
smartphone
null
null
08/31/2011 19:40:15
off topic
camera sensors - smartphones === How do camera sensors work on smartphones. ( I am not looking for the APIs but the technical details). Is it the CCD image sensor that is used or the CMOS sensors? I am looking for both iOS and android devices. Any help/resources appreciated
2
9,304,688
02/16/2012 02:29:23
682,308
03/29/2011 15:00:33
337
6
FFMPEG conversion to MXF
I have to wrap an MPEG2 video file in an MXF container and convert the audio in the process. I have the MXF wrapping working but it won't convert the audio stream (which needs to be 16bit, 48kHz Linear PCM). Here's what I'm trying: ffmpeg -i input.mpg -vcodec copy -f mpeg2video -acodec pcm_u16 output.mxf Results: ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers built on Jan 30 2012 17:49:23 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3) configuration: *{snipped}* runtime-cpudetect libavutil 51. 34.101 / 51. 34.101 libavcodec 53. 60.100 / 53. 60.100 libavformat 53. 31.100 / 53. 31.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 60.100 / 2. 60.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 / 0. 6.100 libpostproc 52. 0.100 / 52. 0.100 [mpeg @ 0x10201ae00] max_analyze_duration 5000000 reached at 5000000 Input #0, mpeg, from '/Volumes/Extra/test.mpg': Duration: 00:00:59.97, start: 0.192911, bitrate: 6513 kb/s Stream #0:0[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 12000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Output #0, mpeg2video, to 'video.mxf': Metadata: encoder : Lavf53.31.100 Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 12000 kb/s, 25 fps, 90k tbn, 25 tbc Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 1500 fps= 0 q=-1.0 Lsize= 43949kB time=00:00:59.96 bitrate=6004.6kbits/s video:43949kB audio:0kB global headers:0kB muxing overhead 0.000000% The video plays fine as the MXF, but there is no audio stream at all. Any help would be great.
video
ffmpeg
mpeg-2
null
null
02/17/2012 05:33:12
off topic
FFMPEG conversion to MXF === I have to wrap an MPEG2 video file in an MXF container and convert the audio in the process. I have the MXF wrapping working but it won't convert the audio stream (which needs to be 16bit, 48kHz Linear PCM). Here's what I'm trying: ffmpeg -i input.mpg -vcodec copy -f mpeg2video -acodec pcm_u16 output.mxf Results: ffmpeg version 0.10 Copyright (c) 2000-2012 the FFmpeg developers built on Jan 30 2012 17:49:23 with gcc 4.2.1 (Apple Inc. build 5666) (dot 3) configuration: *{snipped}* runtime-cpudetect libavutil 51. 34.101 / 51. 34.101 libavcodec 53. 60.100 / 53. 60.100 libavformat 53. 31.100 / 53. 31.100 libavdevice 53. 4.100 / 53. 4.100 libavfilter 2. 60.100 / 2. 60.100 libswscale 2. 1.100 / 2. 1.100 libswresample 0. 6.100 / 0. 6.100 libpostproc 52. 0.100 / 52. 0.100 [mpeg @ 0x10201ae00] max_analyze_duration 5000000 reached at 5000000 Input #0, mpeg, from '/Volumes/Extra/test.mpg': Duration: 00:00:59.97, start: 0.192911, bitrate: 6513 kb/s Stream #0:0[0x1c0]: Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s Stream #0:1[0x1e0]: Video: mpeg2video (Main), yuv420p, 720x576 [SAR 16:15 DAR 4:3], 12000 kb/s, 25 fps, 25 tbr, 90k tbn, 50 tbc Output #0, mpeg2video, to 'video.mxf': Metadata: encoder : Lavf53.31.100 Stream #0:0: Video: mpeg2video, yuv420p, 720x576 [SAR 16:15 DAR 4:3], q=2-31, 12000 kb/s, 25 fps, 90k tbn, 25 tbc Stream mapping: Stream #0:1 -> #0:0 (copy) Press [q] to stop, [?] for help frame= 1500 fps= 0 q=-1.0 Lsize= 43949kB time=00:00:59.96 bitrate=6004.6kbits/s video:43949kB audio:0kB global headers:0kB muxing overhead 0.000000% The video plays fine as the MXF, but there is no audio stream at all. Any help would be great.
2
7,423,363
09/14/2011 21:44:30
139,147
07/16/2009 02:52:30
96
2
What are some of the features coming to Visual Studio vNext?
I've been curious about some of the features that are coming to the next iteration of Visual Studio, and I'm thinking it would be nice to compile a list of confirmed or rumored features from around various MSDN blogs and other places on the internet. Additionally, I think this posting would be better fit to a community wiki, but I'm not sure how to do that. Some of the more prominent announced features I've read about come from Zain Naboulsi's blog located [here](http://blogs.msdn.com/b/zainnab/archive/2011/09/01/visual-studio-vnext-ide-enhancements.aspx). The stuff that excited me the most was that the project upgrade wizard is gone, and the multiple solution explorer feature. What other interesting features have been confirmed, and where can we read about them?
visual-studio
null
null
null
null
09/15/2011 04:18:27
not constructive
What are some of the features coming to Visual Studio vNext? === I've been curious about some of the features that are coming to the next iteration of Visual Studio, and I'm thinking it would be nice to compile a list of confirmed or rumored features from around various MSDN blogs and other places on the internet. Additionally, I think this posting would be better fit to a community wiki, but I'm not sure how to do that. Some of the more prominent announced features I've read about come from Zain Naboulsi's blog located [here](http://blogs.msdn.com/b/zainnab/archive/2011/09/01/visual-studio-vnext-ide-enhancements.aspx). The stuff that excited me the most was that the project upgrade wizard is gone, and the multiple solution explorer feature. What other interesting features have been confirmed, and where can we read about them?
4
10,284,222
04/23/2012 16:13:36
538,761
12/11/2010 09:04:48
26
0
same backreference in subpatterns, php pcre regexp
I found this at http://www.php.net/manual/en/regexp.reference.subpatterns.php (?|(Sat)ur|(Sun))day this mean (Sat) and Sun will be matched at same order but When I test with regexbuddy it occurr a error abt syntax Thanks
php
regex
null
null
null
04/25/2012 11:34:14
not a real question
same backreference in subpatterns, php pcre regexp === I found this at http://www.php.net/manual/en/regexp.reference.subpatterns.php (?|(Sat)ur|(Sun))day this mean (Sat) and Sun will be matched at same order but When I test with regexbuddy it occurr a error abt syntax Thanks
1
11,699,901
07/28/2012 09:39:42
709,507
04/15/2011 08:57:34
340
2
How to Write a simple Assembly Program
I'm too amatuer. I want to compile program below in an assembly IDE, I mean I want to write a simple console application: X DB 18 MOV AL,-18 ADD AL,X I want to see AL's value as output on console screen, How can I run this simple code? which codes should I add to it?
assembly
null
null
null
null
07/29/2012 11:35:46
too localized
How to Write a simple Assembly Program === I'm too amatuer. I want to compile program below in an assembly IDE, I mean I want to write a simple console application: X DB 18 MOV AL,-18 ADD AL,X I want to see AL's value as output on console screen, How can I run this simple code? which codes should I add to it?
3
1,516,281
10/04/2009 12:20:58
182,172
09/30/2009 23:11:53
23
1
Looking for a simple rails hosting with a rails philosophy
I'm starting to develop applications using rails, I am designer turning developer. I have not find yet a rails hosting easy to use. I tried mediatemple and their RoR container, seems very easy in the control panel: just press a button and you have your application running. But they dont have sqlite3, changed to mySQL and I still cant make the site work. Now I tried slicehost. Excelent chat support, but is not what I am looking for. I don´t want to configure everything manually in the command line from scratch. I just don't want too many configuration options. I just want to run the applications I have created in my mac. Simplicity. Isnt it what is rails about? I will try now heroku, have you used it? Thank you Victor
ruby-on-rails
hosting
null
null
null
null
open
Looking for a simple rails hosting with a rails philosophy === I'm starting to develop applications using rails, I am designer turning developer. I have not find yet a rails hosting easy to use. I tried mediatemple and their RoR container, seems very easy in the control panel: just press a button and you have your application running. But they dont have sqlite3, changed to mySQL and I still cant make the site work. Now I tried slicehost. Excelent chat support, but is not what I am looking for. I don´t want to configure everything manually in the command line from scratch. I just don't want too many configuration options. I just want to run the applications I have created in my mac. Simplicity. Isnt it what is rails about? I will try now heroku, have you used it? Thank you Victor
0
10,392,736
05/01/2012 02:10:05
1,352,458
04/23/2012 22:43:30
18
1
jquery to javascript translation
Would someone please translate this into regular javaScript: $("div.intro h1").hide(); $("div.intro h2").remove(); Thanks.
javascript
jquery
null
null
null
05/01/2012 02:30:56
not a real question
jquery to javascript translation === Would someone please translate this into regular javaScript: $("div.intro h1").hide(); $("div.intro h2").remove(); Thanks.
1
9,600,867
03/07/2012 11:42:54
588,987
01/25/2011 12:28:34
25
5
Running ffmpeg from a windows service on same machine encounters permissions issue
I had been running a Windows Service, form my machine (which has full read/write access to a network drive). The command for ffmpeg was something like this: -i \\filestore\test.avi -b 500000 -s 640x360 -ar 22050 -copyts -y -vcodec libx264 -acodec ac3 -y \\filestore\\mp4\test.mp4 Running it from cmd works perfectly. Running it from a windows service, from the same machine, would yield a File Not found type error. Updating to the latest ffmpeg stable changed that to "Permission denied". I am running the service it as 'Local Account'. I was intending to run this on another server, so I need to get a grip on this! Does running a service on your machine run as a different user to you when you choose 'Local Account'?
windows-services
ffmpeg
shared-directory
null
null
null
open
Running ffmpeg from a windows service on same machine encounters permissions issue === I had been running a Windows Service, form my machine (which has full read/write access to a network drive). The command for ffmpeg was something like this: -i \\filestore\test.avi -b 500000 -s 640x360 -ar 22050 -copyts -y -vcodec libx264 -acodec ac3 -y \\filestore\\mp4\test.mp4 Running it from cmd works perfectly. Running it from a windows service, from the same machine, would yield a File Not found type error. Updating to the latest ffmpeg stable changed that to "Permission denied". I am running the service it as 'Local Account'. I was intending to run this on another server, so I need to get a grip on this! Does running a service on your machine run as a different user to you when you choose 'Local Account'?
0
7,697,352
10/08/2011 14:10:56
564,229
01/05/2011 16:23:09
65
2
Automated control of a Telerik RadDatePicker
I'm using WatIn to create an automated test for a Web App that uses Telerik controls: my first challenge is to drive a Telerik date control - a RadDatePicker. Simply entering the text in the likeliest input field doesn't work: the value is reset to blank as the form is posted. So I imagine I need a more complex set of automated interactions -- for example, I found [this thread on the Telerik site][1] discussing how to automated a selection from a Telerik combo box. Can anyone supply the magic combination of interactions I need? (I'm sure that the answer would help anyone using any automated test tool, hence I've also flagged this question with a couple of other test frameworks too :-)) [1]: http://www.telerik.com/community/forums/aspnet/combobox/select-value-in-telerik-combo-box.aspx
selenium
nunit
telerik
automated-tests
watin
null
open
Automated control of a Telerik RadDatePicker === I'm using WatIn to create an automated test for a Web App that uses Telerik controls: my first challenge is to drive a Telerik date control - a RadDatePicker. Simply entering the text in the likeliest input field doesn't work: the value is reset to blank as the form is posted. So I imagine I need a more complex set of automated interactions -- for example, I found [this thread on the Telerik site][1] discussing how to automated a selection from a Telerik combo box. Can anyone supply the magic combination of interactions I need? (I'm sure that the answer would help anyone using any automated test tool, hence I've also flagged this question with a couple of other test frameworks too :-)) [1]: http://www.telerik.com/community/forums/aspnet/combobox/select-value-in-telerik-combo-box.aspx
0
2,139,741
01/26/2010 13:50:00
61,697
02/02/2009 22:30:26
1,241
65
Broken images in PHP over https
I have a strange situation with PHP working differently from HTML. I'm not a web programmer, just messing around. In HTML my images appear fine, in PHP the images are broken. And only images from a https server are broken, ones from a http server work. As an example, here are two files on my localhost, abc.html and def.php. They try to display two images, one pointing to my https image, and another pointing to the Google logo. abc.html: <img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'> <img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'> def.php: <?php echo "<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>"; echo "<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>"; exit; Browsing to abc.html shows both images perfectly. Browsing to def.php only shows the Google logo and the other image is broken. It doesn't work on Firefox however someone told me it works on Opera. Ideas please :)
php
image
https
firefox
null
null
open
Broken images in PHP over https === I have a strange situation with PHP working differently from HTML. I'm not a web programmer, just messing around. In HTML my images appear fine, in PHP the images are broken. And only images from a https server are broken, ones from a http server work. As an example, here are two files on my localhost, abc.html and def.php. They try to display two images, one pointing to my https image, and another pointing to the Google logo. abc.html: <img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'> <img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'> def.php: <?php echo "<img src='https://photos-1.dropbox.com/i/l/EyvpAUN99vGCmWKqw-ywSYXY1L8dPhkloKA5i9I--NM'>"; echo "<img src='http://www.google.co.uk/intl/en_uk/images/logo.gif'>"; exit; Browsing to abc.html shows both images perfectly. Browsing to def.php only shows the Google logo and the other image is broken. It doesn't work on Firefox however someone told me it works on Opera. Ideas please :)
0
9,270,207
02/14/2012 00:42:20
1,189,582
02/04/2012 16:29:34
1
0
Shortest python program to convert from celsius to fahrenheit and vice versa
A challenge for you. A friend and I were having a competition to see who could produce the shortest python program which converted celsius to fahrenheit and vice versa whilst maintaining "some" usability. Here is the shortest code we could come up with: d=input();print'%s'%((d-32)/1.8 if input('c?')else d*1.8+32) Is there any way of making it shorter without removing 'c?' or reducing accuracy?
python
null
null
null
null
02/14/2012 01:28:05
off topic
Shortest python program to convert from celsius to fahrenheit and vice versa === A challenge for you. A friend and I were having a competition to see who could produce the shortest python program which converted celsius to fahrenheit and vice versa whilst maintaining "some" usability. Here is the shortest code we could come up with: d=input();print'%s'%((d-32)/1.8 if input('c?')else d*1.8+32) Is there any way of making it shorter without removing 'c?' or reducing accuracy?
2
10,936,558
06/07/2012 17:10:24
1,442,786
06/07/2012 17:04:09
1
0
Sending Email at specified date in Apex
I'm new to APEX and really only know programming basics. I have a problem at work where I need to create a date picker that will select the day to send an email. The emails are set up to just send and I will need to put in something where it gets the secified date from the date picker and sends the email on that date(using pl/sql).. Was thinking something like: IF Future_Date Not Null then send email on the date selected... Not sure how to set this up
apex-code
null
null
null
null
06/08/2012 21:09:18
not a real question
Sending Email at specified date in Apex === I'm new to APEX and really only know programming basics. I have a problem at work where I need to create a date picker that will select the day to send an email. The emails are set up to just send and I will need to put in something where it gets the secified date from the date picker and sends the email on that date(using pl/sql).. Was thinking something like: IF Future_Date Not Null then send email on the date selected... Not sure how to set this up
1
7,893,235
10/25/2011 17:22:32
1,013,181
10/25/2011 17:00:15
1
0
how to loop use sql xml variable
i want to loop all my xml nodes in sql, and add attribute on the nodes input example: <Customer><FirstName>tom</FirstName><LastName>hamel</LastName></Customer> i want add 'editTime' attribute to the node: FirstName/LastName expected result: <Customer><FirstName editTime='2011-10-25 10:13:13.787'>tom</FirstName><LastName editTime='2011-10-25 10:13:13.787'>hamel</LastName></Customer> please help me about the code in sql?
sql
xml
null
null
null
10/25/2011 21:09:46
not a real question
how to loop use sql xml variable === i want to loop all my xml nodes in sql, and add attribute on the nodes input example: <Customer><FirstName>tom</FirstName><LastName>hamel</LastName></Customer> i want add 'editTime' attribute to the node: FirstName/LastName expected result: <Customer><FirstName editTime='2011-10-25 10:13:13.787'>tom</FirstName><LastName editTime='2011-10-25 10:13:13.787'>hamel</LastName></Customer> please help me about the code in sql?
1
9,945,190
03/30/2012 14:43:59
1,303,508
03/30/2012 14:36:36
1
0
how to upload game into facebook? i am developing game using HTML and javascript and HTML5?
i want to upload a game in HTML using user authentication of Facebook
javascript
html5
facebook-graph-api
null
null
03/30/2012 16:07:41
not a real question
how to upload game into facebook? i am developing game using HTML and javascript and HTML5? === i want to upload a game in HTML using user authentication of Facebook
1
736,041
04/09/2009 21:51:50
80,171
03/19/2009 18:48:05
100
0
Using WiX, how to install single file to (potentially) multiple sub-directories, based on what is available at install time?
I'm using WiX, and would like to know the .wxs necessary to take a file and install it to every available sub-directory of a particular location. This could mean 0 or more final installation locations, determined at install time based on the currently existing directory structure. For example, if I started the install with: \target \subdir-1 \subdir-2 Then at the end of the installation my file would be in \subdir-1 and \subdir-2. If on the other hand these directories did not exist on the system when the install was started, my file would not be installed at all and no sub directories would be created.
wix
null
null
null
null
null
open
Using WiX, how to install single file to (potentially) multiple sub-directories, based on what is available at install time? === I'm using WiX, and would like to know the .wxs necessary to take a file and install it to every available sub-directory of a particular location. This could mean 0 or more final installation locations, determined at install time based on the currently existing directory structure. For example, if I started the install with: \target \subdir-1 \subdir-2 Then at the end of the installation my file would be in \subdir-1 and \subdir-2. If on the other hand these directories did not exist on the system when the install was started, my file would not be installed at all and no sub directories would be created.
0
11,557,713
07/19/2012 09:22:40
774,610
05/28/2011 19:35:10
49
2
Frameworks for: JQuery Mobile + PHP + Mysql + REST
I think a lot of people is in my same situation, but I cannot find nothing really out-of-the-shelf and easy to use.<br/> <b>Frontend</b>: JQuery Mobile application (embedded in PhoneGap in the future).<br/> <b>Backend</b>: RESTful php (or java) APIs with Mysql as database.
php
mysql
rest
jquery-mobile
null
07/20/2012 00:35:29
not a real question
Frameworks for: JQuery Mobile + PHP + Mysql + REST === I think a lot of people is in my same situation, but I cannot find nothing really out-of-the-shelf and easy to use.<br/> <b>Frontend</b>: JQuery Mobile application (embedded in PhoneGap in the future).<br/> <b>Backend</b>: RESTful php (or java) APIs with Mysql as database.
1
11,091,342
06/18/2012 21:26:42
1,347,166
04/20/2012 17:31:59
8
0
Cookies: Default settings for major browsers?
Can anyone tell me what the default settings are for major browsers such as Firefox, Internet Explorer, Google Chrome, Opera, and Safari, or any of them for that matter? Any info would be much appreciated. I'm sorry that it's such a broad question, since I'm sure each version of each browser is different, but I'm having a lot of trouble finding what the default settings are for each. Thanks.
internet-explorer
firefox
google-chrome
cookies
settings
06/19/2012 18:06:47
not a real question
Cookies: Default settings for major browsers? === Can anyone tell me what the default settings are for major browsers such as Firefox, Internet Explorer, Google Chrome, Opera, and Safari, or any of them for that matter? Any info would be much appreciated. I'm sorry that it's such a broad question, since I'm sure each version of each browser is different, but I'm having a lot of trouble finding what the default settings are for each. Thanks.
1
7,195,025
08/25/2011 17:59:20
775,171
05/29/2011 13:40:33
72
0
Cap down/upload speed for a specific user?
I'm thinking about offering shells, but I need to limit people's download/upload speed. Any way of doing this? Going to be using Ubuntu. Thanks.
linux
bash
shell
null
null
08/25/2011 20:46:03
off topic
Cap down/upload speed for a specific user? === I'm thinking about offering shells, but I need to limit people's download/upload speed. Any way of doing this? Going to be using Ubuntu. Thanks.
2
8,836,408
01/12/2012 14:09:20
1,134,639
01/06/2012 15:55:59
1
0
Android TouchRotateActivity.java Example Exec within Fragment; err setting a newTouchSurfaceView
The error arises from the attempt to set a new TouchSurfaceView within the context of the fragment and setting its' setContentView. public class ProfileView_ActivityPlus extends Activity { public static class ProfilePlus extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create our Preview view and set it as the content of our // Activity mGLSurfaceView = new TouchSurfaceView(this); setContentView(mGLSurfaceView); mGLSurfaceView.requestFocus(); mGLSurfaceView.setFocusableInTouchMode(true); } ERROR1:The constructor ProfileView_ActivityPlus.TouchSurfaceView(ProfileView_ActivityPlus.ProfilePlus) is undefined ERROR2:Cannot make a static reference to the non-static method setContentView(View) from the type Activity
android
opengl
null
null
null
null
open
Android TouchRotateActivity.java Example Exec within Fragment; err setting a newTouchSurfaceView === The error arises from the attempt to set a new TouchSurfaceView within the context of the fragment and setting its' setContentView. public class ProfileView_ActivityPlus extends Activity { public static class ProfilePlus extends Fragment { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // Create our Preview view and set it as the content of our // Activity mGLSurfaceView = new TouchSurfaceView(this); setContentView(mGLSurfaceView); mGLSurfaceView.requestFocus(); mGLSurfaceView.setFocusableInTouchMode(true); } ERROR1:The constructor ProfileView_ActivityPlus.TouchSurfaceView(ProfileView_ActivityPlus.ProfilePlus) is undefined ERROR2:Cannot make a static reference to the non-static method setContentView(View) from the type Activity
0
4,015,209
10/25/2010 13:51:15
2,608
08/23/2008 14:39:53
946
23
What's advantages does the Ruby language have over C#?
I'm read a lot of positives about the Ruby language, people who work in it seem to love it. I'm a C# developer and I find C# a superb language to work in. What advantages does Ruby have over C# (preferably with code examples)?
c#
ruby
null
null
null
10/25/2010 13:54:48
not constructive
What's advantages does the Ruby language have over C#? === I'm read a lot of positives about the Ruby language, people who work in it seem to love it. I'm a C# developer and I find C# a superb language to work in. What advantages does Ruby have over C# (preferably with code examples)?
4
9,079,156
01/31/2012 11:58:21
146,588
07/28/2009 18:09:28
1,225
14
How to create concise and manageable search tables?
I have a configuration table that has a number of columns (20+), most of which are nullable. I generally need to search for and identify an individual row, but each search might have different parameters. In other words, search A might request a match on ParamA, ParamF and ParamG, whilst search B might request a match on ParamA, ParamB, ParamE and ParamK. The problem is, with every new column that is added, a whole bunch of new rows are required to provide the configuration for the various permutations. So both the table, and the code side searching mechanism are becoming ugly and unmanageable. What other ways are there to tackle this kind of issue?
c#
java
database
design
search
null
open
How to create concise and manageable search tables? === I have a configuration table that has a number of columns (20+), most of which are nullable. I generally need to search for and identify an individual row, but each search might have different parameters. In other words, search A might request a match on ParamA, ParamF and ParamG, whilst search B might request a match on ParamA, ParamB, ParamE and ParamK. The problem is, with every new column that is added, a whole bunch of new rows are required to provide the configuration for the various permutations. So both the table, and the code side searching mechanism are becoming ugly and unmanageable. What other ways are there to tackle this kind of issue?
0
5,998,053
05/13/2011 21:38:16
20,471
09/22/2008 14:22:51
7,247
413
"Cannot find symbol" for my own class
I do not have a %CLASSPATH% set up. As I understand, this should not be a problem because Javac will assume a classpath of the current directory. As you can see below, javac is unable to find my `Case` class even though it's in the same exact directory. Any thoughts on why this is happening? This code works fine when I use Eclipse. C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>dir /B Case.class Case.java EntryPoint.java C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>javac EntryPoint.java EntryPoint.java:16: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint ArrayList<Case> cases = new ArrayList<Case>(); ^ EntryPoint.java:16: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint ArrayList<Case> cases = new ArrayList<Case>(); ^ EntryPoint.java:24: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint cases.add(new Case(new Integer(count), line)); ^ 3 errors C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>
java
compiler-errors
javac
null
null
null
open
"Cannot find symbol" for my own class === I do not have a %CLASSPATH% set up. As I understand, this should not be a problem because Javac will assume a classpath of the current directory. As you can see below, javac is unable to find my `Case` class even though it's in the same exact directory. Any thoughts on why this is happening? This code works fine when I use Eclipse. C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>dir /B Case.class Case.java EntryPoint.java C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>javac EntryPoint.java EntryPoint.java:16: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint ArrayList<Case> cases = new ArrayList<Case>(); ^ EntryPoint.java:16: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint ArrayList<Case> cases = new ArrayList<Case>(); ^ EntryPoint.java:24: cannot find symbol symbol : class Case location: class codejam2011.Round0.D.EntryPoint cases.add(new Case(new Integer(count), line)); ^ 3 errors C:\Documents and Settings\joep\My Documents\GCJ\src\codejam2011\Round0\D>
0
6,786,044
07/22/2011 05:32:36
854,787
07/20/2011 21:03:02
3
0
JSON Problem in android (objects disappear)
I'm trying to make a small app (an image gallery from images from the web, were the url's I get from the JSON file that I received). The context of JSON looks like that: {"images":{ "yXVak":{ "image_hash":"yXVak", "imgur_page":"http:\/\/imgur.com\/yXVak", "original_image":"http:\/\/imgur.com\/yXVak.gif", "large_thumbnail":"http:\/\/imgur.com\/yXVakl.gif", "small_thumbnail":"http:\/\/imgur.com\/yXVaks.gif", "message":"I didn&#039;t know they made you see THAT well.", "source":" ", "date_popular":"2011-07-18 18:45:05"}, ..... I have about 30 more objects that looks like "yXVak". Now, the problem is, when I'm trying to parse the text, the program can't find the object "yXVak", the exception looks like that: org.json.JSONException: JSONObject["yXVak"] not found. I parse the JSON file like that: jObject = new JSONObject(jString); JSONObject jImages = jObject.getJSONObject("images"); getImages(jImages); getImages function looks like that: JSONObject jHash = jImages.getJSONObject("yXVak") ; String hash = jHash.getString("yXVak"); String page = jHash.getString("http:\\/\\/imgur.com\\/yXVak"); Image[] images = new Image[3]; images[0] = new Image(jHash.getString("original_image"), jHash.getString("http:\\/\\/imgur.com\\/yXVak.gif")); images[1] = new Image(jHash.getString("large_thumbnail"), jHash.getString("http:\\/\\/imgur.com\\/yXVakl.gif")); images[2] = new Image(jHash.getString("small_thumbnail"), jHash.getString("http:\\/\\/imgur.com\\/yXVaks.gif")); String message = jHash.getString("I didn&#039;t know they made you see THAT well."); String source = jHash.getString(" "); String date = jHash.getString("2011-07-18 18:45:05"); listOfImages.add(new ImageHash(hash, page, images, message, source, date)); ... By debugging I found that the jString object looks right (the whole string that in the file), but the jImages object missing two first objects ("yXVak", and the second one that I didn't show here "6k9yE"). Can someone help me with that please, what did I do wrong?
android
json
null
null
null
null
open
JSON Problem in android (objects disappear) === I'm trying to make a small app (an image gallery from images from the web, were the url's I get from the JSON file that I received). The context of JSON looks like that: {"images":{ "yXVak":{ "image_hash":"yXVak", "imgur_page":"http:\/\/imgur.com\/yXVak", "original_image":"http:\/\/imgur.com\/yXVak.gif", "large_thumbnail":"http:\/\/imgur.com\/yXVakl.gif", "small_thumbnail":"http:\/\/imgur.com\/yXVaks.gif", "message":"I didn&#039;t know they made you see THAT well.", "source":" ", "date_popular":"2011-07-18 18:45:05"}, ..... I have about 30 more objects that looks like "yXVak". Now, the problem is, when I'm trying to parse the text, the program can't find the object "yXVak", the exception looks like that: org.json.JSONException: JSONObject["yXVak"] not found. I parse the JSON file like that: jObject = new JSONObject(jString); JSONObject jImages = jObject.getJSONObject("images"); getImages(jImages); getImages function looks like that: JSONObject jHash = jImages.getJSONObject("yXVak") ; String hash = jHash.getString("yXVak"); String page = jHash.getString("http:\\/\\/imgur.com\\/yXVak"); Image[] images = new Image[3]; images[0] = new Image(jHash.getString("original_image"), jHash.getString("http:\\/\\/imgur.com\\/yXVak.gif")); images[1] = new Image(jHash.getString("large_thumbnail"), jHash.getString("http:\\/\\/imgur.com\\/yXVakl.gif")); images[2] = new Image(jHash.getString("small_thumbnail"), jHash.getString("http:\\/\\/imgur.com\\/yXVaks.gif")); String message = jHash.getString("I didn&#039;t know they made you see THAT well."); String source = jHash.getString(" "); String date = jHash.getString("2011-07-18 18:45:05"); listOfImages.add(new ImageHash(hash, page, images, message, source, date)); ... By debugging I found that the jString object looks right (the whole string that in the file), but the jImages object missing two first objects ("yXVak", and the second one that I didn't show here "6k9yE"). Can someone help me with that please, what did I do wrong?
0