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
9,342,612
02/18/2012 15:54:20
1,018,804
10/28/2011 17:12:03
227
28
missing ) after argument list else { - i can't see it?
Pardon for this, i just get this error in console but i can't see it? I may be blind at the moment, anyone please helps me get this error fixed? says: "missing ) after argument list else {" //run the function for all boxes $(".box").each(function () { var thisBox = $(this); var url = thisBox.href; var infoBox = $(".info", thisBox); thisBox.data('height', $(this).height()); thisBox.click(function () { if (!thisBox.hasClass("opened")) { thisBox.addClass("opened"); $("img", box).fadeOut("slow", function () { infoBox.css({ "visibility": "visible", "height": "auto" }); infoBox.load(url, function () { $('.readMore', thisBox).click(function (e) { e.preventDefault(); var selector = $(this).attr('data-filter-all'); $('#container').isotope({ filter: selector }); $('#container').isotope('reloadItems'); return false; }); $('<a href="#" class="closeBox">Close</a>"').appendTo(infoBox).click(function (e) { e.preventDefault(); $("html, body").animate({ scrollTop: 0 }, 500); $('#container').isotope('reLayout'); }); var newHeight = infoBox.outerHeight(true); thisBox.css({ "width": "692", "height": newHeight }); infoBox.animate({ width: 692, height: newHeight }, function () { $('#container').isotope('reLayout', function () { Shadowbox.setup(); thisBox.removeClass("loading"); infoBox.css({ "visibility": "visible" }); var videoSpan = infoBox.find("span.video"); iframe = $('<iframe/>', { 'frameborder': 0, 'class': 'tide', 'width': '692', 'height': '389', 'src': 'http://player.vimeo.com/video/' + videoSpan.data("vimeoid") + '?autoplay=0&api=1' }); videoSpan.replaceWith(iframe); }); }); }); } else { $(".info").empty(); $("img", thisBox).fadeIn("slow"); thisBox.css("width", "230"); thisBox.height(box.data('height')); thisBox.removeClass("opened"); }; }); }); });
javascript
jquery
null
null
null
02/18/2012 16:32:01
too localized
missing ) after argument list else { - i can't see it? === Pardon for this, i just get this error in console but i can't see it? I may be blind at the moment, anyone please helps me get this error fixed? says: "missing ) after argument list else {" //run the function for all boxes $(".box").each(function () { var thisBox = $(this); var url = thisBox.href; var infoBox = $(".info", thisBox); thisBox.data('height', $(this).height()); thisBox.click(function () { if (!thisBox.hasClass("opened")) { thisBox.addClass("opened"); $("img", box).fadeOut("slow", function () { infoBox.css({ "visibility": "visible", "height": "auto" }); infoBox.load(url, function () { $('.readMore', thisBox).click(function (e) { e.preventDefault(); var selector = $(this).attr('data-filter-all'); $('#container').isotope({ filter: selector }); $('#container').isotope('reloadItems'); return false; }); $('<a href="#" class="closeBox">Close</a>"').appendTo(infoBox).click(function (e) { e.preventDefault(); $("html, body").animate({ scrollTop: 0 }, 500); $('#container').isotope('reLayout'); }); var newHeight = infoBox.outerHeight(true); thisBox.css({ "width": "692", "height": newHeight }); infoBox.animate({ width: 692, height: newHeight }, function () { $('#container').isotope('reLayout', function () { Shadowbox.setup(); thisBox.removeClass("loading"); infoBox.css({ "visibility": "visible" }); var videoSpan = infoBox.find("span.video"); iframe = $('<iframe/>', { 'frameborder': 0, 'class': 'tide', 'width': '692', 'height': '389', 'src': 'http://player.vimeo.com/video/' + videoSpan.data("vimeoid") + '?autoplay=0&api=1' }); videoSpan.replaceWith(iframe); }); }); }); } else { $(".info").empty(); $("img", thisBox).fadeIn("slow"); thisBox.css("width", "230"); thisBox.height(box.data('height')); thisBox.removeClass("opened"); }; }); }); });
3
9,890,132
03/27/2012 13:06:45
1,289,949
03/24/2012 12:15:39
1
0
how can create layout and add images view in to layout using base adapter in android
my all images in mimages i want add any layout public class ImageAdapter extends BaseAdapter { private static final Context Context = null; String qrimage; Bitmap bmp, resizedbitmap; Activity activity = null; private static LayoutInflater inflater = null; private ImageView[] mImages; String[] itemimage; TextView[] tv; String itemname; HashMap<String, String> map = new HashMap<String, String>(); public ImageAdapter(Context context, JSONArray imageArrayJson) { this.mImages = new ImageView[imageArrayJson.length()]; try { for (int i = 0; i < imageArrayJson.length(); i++) { JSONObject image = imageArrayJson.getJSONObject(i); qrimage = image.getString("itemimage"); itemname = image.getString("itemname"); map.put("itemname", image.getString("itemname")); System.out.println(itemname); byte[] qrimageBytes = Base64.decode(qrimage.getBytes()); bmp = BitmapFactory.decodeByteArray(qrimageBytes, 0, qrimageBytes.length); int width = 100; int height = 100; resizedbitmap = Bitmap.createScaledBitmap(bmp, width, height, true); mImages[i] = new ImageView(context); mImages[i].setImageBitmap(resizedbitmap); mImages[i].setScaleType(ImageView.ScaleType.FIT_START); inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // tv[i].setText(itemname); } } catch (Exception e) { // TODO: handle exception } } public int getCount() { return mImages.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { } } how can i create layout .how can i add all images to layout..and itemname it contains all items how can i add textview and how can i add same layout in list view i want display images and text in custom layout ..please modify code and send me
android
null
null
null
null
03/28/2012 14:59:39
not a real question
how can create layout and add images view in to layout using base adapter in android === my all images in mimages i want add any layout public class ImageAdapter extends BaseAdapter { private static final Context Context = null; String qrimage; Bitmap bmp, resizedbitmap; Activity activity = null; private static LayoutInflater inflater = null; private ImageView[] mImages; String[] itemimage; TextView[] tv; String itemname; HashMap<String, String> map = new HashMap<String, String>(); public ImageAdapter(Context context, JSONArray imageArrayJson) { this.mImages = new ImageView[imageArrayJson.length()]; try { for (int i = 0; i < imageArrayJson.length(); i++) { JSONObject image = imageArrayJson.getJSONObject(i); qrimage = image.getString("itemimage"); itemname = image.getString("itemname"); map.put("itemname", image.getString("itemname")); System.out.println(itemname); byte[] qrimageBytes = Base64.decode(qrimage.getBytes()); bmp = BitmapFactory.decodeByteArray(qrimageBytes, 0, qrimageBytes.length); int width = 100; int height = 100; resizedbitmap = Bitmap.createScaledBitmap(bmp, width, height, true); mImages[i] = new ImageView(context); mImages[i].setImageBitmap(resizedbitmap); mImages[i].setScaleType(ImageView.ScaleType.FIT_START); inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE); // tv[i].setText(itemname); } } catch (Exception e) { // TODO: handle exception } } public int getCount() { return mImages.length; } public Object getItem(int position) { return position; } public long getItemId(int position) { return position; } public View getView(int position, View convertView, ViewGroup parent) { } } how can i create layout .how can i add all images to layout..and itemname it contains all items how can i add textview and how can i add same layout in list view i want display images and text in custom layout ..please modify code and send me
1
1,748,398
11/17/2009 12:01:01
148,968
08/01/2009 13:58:15
95
3
PHP: is this validity check vulnerable?
I have this code in a page that includes other files via GET request: $page = strtolower($_GET['page']); if(!$page or !$allow[$page] or $page == 'home') { header("Location: home.php"); } where `$allow` is a hardcoded array which contains a list of the allowed strings that are valid files to be included. Am I missing something obvious which would allow some code injection or is this check good enough?
php
code-injection
security
null
null
null
open
PHP: is this validity check vulnerable? === I have this code in a page that includes other files via GET request: $page = strtolower($_GET['page']); if(!$page or !$allow[$page] or $page == 'home') { header("Location: home.php"); } where `$allow` is a hardcoded array which contains a list of the allowed strings that are valid files to be included. Am I missing something obvious which would allow some code injection or is this check good enough?
0
10,912,907
06/06/2012 11:00:57
1,145,246
01/12/2012 10:17:35
38
0
Android in-app billing phonegap plugin was not working
Recently i tried to get work with in-App billing native phonegap plugin. I found <a href="https://github.com/luoihoc/CallbackBillingPlugin">https://github.com/luoihoc/CallbackBillingPlugin</a> native in-app billing plugin. The example app was working fine but when I have tried with my own package name and activity and add that plugin into my own eclipse project. When I tried to compile and run the application I'm always getting 3 errors with "com.opzi.Slotorama.SlotoramaActivity.access$7(SlotoramaActivity.java:394)" "com.opzi.Slotorama.SlotoramaActivity$1.run(SlotoramaActivity.java:384)" Any idea?? Please help
android
plugins
phonegap
in-app-billing
null
06/07/2012 21:10:38
not a real question
Android in-app billing phonegap plugin was not working === Recently i tried to get work with in-App billing native phonegap plugin. I found <a href="https://github.com/luoihoc/CallbackBillingPlugin">https://github.com/luoihoc/CallbackBillingPlugin</a> native in-app billing plugin. The example app was working fine but when I have tried with my own package name and activity and add that plugin into my own eclipse project. When I tried to compile and run the application I'm always getting 3 errors with "com.opzi.Slotorama.SlotoramaActivity.access$7(SlotoramaActivity.java:394)" "com.opzi.Slotorama.SlotoramaActivity$1.run(SlotoramaActivity.java:384)" Any idea?? Please help
1
9,075,662
01/31/2012 07:02:29
330,374
05/01/2010 13:48:17
73
10
What call should I be using instead of this deprecated method?
I have a <i>UITableViewController</i> which creates dynamically re-sizeable cells. The cell changes the size of the cell depending on the text content and the font size. (A tip found here.) It uses a call to the following method which is deprecated: cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; I have not been able to figure out which method to use instead and keeping my functionality. There is no reference in the Apple documentation. How could I solve this?
iphone
ios
cocoa-touch
deprecated
null
02/06/2012 16:50:50
not a real question
What call should I be using instead of this deprecated method? === I have a <i>UITableViewController</i> which creates dynamically re-sizeable cells. The cell changes the size of the cell depending on the text content and the font size. (A tip found here.) It uses a call to the following method which is deprecated: cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; I have not been able to figure out which method to use instead and keeping my functionality. There is no reference in the Apple documentation. How could I solve this?
1
11,183,154
06/25/2012 03:29:04
1,229,925
02/24/2012 04:32:00
1
0
@font not working from fontsquirrel
I'm trying to use this font: http://www.fontsquirrel.com/fontfacedemo/eb-garamond So I download the type kit and placed it in the correct directory. **CSS**: <code> @font-face { font-family: 'EBGaramondSC'; src: url('/EBGaramondSC-webfont.eot'); src: url('/EBGaramondSC-webfont.eot?#iefix') format('embedded-opentype'), url('/EBGaramondSC-webfont.woff') format('woff'), url('/EBGaramondSC-webfont.ttf') format('truetype'), url('/EBGaramondSC-webfont.svg#EBGaramondRegular') format('svg'); font-weight: normal; font-style: normal; } p.style2 {font: 18px/27px 'EBGaramondSC', Arial, sans-serif;} </code> **HTML**: <code> [p class="style2"] Alfab Solutions, LLC is a custom security firm who focuses on rural secruity solutions. We offer rugged, secure camera systems which integrate into our SSL encrypted website. We provide 24/7 access to your security footage, so you can have peace of mind that your assets are safe. [/p] Ignore brackets </code> My website is alfabsolutions dot com Firebug doesn't even show the correct font image. What gives? I have a weird directory structure. The index is .php and it is generated from a template file. So my fonts are in the template directory as they should be since they only affect the html there. http://alfabsolutions.com/templates/EBGaramondSC-webfont.eot all download correctly.
css
html5
font-face
null
null
06/26/2012 14:07:53
too localized
@font not working from fontsquirrel === I'm trying to use this font: http://www.fontsquirrel.com/fontfacedemo/eb-garamond So I download the type kit and placed it in the correct directory. **CSS**: <code> @font-face { font-family: 'EBGaramondSC'; src: url('/EBGaramondSC-webfont.eot'); src: url('/EBGaramondSC-webfont.eot?#iefix') format('embedded-opentype'), url('/EBGaramondSC-webfont.woff') format('woff'), url('/EBGaramondSC-webfont.ttf') format('truetype'), url('/EBGaramondSC-webfont.svg#EBGaramondRegular') format('svg'); font-weight: normal; font-style: normal; } p.style2 {font: 18px/27px 'EBGaramondSC', Arial, sans-serif;} </code> **HTML**: <code> [p class="style2"] Alfab Solutions, LLC is a custom security firm who focuses on rural secruity solutions. We offer rugged, secure camera systems which integrate into our SSL encrypted website. We provide 24/7 access to your security footage, so you can have peace of mind that your assets are safe. [/p] Ignore brackets </code> My website is alfabsolutions dot com Firebug doesn't even show the correct font image. What gives? I have a weird directory structure. The index is .php and it is generated from a template file. So my fonts are in the template directory as they should be since they only affect the html there. http://alfabsolutions.com/templates/EBGaramondSC-webfont.eot all download correctly.
3
7,311,544
09/05/2011 18:22:49
821,110
06/29/2011 12:55:24
91
2
Using Preprocessors to change language Syntax
I read that Objective-C was made by using preprocessor directives to add features of small talk to C, which got me a little curious so I started tinkering with preprocessors in C++, just because I was bored and came up with this: #include <iostream> #include <string> #define Constant const #define Integer int #define Real double #define Boolean bool #define Character char #define String string; #define System system #define StandardLibrary std #define OutputStream cout int main() { Integer i = 1; Integer ii = 2; Integer iii = ii + i; StandardLibrary::OutputStream<<iii; System("pause"); return 0; } So yeah, it's pretty obvious you can change the names using preprocessors, but how is it possible to implement features of one language into another language using preprocessors? I'm not planning to make my own language through this. I'm just curious as to see how it works.
c++
preprocessor
null
null
null
09/05/2011 18:44:56
not a real question
Using Preprocessors to change language Syntax === I read that Objective-C was made by using preprocessor directives to add features of small talk to C, which got me a little curious so I started tinkering with preprocessors in C++, just because I was bored and came up with this: #include <iostream> #include <string> #define Constant const #define Integer int #define Real double #define Boolean bool #define Character char #define String string; #define System system #define StandardLibrary std #define OutputStream cout int main() { Integer i = 1; Integer ii = 2; Integer iii = ii + i; StandardLibrary::OutputStream<<iii; System("pause"); return 0; } So yeah, it's pretty obvious you can change the names using preprocessors, but how is it possible to implement features of one language into another language using preprocessors? I'm not planning to make my own language through this. I'm just curious as to see how it works.
1
9,191,871
02/08/2012 10:52:05
881,112
08/05/2011 18:25:46
36
2
Eclipse Helios - Symfony Plugin
is there any Symfony plugin for Eclipse Helios? i just found this one which apparently just works with Eclipse Indigo https://github.com/pulse00/Symfony-2-Eclipse-Plugin
eclipse
eclipse-plugin
symfony-2.0
null
null
null
open
Eclipse Helios - Symfony Plugin === is there any Symfony plugin for Eclipse Helios? i just found this one which apparently just works with Eclipse Indigo https://github.com/pulse00/Symfony-2-Eclipse-Plugin
0
4,586,160
01/03/2011 16:20:41
341,255
05/14/2010 13:15:52
143
2
Which is the best free ide/plugin for struts2?
I have just learnt struts 2 and now I have taken up a full fledged project in it. I learnt the basics of struts 2 in Netbeans with it's struts2 plugin. But I am not at all happy with it, as it is very basic and I end up doing most of the work. It is obviously better than plain-vanilla text editor, but still not at all near to what netbeans provides for springs and hibernate. I know because netbeans provides native support for springs and hibernate, it is meant to be better. I don't mind changing my IDE if i get better support for struts2! So my questions are - Please list all the free IDEs where native support for struts2 is provided. And if possible please compare them. - Please list all the plugins that are available for eclipse for struts2 development. I have heard there are better plugins in eclipse. - Also, if there are better plugins in any other IDE (other than netbeans or eclipse of course), please list them giving links. - Please give me some tips which I'll need before starting a full blown project in Struts2. I haven't worked on any project on Struts2. I have just finished reading [Struts 2 in Action][1] of Manning publications. Thanking you in advance! regards shahensha [1]: http://www.amazon.com/Struts-2-Action-Don-Brown/dp/193398807X
plugins
ide
struts2
null
null
08/30/2011 13:41:38
not constructive
Which is the best free ide/plugin for struts2? === I have just learnt struts 2 and now I have taken up a full fledged project in it. I learnt the basics of struts 2 in Netbeans with it's struts2 plugin. But I am not at all happy with it, as it is very basic and I end up doing most of the work. It is obviously better than plain-vanilla text editor, but still not at all near to what netbeans provides for springs and hibernate. I know because netbeans provides native support for springs and hibernate, it is meant to be better. I don't mind changing my IDE if i get better support for struts2! So my questions are - Please list all the free IDEs where native support for struts2 is provided. And if possible please compare them. - Please list all the plugins that are available for eclipse for struts2 development. I have heard there are better plugins in eclipse. - Also, if there are better plugins in any other IDE (other than netbeans or eclipse of course), please list them giving links. - Please give me some tips which I'll need before starting a full blown project in Struts2. I haven't worked on any project on Struts2. I have just finished reading [Struts 2 in Action][1] of Manning publications. Thanking you in advance! regards shahensha [1]: http://www.amazon.com/Struts-2-Action-Don-Brown/dp/193398807X
4
3,752,480
09/20/2010 14:37:42
351,126
09/02/2009 08:25:19
334
7
Should loaded images and text be stored in memory or retrieved each time
My app has various pins that drop onto a map and when you click on the pins you get more information about this entity. Each time you click on the entity it retrieves the information from a web service. Should I only retrieve this information once and store it in memory or should I retrieve it each time that page loads? It's a small about of text and 3 small images?
iphone
objective-c
null
null
null
null
open
Should loaded images and text be stored in memory or retrieved each time === My app has various pins that drop onto a map and when you click on the pins you get more information about this entity. Each time you click on the entity it retrieves the information from a web service. Should I only retrieve this information once and store it in memory or should I retrieve it each time that page loads? It's a small about of text and 3 small images?
0
7,664,941
10/05/2011 17:03:11
980,661
10/05/2011 15:16:34
8
0
how to schedule a task (in unix) to start running when the cpu is free?
I have a program to run on a machine that is shared with many other people. I want to time my job and get performance summaries etc so it's important to run the job when the machine is not shared with other jobs. Is there a way to schedule my jobs to start running once the cpu is not occupied with another job? Are there any unix commands for something like this? Currently I'm having to constantly check to see if the machine is free before running my job so something like this would save me a lot of time! ^^
performance
unix
scheduled-tasks
null
null
10/06/2011 01:40:21
off topic
how to schedule a task (in unix) to start running when the cpu is free? === I have a program to run on a machine that is shared with many other people. I want to time my job and get performance summaries etc so it's important to run the job when the machine is not shared with other jobs. Is there a way to schedule my jobs to start running once the cpu is not occupied with another job? Are there any unix commands for something like this? Currently I'm having to constantly check to see if the machine is free before running my job so something like this would save me a lot of time! ^^
2
5,287,709
03/13/2011 05:34:25
590,091
01/26/2011 03:54:36
118
0
Where is MyBatis's Javadoc?
I download MyBatis's and there's a mybatis-3.0.4-javadoc.jar in the folder, I extract and open it, but it's nearly empty. Where can I find the API doc of MyBatis?
mybatis
null
null
null
null
null
open
Where is MyBatis's Javadoc? === I download MyBatis's and there's a mybatis-3.0.4-javadoc.jar in the folder, I extract and open it, but it's nearly empty. Where can I find the API doc of MyBatis?
0
11,659,607
07/25/2012 22:26:54
174,621
09/16/2009 21:15:47
2,265
59
Your bug report form is buggy
Your bug report form deletes text I type into the "apps" field. It also doesn't seem to recognize my tags. In short, your bug report form is buggy to the point of being impossible to use. This is tested to be true on Chrome and Firefox on OSX. PS: Stack Overflow users, I'm sorry for posting this here, but I obviously can't post it on FB's bug report form.
facebook
bug-report
null
null
null
07/25/2012 22:53:20
off topic
Your bug report form is buggy === Your bug report form deletes text I type into the "apps" field. It also doesn't seem to recognize my tags. In short, your bug report form is buggy to the point of being impossible to use. This is tested to be true on Chrome and Firefox on OSX. PS: Stack Overflow users, I'm sorry for posting this here, but I obviously can't post it on FB's bug report form.
2
9,522,689
03/01/2012 19:31:54
1,232,331
02/25/2012 09:33:33
13
0
Python: Making a wordbook to search within
I am writing a code in which I want to search a datafile with words - a wordbook. Just for fun! The idea is to define some letters, and the program will then find words containing the exact input. I have already written the code and succeded, but it really needs some adjustments too give the right output. This is the code block: def findword(): letters = set(str(raw_input("Type letters: "))) for item in wordlist: # already defined list containing the words if letters >= set(item): if len(item) <= len(letters): print item I am using set to compare the letters with the list of words. The problem is that the output can be words containing two of the same letter even though input may only contain one of that specific letter. So how can I make sure the output will be the exact input letters but not arranged the same way? I'd appreciate if you would take the time to help me out with this! Thanks! Alex
python
list
search
word
null
null
open
Python: Making a wordbook to search within === I am writing a code in which I want to search a datafile with words - a wordbook. Just for fun! The idea is to define some letters, and the program will then find words containing the exact input. I have already written the code and succeded, but it really needs some adjustments too give the right output. This is the code block: def findword(): letters = set(str(raw_input("Type letters: "))) for item in wordlist: # already defined list containing the words if letters >= set(item): if len(item) <= len(letters): print item I am using set to compare the letters with the list of words. The problem is that the output can be words containing two of the same letter even though input may only contain one of that specific letter. So how can I make sure the output will be the exact input letters but not arranged the same way? I'd appreciate if you would take the time to help me out with this! Thanks! Alex
0
4,391,414
12/08/2010 19:24:25
76,149
03/10/2009 14:02:54
162
2
Web client classification using Artifical Neural Network
I have a high traffic web site. I want to create software which on-the-fly analyses requests from clients and decide if it is a real user or a botnet bot. To train network to identify "good" users I can use logs when there are no DDoS activity. Then enable program to distinguish real users from bots. What I have: request URI (and order), cookie, user agent, request frequency. Any ideas on how to best design ANN for this task and how to tune it?
artificial-intelligence
neural-network
null
null
null
null
open
Web client classification using Artifical Neural Network === I have a high traffic web site. I want to create software which on-the-fly analyses requests from clients and decide if it is a real user or a botnet bot. To train network to identify "good" users I can use logs when there are no DDoS activity. Then enable program to distinguish real users from bots. What I have: request URI (and order), cookie, user agent, request frequency. Any ideas on how to best design ANN for this task and how to tune it?
0
3,295,253
07/20/2010 23:40:17
77,784
03/13/2009 16:03:33
603
47
How to aggregate outputs from a dynamically generated set of projects into a single folder.
I need to collect into a single folder all test assemblies, with their dependencies, and configuration files. The process should preserve the directory structure from the output of each test project. We have a solution that requires manually attaching test projects to a master project, but our solution has far too many projects for this to be maintainable. These should be located automatically based on naming convention (x.UnitTest.csproj, y.IntegrationTest.csproj). For background, we are working with a build system that passes artifacts (binaries, etc) between agents. We are compiling on one agent, and testing on other agents. The massive duplication of assemblies between test projects is slowing the build process down. What I have done: 1) I have a csproj that references most of the test projects. This gets binaries and dependencies into one folder. 2) I am able to identify all files to copy using this <CreateItem Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)$(OutDir)*.config"> <Output TaskParameter="Include" ItemName="TestConfigurationFiles"/> </CreateItem> <Copy SourceFiles="@(TestConfigurationFiles)" DestinationFolder="$(OutDir)"> </Copy> I've attempted most obvious things, such as - MsBuild task: RebaseOutputs attribute, overriding the OutDir property. I can provide the msbuild task with a dynamically generated set of outputs, but can only build them in their default folder. - Hooking into the TargetOutputs of msbuild task gives only the primary output assembly (without dependencies). - I experimented with "Copy Always" for configuration files. This puts them in the output directory of the dependent project as "app.config" not "dllname.config", and not in the final project. Solutions that could make this better might include - Provide an example of adding to the projectreference item array dynamically, before compilation. - Use msbuild TargetOutputs to create a list of all files in the folder (instead of just the primary output) and copy to a destination folder. Today I'm using msbuild 3.5. Ideally the solution would work with msbuild 3.5. We are transitioning to .NET 4 / MsBuild 4 soon, so, if must be done in .Net 4, that is fine.
msbuild
continuous-integration
teamcity
null
null
null
open
How to aggregate outputs from a dynamically generated set of projects into a single folder. === I need to collect into a single folder all test assemblies, with their dependencies, and configuration files. The process should preserve the directory structure from the output of each test project. We have a solution that requires manually attaching test projects to a master project, but our solution has far too many projects for this to be maintainable. These should be located automatically based on naming convention (x.UnitTest.csproj, y.IntegrationTest.csproj). For background, we are working with a build system that passes artifacts (binaries, etc) between agents. We are compiling on one agent, and testing on other agents. The massive duplication of assemblies between test projects is slowing the build process down. What I have done: 1) I have a csproj that references most of the test projects. This gets binaries and dependencies into one folder. 2) I am able to identify all files to copy using this <CreateItem Include="%(ProjectReference.RootDir)%(ProjectReference.Directory)$(OutDir)*.config"> <Output TaskParameter="Include" ItemName="TestConfigurationFiles"/> </CreateItem> <Copy SourceFiles="@(TestConfigurationFiles)" DestinationFolder="$(OutDir)"> </Copy> I've attempted most obvious things, such as - MsBuild task: RebaseOutputs attribute, overriding the OutDir property. I can provide the msbuild task with a dynamically generated set of outputs, but can only build them in their default folder. - Hooking into the TargetOutputs of msbuild task gives only the primary output assembly (without dependencies). - I experimented with "Copy Always" for configuration files. This puts them in the output directory of the dependent project as "app.config" not "dllname.config", and not in the final project. Solutions that could make this better might include - Provide an example of adding to the projectreference item array dynamically, before compilation. - Use msbuild TargetOutputs to create a list of all files in the folder (instead of just the primary output) and copy to a destination folder. Today I'm using msbuild 3.5. Ideally the solution would work with msbuild 3.5. We are transitioning to .NET 4 / MsBuild 4 soon, so, if must be done in .Net 4, that is fine.
0
1,156,443
07/20/2009 23:06:24
5,302
09/08/2008 22:49:47
2,344
87
Handling a multi-dimensional data structure in .Net 3.5 and above
I want to build a 2 dimensional (non ragged at this point) object array. I can easily build a 2 dimensional Array[,], and will do so if it is the best option available, but have tended to avoid arrays in favour of the advanced functionality of .NET's List and Dictionary structures. I could also use a List&lt;List&lt;T&gt;&gt; to store a 2 dimensional array, but was wondering if there was any best-practice or implemented data structures in .NET 3.5 or above to handle Typed 2 - n dimensional structures with more flexible / comprehensive functionality than an array? I am not interested in SSAS/OLAP style answers.
.net
arrays
null
null
null
null
open
Handling a multi-dimensional data structure in .Net 3.5 and above === I want to build a 2 dimensional (non ragged at this point) object array. I can easily build a 2 dimensional Array[,], and will do so if it is the best option available, but have tended to avoid arrays in favour of the advanced functionality of .NET's List and Dictionary structures. I could also use a List&lt;List&lt;T&gt;&gt; to store a 2 dimensional array, but was wondering if there was any best-practice or implemented data structures in .NET 3.5 or above to handle Typed 2 - n dimensional structures with more flexible / comprehensive functionality than an array? I am not interested in SSAS/OLAP style answers.
0
464,960
01/21/2009 11:47:03
29,903
10/21/2008 09:43:20
1,195
53
Code golf: combining multiple sorted lists into a single sorted list
Implement an algorithm to merge an arbitrary number of sorted lists into one sorted list. The aim is to create the smallest working programme, in whatever language you like. For example: input: ((1, 4, 7), (2, 5, 8), (3, 6, 9)) output: (1, 2, 3, 4, 5, 6, 7, 8, 9) input: ((1, 10), (), (2, 5, 6, 7)) output: (1, 2, 5, 6, 7, 10) **Note**: solutions which concatenate the input lists then use a language-provided sort function are not in-keeping with the spirit of golf, and will not be accepted: import operator sorted(reduce(operator.add, l)) # cheating: out of bounds! Apart from anything else, your algorithm *should* be (but doesn't have to be) a lot faster! Clearly state the language, any foibles and the character count. Only include meaningful characters in the count, but feel free to add whitespace to the code for artistic / readability purposes. To keep things tidy, suggest improvement in comments or by editing answers where appropriate, rather than creating a new answer for each "revision". ---------- Inspired by http://stackoverflow.com/questions/464342/combining-two-sorted-lists-in-python
code-golf
algorithm
sorting
merge
language-agnostic
null
open
Code golf: combining multiple sorted lists into a single sorted list === Implement an algorithm to merge an arbitrary number of sorted lists into one sorted list. The aim is to create the smallest working programme, in whatever language you like. For example: input: ((1, 4, 7), (2, 5, 8), (3, 6, 9)) output: (1, 2, 3, 4, 5, 6, 7, 8, 9) input: ((1, 10), (), (2, 5, 6, 7)) output: (1, 2, 5, 6, 7, 10) **Note**: solutions which concatenate the input lists then use a language-provided sort function are not in-keeping with the spirit of golf, and will not be accepted: import operator sorted(reduce(operator.add, l)) # cheating: out of bounds! Apart from anything else, your algorithm *should* be (but doesn't have to be) a lot faster! Clearly state the language, any foibles and the character count. Only include meaningful characters in the count, but feel free to add whitespace to the code for artistic / readability purposes. To keep things tidy, suggest improvement in comments or by editing answers where appropriate, rather than creating a new answer for each "revision". ---------- Inspired by http://stackoverflow.com/questions/464342/combining-two-sorted-lists-in-python
0
8,828,470
01/11/2012 23:59:46
381,422
07/01/2010 18:49:03
463
18
What are some potential flaws in my design plan?
I have a website that I'm converting into a web application for iOS and Android. I'm using PhoneGap to create native apps that simply point to the website. (Sidenote: The benefit of having the native app shells, as opposed to simply a homescreen icon to the web app, is that we can use Urban Airship to use push notifications and get usage statistics. ) I want the user to have the ability to use the application offline, at least somewhat. My idea for that is to use HTML5's application cache (cache manifest) to store pages locally on the device and update when the cache is invalidated (when online). 1. [This question][1] indicates that I might run into troubles getting this to work in iOS. Is the HTML5 application cache supported in Android, similarly? 2. The application cache allows explicit pages to be specified for caching, which will happen as soon as the device goes online. I want to use this to our advantage and have every article that the user has "favorited" to be explicitly cached for offline viewing. Can this be accomplished via dynamically serving the cache manifest file? 3. What other issues might I have implementing this design? [1]: http://stackoverflow.com/questions/1540240/html5-cache-manifest-in-a-uiwebview
html5
design
caching
mobile
null
01/14/2012 00:04:09
not a real question
What are some potential flaws in my design plan? === I have a website that I'm converting into a web application for iOS and Android. I'm using PhoneGap to create native apps that simply point to the website. (Sidenote: The benefit of having the native app shells, as opposed to simply a homescreen icon to the web app, is that we can use Urban Airship to use push notifications and get usage statistics. ) I want the user to have the ability to use the application offline, at least somewhat. My idea for that is to use HTML5's application cache (cache manifest) to store pages locally on the device and update when the cache is invalidated (when online). 1. [This question][1] indicates that I might run into troubles getting this to work in iOS. Is the HTML5 application cache supported in Android, similarly? 2. The application cache allows explicit pages to be specified for caching, which will happen as soon as the device goes online. I want to use this to our advantage and have every article that the user has "favorited" to be explicitly cached for offline viewing. Can this be accomplished via dynamically serving the cache manifest file? 3. What other issues might I have implementing this design? [1]: http://stackoverflow.com/questions/1540240/html5-cache-manifest-in-a-uiwebview
1
10,703,082
05/22/2012 13:30:41
541,597
12/14/2010 07:12:49
532
3
WebException not being caught by catch statement
try { this.Invoke((MethodInvoker)delegate { Uri uri = new Uri("mywebpage.com"); NetworkCredential credentials = new NetworkCredential("username", "password"); byte[] lnBuffer; byte[] lnFile; HttpWebRequest lxRequest = (HttpWebRequest)WebRequest.Create(uri); lxRequest.Credentials = credentials; // the line below throws a webexception that for some reason is not being caught by my webexception catch statement. using (HttpWebResponse lxResponse = (HttpWebResponse)lxRequest.GetResponse()) { using (BinaryReader lxBR = new BinaryReader(lxResponse.GetResponseStream())) { using (MemoryStream lxMS = new MemoryStream()) { lnBuffer = lxBR.ReadBytes(1024); while (lnBuffer.Length > 0) { lxMS.Write(lnBuffer, 0, lnBuffer.Length); lnBuffer = lxBR.ReadBytes(1024); } lnFile = new byte[(int)lxMS.Length]; lxMS.Position = 0; lxMS.Read(lnFile, 0, lnFile.Length); lxMS.Close(); lxBR.Close(); } } lxResponse.Close(); } using (MemoryStream lxFS = new MemoryStream(lnFile)) { lxFS.Write(lnFile, 0, lnFile.Length); lxFS.Position = 0; Image resizedimage = new Bitmap(Image.FromStream(lxFS), new Size(320, 240)); pictureBox23.Image = resizedimage; // otherform.picboximage = Image.FromStream(lxFS); lxFS.Close(); } }); } catch (WebException e) { this.Close(); } catch (InvalidOperationException e) { this.Close(); } the line with the comment above it throws a web exception however my catch statement for webexceptions is not catching it. Any ideas? Thanks
c#
null
null
null
null
null
open
WebException not being caught by catch statement === try { this.Invoke((MethodInvoker)delegate { Uri uri = new Uri("mywebpage.com"); NetworkCredential credentials = new NetworkCredential("username", "password"); byte[] lnBuffer; byte[] lnFile; HttpWebRequest lxRequest = (HttpWebRequest)WebRequest.Create(uri); lxRequest.Credentials = credentials; // the line below throws a webexception that for some reason is not being caught by my webexception catch statement. using (HttpWebResponse lxResponse = (HttpWebResponse)lxRequest.GetResponse()) { using (BinaryReader lxBR = new BinaryReader(lxResponse.GetResponseStream())) { using (MemoryStream lxMS = new MemoryStream()) { lnBuffer = lxBR.ReadBytes(1024); while (lnBuffer.Length > 0) { lxMS.Write(lnBuffer, 0, lnBuffer.Length); lnBuffer = lxBR.ReadBytes(1024); } lnFile = new byte[(int)lxMS.Length]; lxMS.Position = 0; lxMS.Read(lnFile, 0, lnFile.Length); lxMS.Close(); lxBR.Close(); } } lxResponse.Close(); } using (MemoryStream lxFS = new MemoryStream(lnFile)) { lxFS.Write(lnFile, 0, lnFile.Length); lxFS.Position = 0; Image resizedimage = new Bitmap(Image.FromStream(lxFS), new Size(320, 240)); pictureBox23.Image = resizedimage; // otherform.picboximage = Image.FromStream(lxFS); lxFS.Close(); } }); } catch (WebException e) { this.Close(); } catch (InvalidOperationException e) { this.Close(); } the line with the comment above it throws a web exception however my catch statement for webexceptions is not catching it. Any ideas? Thanks
0
5,790,716
04/26/2011 12:59:01
725,410
04/26/2011 12:59:01
1
0
SEO - doubt in first result of google search
how to add sub links below the url if my website is the first result in google search. For e.g., if you type gmail in google search bar below the url you can see seven sub links that ends with *more results from google.com*
search
google
seo
engine
null
04/26/2011 13:31:11
off topic
SEO - doubt in first result of google search === how to add sub links below the url if my website is the first result in google search. For e.g., if you type gmail in google search bar below the url you can see seven sub links that ends with *more results from google.com*
2
11,666,221
07/26/2012 09:23:49
1,346,025
04/20/2012 08:24:37
7
0
Embed lua as scripting method in vb.net application
Can someone point me the steps to include a multiline texbot, where i can use lua in my application as a scripting feature, what do i need to import and how to do it, theres a few tutorials about c#, theres almost nothing about vb.net i tried to include it but i cant import lua into the vb.net or well im not doing it properly, if any one could help me. thanks in advance
vb.net
script
lua
embed
null
07/26/2012 20:16:29
not a real question
Embed lua as scripting method in vb.net application === Can someone point me the steps to include a multiline texbot, where i can use lua in my application as a scripting feature, what do i need to import and how to do it, theres a few tutorials about c#, theres almost nothing about vb.net i tried to include it but i cant import lua into the vb.net or well im not doing it properly, if any one could help me. thanks in advance
1
309,282
11/21/2008 16:13:46
21,632
09/24/2008 12:13:26
4,787
167
What are the worst metaphors in computer science and engineering?
We recently had this question about our [favorite metaphors][1], but in my experience, whether we like them or not, the Computer Science/Engineering field is full of metaphors that range wildly in appropriateness. For example, although it never bothered me, I had a computer science professor in my undergrad days who hated the word "partition" in reference to hard drives. In his opinion, a "partition" was a fence or divider, but a hard disk partition referred to the actual space between the dividers. Go figure. Being reminded of the prevalence of metaphors in our field, I wanted to ask the community, what are (in your opinion) some of the worst metaphors in information technology? [1]: http://stackoverflow.com/questions/274054/what-are-your-favorite-metaphors-for-technical-concepts
non-technical
fun
null
null
null
09/27/2011 05:15:54
not constructive
What are the worst metaphors in computer science and engineering? === We recently had this question about our [favorite metaphors][1], but in my experience, whether we like them or not, the Computer Science/Engineering field is full of metaphors that range wildly in appropriateness. For example, although it never bothered me, I had a computer science professor in my undergrad days who hated the word "partition" in reference to hard drives. In his opinion, a "partition" was a fence or divider, but a hard disk partition referred to the actual space between the dividers. Go figure. Being reminded of the prevalence of metaphors in our field, I wanted to ask the community, what are (in your opinion) some of the worst metaphors in information technology? [1]: http://stackoverflow.com/questions/274054/what-are-your-favorite-metaphors-for-technical-concepts
4
6,222,142
06/03/2011 01:36:57
683,387
03/30/2011 06:19:28
3
0
Using CGDataProviderCreateWithData callback
I'm using CGDataProviderCreateWithData to (eventually) create a UIImage from a malloced array of bytes. I call CGDataProviderCreateWithData like this: provider = CGDataProviderCreateWithData(NULL, dataPtr, dataLen, callbackFunc); where dataPtr is the previously malloced array of data bytes for the image, dataLen is the number of bytes in the dataPtr array, and callbackFunc is as described in the CGDataProviderCreateWithData documentation: void callbackFunc(void *info, const void *data, size_t size); The callback function is called when the data provider is released so I could free() dataPtr there, but I may want to continue using it (dataPtr) and at some later stage free it. This block of code will be called multiple times, and the flow will look something like: 1. malloc(dataPtr) 2. create image (call CGDataProviderCreateWithData etc) 3. display image 4. release image (and so release data provider created by CGDataProviderCreateWithData) 5. continue to use dataPtr 6. free(dataPtr) so 1..6 may be executed multiple times. I don't want dataPtr hanging around for the entire execution of the program (and it may change in size anyway), so I want to malloc/free it as necessary. The problem is that I can't free(dataPtr) in the callback from CGDataProviderCreateWithData because I still want to use it, so I want to free it some time later - and I can't free it until I know that the data provider no longer needs it (as far as I can tell CGDataProviderCreateWithData uses the array I pass, it doesn't take a copy). I can't do (1) above until I know it is ok to free and re-malloc dataPtr, so what I really want to do is block waiting for the data provider to be freed (well, I want to know whether I should re-enter the 1..6 block of code, which I can't do until the data provider is freed). It will be - I create the data provider, create the image and immediately display it and release the data provider. The trouble is that the data provider isn't actually released until the UIImage is released and is finished with it. I'm reasonably new to objective-c and iOS. Am I missing something obvious?
iphone
objective-c
null
null
null
null
open
Using CGDataProviderCreateWithData callback === I'm using CGDataProviderCreateWithData to (eventually) create a UIImage from a malloced array of bytes. I call CGDataProviderCreateWithData like this: provider = CGDataProviderCreateWithData(NULL, dataPtr, dataLen, callbackFunc); where dataPtr is the previously malloced array of data bytes for the image, dataLen is the number of bytes in the dataPtr array, and callbackFunc is as described in the CGDataProviderCreateWithData documentation: void callbackFunc(void *info, const void *data, size_t size); The callback function is called when the data provider is released so I could free() dataPtr there, but I may want to continue using it (dataPtr) and at some later stage free it. This block of code will be called multiple times, and the flow will look something like: 1. malloc(dataPtr) 2. create image (call CGDataProviderCreateWithData etc) 3. display image 4. release image (and so release data provider created by CGDataProviderCreateWithData) 5. continue to use dataPtr 6. free(dataPtr) so 1..6 may be executed multiple times. I don't want dataPtr hanging around for the entire execution of the program (and it may change in size anyway), so I want to malloc/free it as necessary. The problem is that I can't free(dataPtr) in the callback from CGDataProviderCreateWithData because I still want to use it, so I want to free it some time later - and I can't free it until I know that the data provider no longer needs it (as far as I can tell CGDataProviderCreateWithData uses the array I pass, it doesn't take a copy). I can't do (1) above until I know it is ok to free and re-malloc dataPtr, so what I really want to do is block waiting for the data provider to be freed (well, I want to know whether I should re-enter the 1..6 block of code, which I can't do until the data provider is freed). It will be - I create the data provider, create the image and immediately display it and release the data provider. The trouble is that the data provider isn't actually released until the UIImage is released and is finished with it. I'm reasonably new to objective-c and iOS. Am I missing something obvious?
0
10,383,752
04/30/2012 12:30:44
372,832
06/22/2010 06:03:31
6
0
VST SDK & VST Module SDK
i wanted to create a Pattern oriented VST MIDI plugin with an editor (no audio processing, just a UI editor with a powerful pattern editor and randomizer). i've read the **terrible** VST and VST module SDK documentation. I hope some of you can answer my questions: - Did i get this right: the VST SDK is for audio effects and instruments only whereas the VST module SDK is for MIDI effects only? - None of the samples of the VST module SDK is running (they require VSTGUI which is not in the VST module SDK. I tried to use VSTUI from: SDK 2.4, SDK 3.5.1 or the VSTGUI.sf but i can't compile it. It ends up with tons of errors. Anyone there which can point me in the right direction? thx
c++
vst
null
null
null
null
open
VST SDK & VST Module SDK === i wanted to create a Pattern oriented VST MIDI plugin with an editor (no audio processing, just a UI editor with a powerful pattern editor and randomizer). i've read the **terrible** VST and VST module SDK documentation. I hope some of you can answer my questions: - Did i get this right: the VST SDK is for audio effects and instruments only whereas the VST module SDK is for MIDI effects only? - None of the samples of the VST module SDK is running (they require VSTGUI which is not in the VST module SDK. I tried to use VSTUI from: SDK 2.4, SDK 3.5.1 or the VSTGUI.sf but i can't compile it. It ends up with tons of errors. Anyone there which can point me in the right direction? thx
0
1,854,328
12/06/2009 04:13:05
107,178
05/14/2009 15:54:53
23
1
Codaset, Codebasehq, Unfuddle, Trac or Redmine?
I have a handful of small Git repositories I would like to host remotely. They're all private projects, most of them in Java. Codaset, Codebasehq, Unfuddle, Trac, Redmine.. There seems to be an abundance of solutions out there. They're all packed with features and useful functionality. Putting aside pricing and the glossy layouts, what is the best way of comparing these options?
git
repository
redmine
trac
null
05/22/2011 10:48:28
off topic
Codaset, Codebasehq, Unfuddle, Trac or Redmine? === I have a handful of small Git repositories I would like to host remotely. They're all private projects, most of them in Java. Codaset, Codebasehq, Unfuddle, Trac, Redmine.. There seems to be an abundance of solutions out there. They're all packed with features and useful functionality. Putting aside pricing and the glossy layouts, what is the best way of comparing these options?
2
5,069,248
02/21/2011 17:36:33
610,165
02/09/2011 17:36:44
3
0
I Need Opinions Regarding Building a Virtual Classroom
I want to build a website that represents a simple virtual class in which the teacher uses a webcam to record his lesson and the students can watch the lesson live (while its being recorded), the whole idea is easy because I don't need any other features (the students just sign in and watch) and the teacher (just signs in as Tutor and records). Now what I have to say is that I have a good programming experience using C#.net and some WPF but I want to know how to do it the best way that would make it as fast as possible so that the image doens't flicker, should I use WCF ? should I use ASP.Net ? what should I use ? and can you give me a very very very brief description of the steps I have to do while developing this project. Thanks verymuch for everyone . . .
asp.net
wcf
asp
null
null
11/23/2011 19:15:52
not constructive
I Need Opinions Regarding Building a Virtual Classroom === I want to build a website that represents a simple virtual class in which the teacher uses a webcam to record his lesson and the students can watch the lesson live (while its being recorded), the whole idea is easy because I don't need any other features (the students just sign in and watch) and the teacher (just signs in as Tutor and records). Now what I have to say is that I have a good programming experience using C#.net and some WPF but I want to know how to do it the best way that would make it as fast as possible so that the image doens't flicker, should I use WCF ? should I use ASP.Net ? what should I use ? and can you give me a very very very brief description of the steps I have to do while developing this project. Thanks verymuch for everyone . . .
4
9,647,064
03/10/2012 14:07:57
983,223
10/07/2011 00:59:30
58
2
run c program - stdio.h where do i get it?
Looking into learning C. As I understand it when I say `#include <stdio.h>` it grabs stdio.h from the default location...usually a directory inside your working directory called include. How do I actually get the file stdio.h? Do I need to download a bunch of .h files and move them from project to project inside the include directory? I did the following in a test.c file. I then ran make test and it outputted a binary. When I ran ./test I did not see hello print onto my screen. I thought I wasn't seeing output maybe because it doesn't find the stdio.h library. But then again if I remove the greater than or less than signs in stdio the compiler gives me an error. Any ideas? I'm on a Mac running this from the command line. I am using: GNU Make 3.81. This program built for i386-apple-darwin10.0 #include <stdio.h> main() { printf("hello"); }
c
unix
make
null
null
null
open
run c program - stdio.h where do i get it? === Looking into learning C. As I understand it when I say `#include <stdio.h>` it grabs stdio.h from the default location...usually a directory inside your working directory called include. How do I actually get the file stdio.h? Do I need to download a bunch of .h files and move them from project to project inside the include directory? I did the following in a test.c file. I then ran make test and it outputted a binary. When I ran ./test I did not see hello print onto my screen. I thought I wasn't seeing output maybe because it doesn't find the stdio.h library. But then again if I remove the greater than or less than signs in stdio the compiler gives me an error. Any ideas? I'm on a Mac running this from the command line. I am using: GNU Make 3.81. This program built for i386-apple-darwin10.0 #include <stdio.h> main() { printf("hello"); }
0
11,523,844
07/17/2012 13:45:43
1,512,195
07/09/2012 14:08:30
7
0
802.11 FCS (CRC32)
Is the below code correctly calculating the FCS value of wireless frames?<br /> Because the value produced by the below code does not match the value shown by wireshark. const uint32_t crctable[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL }; uint32_t crc32(uint32_t bytes_sz, const uint8_t *bytes) { uint32_t crc = ~0; uint32_t i; for(i = 0; i < bytes_sz; ++i) { crc = crctable[(crc ^ bytes[i]) & 0xff] ^ (crc >> 8); } return ~crc; } <br /> I am calling the above function in the following manner: uint32_t crc = crc32(header->len - 4, packet); <br /> where header is of type: struct pcap_pkthdr *header; The header information is handled by pcap callback: void my_callback(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) I got the code for crc32() and crctable[] from [this link][1] [1]: http://code.google.com/p/banjax/source/browse/trunk/lib/net/crc32.cpp?spec=svn34&r=34
c
pcap
libpcap
crc32
null
07/19/2012 03:11:50
not a real question
802.11 FCS (CRC32) === Is the below code correctly calculating the FCS value of wireless frames?<br /> Because the value produced by the below code does not match the value shown by wireshark. const uint32_t crctable[] = { 0x00000000L, 0x77073096L, 0xee0e612cL, 0x990951baL, 0x076dc419L, 0x706af48fL, 0xe963a535L, 0x9e6495a3L, 0x0edb8832L, 0x79dcb8a4L, 0xe0d5e91eL, 0x97d2d988L, 0x09b64c2bL, 0x7eb17cbdL, 0xe7b82d07L, 0x90bf1d91L, 0x1db71064L, 0x6ab020f2L, 0xf3b97148L, 0x84be41deL, 0x1adad47dL, 0x6ddde4ebL, 0xf4d4b551L, 0x83d385c7L, 0x136c9856L, 0x646ba8c0L, 0xfd62f97aL, 0x8a65c9ecL, 0x14015c4fL, 0x63066cd9L, 0xfa0f3d63L, 0x8d080df5L, 0x3b6e20c8L, 0x4c69105eL, 0xd56041e4L, 0xa2677172L, 0x3c03e4d1L, 0x4b04d447L, 0xd20d85fdL, 0xa50ab56bL, 0x35b5a8faL, 0x42b2986cL, 0xdbbbc9d6L, 0xacbcf940L, 0x32d86ce3L, 0x45df5c75L, 0xdcd60dcfL, 0xabd13d59L, 0x26d930acL, 0x51de003aL, 0xc8d75180L, 0xbfd06116L, 0x21b4f4b5L, 0x56b3c423L, 0xcfba9599L, 0xb8bda50fL, 0x2802b89eL, 0x5f058808L, 0xc60cd9b2L, 0xb10be924L, 0x2f6f7c87L, 0x58684c11L, 0xc1611dabL, 0xb6662d3dL, 0x76dc4190L, 0x01db7106L, 0x98d220bcL, 0xefd5102aL, 0x71b18589L, 0x06b6b51fL, 0x9fbfe4a5L, 0xe8b8d433L, 0x7807c9a2L, 0x0f00f934L, 0x9609a88eL, 0xe10e9818L, 0x7f6a0dbbL, 0x086d3d2dL, 0x91646c97L, 0xe6635c01L, 0x6b6b51f4L, 0x1c6c6162L, 0x856530d8L, 0xf262004eL, 0x6c0695edL, 0x1b01a57bL, 0x8208f4c1L, 0xf50fc457L, 0x65b0d9c6L, 0x12b7e950L, 0x8bbeb8eaL, 0xfcb9887cL, 0x62dd1ddfL, 0x15da2d49L, 0x8cd37cf3L, 0xfbd44c65L, 0x4db26158L, 0x3ab551ceL, 0xa3bc0074L, 0xd4bb30e2L, 0x4adfa541L, 0x3dd895d7L, 0xa4d1c46dL, 0xd3d6f4fbL, 0x4369e96aL, 0x346ed9fcL, 0xad678846L, 0xda60b8d0L, 0x44042d73L, 0x33031de5L, 0xaa0a4c5fL, 0xdd0d7cc9L, 0x5005713cL, 0x270241aaL, 0xbe0b1010L, 0xc90c2086L, 0x5768b525L, 0x206f85b3L, 0xb966d409L, 0xce61e49fL, 0x5edef90eL, 0x29d9c998L, 0xb0d09822L, 0xc7d7a8b4L, 0x59b33d17L, 0x2eb40d81L, 0xb7bd5c3bL, 0xc0ba6cadL, 0xedb88320L, 0x9abfb3b6L, 0x03b6e20cL, 0x74b1d29aL, 0xead54739L, 0x9dd277afL, 0x04db2615L, 0x73dc1683L, 0xe3630b12L, 0x94643b84L, 0x0d6d6a3eL, 0x7a6a5aa8L, 0xe40ecf0bL, 0x9309ff9dL, 0x0a00ae27L, 0x7d079eb1L, 0xf00f9344L, 0x8708a3d2L, 0x1e01f268L, 0x6906c2feL, 0xf762575dL, 0x806567cbL, 0x196c3671L, 0x6e6b06e7L, 0xfed41b76L, 0x89d32be0L, 0x10da7a5aL, 0x67dd4accL, 0xf9b9df6fL, 0x8ebeeff9L, 0x17b7be43L, 0x60b08ed5L, 0xd6d6a3e8L, 0xa1d1937eL, 0x38d8c2c4L, 0x4fdff252L, 0xd1bb67f1L, 0xa6bc5767L, 0x3fb506ddL, 0x48b2364bL, 0xd80d2bdaL, 0xaf0a1b4cL, 0x36034af6L, 0x41047a60L, 0xdf60efc3L, 0xa867df55L, 0x316e8eefL, 0x4669be79L, 0xcb61b38cL, 0xbc66831aL, 0x256fd2a0L, 0x5268e236L, 0xcc0c7795L, 0xbb0b4703L, 0x220216b9L, 0x5505262fL, 0xc5ba3bbeL, 0xb2bd0b28L, 0x2bb45a92L, 0x5cb36a04L, 0xc2d7ffa7L, 0xb5d0cf31L, 0x2cd99e8bL, 0x5bdeae1dL, 0x9b64c2b0L, 0xec63f226L, 0x756aa39cL, 0x026d930aL, 0x9c0906a9L, 0xeb0e363fL, 0x72076785L, 0x05005713L, 0x95bf4a82L, 0xe2b87a14L, 0x7bb12baeL, 0x0cb61b38L, 0x92d28e9bL, 0xe5d5be0dL, 0x7cdcefb7L, 0x0bdbdf21L, 0x86d3d2d4L, 0xf1d4e242L, 0x68ddb3f8L, 0x1fda836eL, 0x81be16cdL, 0xf6b9265bL, 0x6fb077e1L, 0x18b74777L, 0x88085ae6L, 0xff0f6a70L, 0x66063bcaL, 0x11010b5cL, 0x8f659effL, 0xf862ae69L, 0x616bffd3L, 0x166ccf45L, 0xa00ae278L, 0xd70dd2eeL, 0x4e048354L, 0x3903b3c2L, 0xa7672661L, 0xd06016f7L, 0x4969474dL, 0x3e6e77dbL, 0xaed16a4aL, 0xd9d65adcL, 0x40df0b66L, 0x37d83bf0L, 0xa9bcae53L, 0xdebb9ec5L, 0x47b2cf7fL, 0x30b5ffe9L, 0xbdbdf21cL, 0xcabac28aL, 0x53b39330L, 0x24b4a3a6L, 0xbad03605L, 0xcdd70693L, 0x54de5729L, 0x23d967bfL, 0xb3667a2eL, 0xc4614ab8L, 0x5d681b02L, 0x2a6f2b94L, 0xb40bbe37L, 0xc30c8ea1L, 0x5a05df1bL, 0x2d02ef8dL }; uint32_t crc32(uint32_t bytes_sz, const uint8_t *bytes) { uint32_t crc = ~0; uint32_t i; for(i = 0; i < bytes_sz; ++i) { crc = crctable[(crc ^ bytes[i]) & 0xff] ^ (crc >> 8); } return ~crc; } <br /> I am calling the above function in the following manner: uint32_t crc = crc32(header->len - 4, packet); <br /> where header is of type: struct pcap_pkthdr *header; The header information is handled by pcap callback: void my_callback(u_char *args, const struct pcap_pkthdr *header, const u_char *packet) I got the code for crc32() and crctable[] from [this link][1] [1]: http://code.google.com/p/banjax/source/browse/trunk/lib/net/crc32.cpp?spec=svn34&r=34
1
8,854,740
01/13/2012 17:32:46
1,111,517
12/22/2011 10:14:28
1
0
Photoshop - How to link layers visibility (not position)?
I have a photoshop file with a set of layers. Is there a way that I can link "layer visibility" without having to click and unclick on the eye icon of each layer individually? For instance, I would like to set up instructions such as: -If I click on the eye icon of layer A, activate the eye icon of layer B, AND C, AND D simultaneously... -activate the eye Icon of layer A OR B OR C... but don't allow to have more than one visible layer at the same time... Grouping layers does not fit my purposes because I want to do that between layers that already belong to different groups. Thanks!
visibility
photoshop
layer
null
null
01/13/2012 20:35:35
off topic
Photoshop - How to link layers visibility (not position)? === I have a photoshop file with a set of layers. Is there a way that I can link "layer visibility" without having to click and unclick on the eye icon of each layer individually? For instance, I would like to set up instructions such as: -If I click on the eye icon of layer A, activate the eye icon of layer B, AND C, AND D simultaneously... -activate the eye Icon of layer A OR B OR C... but don't allow to have more than one visible layer at the same time... Grouping layers does not fit my purposes because I want to do that between layers that already belong to different groups. Thanks!
2
2,217,873
02/07/2010 18:57:47
268,232
02/07/2010 18:57:47
1
0
grails test-app to output to console
I am new to grails, coming from Django. Using test driven development, I am used to writing tests and then actual functionality. What works well for me it to write the test, run the function with some debug output to see that state of variables until the unit test passes, and then moving the debug output. In grails the 'grails test-app', the output of 'log.debug' and 'println' is not recorded to the console, and it is not in the reporting either. The documentation point to using mocklogging, which should output the log.debug calls to the console, but using grails 1.2.1, I can not see any output. Can any one please let me know how to see the output of 'println' or 'log.debug' in the console to speed up my developement?
grails
null
null
null
null
null
open
grails test-app to output to console === I am new to grails, coming from Django. Using test driven development, I am used to writing tests and then actual functionality. What works well for me it to write the test, run the function with some debug output to see that state of variables until the unit test passes, and then moving the debug output. In grails the 'grails test-app', the output of 'log.debug' and 'println' is not recorded to the console, and it is not in the reporting either. The documentation point to using mocklogging, which should output the log.debug calls to the console, but using grails 1.2.1, I can not see any output. Can any one please let me know how to see the output of 'println' or 'log.debug' in the console to speed up my developement?
0
8,616,318
12/23/2011 12:52:33
1,049,325
11/16/2011 09:28:21
82
0
Compare datetime in a query and perform a delete in mysql
In this table I want to delete the oldest entry for userid 1, here the oldest entry is `ghi 10/12/2011 11:20:22` i get the oldest entry by the datetime. How can I compare date time and do a delete in the same query. I want to compare the datetime entry for userid 1 delete from tbl_name where datetime is oldestentry and userid=1; No Name DateTime UserID 1 abv 12/12/2011 11:20:22 1 2 edf 11/12/2011 11:20:22 1 3 ghi 10/12/2011 11:20:22 1
mysql
null
null
null
null
null
open
Compare datetime in a query and perform a delete in mysql === In this table I want to delete the oldest entry for userid 1, here the oldest entry is `ghi 10/12/2011 11:20:22` i get the oldest entry by the datetime. How can I compare date time and do a delete in the same query. I want to compare the datetime entry for userid 1 delete from tbl_name where datetime is oldestentry and userid=1; No Name DateTime UserID 1 abv 12/12/2011 11:20:22 1 2 edf 11/12/2011 11:20:22 1 3 ghi 10/12/2011 11:20:22 1
0
8,956,599
01/21/2012 20:52:44
910,100
08/24/2011 16:52:58
18
0
CSS Media Queries
I am trying to adapt my tablet web app for use on cell phones. The Media Query functionality seems perfect and my initial testing bears this out. The question I have is: with phones and tablets that change their orientation from portrait to landscape (upon rotation of the device) what does max-width then refer to? In other words, the bigger Android phones have resolutions along the lines of 480x800, the iPhone4 has a resolution of 640x960, and the original Blackberry Torch has a resolution of 360x480. These are all the resolutions (W x H) when the devices are held in portrait mode, so the widths are 400, 640, and 360 respectively. However, when you rotate the device to landscape, the height 'becomes' the width for display purposes. So the effective widths in landscape then become 800, 960, and 480 respectively, and the 800 and 960 widths overlap with tablet landscape widths which messes up the display. So, is width always width? That is to say, when the device reports its dimensions, does the width value always stay the same for CSS purposes, or does the width value change when the device rotates to landscape? Thanks to you all in advance.
css3
media-queries
null
null
null
null
open
CSS Media Queries === I am trying to adapt my tablet web app for use on cell phones. The Media Query functionality seems perfect and my initial testing bears this out. The question I have is: with phones and tablets that change their orientation from portrait to landscape (upon rotation of the device) what does max-width then refer to? In other words, the bigger Android phones have resolutions along the lines of 480x800, the iPhone4 has a resolution of 640x960, and the original Blackberry Torch has a resolution of 360x480. These are all the resolutions (W x H) when the devices are held in portrait mode, so the widths are 400, 640, and 360 respectively. However, when you rotate the device to landscape, the height 'becomes' the width for display purposes. So the effective widths in landscape then become 800, 960, and 480 respectively, and the 800 and 960 widths overlap with tablet landscape widths which messes up the display. So, is width always width? That is to say, when the device reports its dimensions, does the width value always stay the same for CSS purposes, or does the width value change when the device rotates to landscape? Thanks to you all in advance.
0
11,202,603
06/26/2012 07:30:14
1,421,153
05/28/2012 07:11:43
-1
0
How can we save number of AudioRecorded files(.caf) in sqlite3 database
I am developing one app in that i want to record user voice for that i have record the voice in NSTemporaryDirectory() but after coalition of record i want to save that recorded .caf file in database and also retrieve that file from database and play that file so help me... I am do like this... -(IBAction)recordbutton:(id)sender { if(toggle) { toggle = NO; [btnStart setImage:[UIImage imageNamed:@"stopbtn.png"] forState:UIControlStateNormal]; label1.text = @"Speak now"; dotimageview.image = [UIImage imageNamed:@"record_dot.png"]; timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(hideLabel:) userInfo:nil repeats:YES]; btnPlay.enabled = toggle; btnPlay.hidden = !toggle; //Begin the recording session. //Setup the dictionary object with all the recording settings that this //This is a good resource: http://www.totodotnet.net/tag/avaudiorecorder/ NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; //Now that we have our settings we are going to instanciate an instance of our recorder instance. //Generate a temp file for use by the recording. //This sample was one I found online and seems to be a good choice for making a tmp file that // recordedTmpFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"caf"]]]; recordedTmpFile = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"caf"]]]; NSLog(@"Using File called: %@",recordedTmpFile); //Setup the recorder to use this file and record to it. recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error]; //Use the recorder to start the recording. [recorder setDelegate:self]; [recorder prepareToRecord]; //Start the actual Recording [recorder record]; //There is an optional method for doing the recording for a limited time see //[recorder recordForDuration:(NSTimeInterval) 29]; } else { toggle = YES; label1.text = @""; btnPlay.enabled = toggle; btnPlay.hidden = !toggle; // stop the timer [timer invalidate]; timer = nil; dotimageview.hidden = YES; label1.text = @"Listen"; self.navigationItem.rightBarButtonItem.enabled = YES; NSLog(@"Using File called: %@",recordedTmpFile); NSString *soundFile = [NSString stringWithFormat:@"%@",recordedTmpFile]; NSLog(@"str === %@",soundFile); //Stop the recorder. [recorder stop]; } }
iphone
objective-c
ios
null
null
null
open
How can we save number of AudioRecorded files(.caf) in sqlite3 database === I am developing one app in that i want to record user voice for that i have record the voice in NSTemporaryDirectory() but after coalition of record i want to save that recorded .caf file in database and also retrieve that file from database and play that file so help me... I am do like this... -(IBAction)recordbutton:(id)sender { if(toggle) { toggle = NO; [btnStart setImage:[UIImage imageNamed:@"stopbtn.png"] forState:UIControlStateNormal]; label1.text = @"Speak now"; dotimageview.image = [UIImage imageNamed:@"record_dot.png"]; timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(hideLabel:) userInfo:nil repeats:YES]; btnPlay.enabled = toggle; btnPlay.hidden = !toggle; //Begin the recording session. //Setup the dictionary object with all the recording settings that this //This is a good resource: http://www.totodotnet.net/tag/avaudiorecorder/ NSMutableDictionary* recordSetting = [[NSMutableDictionary alloc] init]; [recordSetting setValue :[NSNumber numberWithInt:kAudioFormatAppleIMA4] forKey:AVFormatIDKey]; [recordSetting setValue:[NSNumber numberWithFloat:44100.0] forKey:AVSampleRateKey]; [recordSetting setValue:[NSNumber numberWithInt: 2] forKey:AVNumberOfChannelsKey]; //Now that we have our settings we are going to instanciate an instance of our recorder instance. //Generate a temp file for use by the recording. //This sample was one I found online and seems to be a good choice for making a tmp file that // recordedTmpFile = [NSURL fileURLWithPath:[NSTemporaryDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"caf"]]]; recordedTmpFile = [NSURL fileURLWithPath:[NSHomeDirectory() stringByAppendingPathComponent: [NSString stringWithFormat: @"%.0f.%@", [NSDate timeIntervalSinceReferenceDate] * 1000.0, @"caf"]]]; NSLog(@"Using File called: %@",recordedTmpFile); //Setup the recorder to use this file and record to it. recorder = [[ AVAudioRecorder alloc] initWithURL:recordedTmpFile settings:recordSetting error:&error]; //Use the recorder to start the recording. [recorder setDelegate:self]; [recorder prepareToRecord]; //Start the actual Recording [recorder record]; //There is an optional method for doing the recording for a limited time see //[recorder recordForDuration:(NSTimeInterval) 29]; } else { toggle = YES; label1.text = @""; btnPlay.enabled = toggle; btnPlay.hidden = !toggle; // stop the timer [timer invalidate]; timer = nil; dotimageview.hidden = YES; label1.text = @"Listen"; self.navigationItem.rightBarButtonItem.enabled = YES; NSLog(@"Using File called: %@",recordedTmpFile); NSString *soundFile = [NSString stringWithFormat:@"%@",recordedTmpFile]; NSLog(@"str === %@",soundFile); //Stop the recorder. [recorder stop]; } }
0
11,489,255
07/15/2012 03:48:07
255,439
01/21/2010 02:52:20
1,088
19
PHP: Error handling
Sometimes, my script cannot read output by a server and the following error occurs: `PHP Fatal error: Call to a member function somefun() on a non-object` This is not something that can be fixed on my end but this causes my script to crash. Is there a way I can create a function that gets run when this particular error occurs? I don't think it's practical to make a try-catch or similar because I would have to find every instance where a member function gets called and test whether the object exists or not (several thousand).
php
error-handling
null
null
null
null
open
PHP: Error handling === Sometimes, my script cannot read output by a server and the following error occurs: `PHP Fatal error: Call to a member function somefun() on a non-object` This is not something that can be fixed on my end but this causes my script to crash. Is there a way I can create a function that gets run when this particular error occurs? I don't think it's practical to make a try-catch or similar because I would have to find every instance where a member function gets called and test whether the object exists or not (several thousand).
0
8,069,908
11/09/2011 18:44:00
1,038,293
11/09/2011 18:29:45
1
0
WSJ News Reader
The WSJ recently launched [WSJ Social][1], on FB. I was tasked with finding out how this was done, whether there are costs involved etc. My colleague, an Editorial Director with a higher ed publication, is interested in learning how/if we can do something similar for our readers? Any assistance and/or direction you can provide is greatly appreciated! Thanks in advance! Brion [1]: https://apps.facebook.com/wsjsocial/
javascript
facebook
fbml
null
null
11/10/2011 00:07:45
not constructive
WSJ News Reader === The WSJ recently launched [WSJ Social][1], on FB. I was tasked with finding out how this was done, whether there are costs involved etc. My colleague, an Editorial Director with a higher ed publication, is interested in learning how/if we can do something similar for our readers? Any assistance and/or direction you can provide is greatly appreciated! Thanks in advance! Brion [1]: https://apps.facebook.com/wsjsocial/
4
4,979,312
02/12/2011 16:59:34
197,606
10/27/2009 19:49:00
2,494
103
DISTINCT pulling duplicate column values
The following query is pulling duplicate `site_id`s, with me using DISTINCT I can't figure out why... SELECT DISTINCT site_id, deal_woot.*, site.woot_off, site.name AS site_name FROM deal_woot INNER JOIN site ON site.id = site_id WHERE site_id IN (2, 3, 4, 5, 6) ORDER BY deal_woot.id DESC LIMIT 5
php
null
null
null
null
null
open
DISTINCT pulling duplicate column values === The following query is pulling duplicate `site_id`s, with me using DISTINCT I can't figure out why... SELECT DISTINCT site_id, deal_woot.*, site.woot_off, site.name AS site_name FROM deal_woot INNER JOIN site ON site.id = site_id WHERE site_id IN (2, 3, 4, 5, 6) ORDER BY deal_woot.id DESC LIMIT 5
0
3,340,938
07/27/2010 05:18:09
372,291
06/21/2010 15:11:08
1
0
How to place a wide figure with subfigures in Latex?
I am trying to write a report and stuck with a wide figure. My document type is PRL using revtex4.1 with two columns. I have a wide figure which consists of 8 subfigures. I am trying to place it bottom of a page but it insists to go next page. Here is code for my wide figure: \begin{figure*} \centering \subfloat[s1]{\label{fig:s1}\includegraphics[width=0.20\textwidth]{s1.png}}\qquad \subfloat[s2]{\label{fig:s2}\includegraphics[width=0.20\textwidth]{s2.png}}\qquad \subfloat[s3]{\label{fig:s3}\includegraphics[width=0.20\textwidth]{s3.png}}\qquad \subfloat[s4]{\label{fig:s4}\includegraphics[width=0.20\textwidth]{s4.png}}\\ \subfloat[s5]{\label{fig:s5}\includegraphics[width=0.20\textwidth]{s5.png}}\qquad \subfloat[s6]{\label{fig:s6}\includegraphics[width=0.20\textwidth]{s6.png}}\qquad \subfloat[s7]{\label{fig:s7}\includegraphics[width=0.20\textwidth]{s7.png}}\qquad \subfloat[s8]{\label{fig:s8}\includegraphics[width=0.20\textwidth]{s8.png}} \caption{\label{fig:s}Caption} \end{figure*}
latex
subfigure
null
null
null
null
open
How to place a wide figure with subfigures in Latex? === I am trying to write a report and stuck with a wide figure. My document type is PRL using revtex4.1 with two columns. I have a wide figure which consists of 8 subfigures. I am trying to place it bottom of a page but it insists to go next page. Here is code for my wide figure: \begin{figure*} \centering \subfloat[s1]{\label{fig:s1}\includegraphics[width=0.20\textwidth]{s1.png}}\qquad \subfloat[s2]{\label{fig:s2}\includegraphics[width=0.20\textwidth]{s2.png}}\qquad \subfloat[s3]{\label{fig:s3}\includegraphics[width=0.20\textwidth]{s3.png}}\qquad \subfloat[s4]{\label{fig:s4}\includegraphics[width=0.20\textwidth]{s4.png}}\\ \subfloat[s5]{\label{fig:s5}\includegraphics[width=0.20\textwidth]{s5.png}}\qquad \subfloat[s6]{\label{fig:s6}\includegraphics[width=0.20\textwidth]{s6.png}}\qquad \subfloat[s7]{\label{fig:s7}\includegraphics[width=0.20\textwidth]{s7.png}}\qquad \subfloat[s8]{\label{fig:s8}\includegraphics[width=0.20\textwidth]{s8.png}} \caption{\label{fig:s}Caption} \end{figure*}
0
4,247,803
11/22/2010 16:40:54
233,087
12/16/2009 16:00:58
1,120
11
How to perform an operation before object is disposed?
Working with C#. I have an abstract class that I use to read/write settings to an xml file. When the class is no longer needed I want to perform one last write operation to the xml file before the class gets disposed. I tried putting this code in a destructor method `~myClass() {}` but it throws an exception saying that the safe handle is closed. I am guessing this means that the class is already disposed or partially disposed. So if the destructor is not the correct place to do this where is the correct place? Do I need to implement IDisposable or something?
c#
garbage-collection
dispose
abstract
null
null
open
How to perform an operation before object is disposed? === Working with C#. I have an abstract class that I use to read/write settings to an xml file. When the class is no longer needed I want to perform one last write operation to the xml file before the class gets disposed. I tried putting this code in a destructor method `~myClass() {}` but it throws an exception saying that the safe handle is closed. I am guessing this means that the class is already disposed or partially disposed. So if the destructor is not the correct place to do this where is the correct place? Do I need to implement IDisposable or something?
0
6,711,171
07/15/2011 17:50:54
223,367
12/02/2009 23:52:01
2,734
10
Where is the space coming from at the bottom of the footer
I have this page[ here][1] and if you scroll to the bottom you can see a space at the bottom but for the life of me i cant seem to figure out what is causing it...any ideas.. [1]: http://posnation.com/shop_pos/
html
css
null
null
null
07/18/2011 03:43:30
too localized
Where is the space coming from at the bottom of the footer === I have this page[ here][1] and if you scroll to the bottom you can see a space at the bottom but for the life of me i cant seem to figure out what is causing it...any ideas.. [1]: http://posnation.com/shop_pos/
3
9,044,548
01/28/2012 10:25:18
735,960
05/03/2011 10:38:38
359
22
Using group_by with where statement in RoR
Already check [this][1] video which is very helpful. But actually i dont just want to group just months. I want to group them with a condition too. So i have; MyModel.where("state = 'A'").all.group_by { |q| q.created_at.beginning_of_month }.count But it gives me all records that states in 'A' not in current month specifically. Am i missing something? Thanks. [1]: http://railscasts.com/episodes/29-group-by-month
ruby-on-rails
ruby
activerecord
group-by
null
null
open
Using group_by with where statement in RoR === Already check [this][1] video which is very helpful. But actually i dont just want to group just months. I want to group them with a condition too. So i have; MyModel.where("state = 'A'").all.group_by { |q| q.created_at.beginning_of_month }.count But it gives me all records that states in 'A' not in current month specifically. Am i missing something? Thanks. [1]: http://railscasts.com/episodes/29-group-by-month
0
2,727,158
04/28/2010 06:07:20
300,535
03/24/2010 05:24:30
36
2
Dynamically set value of an elements attribute in ASP.NET
I have some simple code in an aspx page <object width="550" height="400"> <param name="movie" value='XXXX' /> <embed src='XXXX' width="350" height="370"></embed> </object> I want to be able to dynamically set the value of XXXX. What is the best way to do this ?
asp.net
html
null
null
null
null
open
Dynamically set value of an elements attribute in ASP.NET === I have some simple code in an aspx page <object width="550" height="400"> <param name="movie" value='XXXX' /> <embed src='XXXX' width="350" height="370"></embed> </object> I want to be able to dynamically set the value of XXXX. What is the best way to do this ?
0
3,186,403
07/06/2010 13:07:01
8,741
09/15/2008 16:46:16
2,541
71
SqlRoleProvider fails to connect to DB.
I have the following config for roles using standard SqlRoleProvider, but I get an error when I try and open the Security page in the wweb site Admin tool: <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider"> <providers> <remove name="AspNetSqlRoleProvider"/> <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="PoyntingInstallationConnectionString" applicationName="/" /> </providers> </roleManager> The DB has all the role tables etc. but I notice no database roles were created by the generated script from the framework.
asp.net
authorization
roles
null
null
null
open
SqlRoleProvider fails to connect to DB. === I have the following config for roles using standard SqlRoleProvider, but I get an error when I try and open the Security page in the wweb site Admin tool: <roleManager enabled="true" defaultProvider="AspNetSqlRoleProvider"> <providers> <remove name="AspNetSqlRoleProvider"/> <add name="AspNetSqlRoleProvider" type="System.Web.Security.SqlRoleProvider" connectionStringName="PoyntingInstallationConnectionString" applicationName="/" /> </providers> </roleManager> The DB has all the role tables etc. but I notice no database roles were created by the generated script from the framework.
0
7,310,285
09/05/2011 15:52:54
929,155
09/05/2011 15:43:18
1
0
is Martin Fowler's book Refactoring still a worth buy?
The book is old and haven't heard that any new edition is coming our way. I want to improve my software engineeering / architecture skills, but I'm not so sure where to start.
architecture
books
refactoring
software-engineering
fowler
09/05/2011 16:44:35
not constructive
is Martin Fowler's book Refactoring still a worth buy? === The book is old and haven't heard that any new edition is coming our way. I want to improve my software engineeering / architecture skills, but I'm not so sure where to start.
4
1,830,684
12/02/2009 04:39:35
222,624
12/02/2009 04:39:35
1
0
Check the sortedness Of An Array
I need an Algorithm which is used to find the N-element randomly-ordered integer array is either already sorted or not.
algorithm
null
null
null
null
null
open
Check the sortedness Of An Array === I need an Algorithm which is used to find the N-element randomly-ordered integer array is either already sorted or not.
0
10,318,571
04/25/2012 15:13:55
971,058
09/29/2011 11:57:19
6
0
Cannot obtain a Youtube API developer key
I'm facing a very curious problem.<br/> I'm trying to obtain a developer key for the youtube API (seems that you need this if you want to use the Google c# client library). I'm following the links up to here: https://code.google.com/apis/youtube/dashboard/gwt/index.html#newProduct where the form is not editable... (impossible for me to add a product name or website).<br/> Any help greatly appreciated !<br/> Thanks, Alex
c#
.net
youtube
youtube-api
null
04/25/2012 15:26:59
off topic
Cannot obtain a Youtube API developer key === I'm facing a very curious problem.<br/> I'm trying to obtain a developer key for the youtube API (seems that you need this if you want to use the Google c# client library). I'm following the links up to here: https://code.google.com/apis/youtube/dashboard/gwt/index.html#newProduct where the form is not editable... (impossible for me to add a product name or website).<br/> Any help greatly appreciated !<br/> Thanks, Alex
2
10,670,268
05/20/2012 02:14:57
1,236,720
02/27/2012 23:21:33
829
10
How do portfolio software generate their portfolio suggestions so quickly when the possibilities are huge?
I hope this does not get closed because it is related to algorithms that I have not been able to figure out(its also pretty long because I'm so confused about how its being done). Basically many years back I used to work at a mutual fund and we used different tools to select optimize portfolios as well as hedge existing ones. We would take these results and make our own modifications then sell them to clients. After my company downsized, I decided I wanted to give it a try(to create the software and include my customizations) but I have no clue how combinations are actually generated for the software. After 6 months of trying, I'm accepting that my approach is impossible. I was trying to use combination algorithms like from Knuth's book, as well as doing bit combinations to try to find every possible portfolio(I limited it to 30 stocks) on the NYSE(5,000+ stocks). But as per everyone I have spoken to this will take me billions of billions of years to just get one days results. So what am I missing? We would enter our risk tolerance and view of the market(stock market growth expectations, inflation expectations, fed funds expectations,etc..) and it would give us the ideal portfolio(in theory..). With thousands of possibilities and quadrillion possible combinations of weights of stocks, how are they able to calculate results so quickly(or even at all)? As the admin of the system, I know we downloaded a file everyday(less than 100 mb and loaded in a mssql database..so its not like we had every possibility, I would get a 5 gig file in a min of doing my combination algo) and the applications worked offline(so it must have been doing it locally on the desktop/laptop cpu not on a massive supercomputer somewhere and took a min or two to run..15 minutes was the longest for a global fund which includes every stock in the world). Its so confusing because their work required correlation of the entire fund to be good(I don't think they were just sending the top stocks they pre-calculated because everyone got different results). So I wanted a 30 stock fund that gave me 2% returns and had a negative correlation with the market, and was 60% hedged how could the software generate that information? note, I'm not asking about the math or the finance part, I'm asking how it was able to generate 30 stocks from the entire market that gave 2% returns when in order to do that it would need to know the returns of all 30 stock portfolio(That alone would make it run for billions of years, right? the other restrictions make it more complex). So How is this being done programmatically? I'm starting to believe they are not using Knuth's combination algorithm to generate every possibility yet their results don't seem randomly selected and individually selecting the stocks seems to miss the correlation part. How can so many investment softwares do things like this? It seemed like nothing when using the program but after trying to create my own it seems impossible(which its not because people are using it).
algorithm
math
statistics
finance
portfolio
05/21/2012 11:13:02
not constructive
How do portfolio software generate their portfolio suggestions so quickly when the possibilities are huge? === I hope this does not get closed because it is related to algorithms that I have not been able to figure out(its also pretty long because I'm so confused about how its being done). Basically many years back I used to work at a mutual fund and we used different tools to select optimize portfolios as well as hedge existing ones. We would take these results and make our own modifications then sell them to clients. After my company downsized, I decided I wanted to give it a try(to create the software and include my customizations) but I have no clue how combinations are actually generated for the software. After 6 months of trying, I'm accepting that my approach is impossible. I was trying to use combination algorithms like from Knuth's book, as well as doing bit combinations to try to find every possible portfolio(I limited it to 30 stocks) on the NYSE(5,000+ stocks). But as per everyone I have spoken to this will take me billions of billions of years to just get one days results. So what am I missing? We would enter our risk tolerance and view of the market(stock market growth expectations, inflation expectations, fed funds expectations,etc..) and it would give us the ideal portfolio(in theory..). With thousands of possibilities and quadrillion possible combinations of weights of stocks, how are they able to calculate results so quickly(or even at all)? As the admin of the system, I know we downloaded a file everyday(less than 100 mb and loaded in a mssql database..so its not like we had every possibility, I would get a 5 gig file in a min of doing my combination algo) and the applications worked offline(so it must have been doing it locally on the desktop/laptop cpu not on a massive supercomputer somewhere and took a min or two to run..15 minutes was the longest for a global fund which includes every stock in the world). Its so confusing because their work required correlation of the entire fund to be good(I don't think they were just sending the top stocks they pre-calculated because everyone got different results). So I wanted a 30 stock fund that gave me 2% returns and had a negative correlation with the market, and was 60% hedged how could the software generate that information? note, I'm not asking about the math or the finance part, I'm asking how it was able to generate 30 stocks from the entire market that gave 2% returns when in order to do that it would need to know the returns of all 30 stock portfolio(That alone would make it run for billions of years, right? the other restrictions make it more complex). So How is this being done programmatically? I'm starting to believe they are not using Knuth's combination algorithm to generate every possibility yet their results don't seem randomly selected and individually selecting the stocks seems to miss the correlation part. How can so many investment softwares do things like this? It seemed like nothing when using the program but after trying to create my own it seems impossible(which its not because people are using it).
4
10,160,407
04/15/2012 07:55:45
558,261
12/30/2010 12:19:30
105
6
JMAP -dump not excuted on java: runtime.exec()
i have tried to execute the 'jmap -dump:format =b; file" command in runtime.exec(), but it wont execute where other commands like date, pwd are working fine. can anyone know why?
java
unix
heap
dump
jmap
04/18/2012 16:10:14
not a real question
JMAP -dump not excuted on java: runtime.exec() === i have tried to execute the 'jmap -dump:format =b; file" command in runtime.exec(), but it wont execute where other commands like date, pwd are working fine. can anyone know why?
1
6,946,784
08/04/2011 18:38:21
856,948
07/21/2011 22:18:42
6
0
2D Sprites, textures for download
Alright, so I've been looking for a 2D texture of ball but couldn't find any.. Can anyone please give me a link that I could download from 2D sprites and textures? Or it will be even better to give me a link for 2D ball texture? Thanks alot!
c#
xna
null
null
null
08/04/2011 19:27:31
off topic
2D Sprites, textures for download === Alright, so I've been looking for a 2D texture of ball but couldn't find any.. Can anyone please give me a link that I could download from 2D sprites and textures? Or it will be even better to give me a link for 2D ball texture? Thanks alot!
2
10,187,148
04/17/2012 07:43:06
703,356
04/12/2011 04:49:46
7
0
How to lookup a non-jta-data-source/jta-data-source via a Webservice
I get the following error when my Webservice is invoked: org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property. The Webservice class is bascially trying to use JPA to insert data, and based on the above error message it seems the EntityManager cant access the datasource entry as shown below: <persistence-unit name="TEST_P" transaction-type="RESOURCE_LOCAL"> <provider> com.ibm.websphere.persistence.PersistenceProviderImpl </provider> <non-jta-data-source>java:comp/env/jdbc/DATA</non-jta-data-source> <class>jpa.WSTGHandler</class> <properties> </properties> </persistence-unit> I have also defined the datasource entry in the web.xml as shown below: <resource-ref> <res-ref-name>java:comp/env/jdbc/DATA</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> Embedding the JPA code in In Servlet suceesfully locates the datasource. how can I get the Webservice to work the same way ? PS: I am using Websphere 7, JPA version 1.2, and JAX-WS
web-services
java-ee
jpa
websphere-7
null
null
open
How to lookup a non-jta-data-source/jta-data-source via a Webservice === I get the following error when my Webservice is invoked: org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property. The Webservice class is bascially trying to use JPA to insert data, and based on the above error message it seems the EntityManager cant access the datasource entry as shown below: <persistence-unit name="TEST_P" transaction-type="RESOURCE_LOCAL"> <provider> com.ibm.websphere.persistence.PersistenceProviderImpl </provider> <non-jta-data-source>java:comp/env/jdbc/DATA</non-jta-data-source> <class>jpa.WSTGHandler</class> <properties> </properties> </persistence-unit> I have also defined the datasource entry in the web.xml as shown below: <resource-ref> <res-ref-name>java:comp/env/jdbc/DATA</res-ref-name> <res-type>javax.sql.DataSource</res-type> <res-auth>Container</res-auth> <res-sharing-scope>Shareable</res-sharing-scope> </resource-ref> Embedding the JPA code in In Servlet suceesfully locates the datasource. how can I get the Webservice to work the same way ? PS: I am using Websphere 7, JPA version 1.2, and JAX-WS
0
3,515,759
08/18/2010 19:11:29
326,196
04/26/2010 17:12:47
20
0
dynamically adding a view to activity layout
I have a custom view (an extension of a TextView) that I want to dynamically add to my Layout (don't want to include it in the main.xml file). The book says to fetch the RelativeLayout using findViewById() in my java code then create a new instance of my custom view, then use addView on the RelativeLayout to add the new view. I'm not getting any errors, but when I click my button to add the new view, nothing is happening (view isn't being added). Do I need to set additional properties on my custom view (layout width, layout height for example) in order for it to be shown?
android
user-interface
textview
relativelayout
null
null
open
dynamically adding a view to activity layout === I have a custom view (an extension of a TextView) that I want to dynamically add to my Layout (don't want to include it in the main.xml file). The book says to fetch the RelativeLayout using findViewById() in my java code then create a new instance of my custom view, then use addView on the RelativeLayout to add the new view. I'm not getting any errors, but when I click my button to add the new view, nothing is happening (view isn't being added). Do I need to set additional properties on my custom view (layout width, layout height for example) in order for it to be shown?
0
7,614,394
09/30/2011 18:15:02
878,418
08/04/2011 10:56:11
64
0
EJB - external lib or inside JSF project?
I'm packaging my app as WAR archive. What are pros/cons of these two approaches: 1. Keep EJB (beans, entities etc) as separate project and include into WAR as lib (*.jar file - WEB-INF/lib) during build? 2. Keep everything (ejb-s, jsf beans etc) in one project, so after build all would go to WEB_INF/classes Is there any performance/security difference? I'm using GlassFish 3.1.1 WebProfile
jsf
java-ee
ejb
null
null
null
open
EJB - external lib or inside JSF project? === I'm packaging my app as WAR archive. What are pros/cons of these two approaches: 1. Keep EJB (beans, entities etc) as separate project and include into WAR as lib (*.jar file - WEB-INF/lib) during build? 2. Keep everything (ejb-s, jsf beans etc) in one project, so after build all would go to WEB_INF/classes Is there any performance/security difference? I'm using GlassFish 3.1.1 WebProfile
0
11,626,562
07/24/2012 08:00:04
1,326,868
04/11/2012 14:32:50
41
1
Get five latest data from mongoDB
Im working with node.js express and mongoDB, my task is to get the five latest data from database. So what i learn is simply using sort({_id:-1}).limit(5) if i do it directly in the mongo command window. But i need something more complex that implment the sort function in express and display in the website. Without sort function, just get the full user list: // user list exports.users = function(req, res){ memberModel.find({},function(err, docs){ res.render('users.jade', { title: 'hol - Member list', members: docs }); }); }; With sort function, keeps getting error that complains about the .jade file: // user list exports.users = function(req, res){ memberModel.find().sort({_id:-1}).run({},function(err, docs){ res.render('users.jade', { title: 'ho - Member list', members: docs }); }); }; Here is the .jade file that displays Users in the website table.zebra-striped thead tr th Users tbody - members.(function(member){ tr td= member['name'] - })
javascript
node.js
mongodb
express
jade
07/24/2012 13:18:31
too localized
Get five latest data from mongoDB === Im working with node.js express and mongoDB, my task is to get the five latest data from database. So what i learn is simply using sort({_id:-1}).limit(5) if i do it directly in the mongo command window. But i need something more complex that implment the sort function in express and display in the website. Without sort function, just get the full user list: // user list exports.users = function(req, res){ memberModel.find({},function(err, docs){ res.render('users.jade', { title: 'hol - Member list', members: docs }); }); }; With sort function, keeps getting error that complains about the .jade file: // user list exports.users = function(req, res){ memberModel.find().sort({_id:-1}).run({},function(err, docs){ res.render('users.jade', { title: 'ho - Member list', members: docs }); }); }; Here is the .jade file that displays Users in the website table.zebra-striped thead tr th Users tbody - members.(function(member){ tr td= member['name'] - })
3
6,877,937
07/29/2011 19:15:59
869,940
07/29/2011 19:15:59
1
0
C++ card game, exercise with classes
Hallo everybody, I wrote a little code to get some exerice in C++... The code works... but it has a little problem... if you want to solve the problem go ahead and read, if you don't want to please comment on the programming style, I need it to improve myself. The game is called "Stress in camisa", is a card game from my region in Italy... the game is a really simple luck game , I played it when I was 4... The rules are simple: distribute all the 52 card of a French deck between two player, each player in a row discard the card on top of the hand in the center of the table , if one card is less then three, the other player has to give a corresponding number of cards to the number reported on the card... if the other player throw the cards in a row without having a card less then 3, the other player get all the cards that are in the center of the table. loses who don't have anymore cards in his hand. Example "firs turn" player 1: King of Spades player 2: Queen of Clubs player 1: 3 of Diamond (>now player2 has to discard 3 cards) player 2: Jack of Hearts 8 of Clubs 6 of Diamond player 1 won and take: King of Spades Queen of Clubs 3 of Diamond Jack of Hearts 8 of Clubs 6 of Diamond "second turn" player 2: 2 of Clubs (> player 1 has to throw 2 cards) player 1: King of Clubs (> 1st card) 2 of Diamond (> 2nd card is less then 3 so player 2 has to throw 2 card) player 2: 5 of Hearts (> 1st card) Jack of Diamond (> 2nd card) player one whon again, and takes: 2 of Clubs King of Clubs 2 of Diamond 5 of Hearts Jack of Diamond **To the code** I defined the function to check if the card is thrown is < 3 and to make the other player throw the corresponding number of card like this: void check(Card card, Hand &g1, Hand &g2, Hand &Deck_c){ cout << endl; int a = card.get_number(); if (card.get_number() <= 3) { cout << g2.get_name() << " discard: " << endl; while (a > 0) { if (g2.void_hand()) { return; } Card discarded_card = g2.discard(0); cout << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check( discarded_card, g2,g1, Deck_c); a--; } int size_Deck_c = Deck_c.size_cards(); for (int i = 0; i < size_Deck_c; i++) { g1.feed_from_back(Deck_c.discard(0)); } return; } return; } it works fine if there is only one card less then 3 in play: Giovanni discard: 2 of Heart Pietro discard: 8 of Clubs 7 of Heart but here is the problem: Pietro discard: 3 of Heart Giovanni discard: 2 of Spades Pietro discard: Queen of Spades 5 of Spades (>should pass the turn but continue to throw cards) 5 of Diamond 9 of Diamond Pietro should discard 2 card, then pass the turn.... the function is a recursive function, which check if the card is less then 3 every card is thrown if it's over 3 it return to the normal game, else it call again the function with switched players... The problem is in that iterator "int a"... This is the source code if you want to have a look: #include <iostream> #include <string> #include <vector> #include <stdlib.h> using namespace std; int array_numbers[] = {1,2,3,4,5,6,7,8,9,10,11,12,13}; string array_suit[] = {"Heart","Clubs","Spades","Diamond"}; class Card{ private: int Number; string Suit; public: Card(); Card(int,string); int get_number(); string get_suit(); void assign_values(int,string); friend ostream &operator<<(ostream&, const Card&); }; Card::Card(){ Number = 0; Suit = "void"; } Card::Card(int number, string suit){ Number = number; Suit = suit; } int Card::get_number(){ return Number; } string Card::get_suit(){ return Suit; } void Card::assign_values(int i, string suit){ Number = i; Suit = suit; } ostream &operator<<(ostream& os, const Card& card){ if (card.Number == 1) { os << "Ace of " << card.Suit; } else if(card.Number == 11){ os << "Jack of " << card.Suit; } else if(card.Number == 12){ os << "Queen of " << card.Suit; } else if(card.Number == 13){ os << "King of " << card.Suit; } else{ os << card.Number << " of " << card.Suit; } return os; } class Deck { private: int x; Card cards[52]; public: Deck(); void print_card(int); void print_Deck(); void shuffle(); Card get_card(int); }; Deck::Deck(){ for (int n = 0; n < 13; n++) { for (int seme = 0; seme < 4; seme++) { cards[n*4+seme].assign_values(array_numbers[n], array_suit[seme]); } } } void Deck::print_card(int i){ cout << cards[i]; } void Deck::print_Deck(){ for (int i = 0; i<52; i++) { for (int a = 0; a < i; a++) { cout << " "; } print_card(i); cout << endl; } } void Deck::shuffle(){ srand ( time(NULL) ); for (int i = 0; i<500; i++) { int x = rand()%51; int y = rand()%51; Card cpy; cpy.assign_values(cards[x].get_number(),cards[x].get_suit()); cards[x] = cards[y]; cards[y] = cpy; } } Card Deck::get_card(int i){ return cards[i]; } class Hand { private: vector <Card> cards; string name; public: Hand(); Hand(string); string get_name(); void append_card(Card); void print_hand(); Card discard(int); bool operator==(Hand); bool void_hand(); void feed_from_back(Card); int size_cards(); }; int Hand::size_cards(){ return cards.size(); } void Hand::append_card(Card card){ cards.insert(cards.begin(),card); } Hand::Hand(){ name = "void"; } Hand::Hand(string x){ name = x; } string Hand::get_name(){ return name; } void Hand::print_hand(){ int a= 0; vector <Card> ::iterator i; for (i = cards.begin(); i != cards.end(); i++) { a++; for (int c = 0; c < a; c++) { cout << " "; } cout << *i << endl; } } Card Hand::discard(int a){ Card c_return; vector <Card>::iterator i; i = cards.begin(); for (int f = 0; f < a; f++) { i++; } c_return = *i; cards.erase(i); return c_return; } bool Hand::operator==(Hand other_hand){ if (name == other_hand.get_name()) { return 1; } else { return 0; } } bool Hand::void_hand(){ if (cards.size()== 0) { return 1; } else { return 0; } } void Hand::feed_from_back(Card x){ cards.insert(cards.end(),x); } void check(Card card, Hand &g1, Hand &g2, Hand &Deck_c){ cout << endl; int a = card.get_number(); if (card.get_number() <= 3) { cout << g2.get_name() << " discard: " << endl; while (a > 0) { if (g2.void_hand()) { return; } Card discarded_card = g2.discard(0); cout << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check( discarded_card, g2,g1, Deck_c); a--; } int size_Deck_c = Deck_c.size_cards(); for (int i = 0; i < size_Deck_c; i++) { g1.feed_from_back(Deck_c.discard(0)); } return; } return; } void turn(Hand &g1, Hand &g2, Hand &Deck_c){ if (g1.void_hand()) { return; } Card discarded_card = g1.discard(0); cout << g1.get_name() << " discard:" << endl << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check(discarded_card, g1, g2, Deck_c); turn(g2,g1,Deck_c); } int main (int argc, char * const argv[]) { // inizializzo il mazzo Deck Deck1; Deck1.shuffle(); Hand hand1("Giovanni"); Hand hand2("Pietro"); Hand central_deck; // inizializzo le mani for (int i = 0; i < 52/2; i++) { hand1.append_card(Deck1.get_card(i)); } for (int i = 52/2; i < 52; i++) { hand2.append_card(Deck1.get_card(i)); } turn(hand1, hand2, central_deck); //turn(mano1, mano2, mazzo_centrale); cout << "mazzo" << endl; central_deck.print_hand(); cout << "mano 1" << endl; hand1.print_hand(); cout << "mano 2" << endl; hand2.print_hand(); std::cout << "Hello, World!\n"; return 0; }
c++
class
card-games
null
null
07/30/2011 00:29:37
not a real question
C++ card game, exercise with classes === Hallo everybody, I wrote a little code to get some exerice in C++... The code works... but it has a little problem... if you want to solve the problem go ahead and read, if you don't want to please comment on the programming style, I need it to improve myself. The game is called "Stress in camisa", is a card game from my region in Italy... the game is a really simple luck game , I played it when I was 4... The rules are simple: distribute all the 52 card of a French deck between two player, each player in a row discard the card on top of the hand in the center of the table , if one card is less then three, the other player has to give a corresponding number of cards to the number reported on the card... if the other player throw the cards in a row without having a card less then 3, the other player get all the cards that are in the center of the table. loses who don't have anymore cards in his hand. Example "firs turn" player 1: King of Spades player 2: Queen of Clubs player 1: 3 of Diamond (>now player2 has to discard 3 cards) player 2: Jack of Hearts 8 of Clubs 6 of Diamond player 1 won and take: King of Spades Queen of Clubs 3 of Diamond Jack of Hearts 8 of Clubs 6 of Diamond "second turn" player 2: 2 of Clubs (> player 1 has to throw 2 cards) player 1: King of Clubs (> 1st card) 2 of Diamond (> 2nd card is less then 3 so player 2 has to throw 2 card) player 2: 5 of Hearts (> 1st card) Jack of Diamond (> 2nd card) player one whon again, and takes: 2 of Clubs King of Clubs 2 of Diamond 5 of Hearts Jack of Diamond **To the code** I defined the function to check if the card is thrown is < 3 and to make the other player throw the corresponding number of card like this: void check(Card card, Hand &g1, Hand &g2, Hand &Deck_c){ cout << endl; int a = card.get_number(); if (card.get_number() <= 3) { cout << g2.get_name() << " discard: " << endl; while (a > 0) { if (g2.void_hand()) { return; } Card discarded_card = g2.discard(0); cout << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check( discarded_card, g2,g1, Deck_c); a--; } int size_Deck_c = Deck_c.size_cards(); for (int i = 0; i < size_Deck_c; i++) { g1.feed_from_back(Deck_c.discard(0)); } return; } return; } it works fine if there is only one card less then 3 in play: Giovanni discard: 2 of Heart Pietro discard: 8 of Clubs 7 of Heart but here is the problem: Pietro discard: 3 of Heart Giovanni discard: 2 of Spades Pietro discard: Queen of Spades 5 of Spades (>should pass the turn but continue to throw cards) 5 of Diamond 9 of Diamond Pietro should discard 2 card, then pass the turn.... the function is a recursive function, which check if the card is less then 3 every card is thrown if it's over 3 it return to the normal game, else it call again the function with switched players... The problem is in that iterator "int a"... This is the source code if you want to have a look: #include <iostream> #include <string> #include <vector> #include <stdlib.h> using namespace std; int array_numbers[] = {1,2,3,4,5,6,7,8,9,10,11,12,13}; string array_suit[] = {"Heart","Clubs","Spades","Diamond"}; class Card{ private: int Number; string Suit; public: Card(); Card(int,string); int get_number(); string get_suit(); void assign_values(int,string); friend ostream &operator<<(ostream&, const Card&); }; Card::Card(){ Number = 0; Suit = "void"; } Card::Card(int number, string suit){ Number = number; Suit = suit; } int Card::get_number(){ return Number; } string Card::get_suit(){ return Suit; } void Card::assign_values(int i, string suit){ Number = i; Suit = suit; } ostream &operator<<(ostream& os, const Card& card){ if (card.Number == 1) { os << "Ace of " << card.Suit; } else if(card.Number == 11){ os << "Jack of " << card.Suit; } else if(card.Number == 12){ os << "Queen of " << card.Suit; } else if(card.Number == 13){ os << "King of " << card.Suit; } else{ os << card.Number << " of " << card.Suit; } return os; } class Deck { private: int x; Card cards[52]; public: Deck(); void print_card(int); void print_Deck(); void shuffle(); Card get_card(int); }; Deck::Deck(){ for (int n = 0; n < 13; n++) { for (int seme = 0; seme < 4; seme++) { cards[n*4+seme].assign_values(array_numbers[n], array_suit[seme]); } } } void Deck::print_card(int i){ cout << cards[i]; } void Deck::print_Deck(){ for (int i = 0; i<52; i++) { for (int a = 0; a < i; a++) { cout << " "; } print_card(i); cout << endl; } } void Deck::shuffle(){ srand ( time(NULL) ); for (int i = 0; i<500; i++) { int x = rand()%51; int y = rand()%51; Card cpy; cpy.assign_values(cards[x].get_number(),cards[x].get_suit()); cards[x] = cards[y]; cards[y] = cpy; } } Card Deck::get_card(int i){ return cards[i]; } class Hand { private: vector <Card> cards; string name; public: Hand(); Hand(string); string get_name(); void append_card(Card); void print_hand(); Card discard(int); bool operator==(Hand); bool void_hand(); void feed_from_back(Card); int size_cards(); }; int Hand::size_cards(){ return cards.size(); } void Hand::append_card(Card card){ cards.insert(cards.begin(),card); } Hand::Hand(){ name = "void"; } Hand::Hand(string x){ name = x; } string Hand::get_name(){ return name; } void Hand::print_hand(){ int a= 0; vector <Card> ::iterator i; for (i = cards.begin(); i != cards.end(); i++) { a++; for (int c = 0; c < a; c++) { cout << " "; } cout << *i << endl; } } Card Hand::discard(int a){ Card c_return; vector <Card>::iterator i; i = cards.begin(); for (int f = 0; f < a; f++) { i++; } c_return = *i; cards.erase(i); return c_return; } bool Hand::operator==(Hand other_hand){ if (name == other_hand.get_name()) { return 1; } else { return 0; } } bool Hand::void_hand(){ if (cards.size()== 0) { return 1; } else { return 0; } } void Hand::feed_from_back(Card x){ cards.insert(cards.end(),x); } void check(Card card, Hand &g1, Hand &g2, Hand &Deck_c){ cout << endl; int a = card.get_number(); if (card.get_number() <= 3) { cout << g2.get_name() << " discard: " << endl; while (a > 0) { if (g2.void_hand()) { return; } Card discarded_card = g2.discard(0); cout << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check( discarded_card, g2,g1, Deck_c); a--; } int size_Deck_c = Deck_c.size_cards(); for (int i = 0; i < size_Deck_c; i++) { g1.feed_from_back(Deck_c.discard(0)); } return; } return; } void turn(Hand &g1, Hand &g2, Hand &Deck_c){ if (g1.void_hand()) { return; } Card discarded_card = g1.discard(0); cout << g1.get_name() << " discard:" << endl << " "; cout << discarded_card; Deck_c.append_card(discarded_card); check(discarded_card, g1, g2, Deck_c); turn(g2,g1,Deck_c); } int main (int argc, char * const argv[]) { // inizializzo il mazzo Deck Deck1; Deck1.shuffle(); Hand hand1("Giovanni"); Hand hand2("Pietro"); Hand central_deck; // inizializzo le mani for (int i = 0; i < 52/2; i++) { hand1.append_card(Deck1.get_card(i)); } for (int i = 52/2; i < 52; i++) { hand2.append_card(Deck1.get_card(i)); } turn(hand1, hand2, central_deck); //turn(mano1, mano2, mazzo_centrale); cout << "mazzo" << endl; central_deck.print_hand(); cout << "mano 1" << endl; hand1.print_hand(); cout << "mano 2" << endl; hand2.print_hand(); std::cout << "Hello, World!\n"; return 0; }
1
94,864
09/18/2008 17:46:05
16,440
09/17/2008 17:11:28
1
1
Tasklist replacement for Visual Studio
I would like to use the task-list in Visual Studio but it really lacks almost any useful feature a task-list should provide. So I use [Todo-List][1] externally, to keep track of the things I need to get done. Would be nice to have it all in one place. So does anyone know of a cool replacement Add-On for the tasklist in Visual Studio? Thanks in advance! [1]: http://www.abstractspoon.com/
visual
tasks
add-on
studio
null
null
open
Tasklist replacement for Visual Studio === I would like to use the task-list in Visual Studio but it really lacks almost any useful feature a task-list should provide. So I use [Todo-List][1] externally, to keep track of the things I need to get done. Would be nice to have it all in one place. So does anyone know of a cool replacement Add-On for the tasklist in Visual Studio? Thanks in advance! [1]: http://www.abstractspoon.com/
0
2,396,995
03/07/2010 16:40:20
278,618
02/22/2010 10:56:15
96
6
TabPage as userControl ??
I want to create tabpage as userControl. Is there any way to deal with this??
c#
winforms
tabcontrol
null
null
null
open
TabPage as userControl ?? === I want to create tabpage as userControl. Is there any way to deal with this??
0
9,604,882
03/07/2012 16:01:21
956,575
09/21/2011 09:31:01
111
1
.NET Workflow parallel execution
I have created Workflow and I have my code activity which is doing expensive query. I want make execution of my activity (TagData) in Parallel. But for some reason this 'ParallelFroEach<T>' block is working as simple ForEach loop and does not execute it in parallel. Why? Do I missed something? ![enter image description here][1] [1]: http://i.stack.imgur.com/WdOiu.png Thanks!
.net
workflow-foundation
null
null
null
null
open
.NET Workflow parallel execution === I have created Workflow and I have my code activity which is doing expensive query. I want make execution of my activity (TagData) in Parallel. But for some reason this 'ParallelFroEach<T>' block is working as simple ForEach loop and does not execute it in parallel. Why? Do I missed something? ![enter image description here][1] [1]: http://i.stack.imgur.com/WdOiu.png Thanks!
0
5,067,409
02/21/2011 14:55:42
486,509
10/25/2010 14:00:18
43
1
Objective-C: Cart
Hey everbody, i have question here. I have to make a cart for my app, but i dont know whats the best way to do it. Im thinking to use the NSMutableArray, but i dont know if its the best way to to this. Whats the best way to do this? Thanks!
objective-c
null
null
null
null
null
open
Objective-C: Cart === Hey everbody, i have question here. I have to make a cart for my app, but i dont know whats the best way to do it. Im thinking to use the NSMutableArray, but i dont know if its the best way to to this. Whats the best way to do this? Thanks!
0
9,873,194
03/26/2012 13:38:45
692,280
04/05/2011 05:50:26
98
11
How to add OLE object in Excel using Apache POI
I'm trying to create an OLE object on my excel using POI. Here's an example when not using POI Shape shape = ws.shape.addOleObject(params,pathToImage,...) Please help to convert my code to POI. Cheers!
java
excel
apache-poi
ole
null
null
open
How to add OLE object in Excel using Apache POI === I'm trying to create an OLE object on my excel using POI. Here's an example when not using POI Shape shape = ws.shape.addOleObject(params,pathToImage,...) Please help to convert my code to POI. Cheers!
0
6,869,320
07/29/2011 06:12:48
562,286
01/04/2011 08:55:24
50
2
Getting form object values in a script
If you have this kind of form attribute in Spring: <form:select path="form_object.id" items="${objects}" itemValue="id" itemLabel="description"> How can you pass the id (type is int) value to script? $("#form_object").change(function(){ alert($(this.val)); this.val returns nothing. I need to posses the id value of selected item.
spring
script
null
null
null
null
open
Getting form object values in a script === If you have this kind of form attribute in Spring: <form:select path="form_object.id" items="${objects}" itemValue="id" itemLabel="description"> How can you pass the id (type is int) value to script? $("#form_object").change(function(){ alert($(this.val)); this.val returns nothing. I need to posses the id value of selected item.
0
3,169,346
07/02/2010 21:57:00
25,991
10/08/2008 00:45:56
194
13
Dynamic params using remoteLink in Grails
I want to make an Ajax call using remoteLink (with Prototype as the Javascript library) but I need one of the parameters being passed to be the value from a textfield. Here's what I have so far in my GSP: <input id="email" name="email" type="text"/> ... <g:remoteLink action="addEmail" params="[email:???]">Add</g:remoteLink> What do I put in place of ??? to get the remoteLink to send the value of the email textfield as a parameter? Essentially, how do I reference/access the DOM within a Grails tag? I tried putting \$('email').value in place of ??? but I got a "Could not parse script" error in my GSP. Thanks
grails
null
null
null
null
null
open
Dynamic params using remoteLink in Grails === I want to make an Ajax call using remoteLink (with Prototype as the Javascript library) but I need one of the parameters being passed to be the value from a textfield. Here's what I have so far in my GSP: <input id="email" name="email" type="text"/> ... <g:remoteLink action="addEmail" params="[email:???]">Add</g:remoteLink> What do I put in place of ??? to get the remoteLink to send the value of the email textfield as a parameter? Essentially, how do I reference/access the DOM within a Grails tag? I tried putting \$('email').value in place of ??? but I got a "Could not parse script" error in my GSP. Thanks
0
8,533,488
12/16/2011 11:23:54
1,101,207
12/16/2011 04:05:48
6
0
User input equation
Is it possible, in c++, to turn user input into an equation. Example: User inputs x + 2. Programs asks for value of x. Lets say x = 3. Then program outputs 5.
c++
input
equation
null
null
12/16/2011 11:54:51
not constructive
User input equation === Is it possible, in c++, to turn user input into an equation. Example: User inputs x + 2. Programs asks for value of x. Lets say x = 3. Then program outputs 5.
4
10,203,193
04/18/2012 05:15:06
1,285,815
03/22/2012 11:43:52
1
0
HTML Email Newsletter Editing
i'm developing a website like email marrketing campaign in Asp.Net C# and i want to add functionality of editing of email newsletters like exist in email marketing system you may see. plz guide me how can i add this functionality thanks
c#
null
null
null
null
04/19/2012 11:08:34
not a real question
HTML Email Newsletter Editing === i'm developing a website like email marrketing campaign in Asp.Net C# and i want to add functionality of editing of email newsletters like exist in email marketing system you may see. plz guide me how can i add this functionality thanks
1
4,871,914
02/02/2011 07:46:08
574,005
01/13/2011 09:27:08
1
0
Php textbox problem when onclick !!!!!!
I'm just trying to display a table in client side from database as a distinct value from every column. Here i have fetched the value by using "select distinct ...." code and put this value in a single textbox ![enter image description here][1] [1]: http://i.stack.imgur.com/9cn09.png as image shown here..(tamil english,telugu tese values are distinct from database and displayed) but by using onclick function i'm trying to ge the value when onclick on text box... but displays undefined... can any one sujjest me....
php
javascript
mysql
null
null
null
open
Php textbox problem when onclick !!!!!! === I'm just trying to display a table in client side from database as a distinct value from every column. Here i have fetched the value by using "select distinct ...." code and put this value in a single textbox ![enter image description here][1] [1]: http://i.stack.imgur.com/9cn09.png as image shown here..(tamil english,telugu tese values are distinct from database and displayed) but by using onclick function i'm trying to ge the value when onclick on text box... but displays undefined... can any one sujjest me....
0
7,652,020
10/04/2011 17:53:43
160,820
08/21/2009 14:09:57
751
21
New to PHP - need Code refactoring
<?php $db = mysql_connect ( 'localhost', 'foo', 'foo' ); mysql_select_db('foo', $db); $order = strval(@$_REQUEST['order']); $condition = array( username => strval(@$_REQUEST['username']), password => strval(@$_REQUEST['password']), ); $sql = "SELECT 1 FROM user"; $results = getResults($sql, $condition, $order); if (count($results)) { echo "Login ok!"; } else { echo "Login nicht ok!"; } function getResults ( $sql, $condition, $order ) { $where = array(); foreach ($condition as $field => $value) { $where[] = $field . ' = ' . '"'.addslashes($value).'"'; } if (count($where)) { $sql .= ' WHERE ' . implode(' AND ', $where); } $sql .= " $order"; $results = array(); $result = mysql_query($sql); while (($row = mysql_fetch_object($result)) !== FALSE) { $results[] = $row; } return $results; } ?>
php
php5
null
null
null
10/04/2011 17:57:26
off topic
New to PHP - need Code refactoring === <?php $db = mysql_connect ( 'localhost', 'foo', 'foo' ); mysql_select_db('foo', $db); $order = strval(@$_REQUEST['order']); $condition = array( username => strval(@$_REQUEST['username']), password => strval(@$_REQUEST['password']), ); $sql = "SELECT 1 FROM user"; $results = getResults($sql, $condition, $order); if (count($results)) { echo "Login ok!"; } else { echo "Login nicht ok!"; } function getResults ( $sql, $condition, $order ) { $where = array(); foreach ($condition as $field => $value) { $where[] = $field . ' = ' . '"'.addslashes($value).'"'; } if (count($where)) { $sql .= ' WHERE ' . implode(' AND ', $where); } $sql .= " $order"; $results = array(); $result = mysql_query($sql); while (($row = mysql_fetch_object($result)) !== FALSE) { $results[] = $row; } return $results; } ?>
2
3,344,826
07/27/2010 14:47:16
292,291
03/12/2010 10:53:07
622
13
Is it approperiate to request users to look for own hosting resources?
i am wondering if its ok to request users to use own hosting resources for images, videos etc. i think stack overflow does the same for images too right? another option i am looking at is integration with such services. some well known ones i am thinking of are - twitpic, flickr, imageshack for images - screenr, youtube for videos - slideshare for slideshows - snipplr, pastebin for large amts of code/text 1 main reason why i am thinking of using such external hosts are so that i can save up on hosting large amts of data. also so that i do not need to manage such resources. - 1 concern is for services like screenr, twitpic, flickr etc where hosted resources "belongs" to the poster. - only services that have "anonymous" posting like imageshack, pastebin will be more appropriate for such integration?
web-services
null
null
null
null
07/28/2010 15:28:35
off topic
Is it approperiate to request users to look for own hosting resources? === i am wondering if its ok to request users to use own hosting resources for images, videos etc. i think stack overflow does the same for images too right? another option i am looking at is integration with such services. some well known ones i am thinking of are - twitpic, flickr, imageshack for images - screenr, youtube for videos - slideshare for slideshows - snipplr, pastebin for large amts of code/text 1 main reason why i am thinking of using such external hosts are so that i can save up on hosting large amts of data. also so that i do not need to manage such resources. - 1 concern is for services like screenr, twitpic, flickr etc where hosted resources "belongs" to the poster. - only services that have "anonymous" posting like imageshack, pastebin will be more appropriate for such integration?
2
7,173,379
08/24/2011 09:45:44
209,636
11/12/2009 14:12:07
30
0
What are the differences between Spring Frameworks of Java?
currently I'm working in a project using Spring, this is the first time i learn Spring framework, I haved learnt some experience in spring 2.0. Then I have a question want to know "What is the difference between Spring 2.0, Spring 2.5 and Spring 3.0". Thank for take your time!
java
spring
null
null
null
08/25/2011 12:53:12
not constructive
What are the differences between Spring Frameworks of Java? === currently I'm working in a project using Spring, this is the first time i learn Spring framework, I haved learnt some experience in spring 2.0. Then I have a question want to know "What is the difference between Spring 2.0, Spring 2.5 and Spring 3.0". Thank for take your time!
4
621,418
03/07/2009 06:21:35
10,333
09/15/2008 22:28:36
504
25
Best cross-platform/SQL GUI?
I use SQL Server 2005, MySql, and Posgresql regularly. I'm tired of using Microsoft's SQL tool for SQL Server, phpMyAdmin for MySql, and pgAdmin for Postgres. Is there a decent cross-platform GUI that I can use for all of these database servers? I don't care about the actual database administration part, I realize that each vendor's tool has specific functionality for administrative purposes. I just care about running queries on data. I prefer free, but if a good tool is going to cost me a little bit of money, that's fine. Thanks!
sql
mysql
sql-server
postgresql
null
05/22/2012 10:09:42
not constructive
Best cross-platform/SQL GUI? === I use SQL Server 2005, MySql, and Posgresql regularly. I'm tired of using Microsoft's SQL tool for SQL Server, phpMyAdmin for MySql, and pgAdmin for Postgres. Is there a decent cross-platform GUI that I can use for all of these database servers? I don't care about the actual database administration part, I realize that each vendor's tool has specific functionality for administrative purposes. I just care about running queries on data. I prefer free, but if a good tool is going to cost me a little bit of money, that's fine. Thanks!
4
9,747,882
03/17/2012 06:34:54
1,275,405
03/17/2012 06:27:06
1
0
Which data structure is appropriate for storing paths of file system?
by using the parent path, i need to traverse and store all the folders and files paths that lie within that parent path. so which data structure should be applied here?
java
null
null
null
null
03/21/2012 12:44:02
not a real question
Which data structure is appropriate for storing paths of file system? === by using the parent path, i need to traverse and store all the folders and files paths that lie within that parent path. so which data structure should be applied here?
1
8,006,697
11/04/2011 08:40:58
633,784
02/25/2011 08:34:51
132
2
Finding maximum distance between (x,y) coordinates
Im trying to calculate the maximum manhattan distance of a large 2D input , the inputs are consisting of (x, y)s and what I want to do is to calculate the maximum distance between two of those coordinates In less than O(n^2) time , I can do it in O(n^2) by going through all of elements sth like : *(Manhattan distance is between two points (X1,Y1) and (X2,Y2) is : |X1-X2| + |Y1-Y2|) for ( 0 -> n ) for ( 0-> n ) { // here i calculate |Xi - Xj| + |Yi - Yj| which is maximum } but what It won't work efficiently for very large inputs :( anyone has any idea for a better algorithm ?
java
c++
algorithm
distance
null
null
open
Finding maximum distance between (x,y) coordinates === Im trying to calculate the maximum manhattan distance of a large 2D input , the inputs are consisting of (x, y)s and what I want to do is to calculate the maximum distance between two of those coordinates In less than O(n^2) time , I can do it in O(n^2) by going through all of elements sth like : *(Manhattan distance is between two points (X1,Y1) and (X2,Y2) is : |X1-X2| + |Y1-Y2|) for ( 0 -> n ) for ( 0-> n ) { // here i calculate |Xi - Xj| + |Yi - Yj| which is maximum } but what It won't work efficiently for very large inputs :( anyone has any idea for a better algorithm ?
0
10,140,750
04/13/2012 12:24:09
1,331,316
04/13/2012 10:23:13
3
0
How to create dynamic map images?
So I want to know how I can use a png or similar vector imagery format of a map image, and add functionality to it using php? As in, what are the basics of adding dynamism to images using any programming language? Support materials and references would be appreciated. I use Illustrator to draw or modify my maps. PHP to code. HTML, CSS for the design. And MySQL for the db.
php
mysql
gis
vector-graphics
adobe-illustrator
04/14/2012 02:41:44
not a real question
How to create dynamic map images? === So I want to know how I can use a png or similar vector imagery format of a map image, and add functionality to it using php? As in, what are the basics of adding dynamism to images using any programming language? Support materials and references would be appreciated. I use Illustrator to draw or modify my maps. PHP to code. HTML, CSS for the design. And MySQL for the db.
1
6,786,583
07/22/2011 06:50:12
834,032
07/07/2011 17:20:13
214
4
Question on submit and push buttons. and also the scripting language in HTML
Iam working on HTML.and As for now Im going well.But the thing I want to know is about the submit button.I have created user and password and a submit button and a register button.The basic question on my mind for now is, how the facebook users or may be email user names are stored and how they are retrieved back when they press enter . Where do they save the user names and passwords? and How do i save the user name and the password that is entered through submit button in some other file? I have written perl scripts and c programs for saving and retreiving passwords using file concepts.But how do i manage them in HTML.Do they also save these data in some file and search for the user and password using some python or perl script and send back the result? because searching and sorting techniques are powerful with the above scripts.I dont know how to use them in HTML and also the question is,can we use them in HTML? Please let me know How to make it through.And can we also redirect to some links when we use click button and push buttons ?
html
html5
null
null
null
07/23/2011 22:41:03
not a real question
Question on submit and push buttons. and also the scripting language in HTML === Iam working on HTML.and As for now Im going well.But the thing I want to know is about the submit button.I have created user and password and a submit button and a register button.The basic question on my mind for now is, how the facebook users or may be email user names are stored and how they are retrieved back when they press enter . Where do they save the user names and passwords? and How do i save the user name and the password that is entered through submit button in some other file? I have written perl scripts and c programs for saving and retreiving passwords using file concepts.But how do i manage them in HTML.Do they also save these data in some file and search for the user and password using some python or perl script and send back the result? because searching and sorting techniques are powerful with the above scripts.I dont know how to use them in HTML and also the question is,can we use them in HTML? Please let me know How to make it through.And can we also redirect to some links when we use click button and push buttons ?
1
5,217,290
03/07/2011 08:09:10
637,364
02/28/2011 08:34:57
6
0
Create a function to a function that runs a for loop?
I have made some code that creates a red border around an image when the user click on to highlite thats the choesen one. But I want to erase previous or all border with a white border around all images before a new click is made on another image. My question is how do I activate a call to a function when a click is made and how would a function look in jQuery? I just whant to use the .css to change the border in perhaps a loop and change the id of the images? Can I mix common javascript with jQuery, or should it only be pure jQuery code in a script? This is a simplified part of the code, it contains "minibild_1" to "minibild_5" $(document).ready(function(){ $("#minibild_1").click(function(){ $("#minibild_1").css({"border":"2px solid #D00C33"}); $("#storbild").attr("src","../bilder/bilder_stora/{$row1->bild_1}.jpg"); }); $("#minibild_2").click(function(){ $("#minibild_2").css({"border":"2px solid #D00C33"}); $("#storbild").attr("src","../bilder/bilder_stora/{$row1->bild_2}.jpg"); }); });
jquery
null
null
null
null
null
open
Create a function to a function that runs a for loop? === I have made some code that creates a red border around an image when the user click on to highlite thats the choesen one. But I want to erase previous or all border with a white border around all images before a new click is made on another image. My question is how do I activate a call to a function when a click is made and how would a function look in jQuery? I just whant to use the .css to change the border in perhaps a loop and change the id of the images? Can I mix common javascript with jQuery, or should it only be pure jQuery code in a script? This is a simplified part of the code, it contains "minibild_1" to "minibild_5" $(document).ready(function(){ $("#minibild_1").click(function(){ $("#minibild_1").css({"border":"2px solid #D00C33"}); $("#storbild").attr("src","../bilder/bilder_stora/{$row1->bild_1}.jpg"); }); $("#minibild_2").click(function(){ $("#minibild_2").css({"border":"2px solid #D00C33"}); $("#storbild").attr("src","../bilder/bilder_stora/{$row1->bild_2}.jpg"); }); });
0
7,927,215
10/28/2011 09:06:48
1,011,324
10/24/2011 16:57:43
1
0
how would one go about finding specific words in a text file in c++
Hello im stumped i don't know what im looking for i was wondering if someone could lead me in the right direction of referencing a file that contains text and if it contains .txt or .png .bat in text form then do something. any tips or advice would be great. thanks
c++
text
null
null
null
10/28/2011 09:44:00
not a real question
how would one go about finding specific words in a text file in c++ === Hello im stumped i don't know what im looking for i was wondering if someone could lead me in the right direction of referencing a file that contains text and if it contains .txt or .png .bat in text form then do something. any tips or advice would be great. thanks
1
9,071,406
01/30/2012 21:57:33
571,783
01/11/2011 19:30:33
694
28
jQuery .trigger() method in a loop
I have this piece of code: $(document).on("click", "#breadNavMain", function() { for(var i = 0; i < getActiveSlides().length; i++) { $("#studentWrapper").trigger("click"); } }); The method `getActiveSlides()` will return the slides (as an array) currently activated for my application. What's import is that I am getting the number of slides that are active. For anything over 1 active slide, the loop above does not work. If I have 3 active slides (for example), it will only call the `.trigger()` method once. Within my click handler, if I instead use: $("#studentWrapper").trigger("click"); $("#studentWrapper").trigger("click"); $("#studentWrapper").trigger("click"); It will work just fine. The problem is that I don't know how many times I'll need to call the `.trigger()` method so I am unable to do this manually. I wanted to call it inside of a loop like I tried to above. Is there anyway to get `.trigger()` to work inside of a loop?
jquery
arrays
events
loops
null
null
open
jQuery .trigger() method in a loop === I have this piece of code: $(document).on("click", "#breadNavMain", function() { for(var i = 0; i < getActiveSlides().length; i++) { $("#studentWrapper").trigger("click"); } }); The method `getActiveSlides()` will return the slides (as an array) currently activated for my application. What's import is that I am getting the number of slides that are active. For anything over 1 active slide, the loop above does not work. If I have 3 active slides (for example), it will only call the `.trigger()` method once. Within my click handler, if I instead use: $("#studentWrapper").trigger("click"); $("#studentWrapper").trigger("click"); $("#studentWrapper").trigger("click"); It will work just fine. The problem is that I don't know how many times I'll need to call the `.trigger()` method so I am unable to do this manually. I wanted to call it inside of a loop like I tried to above. Is there anyway to get `.trigger()` to work inside of a loop?
0
7,440,461
09/16/2011 05:24:34
948,180
09/16/2011 05:24:34
1
0
t is undefined Line 18 Jquery fancybox 1.3.4
We are using tabs and fancybox on same page. not sure about if the order of js lib include matters.
jquery
tabs
fancybox
undefined
null
09/16/2011 09:37:20
not a real question
t is undefined Line 18 Jquery fancybox 1.3.4 === We are using tabs and fancybox on same page. not sure about if the order of js lib include matters.
1
8,015,903
11/04/2011 21:23:42
974,594
10/01/2011 15:20:24
45
0
java tokenize big files to hashtable
I'm having this problem: I'm reading 900 files and, after processing the files, my final output will be an HashMap<String, <HashMap<String, Double>>. First string is fileName, second string is word and the double is word frequency. The processing order is as follows: - read the first file - read the first line of the file - split the important tokens to a string array - copy the string array to my final map, incrementing word frequencies - repeat for all files PS. I'm using string BufferedReader. The problem is, after processing the first files, the Hash becomes so big that the performance is very low after a while. I would like to hear solution for this. My idea is to create a limited hash, after the limit reached store into a file. do that until everything is processed, mix all the hashs at the end.
java
hashmap
corpus
null
null
null
open
java tokenize big files to hashtable === I'm having this problem: I'm reading 900 files and, after processing the files, my final output will be an HashMap<String, <HashMap<String, Double>>. First string is fileName, second string is word and the double is word frequency. The processing order is as follows: - read the first file - read the first line of the file - split the important tokens to a string array - copy the string array to my final map, incrementing word frequencies - repeat for all files PS. I'm using string BufferedReader. The problem is, after processing the first files, the Hash becomes so big that the performance is very low after a while. I would like to hear solution for this. My idea is to create a limited hash, after the limit reached store into a file. do that until everything is processed, mix all the hashs at the end.
0
9,484,760
02/28/2012 15:29:28
543,844
12/15/2010 19:57:28
126
8
Android ViewPager and Unlimited Views
Good morning, I'm working with ViewPager and PagerAdapter to display a Day View calendar. The calendar will start on today when loaded and the user can then swipe left to get to tomorrow or right to get to yesterday, continuing to swipe in either direction for as far as they want. The final statement there is the problem. Is there a way to use ViewPager with an unlimited number of views? I've tested my base code and have been able to set the total number of views to 10,000 and asked the pager to start me on page 5,000 and it works completely fine. As long as there are no memory concerns, I may just go this route, anticipating that the user will not likely swipe 5,000 days in either direction. ViewPager is an awesome gift for Android developers, so I'll find a way to use it. Who else is using it and are you using it with a large amount of views? Thanks! db
android
android-viewpager
null
null
null
02/28/2012 15:42:46
not constructive
Android ViewPager and Unlimited Views === Good morning, I'm working with ViewPager and PagerAdapter to display a Day View calendar. The calendar will start on today when loaded and the user can then swipe left to get to tomorrow or right to get to yesterday, continuing to swipe in either direction for as far as they want. The final statement there is the problem. Is there a way to use ViewPager with an unlimited number of views? I've tested my base code and have been able to set the total number of views to 10,000 and asked the pager to start me on page 5,000 and it works completely fine. As long as there are no memory concerns, I may just go this route, anticipating that the user will not likely swipe 5,000 days in either direction. ViewPager is an awesome gift for Android developers, so I'll find a way to use it. Who else is using it and are you using it with a large amount of views? Thanks! db
4
6,167,703
05/29/2011 12:24:53
707,729
04/14/2011 10:09:34
35
0
Tool for drawing the web interface.
What program was used to draw the picture below? ![enter image description here][1] [1]: http://i.stack.imgur.com/ehM1Q.png
drawing
null
null
null
null
05/29/2011 14:20:25
off topic
Tool for drawing the web interface. === What program was used to draw the picture below? ![enter image description here][1] [1]: http://i.stack.imgur.com/ehM1Q.png
2
9,419,429
02/23/2012 19:01:03
706,167
04/13/2011 13:46:59
1
0
C or JAVA for a graphics app?
i'm doing a home work in Java. It's a renderer for 3D shapes and figures. For now, the software is quite simple: - an very simple scripting language for describing what to draw - a simple gui with a smart preview - a renderer which renders images or animations via files or screen. I'm asking myself two questions: 1) should i take the soft to C language ? +: speed -: harder to develop, to run. I don't talk about garbage collector since i don't use it very much. 2) keep the soft in Java, just change code for less heap memory usage: Use arrays contained in classes instead of (LARGE) collections of complex objects. ( i used that technique in ZBuffer implementation : Memory Usage -- Speed +++) A last question : how to design a script language? Especially for 3D shapes and figures? THKS
design
graphics
language
null
null
03/02/2012 03:34:16
not constructive
C or JAVA for a graphics app? === i'm doing a home work in Java. It's a renderer for 3D shapes and figures. For now, the software is quite simple: - an very simple scripting language for describing what to draw - a simple gui with a smart preview - a renderer which renders images or animations via files or screen. I'm asking myself two questions: 1) should i take the soft to C language ? +: speed -: harder to develop, to run. I don't talk about garbage collector since i don't use it very much. 2) keep the soft in Java, just change code for less heap memory usage: Use arrays contained in classes instead of (LARGE) collections of complex objects. ( i used that technique in ZBuffer implementation : Memory Usage -- Speed +++) A last question : how to design a script language? Especially for 3D shapes and figures? THKS
4
5,669,784
04/14/2011 21:14:38
463,304
09/30/2010 21:11:12
1,966
88
Eclipse: Save files without asking when I click run
Is there a way to save files without asking in Eclipse? Every time I click Run, it asks me if I want to save the file, and I always do.
eclipse
null
null
null
null
null
open
Eclipse: Save files without asking when I click run === Is there a way to save files without asking in Eclipse? Every time I click Run, it asks me if I want to save the file, and I always do.
0
8,618,082
12/23/2011 16:03:12
483,567
10/21/2010 21:29:50
443
23
Visitor Pattern in Scala
Is there any use cases of using [Visitor Pattern][1] with Scala? Should I use *Pattern Matching* Should every time I'd used visitor in Java. [1]: http://en.wikipedia.org/wiki/Visitor_pattern
design-patterns
scala
null
null
null
null
open
Visitor Pattern in Scala === Is there any use cases of using [Visitor Pattern][1] with Scala? Should I use *Pattern Matching* Should every time I'd used visitor in Java. [1]: http://en.wikipedia.org/wiki/Visitor_pattern
0
7,428,912
09/15/2011 09:46:10
673,730
03/23/2011 19:21:18
2,169
140
For index declaration in C++
Is there any difference code-wise between: int i = 0; for ( i = 0 ; i < n ; i++ ) { } and for ( int i = 0 ; i < n ; i++ ) { } Maybe if there are more loops and they all use the same index? Also, is the first version equivalent to: int i = 0; for ( ; i < n ; i++ ) { } I know the optimizer should be smart enough to generate the same code at least, but is there theoretically any difference?
c++
syntax
null
null
null
05/03/2012 19:55:26
too localized
For index declaration in C++ === Is there any difference code-wise between: int i = 0; for ( i = 0 ; i < n ; i++ ) { } and for ( int i = 0 ; i < n ; i++ ) { } Maybe if there are more loops and they all use the same index? Also, is the first version equivalent to: int i = 0; for ( ; i < n ; i++ ) { } I know the optimizer should be smart enough to generate the same code at least, but is there theoretically any difference?
3
6,452,689
06/23/2011 10:37:36
55,794
01/16/2009 10:40:35
1,053
66
Sonar ANT Task -
I've followed the [basic instructions to integrate an ANT target][1] with sonar. <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> <classpath path="${3pp.dir}/ant/sonar-ant-task-1.0.jar" /> </taskdef> <property name="sonar.host.url" value="http://xsx:9000" /> <target name="sonar"> <!-- The workDir directory is used by Sonar to store temporary files --> <sonar:sonar workDir="." key="org.example:example" version="0.1-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant"> <!-- source directories (required) --> <sources> <path location="${src.dir}"/> </sources> <!-- list of properties (optional) --> <property key="sonar.projectName" value="tp" /> <property key="sonar.dynamicAnalysis" value="false" /> <!-- test source directories (optional) --> <tests> <path location="${src.dir}"/> </tests> </sonar:sonar> </target> When i run the target I get this exception. Do i need to add specific xml parser jars to the target in order for it to work? [sonar:sonar] Sonar version: 2.8 BUILD FAILED /home/assure/projects/touchpoint/main/sonar.xml:20: javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:170) at org.sonar.ant.SonarTask.execute(SonarTask.java:151) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:134) at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:56) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:105) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:76) at org.sonar.ant.Launcher.initLogging(Launcher.java:133) at org.sonar.ant.Launcher.execute(Launcher.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:167) ... 17 more --- Nested Exception --- javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:134) at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:56) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:105) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:76) at org.sonar.ant.Launcher.initLogging(Launcher.java:133) at org.sonar.ant.Launcher.execute(Launcher.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:167) at org.sonar.ant.SonarTask.execute(SonarTask.java:151) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) [1]: http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task+1.0
ant
sonar
null
null
null
06/26/2011 13:18:47
too localized
Sonar ANT Task - === I've followed the [basic instructions to integrate an ANT target][1] with sonar. <taskdef uri="antlib:org.sonar.ant" resource="org/sonar/ant/antlib.xml"> <classpath path="${3pp.dir}/ant/sonar-ant-task-1.0.jar" /> </taskdef> <property name="sonar.host.url" value="http://xsx:9000" /> <target name="sonar"> <!-- The workDir directory is used by Sonar to store temporary files --> <sonar:sonar workDir="." key="org.example:example" version="0.1-SNAPSHOT" xmlns:sonar="antlib:org.sonar.ant"> <!-- source directories (required) --> <sources> <path location="${src.dir}"/> </sources> <!-- list of properties (optional) --> <property key="sonar.projectName" value="tp" /> <property key="sonar.dynamicAnalysis" value="false" /> <!-- test source directories (optional) --> <tests> <path location="${src.dir}"/> </tests> </sonar:sonar> </target> When i run the target I get this exception. Do i need to add specific xml parser jars to the target in order for it to work? [sonar:sonar] Sonar version: 2.8 BUILD FAILED /home/assure/projects/touchpoint/main/sonar.xml:20: javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:170) at org.sonar.ant.SonarTask.execute(SonarTask.java:151) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) Caused by: javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:134) at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:56) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:105) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:76) at org.sonar.ant.Launcher.initLogging(Launcher.java:133) at org.sonar.ant.Launcher.execute(Launcher.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:167) ... 17 more --- Nested Exception --- javax.xml.parsers.FactoryConfigurationError: Provider com.icl.saxon.aelfred.SAXParserFactoryImpl not found at javax.xml.parsers.SAXParserFactory.newInstance(SAXParserFactory.java:134) at ch.qos.logback.core.joran.event.SaxEventRecorder.recordEvents(SaxEventRecorder.java:56) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:105) at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:76) at org.sonar.ant.Launcher.initLogging(Launcher.java:133) at org.sonar.ant.Launcher.execute(Launcher.java:59) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:167) at org.sonar.ant.SonarTask.execute(SonarTask.java:151) at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288) at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:105) at org.apache.tools.ant.Task.perform(Task.java:348) at org.apache.tools.ant.Target.execute(Target.java:357) at org.apache.tools.ant.Target.performTasks(Target.java:385) at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1329) at org.apache.tools.ant.Project.executeTarget(Project.java:1298) at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41) at org.apache.tools.ant.Project.executeTargets(Project.java:1181) at org.apache.tools.ant.Main.runBuild(Main.java:698) at org.apache.tools.ant.Main.startAnt(Main.java:199) at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257) at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104) [1]: http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task+1.0
3
8,569,500
12/20/2011 00:45:50
1,028,940
11/04/2011 02:19:12
6
0
Button Sometimes Functions
I have three view controllers. I used the flipsideproject template and then added another view controller. There is a button on the first view controller that goes to the second view controller. There is a button on the second view controller that goes back to the first one. When switching between the first and second, those buttons always work. It is the same situation with the second and third view controller. When I try to transfer between the first to second to third and then back to first, it does not work. (1-->2-->3-->2-/->1) My poorly drawn diagram depicts the situation. I had all of the back buttons connected to the back IBAction, which I thought was the problem. I then made another IBAction, but it has not fixed the problem. Any ideas? I'm new. If someone can tell me how to add the source code to my post I will. Thanks.
button
view
null
null
null
null
open
Button Sometimes Functions === I have three view controllers. I used the flipsideproject template and then added another view controller. There is a button on the first view controller that goes to the second view controller. There is a button on the second view controller that goes back to the first one. When switching between the first and second, those buttons always work. It is the same situation with the second and third view controller. When I try to transfer between the first to second to third and then back to first, it does not work. (1-->2-->3-->2-/->1) My poorly drawn diagram depicts the situation. I had all of the back buttons connected to the back IBAction, which I thought was the problem. I then made another IBAction, but it has not fixed the problem. Any ideas? I'm new. If someone can tell me how to add the source code to my post I will. Thanks.
0
9,679,690
03/13/2012 07:08:16
911,063
08/25/2011 02:59:27
11
0
Ragtag apparently not working?
I am currently trying to use ragtag to close some of my html tags in ERB files. However, pressing something like (C-X)/ (which I interpret to be , "CONTROL" + "uppercase X" + "/") it just prints the / to the buffer. Any ideas?
vim
null
null
null
null
null
open
Ragtag apparently not working? === I am currently trying to use ragtag to close some of my html tags in ERB files. However, pressing something like (C-X)/ (which I interpret to be , "CONTROL" + "uppercase X" + "/") it just prints the / to the buffer. Any ideas?
0
9,116,768
02/02/2012 17:17:11
1,096,040
12/13/2011 15:18:46
3
1
Convert JQuery to JavaScript
My knowledge of Jquery & Javascript is limited at best, but I'm under the impression QJuery is basically a simplified version of JavaScript. If that is the case is there a way of converting this code to Javascript so I don't have to call the JQuery Library as it seems to be causing other JavaScript Functions to not work? function toggleStatus(mynum) { $('#product_'+mynum+'_submit_button').removeAttr('disabled'); }
javascript
jquery
null
null
null
null
open
Convert JQuery to JavaScript === My knowledge of Jquery & Javascript is limited at best, but I'm under the impression QJuery is basically a simplified version of JavaScript. If that is the case is there a way of converting this code to Javascript so I don't have to call the JQuery Library as it seems to be causing other JavaScript Functions to not work? function toggleStatus(mynum) { $('#product_'+mynum+'_submit_button').removeAttr('disabled'); }
0
1,643,842
10/29/2009 13:44:22
79,708
03/18/2009 20:16:19
1,091
52
Can ComboBox in AjaxToolkit use lazy loading
Can I make ComboBox from AjaxToolkit make call to server every time new letter is entered and update ComboBox items?
asp.net
ajaxtoolkit
null
null
null
null
open
Can ComboBox in AjaxToolkit use lazy loading === Can I make ComboBox from AjaxToolkit make call to server every time new letter is entered and update ComboBox items?
0
11,394,166
07/09/2012 11:29:14
1,115,161
12/25/2011 07:56:31
120
5
Use document.write() to write the result in a separate page
I am writing an html code into javascript using document.write(). but the result came in the same page, I want to display the result in a separate page. document.write('<table width="1000" border="1">'); document.write('<tr width="1000">'); document.write('<td width="100" bgcolor="#D8D8D8">Country</td>'); document.write('<td width="100" bgcolor="#D8D8D8">MCC</td>'); document.write('<td width="100" bgcolor="#D8D8D8">MNC</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Network</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Old Price</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Current Price</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Effective</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Status</td>'); document.write('</tr>'); document.write('</table>'); So this table is being displayed in the webpage, I want this result to be displayed in another webpage. Thanks in advanced.
javascript
html
null
null
null
null
open
Use document.write() to write the result in a separate page === I am writing an html code into javascript using document.write(). but the result came in the same page, I want to display the result in a separate page. document.write('<table width="1000" border="1">'); document.write('<tr width="1000">'); document.write('<td width="100" bgcolor="#D8D8D8">Country</td>'); document.write('<td width="100" bgcolor="#D8D8D8">MCC</td>'); document.write('<td width="100" bgcolor="#D8D8D8">MNC</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Network</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Old Price</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Current Price</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Effective</td>'); document.write('<td width="100" bgcolor="#D8D8D8">Status</td>'); document.write('</tr>'); document.write('</table>'); So this table is being displayed in the webpage, I want this result to be displayed in another webpage. Thanks in advanced.
0
8,160,407
11/16/2011 23:52:07
1,002,950
10/19/2011 10:41:59
63
0
How to improve performance or change approach in dynamically load templets by select option list?
In my solution at each selected elements on list JavaScript $.get template trought controller. It is not optimal. Is there any method to reduce requests? How to DRY for date fields in templates. Maybe exist better solution to get similar effect? I already tried jquery show/hide but hidden forms were also sent I decided to form from templates. javascript: $(document).ready(function () { $('#meeting_type_id').change(function () { var selected = $(this).val(); if(selected==''){ $("#time_form").html(''); }else if(selected=='1' || selected=='2') { $.get('meetings/type_form/once', function(data){ $("#time_form").html(data); }); }else{ $.get('meetings/time_form/many', function(data){ $("#time_form").html(data); }); } return false; // $('#time_form').html("= render (:partial => 'once')"); }); }); controller: def time_form type = params[:id] if type == "once" render :partial => 'once' else render :partial => 'many' end end templates: /_once.html.haml/ %input{:name => "meeting[from]", :type => "date", :value => "2011-11-17" /_many.html.haml/ %input{:name => "meeting[from]", :type => "date", :value => "2011-11-17" %input{:name => "meeting[to]", :type => "date", :value => "2011-11-17" view: = collection_select(:meeting, :type_id, Type.all, :id, :type, :prompt => 'Please select type') /generates:/ <select id="meeting_type_id" name="meeting[type_id]"> <option value>Please select type</option> <option value="1">once in golf</option> <option value="2">once in pub</option> <option value="3">many in golf</option> <option value="4">many in pub</option> </select> <div id="time_form"></div>
javascript
jquery
ruby-on-rails-3
null
null
null
open
How to improve performance or change approach in dynamically load templets by select option list? === In my solution at each selected elements on list JavaScript $.get template trought controller. It is not optimal. Is there any method to reduce requests? How to DRY for date fields in templates. Maybe exist better solution to get similar effect? I already tried jquery show/hide but hidden forms were also sent I decided to form from templates. javascript: $(document).ready(function () { $('#meeting_type_id').change(function () { var selected = $(this).val(); if(selected==''){ $("#time_form").html(''); }else if(selected=='1' || selected=='2') { $.get('meetings/type_form/once', function(data){ $("#time_form").html(data); }); }else{ $.get('meetings/time_form/many', function(data){ $("#time_form").html(data); }); } return false; // $('#time_form').html("= render (:partial => 'once')"); }); }); controller: def time_form type = params[:id] if type == "once" render :partial => 'once' else render :partial => 'many' end end templates: /_once.html.haml/ %input{:name => "meeting[from]", :type => "date", :value => "2011-11-17" /_many.html.haml/ %input{:name => "meeting[from]", :type => "date", :value => "2011-11-17" %input{:name => "meeting[to]", :type => "date", :value => "2011-11-17" view: = collection_select(:meeting, :type_id, Type.all, :id, :type, :prompt => 'Please select type') /generates:/ <select id="meeting_type_id" name="meeting[type_id]"> <option value>Please select type</option> <option value="1">once in golf</option> <option value="2">once in pub</option> <option value="3">many in golf</option> <option value="4">many in pub</option> </select> <div id="time_form"></div>
0
7,808,664
10/18/2011 14:14:12
364,746
06/11/2010 16:51:50
854
30
How to get Maven project BaseDir() from java Code
How to get Maven project basedir() from my Java code?
java
maven-2
null
null
null
10/20/2011 10:18:56
not a real question
How to get Maven project BaseDir() from java Code === How to get Maven project basedir() from my Java code?
1
1,380,016
09/04/2009 15:40:24
158,784
08/18/2009 20:47:22
1
0
Does anybody know of a CSS analysis tool?
I'm looking for a tool that can analyze a large site and look for orphaned css. I work on this project that has gone through a couple of UI updates. Scrapping the whole thing and redoing it all would take forever. What I would like is a tool that reads a css file and then lets you browse the site, keeping track of what definitions were used and how often. Then I can go through the css file and find code that I did use and determine if it is indeed deprecated and can be deleted. Thoughts?
css
null
null
null
null
02/12/2012 20:27:14
not constructive
Does anybody know of a CSS analysis tool? === I'm looking for a tool that can analyze a large site and look for orphaned css. I work on this project that has gone through a couple of UI updates. Scrapping the whole thing and redoing it all would take forever. What I would like is a tool that reads a css file and then lets you browse the site, keeping track of what definitions were used and how often. Then I can go through the css file and find code that I did use and determine if it is indeed deprecated and can be deleted. Thoughts?
4
9,948,370
03/30/2012 18:16:14
378,887
06/29/2010 10:28:39
74
1
is programming by voice possible
I've recently started to get pain in my arms and I was wondering if programming using voice software would be possible. I've used dragon naturally speaking several years ago but it was clunky and didnt really work too well with my ide at the time (netbeans) Does anyone have any experience with programming by voice and if so, what software they would recommend
voice-recognition
null
null
null
null
04/01/2012 07:56:09
off topic
is programming by voice possible === I've recently started to get pain in my arms and I was wondering if programming using voice software would be possible. I've used dragon naturally speaking several years ago but it was clunky and didnt really work too well with my ide at the time (netbeans) Does anyone have any experience with programming by voice and if so, what software they would recommend
2
8,426,006
12/08/2011 04:04:13
1,086,978
12/08/2011 03:56:22
1
0
Ask for input from read line?
I am trying to create a script, for example would ask the user how many numbers? If the user asks for 3, it should create 3 questions asking what ur first number, whats ur second number and so on? Thank You
linux
bash
shell
null
null
12/08/2011 22:09:20
too localized
Ask for input from read line? === I am trying to create a script, for example would ask the user how many numbers? If the user asks for 3, it should create 3 questions asking what ur first number, whats ur second number and so on? Thank You
3
11,046,512
06/15/2012 07:39:43
1,458,071
06/15/2012 07:36:17
1
0
Animation of fireworks on the screen of the app
In animation I am trying to implement the fireworks animation on the screen a.k.a the Tango Android app. How do I implement this on the screen? 1. Do I have to start a transparent activity with running a short clip of fireworks with a transparent background? 2. Something else?
android
android-animation
null
null
null
null
open
Animation of fireworks on the screen of the app === In animation I am trying to implement the fireworks animation on the screen a.k.a the Tango Android app. How do I implement this on the screen? 1. Do I have to start a transparent activity with running a short clip of fireworks with a transparent background? 2. Something else?
0
11,321,166
07/04/2012 00:58:35
1,436,153
06/04/2012 22:11:19
30
0
Using an older version of JRE for certain programs
I have learned that on my computer, Minecraft will only run with Java 6 installed. As soon as I install java 7 (JDK or otherwise), the application encounters multiple problems (doesn't crash, just can't connect to any file servers.) My question is: Is there a way to allow Minecraft to use Java 6 while all other programs use 7?
java
jre
null
null
null
07/05/2012 13:12:13
off topic
Using an older version of JRE for certain programs === I have learned that on my computer, Minecraft will only run with Java 6 installed. As soon as I install java 7 (JDK or otherwise), the application encounters multiple problems (doesn't crash, just can't connect to any file servers.) My question is: Is there a way to allow Minecraft to use Java 6 while all other programs use 7?
2
8,634,552
12/26/2011 09:41:46
866,912
07/28/2011 07:14:44
1
0
SP2010, delete is not appearing in Document Library
I am site collection administrator. I am creating a Document Library and uploaded some docs in it. but when i again opened that Library i am not able to delete any docs. when i select any document neither delete button on ECB menu nor in Ribbon button appears pls help ...
sharepoint
sharepoint2010
null
null
null
12/26/2011 23:16:13
off topic
SP2010, delete is not appearing in Document Library === I am site collection administrator. I am creating a Document Library and uploaded some docs in it. but when i again opened that Library i am not able to delete any docs. when i select any document neither delete button on ECB menu nor in Ribbon button appears pls help ...
2
1,561,007
10/13/2009 15:32:21
149,224
08/02/2009 07:56:47
1
0
C++: error when have private copy ctor with public assignment operator
Can one of you explain why the following piece of code does not compile? #include <iostream> using namespace std; class Foo { public: Foo() { cout << "Foo::Foo()" << endl << endl; } Foo& operator=(const Foo&) { cout << "Foo::operator=(const Foo&)" << endl << endl; } private: Foo(const Foo& b) { *this = b; cout << "Foo::Foo(const Foo&)" << endl << endl; } }; int main() { Foo foo; foo = Foo(); } The error I receive: $ g++ -o copy_ctor_assign copy_ctor_assign.cc && ./copy_ctor_assign copy_ctor_assign.cc: In function 'int main()': copy_ctor_assign.cc:10: error: 'Foo::Foo(const Foo&)' is private copy_ctor_assign.cc:17: error: within this context Note: when I remove the ***private:*** keyword the code compiles but the copy ctor is never called. So why does it err when it's private? Not sure if it's important but I'm using: $ g++ --version g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44) Copyright (C) 2006 Free Software Foundation, Inc.
c++
null
null
null
null
null
open
C++: error when have private copy ctor with public assignment operator === Can one of you explain why the following piece of code does not compile? #include <iostream> using namespace std; class Foo { public: Foo() { cout << "Foo::Foo()" << endl << endl; } Foo& operator=(const Foo&) { cout << "Foo::operator=(const Foo&)" << endl << endl; } private: Foo(const Foo& b) { *this = b; cout << "Foo::Foo(const Foo&)" << endl << endl; } }; int main() { Foo foo; foo = Foo(); } The error I receive: $ g++ -o copy_ctor_assign copy_ctor_assign.cc && ./copy_ctor_assign copy_ctor_assign.cc: In function 'int main()': copy_ctor_assign.cc:10: error: 'Foo::Foo(const Foo&)' is private copy_ctor_assign.cc:17: error: within this context Note: when I remove the ***private:*** keyword the code compiles but the copy ctor is never called. So why does it err when it's private? Not sure if it's important but I'm using: $ g++ --version g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-44) Copyright (C) 2006 Free Software Foundation, Inc.
0
10,724,253
05/23/2012 16:36:29
507,718
11/15/2010 00:16:37
390
8
BigDecimal can't be coerced into BigDecimal
This should be pretty simple, yet it's blowing up. Any ideas? d = BigDecimal.new("2.0") YAML::load({:a => d}.to_yaml) TypeError: BigDecimal can't be coerced into BigDecimal from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `block in <module:IRB>' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:30:in `call' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:30:in `inspect_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/context.rb:260:in `inspect_last_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:311:in `output_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:273:in `signal_status' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:155:in `eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:70:in `block in start' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:69:in `catch' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:69:in `start' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `<main>'Maybe IRB bug!
ruby
serialization
yaml
bigdecimal
null
null
open
BigDecimal can't be coerced into BigDecimal === This should be pretty simple, yet it's blowing up. Any ideas? d = BigDecimal.new("2.0") YAML::load({:a => d}.to_yaml) TypeError: BigDecimal can't be coerced into BigDecimal from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `inspect' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:86:in `block in <module:IRB>' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:30:in `call' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/inspector.rb:30:in `inspect_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/context.rb:260:in `inspect_last_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:311:in `output_value' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:160:in `block (2 levels) in eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:273:in `signal_status' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:156:in `block in eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:243:in `block (2 levels) in each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `loop' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:229:in `block in each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `catch' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb/ruby-lex.rb:228:in `each_top_level_statement' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:155:in `eval_input' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:70:in `block in start' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:69:in `catch' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/1.9.1/irb.rb:69:in `start' from /Users/benjohnson/.rvm/rubies/ruby-1.9.3-p125/bin/irb:16:in `<main>'Maybe IRB bug!
0
4,727,351
01/18/2011 17:57:52
559,611
01/01/2011 03:30:12
56
0
python implemented in assembly
Am just being curious but I would like to know whether python can be implemented in assembly and if not why has it not been done to help for speed issues. forgive my naivete in matters of programming languages.
python
null
null
null
null
01/19/2011 01:55:03
not a real question
python implemented in assembly === Am just being curious but I would like to know whether python can be implemented in assembly and if not why has it not been done to help for speed issues. forgive my naivete in matters of programming languages.
1