PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
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 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,350,761 | 07/05/2012 18:56:59 | 1,186,173 | 02/02/2012 21:20:34 | 52 | 3 | Moving files and directories in svn using pysvn & python | I want to be able to move the contents of an svn repository directory into a subdirectory of the specified repository directory.
For example:
Given "http://repo/Directory1" move the contents of Directory1 to "http://repo/Directory1/sub_directory" without making "sub_directory" before moving occurs.
I've been using the pysvn module to try to accomplish this, however, it will only allow me to move the entire folder into a created parent folder. It will then delete the old folder as well.
I basically want to move the contents of the original folder into a sub folder without deleting the original folder.
This is what I've attempted thus far:
import pysvn
import sys
if len(sys.argv) > 2:
print "USAGE: ", sys.argv[0], " (original_directory_path)"
sys.exit()
else:
original_dir_path = sys.argv[1]
client = pysvn.Client()
client.move(("%s" %original_dir_path), ("%s/new_sub_directory" %original_dir_path), force=True)
This creates the new_sub_directory folder and moves the entire contents of original_dir_path into new_sub_directory, it then deletes the original directory.
Is there any other way I can do this?
Thank you for the suggestions | python | pysvn | null | null | null | null | open | Moving files and directories in svn using pysvn & python
===
I want to be able to move the contents of an svn repository directory into a subdirectory of the specified repository directory.
For example:
Given "http://repo/Directory1" move the contents of Directory1 to "http://repo/Directory1/sub_directory" without making "sub_directory" before moving occurs.
I've been using the pysvn module to try to accomplish this, however, it will only allow me to move the entire folder into a created parent folder. It will then delete the old folder as well.
I basically want to move the contents of the original folder into a sub folder without deleting the original folder.
This is what I've attempted thus far:
import pysvn
import sys
if len(sys.argv) > 2:
print "USAGE: ", sys.argv[0], " (original_directory_path)"
sys.exit()
else:
original_dir_path = sys.argv[1]
client = pysvn.Client()
client.move(("%s" %original_dir_path), ("%s/new_sub_directory" %original_dir_path), force=True)
This creates the new_sub_directory folder and moves the entire contents of original_dir_path into new_sub_directory, it then deletes the original directory.
Is there any other way I can do this?
Thank you for the suggestions | 0 |
11,350,702 | 07/05/2012 18:53:30 | 443,602 | 09/09/2010 15:54:43 | 1,481 | 48 | How can I split off one table into another table using TSQL script | I have this code so far:
DECLARE @AddressIDS TABLE
(
AddressID int
)
INSERT INTO Address(Street1, City, StateCode, ZipCode)
OUTPUT inserted.AddressID INTO @AddressIDS
SELECT Street1, City, StateCode, ZipCode
FROM Contact
Now I need to put the IDs in the `@AddressIDS` back into the `AddressID` of the `Contact` table.
This better describes what I'm trying to do in TSQL:
![enter image description here][1]
[1]: http://i.stack.imgur.com/kZIpB.png | sql-server | tsql | null | null | null | null | open | How can I split off one table into another table using TSQL script
===
I have this code so far:
DECLARE @AddressIDS TABLE
(
AddressID int
)
INSERT INTO Address(Street1, City, StateCode, ZipCode)
OUTPUT inserted.AddressID INTO @AddressIDS
SELECT Street1, City, StateCode, ZipCode
FROM Contact
Now I need to put the IDs in the `@AddressIDS` back into the `AddressID` of the `Contact` table.
This better describes what I'm trying to do in TSQL:
![enter image description here][1]
[1]: http://i.stack.imgur.com/kZIpB.png | 0 |
11,350,703 | 07/05/2012 18:53:31 | 1,426,562 | 05/30/2012 16:35:21 | 7 | 0 | OnCheckedChangeListener & OnClickListener in android -- Button half-works on first click, finishes on second click? | Well... here's a problem it looks like I'm not the first to experience looking through other questions, however I can't find one that's Android-specific (others are C++ or straight java with different scenarios).
I have a calculator that determines your fuel mileage needs with given user inputs. The thing I'm adding now is a "burnoff" aspect where you can calculate the weight lost over the course of the race. Before adding the weight/burnoff element, everything worked fine.
Now, everything calculates normally ***except the weight*** on the first click.
On the second click (and subsequent clicks) it calculates properly. I suspect it has something to do with the switch statement and its location, but I could be wrong.... and even if I'm not, I'm not sure how to change it.
Looking for help on getting it all functioning properly on the first click. Thanks!
-------------------------------
package com.tomcat.performance;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
public class Fuelsimple extends Activity implements OnCheckedChangeListener{
double fuelweight;
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
switch (checkedId){
case R.id.rbMethanol:
fuelweight = 6.6;
break;
case R.id.rbGasoline:
fuelweight = 6.2;
break;}
}
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.fuelsimple);
RadioGroup rgFuelType = ((RadioGroup) findViewById (R.id.rgFuelType));
rgFuelType.setOnCheckedChangeListener(this);
RadioButton rbMethanol = ((RadioButton) findViewById(R.id.rbMethanol));
RadioButton rbGasoline = ((RadioButton) findViewById(R.id.rbGasoline));
Button gen = ((Button) findViewById(R.id.submit));
gen.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
EditText fuelUsed, pracLaps, featureLaps;
pracLaps = ((EditText) findViewById(R.id.pracLaps));
fuelUsed = ((EditText) findViewById(R.id.fuelUsed));
featureLaps = ((EditText) findViewById(R.id.featureLaps));
TextView textLPGValue, textFuelNeededValue, textBurnoffValue;
try{
double pracLapsVar = Double.parseDouble(pracLaps.getText().toString());
double fuelUsedVar = Double.parseDouble(fuelUsed.getText().toString());
double featureLapsVar = Double.parseDouble(featureLaps.getText().toString());
double efficiency = (pracLapsVar / fuelUsedVar);
double fuelNeeded = (featureLapsVar / efficiency);
double burnoff = (1.05 * (fuelNeeded * fuelweight));
Toast andJelly = Toast.makeText(Fuelsimple.this, String.valueOf(fuelweight), Toast.LENGTH_LONG);
andJelly.show();
textLPGValue = ((TextView) findViewById(R.id.textLPGValue));
textFuelNeededValue = ((TextView) findViewById(R.id.textFuelNeededValue));
textBurnoffValue = ((TextView) findViewById(R.id.textBurnoffValue));
textLPGValue.setText(String.valueOf(String.format("%.3f", efficiency)) + " laps per gallon");
textFuelNeededValue.setText(String.valueOf(String.format("%.3f", fuelNeeded)) + " gallons");
textBurnoffValue.setText(String.valueOf(String.format("%.2f", burnoff)) + " pounds");
} catch (NumberFormatException e) {Toast andEggs = Toast.makeText(Fuelsimple.this, "Please complete all fields and enter your fuel & lap info in decimals or whole numbers.", Toast.LENGTH_LONG); andEggs.show();}
catch (NullPointerException n) {Toast andEggs = Toast.makeText(Fuelsimple.this, "Please enter ALL lap and fuel data.", Toast.LENGTH_LONG);
andEggs.show();}
}}
);
}
public void onClick(View v) {
}
}
| android | radio-button | onclicklistener | oncheckedchanged | null | null | open | OnCheckedChangeListener & OnClickListener in android -- Button half-works on first click, finishes on second click?
===
Well... here's a problem it looks like I'm not the first to experience looking through other questions, however I can't find one that's Android-specific (others are C++ or straight java with different scenarios).
I have a calculator that determines your fuel mileage needs with given user inputs. The thing I'm adding now is a "burnoff" aspect where you can calculate the weight lost over the course of the race. Before adding the weight/burnoff element, everything worked fine.
Now, everything calculates normally ***except the weight*** on the first click.
On the second click (and subsequent clicks) it calculates properly. I suspect it has something to do with the switch statement and its location, but I could be wrong.... and even if I'm not, I'm not sure how to change it.
Looking for help on getting it all functioning properly on the first click. Thanks!
-------------------------------
package com.tomcat.performance;
import android.app.Activity;
import android.os.Bundle;
import android.view.Gravity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TextView;
import android.widget.Toast;
public class Fuelsimple extends Activity implements OnCheckedChangeListener{
double fuelweight;
public void onCheckedChanged(RadioGroup group, int checkedId) {
// TODO Auto-generated method stub
switch (checkedId){
case R.id.rbMethanol:
fuelweight = 6.6;
break;
case R.id.rbGasoline:
fuelweight = 6.2;
break;}
}
@Override
protected void onCreate(Bundle savedInstanceState){
super.onCreate(savedInstanceState);
setContentView(R.layout.fuelsimple);
RadioGroup rgFuelType = ((RadioGroup) findViewById (R.id.rgFuelType));
rgFuelType.setOnCheckedChangeListener(this);
RadioButton rbMethanol = ((RadioButton) findViewById(R.id.rbMethanol));
RadioButton rbGasoline = ((RadioButton) findViewById(R.id.rbGasoline));
Button gen = ((Button) findViewById(R.id.submit));
gen.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
// TODO Auto-generated method stub
EditText fuelUsed, pracLaps, featureLaps;
pracLaps = ((EditText) findViewById(R.id.pracLaps));
fuelUsed = ((EditText) findViewById(R.id.fuelUsed));
featureLaps = ((EditText) findViewById(R.id.featureLaps));
TextView textLPGValue, textFuelNeededValue, textBurnoffValue;
try{
double pracLapsVar = Double.parseDouble(pracLaps.getText().toString());
double fuelUsedVar = Double.parseDouble(fuelUsed.getText().toString());
double featureLapsVar = Double.parseDouble(featureLaps.getText().toString());
double efficiency = (pracLapsVar / fuelUsedVar);
double fuelNeeded = (featureLapsVar / efficiency);
double burnoff = (1.05 * (fuelNeeded * fuelweight));
Toast andJelly = Toast.makeText(Fuelsimple.this, String.valueOf(fuelweight), Toast.LENGTH_LONG);
andJelly.show();
textLPGValue = ((TextView) findViewById(R.id.textLPGValue));
textFuelNeededValue = ((TextView) findViewById(R.id.textFuelNeededValue));
textBurnoffValue = ((TextView) findViewById(R.id.textBurnoffValue));
textLPGValue.setText(String.valueOf(String.format("%.3f", efficiency)) + " laps per gallon");
textFuelNeededValue.setText(String.valueOf(String.format("%.3f", fuelNeeded)) + " gallons");
textBurnoffValue.setText(String.valueOf(String.format("%.2f", burnoff)) + " pounds");
} catch (NumberFormatException e) {Toast andEggs = Toast.makeText(Fuelsimple.this, "Please complete all fields and enter your fuel & lap info in decimals or whole numbers.", Toast.LENGTH_LONG); andEggs.show();}
catch (NullPointerException n) {Toast andEggs = Toast.makeText(Fuelsimple.this, "Please enter ALL lap and fuel data.", Toast.LENGTH_LONG);
andEggs.show();}
}}
);
}
public void onClick(View v) {
}
}
| 0 |
11,408,442 | 07/10/2012 07:22:21 | 1,513,963 | 07/10/2012 07:11:49 | 1 | 0 | symfony 1.0 : Error -> "The Page isn't redirected properly" | I am learning symfony 1.0 and i am facing a problem continuously that page isn't redirected properly
I tried all my way but i failed in every try
Is it because of setAuthentication() or session()
Can anyone plzz help me out there?
Thanx in advance guys | php | symfony | null | null | null | null | open | symfony 1.0 : Error -> "The Page isn't redirected properly"
===
I am learning symfony 1.0 and i am facing a problem continuously that page isn't redirected properly
I tried all my way but i failed in every try
Is it because of setAuthentication() or session()
Can anyone plzz help me out there?
Thanx in advance guys | 0 |
11,410,984 | 07/10/2012 10:07:13 | 1,514,265 | 07/10/2012 09:02:42 | 1 | 1 | Create a dropdown List in android not spinner | In my application i want to create a dropdown that shows data . but this drop will locks like a dropdown as shown in web not like a spinner.
thanks | android | null | null | null | null | null | open | Create a dropdown List in android not spinner
===
In my application i want to create a dropdown that shows data . but this drop will locks like a dropdown as shown in web not like a spinner.
thanks | 0 |
11,410,985 | 07/10/2012 10:07:20 | 1,261,316 | 03/10/2012 17:30:15 | 58 | 4 | Should I use Twitter Bootstrap? | I'm about to embark on a very large front end build project, and probably reusing the same grid for many sites. The back-end developers in my team are raving and raving about twitter bootstrap and how we should be using it.
I've started using it and it's very good, but our grid has become more complex than the default one one in Bootstrap. So I've drilled into the LESS files and added some of my own rules and modified the responsive grid. I also might need to change and add the media queries in there.
So my question is, considering that I'm having to change and customise bootstrap quite a bit, would it be best practice to do this or create my grid/framework from scratch? | html | css | twitter-bootstrap | null | null | null | open | Should I use Twitter Bootstrap?
===
I'm about to embark on a very large front end build project, and probably reusing the same grid for many sites. The back-end developers in my team are raving and raving about twitter bootstrap and how we should be using it.
I've started using it and it's very good, but our grid has become more complex than the default one one in Bootstrap. So I've drilled into the LESS files and added some of my own rules and modified the responsive grid. I also might need to change and add the media queries in there.
So my question is, considering that I'm having to change and customise bootstrap quite a bit, would it be best practice to do this or create my grid/framework from scratch? | 0 |
11,410,994 | 07/10/2012 10:07:42 | 381,801 | 07/02/2010 07:01:02 | 1,239 | 94 | When HashSets aren't | When working with `HashSets` in C#, I recently came across an annoying problem: `HashSets` don't guarantee unicity of the elements; they are not Sets. What they do guarantee is that when `Add(T item)` is called the item is not added if for any item in the set `item.equals(that)` is `true`. This holds no longer if you manipulate items already in the set. A small program that demonstrates (copypasta from my Linqpad):
void Main()
{
HashSet<Tester> testset = new HashSet<Tester>();
testset.Add(new Tester(1));
testset.Add(new Tester(2));
foreach(Tester tester in testset){
tester.Dump();
}
foreach(Tester tester in testset){
tester.myint = 3;
}
foreach(Tester tester in testset){
tester.Dump();
}
HashSet<Tester> secondhashset = new HashSet<Tester>(testset);
foreach(Tester tester in secondhashset){
tester.Dump();
}
}
class Tester{
public int myint;
public Tester(int i){
this.myint = i;
}
public override bool Equals(object o){
if (o== null) return false;
Tester that = o as Tester;
if (that == null) return false;
return (this.myint == that.myint);
}
public override int GetHashCode(){
return this.myint;
}
public override string ToString(){
return this.myint.ToString();
}
}
It will happily manipulate the items in the collection to be equal, only filtering them out when a new HashSet is built. What is advicible when I want to work with sets where I need to know the entries are unique? Roll my own, where Add(T item) adds a copy off the item, and the enumerator enumerates over copies of the contained items? This presents the challenge that every contained element should be deep-copyable, at least in its items that influence it's equality.
Another solution would be to roll your own, and only accepts elements that implement INotifyPropertyChanged, and taking action on the event to re-check for equality, but this seems severely limiting, not to mention a whole lot of work and performance loss under the hood.
Yet another possible solution I thought of is making sure that all fields are readonly or const in the constructor. All solutions seem to have very large drawbacks. Do I have any other options?
| c# | hashset | null | null | null | null | open | When HashSets aren't
===
When working with `HashSets` in C#, I recently came across an annoying problem: `HashSets` don't guarantee unicity of the elements; they are not Sets. What they do guarantee is that when `Add(T item)` is called the item is not added if for any item in the set `item.equals(that)` is `true`. This holds no longer if you manipulate items already in the set. A small program that demonstrates (copypasta from my Linqpad):
void Main()
{
HashSet<Tester> testset = new HashSet<Tester>();
testset.Add(new Tester(1));
testset.Add(new Tester(2));
foreach(Tester tester in testset){
tester.Dump();
}
foreach(Tester tester in testset){
tester.myint = 3;
}
foreach(Tester tester in testset){
tester.Dump();
}
HashSet<Tester> secondhashset = new HashSet<Tester>(testset);
foreach(Tester tester in secondhashset){
tester.Dump();
}
}
class Tester{
public int myint;
public Tester(int i){
this.myint = i;
}
public override bool Equals(object o){
if (o== null) return false;
Tester that = o as Tester;
if (that == null) return false;
return (this.myint == that.myint);
}
public override int GetHashCode(){
return this.myint;
}
public override string ToString(){
return this.myint.ToString();
}
}
It will happily manipulate the items in the collection to be equal, only filtering them out when a new HashSet is built. What is advicible when I want to work with sets where I need to know the entries are unique? Roll my own, where Add(T item) adds a copy off the item, and the enumerator enumerates over copies of the contained items? This presents the challenge that every contained element should be deep-copyable, at least in its items that influence it's equality.
Another solution would be to roll your own, and only accepts elements that implement INotifyPropertyChanged, and taking action on the event to re-check for equality, but this seems severely limiting, not to mention a whole lot of work and performance loss under the hood.
Yet another possible solution I thought of is making sure that all fields are readonly or const in the constructor. All solutions seem to have very large drawbacks. Do I have any other options?
| 0 |
11,410,575 | 07/10/2012 09:42:36 | 734,463 | 05/02/2011 13:03:23 | 636 | 9 | Setting the width of <select> and <option> in IE9 | The issue I'm having is options in a select box flow over the edge of the page (hiding the scroll bar). I'm trying to restrict the width of the options using CSS. Please say if there is a better way...
This worked fine in IE8, but not in IE9. Seems okay in Firefox as well. Chrome ignores it as well, but makes sure the options don't overflow off the page (like IE9).
I know the non-resizing of these was a bug that was fixed for IE9, but it is necessary (sometimes) to set a width limit.
http://jsfiddle.net/jdb1991/Vt8Bd/ | html | css | null | null | null | null | open | Setting the width of <select> and <option> in IE9
===
The issue I'm having is options in a select box flow over the edge of the page (hiding the scroll bar). I'm trying to restrict the width of the options using CSS. Please say if there is a better way...
This worked fine in IE8, but not in IE9. Seems okay in Firefox as well. Chrome ignores it as well, but makes sure the options don't overflow off the page (like IE9).
I know the non-resizing of these was a bug that was fixed for IE9, but it is necessary (sometimes) to set a width limit.
http://jsfiddle.net/jdb1991/Vt8Bd/ | 0 |
11,410,996 | 07/10/2012 10:07:52 | 1,097,831 | 12/14/2011 12:53:38 | 46 | 7 | iScroll 4 not working properly on android | I have downloaded iScroll.js and used in one of my phonegap project i.e.
<script type="application/javascript" src="iscroll.js"></script>
<script type="text/javascript">
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper');
}
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
it doesn't work on normal browsers too but **when i inspect elements it started working absolutely fine??** don't know what the problem is... | iscroll | null | null | null | null | null | open | iScroll 4 not working properly on android
===
I have downloaded iScroll.js and used in one of my phonegap project i.e.
<script type="application/javascript" src="iscroll.js"></script>
<script type="text/javascript">
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper');
}
document.addEventListener('DOMContentLoaded', loaded, false);
</script>
it doesn't work on normal browsers too but **when i inspect elements it started working absolutely fine??** don't know what the problem is... | 0 |
11,410,879 | 07/10/2012 10:00:58 | 286,289 | 03/04/2010 13:38:58 | 1,431 | 4 | How to get my wlan adapter up and running | I just got ZyXEL NWD2105, a small wlan usb adapter that i found on [this list][1] of supported usb adapters.
I've already done
- sudo apt-get install wpasupplicant, I'm already at the newest version
- sudo apt-get install firmware-ralink
- sudo nano /etc/network/interfaces
My config looks like:
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto wlan0
iface wlan inet dhcp
wpa-ssid <my ssid>
wpa-psk <aes key>
# address 192.168.1.11
# netmask 255.255.255.0
# gateway 192.168.1.1
- sudo ifup wlan0, IT STATES: Ignoring unknown interface wlan0=wlan0.
So, does anyone know what I'm missing? :D
[1]: http://wiki.debian.org/rt2800usb | wifi | debian | wlan | null | null | null | open | How to get my wlan adapter up and running
===
I just got ZyXEL NWD2105, a small wlan usb adapter that i found on [this list][1] of supported usb adapters.
I've already done
- sudo apt-get install wpasupplicant, I'm already at the newest version
- sudo apt-get install firmware-ralink
- sudo nano /etc/network/interfaces
My config looks like:
auto eth0
iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
gateway 192.168.1.1
auto wlan0
iface wlan inet dhcp
wpa-ssid <my ssid>
wpa-psk <aes key>
# address 192.168.1.11
# netmask 255.255.255.0
# gateway 192.168.1.1
- sudo ifup wlan0, IT STATES: Ignoring unknown interface wlan0=wlan0.
So, does anyone know what I'm missing? :D
[1]: http://wiki.debian.org/rt2800usb | 0 |
11,410,882 | 07/10/2012 10:01:04 | 88,597 | 04/08/2009 13:38:53 | 7,542 | 231 | Rails file upload gem like Paperclip, without the ImageMagick dependency? | Is there a `Paperclip` gem alternative, which does not require ImageMagick, for Rails 3.2.x projects? | ruby-on-rails | ruby-on-rails-3 | paperclip | null | null | null | open | Rails file upload gem like Paperclip, without the ImageMagick dependency?
===
Is there a `Paperclip` gem alternative, which does not require ImageMagick, for Rails 3.2.x projects? | 0 |
11,411,001 | 07/10/2012 10:08:01 | 985,813 | 10/08/2011 21:07:28 | 11 | 0 | CMS for mobile? | My project consists of developing a mobile cms to manage content on a smartphone(android,ios). The content contains the design of the application using a template (pictures,videos,layouts ..).
To generate this content , I want to use jquery mobile based on HTML5.
I have two choices :
create a custom cms based on symfony2
use an opensource cms
Thank you in advance | android | iphone | content-management-system | null | null | 07/10/2012 10:12:45 | not a real question | CMS for mobile?
===
My project consists of developing a mobile cms to manage content on a smartphone(android,ios). The content contains the design of the application using a template (pictures,videos,layouts ..).
To generate this content , I want to use jquery mobile based on HTML5.
I have two choices :
create a custom cms based on symfony2
use an opensource cms
Thank you in advance | 1 |
11,571,886 | 07/20/2012 02:07:02 | 818,852 | 06/28/2011 09:25:10 | 28 | 1 | Error Reporting Service is executing status | I viewed Windows event log and saw many events "Error Reporting Service changed to executing status" with level of event is "information".
Does it mean at that moment an error of an application (or of Windows) happened? | windows-error-reporting | null | null | null | null | null | open | Error Reporting Service is executing status
===
I viewed Windows event log and saw many events "Error Reporting Service changed to executing status" with level of event is "information".
Does it mean at that moment an error of an application (or of Windows) happened? | 0 |
11,571,892 | 07/20/2012 02:08:01 | 1,226,721 | 02/22/2012 19:43:50 | 1 | 0 | ICS Emulator will not create Calendar Account | Please help. I absolutely need to be able to test the Calendar.contract provider in my app using the SDK emulator. Purchasing a $400 hardware device just to test is not a real option.
I have seen the posts that remind us that we need to target the Google API platform, which we have done. Next, I have seen a work around where it is suggested that we create a google account as an exchange account by specifying the m.google.com server and clicking "Accept all SSL". Unfortunately, that generates the error that:
***You have typed an incorrect server address or the server requires a protocol version that Email doesn't support.***
We created a basic Google account. However, the emulator still says we must create at least one calendar account and forces us into creating the Echange Account. According to the emulator, the account we did create as a Google account has no calendars associated with it, even though I can go to Google Calendar, access that account, and add items to a calendar.
Can anyone suggest a solution?
Thanks, | android | calendar | emulator | ice-cream-sandwich | account | null | open | ICS Emulator will not create Calendar Account
===
Please help. I absolutely need to be able to test the Calendar.contract provider in my app using the SDK emulator. Purchasing a $400 hardware device just to test is not a real option.
I have seen the posts that remind us that we need to target the Google API platform, which we have done. Next, I have seen a work around where it is suggested that we create a google account as an exchange account by specifying the m.google.com server and clicking "Accept all SSL". Unfortunately, that generates the error that:
***You have typed an incorrect server address or the server requires a protocol version that Email doesn't support.***
We created a basic Google account. However, the emulator still says we must create at least one calendar account and forces us into creating the Echange Account. According to the emulator, the account we did create as a Google account has no calendars associated with it, even though I can go to Google Calendar, access that account, and add items to a calendar.
Can anyone suggest a solution?
Thanks, | 0 |
11,571,896 | 07/20/2012 02:08:36 | 993,548 | 10/13/2011 13:26:57 | 28 | 2 | You cannot use the same root element (body) multiple times in an Ember.Application | i'm getting error with ember 0.9.8.1
You cannot use the same root element (body) multiple times in an Ember.Application
any idea what this is happening? some suggestions on where i should look into?
thanks. | emberjs | null | null | null | null | null | open | You cannot use the same root element (body) multiple times in an Ember.Application
===
i'm getting error with ember 0.9.8.1
You cannot use the same root element (body) multiple times in an Ember.Application
any idea what this is happening? some suggestions on where i should look into?
thanks. | 0 |
11,571,897 | 07/20/2012 02:08:47 | 422,304 | 08/17/2010 00:16:39 | 283 | 18 | Access parent of has_many relationship | Is there a way to access the parent of a polymorphic model in Mongoid 3?
I have this relationship
class Project
...
field "comments_count", :type => Integer, :default => 0
has_many :comments, :as => :commentable
...
end
class Comment
...
field "status"
belongs_to :commentable, :polymorphic => true
before_validation :init_status, :on => :create
after_create :increase_count
def inactivate
self.status = "inactive"
decrease_count
end
private
def init_status
self.status = 'active'
end
def increase_count()
@commentable.inc(:comments_count, 1)
end
def decrease_count()
@commentable.inc(:comments_count, -1)
end
...
end
I'd like to be able to update the `comments_count` in the parent relationship when the comment is inactivated since doing a `count()` on the child is very expensive (and I'd need to do that a lot in the app). I have the `increase_count` working, but I can't access `@commentable` in `decrease_count` (`@commentable = nil`). Any ideas?
| ruby-on-rails-3 | mongoid | null | null | null | null | open | Access parent of has_many relationship
===
Is there a way to access the parent of a polymorphic model in Mongoid 3?
I have this relationship
class Project
...
field "comments_count", :type => Integer, :default => 0
has_many :comments, :as => :commentable
...
end
class Comment
...
field "status"
belongs_to :commentable, :polymorphic => true
before_validation :init_status, :on => :create
after_create :increase_count
def inactivate
self.status = "inactive"
decrease_count
end
private
def init_status
self.status = 'active'
end
def increase_count()
@commentable.inc(:comments_count, 1)
end
def decrease_count()
@commentable.inc(:comments_count, -1)
end
...
end
I'd like to be able to update the `comments_count` in the parent relationship when the comment is inactivated since doing a `count()` on the child is very expensive (and I'd need to do that a lot in the app). I have the `increase_count` working, but I can't access `@commentable` in `decrease_count` (`@commentable = nil`). Any ideas?
| 0 |
11,571,898 | 07/20/2012 02:08:50 | 1,515,864 | 07/10/2012 19:35:56 | 35 | 1 | SOQL query, formulate query for more than one | I'm making a search box in php accessing data from a SOQL salesforce database. So far I have this:
`$query = "SELECT Id, FirstName, LastName, Phone From Contact WHERE FirstName = '$var'";`
Which works perfectly fine. However, how would I make it so that let's say `$var` could be the phone number. So if it doesn't match the First name, search for a match in Phone number, etc.
| php | query | salesforce | soql | null | null | open | SOQL query, formulate query for more than one
===
I'm making a search box in php accessing data from a SOQL salesforce database. So far I have this:
`$query = "SELECT Id, FirstName, LastName, Phone From Contact WHERE FirstName = '$var'";`
Which works perfectly fine. However, how would I make it so that let's say `$var` could be the phone number. So if it doesn't match the First name, search for a match in Phone number, etc.
| 0 |
11,571,905 | 07/20/2012 02:10:16 | 1,513,192 | 07/09/2012 21:50:58 | 36 | 1 | How to make a Grid in wxPython? | I want to make a grid like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/Bupmx.gif
Not the wx.Grid. Does anyone know how to do this, and could provide an example? | python | wxpython | wxwidgets | wx | null | null | open | How to make a Grid in wxPython?
===
I want to make a grid like this:
![enter image description here][1]
[1]: http://i.stack.imgur.com/Bupmx.gif
Not the wx.Grid. Does anyone know how to do this, and could provide an example? | 0 |
11,571,907 | 07/20/2012 02:10:21 | 994,179 | 10/13/2011 19:13:15 | 570 | 8 | Indomitable beast: a 2d char array, inside a structure, in the belly of an unmanaged dll | Having gird my loins and ventured into Legacy Land, having hacked, p-invoked and marshaled every type of wild beast, I now stand before a creature so fierce that, as far as I can tell from an exhausting survey of my brethern-in-arms, not a single code warrior has been left standing.
Here are the details. I am attempting to pass a 2d char array (in c#), inside a structure, to a C dll (no source code), which must be able to make changes to the 2d array.
The C structure:
typedef struct s_beast
{
bool fireBreathing;
char entrails[30][50];
} Beast;
Here is what I have so far in C#, but it is (incorrectly) a 1d array:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Beast
{
public BOOL fireBreathing;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30 )]
public char [] entrails;
}
Who is willing to take a stab at this and, for my sake, the sake of my brethern, and for the sake of future generations, once and for all slay this beast?
| c# | pinvoke | marshalling | hacking | 2d-array | null | open | Indomitable beast: a 2d char array, inside a structure, in the belly of an unmanaged dll
===
Having gird my loins and ventured into Legacy Land, having hacked, p-invoked and marshaled every type of wild beast, I now stand before a creature so fierce that, as far as I can tell from an exhausting survey of my brethern-in-arms, not a single code warrior has been left standing.
Here are the details. I am attempting to pass a 2d char array (in c#), inside a structure, to a C dll (no source code), which must be able to make changes to the 2d array.
The C structure:
typedef struct s_beast
{
bool fireBreathing;
char entrails[30][50];
} Beast;
Here is what I have so far in C#, but it is (incorrectly) a 1d array:
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public struct Beast
{
public BOOL fireBreathing;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 30 )]
public char [] entrails;
}
Who is willing to take a stab at this and, for my sake, the sake of my brethern, and for the sake of future generations, once and for all slay this beast?
| 0 |
11,571,913 | 07/20/2012 02:11:07 | 1,146,238 | 01/12/2012 18:56:32 | 29 | 0 | Expand/Collapse Menu in Xaml | I want to know if its possible to create expand/collapse sidebar menu.
For example[enter link description here][1]
[1]: http://dribbble.com/shots/319867-Menu/attachments/14079
If you guys have any examples/ Any Suggestions on where to start.
Thank You. | c# | wpf | xaml | menu | null | null | open | Expand/Collapse Menu in Xaml
===
I want to know if its possible to create expand/collapse sidebar menu.
For example[enter link description here][1]
[1]: http://dribbble.com/shots/319867-Menu/attachments/14079
If you guys have any examples/ Any Suggestions on where to start.
Thank You. | 0 |
11,693,275 | 07/27/2012 18:06:23 | 1,529,402 | 07/16/2012 15:50:37 | 20 | 0 | Dynamically change contents and switch buttons | I have a form that I want to switch its mode and also corresponding buttons. Basically, when users open the page first, they see the form which cannot be edited. There is an "Edit" button as well. When they click the button two things will happen: 1. The form will be editable. 2. "Edit" button is hidden and another two buttons show up which are "Save" and "Cancel".
The code I have now is close but not working the way as I mentioned above. Any idea how to fix it?
html:
<div class="eq-height widget grid_4 container flat rounded-sm bspace" id="Div5">
<header class="widgetheader">
<h2>Contact</h2>
</header>
<input type="submit" value="Edit" class="edit edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<input type="submit" value="Save" class="save edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<input type="submit" value="Cancel" class="cancel edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<fieldset id="Fieldset1" class="content form-fields">
<div class="inner tspace clearfix">
<ul id="contact" class="alpha">
<li class="contactinfo">
<label class="contactinfo grid_12">
Rebekah Becker</label>
</li></ul>
</div>
</fieldset>
<fieldset id="Fieldset6" style="display:none"
class="content form-fields">
<div class="inner tspace clearfix">
<ul id="Ul1" class="alpha">
<li class="contactinfo">
<label class="contactinfo grid_4">
First Name:</label>
<input type="text" trim="true" maxlength="250" value="Rebekah" class="profile-field grid_4">
</li></ul>
<div class="clear-both"></div>
</div>
</fieldset>
</div>
css:
.save, .cancel
{
display:none;
}
javascript:
/*script to toggle the form mode*/
<script type="text/javascript">
var divheight;
$(".edit-one-button").click(function () {
var btnname = $(this).val();
if (btnname == 'Edit') {
divheight = $('.widget').attr('style');
$(this).closest('.widget').removeAttr('style');
$(this).nextUntil('.edit-one-button').toggle();
}
else {
$(this).nextUntil('.edit-one-button').toggle();
$(this).closest('.widget').attr('style', divheight);
}
});
</script>
/*script to switch the buttons*/
<script type="text/javascript">
$('.edit').click(function () {
$(this).hide();
$(this).siblings('.save, .cancel').show();
});
$('.cancel').click(function() {
$(this).siblings('.edit').show();
$(this).siblings('.save').hide();
$(this).hide();
});
$('.save').click(function() {
$(this).siblings('.edit').show();
$(this).siblings('.cancel').hide();
$(this).hide();
});
</script>
| toggle | null | null | null | null | null | open | Dynamically change contents and switch buttons
===
I have a form that I want to switch its mode and also corresponding buttons. Basically, when users open the page first, they see the form which cannot be edited. There is an "Edit" button as well. When they click the button two things will happen: 1. The form will be editable. 2. "Edit" button is hidden and another two buttons show up which are "Save" and "Cancel".
The code I have now is close but not working the way as I mentioned above. Any idea how to fix it?
html:
<div class="eq-height widget grid_4 container flat rounded-sm bspace" id="Div5">
<header class="widgetheader">
<h2>Contact</h2>
</header>
<input type="submit" value="Edit" class="edit edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<input type="submit" value="Save" class="save edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<input type="submit" value="Cancel" class="cancel edit-one-button btn lg bold ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only ui-state-hover" style="border-style:Solid;"/>
<fieldset id="Fieldset1" class="content form-fields">
<div class="inner tspace clearfix">
<ul id="contact" class="alpha">
<li class="contactinfo">
<label class="contactinfo grid_12">
Rebekah Becker</label>
</li></ul>
</div>
</fieldset>
<fieldset id="Fieldset6" style="display:none"
class="content form-fields">
<div class="inner tspace clearfix">
<ul id="Ul1" class="alpha">
<li class="contactinfo">
<label class="contactinfo grid_4">
First Name:</label>
<input type="text" trim="true" maxlength="250" value="Rebekah" class="profile-field grid_4">
</li></ul>
<div class="clear-both"></div>
</div>
</fieldset>
</div>
css:
.save, .cancel
{
display:none;
}
javascript:
/*script to toggle the form mode*/
<script type="text/javascript">
var divheight;
$(".edit-one-button").click(function () {
var btnname = $(this).val();
if (btnname == 'Edit') {
divheight = $('.widget').attr('style');
$(this).closest('.widget').removeAttr('style');
$(this).nextUntil('.edit-one-button').toggle();
}
else {
$(this).nextUntil('.edit-one-button').toggle();
$(this).closest('.widget').attr('style', divheight);
}
});
</script>
/*script to switch the buttons*/
<script type="text/javascript">
$('.edit').click(function () {
$(this).hide();
$(this).siblings('.save, .cancel').show();
});
$('.cancel').click(function() {
$(this).siblings('.edit').show();
$(this).siblings('.save').hide();
$(this).hide();
});
$('.save').click(function() {
$(this).siblings('.edit').show();
$(this).siblings('.cancel').hide();
$(this).hide();
});
</script>
| 0 |
11,693,284 | 07/27/2012 18:07:03 | 276,327 | 02/18/2010 17:30:46 | 312 | 7 | Dotted line bugs | I have adopted and adapted an HTML5 canvas extension which draws dotted lines, but it has a couple of problems as shown in http://jsfiddle.net/VxCYL/2/
Example 1: How can I avoid the "bunching" up of dots where the distance between two points is very small (see the first corner at 30,50 going to 32,50). I guess I need to check the distance from the last point when determining whether to draw or move to the next point? The output looks clumsy when I have lots of points.
Example 2: Where the from.x is less than the to.x or the from.y is less than the to.y i.e. drawing backwards the moveTo does not behave as I would expect i.e. in the example shown the lines should still be joined up.
Thanks. | javascript | html5 | canvas | null | null | null | open | Dotted line bugs
===
I have adopted and adapted an HTML5 canvas extension which draws dotted lines, but it has a couple of problems as shown in http://jsfiddle.net/VxCYL/2/
Example 1: How can I avoid the "bunching" up of dots where the distance between two points is very small (see the first corner at 30,50 going to 32,50). I guess I need to check the distance from the last point when determining whether to draw or move to the next point? The output looks clumsy when I have lots of points.
Example 2: Where the from.x is less than the to.x or the from.y is less than the to.y i.e. drawing backwards the moveTo does not behave as I would expect i.e. in the example shown the lines should still be joined up.
Thanks. | 0 |
11,693,286 | 07/27/2012 18:07:06 | 1,496,143 | 07/02/2012 13:11:59 | 5 | 0 | Accessing FTP server from iPad using Objective C | I have this code that is trying to access an FTP using the URL. But I cant get access because it's username and password protected. How do I implement that so I can get into the server? Here is my code:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[receivedData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[receivedData appendData:data];
}
- (void)connection:(NSURLConnection *)connection
didFailWithError:(NSError *)error
{
NSLog(@"Connection failed! Error - %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
// do something with the data
// receivedData is declared as a method instance elsewhere
NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]);
// release the connection, and the data object
//[connection release];
//[receivedData release];
}
-(IBAction)getURL:(id)sender {
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"ftp://10.0.1.***/App_Data/text.txt"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData to hold the received data.
// receivedData is an instance variable declared elsewhere.
receivedData = [NSMutableData data];
} else {
// Inform the user that the connection failed.
NSLog(@"connection failed");
}}
| objective-c | xcode | http | url | ftp | null | open | Accessing FTP server from iPad using Objective C
===
I have this code that is trying to access an FTP using the URL. But I cant get access because it's username and password protected. How do I implement that so I can get into the server? Here is my code:
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
[receivedData setLength:0];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[receivedData appendData:data];
}
- (void)connection:(NSURLConnection *)connection
didFailWithError:(NSError *)error
{
NSLog(@"Connection failed! Error - %@ %@",
[error localizedDescription],
[[error userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]);
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
// do something with the data
// receivedData is declared as a method instance elsewhere
NSLog(@"Succeeded! Received %d bytes of data",[receivedData length]);
// release the connection, and the data object
//[connection release];
//[receivedData release];
}
-(IBAction)getURL:(id)sender {
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"ftp://10.0.1.***/App_Data/text.txt"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
if (theConnection) {
// Create the NSMutableData to hold the received data.
// receivedData is an instance variable declared elsewhere.
receivedData = [NSMutableData data];
} else {
// Inform the user that the connection failed.
NSLog(@"connection failed");
}}
| 0 |
11,693,288 | 07/27/2012 18:07:08 | 944,624 | 09/14/2011 12:35:09 | 9 | 0 | how to create new repo at Github using git bash? | how can i create a new repository from my machine using git bash?
<code>
I am currently following the below steps.
mkdir ~/Hello-World
cd ~/Hello-World
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin https://github.com/username/Hello-World.git
git push origin master
</code>
But i am getting "Fatal error: did you run update-server-info on the server? "
| github | github-api | git-bash | null | null | null | open | how to create new repo at Github using git bash?
===
how can i create a new repository from my machine using git bash?
<code>
I am currently following the below steps.
mkdir ~/Hello-World
cd ~/Hello-World
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin https://github.com/username/Hello-World.git
git push origin master
</code>
But i am getting "Fatal error: did you run update-server-info on the server? "
| 0 |
11,542,242 | 07/18/2012 13:12:42 | 834,316 | 07/07/2011 20:25:16 | 523 | 3 | Multiple threads reading a primitive type | If multiple threads read a primitive type that has been previously set and does not change ever after, can they get a wrong value?
For example, assume the following simple code excerpt:
public static final boolean proceed = read(); // Read the value from a file
public static void doSomething() // Method accessed by multiple threads
{
if (proceed)
{
System.out.println("TRUE");
}
else
{
System.out.println("FALSE");
}
}
Assuming that the `proceed` variable is initialized to `true`, is it possible that, in one or more of the multiple threads that simultaneously run the `doSomething()` method, the printed message is `FALSE`?
If the `proceed` variable was mutable, surely that would be possible, hence the need for synchronization, or for using an `AtomicBoolean` (e.g., as per [this question][1]). But in this case `proceed` is immutable and only set once, during the static initialization of the containing class.
Similarly for other primitive types, if a value is set as final, it should always be thread-safe to access it afterwards, correct?
[1]: http://stackoverflow.com/questions/4501223/when-i-need-to-use-atomicboolean-in-java | java | thread-safety | multiple | primitive | null | null | open | Multiple threads reading a primitive type
===
If multiple threads read a primitive type that has been previously set and does not change ever after, can they get a wrong value?
For example, assume the following simple code excerpt:
public static final boolean proceed = read(); // Read the value from a file
public static void doSomething() // Method accessed by multiple threads
{
if (proceed)
{
System.out.println("TRUE");
}
else
{
System.out.println("FALSE");
}
}
Assuming that the `proceed` variable is initialized to `true`, is it possible that, in one or more of the multiple threads that simultaneously run the `doSomething()` method, the printed message is `FALSE`?
If the `proceed` variable was mutable, surely that would be possible, hence the need for synchronization, or for using an `AtomicBoolean` (e.g., as per [this question][1]). But in this case `proceed` is immutable and only set once, during the static initialization of the containing class.
Similarly for other primitive types, if a value is set as final, it should always be thread-safe to access it afterwards, correct?
[1]: http://stackoverflow.com/questions/4501223/when-i-need-to-use-atomicboolean-in-java | 0 |
11,542,243 | 07/18/2012 13:12:47 | 51,197 | 01/03/2009 17:39:24 | 7,824 | 157 | Bash: number of child processes | How do find the number of child processes of a bash script, from within the script itself? | bash | processes | pid | null | null | null | open | Bash: number of child processes
===
How do find the number of child processes of a bash script, from within the script itself? | 0 |
11,542,366 | 07/18/2012 13:18:35 | 731,052 | 04/29/2011 12:40:34 | 23 | 1 | Retrieve ID's after bulk insert | I'm using MySQL 5.5 with PHP 5.4. I'm performing a bulk insert and need to capture all of the newly inserted ID's. This is my code:
$db->query("INSERT INTO commodity (analysis_id, commodity_description, a_units,
a_average_yield, a_average_price) SELECT $analysis_id, commodity_description,
a_units, a_average_yield, a_average_price FROM commodity WHERE analysis_id =
$import_analysis_id");
Is there a way to retrieve all of the new ID's of the inserted rows? Using `$db->insert_id` only returns a single ID. I would hate to have to use a PHP loop and execute several queries, but I will if I have to. Thanks! | php | mysql | insert | mysqli | bulkinsert | null | open | Retrieve ID's after bulk insert
===
I'm using MySQL 5.5 with PHP 5.4. I'm performing a bulk insert and need to capture all of the newly inserted ID's. This is my code:
$db->query("INSERT INTO commodity (analysis_id, commodity_description, a_units,
a_average_yield, a_average_price) SELECT $analysis_id, commodity_description,
a_units, a_average_yield, a_average_price FROM commodity WHERE analysis_id =
$import_analysis_id");
Is there a way to retrieve all of the new ID's of the inserted rows? Using `$db->insert_id` only returns a single ID. I would hate to have to use a PHP loop and execute several queries, but I will if I have to. Thanks! | 0 |
11,542,367 | 07/18/2012 13:18:40 | 385,883 | 06/07/2010 10:06:34 | 103 | 2 | Where can I find Microsoft.Build.Utilities.v3.5 | How can I get Microsoft.Build.Utilities.v3.5 , I am using StyleCop 4.7 and it would seem that StyleCop msbuild task which is in Stylecop.dll has as a dependency Microsoft.Build.Utilities.v3.5. Do you know how can I obtain that dll? I mean what should I donwload and install in order to get that dll (installing visual studio is not an option)
Thanks,
Peter | c# | .net | msbuild | teamcity | msbuild-4.0 | null | open | Where can I find Microsoft.Build.Utilities.v3.5
===
How can I get Microsoft.Build.Utilities.v3.5 , I am using StyleCop 4.7 and it would seem that StyleCop msbuild task which is in Stylecop.dll has as a dependency Microsoft.Build.Utilities.v3.5. Do you know how can I obtain that dll? I mean what should I donwload and install in order to get that dll (installing visual studio is not an option)
Thanks,
Peter | 0 |
11,542,369 | 07/18/2012 13:18:49 | 620,324 | 02/16/2011 20:32:36 | 1 | 0 | Advanced Installer startup action | I'm using Advanced Installer professional edition for a small windows application.
I wondering if it is possible to run a custom action when the installer is executed and the product is already installed (and up to date) ?
Usually when you run the installer you either get the "Another version product already installed" message, or nothing happens. From what I understand it's MSI which does this automatically, but I was hoping there would be some way to get around it since Advanced Installer can wrap the MSI in it's own exe-file.
What i would like to do is start the application if it's already installed. I already auto-start the application after the normal installation completes, but I would like the installer to always start the application when run.
| windows-installer | advanced-installer | null | null | null | null | open | Advanced Installer startup action
===
I'm using Advanced Installer professional edition for a small windows application.
I wondering if it is possible to run a custom action when the installer is executed and the product is already installed (and up to date) ?
Usually when you run the installer you either get the "Another version product already installed" message, or nothing happens. From what I understand it's MSI which does this automatically, but I was hoping there would be some way to get around it since Advanced Installer can wrap the MSI in it's own exe-file.
What i would like to do is start the application if it's already installed. I already auto-start the application after the normal installation completes, but I would like the installer to always start the application when run.
| 0 |
11,542,371 | 07/18/2012 13:18:51 | 1,532,001 | 07/17/2012 13:53:25 | 1 | 0 | Error adding service reference to WCF from MVC 4 project in VS 2012 RC | I tried to add a service reference to a WCF service that resides in the same solution from an MVC 4 project but failed. I got a error saying: Custom tool error: Failed to generate code for the service reference 'XXX'. Please check other error and warning messages for details. The root warning is:
Warning 9 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove references to itself.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IXXX'] C:\Projects\...\Reference.svcmap 1 1 pqrt.web
If I removed the data contracts from the service contract, it worked. I also tried to add the service reference to other projects like a library project or even an MVC 3 project, it all worked. I was wondering if this was an issue with MVC 4? I was using VS 2012 RC.
One workaround I can think of is to add the service reference to a library project and then call the library project from MVC 4, but I hate to do that since it's an extra step. Any suggestions?
Thanks!
| wcf | asp.net-mvc-4 | visual-studio-2012 | service-reference | null | null | open | Error adding service reference to WCF from MVC 4 project in VS 2012 RC
===
I tried to add a service reference to a WCF service that resides in the same solution from an MVC 4 project but failed. I got a error saying: Custom tool error: Failed to generate code for the service reference 'XXX'. Please check other error and warning messages for details. The root warning is:
Warning 9 Custom tool warning: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.DataContractSerializerMessageContractImporter
Error: Type 'Newtonsoft.Json.Linq.JToken' is a recursive collection data contract which is not supported. Consider modifying the definition of collection 'Newtonsoft.Json.Linq.JToken' to remove references to itself.
XPath to Error Source: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='IXXX'] C:\Projects\...\Reference.svcmap 1 1 pqrt.web
If I removed the data contracts from the service contract, it worked. I also tried to add the service reference to other projects like a library project or even an MVC 3 project, it all worked. I was wondering if this was an issue with MVC 4? I was using VS 2012 RC.
One workaround I can think of is to add the service reference to a library project and then call the library project from MVC 4, but I hate to do that since it's an extra step. Any suggestions?
Thanks!
| 0 |
11,542,373 | 07/18/2012 13:18:56 | 1,328,510 | 04/12/2012 08:09:32 | 23 | 0 | paypal android sell digital content | We'd like to sell digital content through mobile application on Android.
Can we use PayPal for it?
Content will be : digital goods such as movies and songs, that are available through our app. and physical goods as discs with content.
| android | paypal | null | null | null | 07/18/2012 13:23:14 | off topic | paypal android sell digital content
===
We'd like to sell digital content through mobile application on Android.
Can we use PayPal for it?
Content will be : digital goods such as movies and songs, that are available through our app. and physical goods as discs with content.
| 2 |
11,350,770 | 07/05/2012 18:57:34 | 1,170,342 | 01/25/2012 23:43:20 | 1 | 1 | pandas + dataframe - select by partial string | I have a DataFrame with 4 columns of which 2 contain string values. I was wondering if there was a way to select rows based on a partial string match against a particular column? In other words, a function or lambda function that would do something like re.search(pattern, cell_in_question) returning a boolean. I am familiar with the syntax of df[df['A'] == "hello world"] but can't seem to find a way to do the same with a partial string match say 'hello'. Would someone be able to point me in the right direction? Thank you in advance. | pandas | null | null | null | null | null | open | pandas + dataframe - select by partial string
===
I have a DataFrame with 4 columns of which 2 contain string values. I was wondering if there was a way to select rows based on a partial string match against a particular column? In other words, a function or lambda function that would do something like re.search(pattern, cell_in_question) returning a boolean. I am familiar with the syntax of df[df['A'] == "hello world"] but can't seem to find a way to do the same with a partial string match say 'hello'. Would someone be able to point me in the right direction? Thank you in advance. | 0 |
11,350,777 | 07/05/2012 18:57:51 | 771,318 | 05/25/2011 19:13:11 | 288 | 4 | How to generate java doc and sources for a library created by me using maven | This might be small question but I am not able to find answer to it. I wrote a library called Utilities and used java doc style comments. Using maven (m2e plugin in eclipse). I am using maven install option. I am getting a jar file and i am pushing the jar file to a central repository and reusing the same library in another project. I am able to use the lib and complete my project successfully but when I do ctrl click I am not able to see the library code from my project. I am also not able to see the arguments description when i hover my mouse on the methods.
I know that it is because My project is not finding sources and java doc .
So How can i generate sources , java doc for my library and attach them to my project using maven.
Thanks | java | maven | javadoc | m2eclipse | null | null | open | How to generate java doc and sources for a library created by me using maven
===
This might be small question but I am not able to find answer to it. I wrote a library called Utilities and used java doc style comments. Using maven (m2e plugin in eclipse). I am using maven install option. I am getting a jar file and i am pushing the jar file to a central repository and reusing the same library in another project. I am able to use the lib and complete my project successfully but when I do ctrl click I am not able to see the library code from my project. I am also not able to see the arguments description when i hover my mouse on the methods.
I know that it is because My project is not finding sources and java doc .
So How can i generate sources , java doc for my library and attach them to my project using maven.
Thanks | 0 |
11,350,788 | 07/05/2012 18:58:38 | 1,262,568 | 03/11/2012 16:52:25 | 244 | 16 | Coloring console output in windows | I was trying to find if it is possible to colour console output in windows system. I found that [Console - Ansi][1] but i cant find any information about coloring output in windows prompt.
[1]: http://hackage.haskell.org/packages/archive/ansi-terminal/0.5.0/doc/html/System-Console-ANSI.html
I woudl appreciate information about my problem. | haskell | cmd | ghci | null | null | null | open | Coloring console output in windows
===
I was trying to find if it is possible to colour console output in windows system. I found that [Console - Ansi][1] but i cant find any information about coloring output in windows prompt.
[1]: http://hackage.haskell.org/packages/archive/ansi-terminal/0.5.0/doc/html/System-Console-ANSI.html
I woudl appreciate information about my problem. | 0 |
11,350,789 | 07/05/2012 18:58:48 | 1,504,899 | 07/05/2012 18:36:51 | 1 | 0 | AS3: Multiple "get" URLRequests not working | I'm trying to read data from a server by using a GET URLRequest with a URLLoader, and it does work. The problem is, it only works once.
public class Settings
{
private static var request:URLRequest;
private static var loader:URLLoader;
public static function getRequest(url:String):void
{
request = new URLRequest(url);
request.method = URLRequestMethod.GET;
loader = new URLLoader();
loader.addEventListener(flash.events.Event.COMPLETE, responseHolder);
loader.load(request);
}
}
Whenever I open the Flash application I put this in and call getRequest, I get the correct data from the URLLoader. Whenever I call it afterwards, I still get a response and an Event.COMPLETE is still dispatched, but the data received is always the data obtained from the first GET. Only if I close and re-open the application does the GET actually obtain the most recent data.
I also ran a remote debug session to test this, and it turns out that only the first call of this function even communicates with the server it's trying to read from.
The only explanation for this that I can think of is that the URLRequest and URLLoader aren't being cleared after reading the data, so when another GET is called, they simply reuse the last acquired data without trying to contact the server. But I'm clearing them, as such:
//in Settings class
private static function responseHolder(e:flash.events.Event):void
{
request = null;
loader.removeEventListener(flash.events.Event.COMPLETE, responseHolder);
loader.close();
loader = null;
}
Is there something I have to do to re-enable GET URLRequests? | actionscript-3 | multiple | urlloader | urlrequest | null | null | open | AS3: Multiple "get" URLRequests not working
===
I'm trying to read data from a server by using a GET URLRequest with a URLLoader, and it does work. The problem is, it only works once.
public class Settings
{
private static var request:URLRequest;
private static var loader:URLLoader;
public static function getRequest(url:String):void
{
request = new URLRequest(url);
request.method = URLRequestMethod.GET;
loader = new URLLoader();
loader.addEventListener(flash.events.Event.COMPLETE, responseHolder);
loader.load(request);
}
}
Whenever I open the Flash application I put this in and call getRequest, I get the correct data from the URLLoader. Whenever I call it afterwards, I still get a response and an Event.COMPLETE is still dispatched, but the data received is always the data obtained from the first GET. Only if I close and re-open the application does the GET actually obtain the most recent data.
I also ran a remote debug session to test this, and it turns out that only the first call of this function even communicates with the server it's trying to read from.
The only explanation for this that I can think of is that the URLRequest and URLLoader aren't being cleared after reading the data, so when another GET is called, they simply reuse the last acquired data without trying to contact the server. But I'm clearing them, as such:
//in Settings class
private static function responseHolder(e:flash.events.Event):void
{
request = null;
loader.removeEventListener(flash.events.Event.COMPLETE, responseHolder);
loader.close();
loader = null;
}
Is there something I have to do to re-enable GET URLRequests? | 0 |
11,350,790 | 07/05/2012 18:58:50 | 154,513 | 08/11/2009 16:53:58 | 4,707 | 362 | What is the correct way to parse JSON in PHP? | I have the following JSON string coming back from a Node JS Service:
"{\"success\":true,\"isavailable\":true}"
When I try to use json_decode() in the PHP I get the following on a var_dump:
string '{"success":true,"isavailable":true}' (length=35)
So, I set about to do the following:
$str = str_replace("\"{", "'{", $str);
$str = str_replace("}\"", "}'", $str);
$str = str_replace('\"','"',$str);
When I do this I get a Syntax Error from Return Last Error and a Value of NULL.
So, what is the correct way to parse this JSON string in PHP? | php | json | null | null | null | null | open | What is the correct way to parse JSON in PHP?
===
I have the following JSON string coming back from a Node JS Service:
"{\"success\":true,\"isavailable\":true}"
When I try to use json_decode() in the PHP I get the following on a var_dump:
string '{"success":true,"isavailable":true}' (length=35)
So, I set about to do the following:
$str = str_replace("\"{", "'{", $str);
$str = str_replace("}\"", "}'", $str);
$str = str_replace('\"','"',$str);
When I do this I get a Syntax Error from Return Last Error and a Value of NULL.
So, what is the correct way to parse this JSON string in PHP? | 0 |
11,350,793 | 07/05/2012 18:58:54 | 1,023,733 | 11/01/2011 12:59:16 | 47 | 0 | How can I purge my Haskell installation from my Windows XP machine? | I tried uninstalling the Haskell Platform, but the package database remains intact. How can I completely purge Haskell from my system? | haskell | null | null | null | null | null | open | How can I purge my Haskell installation from my Windows XP machine?
===
I tried uninstalling the Haskell Platform, but the package database remains intact. How can I completely purge Haskell from my system? | 0 |
11,350,795 | 07/05/2012 18:59:05 | 1,494,432 | 07/01/2012 15:39:27 | 1 | 1 | Cocos2d if statement logic not working | The if statement is: `int x = enemy.position.x;
int y = enemy.position.y;
NSLog(@"%G,%G", leftJoystick.velocity.x, leftJoystick.velocity.y);`
if ((leftJoystick.stickPosition.x < 1 && leftJoystick.stickPosition.x > -1)&& leftJoystick.stickPosition.y > 0) {
enemy.position = ccp(x,y-1);
NSLog(@"North");
return;
}
In the feedback it shows that `-0.0544645,0.998516` works and it logs North, but `-0.0725357,0.997366` doesn't work. I don't understand why?
I'm trying to do this in cocos2d BTW. | iphone | if-statement | cocos2d | logic | null | null | open | Cocos2d if statement logic not working
===
The if statement is: `int x = enemy.position.x;
int y = enemy.position.y;
NSLog(@"%G,%G", leftJoystick.velocity.x, leftJoystick.velocity.y);`
if ((leftJoystick.stickPosition.x < 1 && leftJoystick.stickPosition.x > -1)&& leftJoystick.stickPosition.y > 0) {
enemy.position = ccp(x,y-1);
NSLog(@"North");
return;
}
In the feedback it shows that `-0.0544645,0.998516` works and it logs North, but `-0.0725357,0.997366` doesn't work. I don't understand why?
I'm trying to do this in cocos2d BTW. | 0 |
11,350,740 | 07/05/2012 18:55:54 | 1,504,921 | 07/05/2012 18:46:54 | 1 | 0 | How to remove duplicate records as defined by two cells in different columns in R (or Excel) | I would like to remove duplicate records in a list based on the COMBINATION of the values in two cells whose orders are reversed. I used melt to extract a list from a matrix, but it requires a full matrix and so each record has a duplicate. For example, my data now look like:
meltID individual1 individual2 distance
42 A B 14.0
72264 A C 12.5
5399 C A 12.5
92200 B C 18.1
lines 72264 and 5399 are duplicates.
Is there something besides melt that would extract from a triangular matrix? Or is there some other way in R to do this?
Cheers,
Steve
| r | duplicates | null | null | null | null | open | How to remove duplicate records as defined by two cells in different columns in R (or Excel)
===
I would like to remove duplicate records in a list based on the COMBINATION of the values in two cells whose orders are reversed. I used melt to extract a list from a matrix, but it requires a full matrix and so each record has a duplicate. For example, my data now look like:
meltID individual1 individual2 distance
42 A B 14.0
72264 A C 12.5
5399 C A 12.5
92200 B C 18.1
lines 72264 and 5399 are duplicates.
Is there something besides melt that would extract from a triangular matrix? Or is there some other way in R to do this?
Cheers,
Steve
| 0 |
11,350,742 | 07/05/2012 18:55:54 | 1,006,249 | 10/21/2011 00:12:59 | 389 | 8 | Does index works for LIKE statement in MySQL? | I have a table `(id, title)`, where `id` is PK. For a query `SELECT * FROM table WHERE title LIKE "%stackoverflow%"`, I tried indexing `title` and fulltext indexing `title`. I used `EXPLAIN` to check if index works, and both don't work.
I am told index doesn't work for `LIKE "%...%"`. Is this the case? | mysql | index | null | null | null | null | open | Does index works for LIKE statement in MySQL?
===
I have a table `(id, title)`, where `id` is PK. For a query `SELECT * FROM table WHERE title LIKE "%stackoverflow%"`, I tried indexing `title` and fulltext indexing `title`. I used `EXPLAIN` to check if index works, and both don't work.
I am told index doesn't work for `LIKE "%...%"`. Is this the case? | 0 |
11,350,798 | 07/05/2012 18:59:12 | 214,923 | 11/19/2009 19:53:42 | 361 | 16 | How can I create/update an XML node that may or may not exist? | Is there a method available (i.e. without me creating my own recursive method), for a given xpath (or other method of identifying the hierarchical position) to create/update an XML node, where the node would be created if it does not exist? This would need to create the parent node if it does not exist as well. I do have an XSD which includes all possible nodes.
i.e.
Before:
<employee>
<name>John Smith</name>
</employee>
Would like to call something like this:
CoolXmlUpdateMethod("/employee/address/city", "Los Angeles");
After:
<employee>
<name>John Smith</name>
<address>
<city>Los Angeles</city>
</address>
</employee>
Or even a method to create a node, given an xpath, wherein it will recursively create the parent node(s) if they do not exist?
As far as the application (if it matters), this is taking an existing XML doc that contains only populated nodes, and adding data to it from another system. The new data may or may not already have values populated in the source XML.
Surely this is not an uncommon scenario? | .net | xml | linq | xpath | null | null | open | How can I create/update an XML node that may or may not exist?
===
Is there a method available (i.e. without me creating my own recursive method), for a given xpath (or other method of identifying the hierarchical position) to create/update an XML node, where the node would be created if it does not exist? This would need to create the parent node if it does not exist as well. I do have an XSD which includes all possible nodes.
i.e.
Before:
<employee>
<name>John Smith</name>
</employee>
Would like to call something like this:
CoolXmlUpdateMethod("/employee/address/city", "Los Angeles");
After:
<employee>
<name>John Smith</name>
<address>
<city>Los Angeles</city>
</address>
</employee>
Or even a method to create a node, given an xpath, wherein it will recursively create the parent node(s) if they do not exist?
As far as the application (if it matters), this is taking an existing XML doc that contains only populated nodes, and adding data to it from another system. The new data may or may not already have values populated in the source XML.
Surely this is not an uncommon scenario? | 0 |
11,660,640 | 07/26/2012 00:22:36 | 35,634 | 11/07/2008 21:56:36 | 12,952 | 426 | what is coldspring <map> eqv in wirebox? | I'm porting my Coldspring xml into Wirebox, but I'm stuck.
`<map>` in Coldspring can create a struct of singletons and then pass that struct into the 'bean' by constructor or setter.
What do I write in Wirebox.cfc to do the same thing?
<bean id="Foo" class="com.foo">
<constructor-arg name="something">
<map>
<entry key="apple">
<ref bean="apple"/>
</entry>
<entry key="banana">
<ref bean="banana"/>
</entry>
</map>
</constructor-arg>
</bean> | coldfusion | coldbox | coldspring | wirebox | null | null | open | what is coldspring <map> eqv in wirebox?
===
I'm porting my Coldspring xml into Wirebox, but I'm stuck.
`<map>` in Coldspring can create a struct of singletons and then pass that struct into the 'bean' by constructor or setter.
What do I write in Wirebox.cfc to do the same thing?
<bean id="Foo" class="com.foo">
<constructor-arg name="something">
<map>
<entry key="apple">
<ref bean="apple"/>
</entry>
<entry key="banana">
<ref bean="banana"/>
</entry>
</map>
</constructor-arg>
</bean> | 0 |
11,660,643 | 07/26/2012 00:22:49 | 553,609 | 12/24/2010 23:19:46 | 1,845 | 66 | Converting a pointer into a MemoryStream? | I am trying to fetch a *Device Independent Bitmap* from the clipboard. I am well-aware that this can be done through the Clipboard.GetData function inbuilt in the .NET Framework, but since it is very buggy (as documented many places on the web), I want to use the APIs only.
I have written the following code which works.
//i can correctly cast this to a MemoryStream
MemoryStream ms = Clipboard.GetData("DeviceIndependentBitmap") as MemoryStream;
But I want to use it with the APIs, which just return a pointer (an IntPtr) that point to the stream somehow. I took a look at the [UnmanagedMemoryStream][1] but fail to understand how to correctly convert an `IntPtr` into that.
Here's my API code (using the [GetClipboardData][2] API where the `CF_DIB` format is set as its argument).
IntPtr p = GetClipboardData(8);
//what do I do from here to get a MemoryStream from this pointer?
I'm a bit confused. I already researched it myself, but couldn't come up with something useful.
[1]: http://msdn.microsoft.com/en-us/library/system.io.unmanagedmemorystream.aspx
[2]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms649039%28v=vs.85%29.aspx | c# | wpf | clipboard | null | null | null | open | Converting a pointer into a MemoryStream?
===
I am trying to fetch a *Device Independent Bitmap* from the clipboard. I am well-aware that this can be done through the Clipboard.GetData function inbuilt in the .NET Framework, but since it is very buggy (as documented many places on the web), I want to use the APIs only.
I have written the following code which works.
//i can correctly cast this to a MemoryStream
MemoryStream ms = Clipboard.GetData("DeviceIndependentBitmap") as MemoryStream;
But I want to use it with the APIs, which just return a pointer (an IntPtr) that point to the stream somehow. I took a look at the [UnmanagedMemoryStream][1] but fail to understand how to correctly convert an `IntPtr` into that.
Here's my API code (using the [GetClipboardData][2] API where the `CF_DIB` format is set as its argument).
IntPtr p = GetClipboardData(8);
//what do I do from here to get a MemoryStream from this pointer?
I'm a bit confused. I already researched it myself, but couldn't come up with something useful.
[1]: http://msdn.microsoft.com/en-us/library/system.io.unmanagedmemorystream.aspx
[2]: http://msdn.microsoft.com/en-us/library/windows/desktop/ms649039%28v=vs.85%29.aspx | 0 |
11,660,650 | 07/26/2012 00:23:16 | 1,094,441 | 12/12/2011 19:46:37 | 13 | 0 | ActiveX Object is not Defined Error, How To Fix? | try {this.conn = new ActiveXObject("Msxml2.XMLHTTP");}
This is the line the code errors on. Even errors in IE, dont know what else to try. Thanks for the help. Much appreciated. Here is some more of the code:
function XmlHttp(target,parms) {
this.target = target;
this.parms = parms;
this.getHttpRequestObject();
}
XmlHttp.prototype.getHttpRequestObject = function() {
try {this.conn = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e) {
try {this.conn = new ActiveXObject("Microsoft.XMLHTTP");}
catch(E) {this.conn = false;}
try {this.conn = new XMLHttpRequest();}
catch(E) {this.conn = false;}
}
if (!this.conn && typeof XMLHttpRequest != 'undefined') {
this.conn = new XMLHttpRequest();
if (this.conn.overrideMimeType) {
this.conn.overrideMimeType('text/html');
}
}
}; | ajax | activex | null | null | null | null | open | ActiveX Object is not Defined Error, How To Fix?
===
try {this.conn = new ActiveXObject("Msxml2.XMLHTTP");}
This is the line the code errors on. Even errors in IE, dont know what else to try. Thanks for the help. Much appreciated. Here is some more of the code:
function XmlHttp(target,parms) {
this.target = target;
this.parms = parms;
this.getHttpRequestObject();
}
XmlHttp.prototype.getHttpRequestObject = function() {
try {this.conn = new ActiveXObject("Msxml2.XMLHTTP");}
catch(e) {
try {this.conn = new ActiveXObject("Microsoft.XMLHTTP");}
catch(E) {this.conn = false;}
try {this.conn = new XMLHttpRequest();}
catch(E) {this.conn = false;}
}
if (!this.conn && typeof XMLHttpRequest != 'undefined') {
this.conn = new XMLHttpRequest();
if (this.conn.overrideMimeType) {
this.conn.overrideMimeType('text/html');
}
}
}; | 0 |
11,660,579 | 07/26/2012 00:14:40 | 384,641 | 07/06/2010 14:33:28 | 792 | 23 | Getting sub-scores for sub-queries in Lucene | I have constructed a query that's essentially a weighted sum of other queries:
val query = new BooleanQuery
for ((subQuery, weight) <- ...) {
subQuery.setBoost(weight)
query.add(subQuery, BooleanClause.Occur.MUST)
}
When I query the index, I get back documents with the overall scores. This is good, but I also need to know what the sub-scores for each of the sub-queries were. How can I get those? Here's what I'm doing now:
for (scoreDoc <- searcher.search(query, nHits).scoreDocs) {
val score = scoreDoc.score
val subScores = subQueries.map { subQuery =>
val weight = searcher.createNormalizedWeight(subQuery)
val scorer = weight.scorer(reader, true, true)
scorer.advance(scoreDoc.doc)
scorer.score
}
}
I think this gives me the right scores, but it seems wasteful to advance to and re-score the document when I know it's already been scored as part of the overall score.
Is there a more efficient way to get those sub-scores?
[My code here is in Scala, but feel free to respond in Java if that's easier.]
| java | scala | lucene | null | null | null | open | Getting sub-scores for sub-queries in Lucene
===
I have constructed a query that's essentially a weighted sum of other queries:
val query = new BooleanQuery
for ((subQuery, weight) <- ...) {
subQuery.setBoost(weight)
query.add(subQuery, BooleanClause.Occur.MUST)
}
When I query the index, I get back documents with the overall scores. This is good, but I also need to know what the sub-scores for each of the sub-queries were. How can I get those? Here's what I'm doing now:
for (scoreDoc <- searcher.search(query, nHits).scoreDocs) {
val score = scoreDoc.score
val subScores = subQueries.map { subQuery =>
val weight = searcher.createNormalizedWeight(subQuery)
val scorer = weight.scorer(reader, true, true)
scorer.advance(scoreDoc.doc)
scorer.score
}
}
I think this gives me the right scores, but it seems wasteful to advance to and re-score the document when I know it's already been scored as part of the overall score.
Is there a more efficient way to get those sub-scores?
[My code here is in Scala, but feel free to respond in Java if that's easier.]
| 0 |
11,660,647 | 07/26/2012 00:23:09 | 1,553,136 | 07/26/2012 00:12:10 | 1 | 0 | Classic ASP Read CSV information inside an XML file | I have a script that reads an XML file using the DOM without problem. If I check the result, I get the CSV information contained in the node in question. However, I have a problem to read that information. I have a variable that contains it as a text/string, but I do not know how to split that text according to the new line in order to separate each CSV informations. As my search on the Web leads to a great lack of result, I allow me to ask this question to the community.
Note : I already try stuffs like :
myCsv = Replace(myCsv,vbCrLf,"<br>")
myCsv = Split(myCsv, "<br>")
or like : `myCsv = Split(myCsv, vbCrLf)`.
Thank you !
Regards,
Phil | xml | dom | csv | asp-classic | null | null | open | Classic ASP Read CSV information inside an XML file
===
I have a script that reads an XML file using the DOM without problem. If I check the result, I get the CSV information contained in the node in question. However, I have a problem to read that information. I have a variable that contains it as a text/string, but I do not know how to split that text according to the new line in order to separate each CSV informations. As my search on the Web leads to a great lack of result, I allow me to ask this question to the community.
Note : I already try stuffs like :
myCsv = Replace(myCsv,vbCrLf,"<br>")
myCsv = Split(myCsv, "<br>")
or like : `myCsv = Split(myCsv, vbCrLf)`.
Thank you !
Regards,
Phil | 0 |
11,465,223 | 07/13/2012 06:26:23 | 651,016 | 03/09/2011 06:03:22 | 692 | 25 | Using Photobucket api with Rails | I am trying to use Photobucket(API) as a image uploading option in my website.
Is there any available gem to do this? or should i use things like REST to achieve this?
Please suggest.
Thanks,
Balan | ruby-on-rails | photobucket | null | null | null | null | open | Using Photobucket api with Rails
===
I am trying to use Photobucket(API) as a image uploading option in my website.
Is there any available gem to do this? or should i use things like REST to achieve this?
Please suggest.
Thanks,
Balan | 0 |
11,465,224 | 07/13/2012 06:26:29 | 283,561 | 03/01/2010 11:24:16 | 434 | 14 | Build script for Visual Studio and Qt projects | I have an C++ application, which consists of serveral VS2010 projects and two Qt Creator projects (for the GUI).
I would like to have a build script, which builds all the projects at once. So what would be the best tool for the job?
| qt | visual-c++ | build-script | null | null | null | open | Build script for Visual Studio and Qt projects
===
I have an C++ application, which consists of serveral VS2010 projects and two Qt Creator projects (for the GUI).
I would like to have a build script, which builds all the projects at once. So what would be the best tool for the job?
| 0 |
11,472,525 | 07/13/2012 14:28:22 | 92,676 | 04/19/2009 05:15:17 | 691 | 3 | observe scroll view's 'dragging' property but received no notification | I have a custom view that is added to as a subview of a scrollview, and i want that view automatically repositioned whenever the scroll view scrolls. In addition to observe the scroll view's **contentOffset** property(which works fine), I also observes its **dragging** property:
[scrollView addObserver: self forKeyPath: @"dragging" options: NSKeyValueObservingOptionNew context: NULL];
but in the 'observeValueForKeyPath:ofObject:change:context' method, i didn't receive any notification for the change of the dragging property, what's the problem here? Thanks.
| objective-c | ios | key-value-observing | null | null | null | open | observe scroll view's 'dragging' property but received no notification
===
I have a custom view that is added to as a subview of a scrollview, and i want that view automatically repositioned whenever the scroll view scrolls. In addition to observe the scroll view's **contentOffset** property(which works fine), I also observes its **dragging** property:
[scrollView addObserver: self forKeyPath: @"dragging" options: NSKeyValueObservingOptionNew context: NULL];
but in the 'observeValueForKeyPath:ofObject:change:context' method, i didn't receive any notification for the change of the dragging property, what's the problem here? Thanks.
| 0 |
11,472,529 | 07/13/2012 14:28:36 | 1,142,359 | 01/11/2012 04:47:24 | 3 | 0 | Samsung Smart TV VOD App - How to switch from source to player and back to source | Working on a video on demand (VOD) app for Samsung Smart TV using the 2.5 SDK, I have pretty much all the functionally working.
The app should runs overlayed on live program but the screen is black (no source) then I select video, player loads and the video turns on and also when I exit the app the source gets lost... in my config.xml I have the following
>><fullwidget itemtype="boolean">fullwidget itemtype="boolean" = y </fullwidget><br>
<movie itemtype="string">movie itemtype="string" = y </movie><br>
<srcctl itemtype="boolean">srcctl itemtype="boolean" = y</srcctl>
>>
in addition to that i'm calling plugin.Stop() on onUnload
Has anyone else experienced this issue and, if so, did you manage to fix it?
PS: when srcctl = n the source comes up on the initial load but the vod loads with no audio and only source audio when exit the app source gets lost all together.
check the code shown below:
Main.onUnload = function(){
Player.deinit();
}
Player.deinit = function(){
if (this.plugin)
{
this.plugin.Stop();
}
} | javascript | html | css | samsung-smart-tv | null | null | open | Samsung Smart TV VOD App - How to switch from source to player and back to source
===
Working on a video on demand (VOD) app for Samsung Smart TV using the 2.5 SDK, I have pretty much all the functionally working.
The app should runs overlayed on live program but the screen is black (no source) then I select video, player loads and the video turns on and also when I exit the app the source gets lost... in my config.xml I have the following
>><fullwidget itemtype="boolean">fullwidget itemtype="boolean" = y </fullwidget><br>
<movie itemtype="string">movie itemtype="string" = y </movie><br>
<srcctl itemtype="boolean">srcctl itemtype="boolean" = y</srcctl>
>>
in addition to that i'm calling plugin.Stop() on onUnload
Has anyone else experienced this issue and, if so, did you manage to fix it?
PS: when srcctl = n the source comes up on the initial load but the vod loads with no audio and only source audio when exit the app source gets lost all together.
check the code shown below:
Main.onUnload = function(){
Player.deinit();
}
Player.deinit = function(){
if (this.plugin)
{
this.plugin.Stop();
}
} | 0 |
11,472,460 | 07/13/2012 14:24:58 | 1,015,974 | 10/27/2011 06:53:13 | 173 | 7 | array search not working in php | i am trying to find picid in array but its not working . when u echo it nothing appears .
here is my code
<?php $psql=mysql_query("select * from gallery where userId='$miid'");
$photo1 = array();
while($photo=mysql_fetch_assoc($psql)){
$photo1[]=$photo;
print_r($photo);
}
foreach($photo1 as $k => $v){
if($v['picId']==$mipic){
$pic="uploads/".$v['photo'];
echo ">>>". $key=array_search($v['picId'],$photo1);
?>
| php | arrays | null | null | null | null | open | array search not working in php
===
i am trying to find picid in array but its not working . when u echo it nothing appears .
here is my code
<?php $psql=mysql_query("select * from gallery where userId='$miid'");
$photo1 = array();
while($photo=mysql_fetch_assoc($psql)){
$photo1[]=$photo;
print_r($photo);
}
foreach($photo1 as $k => $v){
if($v['picId']==$mipic){
$pic="uploads/".$v['photo'];
echo ">>>". $key=array_search($v['picId'],$photo1);
?>
| 0 |
11,373,428 | 07/07/2012 08:12:56 | 1,508,408 | 07/07/2012 07:38:01 | 1 | 0 | Is it possible to use Enum constants as templates for instantiable classes in Java? | What I'd like to be able to do is define an Enum, eg.:
public enum Animals {
Cow,
Chicken,
Sheep,
Horse;
}
and have each enum constant define an instantiable class that's not a local class. Would the following work? And if not, why, and what would?
In some file:
abstract public class Animal {
private String nameString;
public String getName() {
return nameString;
}
}
In another:
public enum Animals {
Cow ((new Animal() {
private boolean hasMilk;
{
nameString = "Cow";
hasMilk = false;
}
public boolean hasMilk() {
return hasMilk;
}
}).getClass()),
Chicken ((new Animal() {
private boolean hasFeathers;
{
nameString = "Chicken";
hasFeathers = true;
}
public boolean hasFeathers() {
return hasFeathers;
}
}).getClass()),
Sheep ((new Animal() {
private boolean isShorn;
{
nameString = "Cow";
isShorn = false;
}
public boolean isShorn() {
return isShorn;
}
public void Shear() {
isShorn = true;
}
}).getClass()),
Horse ((new Animal() {
{
nameString = "Cow";
}
}).getClass());
private Class<? extends Animal> animalClass;
private Animals(Class<? extends Animal> a) {
animalClass = a;
}
public Class<? extends Animal> getAnimalClass() {
return animalClass;
}
}
And then, in some other method of some other class, be able to do this:
Animal farmAnimal;
farmAnimal = Animals.Sheep.getAnimalClass().newInstance();
boolean shorn = farmAnimal.isShorn();
(The value of `shorn` being `false` at this point);
farmAnimal.shear();
shorn = farmAnimal.isShorn();
(`shorn == true`)
farmAnimal = Animals.Sheep.getAnimalClass().newInstance();
shorn = farmAnimal.isShorn();
(`shorn == false`)
Obviously, this isn't the best way to do what I've done here, but that's not the point. I know I can specify behaviour for enum constants, but that doesn't make them instantiable. I want to be able to create multiple instances (or copies) of various enum constants, which I can then do stuff to (alter instance variables) without modifying the enum constant. | java | class | templates | enums | instantiation | null | open | Is it possible to use Enum constants as templates for instantiable classes in Java?
===
What I'd like to be able to do is define an Enum, eg.:
public enum Animals {
Cow,
Chicken,
Sheep,
Horse;
}
and have each enum constant define an instantiable class that's not a local class. Would the following work? And if not, why, and what would?
In some file:
abstract public class Animal {
private String nameString;
public String getName() {
return nameString;
}
}
In another:
public enum Animals {
Cow ((new Animal() {
private boolean hasMilk;
{
nameString = "Cow";
hasMilk = false;
}
public boolean hasMilk() {
return hasMilk;
}
}).getClass()),
Chicken ((new Animal() {
private boolean hasFeathers;
{
nameString = "Chicken";
hasFeathers = true;
}
public boolean hasFeathers() {
return hasFeathers;
}
}).getClass()),
Sheep ((new Animal() {
private boolean isShorn;
{
nameString = "Cow";
isShorn = false;
}
public boolean isShorn() {
return isShorn;
}
public void Shear() {
isShorn = true;
}
}).getClass()),
Horse ((new Animal() {
{
nameString = "Cow";
}
}).getClass());
private Class<? extends Animal> animalClass;
private Animals(Class<? extends Animal> a) {
animalClass = a;
}
public Class<? extends Animal> getAnimalClass() {
return animalClass;
}
}
And then, in some other method of some other class, be able to do this:
Animal farmAnimal;
farmAnimal = Animals.Sheep.getAnimalClass().newInstance();
boolean shorn = farmAnimal.isShorn();
(The value of `shorn` being `false` at this point);
farmAnimal.shear();
shorn = farmAnimal.isShorn();
(`shorn == true`)
farmAnimal = Animals.Sheep.getAnimalClass().newInstance();
shorn = farmAnimal.isShorn();
(`shorn == false`)
Obviously, this isn't the best way to do what I've done here, but that's not the point. I know I can specify behaviour for enum constants, but that doesn't make them instantiable. I want to be able to create multiple instances (or copies) of various enum constants, which I can then do stuff to (alter instance variables) without modifying the enum constant. | 0 |
11,373,431 | 07/07/2012 08:14:00 | 910,854 | 08/24/2011 23:31:05 | 166 | 17 | Upload Image to parse.com usint REST API + PHP | Currently using this, but file that is stored is empty, so I supose no data is going through.
$post = array("file"=>'@'.$_FILES['uploadfile']['tmp_name']);
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Parse-Application-Id : XXXXXXXXXXXXXX','X-Parse-REST-API-Key: XXXXXXXXx', 'Content-type: image/jpeg'));
curl_setopt($ch, CURLOPT_URL, 'https://api.parse.com/1/files/'.$_FILES['uploadfile']['name']);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post));
$result=curl_exec ($ch);
curl_close ($ch);
echo $result; | php | parse.com | null | null | null | null | open | Upload Image to parse.com usint REST API + PHP
===
Currently using this, but file that is stored is empty, so I supose no data is going through.
$post = array("file"=>'@'.$_FILES['uploadfile']['tmp_name']);
$ch = curl_init();
curl_setopt($ch,CURLOPT_HTTPHEADER,array('X-Parse-Application-Id : XXXXXXXXXXXXXX','X-Parse-REST-API-Key: XXXXXXXXx', 'Content-type: image/jpeg'));
curl_setopt($ch, CURLOPT_URL, 'https://api.parse.com/1/files/'.$_FILES['uploadfile']['name']);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_BINARYTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($post));
$result=curl_exec ($ch);
curl_close ($ch);
echo $result; | 0 |
11,373,443 | 07/07/2012 08:15:47 | 1,506,061 | 07/06/2012 07:34:04 | 1 | 0 | How to set Tab View Indicator background color in Android | How to Change color on click tab Host. i can change image but color are not change.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TabHost tabHost=(TabHost)findViewById(R.id.tabHost);
tabHost.setup();
TabSpec spec1=tabHost.newTabSpec("Tab 1");
spec1.setContent(R.id.tab1);`enter code here`
spec1.setIndicator("Tab 1", getResources().getDrawable(setBackgroundColor(Color.RED));
TabSpec spec2=tabHost.newTabSpec("Tab 2");
spec2.setIndicator("Tab 2", getResources().getDrawable(setBackgroundColor(Color.GREAN));
spec2.setContent(R.id.tab2);
TabSpec spec3=tabHost.newTabSpec("Tab 3");
spec3.setIndicator("Tab 3", getResources().getDrawable(setBackgroundColor(Color.BLACK));
spec3.setContent(R.id.tab3);
tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.addTab(spec3);
}
} | android | null | null | null | null | null | open | How to set Tab View Indicator background color in Android
===
How to Change color on click tab Host. i can change image but color are not change.
public class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TabHost tabHost=(TabHost)findViewById(R.id.tabHost);
tabHost.setup();
TabSpec spec1=tabHost.newTabSpec("Tab 1");
spec1.setContent(R.id.tab1);`enter code here`
spec1.setIndicator("Tab 1", getResources().getDrawable(setBackgroundColor(Color.RED));
TabSpec spec2=tabHost.newTabSpec("Tab 2");
spec2.setIndicator("Tab 2", getResources().getDrawable(setBackgroundColor(Color.GREAN));
spec2.setContent(R.id.tab2);
TabSpec spec3=tabHost.newTabSpec("Tab 3");
spec3.setIndicator("Tab 3", getResources().getDrawable(setBackgroundColor(Color.BLACK));
spec3.setContent(R.id.tab3);
tabHost.addTab(spec1);
tabHost.addTab(spec2);
tabHost.addTab(spec3);
}
} | 0 |
11,373,448 | 07/07/2012 08:16:46 | 772,481 | 04/27/2011 09:02:26 | 309 | 8 | Restkit: Post Json Array and Map response to Managed Objects | Here is my setup, Post a list of objects in Json to server and got back with updated results that will be mapped to core data and updated.
-- Post Boday --
{
"memberId": "1000000",
"contacts": [
{
"phoneNumber": "+12233333333",
"firstName": "john",
"lastName": "H"
},
{
"phoneNumber": "+12244444444",
"firstName": "mary",
"lastName": "K"
}
]
}
-- Post Response --
{
"contacts": [
{
"phoneNumber": "+12233333333",
"firstName": "john",
"lastName": "k",
"isMember": "yes"
},
{
"phoneNumber": "+12244444444",
"firstName": "mary",
"lastName": "k",
"isMember": "no"
}
]
}
I found another thread which discusses very similar to my case. http://stackoverflow.com/q/7726437/772481
This is my setup.
-- SHContact.h --
@interface SHContact : NSManagedObject {}
@property (nonatomic, strong) NSString* phoneNumber;
@property (nonatomic, strong) NSString* firstName;
@property (nonatomic, strong) NSString* lastName;
@property (nonatomic, strong) NSNumber* isMember;
@end
-- SHContactPost.m --
#import "SHContactPost.h"
@implementation SHContactPost
@synthesize contacts;
@synthesize memberId;
@synthesize countryCode;
- (NSArray*)contacts {
return <list-of-SHContact>;
}
- (NSString *)memberId {
return @"my-member-id";
}
@end
-- RK Mapping --
// Setup our object mappings for SHContact
RKManagedObjectMapping* contactMapping =
[RKManagedObjectMapping mappingForClass:[SHContact class]
inManagedObjectStore:objectManager.objectStore];
contactMapping.primaryKeyAttribute = @"phoneNumber";
[contactMapping mapAttributes:@"phoneNumber",
@"firstName", @"lastName", @"isMember", nil];
[objectManager.mappingProvider setObjectMapping:contactMapping
forKeyPath:@"contacts"];
[[objectManager mappingProvider]
setSerializationMapping:[contactMapping inverseMapping]
forClass:[SHContact class]];
RKObjectMapping *cPostMapping = [RKObjectMapping
mappingForClass:[SHContactPost class]];
[cPostMapping mapKeyPath:@"contacts"
toRelationship:@"contacts"
withMapping:contactMapping];
[cPostMapping mapAttributes:@"memberId", nil];
[objectManager.mappingProvider
setSerializationMapping:[cPostMapping inverseMapping]
forClass:[SHContactPost class]];
[objectManager.router routeClass:[SHContactPost class]
toResourcePath:@"/contacts"
forMethod:RKRequestMethodPOST];
objectManager.serializationMIMEType = RKMIMETypeJSON;
-- Post to server --
SHContactPost *post = [[SHContactPost alloc] init];
RKObjectManager* manager = [RKObjectManager sharedManager];
[manager postObject:post delegate:self];
Server post and response is **SUCCESSFUL**. However, Reskit was not able to map the result back to the list of SHContact objects. This is the exception. Am I missing something?
restkit.network:RKObjectLoader.m:222 Encountered errors during mapping:
Cannot map a collection of objects onto a non-mutable collection.
Unexpected destination object type 'SHContactPost'
| objective-c | ios | json | restkit | null | null | open | Restkit: Post Json Array and Map response to Managed Objects
===
Here is my setup, Post a list of objects in Json to server and got back with updated results that will be mapped to core data and updated.
-- Post Boday --
{
"memberId": "1000000",
"contacts": [
{
"phoneNumber": "+12233333333",
"firstName": "john",
"lastName": "H"
},
{
"phoneNumber": "+12244444444",
"firstName": "mary",
"lastName": "K"
}
]
}
-- Post Response --
{
"contacts": [
{
"phoneNumber": "+12233333333",
"firstName": "john",
"lastName": "k",
"isMember": "yes"
},
{
"phoneNumber": "+12244444444",
"firstName": "mary",
"lastName": "k",
"isMember": "no"
}
]
}
I found another thread which discusses very similar to my case. http://stackoverflow.com/q/7726437/772481
This is my setup.
-- SHContact.h --
@interface SHContact : NSManagedObject {}
@property (nonatomic, strong) NSString* phoneNumber;
@property (nonatomic, strong) NSString* firstName;
@property (nonatomic, strong) NSString* lastName;
@property (nonatomic, strong) NSNumber* isMember;
@end
-- SHContactPost.m --
#import "SHContactPost.h"
@implementation SHContactPost
@synthesize contacts;
@synthesize memberId;
@synthesize countryCode;
- (NSArray*)contacts {
return <list-of-SHContact>;
}
- (NSString *)memberId {
return @"my-member-id";
}
@end
-- RK Mapping --
// Setup our object mappings for SHContact
RKManagedObjectMapping* contactMapping =
[RKManagedObjectMapping mappingForClass:[SHContact class]
inManagedObjectStore:objectManager.objectStore];
contactMapping.primaryKeyAttribute = @"phoneNumber";
[contactMapping mapAttributes:@"phoneNumber",
@"firstName", @"lastName", @"isMember", nil];
[objectManager.mappingProvider setObjectMapping:contactMapping
forKeyPath:@"contacts"];
[[objectManager mappingProvider]
setSerializationMapping:[contactMapping inverseMapping]
forClass:[SHContact class]];
RKObjectMapping *cPostMapping = [RKObjectMapping
mappingForClass:[SHContactPost class]];
[cPostMapping mapKeyPath:@"contacts"
toRelationship:@"contacts"
withMapping:contactMapping];
[cPostMapping mapAttributes:@"memberId", nil];
[objectManager.mappingProvider
setSerializationMapping:[cPostMapping inverseMapping]
forClass:[SHContactPost class]];
[objectManager.router routeClass:[SHContactPost class]
toResourcePath:@"/contacts"
forMethod:RKRequestMethodPOST];
objectManager.serializationMIMEType = RKMIMETypeJSON;
-- Post to server --
SHContactPost *post = [[SHContactPost alloc] init];
RKObjectManager* manager = [RKObjectManager sharedManager];
[manager postObject:post delegate:self];
Server post and response is **SUCCESSFUL**. However, Reskit was not able to map the result back to the list of SHContact objects. This is the exception. Am I missing something?
restkit.network:RKObjectLoader.m:222 Encountered errors during mapping:
Cannot map a collection of objects onto a non-mutable collection.
Unexpected destination object type 'SHContactPost'
| 0 |
11,410,424 | 07/10/2012 09:33:45 | 1,281,940 | 03/20/2012 20:48:13 | 26 | 1 | magento - cloning webshop results in http500 - PHP fatal error | i am trying to clone my webshop again for a test environment.
(magento 1.6.2 on a dedicated server)
I never had any trouble doing this.
I just deleted all the old content in FTP and DB and then i make a copy of the live store and synchronize the db.
Then i change the url in the db and the test-db in the local.xml.
I also clean the var/cache and var/session.
This always worked well.
But yesterday did the same ... but now i get a http 500 error. (white screen)
From the error logs:
"GET / HTTP/1.1" 500 222 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1"
and
PHP Fatal error: Call to a member function getCode() on a non-object in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/App.php on line 701
I tried to use the magento-cleanup.php and i also changed all permissions to 775.
But all without result ...
Has anyone have a clue? | php | magento | fatal-error | magento-1.6 | null | null | open | magento - cloning webshop results in http500 - PHP fatal error
===
i am trying to clone my webshop again for a test environment.
(magento 1.6.2 on a dedicated server)
I never had any trouble doing this.
I just deleted all the old content in FTP and DB and then i make a copy of the live store and synchronize the db.
Then i change the url in the db and the test-db in the local.xml.
I also clean the var/cache and var/session.
This always worked well.
But yesterday did the same ... but now i get a http 500 error. (white screen)
From the error logs:
"GET / HTTP/1.1" 500 222 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20100101 Firefox/13.0.1"
and
PHP Fatal error: Call to a member function getCode() on a non-object in /var/www/vhosts/liefstoereigenwijs.nl/testwinkel/app/code/core/Mage/Core/Model/App.php on line 701
I tried to use the magento-cleanup.php and i also changed all permissions to 775.
But all without result ...
Has anyone have a clue? | 0 |
11,411,028 | 07/10/2012 10:09:22 | 1,140,468 | 01/10/2012 09:06:27 | 3 | 0 | Jetty/Tomcat without reverse proxy | Is it safe to handle requests directly by Jetty or Tomcat?
Or only reverse proxy (such as nginx) can prevent abuses (slow data transferring on purpose etc)?
PS: ofcouse I serve static content with nginx =) | java | tomcat | nginx | jetty | null | null | open | Jetty/Tomcat without reverse proxy
===
Is it safe to handle requests directly by Jetty or Tomcat?
Or only reverse proxy (such as nginx) can prevent abuses (slow data transferring on purpose etc)?
PS: ofcouse I serve static content with nginx =) | 0 |
11,410,464 | 07/10/2012 09:35:59 | 1,514,286 | 07/10/2012 09:11:40 | 1 | 0 | Can I create a Hangout "client" program? (kind of Google TalkAbout) | As stated in the [Google Talk for Developers site](https://developers.google.com/talk/talk_developers_home), you can use the provided APIs to build a client that connects to the Google Talk service.
I would like to know if it's possible (or it will be in the near future) to build a similar client to the google hangouts.
What we pretend is to build something similar to cloud print, that provides printing services to the cloud, but for audio/video streaming: a camera and microphone would replace the
printer.
Thanks a lot. | google-plus | gtalk | null | null | null | null | open | Can I create a Hangout "client" program? (kind of Google TalkAbout)
===
As stated in the [Google Talk for Developers site](https://developers.google.com/talk/talk_developers_home), you can use the provided APIs to build a client that connects to the Google Talk service.
I would like to know if it's possible (or it will be in the near future) to build a similar client to the google hangouts.
What we pretend is to build something similar to cloud print, that provides printing services to the cloud, but for audio/video streaming: a camera and microphone would replace the
printer.
Thanks a lot. | 0 |
11,410,465 | 07/10/2012 09:36:03 | 549,487 | 12/21/2010 04:30:18 | 41 | 4 | I want to remember a (NSIndexPath *)indexPath for later deleting, but crashed | I define a member like this :
@property (nonatomic, retain) NSIndexPath *deletingIndexPath; //记录当前需要删除的行
And assign it in
- (void)tableView:(UITableView *)atableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
...
deletingIndexPath = indexPath;
...
}
And use it in another CallBack Function
NSArray *deleteIndexPaths = [NSArray arrayWithObjects:deletingIndexPath,nil];
[self.tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];
And it crashed...
in simulator it says
2012-07-10 16:56:54.887 p[20972:16a03] *** Assertion failure in -[NSIndexPath row], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableViewSupport.m:2606
2012-07-10 16:56:54.898 p[20972:16a03] Uncaught exception: Invalid index path for use with UITableView. Index paths passed to table view must contain exactly two indices specifying the section and row. Please use the category on NSIndexPath in UITableView.h if possible.
Who can tell me why? | ios | xcode | uitableview | memory | null | null | open | I want to remember a (NSIndexPath *)indexPath for later deleting, but crashed
===
I define a member like this :
@property (nonatomic, retain) NSIndexPath *deletingIndexPath; //记录当前需要删除的行
And assign it in
- (void)tableView:(UITableView *)atableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
...
deletingIndexPath = indexPath;
...
}
And use it in another CallBack Function
NSArray *deleteIndexPaths = [NSArray arrayWithObjects:deletingIndexPath,nil];
[self.tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];
And it crashed...
in simulator it says
2012-07-10 16:56:54.887 p[20972:16a03] *** Assertion failure in -[NSIndexPath row], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableViewSupport.m:2606
2012-07-10 16:56:54.898 p[20972:16a03] Uncaught exception: Invalid index path for use with UITableView. Index paths passed to table view must contain exactly two indices specifying the section and row. Please use the category on NSIndexPath in UITableView.h if possible.
Who can tell me why? | 0 |
11,411,032 | 07/10/2012 10:09:33 | 284,795 | 03/02/2010 21:40:24 | 1,210 | 53 | Powershell documentation site root | I found a page of Powershell documentation dated 2010 written for Powershell version 2.
http://technet.microsoft.com/en-us/library/dd315303.aspx
That page is for a particular command. Where is the documentation front page where I can read the rest of the documentation for version 2? The left sidebar just shows 'TechNet Library' to me and has no Powershell links.
* * *
I found the docs for old Powershell version 1 and pre-release version 3. On these pages the left sidebar works so it's easy to navigate to the front-page
Version 1 doc page http://technet.microsoft.com/en-us/library/ee176924.aspx to front page http://technet.microsoft.com/en-us/library/hh848793
Version 3 doc page http://technet.microsoft.com/library/hh849882.aspx to front page http://technet.microsoft.com/en-us/library/bb978526 | powershell | msdn | technet | null | null | null | open | Powershell documentation site root
===
I found a page of Powershell documentation dated 2010 written for Powershell version 2.
http://technet.microsoft.com/en-us/library/dd315303.aspx
That page is for a particular command. Where is the documentation front page where I can read the rest of the documentation for version 2? The left sidebar just shows 'TechNet Library' to me and has no Powershell links.
* * *
I found the docs for old Powershell version 1 and pre-release version 3. On these pages the left sidebar works so it's easy to navigate to the front-page
Version 1 doc page http://technet.microsoft.com/en-us/library/ee176924.aspx to front page http://technet.microsoft.com/en-us/library/hh848793
Version 3 doc page http://technet.microsoft.com/library/hh849882.aspx to front page http://technet.microsoft.com/en-us/library/bb978526 | 0 |
11,411,036 | 07/10/2012 10:09:44 | 397,830 | 07/21/2010 10:51:45 | 1,106 | 31 | Oracle: Cannot connect from entity framework | I've an oracle server, already installed on a remote server.
I've installed oracle latest provider, to use them in visual studio with entity framework.
But when I'm trying to connect to the server, I got this exception:
ORA-12560: TNS:protocol adapter error.
I'm really new to the oracle world, and I cannot find what is the problem or even how to debug it.
I saw that listeners are ups, by doing a `lsnrctl status` I've my listener on the port 1521.
But, I saw that i've the security like this: "`Security ON: Local OS Authentication`", but since I've no common users between the server and the client, can it make somes troubles?
Should I have some specials rights on my user? In local, I can connect myself with the sqldeveloper tools.
Any help would be greatly appreciated
| c# | .net | oracle | entity-framework | null | null | open | Oracle: Cannot connect from entity framework
===
I've an oracle server, already installed on a remote server.
I've installed oracle latest provider, to use them in visual studio with entity framework.
But when I'm trying to connect to the server, I got this exception:
ORA-12560: TNS:protocol adapter error.
I'm really new to the oracle world, and I cannot find what is the problem or even how to debug it.
I saw that listeners are ups, by doing a `lsnrctl status` I've my listener on the port 1521.
But, I saw that i've the security like this: "`Security ON: Local OS Authentication`", but since I've no common users between the server and the client, can it make somes troubles?
Should I have some specials rights on my user? In local, I can connect myself with the sqldeveloper tools.
Any help would be greatly appreciated
| 0 |
11,628,418 | 07/24/2012 09:58:09 | 1,548,233 | 07/24/2012 09:41:29 | 1 | 0 | GIT - Can't ignore .suo file | i'm trying to work using Git - Extension with a colleague, in an application written in C #.
We have been added on the file .gitignore the file "project1.suo" but every time one of us have to commit the project, Git seems tell us to commit the file "project1.suo".
we have try many method to add the file in .gitignore like that:
*.suo
project1.suo
c:\project\project1.suo
we cant fix this problem.
Someone can help?
Thanks in Advice | c# | null | null | null | null | null | open | GIT - Can't ignore .suo file
===
i'm trying to work using Git - Extension with a colleague, in an application written in C #.
We have been added on the file .gitignore the file "project1.suo" but every time one of us have to commit the project, Git seems tell us to commit the file "project1.suo".
we have try many method to add the file in .gitignore like that:
*.suo
project1.suo
c:\project\project1.suo
we cant fix this problem.
Someone can help?
Thanks in Advice | 0 |
11,628,420 | 07/24/2012 09:58:13 | 1,211,349 | 02/15/2012 12:48:05 | 31 | 7 | Server/Client stop 1 thread = 1 clients | Sorry for my bad english but i'm french.
Protocol : TCP
I have a server with a SocketServer accept clients and put the socket (get from ss.accept()) in an array.
I have 1 thread who need to be notify when a socket is ready to be read (client sent data).
This thread will dispatche the request to others thread to process it so this thread is really simple and fast.
Is it possible ?
I really want to evade 1 thread = 1 client, i need 1 thread = N clients.
Thanks. | java | multithreading | sockets | null | null | null | open | Server/Client stop 1 thread = 1 clients
===
Sorry for my bad english but i'm french.
Protocol : TCP
I have a server with a SocketServer accept clients and put the socket (get from ss.accept()) in an array.
I have 1 thread who need to be notify when a socket is ready to be read (client sent data).
This thread will dispatche the request to others thread to process it so this thread is really simple and fast.
Is it possible ?
I really want to evade 1 thread = 1 client, i need 1 thread = N clients.
Thanks. | 0 |
11,628,424 | 07/24/2012 09:58:28 | 1,420,169 | 05/27/2012 13:26:00 | 89 | 1 | When to use tempfile, pickle, json or open() | I know Python has many ways of dumping files, so I would like to know what the best practices are for the above 4, and when each is most applicable.
Also, please let me know if there are any other modules/functions I should be aware of. | python | json | open | dump | pickle | null | open | When to use tempfile, pickle, json or open()
===
I know Python has many ways of dumping files, so I would like to know what the best practices are for the above 4, and when each is most applicable.
Also, please let me know if there are any other modules/functions I should be aware of. | 0 |
11,628,432 | 07/24/2012 09:58:46 | 1,298,775 | 03/28/2012 16:48:57 | 22 | 0 | C# Allow simulataneous console input and output | I'm trying to learn my way around C# threading by making a simple little game. I've run into a bit of an issue that I could certainly use help with.
My desire is to have simultaneous input and output. The output from the threads would appear at the top of the screen, while the user's input could be typed to the bottom of the screen. The problem I am running into is that in order to refresh the screen, when I use "Console.Clear()", it also wipes out whatever the user is typing! Below I have attached an extremely simplified version of what I am trying to do (in order to avoid unnecessary code getting in the way of the actual issue). Please note: While in this example I am only updating a single character at the top of the screen, my actual program would have LOTS of text all over the top and middle of the screen that would be constantly changing with every tick (which I plan to use at 1.5 seconds).
Any ideas would be great! I'm still new to C# programming and would be thrilled for any help you could give :) The only thing here that I am attached to is the design. System output at the top, user input at the very bottom preceeded by ">". If the way I am doing it is wrong, I have no issue with tossing it all out the window and doing it a different way.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace ConsoleApplication2
{
class Program
{
static int i = 0;
static void Main(string[] args)
{
Thread tickThread = new Thread(new ThreadStart(CountThread));
Thread userThread = new Thread(new ThreadStart(UserInput));
tickThread.Start();
Thread.Sleep(1);
userThread.Start();
Thread.Sleep(20000);
tickThread.Abort();
userThread.Abort();
}
static void UserInput()
{
string input = "";
while (true)
{
input = Console.ReadLine();
}
}
static void CountThread()
{
while (true)
{
Console.Clear();
Console.SetCursorPosition(0, 0);
Console.WriteLine(i);
i++;
Console.SetCursorPosition(0, Console.WindowHeight - 1);
Console.Write("> ");
Thread.Sleep(1500);
}
}
}
} | c# | multithreading | console | null | null | null | open | C# Allow simulataneous console input and output
===
I'm trying to learn my way around C# threading by making a simple little game. I've run into a bit of an issue that I could certainly use help with.
My desire is to have simultaneous input and output. The output from the threads would appear at the top of the screen, while the user's input could be typed to the bottom of the screen. The problem I am running into is that in order to refresh the screen, when I use "Console.Clear()", it also wipes out whatever the user is typing! Below I have attached an extremely simplified version of what I am trying to do (in order to avoid unnecessary code getting in the way of the actual issue). Please note: While in this example I am only updating a single character at the top of the screen, my actual program would have LOTS of text all over the top and middle of the screen that would be constantly changing with every tick (which I plan to use at 1.5 seconds).
Any ideas would be great! I'm still new to C# programming and would be thrilled for any help you could give :) The only thing here that I am attached to is the design. System output at the top, user input at the very bottom preceeded by ">". If the way I am doing it is wrong, I have no issue with tossing it all out the window and doing it a different way.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace ConsoleApplication2
{
class Program
{
static int i = 0;
static void Main(string[] args)
{
Thread tickThread = new Thread(new ThreadStart(CountThread));
Thread userThread = new Thread(new ThreadStart(UserInput));
tickThread.Start();
Thread.Sleep(1);
userThread.Start();
Thread.Sleep(20000);
tickThread.Abort();
userThread.Abort();
}
static void UserInput()
{
string input = "";
while (true)
{
input = Console.ReadLine();
}
}
static void CountThread()
{
while (true)
{
Console.Clear();
Console.SetCursorPosition(0, 0);
Console.WriteLine(i);
i++;
Console.SetCursorPosition(0, Console.WindowHeight - 1);
Console.Write("> ");
Thread.Sleep(1500);
}
}
}
} | 0 |
11,350,800 | 07/05/2012 18:59:20 | 425,367 | 08/19/2010 14:35:28 | 2,536 | 189 | Play constantly writes to disc? Causing higher bill on Amazon ec2 | I've got myself an Amazon ec2 Micro Instance (A VPN Server) to play around with.<br/>
The problem is that Amazon charge you for every disc IO you do in a Micro Instance.<br/>
The instance is running Amazon Linux a flavor of CentOS.
I've started a Scala application in Play 2.0(.2) framework on the server and I'm the only one who connects to the application.
I have observed that every few second something on the server commits IO transactions, to narrow it down I installed a Linux program called `iotop`.
Here is an output after a couple of seconds.
TID PRIO USER DISK READ DISK WRITE SWAPIN IO>
23333 be/4 root 0.00 B/s 11.91 K/s 0.00 % 0.00 %
COMMAND java -Dsbt.ivy.home=/usr/play-2.0.2/framework/../repository -Djava.runtime.name=OpenJDK ~/jars/slf4j-api.jar:/usr/play-2.0.2/repository/local/org.slf4j/jul-to-slf4j/1.6.4/jars/j
A cat from the log file
cat /home/ec2-user/socketTest/logs/application.log
2012-07-05 11:43:31,881 - [INFO] - from play in main
Listening for HTTP on port 9000...
So Play doesn't write anything to the log file.
First question have I understood the iotop correct and that Play indeed is the disc IO thief.<br/>
If so why do play use IO?
My application is a simple websocket example. In essence it echos the input to the output. The IO occurs even thou nothing is pushed thru websockets. | linux | scala | amazon-ec2 | websocket | playframework-2.0 | null | open | Play constantly writes to disc? Causing higher bill on Amazon ec2
===
I've got myself an Amazon ec2 Micro Instance (A VPN Server) to play around with.<br/>
The problem is that Amazon charge you for every disc IO you do in a Micro Instance.<br/>
The instance is running Amazon Linux a flavor of CentOS.
I've started a Scala application in Play 2.0(.2) framework on the server and I'm the only one who connects to the application.
I have observed that every few second something on the server commits IO transactions, to narrow it down I installed a Linux program called `iotop`.
Here is an output after a couple of seconds.
TID PRIO USER DISK READ DISK WRITE SWAPIN IO>
23333 be/4 root 0.00 B/s 11.91 K/s 0.00 % 0.00 %
COMMAND java -Dsbt.ivy.home=/usr/play-2.0.2/framework/../repository -Djava.runtime.name=OpenJDK ~/jars/slf4j-api.jar:/usr/play-2.0.2/repository/local/org.slf4j/jul-to-slf4j/1.6.4/jars/j
A cat from the log file
cat /home/ec2-user/socketTest/logs/application.log
2012-07-05 11:43:31,881 - [INFO] - from play in main
Listening for HTTP on port 9000...
So Play doesn't write anything to the log file.
First question have I understood the iotop correct and that Play indeed is the disc IO thief.<br/>
If so why do play use IO?
My application is a simple websocket example. In essence it echos the input to the output. The IO occurs even thou nothing is pushed thru websockets. | 0 |
11,350,801 | 07/05/2012 18:59:24 | 566,637 | 01/07/2011 08:48:15 | 16 | 2 | What if crash handler doesn't catch expcetion? | I'm using [google-breakpad](http://code.google.com/p/google-breakpad/).
Bug report program is running as background to report parent process's crash.
It works almost situation.
Sometime, it can not catch exception. No report, no dump file.
It just crashed. (Last clue for crash is windows event message anyway)
What methods are remained for this situation? | c++ | exception | crash | crash-dumps | breakpad | null | open | What if crash handler doesn't catch expcetion?
===
I'm using [google-breakpad](http://code.google.com/p/google-breakpad/).
Bug report program is running as background to report parent process's crash.
It works almost situation.
Sometime, it can not catch exception. No report, no dump file.
It just crashed. (Last clue for crash is windows event message anyway)
What methods are remained for this situation? | 0 |
11,350,810 | 07/05/2012 19:00:23 | 1,504,915 | 07/05/2012 18:43:21 | 1 | 0 | Displaying php variables for the value in text boxes | I need to have users choose a task to edit from a drop down box. I need to take this value and perform a SELECT query to fill out a form with the results of this query. I have the drop down menu working fine. I am accurately passing the value through the $_POST['taskID'] variable. I am loading the proper value into $taskName. I added the print_r and echos at the bottom of this as a test to make certain I was getting the proper values. I have tried using every syntax choice I have found in the forums. This would include single quotes, using echo, adding a semi colon, etc. I am using this in a .php file. Any help would be greatly appreciated.
This is the code I am using:
Task Name: <input type="text" size="32" maxlength="32" value="<?= $taskName ?>" /><br /><br />
<?php
$tidHolder = $_POST['taskID'];
include( 'inc/mice.inc.php' );
$cxn = mysqli_connect( $host, $user, $password, $database );
$sql = "SELECT taskName FROM taskManager_tasks WHERE tid = '$tidHolder'" ;
$sqlResult = mysqli_query( $cxn, $sql);
if (!$sqlResult)
{
die('Could not connect: ' . mysql_error());
}
$row = mysqli_fetch_assoc($sqlResult);
$taskName=$row['taskName'];
echo $tidHolder;
print_r($_POST);
echo $taskName;
?> | php | null | null | null | null | null | open | Displaying php variables for the value in text boxes
===
I need to have users choose a task to edit from a drop down box. I need to take this value and perform a SELECT query to fill out a form with the results of this query. I have the drop down menu working fine. I am accurately passing the value through the $_POST['taskID'] variable. I am loading the proper value into $taskName. I added the print_r and echos at the bottom of this as a test to make certain I was getting the proper values. I have tried using every syntax choice I have found in the forums. This would include single quotes, using echo, adding a semi colon, etc. I am using this in a .php file. Any help would be greatly appreciated.
This is the code I am using:
Task Name: <input type="text" size="32" maxlength="32" value="<?= $taskName ?>" /><br /><br />
<?php
$tidHolder = $_POST['taskID'];
include( 'inc/mice.inc.php' );
$cxn = mysqli_connect( $host, $user, $password, $database );
$sql = "SELECT taskName FROM taskManager_tasks WHERE tid = '$tidHolder'" ;
$sqlResult = mysqli_query( $cxn, $sql);
if (!$sqlResult)
{
die('Could not connect: ' . mysql_error());
}
$row = mysqli_fetch_assoc($sqlResult);
$taskName=$row['taskName'];
echo $tidHolder;
print_r($_POST);
echo $taskName;
?> | 0 |
11,350,816 | 07/05/2012 19:00:37 | 152,949 | 08/08/2009 11:22:21 | 1,250 | 83 | Fewer cache misses with TLS? | Will I get fewer cache misses if I use Thread Local Storage in my multithreaded program? | c++ | multithreading | thread-local-storage | null | null | null | open | Fewer cache misses with TLS?
===
Will I get fewer cache misses if I use Thread Local Storage in my multithreaded program? | 0 |
11,350,815 | 07/05/2012 19:00:34 | 330,396 | 05/01/2010 14:26:00 | 68 | 1 | Radio Style But with images | I am looking to make something like a radio style buttons, but no text, just images. Something like this is what i want to style below. And i want to make it so that on the click its a certain image. But i want it to send out a value like a radio button html coding would.
How should i go about coding this or is there any tips or anything i should follow? Just not sure how to approach it.
Basically i want something that would work like radio buttons but in the theme below.

| javascript | jquery | html | null | null | null | open | Radio Style But with images
===
I am looking to make something like a radio style buttons, but no text, just images. Something like this is what i want to style below. And i want to make it so that on the click its a certain image. But i want it to send out a value like a radio button html coding would.
How should i go about coding this or is there any tips or anything i should follow? Just not sure how to approach it.
Basically i want something that would work like radio buttons but in the theme below.

| 0 |
11,349,119 | 07/05/2012 17:05:13 | 1,432,594 | 06/02/2012 15:52:25 | 563 | 24 | RadioButtonList OnSelectedIndexChanged Only firing ONCE | I have a radiobuttonlist that is hardcoded into my asp.net page like so:
<asp:RadioButtonList runat="server" ID="rblOrientation" RepeatDirection="Horizontal"
OnSelectedIndexChanged="rblOrientation_onSelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Portrait" Value="P" Selected="True"></asp:ListItem>
<asp:ListItem Text="Landscape" Value="L"></asp:ListItem>
</asp:RadioButtonList>
The code behind is as follows:
protected void rblOrientation_onSelectedIndexChanged(object sender, EventArgs e)
{
ddlPaperSize_onSelectedIndexChanged(sender, e);
}
Basically what happens is it calls on another function which updates a bunch of values that
are within an update panel. This is also hardcoded in and looks like this:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Label ID="lblPaperWidth" runat="server" />
<span id="txtUOMWidth" runat="server" /> ×
<asp:Label ID="lblPaperHeight" runat="server" />
<span id="txtUOMHeight" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rblOrientation" />
<asp:AsyncPostBackTrigger ControlID="ddlPaperSize" />
<asp:AsyncPostBackTrigger ControlID="ddlScale" />
</Triggers>
</asp:UpdatePanel>
Everything works fine the first time I change the value of the radiobuttonlist, however, if I try a second time it does not work. Does anyone know why this might be? Any advice would be great, thanks! | c# | asp.net | updatepanel | postback | radiobuttonlist | null | open | RadioButtonList OnSelectedIndexChanged Only firing ONCE
===
I have a radiobuttonlist that is hardcoded into my asp.net page like so:
<asp:RadioButtonList runat="server" ID="rblOrientation" RepeatDirection="Horizontal"
OnSelectedIndexChanged="rblOrientation_onSelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Text="Portrait" Value="P" Selected="True"></asp:ListItem>
<asp:ListItem Text="Landscape" Value="L"></asp:ListItem>
</asp:RadioButtonList>
The code behind is as follows:
protected void rblOrientation_onSelectedIndexChanged(object sender, EventArgs e)
{
ddlPaperSize_onSelectedIndexChanged(sender, e);
}
Basically what happens is it calls on another function which updates a bunch of values that
are within an update panel. This is also hardcoded in and looks like this:
<asp:UpdatePanel runat="server">
<ContentTemplate>
<asp:Label ID="lblPaperWidth" runat="server" />
<span id="txtUOMWidth" runat="server" /> ×
<asp:Label ID="lblPaperHeight" runat="server" />
<span id="txtUOMHeight" runat="server" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="rblOrientation" />
<asp:AsyncPostBackTrigger ControlID="ddlPaperSize" />
<asp:AsyncPostBackTrigger ControlID="ddlScale" />
</Triggers>
</asp:UpdatePanel>
Everything works fine the first time I change the value of the radiobuttonlist, however, if I try a second time it does not work. Does anyone know why this might be? Any advice would be great, thanks! | 0 |
11,472,547 | 07/13/2012 14:29:59 | 1,315,828 | 04/05/2012 16:48:40 | 160 | 0 | Calling a batch file and waiting for it to finish | I have a powershell script that could be VERY crudely represented by the following.
function startTask
{
calls external batch script (runs for roughly 10 minutes)
creates done1.txt
}
function startTask2
{
calls batch (runs for roughly 10 minutes)
creates done2.txt
}
startTask
if done1.txt exists
startTask2
if done2.txt exists
write-host "done"
The issue I am facing is that immediately after calling the first batch file the 2nd batch file gets called. Is there a way to have powershell be aware of when the batch file is done? Side note, I don't have access to the batch file so I am unable to edit it
| powershell | batch | null | null | null | null | open | Calling a batch file and waiting for it to finish
===
I have a powershell script that could be VERY crudely represented by the following.
function startTask
{
calls external batch script (runs for roughly 10 minutes)
creates done1.txt
}
function startTask2
{
calls batch (runs for roughly 10 minutes)
creates done2.txt
}
startTask
if done1.txt exists
startTask2
if done2.txt exists
write-host "done"
The issue I am facing is that immediately after calling the first batch file the 2nd batch file gets called. Is there a way to have powershell be aware of when the batch file is done? Side note, I don't have access to the batch file so I am unable to edit it
| 0 |
11,472,077 | 07/13/2012 14:05:20 | 303,257 | 03/27/2010 17:00:16 | 37 | 1 | Parse buffered data line by line | I want to write a parser for text-based file format. However I prefer to load the whole file at once to reduce IO operation count. Is there a way to parse buffered data line by line?
void ObjModelConditioner::Import(Model& asset)
{
uint8_t* buffer = SyncReadFile(asset.source_file_info());
delete [] buffer;
} | c++ | file-io | stl | null | null | null | open | Parse buffered data line by line
===
I want to write a parser for text-based file format. However I prefer to load the whole file at once to reduce IO operation count. Is there a way to parse buffered data line by line?
void ObjModelConditioner::Import(Model& asset)
{
uint8_t* buffer = SyncReadFile(asset.source_file_info());
delete [] buffer;
} | 0 |
11,472,079 | 07/13/2012 14:05:27 | 391,002 | 07/13/2010 22:08:42 | 126 | 9 | Find first specified char that is not quotes | I am tryin to figure out how to find first occurence of specified character (lets say =) in string. This is easy, but i want position of that = only if its NOT in quotes.
For example, in this case:
foo = bar
I want position of first =, but in this case:
"foo = bar" = baz
I want position of the second =.
I found [similar question][1] here, but I need position, not splitting. And I must be able to deal with escaped quotes \" or \' so I think I wont be able to use string based approach to this problem.
One of my ideas was using lex. analysis with regexp based syntax analysis, which can find first occurence of = for me, but it seems rather heavy :)
[1]: http://stackoverflow.com/questions/1721921/how-could-i-find-all-whitespaces-excluding-the-ones-between-quotes | php | regex | null | null | null | null | open | Find first specified char that is not quotes
===
I am tryin to figure out how to find first occurence of specified character (lets say =) in string. This is easy, but i want position of that = only if its NOT in quotes.
For example, in this case:
foo = bar
I want position of first =, but in this case:
"foo = bar" = baz
I want position of the second =.
I found [similar question][1] here, but I need position, not splitting. And I must be able to deal with escaped quotes \" or \' so I think I wont be able to use string based approach to this problem.
One of my ideas was using lex. analysis with regexp based syntax analysis, which can find first occurence of = for me, but it seems rather heavy :)
[1]: http://stackoverflow.com/questions/1721921/how-could-i-find-all-whitespaces-excluding-the-ones-between-quotes | 0 |
11,472,172 | 07/13/2012 14:10:52 | 196,919 | 10/26/2009 21:39:42 | 2,346 | 146 | How to find an application installation path in the ms windows registry via EXE name | Is there any clear code to find an application installation path by EXE name?
I found [this][1] but it is usefulness at all.
Thank you!
[1]: http://stackoverflow.com/questions/7231903/find-the-path-of-my-application-installed-in-registry | c# | .net | null | null | null | null | open | How to find an application installation path in the ms windows registry via EXE name
===
Is there any clear code to find an application installation path by EXE name?
I found [this][1] but it is usefulness at all.
Thank you!
[1]: http://stackoverflow.com/questions/7231903/find-the-path-of-my-application-installed-in-registry | 0 |
11,472,552 | 07/13/2012 14:30:14 | 1,137,432 | 01/08/2012 18:49:39 | 13 | 0 | Removing specific html tags with python | I have some html tables inside of an html cell like so:
miniTable='<table style="width: 100%%" bgcolor="%s"><tr><td><font color="%s"><b>%s</b></td></tr></table>' % ( bgcolor, fontColor, floatNumber)
html += '<td>' + miniTable + '</td>'
Is there a way to remove the HTML tags that pertain to this minitable, and ONLY these html tags? I would like to somehow remove these tags:
<table style="width: 100%%" bgcolor="%s"><tr><td><font color="%s"><b>
and
</b></td></tr></table>
to get
floatNumber
where float is the string representation of a floating point number. I don't want any of the other HTML tags to be modified in any way. I was thinking of using string.replace or regex, but I'm stumped. Thanks!
| python | html | null | null | null | null | open | Removing specific html tags with python
===
I have some html tables inside of an html cell like so:
miniTable='<table style="width: 100%%" bgcolor="%s"><tr><td><font color="%s"><b>%s</b></td></tr></table>' % ( bgcolor, fontColor, floatNumber)
html += '<td>' + miniTable + '</td>'
Is there a way to remove the HTML tags that pertain to this minitable, and ONLY these html tags? I would like to somehow remove these tags:
<table style="width: 100%%" bgcolor="%s"><tr><td><font color="%s"><b>
and
</b></td></tr></table>
to get
floatNumber
where float is the string representation of a floating point number. I don't want any of the other HTML tags to be modified in any way. I was thinking of using string.replace or regex, but I'm stumped. Thanks!
| 0 |
11,472,557 | 07/13/2012 14:30:17 | 1,522,454 | 07/13/2012 02:46:00 | 1 | 0 | Displaying the elements of a singly linked list | I have written a simple program to traverse through the nodes of a linked list.
struct node
{
int data;
struct node *next;
}*start;
start=(struct node *)malloc(sizeof(struct node));
start->next=NULL;
int main(void)
{
if(start==NULL)
{
printf("There are no elements in the list");
}
else
{
struct node *tmp;
printf("\nThe elemnets are ");
for(tmp=start;tmp!=NULL;tmp=tmp->next)
{
printf("%d\t",tmp->data);
}
}
return 0;
}
Whenever i am trying to print the elements of the linked list, however even though the list is empty, it gives the output
The elements are 5640144
What am i doing wrong ? Am i declaring the start pointer correctly ?
Why do i need to do this (actually i was not doing this initially, but was asked to by one of my friends)
start=(struct node *)malloc(sizeof(struct node));
start->next=NULL;
| c | null | null | null | null | null | open | Displaying the elements of a singly linked list
===
I have written a simple program to traverse through the nodes of a linked list.
struct node
{
int data;
struct node *next;
}*start;
start=(struct node *)malloc(sizeof(struct node));
start->next=NULL;
int main(void)
{
if(start==NULL)
{
printf("There are no elements in the list");
}
else
{
struct node *tmp;
printf("\nThe elemnets are ");
for(tmp=start;tmp!=NULL;tmp=tmp->next)
{
printf("%d\t",tmp->data);
}
}
return 0;
}
Whenever i am trying to print the elements of the linked list, however even though the list is empty, it gives the output
The elements are 5640144
What am i doing wrong ? Am i declaring the start pointer correctly ?
Why do i need to do this (actually i was not doing this initially, but was asked to by one of my friends)
start=(struct node *)malloc(sizeof(struct node));
start->next=NULL;
| 0 |
11,472,566 | 07/13/2012 14:30:34 | 1,517,834 | 07/11/2012 12:56:25 | 8 | 0 | What is optimal algorithm to male all possible combinations of a string? | I find other similar question too complicated
I think it means if we are given pot then combinations will be
pot
opt
top
pot
pto
pot
so I wrote the following code:
#include<iostream>
#include<string.h>
using namespace std;
int main(){
char s[10];
char temp;
cin>>s;
char t[10];
for(int i=0;i<3;i++)
{
for(int j=i;j<3;j++)
{
strcpy(t,s);
temp=s[i];
s[i]=s[j];
s[j]=temp;
cout<<s<<"\n";
strcpy(s,t);
}
}
Is there a better way ? | string | algorithm | interview-questions | null | null | null | open | What is optimal algorithm to male all possible combinations of a string?
===
I find other similar question too complicated
I think it means if we are given pot then combinations will be
pot
opt
top
pot
pto
pot
so I wrote the following code:
#include<iostream>
#include<string.h>
using namespace std;
int main(){
char s[10];
char temp;
cin>>s;
char t[10];
for(int i=0;i<3;i++)
{
for(int j=i;j<3;j++)
{
strcpy(t,s);
temp=s[i];
s[i]=s[j];
s[j]=temp;
cout<<s<<"\n";
strcpy(s,t);
}
}
Is there a better way ? | 0 |
11,472,505 | 07/13/2012 14:27:07 | 1,523,749 | 07/13/2012 13:55:14 | 1 | 0 | PHP 5: Return closest 5 results to a search value from an XML | I have an XML which is supplied by a third party and I have no control over its formatting. It looks like this:
`<base>
<results index="1">
<quote vendor_name="Company X">
<quote_detail rate="3.375" price="-0.440">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
<results index="2">
<quote vendor_name="Company y">
<quote_detail rate="3.548" price="-0.230">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
<results index="3">
<quote vendor_name="Company Z">
<quote_detail rate="3.799" price="1.120">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
</base>`
What I need to do is return the result (vendor_name, rate and price) that has a price closest to zero without going over as well as the next two above and below. The ideal result would look something like this (where the middle one is closest to zero):
1. Company Z / 3.875 / -1.375
2. Company Y / 3.750 / -0.875
3. Company X / 3.375 / -0.440
4. Company A / 3.500 / 0.250
5. Company B / 3.375 / 1.125
I'm not sure about the logic required to do this or how to preserve the XML information while running said logic. Any help? | php | xml | xml-parsing | null | null | null | open | PHP 5: Return closest 5 results to a search value from an XML
===
I have an XML which is supplied by a third party and I have no control over its formatting. It looks like this:
`<base>
<results index="1">
<quote vendor_name="Company X">
<quote_detail rate="3.375" price="-0.440">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
<results index="2">
<quote vendor_name="Company y">
<quote_detail rate="3.548" price="-0.230">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
<results index="3">
<quote vendor_name="Company Z">
<quote_detail rate="3.799" price="1.120">
<stuff>value</stuff>
</quote_detail>
</quote>
</results>
</base>`
What I need to do is return the result (vendor_name, rate and price) that has a price closest to zero without going over as well as the next two above and below. The ideal result would look something like this (where the middle one is closest to zero):
1. Company Z / 3.875 / -1.375
2. Company Y / 3.750 / -0.875
3. Company X / 3.375 / -0.440
4. Company A / 3.500 / 0.250
5. Company B / 3.375 / 1.125
I'm not sure about the logic required to do this or how to preserve the XML information while running said logic. Any help? | 0 |
11,454,194 | 07/12/2012 14:35:00 | 1,521,096 | 07/12/2012 14:30:52 | 1 | 0 | Restore button for in-app purchase - is it the same as buying again? | I have written some code for a restore button;
-(IBAction)restore:(id)sender
{
[[MKStoreManager sharedManager]buyFeature];
}
-(void)productPurchased
{
for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
}
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Thank you" message:@"Your restore was successful." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
// error restore
- (void)failed
{
for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
}
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Your restore has failed." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
But it prompts the user to 'buy' when they press it? Is this correct? I know essentially the same thing is happening as it is not going to charge them again, but I don't want to submit this code to apple only for them to reject it on the fact it doesn't make it clear enough?
Or have I done the code incorrectly?
Your help would be great appreciated,
Regards,
Agnelli
| iphone | xcode | ipad | apple | in-app-purchase | null | open | Restore button for in-app purchase - is it the same as buying again?
===
I have written some code for a restore button;
-(IBAction)restore:(id)sender
{
[[MKStoreManager sharedManager]buyFeature];
}
-(void)productPurchased
{
for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
}
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Thank you" message:@"Your restore was successful." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
// error restore
- (void)failed
{
for (UIView *view in self.view.subviews)
{
if (view.tag==2000)
{
[view removeFromSuperview];
}
}
UIAlertView *alert=[[UIAlertView alloc]initWithTitle:@"Error" message:@"Your restore has failed." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil, nil];
[alert show];
[alert release];
}
But it prompts the user to 'buy' when they press it? Is this correct? I know essentially the same thing is happening as it is not going to charge them again, but I don't want to submit this code to apple only for them to reject it on the fact it doesn't make it clear enough?
Or have I done the code incorrectly?
Your help would be great appreciated,
Regards,
Agnelli
| 0 |
11,500,085 | 07/16/2012 07:48:34 | 1,374,763 | 05/04/2012 10:52:40 | 41 | 0 | getting html value with getCell jqgrid | long story short, when i'm trying to get value of any column with this
<code>
var Id=jQuery("#grid").jqGrid('getCell',id,'Id');
</code>
I'm getting this value
<code>`<INPUT style="WIDTH: 98%" id=2_Id class=editable role=textbox value=86 name=Id>`</code>
and i"m expecting 86 only. any guess what is wrong? | javascript | jquery | mvc | jqgrid | null | null | open | getting html value with getCell jqgrid
===
long story short, when i'm trying to get value of any column with this
<code>
var Id=jQuery("#grid").jqGrid('getCell',id,'Id');
</code>
I'm getting this value
<code>`<INPUT style="WIDTH: 98%" id=2_Id class=editable role=textbox value=86 name=Id>`</code>
and i"m expecting 86 only. any guess what is wrong? | 0 |
11,500,088 | 07/16/2012 07:48:37 | 1,371,886 | 05/03/2012 08:00:47 | 21 | 0 | PHP: Express Number in Words | Is there a function that will express any given number in words.
For example:
if number is 1432 then this function should echo "One thousand four hundred thirty two".
Thanks | php | numbers | words | null | null | null | open | PHP: Express Number in Words
===
Is there a function that will express any given number in words.
For example:
if number is 1432 then this function should echo "One thousand four hundred thirty two".
Thanks | 0 |
11,500,089 | 07/16/2012 07:48:45 | 420,287 | 08/14/2010 09:38:02 | 113 | 3 | Running customized PMD ruleset in Maven | I would like to run my customized PMD rule set which is in my Local disk D:\rulesets\java\. I am using maven to build my application. I put the below entry in maven POM.xml
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<rulesets>
<ruleset>D:\rulesets\java\basic.xml</ruleset>
<ruleset>D:\rulesets\java\braces.xml</ruleset>
<ruleset>D:\rulesets\java\clone.xml</ruleset>
<ruleset>D:\rulesets\java\codesize.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</reporting> When i run my PMD report (mvn pmd:pmd)it's not taking my customized pmd ruleset defined in pom file.How to solve this issue. Please help me.
Thanks in Advance. | maven | customization | rules | pmd | null | null | open | Running customized PMD ruleset in Maven
===
I would like to run my customized PMD rule set which is in my Local disk D:\rulesets\java\. I am using maven to build my application. I put the below entry in maven POM.xml
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId>
<configuration>
<rulesets>
<ruleset>D:\rulesets\java\basic.xml</ruleset>
<ruleset>D:\rulesets\java\braces.xml</ruleset>
<ruleset>D:\rulesets\java\clone.xml</ruleset>
<ruleset>D:\rulesets\java\codesize.xml</ruleset>
</rulesets>
</configuration>
</plugin>
</plugins>
</reporting> When i run my PMD report (mvn pmd:pmd)it's not taking my customized pmd ruleset defined in pom file.How to solve this issue. Please help me.
Thanks in Advance. | 0 |
11,499,377 | 07/16/2012 06:51:31 | 178,163 | 09/24/2009 00:12:13 | 313 | 3 | How would you organize UI states using JS? | I have an app that is mostly traditional static HTML pages linked via anchor tags, but lately I've been adding more and more dynamic behavior using JS.
I need to "juggle" between numerous UI states in the form of hiding/showing/creating different elements for every "screen". (Let's say homepage and fullpage blog post.)
If I have only 2 states it's pretty easy but complexity arises as more and more "screens" are added.
**The problem:**
How would I organize the the various UI states so that it is straightforward to switch between? | javascript | html | user-interface | null | null | null | open | How would you organize UI states using JS?
===
I have an app that is mostly traditional static HTML pages linked via anchor tags, but lately I've been adding more and more dynamic behavior using JS.
I need to "juggle" between numerous UI states in the form of hiding/showing/creating different elements for every "screen". (Let's say homepage and fullpage blog post.)
If I have only 2 states it's pretty easy but complexity arises as more and more "screens" are added.
**The problem:**
How would I organize the the various UI states so that it is straightforward to switch between? | 0 |
11,499,379 | 07/16/2012 06:51:40 | 1,447,182 | 06/10/2012 09:43:25 | 29 | 1 | PHP. How to remove filename parts? | I have:
$filename = basename(__FILE__);
$id = preg_replace("/\\.[^.\\s]{3,4}$/", "", $filename);
`$id` is filename without extension now. How can I remove not only extension but prefix and suffix from the file too?
prefix_ineedthis_suffix.php -> ineedthis | php | regex | null | null | null | null | open | PHP. How to remove filename parts?
===
I have:
$filename = basename(__FILE__);
$id = preg_replace("/\\.[^.\\s]{3,4}$/", "", $filename);
`$id` is filename without extension now. How can I remove not only extension but prefix and suffix from the file too?
prefix_ineedthis_suffix.php -> ineedthis | 0 |
11,499,380 | 07/16/2012 06:51:52 | 676,603 | 03/25/2011 11:23:48 | 108 | 6 | Android without Proxy not working? | I need the condition of setting no proxy in my aplication for that i used the following code:
URLConnection conn = url.openConnection(Proxy.NO_PROXY);
(import java.net.Proxy;)
But i got network unreachable exception!!
Any help!! | android | proxy | httpurlconnection | null | null | null | open | Android without Proxy not working?
===
I need the condition of setting no proxy in my aplication for that i used the following code:
URLConnection conn = url.openConnection(Proxy.NO_PROXY);
(import java.net.Proxy;)
But i got network unreachable exception!!
Any help!! | 0 |
11,499,220 | 07/16/2012 06:38:46 | 801,450 | 06/16/2011 12:34:19 | 10 | 0 | iPhone - Source Code Modification | I am trying to modify the existing iPhone App source Code.
In the AppDelegate class -
1. Insert a new function. (This I can add using NSString) For e.g. -void test(){}
2. Search for the function -void **doSomeOperation**() in the AppDelegate.m file.
3. Get the contents of the **doSomeOperation** function.
3. Modify/add my own code in the **doSomeOperation** function.
I know using some String Manipulations I can do the above tasks, but is there an easy way to perform the above things? Like using NSFileManager to search for a string and then replace those?
Regards,
Nirav | nsstring | manipulation | null | null | null | null | open | iPhone - Source Code Modification
===
I am trying to modify the existing iPhone App source Code.
In the AppDelegate class -
1. Insert a new function. (This I can add using NSString) For e.g. -void test(){}
2. Search for the function -void **doSomeOperation**() in the AppDelegate.m file.
3. Get the contents of the **doSomeOperation** function.
3. Modify/add my own code in the **doSomeOperation** function.
I know using some String Manipulations I can do the above tasks, but is there an easy way to perform the above things? Like using NSFileManager to search for a string and then replace those?
Regards,
Nirav | 0 |
11,500,090 | 07/16/2012 07:48:52 | 866,659 | 07/28/2011 03:38:59 | 390 | 1 | How to call object from Controller to display in the View of ASP.net MVC | I have one action in my controller :
public ActionResult GiftVochure()
{
if (Request.QueryString["gc"] != "")
{
var obj = from b in context.GiftCards
join cus in context.Customers on b.CustomerID equals cus.ID
where b.ID == int.Parse(Request.QueryString["gc"])
select new
{
b.ID,
b.Date,
b.CardNo,
b.Price,
CustomerName = cus.FirstName + " " + cus.LastName
};
return View(obj.ToList());
}
return View();
}
And I want to take "obj" to loop and display in the GiftVochure Views, Does any one know, how to do this?
Thanks. | asp.net-mvc-2 | null | null | null | null | null | open | How to call object from Controller to display in the View of ASP.net MVC
===
I have one action in my controller :
public ActionResult GiftVochure()
{
if (Request.QueryString["gc"] != "")
{
var obj = from b in context.GiftCards
join cus in context.Customers on b.CustomerID equals cus.ID
where b.ID == int.Parse(Request.QueryString["gc"])
select new
{
b.ID,
b.Date,
b.CardNo,
b.Price,
CustomerName = cus.FirstName + " " + cus.LastName
};
return View(obj.ToList());
}
return View();
}
And I want to take "obj" to loop and display in the GiftVochure Views, Does any one know, how to do this?
Thanks. | 0 |
11,500,091 | 07/16/2012 02:09:40 | 1,348,351 | 04/21/2012 13:26:26 | 1 | 0 | dynamic button inside dynamic literal control | I want to add dynamic literal control and dynamic button.
so I try like this:
Literal lit = new Literal();
lit.Text = lit.Text + theRow["CaseExampleDescription"].ToString() + "\n\n";
Button btn = new Button();
btn.ID = "btn1";
lit.Controls.Add(btn);
but there is error -System.Web.UI.WebControls.Literal' does not allow child controls.
How can I solve this? | c# | null | null | null | null | null | open | dynamic button inside dynamic literal control
===
I want to add dynamic literal control and dynamic button.
so I try like this:
Literal lit = new Literal();
lit.Text = lit.Text + theRow["CaseExampleDescription"].ToString() + "\n\n";
Button btn = new Button();
btn.ID = "btn1";
lit.Controls.Add(btn);
but there is error -System.Web.UI.WebControls.Literal' does not allow child controls.
How can I solve this? | 0 |
11,500,094 | 07/16/2012 07:48:58 | 1,502,517 | 07/04/2012 21:28:01 | 15 | 0 | Boost-button delay | I am making this game with a boost button. Of course, just leaving it as normal would enable the player to tap it constantly, so i need a neat delay of e.g. 20 seconds before it is possible to push the button again. Also, would it be possible to show this progression on the button, preferably on the button itself?
Thanks a lot for any answers! | ios6 | xcode4.5 | null | null | null | null | open | Boost-button delay
===
I am making this game with a boost button. Of course, just leaving it as normal would enable the player to tap it constantly, so i need a neat delay of e.g. 20 seconds before it is possible to push the button again. Also, would it be possible to show this progression on the button, preferably on the button itself?
Thanks a lot for any answers! | 0 |
11,500,095 | 07/16/2012 07:49:02 | 193,655 | 10/21/2009 08:29:52 | 1,691 | 26 | How to publish a calednar using webCal | My application generates a complex calendar at runtime, so any user has tasks for a specific date/time and every task has a description + some properties.
I have been requested to "publish" this calendar as webCal. I have no knowledge about webcal, anyway I wonder if anyone of you has already tried for it and can write his comments or suggestions.
One issue is "how to identify a user"? Since I have a multiuser calednar, how do I publish individual calendars for every user?
I think to a kind of Delphi service application that runs continuously, publishing the calendar. | delphi | delphi-xe2 | webcal | null | null | null | open | How to publish a calednar using webCal
===
My application generates a complex calendar at runtime, so any user has tasks for a specific date/time and every task has a description + some properties.
I have been requested to "publish" this calendar as webCal. I have no knowledge about webcal, anyway I wonder if anyone of you has already tried for it and can write his comments or suggestions.
One issue is "how to identify a user"? Since I have a multiuser calednar, how do I publish individual calendars for every user?
I think to a kind of Delphi service application that runs continuously, publishing the calendar. | 0 |
11,500,096 | 07/16/2012 07:49:03 | 1,508,284 | 07/07/2012 05:09:31 | 1 | 0 | Customizing ListView Items with 3 EditText View | I have a table in my db and i query the table (selecting 3 text fields of my table) and save all querying results from my cursor to 3 separate lists. (each list for saving one field values) now i want to view this results in a ListView that each row of it has 3 EditText and each EditText shows one item of my lists (each row of ListView has one item from each list, so each row has three EditText)...
any help? Regards... | android | listview | customization | null | null | null | open | Customizing ListView Items with 3 EditText View
===
I have a table in my db and i query the table (selecting 3 text fields of my table) and save all querying results from my cursor to 3 separate lists. (each list for saving one field values) now i want to view this results in a ListView that each row of it has 3 EditText and each EditText shows one item of my lists (each row of ListView has one item from each list, so each row has three EditText)...
any help? Regards... | 0 |
11,500,097 | 07/16/2012 07:49:03 | 1,056,118 | 07/24/2011 08:39:59 | 334 | 5 | importing, saving and displaying large data sets using background thread | I have followed Cocoa is my girl friend's tutorial [here][1], which is based on a subclass of `NSOperation` to fetch and load big number of records in a background thread, but in my case I have several thousands of records which take 1-2 minutes of continuous loading from a remote web service. The app have web service proxy classes generated using [SudzC][2]. There is no memory leaks detected. The problem occurs after the app finishes loading and saving this huge number of records into sqlite database (using core data), I notice that this import/save operation consumes so much memory, i.e. after this operation finishes, I use the app features for couple minutes (opening table views, writing text, etc ...), then i will see a crash that happens due to low memory, if I didn't include the import/save operation the app works fine without any low memory crash!
does anybody have a clue for this problem ?
thanks in advance.
[1]: http://www.cimgf.com/2011/08/22/importing-and-displaying-large-data-sets-in-core-data/
[2]: http://sudzc.com/ | iphone | objective-c | ios | multithreading | null | null | open | importing, saving and displaying large data sets using background thread
===
I have followed Cocoa is my girl friend's tutorial [here][1], which is based on a subclass of `NSOperation` to fetch and load big number of records in a background thread, but in my case I have several thousands of records which take 1-2 minutes of continuous loading from a remote web service. The app have web service proxy classes generated using [SudzC][2]. There is no memory leaks detected. The problem occurs after the app finishes loading and saving this huge number of records into sqlite database (using core data), I notice that this import/save operation consumes so much memory, i.e. after this operation finishes, I use the app features for couple minutes (opening table views, writing text, etc ...), then i will see a crash that happens due to low memory, if I didn't include the import/save operation the app works fine without any low memory crash!
does anybody have a clue for this problem ?
thanks in advance.
[1]: http://www.cimgf.com/2011/08/22/importing-and-displaying-large-data-sets-in-core-data/
[2]: http://sudzc.com/ | 0 |
11,500,098 | 07/16/2012 07:49:08 | 1,197,359 | 02/08/2012 14:02:39 | 61 | 1 | Get the difference between two dates both In Months and days in sql | Hi Guys I need to get the difference between two dates say if the difference is 84 days, I should Probably have Output as 2 months and 14 days, the code I have Just Gives the Totals. Here is the code;
SELECT MONTHS_BETWEEN(TO_DATE('20120325', 'YYYYMMDD'), TO_DATE('20120101', 'YYYYMMDD'))
num_months,(TO_DATE('20120325', 'YYYYMMDD') - TO_DATE('20120101', 'YYYYMMDD'))
diff_in_days FROM dual;
Output is:
NUM_MONTHS DIFF_IN_DAYS
2.774193548 84
I need for example the output for this Query to be Ether 2 months and 14 days at worst, otherwise I won't Mind If I can have the exact days After the months figure because those days are not really 14 because All Months do not have 30 days. Please help anyone??? | sql | oracle | null | null | null | null | open | Get the difference between two dates both In Months and days in sql
===
Hi Guys I need to get the difference between two dates say if the difference is 84 days, I should Probably have Output as 2 months and 14 days, the code I have Just Gives the Totals. Here is the code;
SELECT MONTHS_BETWEEN(TO_DATE('20120325', 'YYYYMMDD'), TO_DATE('20120101', 'YYYYMMDD'))
num_months,(TO_DATE('20120325', 'YYYYMMDD') - TO_DATE('20120101', 'YYYYMMDD'))
diff_in_days FROM dual;
Output is:
NUM_MONTHS DIFF_IN_DAYS
2.774193548 84
I need for example the output for this Query to be Ether 2 months and 14 days at worst, otherwise I won't Mind If I can have the exact days After the months figure because those days are not really 14 because All Months do not have 30 days. Please help anyone??? | 0 |
11,500,099 | 07/16/2012 07:49:09 | 951,057 | 09/18/2011 08:48:40 | 322 | 1 | Kaltura -- Can't upload contents | After [Kaltura][1] is setup and then, at the KMC panel, Users/Publishers can not upload the contents, like Movies for example. It is showing:
- `Internal Server Error Occurred` (Message Box appeared)
and in the, kaltura_api_v3.log file, many lines are coming like:
2012-07-16 15:36:32 [84.151.59.126] [934211573] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'Exception' with message 'Failed to connect to any Sphinx config' in /opt/kaltura/app/infra/db/DbManager.php:157
Stack trace:
#0 /opt/kaltura/app/plugins/sphinx_search/lib/SphinxCriteria.php(169): DbManager::getSphinxConnection()
#1 /opt/kaltura/app/plugins/sphinx_search/lib/SphinxCriteria.php(359): SphinxCriteria->executeSphinx('kaltura_entry', 'WHERE display_i...', 'ORDER BY create...', 50, 1000, true, '')
#2 /opt/kaltura/app/alpha/lib/model/entryPeer.php(449): SphinxCriteria->applyFilters()
#3 /opt/kaltura/app/api_v3/lib/KalturaEntryService.php(883): entryPeer::doSelect(Object(SphinxEntryCriteria))
#4 /opt/kaltura/app/api_v3/services/BaseEntryService.php(441): KalturaEntryService->listEntriesByFilter(Object(KalturaMediaEntryFilter), Object(KalturaFilterPager))
#5 [internal function]: BaseEntryService->listAction(Object(KalturaMediaEntryFilter), Object(KalturaFilterPager))
#6 /opt/kaltura/app/api_v3/lib/KalturaServiceReflector.php(293): call_user_func_array(Array, Array)
#7 /opt/kaltura/app/api_v3/lib/KalturaDispatcher.php(85): KalturaServiceReflector->invoke('list', Array)
#8 /opt/kaltura/app/api_v3/lib/KalturaFrontController.php(97): KalturaDispatcher->dispatch('baseentry', 'list', Array)
#9 /opt/kaltura/app/api_v3/web/index.php(19): KalturaFrontController->run()
#10 {main}
2012-07-16 15:36:32 [127.0.0.1] [822765712] [API] [kPermissionManager::addPartnerGroupAction] NOTICE: Permission item id [571] is not of type PermissionItemType::API_ACTION_ITEM but still defined in partner group permission id [117]
2012-07-16 15:36:32 [127.0.0.1] [822765712] [API] [kPermissionManager::addPartnerGroupAction] NOTICE: Permission item id [633] is not of type PermissionItemType::API_ACTION_ITEM but still defined in partner group permission id [117]
2012-07-16 15:36:32 [127.0.0.1] [732952482] [API] [KalturaFrontController->errorHandler] WARN: /opt/kaltura/app/infra/KAutoloader.php line 52 - require_once(): Unable to allocate memory for pool.
- What is it mean and how should i make it work?
[1]: http://www.kaltura.org/ | video | upload | content | media | server | null | open | Kaltura -- Can't upload contents
===
After [Kaltura][1] is setup and then, at the KMC panel, Users/Publishers can not upload the contents, like Movies for example. It is showing:
- `Internal Server Error Occurred` (Message Box appeared)
and in the, kaltura_api_v3.log file, many lines are coming like:
2012-07-16 15:36:32 [84.151.59.126] [934211573] [API] [KalturaFrontController->getExceptionObject] CRIT: exception 'Exception' with message 'Failed to connect to any Sphinx config' in /opt/kaltura/app/infra/db/DbManager.php:157
Stack trace:
#0 /opt/kaltura/app/plugins/sphinx_search/lib/SphinxCriteria.php(169): DbManager::getSphinxConnection()
#1 /opt/kaltura/app/plugins/sphinx_search/lib/SphinxCriteria.php(359): SphinxCriteria->executeSphinx('kaltura_entry', 'WHERE display_i...', 'ORDER BY create...', 50, 1000, true, '')
#2 /opt/kaltura/app/alpha/lib/model/entryPeer.php(449): SphinxCriteria->applyFilters()
#3 /opt/kaltura/app/api_v3/lib/KalturaEntryService.php(883): entryPeer::doSelect(Object(SphinxEntryCriteria))
#4 /opt/kaltura/app/api_v3/services/BaseEntryService.php(441): KalturaEntryService->listEntriesByFilter(Object(KalturaMediaEntryFilter), Object(KalturaFilterPager))
#5 [internal function]: BaseEntryService->listAction(Object(KalturaMediaEntryFilter), Object(KalturaFilterPager))
#6 /opt/kaltura/app/api_v3/lib/KalturaServiceReflector.php(293): call_user_func_array(Array, Array)
#7 /opt/kaltura/app/api_v3/lib/KalturaDispatcher.php(85): KalturaServiceReflector->invoke('list', Array)
#8 /opt/kaltura/app/api_v3/lib/KalturaFrontController.php(97): KalturaDispatcher->dispatch('baseentry', 'list', Array)
#9 /opt/kaltura/app/api_v3/web/index.php(19): KalturaFrontController->run()
#10 {main}
2012-07-16 15:36:32 [127.0.0.1] [822765712] [API] [kPermissionManager::addPartnerGroupAction] NOTICE: Permission item id [571] is not of type PermissionItemType::API_ACTION_ITEM but still defined in partner group permission id [117]
2012-07-16 15:36:32 [127.0.0.1] [822765712] [API] [kPermissionManager::addPartnerGroupAction] NOTICE: Permission item id [633] is not of type PermissionItemType::API_ACTION_ITEM but still defined in partner group permission id [117]
2012-07-16 15:36:32 [127.0.0.1] [732952482] [API] [KalturaFrontController->errorHandler] WARN: /opt/kaltura/app/infra/KAutoloader.php line 52 - require_once(): Unable to allocate memory for pool.
- What is it mean and how should i make it work?
[1]: http://www.kaltura.org/ | 0 |
11,500,102 | 07/16/2012 07:49:21 | 1,312,250 | 04/04/2012 07:58:23 | 9 | 0 | ASP.NET MVC partial view does not call my Action when i used $.getJSON method | I am building a Website for document management system on ASP.NET MVC3, in a page I am using a Partial view, the Partial View represents a simple Form.There is a drop down list and when one option is selected the ID of selected option should go to action Result. To do that i used **$.getJSON** method to pass values to action method. but problem is ID not goes to ActionResult. Can anyone help me to solve this problem?
cshtml code
<div >
@using (Html.BeginForm("GetFilteredActivityLogs", "Document", FormMethod.Post, new
{
id = "activityLog",
@class = "form-horizontal",
}))
{
<h3>Activity Log</h3>
<div>
<div style="float: left" class="control-label">
<label>
Action Type
</label>
</div>
<div class="controls">
@Html.DropDownListFor(model => model.SelectedActionId, Model.ActionTypes as SelectList, "All", new {
id = "SelectedActionId"
})
</div>
<table class="table table-bordered" style="margin-top: 20px; width: 100%;">
<thead>
<tr>
<th style="width: 15%; text-align: center">
Employee No
</th>
<th style="width: 20%; text-align: center">
Employee Name
</th>
<th style="width: 45%; text-align: center">
Action
</th>
<th style="width: 20%; text-align: center">
Date and Time
</th>
</tr>
</thead>
<tbody id="Activities">
</tbody>
</table>
</div>
}
</div>
controller:
public ActionResult GetFilteredActivityLogs(int actionTypeId)
{
return View();
}
Script:
<script type="text/javascript">
$(function ()
{
$('#SelectedActionId').change(function ()
{
var selectedActivityId = $(this).val();
$.getJSON('@Url.Action("GetFilteredActivityLogs", "Document")', { activityId: selectedActivityId }, function (FilteredActivities)
{
var ActivitySelect = $('#Activities');
// GroupSelect.empty();
$.each(FilteredActivities, function (index, activity)
{
// some code goes here...
});
});
});
});
</script> | jquery | asp.net-mvc-3 | null | null | null | null | open | ASP.NET MVC partial view does not call my Action when i used $.getJSON method
===
I am building a Website for document management system on ASP.NET MVC3, in a page I am using a Partial view, the Partial View represents a simple Form.There is a drop down list and when one option is selected the ID of selected option should go to action Result. To do that i used **$.getJSON** method to pass values to action method. but problem is ID not goes to ActionResult. Can anyone help me to solve this problem?
cshtml code
<div >
@using (Html.BeginForm("GetFilteredActivityLogs", "Document", FormMethod.Post, new
{
id = "activityLog",
@class = "form-horizontal",
}))
{
<h3>Activity Log</h3>
<div>
<div style="float: left" class="control-label">
<label>
Action Type
</label>
</div>
<div class="controls">
@Html.DropDownListFor(model => model.SelectedActionId, Model.ActionTypes as SelectList, "All", new {
id = "SelectedActionId"
})
</div>
<table class="table table-bordered" style="margin-top: 20px; width: 100%;">
<thead>
<tr>
<th style="width: 15%; text-align: center">
Employee No
</th>
<th style="width: 20%; text-align: center">
Employee Name
</th>
<th style="width: 45%; text-align: center">
Action
</th>
<th style="width: 20%; text-align: center">
Date and Time
</th>
</tr>
</thead>
<tbody id="Activities">
</tbody>
</table>
</div>
}
</div>
controller:
public ActionResult GetFilteredActivityLogs(int actionTypeId)
{
return View();
}
Script:
<script type="text/javascript">
$(function ()
{
$('#SelectedActionId').change(function ()
{
var selectedActivityId = $(this).val();
$.getJSON('@Url.Action("GetFilteredActivityLogs", "Document")', { activityId: selectedActivityId }, function (FilteredActivities)
{
var ActivitySelect = $('#Activities');
// GroupSelect.empty();
$.each(FilteredActivities, function (index, activity)
{
// some code goes here...
});
});
});
});
</script> | 0 |
11,542,378 | 07/18/2012 13:19:09 | 1,534,884 | 07/18/2012 13:14:10 | 1 | 0 | Search Core Result code needs to be modified to show only ONE kind of file | I have code below it is the Search Core Result core for SharePoint 2007 i want to modify it to only show files that have extension ".url". I been on it for over a month still heading no where .. Help if you can
Thanks
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:param name="ResultsBy" />
<xsl:param name="ViewByUrl" />
<xsl:param name="ViewByValue" />
<xsl:param name="IsNoKeyword" />
<xsl:param name="IsFixedQuery" />
<xsl:param name="ShowActionLinks" />
<xsl:param name="MoreResultsText" />
<xsl:param name="MoreResultsLink" />
<xsl:param name="CollapsingStatusLink" />
<xsl:param name="CollapseDuplicatesText" />
<xsl:param name="AlertMeLink" />
<xsl:param name="AlertMeText" />
<xsl:param name="SrchRSSText" />
<xsl:param name="SrchRSSLink" />
<xsl:param name="ShowMessage" />
<xsl:param name="IsThisListScope" />
<xsl:param name="DisplayDiscoveredDefinition" select="True" />
<xsl:param name="NoFixedQuery" />
<xsl:param name="NoKeyword" />
<xsl:param name="NoResults" />
<xsl:param name="NoResults1" />
<xsl:param name="NoResults2" />
<xsl:param name="NoResults3" />
<xsl:param name="NoResults4" />
<xsl:param name="DefinitionIntro" />
<!-- When there is keywory to issue the search -->
<xsl:template name="dvt_1.noKeyword">
<span class="srch-description">
<xsl:choose>
<xsl:when test="$IsFixedQuery">
<xsl:value-of select="$NoFixedQuery" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$NoKeyword" />
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:template>
<!-- When empty result set is returned from search -->
<xsl:template name="dvt_1.empty">
<div class="srch-sort">
<xsl:if test="$AlertMeLink and $ShowActionLinks">
<span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM1" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
</span>
</xsl:if>
<xsl:if test="string-length($SrchRSSLink) > 0 and $ShowActionLinks">
<xsl:if test="$AlertMeLink">
|
</xsl:if>
<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
</xsl:if>
</div>
<br/> <br/>
<span class="srch-description" id="CSR_NO_RESULTS">
<xsl:value-of select="$NoResults" />
<ol>
<li><xsl:value-of select="$NoResults1" /></li>
<li><xsl:value-of select="$NoResults2" /></li>
<li><xsl:value-of select="$NoResults3" /></li>
<li><xsl:value-of select="$NoResults4" /></li>
</ol>
</span>
</xsl:template>
<!-- Main body template. Sets the Results view (Relevance or date) options -->
<xsl:template name="dvt_1.body">
<div class="srch-results">
<xsl:if test="$ShowActionLinks">
<div class="srch-sort"> <xsl:value-of select="$ResultsBy" />
<xsl:if test="$ViewByUrl">
|
<a href ="{$ViewByUrl}" id="CSR_RV" title="{$ViewByValue}">
<xsl:value-of select="$ViewByValue" />
</a>
</xsl:if>
<xsl:if test="$AlertMeLink">
|
<span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM2" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
</span>
</xsl:if>
<xsl:if test="string-length($SrchRSSLink) > 0">
|
<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
</xsl:if>
</div>
<br /><br />
</xsl:if>
<xsl:apply-templates />
</div>
<xsl:call-template name="DisplayMoreResultsAnchor" />
</xsl:template><!-- This template is called for each result -->
<xsl:template match="Result">
<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>
<span class="srch-Icon">
<a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</a>
</span>
<span class="srch-Title">
<a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHTitle[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
</xsl:choose>
</a>
<br/>
</span>
<xsl:choose>
<xsl:when test="$IsThisListScope = 'True' and contentclass[. = 'STS_ListItem_PictureLibrary'] and picturethumbnailurl[. != '']">
<div style="padding-top: 2px; padding-bottom: 2px;">
<a href="{$url}" id="{concat('CSR_P',$id)}" title="{title}">
<img src="{picturethumbnailurl}" alt="" />
</a>
</div>
</xsl:when>
</xsl:choose>
<div class="srch-Description">
<xsl:choose>
<xsl:when test="hithighlightedsummary[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedsummary" />
</xsl:call-template>
</xsl:when>
<xsl:when test="description[. != '']">
<xsl:value-of select="description"/>
</xsl:when>
</xsl:choose>
</div >
<p class="srch-Metadata">
<span class="srch-URL">
<a href="{$url}" id="{concat('CSR_U_',$id)}" title="{$url}" dir="ltr">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHUrl[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="url"/></xsl:otherwise>
</xsl:choose>
</a>
</span>
<xsl:call-template name="DisplayCollapsingStatusLink">
<xsl:with-param name="status" select="collapsingstatus"/>
<xsl:with-param name="urlEncoded" select="urlEncoded"/>
<xsl:with-param name="id" select="concat('CSR_CS_',$id)"/>
</xsl:call-template>
</p>
</xsl:template>
<xsl:template name="HitHighlighting">
<xsl:param name="hh" />
<xsl:apply-templates select="$hh"/>
</xsl:template>
<xsl:template match="ddd">
…
</xsl:template>
<xsl:template match="c0">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c1">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c2">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c3">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c4">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c5">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c6">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c7">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c8">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c9">
<b><xsl:value-of select="."/></b>
</xsl:template>
<!-- A generic template to display string with non 0 string length (used for author and lastmodified time -->
<xsl:template name="DisplayString">
<xsl:param name="str" />
<xsl:if test='string-length($str) > 0'>
-
<xsl:value-of select="$str" />
</xsl:if>
</xsl:template>
<!-- document collapsing link setup -->
<xsl:template name="DisplayCollapsingStatusLink">
<xsl:param name="status"/>
<xsl:param name="urlEncoded"/>
<xsl:param name="id"/>
<xsl:if test="$CollapsingStatusLink">
<xsl:choose>
<xsl:when test="$status=1">
<br/>
<xsl:variable name="CollapsingStatusHref" select="concat(substring-before($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'), 'duplicates:"', $urlEncoded, '"', substring-after($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'))"/>
<span class="srch-dup">
[<a href="{$CollapsingStatusHref}" id="$id" title="{$CollapseDuplicatesText}">
<xsl:value-of select="$CollapseDuplicatesText"/>
</a>]
</span>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template><!-- The "view more results" for fixed query -->
<xsl:template name="DisplayMoreResultsAnchor">
<xsl:if test="$MoreResultsLink">
<a href="{$MoreResultsLink}" id="CSR_MRL">
<xsl:value-of select="$MoreResultsText"/>
</a>
</xsl:if>
</xsl:template>
<xsl:template match="All_Results/DiscoveredDefinitions">
<xsl:variable name="FoundIn" select="DDFoundIn" />
<xsl:variable name="DDSearchTerm" select="DDSearchTerm" />
<xsl:if test="$DisplayDiscoveredDefinition = 'True' and string-length($DDSearchTerm) > 0">
<script language="javascript">
function ToggleDefinitionSelection()
{
var selection = document.getElementById("definitionSelection");
if (selection.style.display == "none")
{
selection.style.display = "inline";
}
else
{
selection.style.display = "none";
}
}
</script>
<div>
<a href="#" onclick="ToggleDefinitionSelection(); return false;">
<xsl:value-of select="$DefinitionIntro" /><b><xsl:value-of select="$DDSearchTerm"/></b></a>
<div id="definitionSelection" class="srch-Description" style="display:none;">
<xsl:for-each select="DDefinitions/DDefinition">
<br/>
<xsl:variable name="DDUrl" select="DDUrl" />
<xsl:value-of select="DDStart"/>
<b>
<xsl:value-of select="DDBold"/>
</b>
<xsl:value-of select="DDEnd"/>
<br/>
<xsl:value-of select="$FoundIn"/>
<a href="{$DDUrl}">
<xsl:value-of select="DDTitle"/>
</a>
</xsl:for-each>
</div>
</div>
</xsl:if>
</xsl:template>
<!-- XSL transformation starts here -->
<xsl:template match="/">
<xsl:if test="$AlertMeLink">
<input type="hidden" name="P_Query" />
<input type="hidden" name="P_LastNotificationTime" />
</xsl:if>
<xsl:choose>
<xsl:when test="$IsNoKeyword = 'True'" >
<xsl:call-template name="dvt_1.noKeyword" />
</xsl:when>
<xsl:when test="$ShowMessage = 'True'">
<xsl:call-template name="dvt_1.empty" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dvt_1.body"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- End of Stylesheet -->
</xsl:stylesheet> | java | xml | null | null | null | null | open | Search Core Result code needs to be modified to show only ONE kind of file
===
I have code below it is the Search Core Result core for SharePoint 2007 i want to modify it to only show files that have extension ".url". I been on it for over a month still heading no where .. Help if you can
Thanks
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:param name="ResultsBy" />
<xsl:param name="ViewByUrl" />
<xsl:param name="ViewByValue" />
<xsl:param name="IsNoKeyword" />
<xsl:param name="IsFixedQuery" />
<xsl:param name="ShowActionLinks" />
<xsl:param name="MoreResultsText" />
<xsl:param name="MoreResultsLink" />
<xsl:param name="CollapsingStatusLink" />
<xsl:param name="CollapseDuplicatesText" />
<xsl:param name="AlertMeLink" />
<xsl:param name="AlertMeText" />
<xsl:param name="SrchRSSText" />
<xsl:param name="SrchRSSLink" />
<xsl:param name="ShowMessage" />
<xsl:param name="IsThisListScope" />
<xsl:param name="DisplayDiscoveredDefinition" select="True" />
<xsl:param name="NoFixedQuery" />
<xsl:param name="NoKeyword" />
<xsl:param name="NoResults" />
<xsl:param name="NoResults1" />
<xsl:param name="NoResults2" />
<xsl:param name="NoResults3" />
<xsl:param name="NoResults4" />
<xsl:param name="DefinitionIntro" />
<!-- When there is keywory to issue the search -->
<xsl:template name="dvt_1.noKeyword">
<span class="srch-description">
<xsl:choose>
<xsl:when test="$IsFixedQuery">
<xsl:value-of select="$NoFixedQuery" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$NoKeyword" />
</xsl:otherwise>
</xsl:choose>
</span>
</xsl:template>
<!-- When empty result set is returned from search -->
<xsl:template name="dvt_1.empty">
<div class="srch-sort">
<xsl:if test="$AlertMeLink and $ShowActionLinks">
<span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM1" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
</span>
</xsl:if>
<xsl:if test="string-length($SrchRSSLink) > 0 and $ShowActionLinks">
<xsl:if test="$AlertMeLink">
|
</xsl:if>
<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
</xsl:if>
</div>
<br/> <br/>
<span class="srch-description" id="CSR_NO_RESULTS">
<xsl:value-of select="$NoResults" />
<ol>
<li><xsl:value-of select="$NoResults1" /></li>
<li><xsl:value-of select="$NoResults2" /></li>
<li><xsl:value-of select="$NoResults3" /></li>
<li><xsl:value-of select="$NoResults4" /></li>
</ol>
</span>
</xsl:template>
<!-- Main body template. Sets the Results view (Relevance or date) options -->
<xsl:template name="dvt_1.body">
<div class="srch-results">
<xsl:if test="$ShowActionLinks">
<div class="srch-sort"> <xsl:value-of select="$ResultsBy" />
<xsl:if test="$ViewByUrl">
|
<a href ="{$ViewByUrl}" id="CSR_RV" title="{$ViewByValue}">
<xsl:value-of select="$ViewByValue" />
</a>
</xsl:if>
<xsl:if test="$AlertMeLink">
|
<span class="srch-alertme" > <a href ="{$AlertMeLink}" id="CSR_AM2" title="{$AlertMeText}"><img style="vertical-align: middle;" src="/_layouts/images/bell.gif" alt="" border="0"/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$AlertMeText" /></a>
</span>
</xsl:if>
<xsl:if test="string-length($SrchRSSLink) > 0">
|
<a type="application/rss+xml" href ="{$SrchRSSLink}" title="{$SrchRSSText}" id="SRCHRSSL"><img style="vertical-align: middle;" border="0" src="/_layouts/images/rss.gif" alt=""/><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text><xsl:value-of select="$SrchRSSText"/></a>
</xsl:if>
</div>
<br /><br />
</xsl:if>
<xsl:apply-templates />
</div>
<xsl:call-template name="DisplayMoreResultsAnchor" />
</xsl:template><!-- This template is called for each result -->
<xsl:template match="Result">
<xsl:variable name="id" select="id"/>
<xsl:variable name="url" select="url"/>
<span class="srch-Icon">
<a href="{$url}" id="{concat('CSR_IMG_',$id)}" title="{$url}">
<img align="absmiddle" src="{imageurl}" border="0" alt="{imageurl/@imageurldescription}" />
</a>
</span>
<span class="srch-Title">
<a href="{$url}" id="{concat('CSR_',$id)}" title="{$url}">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHTitle[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHTitle" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
</xsl:choose>
</a>
<br/>
</span>
<xsl:choose>
<xsl:when test="$IsThisListScope = 'True' and contentclass[. = 'STS_ListItem_PictureLibrary'] and picturethumbnailurl[. != '']">
<div style="padding-top: 2px; padding-bottom: 2px;">
<a href="{$url}" id="{concat('CSR_P',$id)}" title="{title}">
<img src="{picturethumbnailurl}" alt="" />
</a>
</div>
</xsl:when>
</xsl:choose>
<div class="srch-Description">
<xsl:choose>
<xsl:when test="hithighlightedsummary[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedsummary" />
</xsl:call-template>
</xsl:when>
<xsl:when test="description[. != '']">
<xsl:value-of select="description"/>
</xsl:when>
</xsl:choose>
</div >
<p class="srch-Metadata">
<span class="srch-URL">
<a href="{$url}" id="{concat('CSR_U_',$id)}" title="{$url}" dir="ltr">
<xsl:choose>
<xsl:when test="hithighlightedproperties/HHUrl[. != '']">
<xsl:call-template name="HitHighlighting">
<xsl:with-param name="hh" select="hithighlightedproperties/HHUrl" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise><xsl:value-of select="url"/></xsl:otherwise>
</xsl:choose>
</a>
</span>
<xsl:call-template name="DisplayCollapsingStatusLink">
<xsl:with-param name="status" select="collapsingstatus"/>
<xsl:with-param name="urlEncoded" select="urlEncoded"/>
<xsl:with-param name="id" select="concat('CSR_CS_',$id)"/>
</xsl:call-template>
</p>
</xsl:template>
<xsl:template name="HitHighlighting">
<xsl:param name="hh" />
<xsl:apply-templates select="$hh"/>
</xsl:template>
<xsl:template match="ddd">
…
</xsl:template>
<xsl:template match="c0">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c1">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c2">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c3">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c4">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c5">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c6">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c7">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c8">
<b><xsl:value-of select="."/></b>
</xsl:template>
<xsl:template match="c9">
<b><xsl:value-of select="."/></b>
</xsl:template>
<!-- A generic template to display string with non 0 string length (used for author and lastmodified time -->
<xsl:template name="DisplayString">
<xsl:param name="str" />
<xsl:if test='string-length($str) > 0'>
-
<xsl:value-of select="$str" />
</xsl:if>
</xsl:template>
<!-- document collapsing link setup -->
<xsl:template name="DisplayCollapsingStatusLink">
<xsl:param name="status"/>
<xsl:param name="urlEncoded"/>
<xsl:param name="id"/>
<xsl:if test="$CollapsingStatusLink">
<xsl:choose>
<xsl:when test="$status=1">
<br/>
<xsl:variable name="CollapsingStatusHref" select="concat(substring-before($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'), 'duplicates:"', $urlEncoded, '"', substring-after($CollapsingStatusLink, '$$COLLAPSE_PARAM$$'))"/>
<span class="srch-dup">
[<a href="{$CollapsingStatusHref}" id="$id" title="{$CollapseDuplicatesText}">
<xsl:value-of select="$CollapseDuplicatesText"/>
</a>]
</span>
</xsl:when>
</xsl:choose>
</xsl:if>
</xsl:template><!-- The "view more results" for fixed query -->
<xsl:template name="DisplayMoreResultsAnchor">
<xsl:if test="$MoreResultsLink">
<a href="{$MoreResultsLink}" id="CSR_MRL">
<xsl:value-of select="$MoreResultsText"/>
</a>
</xsl:if>
</xsl:template>
<xsl:template match="All_Results/DiscoveredDefinitions">
<xsl:variable name="FoundIn" select="DDFoundIn" />
<xsl:variable name="DDSearchTerm" select="DDSearchTerm" />
<xsl:if test="$DisplayDiscoveredDefinition = 'True' and string-length($DDSearchTerm) > 0">
<script language="javascript">
function ToggleDefinitionSelection()
{
var selection = document.getElementById("definitionSelection");
if (selection.style.display == "none")
{
selection.style.display = "inline";
}
else
{
selection.style.display = "none";
}
}
</script>
<div>
<a href="#" onclick="ToggleDefinitionSelection(); return false;">
<xsl:value-of select="$DefinitionIntro" /><b><xsl:value-of select="$DDSearchTerm"/></b></a>
<div id="definitionSelection" class="srch-Description" style="display:none;">
<xsl:for-each select="DDefinitions/DDefinition">
<br/>
<xsl:variable name="DDUrl" select="DDUrl" />
<xsl:value-of select="DDStart"/>
<b>
<xsl:value-of select="DDBold"/>
</b>
<xsl:value-of select="DDEnd"/>
<br/>
<xsl:value-of select="$FoundIn"/>
<a href="{$DDUrl}">
<xsl:value-of select="DDTitle"/>
</a>
</xsl:for-each>
</div>
</div>
</xsl:if>
</xsl:template>
<!-- XSL transformation starts here -->
<xsl:template match="/">
<xsl:if test="$AlertMeLink">
<input type="hidden" name="P_Query" />
<input type="hidden" name="P_LastNotificationTime" />
</xsl:if>
<xsl:choose>
<xsl:when test="$IsNoKeyword = 'True'" >
<xsl:call-template name="dvt_1.noKeyword" />
</xsl:when>
<xsl:when test="$ShowMessage = 'True'">
<xsl:call-template name="dvt_1.empty" />
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="dvt_1.body"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- End of Stylesheet -->
</xsl:stylesheet> | 0 |
11,542,385 | 07/18/2012 13:19:21 | 1,523,402 | 07/13/2012 11:24:08 | 54 | 2 | Move class into other class by ReSharper | I have a **not-nested** class `WillBeNestedClass` and another class `NestBox`.
Now I want to move class `WillBeNestedClass` into class `NestBox` as a nested class. So `WillBeNestedClass` will be nested in class `NestBox`.
Is there a refactoring in VS or ReSharper that can do that moving and that automatically updates all references to nested class (from `WillBeNestedClass` to `NestBox.WillBeNestedClass`)? | c# | resharper-5.1 | null | null | null | null | open | Move class into other class by ReSharper
===
I have a **not-nested** class `WillBeNestedClass` and another class `NestBox`.
Now I want to move class `WillBeNestedClass` into class `NestBox` as a nested class. So `WillBeNestedClass` will be nested in class `NestBox`.
Is there a refactoring in VS or ReSharper that can do that moving and that automatically updates all references to nested class (from `WillBeNestedClass` to `NestBox.WillBeNestedClass`)? | 0 |
11,542,387 | 07/18/2012 13:19:25 | 131,069 | 06/30/2009 13:14:48 | 115 | 6 | SQL INSERT Using WHILE LOOP and SELECT | Need to add a bunch of repetitive records to the database and don't want to do all of it by hand.
Need to add the intial records by hand but then want to create a query I can run to essentially template rest of the records and then just change the one different field by hand.
Problem is, I don't know exactly what the initial records are until I enter them.
For example
Record One<br/>
FieldOne = Text One<br/>
FieldTwo = Text Two A<br/>
FieldThree = int Three A<br/>
Record Two<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two B<br/>
FieldThree = int Three A(same as Record One)<br/>
Record Three<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two C<br/>
FieldThree = int Three A(same as Record One)<br/>
... X (N Records)
This all has to be done by hand. I then need to create:
Record Four<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two A (same as Record One)<br/>
FieldThree = int Three B (New Value)<br/>
Record Five<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two B (same as Record Two)<br/>
FieldThree = int Three B (same as Record Four)<br/>
Record Six<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two C (same as Record Three)<br/>
FieldThree = int Three B (same as Record Four)<br/>
... repeat for all the different values in Field Two.
Hope that makes sense?
Essentially what I want to do is:
WHILE (SELECT ALL DISTINCT VALUES FIELDTWO)<br/>
BEGIN<br/>
INSERT INTO TABLE VALUES ('Same all the time', Value From the FieldTwo Select, 'Same all the time')<br/>
END<br/>
Can this be done and can you give me the exact SQL statement to do it?
Thanks.
| sql | select | insert | while-loops | null | null | open | SQL INSERT Using WHILE LOOP and SELECT
===
Need to add a bunch of repetitive records to the database and don't want to do all of it by hand.
Need to add the intial records by hand but then want to create a query I can run to essentially template rest of the records and then just change the one different field by hand.
Problem is, I don't know exactly what the initial records are until I enter them.
For example
Record One<br/>
FieldOne = Text One<br/>
FieldTwo = Text Two A<br/>
FieldThree = int Three A<br/>
Record Two<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two B<br/>
FieldThree = int Three A(same as Record One)<br/>
Record Three<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two C<br/>
FieldThree = int Three A(same as Record One)<br/>
... X (N Records)
This all has to be done by hand. I then need to create:
Record Four<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two A (same as Record One)<br/>
FieldThree = int Three B (New Value)<br/>
Record Five<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two B (same as Record Two)<br/>
FieldThree = int Three B (same as Record Four)<br/>
Record Six<br/>
FieldOne = Text One (same as Record One)<br/>
FieldTwo = Text Two C (same as Record Three)<br/>
FieldThree = int Three B (same as Record Four)<br/>
... repeat for all the different values in Field Two.
Hope that makes sense?
Essentially what I want to do is:
WHILE (SELECT ALL DISTINCT VALUES FIELDTWO)<br/>
BEGIN<br/>
INSERT INTO TABLE VALUES ('Same all the time', Value From the FieldTwo Select, 'Same all the time')<br/>
END<br/>
Can this be done and can you give me the exact SQL statement to do it?
Thanks.
| 0 |
11,542,390 | 07/18/2012 13:19:39 | 1,534,881 | 07/18/2012 13:13:36 | 1 | 0 | allow simple quote and double quote in regex | I've got this regex "/src='cid:(.*)'/Uims" and it works fine but only match element in single quote . What is the way to also allow result who match double quotes (like /src="cid:(.*)"/Uims) but in a single regex? | regex | null | null | null | null | null | open | allow simple quote and double quote in regex
===
I've got this regex "/src='cid:(.*)'/Uims" and it works fine but only match element in single quote . What is the way to also allow result who match double quotes (like /src="cid:(.*)"/Uims) but in a single regex? | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.