question_id int64 4 6.31M | answer_id int64 7 6.31M | title stringlengths 9 150 | question_body stringlengths 0 28.8k | answer_body stringlengths 60 27.2k | question_text stringlengths 40 28.9k | combined_text stringlengths 124 39.6k | tags listlengths 1 6 | question_score int64 0 26.3k | answer_score int64 0 28.8k | view_count int64 15 14M | answer_count int64 0 182 | favorite_count int64 0 32 | question_creation_date stringdate 2008-07-31 21:42:52 2011-06-10 18:12:18 | answer_creation_date stringdate 2008-07-31 22:17:57 2011-06-10 18:14:17 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6,230,457 | 6,231,425 | Setting bar spacing in a matplotlib bar plot | I have a matplotlib.bar plot and I can't figure out how to space the bars further apart so the labels are readable. Here is my code import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def makePlot(self, data, labels, title, fileName): plt.bar(range(1,len(data)+1), data, align="center") plt.title(tit... | You can change the size of the figure by calling plt.figure(figsize=(x,y)) where x and y are the width and height in inches. That line must be before you call plt.bar. Alternatively, you can make the label font smaller. You would do that by changing your call to xticks to plt.xticks(range(1, len(labels)+1), labels, siz... | Setting bar spacing in a matplotlib bar plot I have a matplotlib.bar plot and I can't figure out how to space the bars further apart so the labels are readable. Here is my code import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def makePlot(self, data, labels, title, fileName): plt.bar(range(1,len(... | TITLE:
Setting bar spacing in a matplotlib bar plot
QUESTION:
I have a matplotlib.bar plot and I can't figure out how to space the bars further apart so the labels are readable. Here is my code import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt def makePlot(self, data, labels, title, fileName): pl... | [
"python",
"matplotlib"
] | 1 | 3 | 14,157 | 1 | 0 | 2011-06-03T17:20:02.567000 | 2011-06-03T18:55:09.020000 |
6,230,475 | 6,243,957 | How to get override the WP Admin Syndication feed limit for a custom feed? | I need to override the setting in the WP Admin for the number of recent posts in the Syndication settings under General -> Admin. I'm using the following code, which gets all posts, but I don't need that many. Can someone give me an example of how to retrieve 50 posts? This should only affect this one feed and not all ... | I thought you could hook into pre_get_posts, but if it is a feed the posts_per_page value gets overwritten later. So just hook into post_limits, check for your feed, and return a different LIMIT part if needed. add_filter( 'post_limits', 'so6230475_post_limits', 10, 2 ); function so6230475_post_limits( $limits, &$wp_qu... | How to get override the WP Admin Syndication feed limit for a custom feed? I need to override the setting in the WP Admin for the number of recent posts in the Syndication settings under General -> Admin. I'm using the following code, which gets all posts, but I don't need that many. Can someone give me an example of h... | TITLE:
How to get override the WP Admin Syndication feed limit for a custom feed?
QUESTION:
I need to override the setting in the WP Admin for the number of recent posts in the Syndication settings under General -> Admin. I'm using the following code, which gets all posts, but I don't need that many. Can someone give ... | [
"php",
"wordpress",
"feed",
"syndication"
] | 3 | 2 | 629 | 1 | 0 | 2011-06-03T17:22:24.090000 | 2011-06-05T15:45:48.537000 |
6,230,489 | 6,230,559 | 100% CPU usage with a regexp depending on input length | I'm trying to come up with a regexp in Python that has to match any character but avoiding three or more consecutive commas or semicolons. In other words, only up to two consecutive commas or semicolons are allowed. So this is what I currently have: ^(,|;){,2}([^,;]+(,|;){,2})*$ And it seems to work as expected: >>> r.... | You're running into catastrophic backtracking. The reason for this is that you have made the separators optional, and therefore the [^,;]+ part (which is itself in a repeating group) of your regex will try loads of permutations (of baaaaaaaz ) before finally having to admit failure when confronted with more than two co... | 100% CPU usage with a regexp depending on input length I'm trying to come up with a regexp in Python that has to match any character but avoiding three or more consecutive commas or semicolons. In other words, only up to two consecutive commas or semicolons are allowed. So this is what I currently have: ^(,|;){,2}([^,;... | TITLE:
100% CPU usage with a regexp depending on input length
QUESTION:
I'm trying to come up with a regexp in Python that has to match any character but avoiding three or more consecutive commas or semicolons. In other words, only up to two consecutive commas or semicolons are allowed. So this is what I currently hav... | [
"python",
"regex",
"cpu-usage"
] | 9 | 24 | 1,878 | 4 | 0 | 2011-06-03T17:23:36.853000 | 2011-06-03T17:31:43.740000 |
6,230,490 | 6,230,504 | How I can change cursor color in Vim's color scheme? | I use this color scheme: Cobalt Colour scheme. I cannot see the cursor in insert mode. How I can change the cursor's color? I think this is the cursor part: hi CursorLine guifg=none guibg=#002943 hi Cursor guifg=#F8F8F8 guibg=#A7A7A7 hi CursorIM guifg=#F8F8F8 guibg=#002947"#5F5A60 | There is quite a lot of information about how to set the insert mode cursor color in the vim documentation Here is an example from the linked documentation: highlight Cursor guifg=white guibg=black highlight iCursor guifg=white guibg=steelblue set guicursor=n-v-c:block-Cursor set guicursor+=i:ver100-iCursor set guicurs... | How I can change cursor color in Vim's color scheme? I use this color scheme: Cobalt Colour scheme. I cannot see the cursor in insert mode. How I can change the cursor's color? I think this is the cursor part: hi CursorLine guifg=none guibg=#002943 hi Cursor guifg=#F8F8F8 guibg=#A7A7A7 hi CursorIM guifg=#F8F8F8 guibg=#... | TITLE:
How I can change cursor color in Vim's color scheme?
QUESTION:
I use this color scheme: Cobalt Colour scheme. I cannot see the cursor in insert mode. How I can change the cursor's color? I think this is the cursor part: hi CursorLine guifg=none guibg=#002943 hi Cursor guifg=#F8F8F8 guibg=#A7A7A7 hi CursorIM gui... | [
"vim",
"color-scheme"
] | 22 | 21 | 60,599 | 2 | 0 | 2011-06-03T17:23:54.137000 | 2011-06-03T17:26:20.323000 |
6,230,494 | 6,230,561 | vim search and replace limited to the highlight in visual block mode | I often have text in columns and need to replace some things without clobbering similar stuff on the same line... a simple example follows: Suppose I have highlighted the text in grey with vim visual block mode, and want to replace 80 with 81; however, I only want replacements within the highlighted visual block. I hav... | You need to add \%V to your pattern. From:help \%V: Match inside the Visual area. When Visual mode has already been stopped match in the area that gv would reselect. This is a /zero-width match. To make sure the whole pattern is inside the Visual area put it at the start and end of the pattern. OP EDIT: the explicit so... | vim search and replace limited to the highlight in visual block mode I often have text in columns and need to replace some things without clobbering similar stuff on the same line... a simple example follows: Suppose I have highlighted the text in grey with vim visual block mode, and want to replace 80 with 81; however... | TITLE:
vim search and replace limited to the highlight in visual block mode
QUESTION:
I often have text in columns and need to replace some things without clobbering similar stuff on the same line... a simple example follows: Suppose I have highlighted the text in grey with vim visual block mode, and want to replace 8... | [
"search",
"vim",
"replace"
] | 27 | 28 | 7,270 | 3 | 0 | 2011-06-03T17:24:29.700000 | 2011-06-03T17:32:11.983000 |
6,230,502 | 6,230,597 | Two models with shared methods and same table? [CakePHP] | I currently have two models: Product and Service. Both share the same table structure and the same methods. However, when I update one method, I'll have to do the same with the other model. And it gets messy, not to mention I'm causing redundancy and it's not the best practice available. I know the models can be linked... | Use a Behavior. As stated in the cookbook: Model behaviors are a way to organize some of the functionality defined in CakePHP models. They allow us to separate logic that may not be directly related to a model, but needs to be there. By providing a simple yet powerful way to extend models, behaviors allow us to attach ... | Two models with shared methods and same table? [CakePHP] I currently have two models: Product and Service. Both share the same table structure and the same methods. However, when I update one method, I'll have to do the same with the other model. And it gets messy, not to mention I'm causing redundancy and it's not the... | TITLE:
Two models with shared methods and same table? [CakePHP]
QUESTION:
I currently have two models: Product and Service. Both share the same table structure and the same methods. However, when I update one method, I'll have to do the same with the other model. And it gets messy, not to mention I'm causing redundanc... | [
"php",
"oop",
"cakephp",
"models"
] | 0 | 4 | 1,010 | 3 | 0 | 2011-06-03T17:26:15.143000 | 2011-06-03T17:35:15.227000 |
6,230,503 | 6,230,518 | Why doesn't this getElementById function work? | gf ds function $() { return document.getElementById(arguments); }
$('t', 'g').style.color = "red"; Is there something that I did wrong. It says cannot call style of null... | function $() { return document.getElementById.apply(document, arguments); } You need to use the apply method to call a function using an an array as the arguments. The apply function also needs the context, so you need to pass document as well. Also, getElementById only accepts a single argument and returns a single el... | Why doesn't this getElementById function work? gf ds function $() { return document.getElementById(arguments); }
$('t', 'g').style.color = "red"; Is there something that I did wrong. It says cannot call style of null... | TITLE:
Why doesn't this getElementById function work?
QUESTION:
gf ds function $() { return document.getElementById(arguments); }
$('t', 'g').style.color = "red"; Is there something that I did wrong. It says cannot call style of null...
ANSWER:
function $() { return document.getElementById.apply(document, arguments)... | [
"javascript"
] | 1 | 4 | 1,703 | 2 | 0 | 2011-06-03T17:26:16.333000 | 2011-06-03T17:27:58.517000 |
6,230,507 | 6,231,924 | Which class should be responsible for state and for cleaning up ressources? | I database connection (I guess it could be any statefull ressource) that I create in a parent class and pass to be used in a child class. Which class should have the responsibility for cleaning up the database connection (making the connection is closed on exception and so on)? Which class should have the responsibilit... | Perhaps it's a good idea to use the provider pattern: Instead of providing the actual connection to the child, you pass in only a description on how to acquire a connection. That way, you can manage resources locally, optimize (shorten) the lifetime of your allocated resources and handle errors locally, too. If you don... | Which class should be responsible for state and for cleaning up ressources? I database connection (I guess it could be any statefull ressource) that I create in a parent class and pass to be used in a child class. Which class should have the responsibility for cleaning up the database connection (making the connection ... | TITLE:
Which class should be responsible for state and for cleaning up ressources?
QUESTION:
I database connection (I guess it could be any statefull ressource) that I create in a parent class and pass to be used in a child class. Which class should have the responsibility for cleaning up the database connection (maki... | [
"oop",
"architecture"
] | 0 | 1 | 59 | 2 | 0 | 2011-06-03T17:26:36.867000 | 2011-06-03T19:45:57.067000 |
6,230,508 | 6,230,535 | getRuntime().exec does not perform as expected | I'm trying to get my java program to run an svn command from the command prompt, which will write logs to an xml file. This is what I want it to do: Runtime.getRuntime().exec("cmd.exe /c svn log /location/ --xml > c:\\output.xml"); however, it will not print anything to the xml file. when I enter the "svn log /location... | Can you try giving full path of your svn binary in the first exec method call. | getRuntime().exec does not perform as expected I'm trying to get my java program to run an svn command from the command prompt, which will write logs to an xml file. This is what I want it to do: Runtime.getRuntime().exec("cmd.exe /c svn log /location/ --xml > c:\\output.xml"); however, it will not print anything to th... | TITLE:
getRuntime().exec does not perform as expected
QUESTION:
I'm trying to get my java program to run an svn command from the command prompt, which will write logs to an xml file. This is what I want it to do: Runtime.getRuntime().exec("cmd.exe /c svn log /location/ --xml > c:\\output.xml"); however, it will not pr... | [
"java",
"command-line",
"runtime.exec"
] | 0 | 1 | 2,560 | 3 | 0 | 2011-06-03T17:26:59.453000 | 2011-06-03T17:29:31.780000 |
6,230,511 | 6,258,409 | Getting a Scala interpreter to work | I'm very new to Scala. I have downloaded it, got it working in Eclipse where I'll be developing it; but I can't make it work in Terminal. All sites and books say to just type scala - this doesn't work. The website infuriatingly says: We assume that both the Scala software and the user environment are set up correctly. ... | For OS X, I highly recommend Homebrew. The installation of Homebrew is incredibly easy. Once installed, you just need to run brew install scala and scala will be installed and ready to go. Homebrew also has tons of other goodies just a brew install away. If you don't already have Java installed, you can install that wi... | Getting a Scala interpreter to work I'm very new to Scala. I have downloaded it, got it working in Eclipse where I'll be developing it; but I can't make it work in Terminal. All sites and books say to just type scala - this doesn't work. The website infuriatingly says: We assume that both the Scala software and the use... | TITLE:
Getting a Scala interpreter to work
QUESTION:
I'm very new to Scala. I have downloaded it, got it working in Eclipse where I'll be developing it; but I can't make it work in Terminal. All sites and books say to just type scala - this doesn't work. The website infuriatingly says: We assume that both the Scala so... | [
"macos",
"shell",
"scala",
"terminal",
"installation"
] | 43 | 85 | 37,967 | 8 | 0 | 2011-06-03T17:27:11.023000 | 2011-06-06T21:46:57.230000 |
6,230,512 | 6,230,882 | OpenGL ES 2.0 shader, how is time variable called? | I try to perform such pixel shader: "#ifdef GL_ES\n" " precision highp float;\n" " #endif\n" " \n" " uniform float time;\n" " uniform vec2 resolution;\n" "\n" " void main( void ) {\n" "\n" " vec3 rgb = vec3( abs( sin( time / 5.0 ) ), 0.0, 0.0 );\n" " gl_FragColor = vec4( rgb, 1.0 );\n" "\n" " }\n" I want it to work ali... | Check the page source on your first link. You have to calculate and pass in the time value from your host program. OpenGL ES 2.0 has no notion of time, wall-clock or otherwise. | OpenGL ES 2.0 shader, how is time variable called? I try to perform such pixel shader: "#ifdef GL_ES\n" " precision highp float;\n" " #endif\n" " \n" " uniform float time;\n" " uniform vec2 resolution;\n" "\n" " void main( void ) {\n" "\n" " vec3 rgb = vec3( abs( sin( time / 5.0 ) ), 0.0, 0.0 );\n" " gl_FragColor = vec... | TITLE:
OpenGL ES 2.0 shader, how is time variable called?
QUESTION:
I try to perform such pixel shader: "#ifdef GL_ES\n" " precision highp float;\n" " #endif\n" " \n" " uniform float time;\n" " uniform vec2 resolution;\n" "\n" " void main( void ) {\n" "\n" " vec3 rgb = vec3( abs( sin( time / 5.0 ) ), 0.0, 0.0 );\n" " ... | [
"opengl-es",
"time",
"shader",
"opengl-es-2.0"
] | 4 | 5 | 4,827 | 1 | 0 | 2011-06-03T17:27:35.560000 | 2011-06-03T18:01:53.430000 |
6,230,522 | 6,230,675 | problem with DataBinder | I have the DataBinder.Eval in different place in my asp page but in one place it makes an error 'System.Web.UI.DataBinder' does not contain a definition for 'eval' It work in this line But I got the error in this link in enabled!! I can’t found why!! | In the below line, Eval is typed in Lower Case. it should be Eval, not eval. Remember C# is case Sensitive:) Text='<%#CheckLocked(DataBinder.eval(Container,"DataItem.Ididis"),DataBinder.eval(Container,"DataItem.Prodis")) %>' | problem with DataBinder I have the DataBinder.Eval in different place in my asp page but in one place it makes an error 'System.Web.UI.DataBinder' does not contain a definition for 'eval' It work in this line But I got the error in this link in enabled!! I can’t found why!! | TITLE:
problem with DataBinder
QUESTION:
I have the DataBinder.Eval in different place in my asp page but in one place it makes an error 'System.Web.UI.DataBinder' does not contain a definition for 'eval' It work in this line But I got the error in this link in enabled!! I can’t found why!!
ANSWER:
In the below line,... | [
"c#",
"asp.net"
] | 0 | 0 | 480 | 1 | 0 | 2011-06-03T17:28:20.197000 | 2011-06-03T17:42:23.230000 |
6,230,525 | 6,231,462 | Python: Making a GUI in nokia phone | I am writing one of the Mobile monitoring program in my phone which I almost finished it. My program has a pedometer which counts human's steps in a real time manner. My question is that I am now writing GUI for phone which will show let's say some picture after they accomplish 1000 steps(like an award) and so on. I am... | Which phone model and OS are we talking about? Is it running Android? I believe pre-Android Nokia phones used Qt GUI framework Python has Qt wrappers, look into PyQt4 for all your UI needs. | Python: Making a GUI in nokia phone I am writing one of the Mobile monitoring program in my phone which I almost finished it. My program has a pedometer which counts human's steps in a real time manner. My question is that I am now writing GUI for phone which will show let's say some picture after they accomplish 1000 ... | TITLE:
Python: Making a GUI in nokia phone
QUESTION:
I am writing one of the Mobile monitoring program in my phone which I almost finished it. My program has a pedometer which counts human's steps in a real time manner. My question is that I am now writing GUI for phone which will show let's say some picture after the... | [
"python",
"mobile-phones"
] | 0 | 0 | 305 | 1 | 0 | 2011-06-03T17:28:39.277000 | 2011-06-03T18:58:08.773000 |
6,230,558 | 6,230,980 | Having a TableRow with TextView's underneath each other | I'm currently having the following problem: I've got a TableView that is given TableRow's to be added to it with data. I want each TableRow to contain 2 TextView's having a width of the parent and are underneath each other, for example: | TextView1.............. | | TextView2.............. | |.........EndOfTextView2 | ... | You have several ways to do it: Adding a vertical LinearLayout to each row is one. Another option is not to use a TableLayout, but do everything with a RelativeLayout. A third one is to use a ListView instead of a TableLayout (since, as it looks like, you're using just one cell per row). The links above are for the and... | Having a TableRow with TextView's underneath each other I'm currently having the following problem: I've got a TableView that is given TableRow's to be added to it with data. I want each TableRow to contain 2 TextView's having a width of the parent and are underneath each other, for example: | TextView1.............. |... | TITLE:
Having a TableRow with TextView's underneath each other
QUESTION:
I'm currently having the following problem: I've got a TableView that is given TableRow's to be added to it with data. I want each TableRow to contain 2 TextView's having a width of the parent and are underneath each other, for example: | TextVie... | [
"java",
"android"
] | 0 | 1 | 129 | 1 | 0 | 2011-06-03T17:31:38.887000 | 2011-06-03T18:11:00.957000 |
6,230,588 | 6,230,645 | Foreign keys must be Index in mySQL? | I've just created my first mySQL table on my own (other than using Joomla, Wordpress, etc.) and I am MS SQL developer for years but normally I can easily create a foreign key in MS SQL but I came across a difficulty or lack of knowledge here. Here is my tables: users user_id int primary auto_increment username varchar(... | Short answer: Yes, MySQL forces you to index foreign key. InnoDB requires indexes on foreign keys and referenced keys so that foreign key checks can be fast and not require a table scan. You can read more about foreign keys on MySQL documentation pages: http://dev.mysql.com/doc/refman/5.5/en/innodb-foreign-key-constrai... | Foreign keys must be Index in mySQL? I've just created my first mySQL table on my own (other than using Joomla, Wordpress, etc.) and I am MS SQL developer for years but normally I can easily create a foreign key in MS SQL but I came across a difficulty or lack of knowledge here. Here is my tables: users user_id int pri... | TITLE:
Foreign keys must be Index in mySQL?
QUESTION:
I've just created my first mySQL table on my own (other than using Joomla, Wordpress, etc.) and I am MS SQL developer for years but normally I can easily create a foreign key in MS SQL but I came across a difficulty or lack of knowledge here. Here is my tables: use... | [
"mysql",
"sql",
"foreign-keys",
"indexing"
] | 11 | 19 | 12,646 | 3 | 0 | 2011-06-03T17:34:26.607000 | 2011-06-03T17:39:48.257000 |
6,230,590 | 6,234,341 | android - override menu long press to bring up app home screen and normal press to bring up menu | I am trying to get the menu key to bring up the following: On long press to bring up my app's home screen (instead of default soft keyboard) On normal press to bring up menu. I can do either or but not both. What am I missing? Some code would be much appreciated. Thank you Here is what I have: @Override public boolean ... | So if you call this.openOptionsMenu(); in the onKeyUp() you get the menu show up on the regular screen and soft keyboard is overriden by redirect to home screen. | android - override menu long press to bring up app home screen and normal press to bring up menu I am trying to get the menu key to bring up the following: On long press to bring up my app's home screen (instead of default soft keyboard) On normal press to bring up menu. I can do either or but not both. What am I missi... | TITLE:
android - override menu long press to bring up app home screen and normal press to bring up menu
QUESTION:
I am trying to get the menu key to bring up the following: On long press to bring up my app's home screen (instead of default soft keyboard) On normal press to bring up menu. I can do either or but not bot... | [
"android",
"menu",
"keypress"
] | 2 | 1 | 2,667 | 2 | 0 | 2011-06-03T17:34:32.637000 | 2011-06-04T02:35:42.180000 |
6,230,592 | 6,230,924 | Filtering cfquery results | I am editing already existing code, which is why this question is formed as it is. I am attempting to use a query that already exists and without adding more form variables through the url. So my problem: I have a query that is being run, and this query is being used to populate two drop down lists on the page. One lis... | Here's what I'd do. Only show the state drop down first. This would be easier with some example code, but here's an example. Haven't tried it at all, but should be an okay start. Never remember how to set selects back to nothing selected... First Drop Down #state# Second Drop Down(s) Select a Site #site# Add some JavaS... | Filtering cfquery results I am editing already existing code, which is why this question is formed as it is. I am attempting to use a query that already exists and without adding more form variables through the url. So my problem: I have a query that is being run, and this query is being used to populate two drop down ... | TITLE:
Filtering cfquery results
QUESTION:
I am editing already existing code, which is why this question is formed as it is. I am attempting to use a query that already exists and without adding more form variables through the url. So my problem: I have a query that is being run, and this query is being used to popul... | [
"sql",
"coldfusion",
"distinct",
"cfquery"
] | 1 | 1 | 1,336 | 3 | 0 | 2011-06-03T17:34:50.960000 | 2011-06-03T18:05:52.943000 |
6,230,595 | 6,230,979 | Rake RSpec Tasks are not showing up | I have an inherited app, running on Rails 3 in Ruby 1.9, and its working fine, but for some reason, when I installed both rspec and jasmine, neither of their rake tasks are showing up when I run rake -T. The Rakefile for the app is just the standard one, and in fact, when I installed Cucumber, its rake tasks show up ju... | Do you have rspec-rails in the development group? http://relishapp.com/rspec/rspec-rails/file/gettingstarted | Rake RSpec Tasks are not showing up I have an inherited app, running on Rails 3 in Ruby 1.9, and its working fine, but for some reason, when I installed both rspec and jasmine, neither of their rake tasks are showing up when I run rake -T. The Rakefile for the app is just the standard one, and in fact, when I installed... | TITLE:
Rake RSpec Tasks are not showing up
QUESTION:
I have an inherited app, running on Rails 3 in Ruby 1.9, and its working fine, but for some reason, when I installed both rspec and jasmine, neither of their rake tasks are showing up when I run rake -T. The Rakefile for the app is just the standard one, and in fact... | [
"ruby-on-rails",
"ruby",
"rspec",
"rake"
] | 11 | 33 | 5,094 | 1 | 0 | 2011-06-03T17:35:05.827000 | 2011-06-03T18:10:44.390000 |
6,230,600 | 6,236,804 | Trouble updating an RRDtool database | I created a database with the following syntax. rrdtool create mydatabase.rrd -s 60 \ DS:users:COUNTER:600:0:U \ DS:activeusers:GAUGE:600:0:U \ RRA:AVERAGE:0.5:360:576 \ RRA:AVERAGE:0.5:8640:672 \ RRA:AVERAGE:0.5:259200:732 \ RRA:AVERAGE:0.5:3153600:732 And I have a crontab entry that runs the following. * * * * * rrdt... | Make sure that you are actually inputting valid data. Send N:$users:$active a logfile. Also, have an RRA file with a little bit of a higher resolution. At the moment you are storing one entry every 360 minutes = 6 hours in the first RRA file. In the last RRA file you store one update every six years for 732 years. | Trouble updating an RRDtool database I created a database with the following syntax. rrdtool create mydatabase.rrd -s 60 \ DS:users:COUNTER:600:0:U \ DS:activeusers:GAUGE:600:0:U \ RRA:AVERAGE:0.5:360:576 \ RRA:AVERAGE:0.5:8640:672 \ RRA:AVERAGE:0.5:259200:732 \ RRA:AVERAGE:0.5:3153600:732 And I have a crontab entry th... | TITLE:
Trouble updating an RRDtool database
QUESTION:
I created a database with the following syntax. rrdtool create mydatabase.rrd -s 60 \ DS:users:COUNTER:600:0:U \ DS:activeusers:GAUGE:600:0:U \ RRA:AVERAGE:0.5:360:576 \ RRA:AVERAGE:0.5:8640:672 \ RRA:AVERAGE:0.5:259200:732 \ RRA:AVERAGE:0.5:3153600:732 And I have ... | [
"rrdtool"
] | 1 | 1 | 1,333 | 1 | 0 | 2011-06-03T17:35:28.853000 | 2011-06-04T12:43:02.343000 |
6,230,603 | 6,257,601 | Resolving External User Control x:Name Convention Bindings in Caliburn.Micro | I'd like to use x:Name binding to resolve property bindings in nested, satellite user controls via Caliburn.Micro's conventions. The UI for our Views is pretty standard. We have a satellite project that contains user controls which are then used to compose the UI in our Views, similar to the example below:.... The View... | You need to use cal:Bind.Model="{Binding}" where you use the control; cal is an xmlns for Caliburn.Micro..... | Resolving External User Control x:Name Convention Bindings in Caliburn.Micro I'd like to use x:Name binding to resolve property bindings in nested, satellite user controls via Caliburn.Micro's conventions. The UI for our Views is pretty standard. We have a satellite project that contains user controls which are then us... | TITLE:
Resolving External User Control x:Name Convention Bindings in Caliburn.Micro
QUESTION:
I'd like to use x:Name binding to resolve property bindings in nested, satellite user controls via Caliburn.Micro's conventions. The UI for our Views is pretty standard. We have a satellite project that contains user controls... | [
"wpf",
"caliburn.micro"
] | 7 | 9 | 2,250 | 1 | 0 | 2011-06-03T17:35:38.420000 | 2011-06-06T20:25:13.650000 |
6,230,604 | 6,230,713 | jQuery 1.6 type property is undefined | I can't seem to get the type property in jQuery 1.6 and jquery $.each('#div_id input',function(index,value){ var input_type = $(this).prop('type') alert(input_type); /* switch(input_type) { case 'checkbox': $(this).prop('checked',false); break; //more cases here default: this.value = ''; }*/ }); see my fiddle | This is because you've misunderstood the $.each() function, which accepts an array or object (as opposed to a selector). When you pass a string to $.each(), jQuery iterates over all the characters in the string (in most browsers). To fix the issue you can pass the selector to jQuery and either use the result in $.each(... | jQuery 1.6 type property is undefined I can't seem to get the type property in jQuery 1.6 and jquery $.each('#div_id input',function(index,value){ var input_type = $(this).prop('type') alert(input_type); /* switch(input_type) { case 'checkbox': $(this).prop('checked',false); break; //more cases here default: this.value... | TITLE:
jQuery 1.6 type property is undefined
QUESTION:
I can't seem to get the type property in jQuery 1.6 and jquery $.each('#div_id input',function(index,value){ var input_type = $(this).prop('type') alert(input_type); /* switch(input_type) { case 'checkbox': $(this).prop('checked',false); break; //more cases here d... | [
"jquery",
"properties",
"jquery-1.6"
] | 1 | 2 | 1,257 | 4 | 0 | 2011-06-03T17:35:51.803000 | 2011-06-03T17:46:45.913000 |
6,230,610 | 6,230,785 | TabBar application, CoreData related application crash | In my project I'm using a tabBarController as the rootView Controller, then on one of my tabs, I add my exsisting ToDoList application. The problem I'm having is this: If I use this code in the AppDelegate: ToDoList is load as RootView. But I want it to show only after appropriate tab selected. - (void)applicationDidFi... | Utilize Interface Builder to set the Tab View Controllers that will be displayed when a tab is typed. If you must do it programmatically then you should check out the documentation for TabBarControllers. of - (void)applicationDidFinishLaunching:(UIApplication *)application {
tabBarController = [[UITabBarController all... | TabBar application, CoreData related application crash In my project I'm using a tabBarController as the rootView Controller, then on one of my tabs, I add my exsisting ToDoList application. The problem I'm having is this: If I use this code in the AppDelegate: ToDoList is load as RootView. But I want it to show only a... | TITLE:
TabBar application, CoreData related application crash
QUESTION:
In my project I'm using a tabBarController as the rootView Controller, then on one of my tabs, I add my exsisting ToDoList application. The problem I'm having is this: If I use this code in the AppDelegate: ToDoList is load as RootView. But I want... | [
"iphone",
"cocoa-touch",
"ios",
"core-data",
"ios-3.x"
] | 1 | 0 | 266 | 1 | 0 | 2011-06-03T17:36:05.303000 | 2011-06-03T17:53:13.150000 |
6,230,614 | 6,230,667 | Whats wrong with this img html markup | I have a page that shows images and the images are really looking messed up:) This is how the page looks like: http://www.comehike.com/outdoors/parks/park.php?park_id=15 See on the right side middle the images are looking very messy. And when I try to do view source, the html below is what I get. But from just looking ... | I see two issues. One is, some of the image links are broken, so every other image is not loading. The second is, the images are contained in a div with explicit dimensions, and the contents do not fit inside the div and they are flowing out over the top of the content below. You can set the 'overflow' css attribute to... | Whats wrong with this img html markup I have a page that shows images and the images are really looking messed up:) This is how the page looks like: http://www.comehike.com/outdoors/parks/park.php?park_id=15 See on the right side middle the images are looking very messy. And when I try to do view source, the html below... | TITLE:
Whats wrong with this img html markup
QUESTION:
I have a page that shows images and the images are really looking messed up:) This is how the page looks like: http://www.comehike.com/outdoors/parks/park.php?park_id=15 See on the right side middle the images are looking very messy. And when I try to do view sour... | [
"html",
"css",
"layout"
] | 0 | 2 | 70 | 3 | 0 | 2011-06-03T17:36:13.143000 | 2011-06-03T17:41:50.337000 |
6,230,618 | 6,231,001 | Add-pssnapin from a function in a module does not work (scope issue?) | I have this function: function start-sqlsnap { add-pssnapin SqlServerCmdletSnapin100 } Regardless of the method used to load the function, get-pssnapin will show the snapin loaded. However: If pasted in the shell, the functions (like invoke-sqlcmd) are recognized If dot sourced from a file, the functions are recognized... | Instead of adding the function to the module file, what if you just add the single line: add-pssnapin SqlServerCmdletSnapin100 I tried that and it seemed to work. | Add-pssnapin from a function in a module does not work (scope issue?) I have this function: function start-sqlsnap { add-pssnapin SqlServerCmdletSnapin100 } Regardless of the method used to load the function, get-pssnapin will show the snapin loaded. However: If pasted in the shell, the functions (like invoke-sqlcmd) a... | TITLE:
Add-pssnapin from a function in a module does not work (scope issue?)
QUESTION:
I have this function: function start-sqlsnap { add-pssnapin SqlServerCmdletSnapin100 } Regardless of the method used to load the function, get-pssnapin will show the snapin loaded. However: If pasted in the shell, the functions (lik... | [
"powershell"
] | 4 | 2 | 4,984 | 2 | 0 | 2011-06-03T17:36:52.423000 | 2011-06-03T18:13:32.360000 |
6,230,627 | 6,230,993 | Is there a way to tell matplotlib to loosen the zoom on the plotted data? | I have some data plotted which includes some limits on each subplot: Both axes have the limits, but since the data fits so nicely within the limits on the second plot, the limits themselves set the boudaries for the y-axis, making them invisible. To make them visible, I could do something like this: axes.set_ylim(1.1*l... | In regards to your request for a function to change the y-axis limits, would this suit your purposes?: def larger_axlim( axlim ): """ argument axlim expects 2-tuple returns slightly larger 2-tuple """ axmin,axmax = axlim axrng = axmax - axmin new_min = axmin - 0.1 * axrng new_max = axmax + 0.1 * axrng return new_min,ne... | Is there a way to tell matplotlib to loosen the zoom on the plotted data? I have some data plotted which includes some limits on each subplot: Both axes have the limits, but since the data fits so nicely within the limits on the second plot, the limits themselves set the boudaries for the y-axis, making them invisible.... | TITLE:
Is there a way to tell matplotlib to loosen the zoom on the plotted data?
QUESTION:
I have some data plotted which includes some limits on each subplot: Both axes have the limits, but since the data fits so nicely within the limits on the second plot, the limits themselves set the boudaries for the y-axis, maki... | [
"python",
"matplotlib"
] | 4 | 5 | 2,133 | 1 | 0 | 2011-06-03T17:37:48.040000 | 2011-06-03T18:12:22.527000 |
6,230,628 | 6,230,681 | Determine image size in JavaScript without `<img>` tag | Using JavaScript, how can I determine the size of an image which is not in the document without inserting it in the document? Could I download the image using AJAX and check its height and width programmatically? Something like... var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp... | You don't need ajax. var img = new Image(); img.onload = function() { alert("The image is " + this.width + "x" + this.height); } img.src = "lena.jpg"; | Determine image size in JavaScript without `<img>` tag Using JavaScript, how can I determine the size of an image which is not in the document without inserting it in the document? Could I download the image using AJAX and check its height and width programmatically? Something like... var xmlhttp = new XMLHttpRequest()... | TITLE:
Determine image size in JavaScript without `<img>` tag
QUESTION:
Using JavaScript, how can I determine the size of an image which is not in the document without inserting it in the document? Could I download the image using AJAX and check its height and width programmatically? Something like... var xmlhttp = ne... | [
"javascript",
"ajax",
"image"
] | 5 | 8 | 3,094 | 5 | 0 | 2011-06-03T17:37:53.640000 | 2011-06-03T17:43:21.403000 |
6,230,634 | 6,231,105 | Android Tutorial, Back Stack | I have written one simple Android Tetris application. After it I decided to read the dev tutorial. It is time to start. So, reading about Back Stack, I was surprised to find this in the tutorial: The back stack abides to the basic "last in, first out" queue mechanism "Last in and first out" and "queue" I am fully confi... | Besides the obvious possibilities in the Queue being double-ended, I think it's just a (perhaps intentional) mix of English and Programming lingo in that sentence. When I read that sentence: The back stack abides to the basic "last in, first out" queue mechanism I understand the "queue mechanism" in plain English, not ... | Android Tutorial, Back Stack I have written one simple Android Tetris application. After it I decided to read the dev tutorial. It is time to start. So, reading about Back Stack, I was surprised to find this in the tutorial: The back stack abides to the basic "last in, first out" queue mechanism "Last in and first out"... | TITLE:
Android Tutorial, Back Stack
QUESTION:
I have written one simple Android Tetris application. After it I decided to read the dev tutorial. It is time to start. So, reading about Back Stack, I was surprised to find this in the tutorial: The back stack abides to the basic "last in, first out" queue mechanism "Last... | [
"data-structures",
"stack",
"queue"
] | 1 | 3 | 725 | 2 | 0 | 2011-06-03T17:38:14.250000 | 2011-06-03T18:23:00.963000 |
6,230,636 | 6,230,662 | C# Grid-like interface (similar to a file explorer) to delete files from a Form | I am currently looking for a grid-like interface, that you can insert into a C# form. From the grid interface you are able to delete files, although not execute them. I'm fairly new to C# and have not seen such as Control which can do this yet. | Can you try this? https://web.archive.org/web/20210513005012/http://www.4guysfromrolla.com/articles/090110-1.aspx. You can add path as a parameter on Delete buttton. Also check this http://www.pr0g33k.com/blog/managing-files-with-aspnet/60 | C# Grid-like interface (similar to a file explorer) to delete files from a Form I am currently looking for a grid-like interface, that you can insert into a C# form. From the grid interface you are able to delete files, although not execute them. I'm fairly new to C# and have not seen such as Control which can do this ... | TITLE:
C# Grid-like interface (similar to a file explorer) to delete files from a Form
QUESTION:
I am currently looking for a grid-like interface, that you can insert into a C# form. From the grid interface you are able to delete files, although not execute them. I'm fairly new to C# and have not seen such as Control ... | [
"c#",
".net",
"winforms"
] | 1 | 0 | 206 | 2 | 0 | 2011-06-03T17:38:35.990000 | 2011-06-03T17:41:28.343000 |
6,230,639 | 6,230,773 | Algorithm for BASH/CSH/ZSH style brace expansion | If I have a string like a/{b,c,d}/e then I want to be able to produce this output: a/b/e a/c/e a/d/e You get the idea. I need to implement this in C. I have written a brute force kind of code which i capable of parsing a single pair of braces (for example: /a/{b,c,d}/e/ but if there are multiple pair of braces, like /a... | If you're on any kind of Unix, Linux or OS X system, there is a built in library function to do this. man 3 glob will tell you about how to call it from C. Or you can visit http://linux.die.net/man/3/glob to find online documentation. If you want to roll your own, a simple way to go is to first scan the string and buil... | Algorithm for BASH/CSH/ZSH style brace expansion If I have a string like a/{b,c,d}/e then I want to be able to produce this output: a/b/e a/c/e a/d/e You get the idea. I need to implement this in C. I have written a brute force kind of code which i capable of parsing a single pair of braces (for example: /a/{b,c,d}/e/ ... | TITLE:
Algorithm for BASH/CSH/ZSH style brace expansion
QUESTION:
If I have a string like a/{b,c,d}/e then I want to be able to produce this output: a/b/e a/c/e a/d/e You get the idea. I need to implement this in C. I have written a brute force kind of code which i capable of parsing a single pair of braces (for examp... | [
"c",
"algorithm",
"string-parsing",
"brace-expansion"
] | 3 | 2 | 1,128 | 4 | 0 | 2011-06-03T17:39:23.620000 | 2011-06-03T17:52:28.010000 |
6,230,641 | 6,231,728 | JAXB and Entity Class validation | For a REST-Webservice i had to validate incoming Data. Is is possible to validate incoming data with an Entity Class and JAXB, instead of xsd | Below is a link of how you could validate Data in a JAX-RS service using JAXB validation based on a schema: Validate JAXBElement in JPA/JAX-RS Web Service If you don't have an XML schema from your model, then you could use JAXB to generate one: http://wiki.eclipse.org/EclipseLink/Examples/MOXy/JAXB/GenerateSchema If yo... | JAXB and Entity Class validation For a REST-Webservice i had to validate incoming Data. Is is possible to validate incoming data with an Entity Class and JAXB, instead of xsd | TITLE:
JAXB and Entity Class validation
QUESTION:
For a REST-Webservice i had to validate incoming Data. Is is possible to validate incoming data with an Entity Class and JAXB, instead of xsd
ANSWER:
Below is a link of how you could validate Data in a JAX-RS service using JAXB validation based on a schema: Validate J... | [
"validation",
"rest",
"jaxb",
"jaxb2"
] | 1 | 0 | 893 | 1 | 0 | 2011-06-03T17:39:38.850000 | 2011-06-03T19:27:57.607000 |
6,230,648 | 6,230,741 | What is the impact (performance wise) of an "if" statement | My buddy says that he tries to program with as little if/else statements as possible, for efficiency's sake. When I asked why he said that if/else's take a somewhat significant part of the program's ressources, so he tries to stay away from them. Is he right? Are there better ways to execute if/else style code without ... | Typically, a compiler will represent an if/then/else construct as a test followed by a jump to another location in the code. This is a very standard and well-optimized operation for any processor. Unless you are programming in something other than the standard compiled or interpreted languages, your buddy's conclusion ... | What is the impact (performance wise) of an "if" statement My buddy says that he tries to program with as little if/else statements as possible, for efficiency's sake. When I asked why he said that if/else's take a somewhat significant part of the program's ressources, so he tries to stay away from them. Is he right? A... | TITLE:
What is the impact (performance wise) of an "if" statement
QUESTION:
My buddy says that he tries to program with as little if/else statements as possible, for efficiency's sake. When I asked why he said that if/else's take a somewhat significant part of the program's ressources, so he tries to stay away from th... | [
"programming-languages",
"performance"
] | 2 | 12 | 5,543 | 6 | 0 | 2011-06-03T17:40:16.410000 | 2011-06-03T17:49:27.720000 |
6,230,651 | 6,230,716 | Weird error with rails atom builder | I am trying to create a simple atom feed with the respond_to method in rails I have the respond to and routes set up properly but my builder errors. I have tried everything I can think of so hopefully StackOverflow can tell me what I overlooked The error that atom builder is giving me is undefined method `post_url' for... | Shouldn't it be: entry.title post.name entry.content post.contents entry.url "/#{post.permalink}" I have no idea if this is a typo or if this is the problem you are experiencing. That being said, could you post more of your stacktrace? | Weird error with rails atom builder I am trying to create a simple atom feed with the respond_to method in rails I have the respond to and routes set up properly but my builder errors. I have tried everything I can think of so hopefully StackOverflow can tell me what I overlooked The error that atom builder is giving m... | TITLE:
Weird error with rails atom builder
QUESTION:
I am trying to create a simple atom feed with the respond_to method in rails I have the respond to and routes set up properly but my builder errors. I have tried everything I can think of so hopefully StackOverflow can tell me what I overlooked The error that atom b... | [
"ruby-on-rails",
"atom-feed"
] | 1 | 0 | 660 | 1 | 0 | 2011-06-03T17:40:34.023000 | 2011-06-03T17:47:13.870000 |
6,230,655 | 6,254,536 | IIS 7.5 forms authentication against Active directory not working in server (but it works on VS) | I'm developing a User manage using.net 4.0 (c#) to enable flags related to the users account, change names, add users and all this stuff related with A.D. When I run the application in visual studio, in my laptop, it works fine, so I can add users, change attributes, enable flags, etc.. through ldap and using Membershi... | You need to make sure the IIS server is a part of the AD domain and that it's computer account is working correctly. Here is a powershell command to test the secure channel or you can use NetDom from the cmd shell Netdom verify iiscomputername /domain:yourdomain. | IIS 7.5 forms authentication against Active directory not working in server (but it works on VS) I'm developing a User manage using.net 4.0 (c#) to enable flags related to the users account, change names, add users and all this stuff related with A.D. When I run the application in visual studio, in my laptop, it works ... | TITLE:
IIS 7.5 forms authentication against Active directory not working in server (but it works on VS)
QUESTION:
I'm developing a User manage using.net 4.0 (c#) to enable flags related to the users account, change names, add users and all this stuff related with A.D. When I run the application in visual studio, in my... | [
"forms",
"active-directory",
"ldap",
"forms-authentication",
"iis-7.5"
] | 0 | 0 | 1,485 | 1 | 0 | 2011-06-03T17:41:00.713000 | 2011-06-06T15:44:37.793000 |
6,230,663 | 6,230,818 | How do I recursively walk a nested hash data structure? | I am stuck with what looks like a simple conceptual issue to me. After diligently looking for similar issues on the Web and Stack Overflow I could not find something similar, so I thought I could ask you. I am building a hash of hash data structure which is deeply nested. The depth can be 10-20 a times. For the sake of... | I'm not sure what you're calling analyse_contig_tree_recursively on (you're not using that $contig_hash parameter anywhere, and you haven't defined $TAXA_LEVEL: did you mean $TAXA_TREE?), but there's obviously a mismatch between your data structure layout and your recursive traversal pattern. Your traversal function as... | How do I recursively walk a nested hash data structure? I am stuck with what looks like a simple conceptual issue to me. After diligently looking for similar issues on the Web and Stack Overflow I could not find something similar, so I thought I could ask you. I am building a hash of hash data structure which is deeply... | TITLE:
How do I recursively walk a nested hash data structure?
QUESTION:
I am stuck with what looks like a simple conceptual issue to me. After diligently looking for similar issues on the Web and Stack Overflow I could not find something similar, so I thought I could ask you. I am building a hash of hash data structu... | [
"perl",
"recursion",
"hash"
] | 7 | 13 | 9,571 | 1 | 0 | 2011-06-03T17:41:28.900000 | 2011-06-03T17:55:22.837000 |
6,230,665 | 6,230,704 | Stored Procedure to SELECT Last 6 Digits of Number | I have a data field in a SQL table with a large number (9 digits, A Customer Information Number). I want to run a stored procedure that will only SELECT the last 6 digits of the number. Something like: SELECT (Last 6 Digits of num) FROM db WHERE user = @user Does anyone know of a way to accomplish this? | DECLARE @bigOne bigint
SET @bigOne = 999333444
SELECT RIGHT(@bigOne, 6) Returns the right part of a character string with the specified number of characters. Here is the MSDN for the Right() function as well: http://msdn.microsoft.com/en-us/library/ms177532.aspx In your case corey you can do: SELECT RIGHT(num, 6) FRO... | Stored Procedure to SELECT Last 6 Digits of Number I have a data field in a SQL table with a large number (9 digits, A Customer Information Number). I want to run a stored procedure that will only SELECT the last 6 digits of the number. Something like: SELECT (Last 6 Digits of num) FROM db WHERE user = @user Does anyon... | TITLE:
Stored Procedure to SELECT Last 6 Digits of Number
QUESTION:
I have a data field in a SQL table with a large number (9 digits, A Customer Information Number). I want to run a stored procedure that will only SELECT the last 6 digits of the number. Something like: SELECT (Last 6 Digits of num) FROM db WHERE user ... | [
"sql",
"sql-server",
"stored-procedures"
] | 7 | 21 | 45,155 | 5 | 0 | 2011-06-03T17:41:45.287000 | 2011-06-03T17:46:10.170000 |
6,230,671 | 6,256,773 | Mule 3.1 - Message transform exception with http-request-to-parameter-map transformer | I am attempting to create a simple service in which an HTTP request is made, I get a map of key/value pairs for the query parameters, and I return something in response. Here is the relevant portion of my config file: Here is relevant portion of the ScenarioIndex class. public Object scenarioIndex(Map queryParameters) ... | I have no idea how to solve this problem as I asked it, but I found a much better workaround. By using the Jersey RESTful support built in, I can get the query parameters in a much better way. My service became and in my class: @GET @Produces(MediaType.APPLICATION_XML) @Path("/kml") public String scenarioIndex( @QueryP... | Mule 3.1 - Message transform exception with http-request-to-parameter-map transformer I am attempting to create a simple service in which an HTTP request is made, I get a map of key/value pairs for the query parameters, and I return something in response. Here is the relevant portion of my config file: Here is relevant... | TITLE:
Mule 3.1 - Message transform exception with http-request-to-parameter-map transformer
QUESTION:
I am attempting to create a simple service in which an HTTP request is made, I get a map of key/value pairs for the query parameters, and I return something in response. Here is the relevant portion of my config file... | [
"java",
"http",
"esb",
"mule"
] | 0 | 1 | 3,415 | 1 | 0 | 2011-06-03T17:42:05.217000 | 2011-06-06T19:04:53.530000 |
6,230,679 | 6,231,031 | Django aggregate count on ForeignKey returning multiple records for same ID | The model structure is Question has one Video, and Question has many Answers. The problem query is: questions = Question.objects\.values('id', 'answer', 'section__title', 'title', 'created_at','user__username')\.filter(video=v).annotate(answer_count=Count('answer')) I'm using the Count aggregate function to add an extr... | I'm not sure what your model definition is. I assume you have something like this: class Answer(models.Models): question = models.ForeignKey(Question, related_name='answer') When you query the way you described, you will retrieve one row per answer. If you leave out 'answer', from the values call, you should get what y... | Django aggregate count on ForeignKey returning multiple records for same ID The model structure is Question has one Video, and Question has many Answers. The problem query is: questions = Question.objects\.values('id', 'answer', 'section__title', 'title', 'created_at','user__username')\.filter(video=v).annotate(answer_... | TITLE:
Django aggregate count on ForeignKey returning multiple records for same ID
QUESTION:
The model structure is Question has one Video, and Question has many Answers. The problem query is: questions = Question.objects\.values('id', 'answer', 'section__title', 'title', 'created_at','user__username')\.filter(video=v... | [
"python",
"django"
] | 0 | 1 | 575 | 1 | 0 | 2011-06-03T17:43:01.573000 | 2011-06-03T18:15:35.630000 |
6,230,685 | 6,230,884 | Working with databases in android? | I have a database in my app and when I need to insert or delete something I have to open the database,of course. I do this every activity, so that means that I open the database even if it is open. In DDMS I get:"Leak found". What should I do to open my database only once time? Should I use a singleton class? | Yes, Singleton is the best option. You can use a common instance to access the database. If you want to share DB with external activities, then go for content provider. | Working with databases in android? I have a database in my app and when I need to insert or delete something I have to open the database,of course. I do this every activity, so that means that I open the database even if it is open. In DDMS I get:"Leak found". What should I do to open my database only once time? Should... | TITLE:
Working with databases in android?
QUESTION:
I have a database in my app and when I need to insert or delete something I have to open the database,of course. I do this every activity, so that means that I open the database even if it is open. In DDMS I get:"Leak found". What should I do to open my database only... | [
"android",
"database",
"sqlite",
"android-loadermanager"
] | 2 | 3 | 446 | 2 | 0 | 2011-06-03T17:44:05.923000 | 2011-06-03T18:01:55.183000 |
6,230,690 | 6,230,725 | Visual C++ copy char array into char array | Need help with copying array object to a temp array object using a for loop (see code + comments below)..... Thanks in advance!!!! int counter; char buffer[] = "this is what i want 0 ignore the rest after the zero"; // char command[sizeof(buffer)];
for ( counter = 0; counter < sizeof(buffer); counter++ ){ if ( buffer[... | http://ideone.com/haCBP Your code is working fine: output: this is what i want this is what i want Edit: That being said, you need to initialize your output buffer: char command[sizeof(buffer)]={}; // now the string will be null-termiated // no matter where the copy ends | Visual C++ copy char array into char array Need help with copying array object to a temp array object using a for loop (see code + comments below)..... Thanks in advance!!!! int counter; char buffer[] = "this is what i want 0 ignore the rest after the zero"; // char command[sizeof(buffer)];
for ( counter = 0; counter ... | TITLE:
Visual C++ copy char array into char array
QUESTION:
Need help with copying array object to a temp array object using a for loop (see code + comments below)..... Thanks in advance!!!! int counter; char buffer[] = "this is what i want 0 ignore the rest after the zero"; // char command[sizeof(buffer)];
for ( cou... | [
"c++",
"arrays"
] | 0 | 3 | 3,053 | 4 | 0 | 2011-06-03T17:44:34 | 2011-06-03T17:48:19.673000 |
6,230,692 | 6,230,712 | SimpleDateFormat not catching invalid 13th month | I am attempting to validate a query parameter for a date. If an invalid date is entered i return an 400 BAD_REQUEST response code. However, my validation is not catching an invalid date of '201113'. It does however, catch an invalid year such as '000012'. I am using the following code: SimpleDateFormat df = new SimpleD... | "mm" is for minutes. "MM" is for months... Try "yyyyMM" as your format string instead. | SimpleDateFormat not catching invalid 13th month I am attempting to validate a query parameter for a date. If an invalid date is entered i return an 400 BAD_REQUEST response code. However, my validation is not catching an invalid date of '201113'. It does however, catch an invalid year such as '000012'. I am using the ... | TITLE:
SimpleDateFormat not catching invalid 13th month
QUESTION:
I am attempting to validate a query parameter for a date. If an invalid date is entered i return an 400 BAD_REQUEST response code. However, my validation is not catching an invalid date of '201113'. It does however, catch an invalid year such as '000012... | [
"java",
"validation",
"simpledateformat"
] | 0 | 4 | 733 | 1 | 0 | 2011-06-03T17:44:45.673000 | 2011-06-03T17:46:45.033000 |
6,230,693 | 6,230,714 | URL Encoding Strings that aren't valid URIs | I'm not sure I understand the URI object completely to do this properly. I want to be able to convert a string into a url-encoded string. For example, I have a servlet acting as a file handler and I need to specify the file name in the header - response.setHeader("Content-disposition", "attachment;filename=" + new URI(... | You could use URLEncoder and simply replace all + with %20. Also, URLEncoder.encode(String s, String enc) is not deprecated. You could also use org.springframework.web.util.UriUtils.encodeUri. | URL Encoding Strings that aren't valid URIs I'm not sure I understand the URI object completely to do this properly. I want to be able to convert a string into a url-encoded string. For example, I have a servlet acting as a file handler and I need to specify the file name in the header - response.setHeader("Content-dis... | TITLE:
URL Encoding Strings that aren't valid URIs
QUESTION:
I'm not sure I understand the URI object completely to do this properly. I want to be able to convert a string into a url-encoded string. For example, I have a servlet acting as a file handler and I need to specify the file name in the header - response.setH... | [
"java",
"url-encoding"
] | 0 | 1 | 3,473 | 4 | 0 | 2011-06-03T17:44:45.720000 | 2011-06-03T17:46:48.737000 |
6,230,697 | 6,230,763 | Question about .Net Tasks and the Async CTP | I'm experimenting with the Async CTP and liking it quite a bit. I did have a question from the whitepaper explaining it however. In it, it says: It is important to understand that async methods like ( an example method listed in the whitepaper ) do not run on their own thread. If they don't run on their own thread, how... | When you call an async method, it's initially synchronous. It doesn't even have the chance of being asynchronous until it hits an await. At each await expression, GetAwaiter() is called on the awaitable that you're awaiting. Then the IsCompleted property is tested on the awaiter. If the task has already completed, the ... | Question about .Net Tasks and the Async CTP I'm experimenting with the Async CTP and liking it quite a bit. I did have a question from the whitepaper explaining it however. In it, it says: It is important to understand that async methods like ( an example method listed in the whitepaper ) do not run on their own thread... | TITLE:
Question about .Net Tasks and the Async CTP
QUESTION:
I'm experimenting with the Async CTP and liking it quite a bit. I did have a question from the whitepaper explaining it however. In it, it says: It is important to understand that async methods like ( an example method listed in the whitepaper ) do not run o... | [
"asynchronous",
"async-await"
] | 6 | 5 | 297 | 2 | 0 | 2011-06-03T17:45:15.163000 | 2011-06-03T17:51:31.723000 |
6,230,701 | 6,230,720 | "if var and var2 == getSomeValue()" in python - if the first is false, is the second statement evaluated?' | I have some code like this: if var: if var2 == getSomeValue() This could be in a single expression. if var and var2 == getSomeValue():...but getSomeValue() can only be called if var is True. So, when calling if var and var2 == getSomeValue(), are both evaluated by the interpreter, or the evaluation stops at var if Fals... | This is called short-circuiting, and Python does it, so you're good. UPDATE: Here's a quick example. >>> def foo():... print "Yay!"... >>> if True and foo() is None:... print "indeed"... Yay! indeed >>> if False and foo() is None:... print "nope"... UPDATE 2: Putting the relevant PEP (308) in my answer so it doesn't ge... | "if var and var2 == getSomeValue()" in python - if the first is false, is the second statement evaluated?' I have some code like this: if var: if var2 == getSomeValue() This could be in a single expression. if var and var2 == getSomeValue():...but getSomeValue() can only be called if var is True. So, when calling if va... | TITLE:
"if var and var2 == getSomeValue()" in python - if the first is false, is the second statement evaluated?'
QUESTION:
I have some code like this: if var: if var2 == getSomeValue() This could be in a single expression. if var and var2 == getSomeValue():...but getSomeValue() can only be called if var is True. So, ... | [
"python",
"short-circuiting"
] | 5 | 10 | 523 | 6 | 0 | 2011-06-03T17:45:31.827000 | 2011-06-03T17:47:44.560000 |
6,230,703 | 6,230,789 | How to Access Related Models in Polymorphic Associations | If I have a polymorphic association, how do I access related methods in my views? For example, let's say the model associations are: class Order < ActiveRecord::Base belongs_to:orderable,:polymorphic => true end
class Product < ActiveRecord::Base has_many:orders,:as =>:orderable end And, in the Order view, I tried usi... | Try this: Use the name given to the:as to access the parent: <%= @order.orderable.id %> Also, here is some info in the Rails Guides | How to Access Related Models in Polymorphic Associations If I have a polymorphic association, how do I access related methods in my views? For example, let's say the model associations are: class Order < ActiveRecord::Base belongs_to:orderable,:polymorphic => true end
class Product < ActiveRecord::Base has_many:orders... | TITLE:
How to Access Related Models in Polymorphic Associations
QUESTION:
If I have a polymorphic association, how do I access related methods in my views? For example, let's say the model associations are: class Order < ActiveRecord::Base belongs_to:orderable,:polymorphic => true end
class Product < ActiveRecord::Ba... | [
"ruby-on-rails",
"associations"
] | 1 | 5 | 1,763 | 2 | 0 | 2011-06-03T17:46:08.823000 | 2011-06-03T17:53:31.507000 |
6,230,705 | 6,232,122 | jcarousellite circular items help with cloned items | Hey guys, I am using the jcarousellite to display items that are set to circular so it scrolls back around...However the items that scroll around are actually clones and dynamically generated so when those items are in view, I can't click on them and pull the title via jQuery because they seem to not be bind... So does... | Ok I dug through the code and researched the clone function and it turns out I just need to add clone(true) to the plugin and that will bind the cloned items to the parent dom element. | jcarousellite circular items help with cloned items Hey guys, I am using the jcarousellite to display items that are set to circular so it scrolls back around...However the items that scroll around are actually clones and dynamically generated so when those items are in view, I can't click on them and pull the title vi... | TITLE:
jcarousellite circular items help with cloned items
QUESTION:
Hey guys, I am using the jcarousellite to display items that are set to circular so it scrolls back around...However the items that scroll around are actually clones and dynamically generated so when those items are in view, I can't click on them and... | [
"jquery",
"jcarousellite"
] | 0 | 0 | 565 | 1 | 0 | 2011-06-03T17:46:13.447000 | 2011-06-03T20:10:12.107000 |
6,230,715 | 6,230,790 | How to send parameters from class to winform? | I've found a code that does exactly what I like: View/edit ID3 data for MP3 files... class a{ public? getContent(){
string Title = Encoding.Default.GetString(tag.Title); string Artist = Encoding.Default.GetString(tag.Artist); string Album = Encoding.Default.GetString(tag.Album); } }
class form1{ button1.click() {? = ... | Is there some reason you can't use a class to encapsulate that data? class TagData { public string Title {get; set; } public string Artist {get; set; } public string Album {get; set; } }
class a{ public TagData getContent(){ return new TagData { Title = Encoding.Default.GetString(tag.Title), Artist = Encoding.Default.... | How to send parameters from class to winform? I've found a code that does exactly what I like: View/edit ID3 data for MP3 files... class a{ public? getContent(){
string Title = Encoding.Default.GetString(tag.Title); string Artist = Encoding.Default.GetString(tag.Artist); string Album = Encoding.Default.GetString(tag.A... | TITLE:
How to send parameters from class to winform?
QUESTION:
I've found a code that does exactly what I like: View/edit ID3 data for MP3 files... class a{ public? getContent(){
string Title = Encoding.Default.GetString(tag.Title); string Artist = Encoding.Default.GetString(tag.Artist); string Album = Encoding.Defau... | [
"c#",
"winforms"
] | 1 | 1 | 207 | 3 | 0 | 2011-06-03T17:47:09.007000 | 2011-06-03T17:53:35.390000 |
6,230,717 | 6,231,934 | Convert CSV to multi dimensional array in Javascript | I'm reading data from a CSV file using jQuery's Ajax function. I have been using a Jquery plugin called Jquery CSV to convert the data into an array, but in Internet Explorer the array is returning different keys for some reason. The code for the ajax call and the plugin processing the data was: var ourOffices = new Ar... | I'm sure you have seen the comment in the plugin split() doesn't work properly on IE. "a,,b".split(",") returns ["a", "b"] and not ["a", "", "b"] could that be your issue. | Convert CSV to multi dimensional array in Javascript I'm reading data from a CSV file using jQuery's Ajax function. I have been using a Jquery plugin called Jquery CSV to convert the data into an array, but in Internet Explorer the array is returning different keys for some reason. The code for the ajax call and the pl... | TITLE:
Convert CSV to multi dimensional array in Javascript
QUESTION:
I'm reading data from a CSV file using jQuery's Ajax function. I have been using a Jquery plugin called Jquery CSV to convert the data into an array, but in Internet Explorer the array is returning different keys for some reason. The code for the aj... | [
"jquery",
"arrays",
"csv"
] | 2 | 3 | 2,715 | 1 | 0 | 2011-06-03T17:47:29.377000 | 2011-06-03T19:47:04.920000 |
6,230,739 | 6,230,774 | svcutil generated client side WCF service binding code which doesnt compile | [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="TreeTraversalType", Namespace="http://schemas.datacontract.org/2004/07/DsLib")] public enum TreeTraversalType: int { [System.Runtime.Serialization.EnumMemberAttribute()] ... | Enums work fine in contracts. Do you have a reference to System.Runtime.Serialization.dll (where DataContractAttribute is defined) in your project? | svcutil generated client side WCF service binding code which doesnt compile [System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="TreeTraversalType", Namespace="http://schemas.datacontract.org/2004/07/DsLib")] public enum Tr... | TITLE:
svcutil generated client side WCF service binding code which doesnt compile
QUESTION:
[System.CodeDom.Compiler.GeneratedCodeAttribute("System.Runtime.Serialization", "3.0.0.0")] [System.Runtime.Serialization.DataContractAttribute(Name="TreeTraversalType", Namespace="http://schemas.datacontract.org/2004/07/DsLib... | [
".net",
"wcf",
"wcf-binding"
] | 0 | 1 | 317 | 2 | 0 | 2011-06-03T17:49:12.980000 | 2011-06-03T17:52:30.077000 |
6,230,743 | 6,230,889 | How to hide certain tags from the_tags() in WordPress? | I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone please give me an example as to how to do this? | Use get_tags() instead of the_tags() in your templates $tags = get_tags();
foreach ($tags as $tag) { if($tag->name=='the tag i want gone') continue;// do this for every tag you want gone echo $tag->name.', '; } | How to hide certain tags from the_tags() in WordPress? I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone please give me an example as to how to do this? | TITLE:
How to hide certain tags from the_tags() in WordPress?
QUESTION:
I need to assign some tags to my posts (for external use), but I don't want them showing anywhere that tags are listed. Can someone please give me an example as to how to do this?
ANSWER:
Use get_tags() instead of the_tags() in your templates $ta... | [
"php",
"wordpress",
"tags"
] | 2 | 2 | 4,218 | 2 | 0 | 2011-06-03T17:49:42.247000 | 2011-06-03T18:02:37.860000 |
6,230,754 | 6,230,872 | Access violation exception | Hi I am getting an access violation error..... What might be the problem in my code?? When I change W and H to 10 it works fine. #define W 100 #define H 100 #define MAX 100000 int** GetImage() { int **img = new int*[W]; for(size_t i = 0; i < W; i++ ) img[i] = new int[H];
for(int i=0;i | Your array isn't contiguous in memory, but you're trying to copy it as if it were. To allocate a contiguous array, you'd need to do a single allocation. But you're allocating an array of pointers and then allocating an array of integers for each of those pointers, so there's no guarantee that img[0] immediately precede... | Access violation exception Hi I am getting an access violation error..... What might be the problem in my code?? When I change W and H to 10 it works fine. #define W 100 #define H 100 #define MAX 100000 int** GetImage() { int **img = new int*[W]; for(size_t i = 0; i < W; i++ ) img[i] = new int[H];
for(int i=0;i | TITLE:
Access violation exception
QUESTION:
Hi I am getting an access violation error..... What might be the problem in my code?? When I change W and H to 10 it works fine. #define W 100 #define H 100 #define MAX 100000 int** GetImage() { int **img = new int*[W]; for(size_t i = 0; i < W; i++ ) img[i] = new int[H];
fo... | [
"cuda"
] | 0 | 0 | 1,970 | 2 | 0 | 2011-06-03T17:50:50.640000 | 2011-06-03T18:00:58.683000 |
6,230,761 | 6,230,853 | JavaScript stops workiong after an Ajax call | I'm currently trying to build a filter search function using JQuery and Ajax. The filter can be seen at: http://www.danfarrellwright.com/screwsline/front_end/product.php?product_id=104 When the page loads hover over the table and you'll see that the current cell changes color. Now use with either the length or gauge fi... | Your delegate is on $('table') which lies inside of the $('#tableHolder') meaning that it is replaced when you do the ajax call, so you lose you delegate. | JavaScript stops workiong after an Ajax call I'm currently trying to build a filter search function using JQuery and Ajax. The filter can be seen at: http://www.danfarrellwright.com/screwsline/front_end/product.php?product_id=104 When the page loads hover over the table and you'll see that the current cell changes colo... | TITLE:
JavaScript stops workiong after an Ajax call
QUESTION:
I'm currently trying to build a filter search function using JQuery and Ajax. The filter can be seen at: http://www.danfarrellwright.com/screwsline/front_end/product.php?product_id=104 When the page loads hover over the table and you'll see that the current... | [
"javascript",
"jquery",
"ajax"
] | 0 | 1 | 230 | 2 | 0 | 2011-06-03T17:51:11.877000 | 2011-06-03T17:59:11.370000 |
6,230,766 | 6,231,956 | What should i use a MapView or a Map Intent | I would like to create a mapview that will have text items and a direct me button under it. So when the activity starts up, it will drop a pin on a location specificed in the previous activity. There will then be a location name and then a direct me button. when the button is clicked it will display the route from the ... | how do i drop a pin on the mapview itself Create an ItemizedOverlay with an OverlayItem and add it to your map. Here is a sample application demonstrating this. Would you reccomend i begin a map intent to show the directions, or could i just update the map view with the directions. (how would i go about doing both) The... | What should i use a MapView or a Map Intent I would like to create a mapview that will have text items and a direct me button under it. So when the activity starts up, it will drop a pin on a location specificed in the previous activity. There will then be a location name and then a direct me button. when the button is... | TITLE:
What should i use a MapView or a Map Intent
QUESTION:
I would like to create a mapview that will have text items and a direct me button under it. So when the activity starts up, it will drop a pin on a location specificed in the previous activity. There will then be a location name and then a direct me button. ... | [
"java",
"android",
"android-mapview"
] | 1 | 1 | 164 | 1 | 0 | 2011-06-03T17:51:44.150000 | 2011-06-03T19:50:09.753000 |
6,230,768 | 6,231,571 | Programming a Bivariate Normal CDF in R | I have a question regarding coding a function that contains a bivariate normal CDF in R. The function I am trying to code requires one bivariate normal CDF, that should be calculated differently depending on the observation. Specifically, depending upon the value of a certain variable, the correlation should "switch" b... | It sounds like all you need is 1) to make your script into a function so it can apply to arbitrary x,y and q and 2) to get rid of the for loop. If that is the case?function and?apply should give you what you need. BVN=function(x,y,q) {
cdf.results=apply(cbind(x,y,q),1,FUN=function(X) { x=X[1] y=X[2] q=X[3] vc.mat <- m... | Programming a Bivariate Normal CDF in R I have a question regarding coding a function that contains a bivariate normal CDF in R. The function I am trying to code requires one bivariate normal CDF, that should be calculated differently depending on the observation. Specifically, depending upon the value of a certain var... | TITLE:
Programming a Bivariate Normal CDF in R
QUESTION:
I have a question regarding coding a function that contains a bivariate normal CDF in R. The function I am trying to code requires one bivariate normal CDF, that should be calculated differently depending on the observation. Specifically, depending upon the valu... | [
"r",
"statistics"
] | 6 | 2 | 3,549 | 1 | 0 | 2011-06-03T17:51:57.700000 | 2011-06-03T19:11:01.093000 |
6,230,770 | 6,230,839 | Changing production database | This is probably a simple question. I have a database that I'm using to store my users details. My app queries this db to determine if they get access or not. During testing, if I wanted to change the structure of the db, such as adding a new column, I would simply DROP the tables and re-CREATE them. I don't think I wa... | Generally I've tracked database changes in source control as such: Have an initial baseline of scripts to generate the initial database. This step can be performed as needed in development and test environments, but in Production it's pretty much just performed the first time. Have a folder of delta scripts. When gener... | Changing production database This is probably a simple question. I have a database that I'm using to store my users details. My app queries this db to determine if they get access or not. During testing, if I wanted to change the structure of the db, such as adding a new column, I would simply DROP the tables and re-CR... | TITLE:
Changing production database
QUESTION:
This is probably a simple question. I have a database that I'm using to store my users details. My app queries this db to determine if they get access or not. During testing, if I wanted to change the structure of the db, such as adding a new column, I would simply DROP th... | [
"mysql",
"database"
] | 0 | 1 | 253 | 3 | 0 | 2011-06-03T17:52:07.143000 | 2011-06-03T17:57:49.850000 |
6,230,775 | 6,230,807 | Scala public methods: ';' expected but 'def' found | I wrote this method: public def getXScaleFactor(panelWidth: Int): Double = { return (panelWidth / (samplesContainer[0].length.asInstanceOf[Double])) } and I have problems with compilation: [error]./src/main/scala/Controllers/TrackController.scala:85: ';' expected but 'def' found. [error] public def getXScaleFactor(pane... | public is not a reserved word in Scala, so it's interpreting it as a variable name. Public access is the default; just leave off public and you'll be fine. | Scala public methods: ';' expected but 'def' found I wrote this method: public def getXScaleFactor(panelWidth: Int): Double = { return (panelWidth / (samplesContainer[0].length.asInstanceOf[Double])) } and I have problems with compilation: [error]./src/main/scala/Controllers/TrackController.scala:85: ';' expected but '... | TITLE:
Scala public methods: ';' expected but 'def' found
QUESTION:
I wrote this method: public def getXScaleFactor(panelWidth: Int): Double = { return (panelWidth / (samplesContainer[0].length.asInstanceOf[Double])) } and I have problems with compilation: [error]./src/main/scala/Controllers/TrackController.scala:85: ... | [
"scala",
"methods",
"compilation",
"function",
"public-method"
] | 5 | 24 | 5,648 | 4 | 0 | 2011-06-03T17:52:37.643000 | 2011-06-03T17:54:41.900000 |
6,230,779 | 6,230,799 | Trying to find amount of NULL values for a column returning 0? | I have a column in my table that has a few different values, of which I verified by using a group by. When I do something like this it returns a number amount: SELECT COUNT(*) FROM table WHERE age=''; However when I do this it always returns 0 even though that is incorrect: SELECT COUNT(*) FROM table WHERE age=NULL; An... | SELECT COUNT(*) FROM table WHERE age IS NULL; Read 3.3.4.6. Working with NULL Values To test for NULL, you cannot use the arithmetic comparison operators such as =, <, or <>. Use the IS NULL and IS NOT NULL operators instead: | Trying to find amount of NULL values for a column returning 0? I have a column in my table that has a few different values, of which I verified by using a group by. When I do something like this it returns a number amount: SELECT COUNT(*) FROM table WHERE age=''; However when I do this it always returns 0 even though t... | TITLE:
Trying to find amount of NULL values for a column returning 0?
QUESTION:
I have a column in my table that has a few different values, of which I verified by using a group by. When I do something like this it returns a number amount: SELECT COUNT(*) FROM table WHERE age=''; However when I do this it always retur... | [
"mysql",
"null",
"myisam"
] | 1 | 6 | 67 | 3 | 0 | 2011-06-03T17:52:50.897000 | 2011-06-03T17:53:59.647000 |
6,230,794 | 6,230,876 | Is it possible to calculate method execution time without a variable? | This is the Java code: public void foo() { final long start = System.nanoTime(); // some operations... System.out.println("done in " + (System.nanoTime() - start) + " nano sec"); } Is it possible to do the same, but without start variable? Something like this: public void foo() { // some operations... System.out.printl... | This is not a straightforward answer. I'm inferring from the question that you do not wish to clutter your code with unnecessary profiling code, that you may remove later. In such a case, it is recommended to use AOP. You may then weave aspects around the methods that you want profiled, and these aspects would have the... | Is it possible to calculate method execution time without a variable? This is the Java code: public void foo() { final long start = System.nanoTime(); // some operations... System.out.println("done in " + (System.nanoTime() - start) + " nano sec"); } Is it possible to do the same, but without start variable? Something ... | TITLE:
Is it possible to calculate method execution time without a variable?
QUESTION:
This is the Java code: public void foo() { final long start = System.nanoTime(); // some operations... System.out.println("done in " + (System.nanoTime() - start) + " nano sec"); } Is it possible to do the same, but without start va... | [
"java"
] | 0 | 3 | 221 | 2 | 0 | 2011-06-03T17:53:50.967000 | 2011-06-03T18:01:26.487000 |
6,230,800 | 6,230,923 | Is there a way of importing fonts through css in ie7? | My problem is pretty simple, but I just can't solve it by myself. Does anybody know how to import fonts in ie7? The code that I use and works in all navigators, except ie is: @font-face { font-family: "Interstate"; src: url("interstate_regular.ttf"); } All that I found is that ie7 can't support it, but it's better to b... | I'm fairly certain IE7 supports @font-face but (forgive me, been a while since I ever worried about IE7 so memory is fuzzy) I believe there is a bug in the way IE 7 and 8 process the URL's. Your best bet is to use the @font-face generator at fontsquirrel... it will create a css class with all the necessary fixes to mak... | Is there a way of importing fonts through css in ie7? My problem is pretty simple, but I just can't solve it by myself. Does anybody know how to import fonts in ie7? The code that I use and works in all navigators, except ie is: @font-face { font-family: "Interstate"; src: url("interstate_regular.ttf"); } All that I fo... | TITLE:
Is there a way of importing fonts through css in ie7?
QUESTION:
My problem is pretty simple, but I just can't solve it by myself. Does anybody know how to import fonts in ie7? The code that I use and works in all navigators, except ie is: @font-face { font-family: "Interstate"; src: url("interstate_regular.ttf"... | [
"css",
"fonts",
"import",
"internet-explorer-7"
] | 3 | 1 | 1,152 | 2 | 0 | 2011-06-03T17:54:04.780000 | 2011-06-03T18:05:46.063000 |
6,230,805 | 6,231,385 | Deleting a site content type in Sharepoint 2007 | I'm trying to delete a custom content type that I've created, but I'm getting an error when I try to do so: The content type is in use. at Microsoft.SharePoint.SPContentTypeCollection.DeleteFromWeb(SPContentTypeId id, String strName) at Microsoft.SharePoint.SPContentTypeCollection.Delete(SPContentTypeId id) at Microsof... | I found out that the a library on the parent site was using this content type still. The important thing to note is that even though a list or library may not have an items in it, it could still be using the content type. Thanks everyone for you responses | Deleting a site content type in Sharepoint 2007 I'm trying to delete a custom content type that I've created, but I'm getting an error when I try to do so: The content type is in use. at Microsoft.SharePoint.SPContentTypeCollection.DeleteFromWeb(SPContentTypeId id, String strName) at Microsoft.SharePoint.SPContentTypeC... | TITLE:
Deleting a site content type in Sharepoint 2007
QUESTION:
I'm trying to delete a custom content type that I've created, but I'm getting an error when I try to do so: The content type is in use. at Microsoft.SharePoint.SPContentTypeCollection.DeleteFromWeb(SPContentTypeId id, String strName) at Microsoft.SharePo... | [
"sharepoint",
"content-type"
] | 1 | 0 | 2,102 | 3 | 0 | 2011-06-03T17:54:28.367000 | 2011-06-03T18:50:38.327000 |
6,230,825 | 6,230,921 | Is it safe to use SET ROWCOUNT? | I am using SET ROWCOUNT because the value comes from a parameter into my procedure. SET ROWCOUNT @take
SELECT * FROM Something
SET ROWCOUNT 0 Is it possible to another procedure executes at the same time and get the rowcount setting, or is it perfectly safe to use it on a stored procedure? | Rowcount is specific to your current scope, so you are safe there. However, Books Online tells me this (which may or may not affect your needs): Using SET ROWCOUNT will not affect DELETE, INSERT, and UPDATE statements in the next release of SQL Server. Do not use SET ROWCOUNT with DELETE, INSERT, and UPDATE statements ... | Is it safe to use SET ROWCOUNT? I am using SET ROWCOUNT because the value comes from a parameter into my procedure. SET ROWCOUNT @take
SELECT * FROM Something
SET ROWCOUNT 0 Is it possible to another procedure executes at the same time and get the rowcount setting, or is it perfectly safe to use it on a stored proced... | TITLE:
Is it safe to use SET ROWCOUNT?
QUESTION:
I am using SET ROWCOUNT because the value comes from a parameter into my procedure. SET ROWCOUNT @take
SELECT * FROM Something
SET ROWCOUNT 0 Is it possible to another procedure executes at the same time and get the rowcount setting, or is it perfectly safe to use it ... | [
"sql-server",
"sql-server-2008",
"rowcount"
] | 7 | 8 | 18,215 | 4 | 0 | 2011-06-03T17:56:13.657000 | 2011-06-03T18:05:30.427000 |
6,230,826 | 6,230,977 | display a System.Drawing.Bitmap object in a System.Windows.Controls.Image control | I have an image control as: in a wpf application. I imported a library that converts a video to bitmap images and I am trying to place those bitmaps in the image countrol. There is a method that returns a System.Drawing.Bitmap object and I want to display that bitmap in image1. How could I do that? | You need to convert it to an ImageSource of some kind first. See this question. You can use a ValueConverter to do this on the fly in the binding itself. | display a System.Drawing.Bitmap object in a System.Windows.Controls.Image control I have an image control as: in a wpf application. I imported a library that converts a video to bitmap images and I am trying to place those bitmaps in the image countrol. There is a method that returns a System.Drawing.Bitmap object and ... | TITLE:
display a System.Drawing.Bitmap object in a System.Windows.Controls.Image control
QUESTION:
I have an image control as: in a wpf application. I imported a library that converts a video to bitmap images and I am trying to place those bitmaps in the image countrol. There is a method that returns a System.Drawing.... | [
"c#",
"wpf",
"image",
"xaml",
"bitmapimage"
] | 3 | 2 | 8,767 | 1 | 0 | 2011-06-03T17:56:19.077000 | 2011-06-03T18:10:36.510000 |
6,230,830 | 6,240,642 | Incercept when DateTime.Now is used when writing to a Database | It is well known that in a database, you should be storing the date in universal time coordinate. I am looking for a way to know when a developer misuses DateTime.Now when writing to the Database. We are using Sql Server 2008, with either EF4 or nHibernate 3.0. Is it possible to intercept the value of a datetime when i... | You can add the following event listener: public class DateTimeEventListener: IPreUpdateEventListener, IPreInsertEventListener { public bool OnPreUpdate(PreUpdateEvent e) { foreach (var value in e.State) if (value is DateTime && ((DateTime)value).Kind!= DateTimeKind.Utc) throw new Exception("Non-UTC DateTime used"); }
... | Incercept when DateTime.Now is used when writing to a Database It is well known that in a database, you should be storing the date in universal time coordinate. I am looking for a way to know when a developer misuses DateTime.Now when writing to the Database. We are using Sql Server 2008, with either EF4 or nHibernate ... | TITLE:
Incercept when DateTime.Now is used when writing to a Database
QUESTION:
It is well known that in a database, you should be storing the date in universal time coordinate. I am looking for a way to know when a developer misuses DateTime.Now when writing to the Database. We are using Sql Server 2008, with either ... | [
".net",
"sql-server",
"nhibernate",
"entity-framework"
] | 3 | 3 | 294 | 6 | 0 | 2011-06-03T17:56:53.463000 | 2011-06-05T02:24:01.163000 |
6,230,838 | 6,230,885 | Powershell values within a loop losing their value | Forgive the title, I'm not really sure how to explain what I'm seeing. Sample Code: $SampleValues = 1..5 $Result = "" | Select ID $Results = @()
$SampleValues | %{ $Result.ID = $_ $Results += $Result }
$Results This is fairly straightforward: Create an array with 5 numbers to be used in a loop Create a temp variable ... | It fixes the problem by moving into the loop because then you are then creating a new $Result object each time rather than changing a value on the same one (referenced 5 times in the array). It doesn't have anything to do with whether you use "" | Select ID or 123 | Select ID because that just becomes a sort of propert... | Powershell values within a loop losing their value Forgive the title, I'm not really sure how to explain what I'm seeing. Sample Code: $SampleValues = 1..5 $Result = "" | Select ID $Results = @()
$SampleValues | %{ $Result.ID = $_ $Results += $Result }
$Results This is fairly straightforward: Create an array with 5 n... | TITLE:
Powershell values within a loop losing their value
QUESTION:
Forgive the title, I'm not really sure how to explain what I'm seeing. Sample Code: $SampleValues = 1..5 $Result = "" | Select ID $Results = @()
$SampleValues | %{ $Result.ID = $_ $Results += $Result }
$Results This is fairly straightforward: Create... | [
"powershell"
] | 3 | 9 | 5,054 | 2 | 0 | 2011-06-03T17:57:44.833000 | 2011-06-03T18:01:59.937000 |
6,230,843 | 6,231,018 | Publish APP to Android market, where to embed my own key? | I want to publish my application (which is not free) in android market with my own key. I got my encrypted key, but I don’t know where do I need to write this key? In which file I need to write this key? I read the dev Guide documentation of android and I also searched by myself but I don’t understand and I couldn’t fi... | You only need the key if you have implemented licensing ( http://developer.android.com/guide/publishing/licensing.html ) | Publish APP to Android market, where to embed my own key? I want to publish my application (which is not free) in android market with my own key. I got my encrypted key, but I don’t know where do I need to write this key? In which file I need to write this key? I read the dev Guide documentation of android and I also s... | TITLE:
Publish APP to Android market, where to embed my own key?
QUESTION:
I want to publish my application (which is not free) in android market with my own key. I got my encrypted key, but I don’t know where do I need to write this key? In which file I need to write this key? I read the dev Guide documentation of an... | [
"android",
"android-manifest",
"google-play"
] | 2 | 1 | 260 | 1 | 0 | 2011-06-03T17:58:00.090000 | 2011-06-03T18:14:42.897000 |
6,230,847 | 6,244,897 | How to create view/python reference on scipy sparse matrix? | I am working on an algorithm that uses diagonal and first off-diagonal blocks of a large (will be e06 x e06) block diagonal sparse matrix. Right now I create a dict that stores the blocks in such a way that I can access the blocks in a matrix like fashion. For example B[0,0](5x5) gives the first block of matrix A (20x2... | As far as I know, all of the various sparse matricies in scipy.sparse return copies rather than a view of some sort. (Some of the others may be significantly faster at doing so than lil_matrix, though!) One way of doing what you want is to just work with slice objects. For example: import scipy.sparse
class SparseBloc... | How to create view/python reference on scipy sparse matrix? I am working on an algorithm that uses diagonal and first off-diagonal blocks of a large (will be e06 x e06) block diagonal sparse matrix. Right now I create a dict that stores the blocks in such a way that I can access the blocks in a matrix like fashion. For... | TITLE:
How to create view/python reference on scipy sparse matrix?
QUESTION:
I am working on an algorithm that uses diagonal and first off-diagonal blocks of a large (will be e06 x e06) block diagonal sparse matrix. Right now I create a dict that stores the blocks in such a way that I can access the blocks in a matrix... | [
"python",
"view",
"scipy",
"sparse-matrix"
] | 5 | 4 | 671 | 1 | 0 | 2011-06-03T17:58:13.180000 | 2011-06-05T18:23:46.400000 |
6,230,848 | 6,230,930 | javascript redirect back to parent page | I have a page where opens a child page with javascript. the code is like below: onclick='window.open("http://mysite.com/pagename", "loginWindonw", "width=800,height=600,left=150,top=100" ); return false;' in the child window, when user logs in, I redirect them back to the main window and close the child window. This wo... | If I understood well, you want to bring the user back to the same page they opened the logging window from, but first log them in, right? Then you may just want to refresh the page in the parent window after logging in: location.reload(true); // this will reload the page | javascript redirect back to parent page I have a page where opens a child page with javascript. the code is like below: onclick='window.open("http://mysite.com/pagename", "loginWindonw", "width=800,height=600,left=150,top=100" ); return false;' in the child window, when user logs in, I redirect them back to the main wi... | TITLE:
javascript redirect back to parent page
QUESTION:
I have a page where opens a child page with javascript. the code is like below: onclick='window.open("http://mysite.com/pagename", "loginWindonw", "width=800,height=600,left=150,top=100" ); return false;' in the child window, when user logs in, I redirect them b... | [
"javascript",
"redirect"
] | 3 | 2 | 8,954 | 2 | 0 | 2011-06-03T17:58:19.007000 | 2011-06-03T18:06:15.943000 |
6,230,851 | 6,230,906 | js style properties returns blank | I am trying to receive the original CSS width value of an object using JavaScript. However, if I use: var originalWidth = document.getElementById( ).style.width; It always returns blank. I've also noticed that any property I access using this syntax will return blank. I know for sure that the given element exists, sinc... | You probably try to get the value which was set in stylesheet, not directly like this: document.getElementById( ).style.width = '100px'; If you want to get the width of the element you can use innerWidth property: var width = document.getElementById( ).offsetWidth; | js style properties returns blank I am trying to receive the original CSS width value of an object using JavaScript. However, if I use: var originalWidth = document.getElementById( ).style.width; It always returns blank. I've also noticed that any property I access using this syntax will return blank. I know for sure t... | TITLE:
js style properties returns blank
QUESTION:
I am trying to receive the original CSS width value of an object using JavaScript. However, if I use: var originalWidth = document.getElementById( ).style.width; It always returns blank. I've also noticed that any property I access using this syntax will return blank.... | [
"javascript",
"coding-style"
] | 12 | 13 | 9,638 | 5 | 0 | 2011-06-03T17:58:24.570000 | 2011-06-03T18:04:09.693000 |
6,230,852 | 6,261,373 | How to override standard behavior of ApplicationTagLib#createLink and g:link? | Background: I have grails 1.3.7 application which uses g:createLink and g:link on many pages. Recently I decided to make big change in url mappings - introduce preceding path element. Currently I have: /$controller/$action?/$id? But want to have: /$regionId/$controller/$action?/$id? It was easy to change urlMappings, b... | I was unable to solve this problem in terms of OOP. I mean I can't find way how to override closure. I tried several approaches, but with no success. And documentation says that you can't override closure, you can only replace it with new implementation (please correct me if I wrong). But (!) I was able to solve task b... | How to override standard behavior of ApplicationTagLib#createLink and g:link? Background: I have grails 1.3.7 application which uses g:createLink and g:link on many pages. Recently I decided to make big change in url mappings - introduce preceding path element. Currently I have: /$controller/$action?/$id? But want to h... | TITLE:
How to override standard behavior of ApplicationTagLib#createLink and g:link?
QUESTION:
Background: I have grails 1.3.7 application which uses g:createLink and g:link on many pages. Recently I decided to make big change in url mappings - introduce preceding path element. Currently I have: /$controller/$action?/... | [
"grails"
] | 11 | 4 | 4,248 | 3 | 0 | 2011-06-03T17:59:01.137000 | 2011-06-07T06:31:07.203000 |
6,230,854 | 6,237,818 | Facebook JS+FLASH SDK: Works on IE not in FF, Chrome | I have a facebook application developed with a mixture of the PHP, JS, and AS3 SDKs. The application works perfectly on IE but it hangs on other browsers (FF,Chrome) IN FF debug console I see an error message: Empty string passed to getElementById(). swf is null (92 out of range 62) This error happens just after callin... | Ok, I found the culprit. The Facebook api needs a reference to the embedded SWF object. Since I was using SWFObject, I needed to pass two parameters: id for IE and name for Chrome/Mozilla Browsers. Simple as that... | Facebook JS+FLASH SDK: Works on IE not in FF, Chrome I have a facebook application developed with a mixture of the PHP, JS, and AS3 SDKs. The application works perfectly on IE but it hangs on other browsers (FF,Chrome) IN FF debug console I see an error message: Empty string passed to getElementById(). swf is null (92 ... | TITLE:
Facebook JS+FLASH SDK: Works on IE not in FF, Chrome
QUESTION:
I have a facebook application developed with a mixture of the PHP, JS, and AS3 SDKs. The application works perfectly on IE but it hangs on other browsers (FF,Chrome) IN FF debug console I see an error message: Empty string passed to getElementById()... | [
"javascript",
"flash",
"facebook"
] | 0 | 1 | 512 | 1 | 0 | 2011-06-03T17:59:19.557000 | 2011-06-04T16:02:26.933000 |
6,230,855 | 6,230,982 | confused about local data storage for occasionally connected application in .NET | Can I use a SQL Server Express database as my local database for an occasionally connected application (OCA) written using Visual Studio? Would that require SQL Server to be installed on the client machine? It looks like the default architecture for OCAs in.NET is to use SQL Server Compact. However, SQL Server Compact ... | Yes, local data cache works with SQL CE 3.5 and you cannot use stored procedures on the cache. Once you add local data cache item to your project it automatically prepares all necessary MS Sync Framework code for data synchronization with the main data source + all necessary SQL scripts for local database and it will a... | confused about local data storage for occasionally connected application in .NET Can I use a SQL Server Express database as my local database for an occasionally connected application (OCA) written using Visual Studio? Would that require SQL Server to be installed on the client machine? It looks like the default archit... | TITLE:
confused about local data storage for occasionally connected application in .NET
QUESTION:
Can I use a SQL Server Express database as my local database for an occasionally connected application (OCA) written using Visual Studio? Would that require SQL Server to be installed on the client machine? It looks like ... | [
"asp.net",
"wpf",
"wcf",
"visual-studio-2010"
] | 0 | 1 | 528 | 1 | 0 | 2011-06-03T17:59:20.427000 | 2011-06-03T18:11:06.337000 |
6,230,857 | 6,230,881 | Unused variable when using jQuery UI API | When using the jQuery UI API, I run into the "Unused variable" problem when running my plugin through jsLint. Example: select: function( event, ui ) { $.cookie( opts.cookieName + "_" + that.index(), ui.index ); } In this case, I only need the ui.index, but event is unused. But the API requires me to pass both parameter... | This is normal. It is often the case the event object is not used when responding to UI events | Unused variable when using jQuery UI API When using the jQuery UI API, I run into the "Unused variable" problem when running my plugin through jsLint. Example: select: function( event, ui ) { $.cookie( opts.cookieName + "_" + that.index(), ui.index ); } In this case, I only need the ui.index, but event is unused. But t... | TITLE:
Unused variable when using jQuery UI API
QUESTION:
When using the jQuery UI API, I run into the "Unused variable" problem when running my plugin through jsLint. Example: select: function( event, ui ) { $.cookie( opts.cookieName + "_" + that.index(), ui.index ); } In this case, I only need the ui.index, but even... | [
"jquery",
"jquery-ui",
"jquery-ui-tabs"
] | 1 | 1 | 231 | 1 | 0 | 2011-06-03T17:59:24.907000 | 2011-06-03T18:01:47.383000 |
6,230,862 | 6,231,126 | Best practices when writing glue code | I asked this question to get some opinions on the subject of glue code. For example, imagine you have a class (pseudocode): class MyClass int attribute a string attribute b And to represent that data model, you have BOTH a slider and a text box to represent a, and a text box and say... the window label to represent b. ... | For me I think it comes down to where the behavior is needed. In the situation you describe, the fact that you are binding multiple controls to a property is what is driving the requirement, so it doesn't make sense to add code to the model to support that. In a web-based model I would probably put the logic in the web... | Best practices when writing glue code I asked this question to get some opinions on the subject of glue code. For example, imagine you have a class (pseudocode): class MyClass int attribute a string attribute b And to represent that data model, you have BOTH a slider and a text box to represent a, and a text box and sa... | TITLE:
Best practices when writing glue code
QUESTION:
I asked this question to get some opinions on the subject of glue code. For example, imagine you have a class (pseudocode): class MyClass int attribute a string attribute b And to represent that data model, you have BOTH a slider and a text box to represent a, and... | [
"model-view-controller",
"language-agnostic",
"model-glue"
] | 2 | 1 | 1,465 | 1 | 0 | 2011-06-03T17:59:57.803000 | 2011-06-03T18:24:29.223000 |
6,230,867 | 6,231,242 | UISegmented Control with a UITabBar on the bottom | I am using a segmented control as suggested by Marc M here: How do I use a UISegmentedControl to switch views? I also have a tabbar on the bottom that I would still need to use regardless of what segment I am on. How to I get the segmented control to switch XIB files? | Your should follow the answer provided by @Rayfleck. To setup a segmented control, Setup a view controller for Media. Setup a UISegmentedControl and assign labels Teaching and Worship Create two view for each Teaching and worship (respectively), and have them ready with your data. Use the link you had provided in your ... | UISegmented Control with a UITabBar on the bottom I am using a segmented control as suggested by Marc M here: How do I use a UISegmentedControl to switch views? I also have a tabbar on the bottom that I would still need to use regardless of what segment I am on. How to I get the segmented control to switch XIB files? | TITLE:
UISegmented Control with a UITabBar on the bottom
QUESTION:
I am using a segmented control as suggested by Marc M here: How do I use a UISegmentedControl to switch views? I also have a tabbar on the bottom that I would still need to use regardless of what segment I am on. How to I get the segmented control to s... | [
"iphone",
"xcode",
"ios4",
"uitabbarcontroller",
"uisegmentedcontrol"
] | 0 | 1 | 614 | 2 | 0 | 2011-06-03T18:00:26.033000 | 2011-06-03T18:37:59.980000 |
6,230,869 | 6,230,958 | Tiny numbers in place of zero? | I have been making a matrix class (as a learning exercise) and I have come across and issue whilst testing my inverse function. I input a arbitrary matrix as such: 2 1 1 1 2 1 1 1 2 And got it to calculate the inverse and I got the correct result: 0.75 -0.25 -0.25 -0.25 0.75 -0.25 -0.25 -0.25 0.75 But when I tried mult... | You've got numbers like 0.250000000000000005 in your inverted matrix, they're just rounded for display so you see nice little round numbers like 0.25. | Tiny numbers in place of zero? I have been making a matrix class (as a learning exercise) and I have come across and issue whilst testing my inverse function. I input a arbitrary matrix as such: 2 1 1 1 2 1 1 1 2 And got it to calculate the inverse and I got the correct result: 0.75 -0.25 -0.25 -0.25 0.75 -0.25 -0.25 -... | TITLE:
Tiny numbers in place of zero?
QUESTION:
I have been making a matrix class (as a learning exercise) and I have come across and issue whilst testing my inverse function. I input a arbitrary matrix as such: 2 1 1 1 2 1 1 1 2 And got it to calculate the inverse and I got the correct result: 0.75 -0.25 -0.25 -0.25 ... | [
"c++",
"math",
"double-precision"
] | 5 | 9 | 1,934 | 5 | 0 | 2011-06-03T18:00:45.970000 | 2011-06-03T18:08:51.810000 |
6,230,873 | 6,233,627 | Should nodes of trees and similar data structures be visible to the outside? | I've read "Michael T. Goodrich's Data Structures and Algorithms in Java" book and often stumbled about method signatures like the following example taken from the tree section: public Position parent(Position v) To me the proposed API looks a bit weird. I don't understand why they make the Position class/objects availa... | Why is it strange to call parent() on objects that are not in the tree? You can do that with the second version too, i.e. you could call parent(E) on some E that's not in the tree. Generally, I think exposing the tree structure makes sense when what you are providing to the users is a tree. If you were for example crea... | Should nodes of trees and similar data structures be visible to the outside? I've read "Michael T. Goodrich's Data Structures and Algorithms in Java" book and often stumbled about method signatures like the following example taken from the tree section: public Position parent(Position v) To me the proposed API looks a ... | TITLE:
Should nodes of trees and similar data structures be visible to the outside?
QUESTION:
I've read "Michael T. Goodrich's Data Structures and Algorithms in Java" book and often stumbled about method signatures like the following example taken from the tree section: public Position parent(Position v) To me the pro... | [
"api",
"data-structures",
"tree"
] | 2 | 1 | 78 | 1 | 0 | 2011-06-03T18:01:02.937000 | 2011-06-03T23:32:36.790000 |
6,230,875 | 6,231,455 | How to handle choppy drawing as Views are being added to a layout? | I have 10 views that are being added to a LinearLayout with vertical orientation. This all occurs at runtime. However, each time the layout is redrawn, the user can see the choppy transition from a blank layout to one with all 10 views added. What's the recommended approach to reduce the choppiness? | My guess is that you must be using some custom View that does a lot of processing during onDraw(). Try doing all the processing you can in advance or in a separate thread. Also, using a ListView as inazaruk proposes will let you separate data generation from View rendering. If that is not the case, look in your code if... | How to handle choppy drawing as Views are being added to a layout? I have 10 views that are being added to a LinearLayout with vertical orientation. This all occurs at runtime. However, each time the layout is redrawn, the user can see the choppy transition from a blank layout to one with all 10 views added. What's the... | TITLE:
How to handle choppy drawing as Views are being added to a layout?
QUESTION:
I have 10 views that are being added to a LinearLayout with vertical orientation. This all occurs at runtime. However, each time the layout is redrawn, the user can see the choppy transition from a blank layout to one with all 10 views... | [
"android",
"android-layout"
] | 0 | 1 | 158 | 2 | 0 | 2011-06-03T18:01:24.193000 | 2011-06-03T18:57:34.633000 |
6,230,877 | 6,296,949 | Bring spell check window to foreground with JavaScript/JScript in Windows 7 | I have some JScript code (converted from some old VBScript) that starts like this: var Word = new ActiveXObject("Word.Basic");
Word.FileNew(); // opens new Word document Word.Insert(IncorrectText); Word.ToolsSpelling(); // opens spell check behind IE The idea is to utilize the MS Word spell check for browser use, and ... | You might be able to jigger the window state. When the window is maximized after having been minimized, Windows will stack that in front (zIndex to top). Something like: var WIN_MAX = 2; var WIN_MIN = 1;
var Word = new ActiveXObject("Word.Application"); Word.Visible = true; // minimize the app Word.WindowState = WIN_M... | Bring spell check window to foreground with JavaScript/JScript in Windows 7 I have some JScript code (converted from some old VBScript) that starts like this: var Word = new ActiveXObject("Word.Basic");
Word.FileNew(); // opens new Word document Word.Insert(IncorrectText); Word.ToolsSpelling(); // opens spell check be... | TITLE:
Bring spell check window to foreground with JavaScript/JScript in Windows 7
QUESTION:
I have some JScript code (converted from some old VBScript) that starts like this: var Word = new ActiveXObject("Word.Basic");
Word.FileNew(); // opens new Word document Word.Insert(IncorrectText); Word.ToolsSpelling(); // op... | [
"javascript",
"ms-word",
"activex",
"office-interop"
] | 2 | 2 | 3,204 | 1 | 0 | 2011-06-03T18:01:35.910000 | 2011-06-09T17:36:04.457000 |
6,230,878 | 6,231,734 | Some problems with Arduino protothreads | I'm doing a project about controlling two sensors (ultrasonic and infrared), managing them with Arduino. The IR receiver has a filter system inside, so it receives at the frequency of 36 kHz. I use the module srf04 to handle the ultrasonic stuff. If I do a program which has to control only one sensor, it works. But I h... | In irthread() the second argument to macro PT_WAIT_UNTIL always evaluates to true: PT_WAIT_UNTIL(pt, 1>0); Thus the program will be stuck in irthread()'s infinite loop, because part of the result of macro PT_WAIT_UNTIL in this case is something like if(!(1>0)) return 0;; the statement return 0 is never called. It works... | Some problems with Arduino protothreads I'm doing a project about controlling two sensors (ultrasonic and infrared), managing them with Arduino. The IR receiver has a filter system inside, so it receives at the frequency of 36 kHz. I use the module srf04 to handle the ultrasonic stuff. If I do a program which has to co... | TITLE:
Some problems with Arduino protothreads
QUESTION:
I'm doing a project about controlling two sensors (ultrasonic and infrared), managing them with Arduino. The IR receiver has a filter system inside, so it receives at the frequency of 36 kHz. I use the module srf04 to handle the ultrasonic stuff. If I do a progr... | [
"pthreads",
"arduino",
"sensors",
"infrared"
] | 9 | 9 | 8,606 | 3 | 0 | 2011-06-03T18:01:40.200000 | 2011-06-03T19:28:31.830000 |
6,230,883 | 6,234,022 | Helper Classes for DelayedJob in Rails | In order to start delayed_job's on a schedule you need to have helper classes with a perform method that delayed_job can call. These need to be defined before any of the classes that use them to create scheduled delayed_jobs are called. All very short, and many of them in my case. For example: class AccountUpdateJob < ... | I keep mine in lib/jobs, one file per class. So, your example would be in lib/jobs/account_update_job.rb module Jobs class AccountUpdateJob < Struct.new(:account_id) def perform acct = Account.find(account_id) acct.api_update end end end | Helper Classes for DelayedJob in Rails In order to start delayed_job's on a schedule you need to have helper classes with a perform method that delayed_job can call. These need to be defined before any of the classes that use them to create scheduled delayed_jobs are called. All very short, and many of them in my case.... | TITLE:
Helper Classes for DelayedJob in Rails
QUESTION:
In order to start delayed_job's on a schedule you need to have helper classes with a perform method that delayed_job can call. These need to be defined before any of the classes that use them to create scheduled delayed_jobs are called. All very short, and many o... | [
"ruby-on-rails",
"ruby-on-rails-3",
"delayed-job"
] | 1 | 0 | 456 | 1 | 0 | 2011-06-03T18:01:54.543000 | 2011-06-04T01:13:24.637000 |
6,230,893 | 6,231,268 | Developing C++ concurrency library with "futures" or similar paradigm | I'm working on a C++ project that needs to run many jobs in a threadpool. The jobs are failure-prone, which means that I need to know how each job terminated after it completes. Being a Java programmer for the most part, I like the idea of using "futures" or a similar paradigm, akin to the various classes in Java's uti... | Futures are both present in the upcoming standard (C++0x) and inside boost. Note that while the main name future is the same, you will need to read into the documentation to locate other types and to understand the semantics. I don't know Java futures, so I cannot tell you where they differ, if they do. The library in ... | Developing C++ concurrency library with "futures" or similar paradigm I'm working on a C++ project that needs to run many jobs in a threadpool. The jobs are failure-prone, which means that I need to know how each job terminated after it completes. Being a Java programmer for the most part, I like the idea of using "fut... | TITLE:
Developing C++ concurrency library with "futures" or similar paradigm
QUESTION:
I'm working on a C++ project that needs to run many jobs in a threadpool. The jobs are failure-prone, which means that I need to know how each job terminated after it completes. Being a Java programmer for the most part, I like the ... | [
"c++",
"multithreading",
"threadpool",
"future"
] | 3 | 5 | 2,423 | 3 | 0 | 2011-06-03T18:03:07.400000 | 2011-06-03T18:41:15.963000 |
6,230,901 | 6,236,699 | linker says _IsolationAwareLoadLibrary is undefined - any ideas? | I added some boost stuff* to my code and the linking phase failed with: error LNK2019: unresolved external symbol _IsolationAwareLoadLibraryA@4 referenced in function "void * __cdecl boost::interprocess::winapi::load_library(char const *)" (?load_library@winapi@interprocess@boost@@YAPAXPBD@Z) Can anyone help me figure ... | It turned out the project I used had a "ISOLATION_AWARE_ENABLED=1" added to preprocessor definitions. Removing it fixed the linker error. Not sure whether this won't cause any other problems though. The disturbing fact is that I'm wasting lots of time just resolving various issues related to building my project with th... | linker says _IsolationAwareLoadLibrary is undefined - any ideas? I added some boost stuff* to my code and the linking phase failed with: error LNK2019: unresolved external symbol _IsolationAwareLoadLibraryA@4 referenced in function "void * __cdecl boost::interprocess::winapi::load_library(char const *)" (?load_library@... | TITLE:
linker says _IsolationAwareLoadLibrary is undefined - any ideas?
QUESTION:
I added some boost stuff* to my code and the linking phase failed with: error LNK2019: unresolved external symbol _IsolationAwareLoadLibraryA@4 referenced in function "void * __cdecl boost::interprocess::winapi::load_library(char const *... | [
"c++",
"c",
"windows",
"visual-studio",
"linker"
] | 1 | 1 | 302 | 2 | 0 | 2011-06-03T18:03:39.810000 | 2011-06-04T12:17:34.653000 |
6,230,904 | 6,231,037 | What's the difference between rack app vs. rails app? | I uploaded my rails 2.3.8 app to DreamHost and got an error about rack version incompatibility. I issued a support ticket and the service guy recommended that I delete config.ru. That solved the problem. But I wonder what that would affect. Is it ok that a rails app goes without config.ru? | A Rack app is a web app written in Ruby that uses the Rack project. A really simple Hello World config.ru example is like so: class HelloWorld def call(env) [200, {'Content-Type' => 'text/plain'}, ['Hello World!']] end end
run HelloWorld.new Rails 2.3+ uses Rack as the basis for its HTTP handling, but some hosting pro... | What's the difference between rack app vs. rails app? I uploaded my rails 2.3.8 app to DreamHost and got an error about rack version incompatibility. I issued a support ticket and the service guy recommended that I delete config.ru. That solved the problem. But I wonder what that would affect. Is it ok that a rails app... | TITLE:
What's the difference between rack app vs. rails app?
QUESTION:
I uploaded my rails 2.3.8 app to DreamHost and got an error about rack version incompatibility. I issued a support ticket and the service guy recommended that I delete config.ru. That solved the problem. But I wonder what that would affect. Is it o... | [
"ruby-on-rails",
"rack"
] | 11 | 9 | 9,759 | 2 | 0 | 2011-06-03T18:03:47.973000 | 2011-06-03T18:16:25.287000 |
6,230,905 | 6,231,249 | cross browser alternative to Webkit /Html Notification | What are cross browser alternative to Webkit /Html Notification preferably in jquery/css. I basically want something that can popup from the bottom right of the page like the webkit notification | Here is a little demo that may give you some ideas... Demo: http://jsfiddle.net/wdm954/XEHZw/ Basically I'm using a fixed position div to create a small box that slides into view on the page triggered by some event (on click in this example). | cross browser alternative to Webkit /Html Notification What are cross browser alternative to Webkit /Html Notification preferably in jquery/css. I basically want something that can popup from the bottom right of the page like the webkit notification | TITLE:
cross browser alternative to Webkit /Html Notification
QUESTION:
What are cross browser alternative to Webkit /Html Notification preferably in jquery/css. I basically want something that can popup from the bottom right of the page like the webkit notification
ANSWER:
Here is a little demo that may give you som... | [
"javascript",
"jquery",
"css",
"html"
] | 1 | 1 | 1,108 | 2 | 0 | 2011-06-03T18:03:59.340000 | 2011-06-03T18:38:36.677000 |
6,230,919 | 6,231,042 | Not show label for an empty property with LabelFor? | I'm using MVC3 w/ Razor and I have a model that has quite a few properties that are sometimes empty. Other than a custom htmlHelper, or using an if/then in the view for every LabelFor/DisplayFor pair, is there a way to not display the LabelFor/DisplayFor for a property that is empty or null? | No.... You need the above mentioned solutions or additional view models. Sorry! | Not show label for an empty property with LabelFor? I'm using MVC3 w/ Razor and I have a model that has quite a few properties that are sometimes empty. Other than a custom htmlHelper, or using an if/then in the view for every LabelFor/DisplayFor pair, is there a way to not display the LabelFor/DisplayFor for a propert... | TITLE:
Not show label for an empty property with LabelFor?
QUESTION:
I'm using MVC3 w/ Razor and I have a model that has quite a few properties that are sometimes empty. Other than a custom htmlHelper, or using an if/then in the view for every LabelFor/DisplayFor pair, is there a way to not display the LabelFor/Displa... | [
"asp.net-mvc-3",
"razor"
] | 1 | 1 | 1,855 | 2 | 0 | 2011-06-03T18:05:16.567000 | 2011-06-03T18:16:57.077000 |
6,230,920 | 6,231,065 | Why does releasing a view controller cause a crash? | I always push a new view controller onto the stack like this: MyViewController *vc = [[MyViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
[vc release]; And all works well when it comes to popping it off the stack with: [self.navigationController popViewControllerAnimated:NO... | Your memory management looks fine. Perhaps you are mismanaging the memory of something inside of your vc. What does the dealloc method of MyViewController look like? My guess is you are using the incorrect init method (perhaps initWithNibName:bundle:) and you are releasing ivars in dealloc that were never properly init... | Why does releasing a view controller cause a crash? I always push a new view controller onto the stack like this: MyViewController *vc = [[MyViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
[vc release]; And all works well when it comes to popping it off the stack with: [se... | TITLE:
Why does releasing a view controller cause a crash?
QUESTION:
I always push a new view controller onto the stack like this: MyViewController *vc = [[MyViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
[vc release]; And all works well when it comes to popping it off t... | [
"iphone",
"uiviewcontroller",
"uinavigationcontroller",
"release",
"exc-bad-access"
] | 2 | 3 | 344 | 5 | 0 | 2011-06-03T18:05:23.113000 | 2011-06-03T18:19:24.443000 |
6,230,932 | 6,230,968 | Having trouble trying to learn MEF | I have been trying to teach myself MEF, starting with this tutorial: http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx There are some differences from the way MEF works now compared to the way it seems to work in this tutorial. One ... | You have to use [ImportMany] if you want to resolve multiple matching Exports. Note that, in a Plugin type of scenario, you'll probably want to use ExportMetadata and then decide which of the Plugins you actually want to instantiate. You would then do something like: [ImportMany] IEnumerable > _possiblePlugins; Now you... | Having trouble trying to learn MEF I have been trying to teach myself MEF, starting with this tutorial: http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx There are some differences from the way MEF works now compared to the way it s... | TITLE:
Having trouble trying to learn MEF
QUESTION:
I have been trying to teach myself MEF, starting with this tutorial: http://blogs.msdn.com/b/brada/archive/2008/09/29/simple-introduction-to-composite-applications-with-the-managed-extensions-framework.aspx There are some differences from the way MEF works now compar... | [
"c#",
".net",
"mef"
] | 4 | 3 | 921 | 1 | 0 | 2011-06-03T18:06:20.793000 | 2011-06-03T18:09:30.003000 |
6,230,937 | 6,231,447 | Dynamic JPA Entities in EJB Container | Within a GF EJB container, I am trying to dynamically discover my JPA entity classes using ServiceLoader and add them to the the JPA configuration prior to the container creating the EntityManagerFactory. The problem I am having is finding a way to "intercept" the PersistenceProvider configuration for a specific persis... | I'm not sure if this helps here, but consider to use an OSGi approach instead of plain ServiceLoader. http://weblogs.java.net/blog/2009/06/14/developing-hybrid-osgi-java-ee-applications-glassfish (I haven't studied this article fully yet, so I'm not sure if it's of any use here.) | Dynamic JPA Entities in EJB Container Within a GF EJB container, I am trying to dynamically discover my JPA entity classes using ServiceLoader and add them to the the JPA configuration prior to the container creating the EntityManagerFactory. The problem I am having is finding a way to "intercept" the PersistenceProvid... | TITLE:
Dynamic JPA Entities in EJB Container
QUESTION:
Within a GF EJB container, I am trying to dynamically discover my JPA entity classes using ServiceLoader and add them to the the JPA configuration prior to the container creating the EntityManagerFactory. The problem I am having is finding a way to "intercept" the... | [
"java",
"jpa",
"glassfish",
"ejb"
] | 0 | 0 | 616 | 1 | 0 | 2011-06-03T18:07:07.620000 | 2011-06-03T18:57:12.400000 |
6,230,942 | 6,230,960 | how can I check if the iOS device can vibrate | Currently only iPhone supports the vibrations how can I check if my device supports vibrations before calling the vibration function. | The iOS sdk has two functions that would vibrate the iPhone. But Vibration hardware is present only on iPhones. So how will you alert your user who uses the app on iPad or iPod touches? Clearly, checking the model is not the way to go. There are two seemingly similar functions that take a parameter kSystemSoundID_Vibra... | how can I check if the iOS device can vibrate Currently only iPhone supports the vibrations how can I check if my device supports vibrations before calling the vibration function. | TITLE:
how can I check if the iOS device can vibrate
QUESTION:
Currently only iPhone supports the vibrations how can I check if my device supports vibrations before calling the vibration function.
ANSWER:
The iOS sdk has two functions that would vibrate the iPhone. But Vibration hardware is present only on iPhones. S... | [
"iphone",
"ios",
"vibration"
] | 11 | 10 | 9,343 | 3 | 0 | 2011-06-03T18:07:28.010000 | 2011-06-03T18:08:57.493000 |
6,230,950 | 6,230,976 | linq insert: getting the row number | I have a table with the primary key as the identity column. I'm doing an insert with linq-to-sql and I was wondering if there's a way to return the ID of the row that was inserted and how we know for sure that the insert happened. Thanks for your suggestions. | The primary key property of the entity that was used for the insert will be updated after the call to SubmitChanges with the ID from the database. Ex: using (var dc = new MyDataContext()) { MyEntity entity = new MyEntity();
dc.MyEntities.InsertOnSubmit(entity); dc.SubmitChanges();
int pkValue = entity.PKColumn } | linq insert: getting the row number I have a table with the primary key as the identity column. I'm doing an insert with linq-to-sql and I was wondering if there's a way to return the ID of the row that was inserted and how we know for sure that the insert happened. Thanks for your suggestions. | TITLE:
linq insert: getting the row number
QUESTION:
I have a table with the primary key as the identity column. I'm doing an insert with linq-to-sql and I was wondering if there's a way to return the ID of the row that was inserted and how we know for sure that the insert happened. Thanks for your suggestions.
ANSWE... | [
"c#",
"linq",
"linq-to-sql"
] | 2 | 2 | 558 | 3 | 0 | 2011-06-03T18:08:16.573000 | 2011-06-03T18:10:21.533000 |
6,230,953 | 6,231,078 | getEntity call results in crash (using odata4j on a WCF service) | I am trying out odata4j in my android app to retrieve data from a DB that can be accessed from a WCF service. ODataConsumer co = ODataConsumer.create("http://xxx.xx.xx.xxx:xxxx/Users"); for(OEntity user: co.getEntities("Users").execute()) { // do stuff } However this crashes at the call to getEntities. I have tried a v... | I guess the call should be: ODataConsumer co = ODataConsumer.create("http://xxx.xx.xx.xxx:xxxx"); for(OEntity user: co.getEntities("Users").execute()) { // do stuff } create defines service you want to connect but Users is the resource you want to query. | getEntity call results in crash (using odata4j on a WCF service) I am trying out odata4j in my android app to retrieve data from a DB that can be accessed from a WCF service. ODataConsumer co = ODataConsumer.create("http://xxx.xx.xx.xxx:xxxx/Users"); for(OEntity user: co.getEntities("Users").execute()) { // do stuff } ... | TITLE:
getEntity call results in crash (using odata4j on a WCF service)
QUESTION:
I am trying out odata4j in my android app to retrieve data from a DB that can be accessed from a WCF service. ODataConsumer co = ODataConsumer.create("http://xxx.xx.xx.xxx:xxxx/Users"); for(OEntity user: co.getEntities("Users").execute()... | [
"android",
"wcf",
"odata",
"odata4j"
] | 0 | 0 | 1,196 | 3 | 0 | 2011-06-03T18:08:25.923000 | 2011-06-03T18:20:47.117000 |
6,230,954 | 6,231,189 | linker error using external FreeVerb C++ classes in iOS project | i'm trying to use the freeverb reverberation library in an audio synthesis project. i've added the source files to the Xcode project, but when i want to use a class from the library, i get a linker error: Undefined symbols for architecture i386: "fv3::nrevb_::nrevb_()", referenced from: -[FreeVerbModule.cxx_construct] ... | Are you experiencing a 32 vs. 64 bit issue as discussed here? | linker error using external FreeVerb C++ classes in iOS project i'm trying to use the freeverb reverberation library in an audio synthesis project. i've added the source files to the Xcode project, but when i want to use a class from the library, i get a linker error: Undefined symbols for architecture i386: "fv3::nrev... | TITLE:
linker error using external FreeVerb C++ classes in iOS project
QUESTION:
i'm trying to use the freeverb reverberation library in an audio synthesis project. i've added the source files to the Xcode project, but when i want to use a class from the library, i get a linker error: Undefined symbols for architectur... | [
"c++",
"ios",
"linker"
] | 0 | 0 | 375 | 1 | 0 | 2011-06-03T18:08:27.367000 | 2011-06-03T18:31:49.210000 |
6,230,964 | 6,230,996 | Waiting for $.post to finish | It appears that my script does not want to wait for the $.post call to finish. Thats a problem. Here is some pseudo code: What is the best way to make sure that my Post call is finished before continuing, without hanging the browser? Hoping for something that is not too messy.:) | Not too messy is using callbacks properly. Just create some function outside the.post() call and call it inside.post() when you think it is appropriate. You make many callbacks and use them inside the AJAX calls in a really flexible way. In your case, because you only call alert(), there is no need to create additional... | Waiting for $.post to finish It appears that my script does not want to wait for the $.post call to finish. Thats a problem. Here is some pseudo code: What is the best way to make sure that my Post call is finished before continuing, without hanging the browser? Hoping for something that is not too messy.:) | TITLE:
Waiting for $.post to finish
QUESTION:
It appears that my script does not want to wait for the $.post call to finish. Thats a problem. Here is some pseudo code: What is the best way to make sure that my Post call is finished before continuing, without hanging the browser? Hoping for something that is not too me... | [
"javascript",
"jquery",
"ajax",
"post"
] | 4 | 4 | 24,512 | 5 | 0 | 2011-06-03T18:09:19.710000 | 2011-06-03T18:12:35.630000 |
6,230,969 | 6,237,042 | SQLite to Postgres (Heroku) GROUP BY | The following SQLite code groups Messages by conversation_id: @messages=Message.where("messages.sender_id = (?) OR messages.recipient_id = (?)", current_user.id, current_user.id).group("messages.conversation_id") In moving over to Heroku, this code isn't recognized by Postgres. Looking at the logs, I'm told to add all ... | I arrived at a functional solution with the use of DISTINCT ON: @messages = Message.select("DISTINCT ON (messages.conversation_id) * ").where("messages.sender_id = (?) OR messages.recipient_id = (?)", current_user.id, current_user.id).group("messages.conversation_id, messages.updated_at, messages.id, messages.sender_id... | SQLite to Postgres (Heroku) GROUP BY The following SQLite code groups Messages by conversation_id: @messages=Message.where("messages.sender_id = (?) OR messages.recipient_id = (?)", current_user.id, current_user.id).group("messages.conversation_id") In moving over to Heroku, this code isn't recognized by Postgres. Look... | TITLE:
SQLite to Postgres (Heroku) GROUP BY
QUESTION:
The following SQLite code groups Messages by conversation_id: @messages=Message.where("messages.sender_id = (?) OR messages.recipient_id = (?)", current_user.id, current_user.id).group("messages.conversation_id") In moving over to Heroku, this code isn't recognized... | [
"sql",
"ruby-on-rails",
"ruby-on-rails-3",
"postgresql",
"heroku"
] | 3 | 3 | 2,496 | 2 | 0 | 2011-06-03T18:09:30.487000 | 2011-06-04T13:36:58.280000 |
6,230,987 | 6,231,389 | Easy Slider 1.7 - make entire slide clickable | I'm using the Easy Slider on my home page. My question is, how can I make each entire slide clickable? Currently only the h3 and p are clickable. Here is my code: Championship History Perhaps the most important aspect of Stanford's athletics program is that its success serves to validate the "scholar-athlete" approach ... | A hack way to do it could be to add onclick events. I have done this before with my own script ( http://magazine.missouristate.edu, the top area with the images), but I can't remember doing it with Easy Slider. | Easy Slider 1.7 - make entire slide clickable I'm using the Easy Slider on my home page. My question is, how can I make each entire slide clickable? Currently only the h3 and p are clickable. Here is my code: Championship History Perhaps the most important aspect of Stanford's athletics program is that its success serv... | TITLE:
Easy Slider 1.7 - make entire slide clickable
QUESTION:
I'm using the Easy Slider on my home page. My question is, how can I make each entire slide clickable? Currently only the h3 and p are clickable. Here is my code: Championship History Perhaps the most important aspect of Stanford's athletics program is tha... | [
"css",
"block",
"href"
] | 0 | 0 | 535 | 1 | 0 | 2011-06-03T18:11:43.447000 | 2011-06-03T18:50:51.473000 |
6,230,991 | 6,231,034 | How to arrange in alphabetical order using php | I have 2 plain text files that contain some words, like: File 1 Aarhus Abbott Abbott's Abel Abelian Abelson Abelson's Aberdeen Aberdeen's File 2 Acapulco Ackerman Acta Adam Adams Adamson This is just a sample list, the files contain more than 10000 entries and the words can be placed in any order. but one thing that ma... | $entries = array_merge( file('file_one', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES), file('file_two', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ); $entries = array_unique($entries); sort($entries); | How to arrange in alphabetical order using php I have 2 plain text files that contain some words, like: File 1 Aarhus Abbott Abbott's Abel Abelian Abelson Abelson's Aberdeen Aberdeen's File 2 Acapulco Ackerman Acta Adam Adams Adamson This is just a sample list, the files contain more than 10000 entries and the words ca... | TITLE:
How to arrange in alphabetical order using php
QUESTION:
I have 2 plain text files that contain some words, like: File 1 Aarhus Abbott Abbott's Abel Abelian Abelson Abelson's Aberdeen Aberdeen's File 2 Acapulco Ackerman Acta Adam Adams Adamson This is just a sample list, the files contain more than 10000 entrie... | [
"php",
"string",
"sorting"
] | 3 | 7 | 2,751 | 4 | 0 | 2011-06-03T18:12:01.253000 | 2011-06-03T18:15:57.547000 |
6,230,992 | 6,231,027 | Convert a function from many to single | I have a function from django-registration which re-sends an activation email to the given recipients. I am trying to convert the function from accepting multiple users for a given email to only one user per email. However, it is throwing an AttributeError when I try and change it. def resend_activation(self, email, si... | try: def resend_activation(self, email, site): sent = False # Get the user you are looking for try: single_user = User.objects.get(email=email) except User.DoesNotExist: return false
# Get all the profiles for that single user registration_profiles = self.all().filter(user=user) # Loop through, and send an email to ea... | Convert a function from many to single I have a function from django-registration which re-sends an activation email to the given recipients. I am trying to convert the function from accepting multiple users for a given email to only one user per email. However, it is throwing an AttributeError when I try and change it... | TITLE:
Convert a function from many to single
QUESTION:
I have a function from django-registration which re-sends an activation email to the given recipients. I am trying to convert the function from accepting multiple users for a given email to only one user per email. However, it is throwing an AttributeError when I... | [
"django",
"django-registration"
] | 1 | 4 | 35 | 1 | 0 | 2011-06-03T18:12:15.077000 | 2011-06-03T18:15:22.113000 |
6,230,997 | 6,231,107 | css float image doesn't seem to be working | I am currently working on two web sites. http://www.campusreader.org/#About if you click on someones picture the text lines up right next to the image. But over on this new web site I'm working on http://www.computationalhealth.org/, the float property is not working (click on the About tab and click on one of the tabs... | The contents of your CSS stylesheet:.centered { display: block; margin-left: auto; margin-right: auto } }.personPic{ float: left; /*margin:0 1em 1em 0;*/ } There's a formatting issue where the block of class 'centered' is closed twice. | css float image doesn't seem to be working I am currently working on two web sites. http://www.campusreader.org/#About if you click on someones picture the text lines up right next to the image. But over on this new web site I'm working on http://www.computationalhealth.org/, the float property is not working (click on... | TITLE:
css float image doesn't seem to be working
QUESTION:
I am currently working on two web sites. http://www.campusreader.org/#About if you click on someones picture the text lines up right next to the image. But over on this new web site I'm working on http://www.computationalhealth.org/, the float property is not... | [
"css",
"image",
"css-float"
] | 1 | 1 | 1,564 | 2 | 0 | 2011-06-03T18:12:37.833000 | 2011-06-03T18:23:12.747000 |
6,231,002 | 6,232,351 | jQTouch: How to embed YouTube video? | I am trying to embed a YouTube video into a page of a jQTouch mobile app. I tried using the "embed" code from YouTube and it worked on my desktop browser (Chrome), but not on my iPod Touch browser (Safari). I then tried using the HTML5 video tag, and still got nothing. How exactly can I embed a YouTube video into a jQT... | I have the following code block as part of a jqtouch app (running from the web), which launches the YouTube app as expected when tested on a mobile device: Page Heading Home | jQTouch: How to embed YouTube video? I am trying to embed a YouTube video into a page of a jQTouch mobile app. I tried using the "embed" code from YouTube and it worked on my desktop browser (Chrome), but not on my iPod Touch browser (Safari). I then tried using the HTML5 video tag, and still got nothing. How exactly ... | TITLE:
jQTouch: How to embed YouTube video?
QUESTION:
I am trying to embed a YouTube video into a page of a jQTouch mobile app. I tried using the "embed" code from YouTube and it worked on my desktop browser (Chrome), but not on my iPod Touch browser (Safari). I then tried using the HTML5 video tag, and still got not... | [
"html",
"jqtouch",
"html5-video"
] | 0 | 1 | 838 | 1 | 0 | 2011-06-03T18:13:33.233000 | 2011-06-03T20:31:15.030000 |
6,231,007 | 6,233,039 | IE7 appends but doesn't load <script> when injected | I have a JS that lives before closing tag that contains a method that injects another | Instead of adding your script element to the body element (which is not closed when you try to do that just before the closing tag), try to add your script to the head. Moreover, don't use setAttribute, but set properties of the new DOMElement directly: var script = document.createElement('script'); script.type = 'text... | IE7 appends but doesn't load <script> when injected I have a JS that lives before closing tag that contains a method that injects another | TITLE:
IE7 appends but doesn't load <script> when injected
QUESTION:
I have a JS that lives before closing tag that contains a method that injects another
ANSWER:
Instead of adding your script element to the body element (which is not closed when you try to do that just before the closing tag), try to add your script... | [
"javascript",
"html",
"internet-explorer-7"
] | 0 | 2 | 1,291 | 3 | 0 | 2011-06-03T18:13:59.623000 | 2011-06-03T21:52:54.947000 |
6,231,016 | 6,254,680 | radcontrols tooltip and radgrid | I am trying to replicate something like this demo http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultvb.aspx using the radtooltipmanager and the radgrid but i get an error that default2 is not defined here is my code Private Sub Page_Load(ByVal sender As Object, ByVal e As System.E... | Just looking over your code quickly I see that you are attempting to use Page.LoadControl() on a WebForms page, and not a user control. I recommend creating a user control (.ascx) replicating your WebForms page (.aspx) and attempt to load that instead. | radcontrols tooltip and radgrid I am trying to replicate something like this demo http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultvb.aspx using the radtooltipmanager and the radgrid but i get an error that default2 is not defined here is my code Private Sub Page_Load(ByVal sende... | TITLE:
radcontrols tooltip and radgrid
QUESTION:
I am trying to replicate something like this demo http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipversustooltipmanager/defaultvb.aspx using the radtooltipmanager and the radgrid but i get an error that default2 is not defined here is my code Private Sub Pag... | [
"vb.net",
"telerik",
"telerik-grid"
] | 0 | 0 | 812 | 1 | 0 | 2011-06-03T18:14:23.397000 | 2011-06-06T15:55:21.920000 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.