PostId
int64 13
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 3
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -33
210k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
5.77k
| Title
stringlengths 10
250
| BodyMarkdown
stringlengths 12
30k
| Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 47
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,117,066 | 06/20/2012 09:57:17 | 323,947 | 04/23/2010 06:42:50 | 53 | 1 | My own Java application which can be customized | I'm planning to implement a process using a java app. The process has various phases. Each phase has an input and output.
So it is something like input1=>phase1=>outpu1=>phase2=>output2=>phase3=>final_output
I want to write a java application in which the users can extend any phase to implement their own functionality.
for e.g: lets say that phase1 sorts the given input. I want to let my app users create custom class which will replace the functionality of phase1. they may want to do counting instead of sorting.
Any ideas on how to do this? plugin architecture? Any examples of frameworks which work in similar way? Where to start? | java | architecture | customization | extends | plugin-architecture | 06/21/2012 13:10:31 | not constructive | My own Java application which can be customized
===
I'm planning to implement a process using a java app. The process has various phases. Each phase has an input and output.
So it is something like input1=>phase1=>outpu1=>phase2=>output2=>phase3=>final_output
I want to write a java application in which the users can extend any phase to implement their own functionality.
for e.g: lets say that phase1 sorts the given input. I want to let my app users create custom class which will replace the functionality of phase1. they may want to do counting instead of sorting.
Any ideas on how to do this? plugin architecture? Any examples of frameworks which work in similar way? Where to start? | 4 |
6,891,261 | 07/31/2011 17:59:42 | 871,726 | 07/31/2011 16:44:58 | 1 | 0 | how does Abstract Factory design pattern is useful ? doesn't it just a polymorphism and nothing else ? | how does Abstract Factory is useful ? doesn't it just a polymorphism and nothing else ?
I have read all the design patterns and everywhere things looks similar. most of them are type of polymorphism's different flavors.
| c# | null | null | null | null | 08/01/2011 03:06:29 | not constructive | how does Abstract Factory design pattern is useful ? doesn't it just a polymorphism and nothing else ?
===
how does Abstract Factory is useful ? doesn't it just a polymorphism and nothing else ?
I have read all the design patterns and everywhere things looks similar. most of them are type of polymorphism's different flavors.
| 4 |
11,389,912 | 07/09/2012 06:19:51 | 1,140,983 | 01/10/2012 13:50:40 | 86 | 6 | How to let the maximum number of concurrent connections be one for IE8 | Currently I can set the values of FEATURE_MAXCONNECTIONSPERSERVER and FEATURE_MAXCONNECTIONSPER1_0SERVER in registry of Windows for IE8 to determine the maximum number of concurrent connections following the [link][1]
[1]: http://msdn.microsoft.com/en-us/library/cc304129%28VS.85%29.aspx
It works when I set the values which are more than or equal to 2. But when I set the values to 1, there are still probably 2 concurrent connections. Is it possible for me to make it only one connection at the same time for IE8?
Thanks so much!
| windows | internet-explorer | registry | null | null | null | open | How to let the maximum number of concurrent connections be one for IE8
===
Currently I can set the values of FEATURE_MAXCONNECTIONSPERSERVER and FEATURE_MAXCONNECTIONSPER1_0SERVER in registry of Windows for IE8 to determine the maximum number of concurrent connections following the [link][1]
[1]: http://msdn.microsoft.com/en-us/library/cc304129%28VS.85%29.aspx
It works when I set the values which are more than or equal to 2. But when I set the values to 1, there are still probably 2 concurrent connections. Is it possible for me to make it only one connection at the same time for IE8?
Thanks so much!
| 0 |
9,221,019 | 02/10/2012 00:21:15 | 215,831 | 11/20/2009 21:59:50 | 20 | 2 | Combining JSP servlets and Javascript | I have been working with ASP.NET for a few years and am now working on a project using JSP, Struts, and Java so I am fairly new to this.
I have a for-loop in a Javascript funtion that looks something like this:
<% int count=0; %>
for(i = 0; i < arrayCount; i++){
jsArray[i] = <%= myBeanArrayList.get(count) %>;
alert("i = " + i + "count = " + count);
<% count++; %>
}
The count variable doesn't increment even if I use <% count = count + 1 %>. I don't understand why that peice of code doesn't do as I want inside the loop. Does anyone have any suggestions on how I can increment the count for the JSP Bean?
| java | javascript | jsp | null | null | null | open | Combining JSP servlets and Javascript
===
I have been working with ASP.NET for a few years and am now working on a project using JSP, Struts, and Java so I am fairly new to this.
I have a for-loop in a Javascript funtion that looks something like this:
<% int count=0; %>
for(i = 0; i < arrayCount; i++){
jsArray[i] = <%= myBeanArrayList.get(count) %>;
alert("i = " + i + "count = " + count);
<% count++; %>
}
The count variable doesn't increment even if I use <% count = count + 1 %>. I don't understand why that peice of code doesn't do as I want inside the loop. Does anyone have any suggestions on how I can increment the count for the JSP Bean?
| 0 |
4,607,028 | 01/05/2011 17:18:56 | 135,769 | 07/09/2009 16:22:14 | 6,634 | 379 | T4 Templates and connection strings in a class library | I'm using the template [posted in this thread][1] to generate C# enums from a couple of lookup tables in SQL Server within a class library that contains my DAL.
At the moment, I have the connection string used by the templates embedded an a template include file in the class library. Is there a convenient way to have the template grab the connection string from the main project (WAP)'s web.config without having to include a physical path? Or is there a better way to approach this?
**Edit**
I've also considered creating a SQL CLR assembly which returns a table-valued function containing the enum contents (which would then be defined in C#, not in the database), but I'm not sure what the performance hit would be. Whether or not it's significant will obviously be application-dependent but I'd hate to charge down a crappy path if it's a know best-avoid-this approach.
[1]: http://stackoverflow.com/questions/4395000/t4-template-to-generate-enums/4480173#4480173 | asp.net | sql-server-2008 | t4-templates | null | null | null | open | T4 Templates and connection strings in a class library
===
I'm using the template [posted in this thread][1] to generate C# enums from a couple of lookup tables in SQL Server within a class library that contains my DAL.
At the moment, I have the connection string used by the templates embedded an a template include file in the class library. Is there a convenient way to have the template grab the connection string from the main project (WAP)'s web.config without having to include a physical path? Or is there a better way to approach this?
**Edit**
I've also considered creating a SQL CLR assembly which returns a table-valued function containing the enum contents (which would then be defined in C#, not in the database), but I'm not sure what the performance hit would be. Whether or not it's significant will obviously be application-dependent but I'd hate to charge down a crappy path if it's a know best-avoid-this approach.
[1]: http://stackoverflow.com/questions/4395000/t4-template-to-generate-enums/4480173#4480173 | 0 |
10,969,645 | 06/10/2012 14:48:10 | 1,291,341 | 03/25/2012 14:07:13 | 11 | 0 | Can anybody help me on quantile-quantile script (q-q plot)? | How to plot quantile-quantile plot from the scratch? I am not sure if each point is calculated using ratio of the points from two series at the same given quantile. But why sometimes, I can see there is negative percentile(e.g. norm distribution). Could anybody help write a script generating q-q plot raw data? (input is two column data)
Thanks,
Jeff | matplotlib | ggplot2 | gnuplot | quantile | cdf | 06/11/2012 23:54:25 | not a real question | Can anybody help me on quantile-quantile script (q-q plot)?
===
How to plot quantile-quantile plot from the scratch? I am not sure if each point is calculated using ratio of the points from two series at the same given quantile. But why sometimes, I can see there is negative percentile(e.g. norm distribution). Could anybody help write a script generating q-q plot raw data? (input is two column data)
Thanks,
Jeff | 1 |
8,947,509 | 01/20/2012 20:31:20 | 645,035 | 03/04/2011 15:52:30 | 1 | 0 | Apache running as reverse proxy using proxy balancer traffic does not seem to get distributed evenly | we have Apache running as reverse proxy using proxy balancer
we run a jMeter load test from 7 Cloud machines
but the traffic does not seem to get distributed evenly
I'm thinking it's an Apache config issue, but not sure what
This is drive insane, any help pls?
tks | apache | cloud | reverse-proxy | null | null | 01/21/2012 21:24:15 | off topic | Apache running as reverse proxy using proxy balancer traffic does not seem to get distributed evenly
===
we have Apache running as reverse proxy using proxy balancer
we run a jMeter load test from 7 Cloud machines
but the traffic does not seem to get distributed evenly
I'm thinking it's an Apache config issue, but not sure what
This is drive insane, any help pls?
tks | 2 |
3,772,173 | 09/22/2010 17:53:28 | 455,369 | 08/20/2010 21:05:04 | 1 | 0 | How do I introduce a float value in this Java code? | import java.io.*;
public class CheckbookBalancingCalculator
{
public static void main(String[] args) throws IOException
{
String statementbalance, depositstotal, checkstotal, feestotal;
int statement, deposits, checks, fees, index;
BufferedReader dataIn= new BufferedReader(new InputStreamReader(System.in));
System.out.println("\tBalancing Your Checkbook:");
System.out.println();
System.out.print("\t\tWhat is the balance from your last statement?");
statementbalance = dataIn.readLine();
statement = Integer.parseInt(statementbalance);
System.out.print("\t\tWhat is the total amount of all deposits?");
depositstotal = dataIn.readLine();
deposits = Integer.parseInt(depositstotal);
System.out.print("\t\tWhat is the total amount of all checks?");
checkstotal = dataIn.readLine();
checks = Integer.parseInt(checkstotal);
System.out.print("\t\tWhat is the total amount of all transaction fees?");
feestotal = dataIn.readLine();
fees = Integer.parseInt(feestotal);
index = statement + deposits - checks - fees;
System.out.println();
System.out.println("\tYour new balance is " + Math.round(index) + ".");
System.out.println();
}
} | java | null | null | null | null | 09/22/2010 18:05:08 | not a real question | How do I introduce a float value in this Java code?
===
import java.io.*;
public class CheckbookBalancingCalculator
{
public static void main(String[] args) throws IOException
{
String statementbalance, depositstotal, checkstotal, feestotal;
int statement, deposits, checks, fees, index;
BufferedReader dataIn= new BufferedReader(new InputStreamReader(System.in));
System.out.println("\tBalancing Your Checkbook:");
System.out.println();
System.out.print("\t\tWhat is the balance from your last statement?");
statementbalance = dataIn.readLine();
statement = Integer.parseInt(statementbalance);
System.out.print("\t\tWhat is the total amount of all deposits?");
depositstotal = dataIn.readLine();
deposits = Integer.parseInt(depositstotal);
System.out.print("\t\tWhat is the total amount of all checks?");
checkstotal = dataIn.readLine();
checks = Integer.parseInt(checkstotal);
System.out.print("\t\tWhat is the total amount of all transaction fees?");
feestotal = dataIn.readLine();
fees = Integer.parseInt(feestotal);
index = statement + deposits - checks - fees;
System.out.println();
System.out.println("\tYour new balance is " + Math.round(index) + ".");
System.out.println();
}
} | 1 |
10,987,100 | 06/11/2012 20:30:00 | 1,289,315 | 03/23/2012 23:16:00 | 14 | 1 | Stylesheet Error - Ruby on Rails Newbie | I am currently learning ruby on rails through "Agile Web Development With Rails," and I have run into an error I cannot fix. So far, I have only done some basic operations. I created a scaffold with a command similar to this:
rails generate scaffold Product title:string description:text image_url:string price:decimal
I then raked that:
rake db:migrate
Once that was run, I went into the db/seeds.db file and filled this newly created table with this data:
Product.delete_all
Product.create(:title => 'Web Design for Developers',
:description =>
%{<p>
<em>Web Design for Developers</em> will show you how to make your
web-based application look professionally designed. We'll help you
learn how to pick the right colors and fonts, avoid costly interface
and accessibility mistakes -- your application will really come alive.
We'll also walk you through some common Photoshop and CSS techniques
and work through a web site redesign, taking a new design from concept
all the way to implementation.
</p>},
:image_url => '/images/rails.png',
:price => 42.95)
# . . .
Product.create(:title => 'Programming Ruby 1.9',
:description =>
%{<p>
Ruby is the fastest growing and most exciting dynamic language
out there. If you need to get working programs delivered fast,
you should add Ruby to your toolbox.
</p>},
:image_url => '/images/rails.png',
:price => 49.50)
# . . .
Product.create(:title => 'Rails Test Prescriptions',
:description =>
%{<p>
<em>Rails Test Prescriptions</em> is a comprehensive guide to testing
Rails applications, covering Test-Driven Development from both a
theoretical perspective (why to test) and from a practical perspective
(how to test effectively). It covers the core Rails testing tools and
procedures for Rails 2 and Rails 3, and introduces popular add-ons,
including Cucumber, Shoulda, Machinist, Mocha, and Rcov.
</p>},
:image_url => '/images/rails.png',
:price => 43.75)
Once again, I raked this data:
rake db:seed
After this was all complete, I loaded up localhost:3000/products and everything was working fine. However, the book wanted to add some css code to make things look a bit better. Once I added the CSS (exactly as the book had it), I got an error when I loaded localhost:3000/products (error: http://postimage.org/image/3qfpta4w7/). I assume my error has something to do with my css, but I do not know what to do. Here is my css:
.products {
table {
border-collapse: collapse;
}
table tr td {
padding: 5px;
vertical-align: top;
}
.list_image {
width: 60px;
height: 70px;
}
.list_description {
width: 60%;
dl {
margin: 0;
}
dt {
color: #244;
font-weight: bold;
font-size: larger;
}
dd {
margin: 0;
}
}
.list_actions {
font-size: x-small;
text-align: right;
padding-left: 1em;
}
.list_line_even {
background: #e0f8f8;
}
.list_line_odd {
background: #f8b0f8;
}
}
I have tried changing several things, but now success has followed. Any and all input on this would be appreciated. (P.S. bonus points for naming your favorite rails book to learn from).
| ruby-on-rails | ruby-on-rails-3 | ruby-on-rails-3.1 | null | null | null | open | Stylesheet Error - Ruby on Rails Newbie
===
I am currently learning ruby on rails through "Agile Web Development With Rails," and I have run into an error I cannot fix. So far, I have only done some basic operations. I created a scaffold with a command similar to this:
rails generate scaffold Product title:string description:text image_url:string price:decimal
I then raked that:
rake db:migrate
Once that was run, I went into the db/seeds.db file and filled this newly created table with this data:
Product.delete_all
Product.create(:title => 'Web Design for Developers',
:description =>
%{<p>
<em>Web Design for Developers</em> will show you how to make your
web-based application look professionally designed. We'll help you
learn how to pick the right colors and fonts, avoid costly interface
and accessibility mistakes -- your application will really come alive.
We'll also walk you through some common Photoshop and CSS techniques
and work through a web site redesign, taking a new design from concept
all the way to implementation.
</p>},
:image_url => '/images/rails.png',
:price => 42.95)
# . . .
Product.create(:title => 'Programming Ruby 1.9',
:description =>
%{<p>
Ruby is the fastest growing and most exciting dynamic language
out there. If you need to get working programs delivered fast,
you should add Ruby to your toolbox.
</p>},
:image_url => '/images/rails.png',
:price => 49.50)
# . . .
Product.create(:title => 'Rails Test Prescriptions',
:description =>
%{<p>
<em>Rails Test Prescriptions</em> is a comprehensive guide to testing
Rails applications, covering Test-Driven Development from both a
theoretical perspective (why to test) and from a practical perspective
(how to test effectively). It covers the core Rails testing tools and
procedures for Rails 2 and Rails 3, and introduces popular add-ons,
including Cucumber, Shoulda, Machinist, Mocha, and Rcov.
</p>},
:image_url => '/images/rails.png',
:price => 43.75)
Once again, I raked this data:
rake db:seed
After this was all complete, I loaded up localhost:3000/products and everything was working fine. However, the book wanted to add some css code to make things look a bit better. Once I added the CSS (exactly as the book had it), I got an error when I loaded localhost:3000/products (error: http://postimage.org/image/3qfpta4w7/). I assume my error has something to do with my css, but I do not know what to do. Here is my css:
.products {
table {
border-collapse: collapse;
}
table tr td {
padding: 5px;
vertical-align: top;
}
.list_image {
width: 60px;
height: 70px;
}
.list_description {
width: 60%;
dl {
margin: 0;
}
dt {
color: #244;
font-weight: bold;
font-size: larger;
}
dd {
margin: 0;
}
}
.list_actions {
font-size: x-small;
text-align: right;
padding-left: 1em;
}
.list_line_even {
background: #e0f8f8;
}
.list_line_odd {
background: #f8b0f8;
}
}
I have tried changing several things, but now success has followed. Any and all input on this would be appreciated. (P.S. bonus points for naming your favorite rails book to learn from).
| 0 |
10,115,370 | 04/11/2012 23:27:01 | 1,327,604 | 04/11/2012 20:51:29 | 1 | 0 | PHP MySQL filtering results | I'm currently building a script for a radio station and need help with the following script:
$yesterday = strtotime('yesterday');
$yesterdow = date('l',$yesterday);
$order = "SELECT * FROM timetable WHERE day = '$yesterdow' ORDER BY time";
$result = mysql_query($order);
What that's suppose to do is return the previous day's timetable from 00:00 to 23:00. However at the moment it's only returning it from 01:00 to 23:00. Is there any way I could make the 00:00 get be included? | php | mysql | sql | null | null | null | open | PHP MySQL filtering results
===
I'm currently building a script for a radio station and need help with the following script:
$yesterday = strtotime('yesterday');
$yesterdow = date('l',$yesterday);
$order = "SELECT * FROM timetable WHERE day = '$yesterdow' ORDER BY time";
$result = mysql_query($order);
What that's suppose to do is return the previous day's timetable from 00:00 to 23:00. However at the moment it's only returning it from 01:00 to 23:00. Is there any way I could make the 00:00 get be included? | 0 |
8,784,024 | 01/09/2012 04:44:00 | 1,060,888 | 11/23/2011 00:19:16 | 14 | 0 | OpenGl - texture glutSolidSphere? | I'm trying to do a simple thing in OpenGL to texture an annoying sphere but when i include this line of code it gets confused like a phat kid dating a super model
#include "imageloader.h"
It basically says that it can not "(open source file "imageloader.h")"
i dont get it why.. is this opengl such a headache | c++ | opengl | 3d | texture | glut | 01/09/2012 15:00:06 | too localized | OpenGl - texture glutSolidSphere?
===
I'm trying to do a simple thing in OpenGL to texture an annoying sphere but when i include this line of code it gets confused like a phat kid dating a super model
#include "imageloader.h"
It basically says that it can not "(open source file "imageloader.h")"
i dont get it why.. is this opengl such a headache | 3 |
10,870,792 | 06/03/2012 13:33:41 | 1,298,196 | 03/28/2012 12:45:03 | 80 | 1 | This source was included by my_file.dart via a #source directive, so cannot itself contain directives | I don't think I understand this error message. Does it mean that my_file.dart was already sourced by another file e.g. my_main.dart contains:
#source('my_file.dart');
and so my_file.dart can't source other files? e.g in my_file.dart.
#source('my_other_file.dart'); // this can't be here?
class MyClass {
Collection<MyOtherClass> myVariables;
}
The thing is, I have to source my_other_file.dart in my_file.dart because it gives errors about "no such type" for classes in my_other_file.dart if I don't. But when I do, I get that title error, "This source was included by my_file.dart via a #source directive, so cannot itself contain directives".
Have I completely misinterpreted this message? How do I make these errors stop? | dart | null | null | null | null | null | open | This source was included by my_file.dart via a #source directive, so cannot itself contain directives
===
I don't think I understand this error message. Does it mean that my_file.dart was already sourced by another file e.g. my_main.dart contains:
#source('my_file.dart');
and so my_file.dart can't source other files? e.g in my_file.dart.
#source('my_other_file.dart'); // this can't be here?
class MyClass {
Collection<MyOtherClass> myVariables;
}
The thing is, I have to source my_other_file.dart in my_file.dart because it gives errors about "no such type" for classes in my_other_file.dart if I don't. But when I do, I get that title error, "This source was included by my_file.dart via a #source directive, so cannot itself contain directives".
Have I completely misinterpreted this message? How do I make these errors stop? | 0 |
2,243,978 | 02/11/2010 11:06:31 | 269,317 | 02/09/2010 08:20:32 | 22 | 0 | remove class from all other list items | I've gotten help from others on this, but their replies were a little bit too broad to help me... I'm a newb when it comes to javascript so I can't quite wrap my head around their answers (and everything I've tried in the last 3 days hasn't worked.) The working site is here: http://www.studioimbrue.com/beta The problem is that with the thumbnails, once clicking them it adds the .selected class properly but when clicking on another, it fails to strip the .selected class from any of the other thumbnails. If you can just correct the code I have that would be amazing, and if you feel like explaining what I had wrong, go right ahead!
$(document).ready(function(){
var activeOpacity = 1.0,
inactiveOpacity = 0.6,
fadeTime = 100,
clickedClass = "selected",
thumbs = "#list li";
$(thumbs).fadeTo(1, inactiveOpacity);
$(thumbs).hover(
function(){
$(this).fadeTo(fadeTime, activeOpacity);
},
function(){
// Only fade out if the user hasn't clicked the thumb
if(!$(this).hasClass(clickedClass)) {
$(this).fadeTo(fadeTime, inactiveOpacity);
}
});
$(thumbs).click(function() {
// Remove selected class from any elements other than this
var previous = $(thumbs+'.'+clickedClass).eq();
var clicked = $(this);
if(clicked !== previous) {
previous.removeClass(clickedClass);
}
clicked.addClass(clickedClass).fadeTo(fadeTime, activeOpacity);
});
}); | javascript | jquery | null | null | null | null | open | remove class from all other list items
===
I've gotten help from others on this, but their replies were a little bit too broad to help me... I'm a newb when it comes to javascript so I can't quite wrap my head around their answers (and everything I've tried in the last 3 days hasn't worked.) The working site is here: http://www.studioimbrue.com/beta The problem is that with the thumbnails, once clicking them it adds the .selected class properly but when clicking on another, it fails to strip the .selected class from any of the other thumbnails. If you can just correct the code I have that would be amazing, and if you feel like explaining what I had wrong, go right ahead!
$(document).ready(function(){
var activeOpacity = 1.0,
inactiveOpacity = 0.6,
fadeTime = 100,
clickedClass = "selected",
thumbs = "#list li";
$(thumbs).fadeTo(1, inactiveOpacity);
$(thumbs).hover(
function(){
$(this).fadeTo(fadeTime, activeOpacity);
},
function(){
// Only fade out if the user hasn't clicked the thumb
if(!$(this).hasClass(clickedClass)) {
$(this).fadeTo(fadeTime, inactiveOpacity);
}
});
$(thumbs).click(function() {
// Remove selected class from any elements other than this
var previous = $(thumbs+'.'+clickedClass).eq();
var clicked = $(this);
if(clicked !== previous) {
previous.removeClass(clickedClass);
}
clicked.addClass(clickedClass).fadeTo(fadeTime, activeOpacity);
});
}); | 0 |
10,802,008 | 05/29/2012 15:17:59 | 1,268,630 | 03/14/2012 09:42:10 | 6 | 1 | image tooltip component | I'm following this little tutorial about how to put an image on a Tooltip.
http://flexscript.wordpress.com/2008/08/18/flex-image-tooltip-component/
I have followed exactly this example, but I have a runtime error :
> ReferenceError: Error #1069: Property bitmapData not found on SWFLoaderStyleembed_css_Assets_swf__brokenImage_1882983457 and there is no default value.
at be.rtbf.radio.cockpit.commons.view::ExtendedToolTip/set imageTip()[C:\projets\cockpitRadio\trunk\flex\trunk\cockpit-commons-flex\src\main\flex\be\rtbf\radio\cockpit\commons\view\ExtendedToolTip.as:25]
at be.rtbf.radio.cockpit.onAir.module.view::RadioOnAir/createToolTip()[
> Blockquote
Here is the code in **ExtendedToolTip.as**:
public class **ExtendedToolTip** extends VBox implements IToolTip {
private static var MAX_WIDTH:Number = 500;
private static var MAX_HEIGHT:Number = 500;
private var image:Bitmap = new Bitmap();
private var lbl:Label;
private var imageHolder:Image;
private var _tipText:String;
public function set imageTip(img:*) : void {
image.bitmapData
if (img is Class) {
imageHolder.source = new img().bitmapData;
}
if (img as String) {
imageHolder.load(img);
}
}
The method call :
private function createToolTip(tip:String) : ExtendedToolTip {
var imageToolTip:ExtendedToolTip = new ExtendedToolTip();
imageToolTip.imageTip = this.visual.source;
imageToolTip.tipText = tip;
return imageToolTip;
}`enter code here`
Any suggestion please to avoid this runtime error? | image | flex | tooltip | null | null | null | open | image tooltip component
===
I'm following this little tutorial about how to put an image on a Tooltip.
http://flexscript.wordpress.com/2008/08/18/flex-image-tooltip-component/
I have followed exactly this example, but I have a runtime error :
> ReferenceError: Error #1069: Property bitmapData not found on SWFLoaderStyleembed_css_Assets_swf__brokenImage_1882983457 and there is no default value.
at be.rtbf.radio.cockpit.commons.view::ExtendedToolTip/set imageTip()[C:\projets\cockpitRadio\trunk\flex\trunk\cockpit-commons-flex\src\main\flex\be\rtbf\radio\cockpit\commons\view\ExtendedToolTip.as:25]
at be.rtbf.radio.cockpit.onAir.module.view::RadioOnAir/createToolTip()[
> Blockquote
Here is the code in **ExtendedToolTip.as**:
public class **ExtendedToolTip** extends VBox implements IToolTip {
private static var MAX_WIDTH:Number = 500;
private static var MAX_HEIGHT:Number = 500;
private var image:Bitmap = new Bitmap();
private var lbl:Label;
private var imageHolder:Image;
private var _tipText:String;
public function set imageTip(img:*) : void {
image.bitmapData
if (img is Class) {
imageHolder.source = new img().bitmapData;
}
if (img as String) {
imageHolder.load(img);
}
}
The method call :
private function createToolTip(tip:String) : ExtendedToolTip {
var imageToolTip:ExtendedToolTip = new ExtendedToolTip();
imageToolTip.imageTip = this.visual.source;
imageToolTip.tipText = tip;
return imageToolTip;
}`enter code here`
Any suggestion please to avoid this runtime error? | 0 |
10,419,772 | 05/02/2012 18:42:13 | 1,173,674 | 01/27/2012 14:26:32 | 11 | 0 | Software for drawing graph algorithms | I'd like some tips on software (Windows or Linux) to draw graphs for teaching algorithms. Ideally, it should have support for several frames of similar drawings with little variation between them and, most importantly, changes could be propagated to all frames.
I currently use yEd to draw graphs, but copy/paste between different images has several issues, for instance, if I change the color of a node after having created several copies, I have to change it in each image separately.
I once used (for a very brief time) Macromedia Flash and I believe it would be quite nice to try with it, but it costs simply too much and is overkill.
DOT is quite nice but I couldn't find a graphical interface with quick feedback to ease the task. It wouldn't bother me if the tool required some programming, but the text-to-image conversion should be almost real-time.
Last time I tried Dia and Visio both didn't seem to have what I want, but maybe I missed it...
Thanks! | algorithm | graph | drawing | null | null | null | open | Software for drawing graph algorithms
===
I'd like some tips on software (Windows or Linux) to draw graphs for teaching algorithms. Ideally, it should have support for several frames of similar drawings with little variation between them and, most importantly, changes could be propagated to all frames.
I currently use yEd to draw graphs, but copy/paste between different images has several issues, for instance, if I change the color of a node after having created several copies, I have to change it in each image separately.
I once used (for a very brief time) Macromedia Flash and I believe it would be quite nice to try with it, but it costs simply too much and is overkill.
DOT is quite nice but I couldn't find a graphical interface with quick feedback to ease the task. It wouldn't bother me if the tool required some programming, but the text-to-image conversion should be almost real-time.
Last time I tried Dia and Visio both didn't seem to have what I want, but maybe I missed it...
Thanks! | 0 |
9,323,401 | 02/17/2012 05:32:48 | 765,368 | 05/23/2011 03:01:51 | 181 | 0 | View full text length iPhone | just a simple question about the iPhone, you know sometimes when a text is too long, only part of it is displayed followed by three dots. How do I view the full text when that happens? That happens especially in the App Store for example when the name of an app is too long.
Thanks | iphone | ios | ios5 | null | null | 02/17/2012 06:21:04 | off topic | View full text length iPhone
===
just a simple question about the iPhone, you know sometimes when a text is too long, only part of it is displayed followed by three dots. How do I view the full text when that happens? That happens especially in the App Store for example when the name of an app is too long.
Thanks | 2 |
406,016 | 01/02/2009 04:27:30 | 708 | 08/08/2008 06:10:02 | 1,343 | 27 | UI Terminology: Logon vs Login | I am crafting an application and cannot decide whether to use the terms **Login/out** or **Logon/off**. Is there a *more correct* option between these two? Should I use something else entirely (like "Sign on/off").
In terms of usability, as long as I am consistent it probably doesn't matter which terms I choose, but I did wonder about the origins of the terms - and whether one or another makes more grammatical sense. I also care deeply about the application I am creating, and want to take the time to investigate all aspects of its user experience. | user-interface | language | null | null | null | 07/16/2012 18:08:18 | off topic | UI Terminology: Logon vs Login
===
I am crafting an application and cannot decide whether to use the terms **Login/out** or **Logon/off**. Is there a *more correct* option between these two? Should I use something else entirely (like "Sign on/off").
In terms of usability, as long as I am consistent it probably doesn't matter which terms I choose, but I did wonder about the origins of the terms - and whether one or another makes more grammatical sense. I also care deeply about the application I am creating, and want to take the time to investigate all aspects of its user experience. | 2 |
11,383,159 | 07/08/2012 12:29:57 | 898,454 | 08/17/2011 10:38:02 | 54 | 0 | mysql slave / master error | My slave based on mysql , stopped suddnely and showing this error msg
Last_Error: Query caused different errors on master and slave. Error on master: message (format)='Table '%-.192s.%-.192s' doesn't exist' error code=1146 ; Error on slave: actual message='no error', error code=0. Default database: 'mysql'. Query: 'FLUSH PRIVILEGES'
Server version: 5.5.21-cll MySQL Community Server (GPL) by Atomicorp Master
Server version: 5.5.21-cll MySQL Community Server (GPL) by Atomicorp Slave
was trying some ways to fix but no luck
Any advise ? | mysql | null | null | null | null | 07/09/2012 01:45:04 | off topic | mysql slave / master error
===
My slave based on mysql , stopped suddnely and showing this error msg
Last_Error: Query caused different errors on master and slave. Error on master: message (format)='Table '%-.192s.%-.192s' doesn't exist' error code=1146 ; Error on slave: actual message='no error', error code=0. Default database: 'mysql'. Query: 'FLUSH PRIVILEGES'
Server version: 5.5.21-cll MySQL Community Server (GPL) by Atomicorp Master
Server version: 5.5.21-cll MySQL Community Server (GPL) by Atomicorp Slave
was trying some ways to fix but no luck
Any advise ? | 2 |
11,483,782 | 07/14/2012 12:34:15 | 1,525,545 | 07/14/2012 12:23:10 | 1 | 0 | all method of gem module: devise shows undefined method | I installed gem module: device for user authentification.
It is working well for login/logout.
But when I add any method of devise in Controller and View, all response is "undefined method"
- e.g1 undefined method `user_signed_in?' for
#<#<Class:0x0000001de39938>:0x0000001dddecb8>
- e.g2 undefined method `authenticate_user!' for#<KpiReportsController:0x0000001fb52c40>
Anyone encounter the same problems? Could you let me know any solutions for it?
I'm using
Rails 3.1.1
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
devise (2.1.2)
Thanks
--Katsuya | ruby-on-rails | devise | null | null | null | 07/16/2012 01:59:57 | not a real question | all method of gem module: devise shows undefined method
===
I installed gem module: device for user authentification.
It is working well for login/logout.
But when I add any method of devise in Controller and View, all response is "undefined method"
- e.g1 undefined method `user_signed_in?' for
#<#<Class:0x0000001de39938>:0x0000001dddecb8>
- e.g2 undefined method `authenticate_user!' for#<KpiReportsController:0x0000001fb52c40>
Anyone encounter the same problems? Could you let me know any solutions for it?
I'm using
Rails 3.1.1
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]
devise (2.1.2)
Thanks
--Katsuya | 1 |
763,989 | 04/18/2009 19:16:51 | 90,777 | 04/14/2009 18:28:04 | 30 | 11 | Mount LVM overlays/snapshots? | I'm trying to mount a disk image created with the Fedora LiveUSB creator under Ubuntu programmatically, and I'm encountering some issues.
From what I've been told, it's very difficult to mount LVM snapshots outside of the host system. I have both the "pristine" image and the persistent snapshot, so I thought that it should be technically possible.
Any ideas? | fedora | ubuntu | lvm | snapshot | null | null | open | Mount LVM overlays/snapshots?
===
I'm trying to mount a disk image created with the Fedora LiveUSB creator under Ubuntu programmatically, and I'm encountering some issues.
From what I've been told, it's very difficult to mount LVM snapshots outside of the host system. I have both the "pristine" image and the persistent snapshot, so I thought that it should be technically possible.
Any ideas? | 0 |
4,652,291 | 01/10/2011 22:35:10 | 459,811 | 09/27/2010 18:29:31 | 54 | 1 | C++ Xerces-c: Initializing a shared_ptr | I am new to shared pointers and was wondering how to initalize a shared pointer if it is also a member variable?
Currently my code looks something like this:
In the header file, I have:
class Parser {
public:
Parser();
~Parser();
boost::shared_ptr<XercesDOMParser> parser;
{
In the constructor, I have something like this:
Parser::Parser()
{
try {
XMLPlatformUtils::Initialize();
} catch (...) {}
parser = shared_ptr<XercesDOMParser> (new XercesDomParser());
}
However compiling the program with Valgrind, I would receive the following error:
Pure virtual method called.
Terminated without an active exception.
Invalid read of size 8.
Any insights into what I may be doing incorrectly with the initialization? | shared-ptr | xerces-c | null | null | null | null | open | C++ Xerces-c: Initializing a shared_ptr
===
I am new to shared pointers and was wondering how to initalize a shared pointer if it is also a member variable?
Currently my code looks something like this:
In the header file, I have:
class Parser {
public:
Parser();
~Parser();
boost::shared_ptr<XercesDOMParser> parser;
{
In the constructor, I have something like this:
Parser::Parser()
{
try {
XMLPlatformUtils::Initialize();
} catch (...) {}
parser = shared_ptr<XercesDOMParser> (new XercesDomParser());
}
However compiling the program with Valgrind, I would receive the following error:
Pure virtual method called.
Terminated without an active exception.
Invalid read of size 8.
Any insights into what I may be doing incorrectly with the initialization? | 0 |
3,580,101 | 08/26/2010 22:36:00 | 372,752 | 06/22/2010 03:28:03 | 18 | 0 | Could you grade my relational algebra answers? | I have a Databases exam tomorrow and I have been running over some past papers to check whether my relational algebra knowledge is up to a decent standard or not.
If it isn't I'm going to stop working on it now and focus on other possible question types (DDL, Normalization) that may also arise.
If it needs just a little bit of work then I might carry on with it but obviously I need someone to tell me if what I am doing is correct or not!
Here are the questions:
[Questions][1]
And here are my answers:
[Answers][2]
Hopefully my writing is legible enough for you guys to understand. If I am totally way off course with my answers then just let me know, as that is what I suspect to be true anyway as I still don't think I'm getting it.
Thank you!
[1]: http://a.imageshack.us/img837/8256/questions.jpg
[2]: http://a.imageshack.us/img829/3702/answers.jpg | relational-database | exam | algebra | relational-algebra | null | 08/27/2010 02:27:05 | off topic | Could you grade my relational algebra answers?
===
I have a Databases exam tomorrow and I have been running over some past papers to check whether my relational algebra knowledge is up to a decent standard or not.
If it isn't I'm going to stop working on it now and focus on other possible question types (DDL, Normalization) that may also arise.
If it needs just a little bit of work then I might carry on with it but obviously I need someone to tell me if what I am doing is correct or not!
Here are the questions:
[Questions][1]
And here are my answers:
[Answers][2]
Hopefully my writing is legible enough for you guys to understand. If I am totally way off course with my answers then just let me know, as that is what I suspect to be true anyway as I still don't think I'm getting it.
Thank you!
[1]: http://a.imageshack.us/img837/8256/questions.jpg
[2]: http://a.imageshack.us/img829/3702/answers.jpg | 2 |
9,952,037 | 03/31/2012 00:48:37 | 1,290,030 | 03/24/2012 14:00:36 | 27 | 4 | Ruby on Rails, Heroku trouble | Sorry im new in Ruby on Rails and Im folling a tutorial but im getting troubles trying to push the db to heroku, I already install postgresql in my linux, try a lot of tutos and still the trouble :/.
When I enter:
$ heroku rake db:migrate
and I got the next problems:
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile,or fold >them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release >notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been->released. (called from <top (required)> at /app/Rakefile:7)
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or >fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the >release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2->has-been-released. (called from <top (required)> at /app/Rakefile:7)
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or >fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the >release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2->has-been-released. (called from <top (required)> at /app/Rakefile:7)
>rake aborted!
>Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is >not part of the bundle. Add it to Gemfile.)
>Tasks: TOP => db:migrate => db:load_config
>(See full trace by running task with --trace)
My Gemfile is this:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
gem 'sqlite3'
group :production do
gem 'pg'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Someone can help me?
Thanks in advance.
| ruby-on-rails | ruby | null | null | null | null | open | Ruby on Rails, Heroku trouble
===
Sorry im new in Ruby on Rails and Im folling a tutorial but im getting troubles trying to push the db to heroku, I already install postgresql in my linux, try a lot of tutos and still the trouble :/.
When I enter:
$ heroku rake db:migrate
and I got the next problems:
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile,or fold >them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the release >notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2-has-been->released. (called from <top (required)> at /app/Rakefile:7)
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or >fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the >release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2->has-been-released. (called from <top (required)> at /app/Rakefile:7)
>DEPRECATION WARNING: You have Rails 2.3-style plugins in vendor/plugins! Support for these >plugins will be removed in Rails 4.0. Move them out and bundle them in your Gemfile, or >fold them in to your app as lib/myplugin/* and config/initializers/myplugin.rb. See the >release notes for more on this: http://weblog.rubyonrails.org/2012/01/04/rails-3-2-0-rc2->has-been-released. (called from <top (required)> at /app/Rakefile:7)
>rake aborted!
>Please install the postgresql adapter: `gem install activerecord-postgresql-adapter` (pg is >not part of the bundle. Add it to Gemfile.)
>Tasks: TOP => db:migrate => db:load_config
>(See full trace by running task with --trace)
My Gemfile is this:
source 'https://rubygems.org'
gem 'rails', '3.2.2'
gem 'sqlite3'
group :production do
gem 'pg'
end
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
Someone can help me?
Thanks in advance.
| 0 |
1,932,951 | 12/19/2009 13:46:08 | 91,258 | 04/15/2009 19:02:26 | 124 | 4 | EC2 database server failover strategy | I am planning to deploy my web app to EC2. I have several webserver instances. I have 1 primary database instance. I have 1 failover database instance. I need a strategy to redirect the webservers to the failover database instance IP when the primary database instance fails.
I was hoping I could use an Elastic IP in my connection strings. But, the webservers are not able to access/ping the Elastic IP. I have several brute force ideas to solve the problem. However, I am trying to find the most elegant solution possible.
I am using all .Net and SQL Server. My connection strings are encrypted.
Does anybody have a strategy for failing over a database instance in EC2 using some form of automation or DNS configuration?
Please let me know. | amazon-ec2 | failover | null | null | null | null | open | EC2 database server failover strategy
===
I am planning to deploy my web app to EC2. I have several webserver instances. I have 1 primary database instance. I have 1 failover database instance. I need a strategy to redirect the webservers to the failover database instance IP when the primary database instance fails.
I was hoping I could use an Elastic IP in my connection strings. But, the webservers are not able to access/ping the Elastic IP. I have several brute force ideas to solve the problem. However, I am trying to find the most elegant solution possible.
I am using all .Net and SQL Server. My connection strings are encrypted.
Does anybody have a strategy for failing over a database instance in EC2 using some form of automation or DNS configuration?
Please let me know. | 0 |
3,379,811 | 07/31/2010 21:12:33 | 260,229 | 01/27/2010 15:48:35 | 67 | 0 | [Python/Project Euler]Problem 41 | I am trying to solve problem 41, but i don't know why my code stops at 987654319:
def IsPandigital(No):
a = sorted(str(No))
for i in range(1,10):
if a[i - 1] != str(i):
return False
return True
def IsPrime(No):
i = 2
while i < No:
if No % i == 0:
return False
i += 1
return True
i = 987654321
while i > 0:
print i
raw_input()
if IsPrime(i) == True and IsPandigital(i) == True:
print i
break
i -= 1
print i
print "EOP"
raw_input()
P.S: I know that i should start from 799999999 because:
> GergS: Every 9 digit and 8 digit pandigital number is divisible by 3. | python | project-euler | null | null | null | null | open | [Python/Project Euler]Problem 41
===
I am trying to solve problem 41, but i don't know why my code stops at 987654319:
def IsPandigital(No):
a = sorted(str(No))
for i in range(1,10):
if a[i - 1] != str(i):
return False
return True
def IsPrime(No):
i = 2
while i < No:
if No % i == 0:
return False
i += 1
return True
i = 987654321
while i > 0:
print i
raw_input()
if IsPrime(i) == True and IsPandigital(i) == True:
print i
break
i -= 1
print i
print "EOP"
raw_input()
P.S: I know that i should start from 799999999 because:
> GergS: Every 9 digit and 8 digit pandigital number is divisible by 3. | 0 |
8,538,280 | 12/16/2011 18:06:58 | 1,080,821 | 12/05/2011 03:07:14 | 1 | 0 | Which is the bestway to input without "\n" in C? | Which is the bestway to input without "\n" in C
and some easyway. | c | null | null | null | null | 12/16/2011 21:42:31 | not a real question | Which is the bestway to input without "\n" in C?
===
Which is the bestway to input without "\n" in C
and some easyway. | 1 |
9,848,680 | 03/24/2012 02:38:51 | 192,910 | 10/20/2009 07:56:41 | 5,969 | 220 | Passign code as a function parameter instead of declaring a callback | I think that some newer languages like JS can do this natively, but I forget the term for it (make a "temporary" function in-line just to pass as a callback)
What I want to do is ...
I'm writing unit tests where I set up expected input & output messages at compile time. Later at run time, I want to do some checks when each output is received or input has been processed, so I added a parameter for a callback function.
That's working fine and I could leave it & move on, but ... I am just curious ...
sometimes a function is overkill and I just need a single comparison; sometime a small block of code would do. Perhaps I could just evaluate these to a zero/non-zero value at run time? But how to pass as a parameter?
At the moment my function has the following signature
void AddExpectedCommand(E_peripheralType peripheral,
communicationBlock_t commandBlock,
errorMessage_t errorMessage,
void *(*DoRunTimeChecks)(E_boolean));
where the final parameter is pointer to a callback function returning boolean.
Is there any way that I could pass a code expression as a parameter instead?
Or does a function seem "cleaner"?
Thanks in advance for any help ...
| c | callback | null | null | null | null | open | Passign code as a function parameter instead of declaring a callback
===
I think that some newer languages like JS can do this natively, but I forget the term for it (make a "temporary" function in-line just to pass as a callback)
What I want to do is ...
I'm writing unit tests where I set up expected input & output messages at compile time. Later at run time, I want to do some checks when each output is received or input has been processed, so I added a parameter for a callback function.
That's working fine and I could leave it & move on, but ... I am just curious ...
sometimes a function is overkill and I just need a single comparison; sometime a small block of code would do. Perhaps I could just evaluate these to a zero/non-zero value at run time? But how to pass as a parameter?
At the moment my function has the following signature
void AddExpectedCommand(E_peripheralType peripheral,
communicationBlock_t commandBlock,
errorMessage_t errorMessage,
void *(*DoRunTimeChecks)(E_boolean));
where the final parameter is pointer to a callback function returning boolean.
Is there any way that I could pass a code expression as a parameter instead?
Or does a function seem "cleaner"?
Thanks in advance for any help ...
| 0 |
7,959,842 | 10/31/2011 21:13:52 | 875,139 | 08/02/2011 17:13:25 | 23 | 0 | htppost to php script from android without using mutlipartEntity | I have used the bunch of code below.
MultipartEntity me = new MultipartEntity();
me.addPart("applicationKey", new StringBody("11111111111"));
me.addPart("clientCode", new StringBody("100"));
me.addPart("userEmail", new StringBody(strMyAdress));
me.addPart("friendEmail0", new StringBody(strFriendAdress));
me.addPart("fromAndroid",new StringBody (Android));
Log.i("TestPathkkkkkkk", strAttachedFile);
me.addPart("videoFile", new FileBody(new File(strAttachedFile)));
me.addPart("static_url",new StringBody (link));
To try to upload all the above parameters to a php script using:
HttpPost httppost = new HttpPost("http:/blah/blah/blah.php");
It seems to accept everything in the post except for the FileBody.
The strAttachedFile in
me.addPart("videoFile", new FileBody(new File(strAttachedFile)));
is the directory path to a video on the phone.
I use logcat to make sure the path is correct.
When i run script to upload, this is what log cat `returns: INFO/TestPathkkkkkk(21987): /mnt/sdcard/DCIM/100MEDIA/VIDEO0111.3gp`
But on the PHP script side it only shows the video name and not the full directory.
Anyways long story short, I was wondering if there is anyway to httppost to php script without using Multipartentity?
Thanks, in advance.
| android | http-post | null | null | null | null | open | htppost to php script from android without using mutlipartEntity
===
I have used the bunch of code below.
MultipartEntity me = new MultipartEntity();
me.addPart("applicationKey", new StringBody("11111111111"));
me.addPart("clientCode", new StringBody("100"));
me.addPart("userEmail", new StringBody(strMyAdress));
me.addPart("friendEmail0", new StringBody(strFriendAdress));
me.addPart("fromAndroid",new StringBody (Android));
Log.i("TestPathkkkkkkk", strAttachedFile);
me.addPart("videoFile", new FileBody(new File(strAttachedFile)));
me.addPart("static_url",new StringBody (link));
To try to upload all the above parameters to a php script using:
HttpPost httppost = new HttpPost("http:/blah/blah/blah.php");
It seems to accept everything in the post except for the FileBody.
The strAttachedFile in
me.addPart("videoFile", new FileBody(new File(strAttachedFile)));
is the directory path to a video on the phone.
I use logcat to make sure the path is correct.
When i run script to upload, this is what log cat `returns: INFO/TestPathkkkkkk(21987): /mnt/sdcard/DCIM/100MEDIA/VIDEO0111.3gp`
But on the PHP script side it only shows the video name and not the full directory.
Anyways long story short, I was wondering if there is anyway to httppost to php script without using Multipartentity?
Thanks, in advance.
| 0 |
3,559,962 | 08/24/2010 18:51:48 | 381,565 | 07/01/2010 21:49:16 | 35 | 1 | Music preview API? | Does anyone know of of a music API that let's you play maybe 30 second previews of songs? I know Amazon has a flash widget, but I was wondering if there are other options for integrating this into a music site.
I know last.fm and musicbrainz have some awesome APIs, but none of them do music previews. | api | music | null | null | null | null | open | Music preview API?
===
Does anyone know of of a music API that let's you play maybe 30 second previews of songs? I know Amazon has a flash widget, but I was wondering if there are other options for integrating this into a music site.
I know last.fm and musicbrainz have some awesome APIs, but none of them do music previews. | 0 |
5,286,340 | 03/12/2011 23:33:50 | 657,052 | 03/12/2011 23:33:50 | 1 | 0 | Problem with combination boost::exception and boost::variant | I have strange problem with two-level variant struct when boost::exception is included. I have following code snippet:
#include <boost/variant.hpp>
#include <boost/exception/all.hpp>
typedef boost::variant< int > StoredValue;
typedef boost::variant< StoredValue > ExpressionItem;
inline std::ostream& operator << ( std::ostream & os, const StoredValue& stvalue ) { return os;}
inline std::ostream& operator << ( std::ostream & os, const ExpressionItem& stvalue ) { return os; }
When I try to compile it, I have following error:
boost/exception/detail/is_output_streamable.hpp(45): error C2593: 'operator <<' is ambiguous
test.cpp(11): could be 'std::ostream &operator <<(std::ostream &,const ExpressionItem &)' [found using argument-dependent lookup]
test.cpp(8): or 'std::ostream &operator <<(std::ostream &,const StoredValue &)' [found using argument-dependent lookup]
1> while trying to match the argument list '(std::basic_ostream<_Elem,_Traits>, const boost::error_info<Tag,T>)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> and
1> [
1> Tag=boost::tag_original_exception_type,
1> T=const type_info *
1> ]
Code snippet is simplified as much as possible, in the real code are structures much more complicated.
Could someone please advise me how to define operators << in order to function even when using boost::Exception ?
Thanks and regards
Rick | c++ | exception | boost | variant | null | null | open | Problem with combination boost::exception and boost::variant
===
I have strange problem with two-level variant struct when boost::exception is included. I have following code snippet:
#include <boost/variant.hpp>
#include <boost/exception/all.hpp>
typedef boost::variant< int > StoredValue;
typedef boost::variant< StoredValue > ExpressionItem;
inline std::ostream& operator << ( std::ostream & os, const StoredValue& stvalue ) { return os;}
inline std::ostream& operator << ( std::ostream & os, const ExpressionItem& stvalue ) { return os; }
When I try to compile it, I have following error:
boost/exception/detail/is_output_streamable.hpp(45): error C2593: 'operator <<' is ambiguous
test.cpp(11): could be 'std::ostream &operator <<(std::ostream &,const ExpressionItem &)' [found using argument-dependent lookup]
test.cpp(8): or 'std::ostream &operator <<(std::ostream &,const StoredValue &)' [found using argument-dependent lookup]
1> while trying to match the argument list '(std::basic_ostream<_Elem,_Traits>, const boost::error_info<Tag,T>)'
1> with
1> [
1> _Elem=char,
1> _Traits=std::char_traits<char>
1> ]
1> and
1> [
1> Tag=boost::tag_original_exception_type,
1> T=const type_info *
1> ]
Code snippet is simplified as much as possible, in the real code are structures much more complicated.
Could someone please advise me how to define operators << in order to function even when using boost::Exception ?
Thanks and regards
Rick | 0 |
5,101,799 | 02/24/2011 07:50:24 | 1,215,393 | 02/17/2011 05:25:50 | 27 | 6 | Updating innerHTML with HTML from a php function? (using xajax) | I'm successfully updating the innerHTML of a DIV through xajax (when I click a link) but only when I assign HTML in the function itself, not when I call it from a different function.
To explain
// For the sake of testing
$output=rand(20,40);
// Add new HTML to container through $output
$ajax_resp->assign('div_container','innerHTML', $output);
return $ajax_resp;
This works fine. When I call this function through clicking the link, the container updates with a random number. However when I change $output to
$output=$compile->show('text');
Which is (simplified)
`function show($var) { echo $var; }`
It does not show it. The function `show` works perfectly outside of xajax. Any suggestions? | php | html | css | ajax | xajax | null | open | Updating innerHTML with HTML from a php function? (using xajax)
===
I'm successfully updating the innerHTML of a DIV through xajax (when I click a link) but only when I assign HTML in the function itself, not when I call it from a different function.
To explain
// For the sake of testing
$output=rand(20,40);
// Add new HTML to container through $output
$ajax_resp->assign('div_container','innerHTML', $output);
return $ajax_resp;
This works fine. When I call this function through clicking the link, the container updates with a random number. However when I change $output to
$output=$compile->show('text');
Which is (simplified)
`function show($var) { echo $var; }`
It does not show it. The function `show` works perfectly outside of xajax. Any suggestions? | 0 |
7,623,377 | 10/01/2011 22:29:25 | 47,775 | 12/19/2008 13:43:01 | 2,640 | 74 | Is there an assembler available for Mac OS 7.5.2? | Following my last quesiton ([Is there a compiler available for Mac OS 7.5.2?][1]), I'm wondering if there is an assembler that I can *download* for Mac OS 7.5.2? I'm not particularly interested in finding an IDE, but I may need a suitable text editor. Also, it would be nice if the program could fit on a 1.4MB floppy disk (since I'm struggling to find a way to network my old PowerBook).
[1]: http://stackoverflow.com/questions/7514706/is-there-a-compiler-available-for-mac-os-7-5-2 | assembly | apple | null | null | null | 10/02/2011 12:14:12 | not constructive | Is there an assembler available for Mac OS 7.5.2?
===
Following my last quesiton ([Is there a compiler available for Mac OS 7.5.2?][1]), I'm wondering if there is an assembler that I can *download* for Mac OS 7.5.2? I'm not particularly interested in finding an IDE, but I may need a suitable text editor. Also, it would be nice if the program could fit on a 1.4MB floppy disk (since I'm struggling to find a way to network my old PowerBook).
[1]: http://stackoverflow.com/questions/7514706/is-there-a-compiler-available-for-mac-os-7-5-2 | 4 |
8,296,738 | 11/28/2011 13:48:35 | 1,064,494 | 11/24/2011 18:21:17 | 1 | 0 | Adding time to a timer/counter | I've looked all over the web and everyone can teach you how to make a timer for your game or a countdown, but I can't seem to find out how to add time to an already counting timer.
So here is my counter class:
package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.text.TextField;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
public class Score extends MovieClip
{
public var second:Number = 0;
public var timer:Timer = new Timer(100);
private var stageRef:Stage;
public function Score(stageRef:Stage)
{
x = 560.95;
y = 31.35;
this.stageRef = stageRef;
timer.addEventListener(TimerEvent.TIMER, scoreTimer);
timer.start();
}
public function scoreTimer(evt:TimerEvent):void
{
second += 1;
scoreDisplay.text = String("Score: " +second);
}
That works without any issues or problems and just keeps counting upwards at a speed of 100ms, what I want to know is how to add say 30 seconds if something happens in my game, say you kill an enemy for example.
Please help! | flash | actionscript-3 | timer | null | null | null | open | Adding time to a timer/counter
===
I've looked all over the web and everyone can teach you how to make a timer for your game or a countdown, but I can't seem to find out how to add time to an already counting timer.
So here is my counter class:
package
{
import flash.display.MovieClip;
import flash.display.Stage;
import flash.text.TextField;
import flash.events.Event;
import flash.utils.Timer;
import flash.events.TimerEvent;
public class Score extends MovieClip
{
public var second:Number = 0;
public var timer:Timer = new Timer(100);
private var stageRef:Stage;
public function Score(stageRef:Stage)
{
x = 560.95;
y = 31.35;
this.stageRef = stageRef;
timer.addEventListener(TimerEvent.TIMER, scoreTimer);
timer.start();
}
public function scoreTimer(evt:TimerEvent):void
{
second += 1;
scoreDisplay.text = String("Score: " +second);
}
That works without any issues or problems and just keeps counting upwards at a speed of 100ms, what I want to know is how to add say 30 seconds if something happens in my game, say you kill an enemy for example.
Please help! | 0 |
7,545,580 | 09/25/2011 12:48:57 | 916,648 | 08/28/2011 17:15:48 | 22 | 0 | Efficient Algorithm/code to print a 2D Array into Spinal Format | Please write a efficient code/algorithm in java to print a two dimensional array [m][n] in a spinal format ?
For ex. if the array provided by the user is :
1 2 3 4
5 6 7 8
1 2 3 4
5 6 7 8
then the output should be
1 2 3 4 8 4 8 7 6 5 1 5 6 7 3 2
| java | arrays | xcode | algorithm | development-approach | 09/25/2011 16:23:48 | not a real question | Efficient Algorithm/code to print a 2D Array into Spinal Format
===
Please write a efficient code/algorithm in java to print a two dimensional array [m][n] in a spinal format ?
For ex. if the array provided by the user is :
1 2 3 4
5 6 7 8
1 2 3 4
5 6 7 8
then the output should be
1 2 3 4 8 4 8 7 6 5 1 5 6 7 3 2
| 1 |
9,973,742 | 04/02/2012 09:17:27 | 359,297 | 06/05/2010 16:48:14 | 1 | 0 | C# - Changing default values for some properties of subclassed DataGridView | Specifically, I want RowTemplate.Height to be 16, and some special values for ColumnHeadersDefaultCellStyle and DefaultCellStyle.
I have of course set them in the constructor, but upon placing the control on a form, my carefully crafted default values are torn away and replaced with completely different values.
I think this is possible with some string representation of the types in question, but I've not been able to figure it out. | c# | winforms | visual-studio | properties | default-value | 06/06/2012 20:40:33 | too localized | C# - Changing default values for some properties of subclassed DataGridView
===
Specifically, I want RowTemplate.Height to be 16, and some special values for ColumnHeadersDefaultCellStyle and DefaultCellStyle.
I have of course set them in the constructor, but upon placing the control on a form, my carefully crafted default values are torn away and replaced with completely different values.
I think this is possible with some string representation of the types in question, but I've not been able to figure it out. | 3 |
9,761,820 | 03/18/2012 20:07:45 | 610,379 | 02/09/2011 20:33:05 | 1 | 0 | high availability and spring framework | is there any sample, document, white paper or technical discussion that talk about how it is possible to support thousands of online users (eg: 50k) by app that implemented using spring-framework? | spring | cluster-computing | null | null | null | 03/19/2012 02:08:40 | not constructive | high availability and spring framework
===
is there any sample, document, white paper or technical discussion that talk about how it is possible to support thousands of online users (eg: 50k) by app that implemented using spring-framework? | 4 |
6,436,539 | 06/22/2011 07:44:26 | 416,499 | 08/10/2010 18:49:24 | 125 | 6 | matlab classes: handle or value | I am someone who has some c++ background and tries to use object oriented programming / classes in matlab.
Can anybody explain me in simple terms what the difference between a handle and a value class is?
I know that I would use a value class if I wanted to define a matrix class with overloaded operators such as "+" and "*". However, sometimes it seems that things only work for me as I want when I pick a handle class.
Thanks in advance for the help! | c++ | oop | matlab | null | null | null | open | matlab classes: handle or value
===
I am someone who has some c++ background and tries to use object oriented programming / classes in matlab.
Can anybody explain me in simple terms what the difference between a handle and a value class is?
I know that I would use a value class if I wanted to define a matrix class with overloaded operators such as "+" and "*". However, sometimes it seems that things only work for me as I want when I pick a handle class.
Thanks in advance for the help! | 0 |
11,071,156 | 06/17/2012 12:06:54 | 1,202,276 | 02/10/2012 14:56:23 | 11 | 0 | theming jquery dialog | I am using datatable and dialog on same page, i would like to apply different themes for each, how do i achieve it. currently my datatable theme is applied for both, how do i scope dialog.
Below is my dialog code
$('#newVisit').dialog({
modal: true,
autoOpen: false,
draggable: true,
width: 'auto',
height: 'auto',
title: "Add New Visit"
// open: function () {
// $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
// }
}); //.parent(".ui-dialog").wrap("<div class='theme-smoothness'></div>");
I have tried wrapping but didn't succeed.
any idea would be appreciated.
Regards
| asp.net | null | null | null | null | null | open | theming jquery dialog
===
I am using datatable and dialog on same page, i would like to apply different themes for each, how do i achieve it. currently my datatable theme is applied for both, how do i scope dialog.
Below is my dialog code
$('#newVisit').dialog({
modal: true,
autoOpen: false,
draggable: true,
width: 'auto',
height: 'auto',
title: "Add New Visit"
// open: function () {
// $(this).parents(".ui-dialog:first").find(".ui-dialog-titlebar").addClass("ui-state-error");
// }
}); //.parent(".ui-dialog").wrap("<div class='theme-smoothness'></div>");
I have tried wrapping but didn't succeed.
any idea would be appreciated.
Regards
| 0 |
11,113,568 | 06/20/2012 05:54:28 | 1,465,491 | 06/19/2012 05:56:41 | 8 | 0 | Simple, efficient, Java web crawler to extract hostnames | I need to write a simple web crawler using Java. I just need the hostname from the crawled page (e.g: facebook.com, without "http://wwww.") and need to save the extracted hostnames in a text file.
I could extract the HTML code from the site and save it in a text file, but need some good tutorials or help on how to search for hostnames inside my text file that contains the extracted HTML code for a page & save these in a text file without repetition (not save the same hostname twice).
Here is my code for extraction.
http://stackoverflow.com/questions/11097294/extract-urls-from-google-results-java
| java | web-crawler | null | null | null | 06/20/2012 11:11:43 | not a real question | Simple, efficient, Java web crawler to extract hostnames
===
I need to write a simple web crawler using Java. I just need the hostname from the crawled page (e.g: facebook.com, without "http://wwww.") and need to save the extracted hostnames in a text file.
I could extract the HTML code from the site and save it in a text file, but need some good tutorials or help on how to search for hostnames inside my text file that contains the extracted HTML code for a page & save these in a text file without repetition (not save the same hostname twice).
Here is my code for extraction.
http://stackoverflow.com/questions/11097294/extract-urls-from-google-results-java
| 1 |
10,288,518 | 04/23/2012 21:21:15 | 1,256,821 | 03/08/2012 10:55:36 | 1 | 0 | strange parenthesis in small c program | i'm writing a simple program on c
int main(int argc, char** argv) {
unsigned char* line = (unsigned char* ) malloc(0xFFFF);
while (gets(line) > 0) {
if (line[0] == 'l') {
if (line[2]=='.' && line[3] == '.') {
printf("forbidden path");
}
unsigned char* res = (unsigned char* ) malloc(0xFFFF);
unsigned char* cmd = (unsigned char* ) malloc(strlen(line) +
1 + strlen(" | grep -v xml") + strlen("/home/files/"));
strcpy(cmd, "ls ");
strcpy(cmd + 3, "/home/boris/0servfiles/");
strcpy(cmd + 3 + strlen("/home/files/"), line + 2);
strcpy(cmd + 3 + strlen("/home/files/") + strlen(line + 2), " | grep -v xml");
execwthr(cmd, res);
printf("%s\n%s", cmd, res);
free(cmd);
free(res);
} else if (line[0] == 'm') {
if (line[2]=='.' && line[3] == '.') {
printf("forbidden path");
}
unsigned char res = (unsigned char* ) malloc(0xFFFF);
unsigned char* cmd = (unsigned char* ) malloc(strlen(line) +
1 + strlen("/home/files/"));
strcpy(cmd, "mkdir ");
strcpy(cmd + 6, "/home/files/");
strcpy(cmd + 6 + strlen("/home/files/"), line + 2);
execwthr(cmd, res);
printf("%s\n%s", cmd, res);
free(cmd);
free(res);
}
}
return (EXIT_SUCCESS);
}
well, there's small problem. when i try to create a folder named "h" i get following:
m l
mkdir /home/files)l
what's wrong? thanks in advance! | c | null | null | null | null | 04/25/2012 11:15:13 | not a real question | strange parenthesis in small c program
===
i'm writing a simple program on c
int main(int argc, char** argv) {
unsigned char* line = (unsigned char* ) malloc(0xFFFF);
while (gets(line) > 0) {
if (line[0] == 'l') {
if (line[2]=='.' && line[3] == '.') {
printf("forbidden path");
}
unsigned char* res = (unsigned char* ) malloc(0xFFFF);
unsigned char* cmd = (unsigned char* ) malloc(strlen(line) +
1 + strlen(" | grep -v xml") + strlen("/home/files/"));
strcpy(cmd, "ls ");
strcpy(cmd + 3, "/home/boris/0servfiles/");
strcpy(cmd + 3 + strlen("/home/files/"), line + 2);
strcpy(cmd + 3 + strlen("/home/files/") + strlen(line + 2), " | grep -v xml");
execwthr(cmd, res);
printf("%s\n%s", cmd, res);
free(cmd);
free(res);
} else if (line[0] == 'm') {
if (line[2]=='.' && line[3] == '.') {
printf("forbidden path");
}
unsigned char res = (unsigned char* ) malloc(0xFFFF);
unsigned char* cmd = (unsigned char* ) malloc(strlen(line) +
1 + strlen("/home/files/"));
strcpy(cmd, "mkdir ");
strcpy(cmd + 6, "/home/files/");
strcpy(cmd + 6 + strlen("/home/files/"), line + 2);
execwthr(cmd, res);
printf("%s\n%s", cmd, res);
free(cmd);
free(res);
}
}
return (EXIT_SUCCESS);
}
well, there's small problem. when i try to create a folder named "h" i get following:
m l
mkdir /home/files)l
what's wrong? thanks in advance! | 1 |
85,353 | 09/17/2008 16:59:23 | 2,233 | 08/21/2008 03:50:22 | 176 | 5 | Best general SVN Ignore Pattern? | What is the best (or as good as possible) general SVN ignore pattern to use?
There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). There are however, a large number of file types that you just never want included in source control automatically irregardless the specifics of your development environment.
The answer to this question would serve as a good starting point for any project - only requiring them to add the few environment specific items they need. It could be adapted for other Version Control Systems (VCS) as well. | svn | version-control | language-agnostic | environment | development-environment | null | open | Best general SVN Ignore Pattern?
===
What is the best (or as good as possible) general SVN ignore pattern to use?
There are a number of different IDE, editor, compiler, plug-in, platform, etc. specific files and some file types that "overlap" (i.e. desirable for some types projects and not for others). There are however, a large number of file types that you just never want included in source control automatically irregardless the specifics of your development environment.
The answer to this question would serve as a good starting point for any project - only requiring them to add the few environment specific items they need. It could be adapted for other Version Control Systems (VCS) as well. | 0 |
6,093,674 | 05/23/2011 06:38:44 | 767,484 | 05/23/2011 06:38:44 | 1 | 0 | Limit Max Results after glob sort by time | I'd like to limit the results returned after I glob the files in a directory and sort them by time. And just in case there are no files in the directory, I'd like to include an 'if file exists' phrase as well. Here is the code so far.
$list = glob('items/*.html');
usort(
$list,
create_function('$a,$b', 'return filemtime($a) < filemtime($b);')
);
foreach($list as $file)
{
include $file;
}
Now I'm guessing, I can probably do the if (file_exists()) part like this:
foreach($list as $file)
{
if (file_exists($file)) {
include $file;}
}
part without throwing errors, but where do I do the count up to a max of 5 or 7?
Thanks, Dave
| php | sorting | glob | null | null | null | open | Limit Max Results after glob sort by time
===
I'd like to limit the results returned after I glob the files in a directory and sort them by time. And just in case there are no files in the directory, I'd like to include an 'if file exists' phrase as well. Here is the code so far.
$list = glob('items/*.html');
usort(
$list,
create_function('$a,$b', 'return filemtime($a) < filemtime($b);')
);
foreach($list as $file)
{
include $file;
}
Now I'm guessing, I can probably do the if (file_exists()) part like this:
foreach($list as $file)
{
if (file_exists($file)) {
include $file;}
}
part without throwing errors, but where do I do the count up to a max of 5 or 7?
Thanks, Dave
| 0 |
849,267 | 05/11/2009 17:57:49 | 38,679 | 11/18/2008 19:53:53 | 1 | 0 | how do i create a map with a type parameter of class | I'm trying to do something like this:
import scala.swing
class componentMapper {
val map = Map[Class[_], Componenet]()
def apply(c: Class[_], component: Component) = map += (c -> componenet)
}
class Render extends ComponentMapper {
def getRenderer(value: AnyRef) = map(value.getClass)
}
This doesn't seem to work. What type parameter should I be using for Class? | scala | null | null | null | null | null | open | how do i create a map with a type parameter of class
===
I'm trying to do something like this:
import scala.swing
class componentMapper {
val map = Map[Class[_], Componenet]()
def apply(c: Class[_], component: Component) = map += (c -> componenet)
}
class Render extends ComponentMapper {
def getRenderer(value: AnyRef) = map(value.getClass)
}
This doesn't seem to work. What type parameter should I be using for Class? | 0 |
7,506,992 | 09/21/2011 21:38:27 | 136,731 | 07/11/2009 13:32:04 | 303 | 39 | Ajax Submit problem | I have this code that works ok when search button is pressed, but if one hits the enter button, it does not return any value from the database.
function showDetails(str){
if (str==""){
document.getElementById("searchDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("searchDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_details.php?q="+str,true);
xmlhttp.send();
}
Here's how I'm using it in a separate page.
`searchField` is a text input field in my form.
<button type="button" name="search" onclick="showDetails(searchField.value)">Search</button>
Like I said, it returns data from the server only when the search button is pressed but not when you hit the enter button on the computer keyboard. Is there any way I can make it respond to both?
| php | mysql | ajax | null | null | null | open | Ajax Submit problem
===
I have this code that works ok when search button is pressed, but if one hits the enter button, it does not return any value from the database.
function showDetails(str){
if (str==""){
document.getElementById("searchDiv").innerHTML="";
return;
}
if (window.XMLHttpRequest) {
xmlhttp=new XMLHttpRequest();
}
else {
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange=function(){
if (xmlhttp.readyState==4 && xmlhttp.status==200){
document.getElementById("searchDiv").innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open("GET","ajax_details.php?q="+str,true);
xmlhttp.send();
}
Here's how I'm using it in a separate page.
`searchField` is a text input field in my form.
<button type="button" name="search" onclick="showDetails(searchField.value)">Search</button>
Like I said, it returns data from the server only when the search button is pressed but not when you hit the enter button on the computer keyboard. Is there any way I can make it respond to both?
| 0 |
10,398,287 | 05/01/2012 13:23:00 | 1,048,319 | 11/15/2011 19:29:56 | 139 | 3 | Taking a Reference cell, searching through 2nd sheet, replace data with same identifier | I decided to change my tact.
I decided to take another shot at this, but in a new way. I did a weekend long Google marathon and found I believe my answer,
Option Explicit
Sub DataUpdate()
Dim rFind As Long, NR As Long, LR As Long, LC As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
LC = Cells(2, Columns.Count).End(xlToLeft).Column
NR = LR + 1
On Error Resume Next
rFind = Range("A25:A" & LR).Find(Range("A1")).Row
On Error GoTo 0
If rFind = 0 Then
If MsgBox("Customer record not found, add to dataset?", vbYesNo + vbQuestion) = vbYes Then
Range("A2", Cells(LC, 2)).Copy
Range("C" & NR).PasteSpecial xlPasteValues
Range("A1", Cells(1, LC)).ClearContents
Exit Sub
End If
Else
Range("A2", Cells(2, LC)).Copy
Range("A" & rFind).PasteSpecial xlPasteValues
Range("A1", Cells(1, LC)).ClearContents
End If
End Sub
Looking at this I just want a cleaner explanation instead of just taking it as is, and using it without knowing what I am doing.
Here is the sheet it is on:
http://dl.dropbox.com/u/3327208/Excel/Replace.zip
If I add this to my code, regurgitate this code I see I can do this, I just want to verify that this is correct.
Option Explicit
Sub PENCMR()
Dim i As Integer
With Application
.ScreenUpdating = False
End With
'Internal NCMR
Dim wsPE As Worksheet
Dim wsNDA As Worksheet
'Copy Ranges
Dim c As Variant
'Paste Ranges
Dim p As Range
'Setting Sheet
Set wsPE = Sheets("Print-Edit NCMR")
Set wsNDA = Sheets("NCMR Data")
Set p = wsPE.Range("A54:U54")
With wsPE
c = Array(.Range("AG2"), .Range("B11"), .Range("B14"), .Range("B17"), .Range("B20"), .Range("B23") _
, .Range("Q11"), .Range("Q14"), .Range("Q17"), .Range("Q20"), .Range("R25"), .Range("V23") _
, .Range("V25"), .Range("V27"), .Range("B32"), .Range("B36"), .Range("B40"), .Range("B44") _
, .Range("D49"), .Range("L49"), .Range("V49"))
End With
For i = LBound(c) To UBound(c)
p(i + 1).Value = c(i).Value
Next
With wsNDA
Dim rFind As Long, NR As Long, LR As Long, LC As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
LC = Cells(2, Columns.Count).End(xlToLeft).Column
NR = LR + 1
rFind = wsNDA.Range("A:A" & LR).Find(Range("A54")).Row
Range("A54", Cells(2, LC)).Copy
Range("A" & rFind).PasteSpecial xlPasteValues
Range("A54", Cells(1, LC)).ClearContents
End With
With Application
.ScreenUpdating = True
End With
End Sub
The code runs, but it doesn't come back with an error, yet it doesn't run completely. It hits to the point where it drags everything down, then it seems to die there. Can someone help me find out why it doesn't do what I think it should do, which is copy the row, search for the number in column A, and then write over it with the correct data in row 54...
I know something is wrong, but I don't have the skills to figure out what, if someone can help me it be greatly appreciated. | excel-vba | null | null | null | null | null | open | Taking a Reference cell, searching through 2nd sheet, replace data with same identifier
===
I decided to change my tact.
I decided to take another shot at this, but in a new way. I did a weekend long Google marathon and found I believe my answer,
Option Explicit
Sub DataUpdate()
Dim rFind As Long, NR As Long, LR As Long, LC As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
LC = Cells(2, Columns.Count).End(xlToLeft).Column
NR = LR + 1
On Error Resume Next
rFind = Range("A25:A" & LR).Find(Range("A1")).Row
On Error GoTo 0
If rFind = 0 Then
If MsgBox("Customer record not found, add to dataset?", vbYesNo + vbQuestion) = vbYes Then
Range("A2", Cells(LC, 2)).Copy
Range("C" & NR).PasteSpecial xlPasteValues
Range("A1", Cells(1, LC)).ClearContents
Exit Sub
End If
Else
Range("A2", Cells(2, LC)).Copy
Range("A" & rFind).PasteSpecial xlPasteValues
Range("A1", Cells(1, LC)).ClearContents
End If
End Sub
Looking at this I just want a cleaner explanation instead of just taking it as is, and using it without knowing what I am doing.
Here is the sheet it is on:
http://dl.dropbox.com/u/3327208/Excel/Replace.zip
If I add this to my code, regurgitate this code I see I can do this, I just want to verify that this is correct.
Option Explicit
Sub PENCMR()
Dim i As Integer
With Application
.ScreenUpdating = False
End With
'Internal NCMR
Dim wsPE As Worksheet
Dim wsNDA As Worksheet
'Copy Ranges
Dim c As Variant
'Paste Ranges
Dim p As Range
'Setting Sheet
Set wsPE = Sheets("Print-Edit NCMR")
Set wsNDA = Sheets("NCMR Data")
Set p = wsPE.Range("A54:U54")
With wsPE
c = Array(.Range("AG2"), .Range("B11"), .Range("B14"), .Range("B17"), .Range("B20"), .Range("B23") _
, .Range("Q11"), .Range("Q14"), .Range("Q17"), .Range("Q20"), .Range("R25"), .Range("V23") _
, .Range("V25"), .Range("V27"), .Range("B32"), .Range("B36"), .Range("B40"), .Range("B44") _
, .Range("D49"), .Range("L49"), .Range("V49"))
End With
For i = LBound(c) To UBound(c)
p(i + 1).Value = c(i).Value
Next
With wsNDA
Dim rFind As Long, NR As Long, LR As Long, LC As Long
LR = Range("C" & Rows.Count).End(xlUp).Row
LC = Cells(2, Columns.Count).End(xlToLeft).Column
NR = LR + 1
rFind = wsNDA.Range("A:A" & LR).Find(Range("A54")).Row
Range("A54", Cells(2, LC)).Copy
Range("A" & rFind).PasteSpecial xlPasteValues
Range("A54", Cells(1, LC)).ClearContents
End With
With Application
.ScreenUpdating = True
End With
End Sub
The code runs, but it doesn't come back with an error, yet it doesn't run completely. It hits to the point where it drags everything down, then it seems to die there. Can someone help me find out why it doesn't do what I think it should do, which is copy the row, search for the number in column A, and then write over it with the correct data in row 54...
I know something is wrong, but I don't have the skills to figure out what, if someone can help me it be greatly appreciated. | 0 |
4,926,027 | 02/07/2011 20:13:09 | 477,415 | 10/15/2010 20:07:08 | 603 | 35 | What file system path is used by Android's Context.openFileOutput()? | I can't understand why the answer to this isn't in the Android developer docs; I find them consistently frustrating.
Re the openFileOutput() method on the Context class to open a file for writing, what internal storage file path does it write to?
http://developer.android.com/reference/android/content/Context.html
http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
| android | null | null | null | null | null | open | What file system path is used by Android's Context.openFileOutput()?
===
I can't understand why the answer to this isn't in the Android developer docs; I find them consistently frustrating.
Re the openFileOutput() method on the Context class to open a file for writing, what internal storage file path does it write to?
http://developer.android.com/reference/android/content/Context.html
http://developer.android.com/guide/topics/data/data-storage.html#filesInternal
| 0 |
9,768,246 | 03/19/2012 10:06:24 | 1,278,258 | 03/19/2012 09:45:32 | 1 | 0 | sqlite3 doesnt retain rows after restart | im trying to save a row in my settings table, it works all fine and dandy except when i kill the app and then try to get the row back it cant find it
Cursor c = db.query(savedSettings.getTableName(), null, null, null, null, null, null);
c.moveToLast();
DatabaseUtils.dumpCursor(c);
db.setTransactionSuccessful();
db.endTransaction();
here's how i do my closing:
public void onPause() {
db.close();
}
public void onDestroy() {
db.close();
database.close();
}
public void onStop() {
db.close();
database.close();
}
public void onResume() {
db = database.getWritableDatabase();
}
after i restart the app it loses its contents.
Anyone got any ideas. | android | sqlite3 | null | null | null | null | open | sqlite3 doesnt retain rows after restart
===
im trying to save a row in my settings table, it works all fine and dandy except when i kill the app and then try to get the row back it cant find it
Cursor c = db.query(savedSettings.getTableName(), null, null, null, null, null, null);
c.moveToLast();
DatabaseUtils.dumpCursor(c);
db.setTransactionSuccessful();
db.endTransaction();
here's how i do my closing:
public void onPause() {
db.close();
}
public void onDestroy() {
db.close();
database.close();
}
public void onStop() {
db.close();
database.close();
}
public void onResume() {
db = database.getWritableDatabase();
}
after i restart the app it loses its contents.
Anyone got any ideas. | 0 |
11,489,518 | 07/15/2012 04:50:25 | 1,526,334 | 07/15/2012 01:29:02 | 4 | 0 | (Obj-C) setting return value of an Instance method | I know that Instance methods can return a value when they are done executing, but I do not know how to set & get that value, I know how to set the parameters but how do I set the return type of Method itself?
So, this is the Instance method implementation:
-(int) returnInteger: (id) anString: (int) anNumber{
to set it´s parameters i do:
[self returnInteger: (id) returnNSString: (int) 100];
But how do I set the value of "returnInteger itself" I want to know how to set i both inside it´s implementation and when I call it (when it executes).
also - one more question
if I set it´s first parameter to be 100 inside the method, and when I call it I want to add 100 to it, how do i do that? i tried this -but did not work
[self returnInteger: (id) returnNSString: (int) + 100];
| objective-c | methods | value | return | instance | 07/16/2012 01:49:52 | not a real question | (Obj-C) setting return value of an Instance method
===
I know that Instance methods can return a value when they are done executing, but I do not know how to set & get that value, I know how to set the parameters but how do I set the return type of Method itself?
So, this is the Instance method implementation:
-(int) returnInteger: (id) anString: (int) anNumber{
to set it´s parameters i do:
[self returnInteger: (id) returnNSString: (int) 100];
But how do I set the value of "returnInteger itself" I want to know how to set i both inside it´s implementation and when I call it (when it executes).
also - one more question
if I set it´s first parameter to be 100 inside the method, and when I call it I want to add 100 to it, how do i do that? i tried this -but did not work
[self returnInteger: (id) returnNSString: (int) + 100];
| 1 |
11,308,481 | 07/03/2012 09:55:38 | 1,498,387 | 07/03/2012 09:49:57 | 1 | 0 | How can I configure the Refund Period when using ServerManagedPolicy () in Android LVL |
How can I control the values for VT, GT, GR and UT ?
Many thanks.
Paul | android | null | null | null | null | 07/04/2012 04:27:19 | not a real question | How can I configure the Refund Period when using ServerManagedPolicy () in Android LVL
===
How can I control the values for VT, GT, GR and UT ?
Many thanks.
Paul | 1 |
9,058,258 | 01/30/2012 00:55:47 | 1,124,715 | 12/31/2011 22:08:41 | -1 | 0 | how to use preg_match to check whole text | Hi i have a problem with preg_match function.
i want to check whole text against pattern and return true if whole text matched with pattern and false for not matched or partially matched with pattern but i can't do this with php preg_match function.
for example i use bellow func to check if input is digit or no.
if(preg_match("/[\d]/","99ab") return true; else return false;
above code return true but i want to this return false.
and other regex that i want to check is users first name and last name with preg_match.
and another regex for phone numbers with this format (000) 000-0000.
please help me to solve this problem.
| php | regex | null | null | null | null | open | how to use preg_match to check whole text
===
Hi i have a problem with preg_match function.
i want to check whole text against pattern and return true if whole text matched with pattern and false for not matched or partially matched with pattern but i can't do this with php preg_match function.
for example i use bellow func to check if input is digit or no.
if(preg_match("/[\d]/","99ab") return true; else return false;
above code return true but i want to this return false.
and other regex that i want to check is users first name and last name with preg_match.
and another regex for phone numbers with this format (000) 000-0000.
please help me to solve this problem.
| 0 |
7,221,058 | 08/28/2011 12:46:06 | 458,680 | 09/26/2010 12:06:43 | 325 | 3 | How to change cell formatting dynamically | I hava implemented a datagrid using dojo which get updated every 5 seconds. I use following code to update the datagrid.
jsonStore.fetch({
query: {id:'*'},
onComplete: function(items, result){
dojo.forEach(items, function(item){
jsonStore.setValue(item, "time" , data.update[0].netchange);
.....
'data' is the new data i need to set to the grid which is an json object as follows
var data = {"update":[{...}]}
what I need to do if the netchage is negative i need set cell color to red. if netchange is positive it should be green. So I need a way to change cell formatting dynamically. can some one please tell me how to this. thanks in advance | javascript | css | dojo | dojox.grid | dojox.grid.datagrid | null | open | How to change cell formatting dynamically
===
I hava implemented a datagrid using dojo which get updated every 5 seconds. I use following code to update the datagrid.
jsonStore.fetch({
query: {id:'*'},
onComplete: function(items, result){
dojo.forEach(items, function(item){
jsonStore.setValue(item, "time" , data.update[0].netchange);
.....
'data' is the new data i need to set to the grid which is an json object as follows
var data = {"update":[{...}]}
what I need to do if the netchage is negative i need set cell color to red. if netchange is positive it should be green. So I need a way to change cell formatting dynamically. can some one please tell me how to this. thanks in advance | 0 |
11,033,815 | 06/14/2012 13:12:46 | 773,175 | 05/27/2011 13:30:28 | 96 | 2 | How to create Scientific calculator in Android like Real Calc? | i am newbie for Android Development. i don't have any idea for creating Scientific Calculator.but i want create to that. so please some one tell me solution... | java | android | calculator | null | null | 06/14/2012 13:58:16 | not a real question | How to create Scientific calculator in Android like Real Calc?
===
i am newbie for Android Development. i don't have any idea for creating Scientific Calculator.but i want create to that. so please some one tell me solution... | 1 |
10,977,178 | 06/11/2012 09:10:22 | 1,428,146 | 05/31/2012 10:25:35 | 5 | 0 | some questions about Facebook Graph api | I have been doing extensive research on facebook graph api and still have several issues that are unclear to me.
1. I searched in FACEBOOK API for this question but I didn't find good information about
where I can found "Facebook limitations" ( ex. no. sending messages per day , searching , creating events , invitations ) ?
2.Sorry for asking this question again in forum but really I would like to know if there is new way that can solved my problem .
about sending private message to friends through graph api instead of using Send Dialog?
3. Is there is way to fill "To,Message" fields in Send Dialog as default values?
4. inviting friends to event through api it's possible ?
5. how can I read posting/comments on friends wall without getting specific permission from my friends ?
Thanks
| facebook-graph-api | search | null | null | null | 06/11/2012 23:50:17 | not a real question | some questions about Facebook Graph api
===
I have been doing extensive research on facebook graph api and still have several issues that are unclear to me.
1. I searched in FACEBOOK API for this question but I didn't find good information about
where I can found "Facebook limitations" ( ex. no. sending messages per day , searching , creating events , invitations ) ?
2.Sorry for asking this question again in forum but really I would like to know if there is new way that can solved my problem .
about sending private message to friends through graph api instead of using Send Dialog?
3. Is there is way to fill "To,Message" fields in Send Dialog as default values?
4. inviting friends to event through api it's possible ?
5. how can I read posting/comments on friends wall without getting specific permission from my friends ?
Thanks
| 1 |
8,396,671 | 12/06/2011 07:40:08 | 1,061,354 | 11/23/2011 07:15:25 | 1 | 0 | (Beginner) How to write a method that takes an array of strings and prints each of them? | Hello I'm a beginner in computer science and I need get a better understanding with methods and arrays. | java | eclipse | null | null | null | 12/07/2011 04:09:05 | not a real question | (Beginner) How to write a method that takes an array of strings and prints each of them?
===
Hello I'm a beginner in computer science and I need get a better understanding with methods and arrays. | 1 |
7,181,526 | 08/24/2011 20:01:05 | 908,419 | 07/20/2010 13:58:15 | 8 | 0 | Example of Implementing Parcelable | i'm new in the world of android development and i'm trying to make that my objects be parcelable, the problem is that i have custom objects and those objects have arraylist attributes of other customs object i have made and i want to know the best way i can do this. Any code example would be appreciate.
Thanks in advance | android | parcelable | null | null | null | 08/25/2011 04:46:41 | not a real question | Example of Implementing Parcelable
===
i'm new in the world of android development and i'm trying to make that my objects be parcelable, the problem is that i have custom objects and those objects have arraylist attributes of other customs object i have made and i want to know the best way i can do this. Any code example would be appreciate.
Thanks in advance | 1 |
8,493,379 | 12/13/2011 17:22:17 | 801,763 | 06/16/2011 15:19:40 | 39 | 0 | Copy uploaded image to my physical directory in ASP.net | I'm creating a user profile for my website and I need to allow user to upload his image to be his profile picture, I used the ASP.net upload control and I need to copy the image he uploaded to a physical directory called Images on the server.
Does any one has idea if that is possible using ASP.net? | c# | asp.net | null | null | null | 12/14/2011 05:54:14 | not a real question | Copy uploaded image to my physical directory in ASP.net
===
I'm creating a user profile for my website and I need to allow user to upload his image to be his profile picture, I used the ASP.net upload control and I need to copy the image he uploaded to a physical directory called Images on the server.
Does any one has idea if that is possible using ASP.net? | 1 |
6,978,059 | 08/08/2011 05:25:37 | 505,797 | 06/23/2010 07:07:43 | 157 | 5 | How to access wodpress database? | I do have the access for the ftp account for this wordpress website and I need to access to its database. Where can I find it? It doesn't have a cpanel cause when I try to access
`www.sampleURL.com/cpanel` it shows:
**Not Found**
The requested URL /cpanel was not found on this server.
Is there any other way? | database | wordpress | cpanel | null | null | 08/08/2011 06:21:31 | off topic | How to access wodpress database?
===
I do have the access for the ftp account for this wordpress website and I need to access to its database. Where can I find it? It doesn't have a cpanel cause when I try to access
`www.sampleURL.com/cpanel` it shows:
**Not Found**
The requested URL /cpanel was not found on this server.
Is there any other way? | 2 |
7,733,265 | 10/11/2011 22:25:25 | 990,413 | 10/11/2011 22:19:49 | 1 | 0 | my screen is just a white screen with words no pic or anything eles | this is whats wrong with my facebook page
this is what it looks like when i log in... just like this
0
1
Find Friends
Friend Requests
Send a New Message
Messages
See All Messages3 unread
Notifications
See All Notifications
Search
Damihion
Home
Help Center
Account Settings
Privacy Settings
Use Facebook as Page
Facebook © 2011 · English (US)
About · Advertising · Create a Page · Developers · Careers · Privacy · Terms · Help
what do i do about it | java | facebook-graph-api | null | null | null | 10/12/2011 01:11:29 | not a real question | my screen is just a white screen with words no pic or anything eles
===
this is whats wrong with my facebook page
this is what it looks like when i log in... just like this
0
1
Find Friends
Friend Requests
Send a New Message
Messages
See All Messages3 unread
Notifications
See All Notifications
Search
Damihion
Home
Help Center
Account Settings
Privacy Settings
Use Facebook as Page
Facebook © 2011 · English (US)
About · Advertising · Create a Page · Developers · Careers · Privacy · Terms · Help
what do i do about it | 1 |
10,843,126 | 06/01/2012 00:52:08 | 608,886 | 02/08/2011 22:12:38 | 1,138 | 98 | "Slang" large numbers in php? | Something like this:
echo somefn(2800000000); // outputs '2,8B' for 2,8 billion
echo somefn(2000000); // outputs '2M' for 2 million
echo somefn(5400); // outputs '5,4K' for 5,400
echo somefn('blabla') // outputs 'blabla' as it is because it isn't a number
echo somefn(5) // outputs 5, nothing to simplify
I know it must be really easy code but I wonder if anyone else has something that accounts for maybe other cases that don't pop in my head right now. | php | null | null | null | null | 06/01/2012 08:17:23 | not a real question | "Slang" large numbers in php?
===
Something like this:
echo somefn(2800000000); // outputs '2,8B' for 2,8 billion
echo somefn(2000000); // outputs '2M' for 2 million
echo somefn(5400); // outputs '5,4K' for 5,400
echo somefn('blabla') // outputs 'blabla' as it is because it isn't a number
echo somefn(5) // outputs 5, nothing to simplify
I know it must be really easy code but I wonder if anyone else has something that accounts for maybe other cases that don't pop in my head right now. | 1 |
11,721,517 | 07/30/2012 12:24:38 | 1,376,433 | 05/05/2012 07:30:35 | 1 | 0 | write an simple app using xcap server in iphone |
one week onwords iam searching this problem in google and stackoverflow ,but i can't find any answer.so please send simple program,please help me.
xcap server and xcap client are implementing and write a program in xcode. | iphone | xcode | xmlhttprequest | xml-schema | null | 07/31/2012 05:28:39 | not a real question | write an simple app using xcap server in iphone
===
one week onwords iam searching this problem in google and stackoverflow ,but i can't find any answer.so please send simple program,please help me.
xcap server and xcap client are implementing and write a program in xcode. | 1 |
11,546,289 | 07/18/2012 16:41:52 | 1,535,524 | 07/18/2012 16:36:37 | 1 | 0 | print pages to multiple printer at same time using c# | I want to print pages to to two different printer at same time for example if i have two printer one on the till and one in kitchen.
i would be able to send one page both to kitchen and till printer.
c# winform example would be helpful. | c# | .net | windows | winforms | printing | 07/19/2012 13:22:14 | not a real question | print pages to multiple printer at same time using c#
===
I want to print pages to to two different printer at same time for example if i have two printer one on the till and one in kitchen.
i would be able to send one page both to kitchen and till printer.
c# winform example would be helpful. | 1 |
5,517,274 | 04/01/2011 18:24:03 | 606,769 | 02/07/2011 16:31:23 | 20 | 1 | gcc/g++ versus icc | Which is more popular in the industry software development business? Some people argue gcc/g++ is more popular on linux, while icc is more popular on windows. Anything else to choose one over the other? Thanks. | c++ | g++ | icc | null | null | 04/01/2011 18:39:02 | not constructive | gcc/g++ versus icc
===
Which is more popular in the industry software development business? Some people argue gcc/g++ is more popular on linux, while icc is more popular on windows. Anything else to choose one over the other? Thanks. | 4 |
11,044,273 | 06/15/2012 03:38:12 | 1,397,558 | 05/16/2012 02:30:10 | 6 | 0 | How to test a driver by Visual Studio 2012 command Prompt | I know how to test a WDK driver project by Visual Studio 2012 UI.
but don't know how to test it by the command prompt.
Anybody know that? | visual-studio | testing | driver | wdk | null | 06/16/2012 11:30:48 | not a real question | How to test a driver by Visual Studio 2012 command Prompt
===
I know how to test a WDK driver project by Visual Studio 2012 UI.
but don't know how to test it by the command prompt.
Anybody know that? | 1 |
11,242,860 | 06/28/2012 10:39:49 | 396,757 | 07/20/2010 12:03:31 | 85 | 7 | Steps to recreate SQL Server Instance | I'm writing a disaster recovery protocol at work - a protocol that describes how to create a SQL Server instance from scratch in case that the PROD server will be unavailable.
We have SQL Server 2008 Enterprise.
We have a valid backup procedure but I want to have a document that will describes all the steps.
Do you know/encountered a link/s that specifies all the necessarily steps to create a duplicate SQL Server based on an old server?
I need that it will be identical in all its components of the instance (I'm not talking about the installation of the Server / cluster)
I'm talking about components such as:
- Database
- Jobs
- Server configuration attributes (sp_configure)
- Security objects - Logins, Users, Permission, Credentials and Audit configuration
- Other objects such as Linked servers, Mail profiles
- Replication information
The reason I'm looking for such thing is becuase:
1. I don't want to strat with nothing. I guess that the basic is written somewhere online.
2. It's a good way to verify that I haven't forggoten anything.
An example for a nice post I've found regarding Logins, Users and permissions:
http://johnsterrett.com/2012/01/24/8-steps-to-moving-database-users-from-sql-2005-to-sql-2008/
Thanks in advance,
Roni | sql-server | database | sql-server-2008 | disaster-recovery | null | 06/28/2012 12:45:58 | off topic | Steps to recreate SQL Server Instance
===
I'm writing a disaster recovery protocol at work - a protocol that describes how to create a SQL Server instance from scratch in case that the PROD server will be unavailable.
We have SQL Server 2008 Enterprise.
We have a valid backup procedure but I want to have a document that will describes all the steps.
Do you know/encountered a link/s that specifies all the necessarily steps to create a duplicate SQL Server based on an old server?
I need that it will be identical in all its components of the instance (I'm not talking about the installation of the Server / cluster)
I'm talking about components such as:
- Database
- Jobs
- Server configuration attributes (sp_configure)
- Security objects - Logins, Users, Permission, Credentials and Audit configuration
- Other objects such as Linked servers, Mail profiles
- Replication information
The reason I'm looking for such thing is becuase:
1. I don't want to strat with nothing. I guess that the basic is written somewhere online.
2. It's a good way to verify that I haven't forggoten anything.
An example for a nice post I've found regarding Logins, Users and permissions:
http://johnsterrett.com/2012/01/24/8-steps-to-moving-database-users-from-sql-2005-to-sql-2008/
Thanks in advance,
Roni | 2 |
11,065,910 | 06/16/2012 18:14:32 | 1,460,810 | 06/16/2012 15:30:57 | 1 | 0 | Fixed position with long content sidebar | I have website with long sidebar (content heigher than one browser 'screen'). What I need is:
- when scrolling down the page we also scroll sidebar (as it was static position)
- when bottom of the screen reaches bottom of sidebar we start to drag it (sidebar position fixed to bottom)
- after we drag it for some time, when scrolling up, again scroll it like static position
- when top of the screen reaches top of sidebar we start to drag it up with us until it reaches its sarting point in which it should reamin(position fixed to top)
I've been searching for solutions and also tried doing it with jquery but nothing worked for me. Any suggestions what should I use?
Link: [http://savicky.pl/etno/](http://savicky.pl/etno/) | jquery | html | css | position-fixed | null | null | open | Fixed position with long content sidebar
===
I have website with long sidebar (content heigher than one browser 'screen'). What I need is:
- when scrolling down the page we also scroll sidebar (as it was static position)
- when bottom of the screen reaches bottom of sidebar we start to drag it (sidebar position fixed to bottom)
- after we drag it for some time, when scrolling up, again scroll it like static position
- when top of the screen reaches top of sidebar we start to drag it up with us until it reaches its sarting point in which it should reamin(position fixed to top)
I've been searching for solutions and also tried doing it with jquery but nothing worked for me. Any suggestions what should I use?
Link: [http://savicky.pl/etno/](http://savicky.pl/etno/) | 0 |
5,511,254 | 04/01/2011 09:04:04 | 687,273 | 04/01/2011 09:00:12 | 1 | 0 | c++ program a problem .please seee | <html>
<body>
Hi Guys!!!<br>
I am stuck with a c++ program which is an assignment.<br> Please help me out.
Please suggest an approach if possible,<br> <em>thanks in advance</em>
code:
Given two vessels, one of which can accommodate a liters of water and the other which can
accommodate b liters of water, determine the number of steps required to obtain exactly c
liters of water in one of the vessels.
At the beginning both vessels are empty. The following operations are counted as 'steps':
• emptying a vessel,
• filling a vessel,
• pouring water from one vessel to the other, without spilling, until one of the vessels is
either full or empty.
Input
An integer t, 1<=t<=100, denoting the number of test cases, followed by t sets of input data,
each consisting of three positive integers a (the number of liters the first container can hold),
b (the number of liters the second container can hold), and c (the final amount of liters of
water one vessel should contain), not larger than 40000, given in separate lines.
</body>
</html> | c++ | null | null | null | null | null | open | c++ program a problem .please seee
===
<html>
<body>
Hi Guys!!!<br>
I am stuck with a c++ program which is an assignment.<br> Please help me out.
Please suggest an approach if possible,<br> <em>thanks in advance</em>
code:
Given two vessels, one of which can accommodate a liters of water and the other which can
accommodate b liters of water, determine the number of steps required to obtain exactly c
liters of water in one of the vessels.
At the beginning both vessels are empty. The following operations are counted as 'steps':
• emptying a vessel,
• filling a vessel,
• pouring water from one vessel to the other, without spilling, until one of the vessels is
either full or empty.
Input
An integer t, 1<=t<=100, denoting the number of test cases, followed by t sets of input data,
each consisting of three positive integers a (the number of liters the first container can hold),
b (the number of liters the second container can hold), and c (the final amount of liters of
water one vessel should contain), not larger than 40000, given in separate lines.
</body>
</html> | 0 |
5,605,090 | 04/09/2011 12:42:42 | 699,946 | 04/09/2011 12:42:42 | 1 | 0 | neuralnet package fitted values issue | The problem I've encountered after trying to train neural networks isn't a new one : The fitted values I'm getting are all the same. Here's some oversimplified code as an example:
`a<-c( 123, 223, 234, 226, 60)
b<-c(60, 90, 53, 54, 91)
d<-c(40,100,207,290,241)
q<-cbind(a,b,d)
nn<-neuralnet(a~b+d,data=q,hidden=2,threshold=0.01,err.fc="sse")
nn$net.result`
Previous answers I have stumbled upon suggest using nnet instead. I am getting the same results though, unless I set the decay argument to a value not equal to 0. Instead of blindly using the decay option, just because it seems to "work" though, I would appreciate understanding what goes wrong with my neuralnet model to begin with.
Thank you in advance,
Nishi | r | null | null | null | null | null | open | neuralnet package fitted values issue
===
The problem I've encountered after trying to train neural networks isn't a new one : The fitted values I'm getting are all the same. Here's some oversimplified code as an example:
`a<-c( 123, 223, 234, 226, 60)
b<-c(60, 90, 53, 54, 91)
d<-c(40,100,207,290,241)
q<-cbind(a,b,d)
nn<-neuralnet(a~b+d,data=q,hidden=2,threshold=0.01,err.fc="sse")
nn$net.result`
Previous answers I have stumbled upon suggest using nnet instead. I am getting the same results though, unless I set the decay argument to a value not equal to 0. Instead of blindly using the decay option, just because it seems to "work" though, I would appreciate understanding what goes wrong with my neuralnet model to begin with.
Thank you in advance,
Nishi | 0 |
874,719 | 05/17/2009 14:25:35 | 22,076 | 09/25/2008 09:44:49 | 3,208 | 100 | return value optimization? | Is there other technique like RVO(return value optimization),NRVO(named return value optimization) that can be use with VC2008? | c++ | optimization | vc8 | rvo | nrvo | null | open | return value optimization?
===
Is there other technique like RVO(return value optimization),NRVO(named return value optimization) that can be use with VC2008? | 0 |
10,052,467 | 04/07/2012 06:56:55 | 1,299,938 | 03/29/2012 05:54:38 | 21 | 0 | How to exclude particular axis from accelerometer code? | I am using the accelerometer function in my project and I need to exclude certain axises from the code. I want to exclude Y & Z and only use X. Thanks
Here is the code I'm using.
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{
double const kThreshold = 1.5;
// double const kThreshold = 2.0;
if ( fabsf(acceleration.x) > kThreshold
|| fabsf(acceleration.y) > kThreshold
|| fabsf(acceleration.z) > kThreshold)
| iphone | ios | xcode | axis | accelerometer | null | open | How to exclude particular axis from accelerometer code?
===
I am using the accelerometer function in my project and I need to exclude certain axises from the code. I want to exclude Y & Z and only use X. Thanks
Here is the code I'm using.
-(void)accelerometer:(UIAccelerometer *)accelerometer didAccelerate:(UIAcceleration *)acceleration{
double const kThreshold = 1.5;
// double const kThreshold = 2.0;
if ( fabsf(acceleration.x) > kThreshold
|| fabsf(acceleration.y) > kThreshold
|| fabsf(acceleration.z) > kThreshold)
| 0 |
10,125,244 | 04/12/2012 14:07:42 | 1,317,732 | 04/06/2012 15:14:52 | 8 | 0 | Is it possible to acquire less than a degree accuracy in iOS compass heading? | Basically I want to know the direction iPhone is pointing with high precision, I tried CLLocationManager, the problem is the CLHeading.magneticHeading returns a double for example 36.44323 but then when I start turning the device CLLocationManager only updates the direction when it reaches 1 degree, so the numbers read like this : 36.44323 37.44323 38.44323 and so on. Is it possible to have more accuracy? | ios | compass-geolocation | accuracy | heading | magnetic | null | open | Is it possible to acquire less than a degree accuracy in iOS compass heading?
===
Basically I want to know the direction iPhone is pointing with high precision, I tried CLLocationManager, the problem is the CLHeading.magneticHeading returns a double for example 36.44323 but then when I start turning the device CLLocationManager only updates the direction when it reaches 1 degree, so the numbers read like this : 36.44323 37.44323 38.44323 and so on. Is it possible to have more accuracy? | 0 |
4,754,549 | 01/21/2011 01:27:52 | 583,835 | 01/21/2011 01:27:52 | 1 | 0 | c program output the highest and lowest in an array of numbers | help on solving c programming problem about arrays, wherein the highest and lowest number should be the output, this is among an array of numbers which is user input | c | null | null | null | null | 01/21/2011 01:46:02 | not a real question | c program output the highest and lowest in an array of numbers
===
help on solving c programming problem about arrays, wherein the highest and lowest number should be the output, this is among an array of numbers which is user input | 1 |
2,549,314 | 03/30/2010 23:04:58 | 293,185 | 03/13/2010 23:23:37 | 23 | 1 | Getting an array back from php using $.ajax | A php script is giving this array (which has been passed through <code>json_encode()</code>)
<code>[{name:"a1",path:"b1"},{name:"a2",path:"b2"}]</code>
I use the following function to retrieve the array to jquery:
$.ajax({
type: "POST",
url: "functions.php",
data: "action=" + something,
cache: false,
success: function(response) { alert(response); }
});
The problem is I get the array back as a string:
<code>(new String("[{name:"a1",path:"b1"},{name:"a2",path:"b2"}}]"))</code>
How can I get it to be a javascript array?
Help would be much appreciated.
| jquery | null | null | null | null | null | open | Getting an array back from php using $.ajax
===
A php script is giving this array (which has been passed through <code>json_encode()</code>)
<code>[{name:"a1",path:"b1"},{name:"a2",path:"b2"}]</code>
I use the following function to retrieve the array to jquery:
$.ajax({
type: "POST",
url: "functions.php",
data: "action=" + something,
cache: false,
success: function(response) { alert(response); }
});
The problem is I get the array back as a string:
<code>(new String("[{name:"a1",path:"b1"},{name:"a2",path:"b2"}}]"))</code>
How can I get it to be a javascript array?
Help would be much appreciated.
| 0 |
5,645,258 | 04/13/2011 06:28:57 | 196,921 | 10/26/2009 21:41:28 | 2,530 | 79 | Google doesn't follow W3C standards... whaaa? | A friend of mine just pointed out an interesting phenomenon... I went to the [Google home page][1] and looked at the source code:
<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title>
...
...
...
A LOT OF STUFF HERE
...
...
...
</script>
... so I noticed that source code doesn't have the closing `</body>` and `</html>` tags. Using Chrome's Inspector, it shows the closing tags but when I right click and look at the source, its not there.
What is going on here? Am I missing something? I tried using the [W3C HTML Validator][2] and it showed a bunch of errors...
http://validator.w3.org/check?verbose=1&uri=http://www.google.com/
So... what's the deal?
Thanks :)
Hristo
[1]: http://www.google.com/
[2]: http://validator.w3.org/ | html | validation | google | w3c | web-standards | 04/15/2011 08:35:44 | not constructive | Google doesn't follow W3C standards... whaaa?
===
A friend of mine just pointed out an interesting phenomenon... I went to the [Google home page][1] and looked at the source code:
<!doctype html><html><head><meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Google</title>
...
...
...
A LOT OF STUFF HERE
...
...
...
</script>
... so I noticed that source code doesn't have the closing `</body>` and `</html>` tags. Using Chrome's Inspector, it shows the closing tags but when I right click and look at the source, its not there.
What is going on here? Am I missing something? I tried using the [W3C HTML Validator][2] and it showed a bunch of errors...
http://validator.w3.org/check?verbose=1&uri=http://www.google.com/
So... what's the deal?
Thanks :)
Hristo
[1]: http://www.google.com/
[2]: http://validator.w3.org/ | 4 |
10,722,217 | 05/23/2012 14:37:03 | 989,571 | 10/11/2011 13:09:21 | 1 | 0 | How to update content in Row after selection in dojo datagrid | Have created one dojo datagrid. Every column has formatter attached to it. When grid is generated formatter is called. Now i want that if user select any row and formatter will be called, some strings should be attached to selected row's column element.
Like grid is like this :-
COLUMN
-------
a </br>
b
c
and now user select 2nd row grid should change to :-
COLUMN
-------
a
b SELECTED
c
Currently I implemented like this :-
if(this.grid.selection.selectedIndex !== -1){
retrun value + "SELECTED";
}else{
return value;
}
Can you please suggest me some good way of doing this. Please note that "SELECTED" string should not be added to grid store. | datagrid | dojo | selection | null | null | null | open | How to update content in Row after selection in dojo datagrid
===
Have created one dojo datagrid. Every column has formatter attached to it. When grid is generated formatter is called. Now i want that if user select any row and formatter will be called, some strings should be attached to selected row's column element.
Like grid is like this :-
COLUMN
-------
a </br>
b
c
and now user select 2nd row grid should change to :-
COLUMN
-------
a
b SELECTED
c
Currently I implemented like this :-
if(this.grid.selection.selectedIndex !== -1){
retrun value + "SELECTED";
}else{
return value;
}
Can you please suggest me some good way of doing this. Please note that "SELECTED" string should not be added to grid store. | 0 |
11,510,456 | 07/16/2012 18:38:24 | 1,172,624 | 01/27/2012 02:02:31 | 22 | 0 | Examples of Sinatra + Postgres + Activerecord apps | I know this is kind of specific, but does anyone know of any example apps that use Sinatra, Postgres and Active record that I can take a look at on github or something?
Thanks! | ruby | postgresql | activerecord | sinatra | null | 07/19/2012 02:04:48 | not constructive | Examples of Sinatra + Postgres + Activerecord apps
===
I know this is kind of specific, but does anyone know of any example apps that use Sinatra, Postgres and Active record that I can take a look at on github or something?
Thanks! | 4 |
9,240,262 | 02/11/2012 12:37:01 | 1,200,160 | 02/09/2012 16:41:01 | 3 | 0 | How to solve a error when I call the method [self somemethod] | I have this code:
.m
-(void)viewDidLoad{
NSMutableArray *array = [[NSMutableArray alloc]init];
[self addToArray];
}
-(void)addToArray{
//some code here…
}
When I call the method addToArray it keeps returning me an error called "Thread 1: Program recived signal"EXC_BAD_ACCESS", and the debugger output says : "Single stepping until exit from function objc_msgSend, which has no line number information." at the line `[self addToArray]`. Any idea of how to solve it? I have wasted to much time with it, please help me! | iphone | objective-c | ios | ipad | null | null | open | How to solve a error when I call the method [self somemethod]
===
I have this code:
.m
-(void)viewDidLoad{
NSMutableArray *array = [[NSMutableArray alloc]init];
[self addToArray];
}
-(void)addToArray{
//some code here…
}
When I call the method addToArray it keeps returning me an error called "Thread 1: Program recived signal"EXC_BAD_ACCESS", and the debugger output says : "Single stepping until exit from function objc_msgSend, which has no line number information." at the line `[self addToArray]`. Any idea of how to solve it? I have wasted to much time with it, please help me! | 0 |
6,056,451 | 05/19/2011 09:22:00 | 760,747 | 05/19/2011 09:22:00 | 1 | 0 | How to display only the second item from XML with this PHP script? | How to display only the second item from XML with this PHP script?
< xml>
< item>
< name>Examplename< /name>
< amount>0000< /amount>
< /item>
< item>
< name>Examplename< /name>
< amount>0000< /amount>
< /item>
< item>
< name>Examplename< /name>
<amount >0000< /amount>
< /item>
< item>
< name>DExamplename< /name>
< amount>0000< /amount>
< /item>
< /xml>
<?
// DOMElement->getElementsByTagName() -- Gets elements by tagname
// nodeValue : The value of this node, depending on its type.
// Load XML File. You can use loadXML if you wish to load XML data from a string
$objDOM = new DOMDocument();
$objDOM->load("feed.xml"); //make sure path is correct
$note = $objDOM->getElementsByTagName("item");
// for each note tag, parse the document and get values for
// tasks and details tag.
foreach( $note as $value ){
$places = $value->getElementsByTagName("name");
$place = $places->item(0)->nodeValue;
$details = $value->getElementsByTagName("amount");
$detail = $details->item(0)->nodeValue;
echo "<BODY STYLE='background-color:transparent'>
<table border='0'>
<tr>
<td width='127'><table width='127px' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><p style='font-family:arial;color:white;font-size:22px;padding-left:3px;text-align:left; background:url(bg2.png)'><strong> $place</strong></p></td>
</tr>
</table>
</td>
<td width='115'>
<table width='115px' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><p style='font-family:arial;color:white;font-size:22px;text-align:right;padding-right:5px; background:url(bg1.png)'><strong>$detail</strong></p></td>
</tr>
</table></td>
</tr>
</table>
";
$i++; }
?> | php | xml | script | item | null | null | open | How to display only the second item from XML with this PHP script?
===
How to display only the second item from XML with this PHP script?
< xml>
< item>
< name>Examplename< /name>
< amount>0000< /amount>
< /item>
< item>
< name>Examplename< /name>
< amount>0000< /amount>
< /item>
< item>
< name>Examplename< /name>
<amount >0000< /amount>
< /item>
< item>
< name>DExamplename< /name>
< amount>0000< /amount>
< /item>
< /xml>
<?
// DOMElement->getElementsByTagName() -- Gets elements by tagname
// nodeValue : The value of this node, depending on its type.
// Load XML File. You can use loadXML if you wish to load XML data from a string
$objDOM = new DOMDocument();
$objDOM->load("feed.xml"); //make sure path is correct
$note = $objDOM->getElementsByTagName("item");
// for each note tag, parse the document and get values for
// tasks and details tag.
foreach( $note as $value ){
$places = $value->getElementsByTagName("name");
$place = $places->item(0)->nodeValue;
$details = $value->getElementsByTagName("amount");
$detail = $details->item(0)->nodeValue;
echo "<BODY STYLE='background-color:transparent'>
<table border='0'>
<tr>
<td width='127'><table width='127px' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><p style='font-family:arial;color:white;font-size:22px;padding-left:3px;text-align:left; background:url(bg2.png)'><strong> $place</strong></p></td>
</tr>
</table>
</td>
<td width='115'>
<table width='115px' border='0' cellpadding='0' cellspacing='0'>
<tr>
<td><p style='font-family:arial;color:white;font-size:22px;text-align:right;padding-right:5px; background:url(bg1.png)'><strong>$detail</strong></p></td>
</tr>
</table></td>
</tr>
</table>
";
$i++; }
?> | 0 |
7,989,218 | 11/03/2011 01:08:02 | 1,026,067 | 11/02/2011 16:30:06 | 1 | 0 | Two questions about work experience in chronological order resume | So I'm still a college student and am writing my resume, in chronological. My target is a software engineer summer intern, and I decide to put 2 jobs in my resume, along with my other projects. The two jobs are a web developer internship in SF from the past summer, and a CS TA on campus. The TA job I have been working for almost two years, so it is "present", does that mean I have to put this position ahead of my summer intern in my resume? I really want to put my intern first because I have more highlights and it's really more relavent.
Another question, I have these sections, education, work experience, projects, skills, positioning in the sequence I list here. But I'm not sure if I should put skills section at the top of my resume or bottom.
Thanks a lot for your help! | software-engineering | jobs | resume | internship | null | 12/03/2011 08:40:41 | off topic | Two questions about work experience in chronological order resume
===
So I'm still a college student and am writing my resume, in chronological. My target is a software engineer summer intern, and I decide to put 2 jobs in my resume, along with my other projects. The two jobs are a web developer internship in SF from the past summer, and a CS TA on campus. The TA job I have been working for almost two years, so it is "present", does that mean I have to put this position ahead of my summer intern in my resume? I really want to put my intern first because I have more highlights and it's really more relavent.
Another question, I have these sections, education, work experience, projects, skills, positioning in the sequence I list here. But I'm not sure if I should put skills section at the top of my resume or bottom.
Thanks a lot for your help! | 2 |
7,658,464 | 10/05/2011 08:16:21 | 979,875 | 10/05/2011 07:29:04 | 1 | 0 | how to open Task Manager when Pc is Locked Windows 7 | Is there any way out to open Task Manager when Pc is Locked Windows 7, as an we can do this in Window xp i guess.
Thanks | windows | tips-and-tricks | null | null | null | 10/05/2011 16:39:26 | off topic | how to open Task Manager when Pc is Locked Windows 7
===
Is there any way out to open Task Manager when Pc is Locked Windows 7, as an we can do this in Window xp i guess.
Thanks | 2 |
1,074,550 | 07/02/2009 14:03:32 | 129,428 | 06/26/2009 13:34:32 | 1 | 0 | Usage of NMAPI | anybody know about nmapi? How to build for c# or any samples resource? | c# | null | null | null | null | 09/27/2011 12:50:24 | not a real question | Usage of NMAPI
===
anybody know about nmapi? How to build for c# or any samples resource? | 1 |
2,097,647 | 01/19/2010 22:28:52 | 253,395 | 01/18/2010 17:31:54 | 21 | 1 | Why does silverlight exist? | Why not to empower WPF or ASP.NET instead of creating a new product? | silverlight | null | null | null | null | 01/19/2010 22:41:38 | not constructive | Why does silverlight exist?
===
Why not to empower WPF or ASP.NET instead of creating a new product? | 4 |
10,575,358 | 05/13/2012 21:21:34 | 503,649 | 11/10/2010 19:07:19 | 21 | 2 | Symfony 2 + Doctrine 2 + PHPUnit | Have there been any in-depth how-tos on how to go about unit testing doctrine repositories?
I have found http://stackoverflow.com/questions/4366592/symfony-2-doctrine-2-phpunit-3-5-serialization-of-closure-exception but aside from that, there seems to be a relative lack of data.
if that is the case, I will forge ahead and try to document my path, but I wanted to check and see if I was missing anything out there first. | unit-testing | symfony-2.0 | doctrine2 | phpunit | null | 05/14/2012 11:37:14 | not constructive | Symfony 2 + Doctrine 2 + PHPUnit
===
Have there been any in-depth how-tos on how to go about unit testing doctrine repositories?
I have found http://stackoverflow.com/questions/4366592/symfony-2-doctrine-2-phpunit-3-5-serialization-of-closure-exception but aside from that, there seems to be a relative lack of data.
if that is the case, I will forge ahead and try to document my path, but I wanted to check and see if I was missing anything out there first. | 4 |
7,101,354 | 08/18/2011 01:18:58 | 899,718 | 08/18/2011 01:18:58 | 1 | 0 | Solving an equation in Python | i'm trying to solve an equation but I don't know the way to do this. I've got a vector x wich is actually a matrix type and I would like to solve the equation x.transpose()*v=0 where v is another vector
Can someone help me?
I thank you in advance | python | equation-solving | null | null | null | 08/18/2011 12:09:31 | not a real question | Solving an equation in Python
===
i'm trying to solve an equation but I don't know the way to do this. I've got a vector x wich is actually a matrix type and I would like to solve the equation x.transpose()*v=0 where v is another vector
Can someone help me?
I thank you in advance | 1 |
8,506,945 | 12/14/2011 15:19:12 | 370,103 | 06/18/2010 08:20:04 | 8,726 | 330 | Get frame width/height of an mp4 file | Is it possible to get the frame width & height of an .mp4 file using ASP.NET?
I know how I can get the width & height of an image (by using a Bitmap object), but I'm not sure whether this is possible with video formats.
I'm using JWPlayer to display uploaded videos through the web application, and I want to set the width/height as a proportion of the actual video width/height. | asp.net | video | height | width | jwplayer | null | open | Get frame width/height of an mp4 file
===
Is it possible to get the frame width & height of an .mp4 file using ASP.NET?
I know how I can get the width & height of an image (by using a Bitmap object), but I'm not sure whether this is possible with video formats.
I'm using JWPlayer to display uploaded videos through the web application, and I want to set the width/height as a proportion of the actual video width/height. | 0 |
6,808,352 | 07/24/2011 17:15:00 | 438,822 | 09/03/2010 09:38:01 | 196 | 0 | Non-type function template parameters | I am reading C++ Templates Complete Guide and came across this non-type function template parameters code (I have added the main() and other parts except the function definition and call):
#include <vector>
#include <algorithm>
#include <iostream>
template <typename T, int value>
T add (T const & element){
return element + value;
}
int main() {
int a[] = {1,2,3,4};
int length = sizeof (a) / sizeof (*a);
int b[length];
std::transform (a, a + length, b, (int(*)(int const &))add <int, 5>); //why?
std::for_each (b, b + length, [](int const & value){ std::cout << value << '\n'; });
return 0;
}
I did not understand after reading from the book why we need typecasting of the function call? | c++ | function-templates | null | null | null | null | open | Non-type function template parameters
===
I am reading C++ Templates Complete Guide and came across this non-type function template parameters code (I have added the main() and other parts except the function definition and call):
#include <vector>
#include <algorithm>
#include <iostream>
template <typename T, int value>
T add (T const & element){
return element + value;
}
int main() {
int a[] = {1,2,3,4};
int length = sizeof (a) / sizeof (*a);
int b[length];
std::transform (a, a + length, b, (int(*)(int const &))add <int, 5>); //why?
std::for_each (b, b + length, [](int const & value){ std::cout << value << '\n'; });
return 0;
}
I did not understand after reading from the book why we need typecasting of the function call? | 0 |
4,957,878 | 02/10/2011 13:49:55 | 310,262 | 04/06/2010 17:36:27 | 274 | 19 | Adding UINavigationController to existing UIViewController | How to add possibility for existing UIViewController (which is presented using presentModalViewController) of UINavigationController?
When user tap on button, new detail view need to be pushed (pushViewController calling pushViewController).
Easiest way to enable this functionality? | iphone | xcode | uiviewcontroller | uinavigationcontroller | null | null | open | Adding UINavigationController to existing UIViewController
===
How to add possibility for existing UIViewController (which is presented using presentModalViewController) of UINavigationController?
When user tap on button, new detail view need to be pushed (pushViewController calling pushViewController).
Easiest way to enable this functionality? | 0 |
5,059,022 | 02/20/2011 18:26:25 | 191,372 | 10/16/2009 18:30:30 | 28 | 0 | How to build a media streaming server | We'd like to build a media streaming server and would like to know the strategies when it comes to choose the hardware and software.
Some of our requirements:
- We host everything ourselves
- Bandwidth is not an issue (we got good backings)
- Commodity hardware (no expensive NAS, SANs)
- Support large files
- Prefer not to use Flash Media Server
The situation here is a little bit different than what some of you guys might have experienced before. The cost of a professional system-admin and developers are way much cheaper than signing a contract with hardware or software vendors in storage solutions area. The way we scale is by buying cheap commodity hardware and (probably) build the infrastructure ourselves using varieties of open source software.
We're looking at a varieties of distributed file systems for storage such as MogileFS, GlusterFS, HDFS and it looks like HDFS might be the front runner.
Please share your experience if you've built something similar before.
Thanks! | streaming | distributed | media | null | null | 07/22/2012 02:53:10 | off topic | How to build a media streaming server
===
We'd like to build a media streaming server and would like to know the strategies when it comes to choose the hardware and software.
Some of our requirements:
- We host everything ourselves
- Bandwidth is not an issue (we got good backings)
- Commodity hardware (no expensive NAS, SANs)
- Support large files
- Prefer not to use Flash Media Server
The situation here is a little bit different than what some of you guys might have experienced before. The cost of a professional system-admin and developers are way much cheaper than signing a contract with hardware or software vendors in storage solutions area. The way we scale is by buying cheap commodity hardware and (probably) build the infrastructure ourselves using varieties of open source software.
We're looking at a varieties of distributed file systems for storage such as MogileFS, GlusterFS, HDFS and it looks like HDFS might be the front runner.
Please share your experience if you've built something similar before.
Thanks! | 2 |
5,737,779 | 04/20/2011 23:25:15 | 679,339 | 03/27/2011 20:58:11 | 16 | 0 | iPhone app review question (UI related) | We just submitted an app for App Store review. A couple of our buttons (namely, login and sign up, which are really only used once per user) do not blink/change color when touched. Are these strong enough reasons for the app to be rejected? | iphone | ios | app-store | appstore-approval | null | 04/21/2011 21:28:45 | off topic | iPhone app review question (UI related)
===
We just submitted an app for App Store review. A couple of our buttons (namely, login and sign up, which are really only used once per user) do not blink/change color when touched. Are these strong enough reasons for the app to be rejected? | 2 |
2,077,074 | 01/16/2010 10:58:33 | 8,206 | 09/15/2008 15:24:06 | 11,695 | 396 | Understanding the C function call prolog with __cdecl on windows | Compiling this simple function with MSVC2008, in Debug mode:
int __cdecl sum(int a, int b)
{
return a + b;
}
I get the following disassembly listing:
int __cdecl sum(int a, int b)
{
004113B0 push ebp
004113B1 mov ebp,esp
004113B3 sub esp,0C0h
004113B9 push ebx
004113BA push esi
004113BB push edi
004113BC lea edi,[ebp-0C0h]
004113C2 mov ecx,30h
004113C7 mov eax,0CCCCCCCCh
004113CC rep stos dword ptr es:[edi]
return a + b;
004113CE mov eax,dword ptr [a]
004113D1 add eax,dword ptr [b]
}
004113D4 pop edi
004113D5 pop esi
004113D6 pop ebx
004113D7 mov esp,ebp
004113D9 pop ebp
004113DA ret
There are some parts of the prolog I don't understand:
004113BC lea edi,[ebp-0C0h]
004113C2 mov ecx,30h
004113C7 mov eax,0CCCCCCCCh
004113CC rep stos dword ptr es:[edi]
Why is this required?
| c | assembly | disassembling | null | null | null | open | Understanding the C function call prolog with __cdecl on windows
===
Compiling this simple function with MSVC2008, in Debug mode:
int __cdecl sum(int a, int b)
{
return a + b;
}
I get the following disassembly listing:
int __cdecl sum(int a, int b)
{
004113B0 push ebp
004113B1 mov ebp,esp
004113B3 sub esp,0C0h
004113B9 push ebx
004113BA push esi
004113BB push edi
004113BC lea edi,[ebp-0C0h]
004113C2 mov ecx,30h
004113C7 mov eax,0CCCCCCCCh
004113CC rep stos dword ptr es:[edi]
return a + b;
004113CE mov eax,dword ptr [a]
004113D1 add eax,dword ptr [b]
}
004113D4 pop edi
004113D5 pop esi
004113D6 pop ebx
004113D7 mov esp,ebp
004113D9 pop ebp
004113DA ret
There are some parts of the prolog I don't understand:
004113BC lea edi,[ebp-0C0h]
004113C2 mov ecx,30h
004113C7 mov eax,0CCCCCCCCh
004113CC rep stos dword ptr es:[edi]
Why is this required?
| 0 |
10,552,884 | 05/11/2012 14:02:10 | 1,389,504 | 05/11/2012 13:04:05 | 1 | 0 | Why do a C++ regular expression code that works with "cmatch" raises an exception with "smatch"? | I am new to C++ regular expressions and cannot make them work with strings instead of char*. The examples I have seen so far were always for c strings.
My real program, which I will not even try to show here, uses sub matches but I could not
make them work, so I tried to modify a very simple working example but it does not work either. I use Visual Studio 2010 Ultimate.
The original - working - code:
const char *first = "abcd";
const char *last = first + strlen(first);
std::cmatch mr;
std::regex rx("abc");
std::regex_constants::match_flag_type fl = std::regex_constants::match_default;
std::cout << "search(f, l, \"abc\") == " << std::boolalpha
<< regex_search(first, last, mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
std::cout << "search(\"xabcd\", \"abc\") == " << std::boolalpha
<< regex_search("xabcd", mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
The modified code:
const string first = "abcd"; // char * => string
std::smatch mr; // cmatch => smatch
std::regex rx(string("abc"));
std::regex_constants::match_flag_type fl = std::regex_constants::match_default;
// this works:
std::cout << "search(f, l, \"abc\") == " << std::boolalpha
<< regex_search(first, mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
// after the next line executes mr seems good to me:
// mr[0] = {3, matched:true, first="abcd", second="d",...}
std::cout << "search(\"xabcd\", \"abc\") == " << std::boolalpha
<< regex_search(string("xabcd"), mr, rx) << std::endl;
// but the following line gives the error
// "Debug assertion failed"
// Expression: string iterators incompatible
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
Strange that one part of the modified code works, while the next part causes an exception. I even tried to use mr[0].str() but I got the same error message. Could you help me to solve this problem? | c++ | regex | visual-studio-2010 | null | null | null | open | Why do a C++ regular expression code that works with "cmatch" raises an exception with "smatch"?
===
I am new to C++ regular expressions and cannot make them work with strings instead of char*. The examples I have seen so far were always for c strings.
My real program, which I will not even try to show here, uses sub matches but I could not
make them work, so I tried to modify a very simple working example but it does not work either. I use Visual Studio 2010 Ultimate.
The original - working - code:
const char *first = "abcd";
const char *last = first + strlen(first);
std::cmatch mr;
std::regex rx("abc");
std::regex_constants::match_flag_type fl = std::regex_constants::match_default;
std::cout << "search(f, l, \"abc\") == " << std::boolalpha
<< regex_search(first, last, mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
std::cout << "search(\"xabcd\", \"abc\") == " << std::boolalpha
<< regex_search("xabcd", mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
The modified code:
const string first = "abcd"; // char * => string
std::smatch mr; // cmatch => smatch
std::regex rx(string("abc"));
std::regex_constants::match_flag_type fl = std::regex_constants::match_default;
// this works:
std::cout << "search(f, l, \"abc\") == " << std::boolalpha
<< regex_search(first, mr, rx) << std::endl;
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
// after the next line executes mr seems good to me:
// mr[0] = {3, matched:true, first="abcd", second="d",...}
std::cout << "search(\"xabcd\", \"abc\") == " << std::boolalpha
<< regex_search(string("xabcd"), mr, rx) << std::endl;
// but the following line gives the error
// "Debug assertion failed"
// Expression: string iterators incompatible
std::cout << " matched: \"" << mr.str() << "\"" << std::endl;
Strange that one part of the modified code works, while the next part causes an exception. I even tried to use mr[0].str() but I got the same error message. Could you help me to solve this problem? | 0 |
6,775,773 | 07/21/2011 12:08:54 | 141,302 | 07/20/2009 10:12:25 | 1,731 | 59 | what are the advantages of using HTML5 in Mobile? | what are the adavantages of HTML 5 in mobile(iphone)? can we access device features(camera,etc) through it using browser?Why should we use HTML 5 in mobile?
| iphone | ipad | html5 | mobile | null | 03/07/2012 21:56:25 | not constructive | what are the advantages of using HTML5 in Mobile?
===
what are the adavantages of HTML 5 in mobile(iphone)? can we access device features(camera,etc) through it using browser?Why should we use HTML 5 in mobile?
| 4 |
3,683,468 | 09/10/2010 09:20:46 | 244,681 | 01/06/2010 12:07:18 | 52 | 4 | Recommend PHP Resources? | I fear this question may be a little too broad but I thought it would be worth a go.
Can anyone recommend any decent podcasts or articles related to PHP? There seems to be so many thing's for beginners and people trying to transition into an intermediate level however I have struggled to find much for professionals.
Something that discusses new language features, advanced development topics such as design patterns etc. Just something that makes you think.
Any recommendations would be much appreciated. | php | online-resources | null | null | null | 06/11/2012 08:26:31 | not constructive | Recommend PHP Resources?
===
I fear this question may be a little too broad but I thought it would be worth a go.
Can anyone recommend any decent podcasts or articles related to PHP? There seems to be so many thing's for beginners and people trying to transition into an intermediate level however I have struggled to find much for professionals.
Something that discusses new language features, advanced development topics such as design patterns etc. Just something that makes you think.
Any recommendations would be much appreciated. | 4 |
1,351,755 | 08/29/2009 15:55:41 | 44,085 | 12/07/2008 12:19:49 | 15 | 3 | Continuous integration - Best practices | I've been thinking about CI and automatic builds a lot lately and thought it would be interested in knowing if there are any best practices for setting up and maintaining a continuous integration environment? Do you keep all your CI related files checked in with your project source? How would you usually structure your CI and build files? Any tips are welcome! | continuous-integration | build-automation | null | null | null | 05/29/2012 06:06:11 | not constructive | Continuous integration - Best practices
===
I've been thinking about CI and automatic builds a lot lately and thought it would be interested in knowing if there are any best practices for setting up and maintaining a continuous integration environment? Do you keep all your CI related files checked in with your project source? How would you usually structure your CI and build files? Any tips are welcome! | 4 |
8,791,476 | 01/09/2012 16:12:39 | 1,139,083 | 01/09/2012 16:03:23 | 1 | 0 | If facebook is no longer supporting fbml / xfbml and the event handlers provided for them then what is the alternative for iframes? | Facebook currently has event handlers for facebook events such as like / recommend. But this is available only for xfbml version of the code. Since facebook is no longer supporting fbml / xfbml ([http://www.allfacebook.com/facebook-markup-language-support-ends-jan-1-2011-12][1]) how do we listen to events on iframes? You cannot use javascript methods listening to ids onclick and etc, esp for iframes owned by facebook / twitter. Is there any other solution to this?
[1]: http://www.allfacebook.com/facebook-markup-language-support-ends-jan-1-2011-12 | events | iframe | fbml | xfbml | handlers | null | open | If facebook is no longer supporting fbml / xfbml and the event handlers provided for them then what is the alternative for iframes?
===
Facebook currently has event handlers for facebook events such as like / recommend. But this is available only for xfbml version of the code. Since facebook is no longer supporting fbml / xfbml ([http://www.allfacebook.com/facebook-markup-language-support-ends-jan-1-2011-12][1]) how do we listen to events on iframes? You cannot use javascript methods listening to ids onclick and etc, esp for iframes owned by facebook / twitter. Is there any other solution to this?
[1]: http://www.allfacebook.com/facebook-markup-language-support-ends-jan-1-2011-12 | 0 |
11,318,085 | 07/03/2012 19:45:36 | 127,896 | 06/23/2009 22:33:32 | 364 | 1 | IE9 displaying all text as bold | I have a wordpress project and when viewed in IE9 all of the text is bold no matter what it's actually set to. I have tried fixing the font files but nothing changed. Why is this only happening in IE? How do I fix it? | wordpress | internet-explorer-9 | font-bold | null | null | 07/04/2012 20:44:53 | off topic | IE9 displaying all text as bold
===
I have a wordpress project and when viewed in IE9 all of the text is bold no matter what it's actually set to. I have tried fixing the font files but nothing changed. Why is this only happening in IE? How do I fix it? | 2 |
3,594,902 | 08/29/2010 13:21:03 | 434,228 | 08/29/2010 13:21:03 | 1 | 0 | Find and replce string | This is my name. Is 1 string in it find is and replce it by was. Please replace is by was. Justify proof by dig. | string | null | null | null | null | 08/29/2010 13:26:13 | not a real question | Find and replce string
===
This is my name. Is 1 string in it find is and replce it by was. Please replace is by was. Justify proof by dig. | 1 |
3,891,011 | 10/08/2010 13:31:27 | 186,658 | 10/08/2009 19:14:58 | 55 | 3 | asp.net breadcrumb | What I want to do is a simple breadcrumb which I have accomplish this with Web.sitemap
Home--> page1 --> page2
**What I need to do**
If I navigate to *page1.aspx?param=value* and after this I go to *page2.aspx*
the breadcrumb shows Home--> page1 --> page2 in which, if I click *Page1* it redirects me to page1.aspx but how could I retrieve the given variables from page1.aspx, so to be redirected to *page1.aspx?param=value*?
Thanks
| asp.net | null | null | null | null | null | open | asp.net breadcrumb
===
What I want to do is a simple breadcrumb which I have accomplish this with Web.sitemap
Home--> page1 --> page2
**What I need to do**
If I navigate to *page1.aspx?param=value* and after this I go to *page2.aspx*
the breadcrumb shows Home--> page1 --> page2 in which, if I click *Page1* it redirects me to page1.aspx but how could I retrieve the given variables from page1.aspx, so to be redirected to *page1.aspx?param=value*?
Thanks
| 0 |
11,386,691 | 07/08/2012 21:03:49 | 1,510,564 | 07/08/2012 20:58:56 | 1 | 0 | failsafe reboot after remote linux server upgrade | Occasionally my (ubuntu) server upgrades fail. Recently due to some weird keymap cache not found by console-tools. So I had to put my sneakers on.
Is there a way to predict these errors or test if they might occur?
In this case the boot process stopped before sshd (or similar) was started and
on the console the message press control-D to proceed.
Is there a way to force the boot up to ignore these errors? | linux | boot | reboot | null | null | 07/09/2012 00:34:13 | off topic | failsafe reboot after remote linux server upgrade
===
Occasionally my (ubuntu) server upgrades fail. Recently due to some weird keymap cache not found by console-tools. So I had to put my sneakers on.
Is there a way to predict these errors or test if they might occur?
In this case the boot process stopped before sshd (or similar) was started and
on the console the message press control-D to proceed.
Is there a way to force the boot up to ignore these errors? | 2 |
11,609,855 | 07/23/2012 09:32:30 | 1,158,895 | 01/19/2012 16:00:35 | 2,819 | 162 | How do I append a colon 0, :0 onto the end of an IP address string? | I have a simple Linux shell script that parses a file generated in windows that is shared with a Linux VM. I would like to obtain an IP address from this file and append a colon 0 (:0) on the end, so as to set the DISPLAY environment variable. When I try to do so, I get strange results.
Here is the script:
#!/bin/bash
LOCAL_HOST=`grep IPv4 /mnt/hgfs/share/localip | awk 'NR ==1 {printf "%s\n", $14 }'`
# for some reason, it overwrites the string from the beginning
COLON_ZERO=':0'
export DISPLAY=${LOCAL_HOST}${COLON_ZERO}
echo $DISPLAY
# This obviously works, but doesnt have the COLON_ZERO on the end
echo "export DISPLAY="$LOCAL_HOST
And here is the output of running this script:
# ./display.sh
:09.107.26.25
export DISPLAY=159.107.26.25
# bash --version
GNU bash, version 3.2.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
And just in case its necessary, here is the result of the grep from the file used in the script:
# grep IPv4 /mnt/hgfs/share/localip
IPv4 Address. . . . . . . . . . . : 159.107.26.25
IPv4 Address. . . . . . . . . . . : 192.168.223.1
IPv4 Address. . . . . . . . . . . : 192.168.132.1
Why do I get this strange result when I append the colon zero onto the end of the IP address string? How can I change the script to get the correct result?
| linux | string | bash | shell | null | null | open | How do I append a colon 0, :0 onto the end of an IP address string?
===
I have a simple Linux shell script that parses a file generated in windows that is shared with a Linux VM. I would like to obtain an IP address from this file and append a colon 0 (:0) on the end, so as to set the DISPLAY environment variable. When I try to do so, I get strange results.
Here is the script:
#!/bin/bash
LOCAL_HOST=`grep IPv4 /mnt/hgfs/share/localip | awk 'NR ==1 {printf "%s\n", $14 }'`
# for some reason, it overwrites the string from the beginning
COLON_ZERO=':0'
export DISPLAY=${LOCAL_HOST}${COLON_ZERO}
echo $DISPLAY
# This obviously works, but doesnt have the COLON_ZERO on the end
echo "export DISPLAY="$LOCAL_HOST
And here is the output of running this script:
# ./display.sh
:09.107.26.25
export DISPLAY=159.107.26.25
# bash --version
GNU bash, version 3.2.48(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
And just in case its necessary, here is the result of the grep from the file used in the script:
# grep IPv4 /mnt/hgfs/share/localip
IPv4 Address. . . . . . . . . . . : 159.107.26.25
IPv4 Address. . . . . . . . . . . : 192.168.223.1
IPv4 Address. . . . . . . . . . . : 192.168.132.1
Why do I get this strange result when I append the colon zero onto the end of the IP address string? How can I change the script to get the correct result?
| 0 |
3,278,027 | 07/19/2010 01:54:21 | 320,161 | 04/19/2010 09:02:02 | 13 | 1 | A Programmer's Most Productive Time of the Day? | I'm just wondering. At what time of the day is a programmer most productive? If there is such a "productive time" or i.e. "intellectual-peak time" are there any scientific researches done to find this out?
Thanks! | project-management | productivity | programming | workplace | null | 07/19/2010 02:09:11 | off topic | A Programmer's Most Productive Time of the Day?
===
I'm just wondering. At what time of the day is a programmer most productive? If there is such a "productive time" or i.e. "intellectual-peak time" are there any scientific researches done to find this out?
Thanks! | 2 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.