unified_texts stringlengths 32 30.1k | OpenStatus_id int64 0 4 | input_ids list | token_type_ids list | attention_mask list |
|---|---|---|---|---|
CMD.EXE on windows 7 Ultimate
===
How Can I Make My Command Prompts Background
Transparent i Have used Econsole B4 But i Didnt Like it
cause it Messes up the Background A lot
Any Ideas?
| 2 | [
2,
2390,
43,
9,
1706,
62,
27,
1936,
453,
6612,
800,
3726,
3726,
184,
92,
31,
233,
51,
1202,
11443,
13531,
2395,
14862,
31,
57,
147,
13,
62,
12124,
6069,
334,
300,
47,
31,
1182,
101,
32,
1679,
32,
3957,
160,
71,
14,
2395,
21,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
revalidate running GUI JTable
===
My GUI needs to repopulate my Jtable panes when I search a new Ticker. However, it only creates a new GUI. I have tried leftTabbedPane.revalidate(), but it doesn't fix the error. I think I am just revalidating wrong, but I could have the whole concept wrong as well. If anyone could be of help it would be greatly appreciated.
![Gui Visual][1]
My code is
//compile javac -cp ;./jsoup-1.6.3.jar;commons-logging-1.1.1.jar;commons-httpclient-3.0.1.jar;commons-codec-1.6.jar;httpclient-4.2.jar AppGUI.java
public class AppGUI extends JFrame{
public AppGUI(Company company)throws Exception {
retrieveGUI(company);
}
public void retrieveGUI(Company company){
this.company = company;
incomeStatementPane = new IncomeStatementPane();
balanceSheetPane = new BalanceSheetPane();
cashFlowsPane = new CashFlowsPane();
JTabbedPane leftTabbedPane = new JTabbedPane(); //Left Pane
JComponent panel1 = incomeStatementPane.render(company); //Income Statement
leftTabbedPane.addTab("Income Statement", panel1);
leftTabbedPane.setMnemonicAt(0, KeyEvent.VK_1);
JComponent panel2 = balanceSheetPane.render(company); //Balance Sheet PAnel
leftTabbedPane.addTab("Balance Sheet", panel2);
leftTabbedPane.setMnemonicAt(1, KeyEvent.VK_2);
JComponent panel3 = cashFlowsPane.render(company); //Cash Flows Panel
leftTabbedPane.addTab("Cash Flows", panel3);
leftTabbedPane.setMnemonicAt(2, KeyEvent.VK_3);
JTabbedPane rightTabbedPane = new JTabbedPane(); //Right Pane
JComponent panel4 = LiquidityPane.render(company); //Liquidity
rightTabbedPane.addTab("Liquidity", panel4);
//ratioTabbedPane.setMnemonicAt(3, KeyEvent.VK_4);
JComponent panel5 = ProfitabilityPane.render(company); //Profitability
rightTabbedPane.addTab("Profitability", panel5);
//ratioTabbedPane.setMnemonicAt(4, KeyEvent.VK_5);
JComponent panel6 = LongTermSolvencyPane.render(company); //Long Term Solvency
rightTabbedPane.addTab("Long Term Solvency", panel6);
//ratioTabbedPane.setMnemonicAt(5, KeyEvent.VK_6);
JComponent panel7 = CashFlowAdequacyPane.render(company); //Cash Flow
rightTabbedPane.addTab("Cash Flow", panel7);
add(rightTabbedPane, BorderLayout.CENTER);
add(leftTabbedPane, BorderLayout.WEST);
JPanel bottomPanel = new JPanel();
bottomPanel.setBackground(new Color(150, 150, 150));
JButton computeBtn = new JButton("Compute Ratios");
//ActionListener computeBtnListener = new computeListener(); //computebutonlistener
//computeBtn.addActionListener(computeBtnListener); //actionlistener
//compute()
bottomPanel.add(computeBtn, BorderLayout.EAST);
JPanel tickerPanel = new JPanel();
JLabel tickerLabel = new JLabel("Search Ticker:");
final JTextField tickerField = new JTextField(10);
JButton searchBtn = new JButton("Search");
searchBtn.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e){
//final String newTicker = tickerField.getText();
try{
refresh(tickerField.getText());
}
catch(Exception ae){}
}
});
tickerPanel.add(tickerLabel/*, BorderLayout.WEST*/);
tickerPanel.add(tickerField/*, BorderLayout.WEST*/);
tickerPanel.add(searchBtn);
add(tickerPanel, BorderLayout.NORTH);
add(bottomPanel, BorderLayout.SOUTH);
//*****I TRIED A REVALIDATE HERE****
}
public void setCompany(Company company) {
this.company = company;
}
// Enter new symbol.
// compnay
public void refresh(String newTicker)throws IOException{
Company newCompany = new Company(newTicker); // Creates new Company. Updating methods are called from constructor automatically.
//System.out.println(newTicker);
retrieveGUI(newCompany); // Stuff from contstructor.
//****AND A REVALIDATE HERE******
}
private Company company;//company from ticker JLabel
private IncomeStatementPane incomeStatementPane;
private BalanceSheetPane balanceSheetPane;
private CashFlowsPane cashFlowsPane;
public static void main(String[] args) throws Exception{
Company company = new Company(); // Creates new Company. Updating methods are called from constructor automatically.
AppGUI frame = new AppGUI(company); // Creates new App GUI. Various panes are initialized from constructor.
frame.retrieveGUI(company);
frame.setTitle("Financial Calculator | Ratios");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setMinimumSize(new Dimension(1000, 500));
frame.pack();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
// public compute(){
// refresh();
// render();
// }
}
[1]: http://i.stack.imgur.com/9R2iJ.png | 0 | [
2,
302,
18506,
8209,
946,
9457,
487,
5924,
800,
3726,
3726,
51,
9457,
2274,
20,
302,
6057,
12383,
51,
487,
5924,
1809,
160,
76,
31,
2122,
21,
78,
8809,
106,
9,
207,
15,
32,
104,
9695,
21,
78,
9457,
9,
31,
57,
794,
225,
15783,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Knockout - binding array or single item
===
I have an array of data as follows:
var data = {
'UserReports': [{
"Id": 1,
"ReportTemplateId": 1,
"ReportSortOptionId": 4,
"Description": "Click me to bring up dialog 1",
"SReportColumnGroups": [1, 44]},
{
"Id": 2,
"ReportTemplateId": 2,
"ReportSortOptionId": 4,
"Description": "Click me to bring up dialog 2",
"SReportColumnGroups": [1, 2]}]
};
I am binding it to my model into an array called UserReports using the following binding:
var userReportsMapping= {
'UserReports': {
key: function(data) {
return ko.utils.unwrapObservable(data.Id);
},
create: function(options) {
return new userReportModel(options.data);
}
}
};
ko.mapping.fromJS(data, userReportsMapping, model);
Elsewhere in my code I need to copy an item from the UserReports array to form a new UserReport - I am currently doing this using the following binding:
var userReportMapping= {
key: function(data) {
return ko.utils.unwrapObservable(data.Id);
},
create: function(options) {
return new userReportModel(options.data);
}
};
var response = ko.mapping.fromJS(ko.mapping.toJS(result[0]), userReportMapping);
where result[0] is an item from the model.UserReports array.
There is a fiddle containing all of this code in context [here][1]
Is there a better way to write this mapping?
[1]: http://jsfiddle.net/BW637/2/ | 0 | [
2,
11676,
13,
8,
8728,
7718,
54,
345,
9101,
800,
3726,
3726,
31,
57,
40,
7718,
16,
1054,
28,
2415,
45,
4033,
1054,
800,
13,
1,
13,
22,
16704,
17437,
18,
22,
45,
636,
1,
13,
7,
1340,
7,
45,
137,
15,
13,
7,
17437,
9577,
6554,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
UIImagePickerController overlayView and showsCameraControls issue
===
I'm trying to use a custom overlay on the UIImagePickerController and also be able to move and scale the resulting image. The problem is when I set showsCameraControls=YES, the overlay won't show but I can use the the move and scale functionality. However, when showsCameraControls is NO, the overlay appears, but when I take the picture, I don't even get the option to crop the image. The actual view loaded from the xib is just a UIToolbar with two buttons, one of which takes the picture
I have a controller (OverlayViewController) which loads the overlay from a xib file as it's view. This controller also has a UIImagePickerController so it sets the overlay of the UIImagepicker controller to the view of the OverlayController. This first method is called in a different controller to set it all up and display it. In summary, I need to be able see the overlayview and use it's button to take the picture, which I can then move and scale
-(void) openCameraForImage
{
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
{
self.overlayViewController =
[[OverlayViewController alloc] initWithNibName:@"OverlayViewController" bundle:nil];
// as a delegate we will be notified when pictures are taken and when to dismiss the image picker
self.overlayViewController.delegate = self;
[self.overlayViewController setupImagePicker:UIImagePickerControllerSourceTypeCamera];
[self presentModalViewController:self.overlayViewController.imagePickerController animated:YES];
}
else {
[Common ShowAlert:@"Alert" andMessage:@"There is no camera on this device"];
}
}
This method is in OverlayViewController and does the work of setting up the Overlay.
- (void)setupImagePicker:(UIImagePickerControllerSourceType)sourceType
{
self.imagePickerController.sourceType = sourceType;
[self.imagePickerController setAllowsEditing:YES];
if (sourceType == UIImagePickerControllerSourceTypeCamera)
{
// user wants to use the camera interface
//
self.imagePickerController.showsCameraControls = NO; //This line allows overlay to show but move and scale doesn't work
self.imagePickerController.allowsEditing = YES;
//[self.view setUserInteractionEnabled:NO];
if ([[self.imagePickerController.cameraOverlayView subviews] count] == 0)
{
// setup our custom overlay view for the camera
//
// ensure that our custom view's frame fits within the parent frame
CGRect overlayViewFrame = self.imagePickerController.cameraOverlayView.frame;
CGRect newFrame = CGRectMake(0.0,
CGRectGetHeight(overlayViewFrame) -
self.view.frame.size.height - 10.0,
CGRectGetWidth(overlayViewFrame),
self.view.frame.size.height + 10.0);
self.view.frame = newFrame;
self.imagePickerController.cameraOverlayView = self.view;
}
}
}
This method in OverlayViewConroller takes the picture
- (IBAction)takePhoto:(id)sender
{
[self.imagePickerController takePicture];
}
| 0 | [
2,
13,
5661,
22039,
16855,
106,
12898,
1252,
84,
4414,
4725,
17,
1285,
24636,
12898,
18,
1513,
800,
3726,
3726,
31,
22,
79,
749,
20,
275,
21,
5816,
84,
4414,
27,
14,
13,
5661,
22039,
16855,
106,
12898,
1252,
17,
67,
44,
777,
20,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Flip transition between storyboard view controllers not working
===
I'm having a lot of trouble setting a flip transition between storyboards. The app crashes when the method below is called. I'm getting the error message:
`[NSPathStore2 setView:]: unrecognized selector sent to instance...`
This is my code:
- (void)advanceToNextViewController {
humptyDumptyViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"firstStoryVC"];
/*
[self.navigationController pushViewController:controller animated:YES];
*/
[UIView beginAnimations:@"animation" context:nil];
[self.navigationController pushViewController:controller animated:NO];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO];
[UIView commitAnimations];
}
I'd appreciate any help with this. | 0 | [
2,
8805,
4513,
128,
609,
2806,
1418,
9919,
18,
52,
638,
800,
3726,
3726,
31,
22,
79,
452,
21,
865,
16,
2572,
2697,
21,
8805,
4513,
128,
609,
2806,
18,
9,
14,
4865,
21563,
76,
14,
2109,
1021,
25,
227,
9,
31,
22,
79,
1017,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uses of volatile without synchronization
===
Knowing that
> Reads and writes are [atomic][1] for all variables declared volatile
**Question1:** Can this be understood as if
private volatile int x = 0;
`x++;` operation is atomic?
And that
> Marking variable volatile does not eliminate all need to synchronize
> atomic actions, because [memory consistency errors are still possible.][2]
**Question2:** I wonder under what circumstances (if any) it is possible to see a variable marked `volatile` and not see any methods of blocks marked synchronized (that attempt to access/ modify the variable)?
In other words, should all variables that need to be protected from concurrent modification be marked `volatile`?
[1]: http://docs.oracle.com/javase/tutorial/essential/concurrency/atomic.html
[2]: http://docs.oracle.com/javase/tutorial/essential/concurrency/memconsist.html | 0 | [
2,
2027,
16,
24208,
366,
13,
16023,
1829,
800,
3726,
3726,
2506,
30,
13,
1,
11137,
17,
6215,
50,
636,
26990,
500,
2558,
165,
500,
26,
65,
12157,
2482,
24208,
13,
1409,
24652,
165,
45,
1409,
92,
48,
44,
4014,
28,
100,
932,
24208,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
GWT Restlet Parameters Always Null
===
I am brand new to both REST and RESTlet- I got everything up and communicating last night but what I found this morning is that everything I pass into the server is always becoming null.
just as a sample app i have the following - a User Objectify entity (id, emailAddress, and version), and a RESTUserProxy object (id, emailAddress) - I wasn't originally sure if i could pass Objectify Entities back and after not being able to see anything switched it to the Proxy object - if i can get it to work this way I will try switching it back
the front end is as follows:
public interface RESTUserResourceProxy extends ClientProxy {
@Get
public void find(String emailAddress, Result<RESTUserProxy> callback);
@Put
public void persist(RESTUserProxy user, Result<Void> callback);
@Delete
public void delete(RESTUserProxy user, Result<Void> callback);
}
the backend code is as follows (this is currently extremely ugly - i got a little frustrated just trying to see something and put in a ton of sysouts)
public class RESTUserServerResource extends ServerResource implements RESTUserResource {
private final UserDao userDao;
public RESTUserServerResource() {
System.out.println("CREATED USER RESOURCE IMPL");
userDao = new UserDao();
}
@Override
@Get
public RESTUserProxy find() {
System.out.println("reference = " + getReference());
Form queryParams = getReference().getQueryAsForm();
System.out.println("query params = " + queryParams);
System.out.println("query = " + getQuery());
System.out.println("query string = " + getQuery().getQueryString());
String searchQuery = (String) getRequest().getAttributes().get("searchQuery");
System.out.println("search query = " + searchQuery) ;
return null;
// if (emailAddress == null) {
// System.out.println("EMAIL ADDRESS WAS NULL FOR NO FUCKING GOOD REASON");
// return null;
// }
// System.out.println("user resource impl find [" + emailAddress + "]");
// final User user = userDao.find(emailAddress.getText());
// if (user != null) {
// System.out.println("found user ");
// return new RESTUserProxy(user.getId(), user.getEmailAddress());
// } else {
// System.out.println("found absolutely nothing");
// return null;
// }
}
@Override
@Put
public void persist(RESTUserProxy userProxy) {
System.out.println("user proxy = " + userProxy);
if (userProxy == null) {
return;
}
final User user = userDao.find(userProxy.getId());
user.setEmailAddress(userProxy.getEmailAddress());
user.setId(userProxy.getId());
userDao.persist(user);
}
@Override
@Delete
public void delete(RESTUserProxy userProxy) {
final User user = userDao.find(userProxy.getId());
userDao.delete(user);
}
}
what im having problems with is that eerythings coming through as null - a lot of other answers on here said to get the query to get the params - but here the query is null
below is the output of calling find and persist
reference = http://127.0.0.1:8888/users/123
query params = []
query = []
query string =
search query = null
i'm sure i'm doing something stupid here i just have no idea how to proceed right now. Any help as to what i'm doing wrong would be greatly appreciated.
| 0 | [
2,
14094,
38,
760,
1336,
12905,
550,
16203,
800,
3726,
3726,
31,
589,
2209,
78,
20,
156,
760,
17,
760,
1336,
8,
31,
330,
796,
71,
17,
23284,
236,
343,
47,
98,
31,
216,
48,
959,
25,
30,
796,
31,
1477,
77,
14,
8128,
25,
550,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Update JTable with Separate Thread
===
The purpose of the application is to query a table, and take that information and update a JTable. Right now the ThreadTask() is able to query the table and obtain the information. My question is how do I update the JTable GUI object with the information obtained from the database?
public class AdminManager extends JFrame {
public static void main(String[] args) throws InterruptedException {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
AdminManager frame = new AdminManager();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
// Setup connection pool
ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor();
exec.scheduleAtFixedRate(new ThreadTask(connection), 2000, 100, TimeUnit.MILLISECONDS);
}
/**
* Create the frame.
*/
public AdminManager() {
// Setup GUI
DefaultTableModel model = new DefaultTableModel();
model.addColumn("#");
tableQueue = new JTable(model);
tableQueue.getColumnModel().getColumn(0).setPreferredWidth(3);
scrollPane.setViewportView(tableQueue);
}
}
class ThreadTask implements Runnable {
private Connection connection;
public ThreadTask(Connection c) {
connection = c;
}
@Override
public void run() {
String sql = "SELECT * FROM table;";
Statement st;
try {
st = connection.createStatement();
ResultSet rs = st.executeQuery(sql);
while(rs.next()) {
String order_num = rs.getString("order_num");
}
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
| 0 | [
2,
11100,
487,
5924,
29,
1725,
9322,
800,
3726,
3726,
14,
2131,
16,
14,
3010,
25,
20,
25597,
21,
859,
15,
17,
247,
30,
676,
17,
11100,
21,
487,
5924,
9,
193,
130,
14,
9322,
38,
20310,
5,
6,
25,
777,
20,
25597,
14,
859,
17,
5... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Odd php file_get_contents behavior
===
I have written a file in php that is doing some behind the scenes work and returns a simple number based on the location GET parameter, in this case the output is 49, see for yourself, cut and paste this into your browser:
http://www.ericseven.com/distance.php?location=3133 W. Belle Ave San Tan Valley, AZ 85142
When I pull this into another php file, which I want to use the number to do some calculations with, it returns, inexplicably, a different number (in this case 7174, as you can see if you hit the following URL):
http://www.ericseven.com/test.php
This is the source of test.php - note that the $url is the same as the location parameter above (it is a cut and paste):
$url = "http://www.ericseven.com/distance.php?location=3133 W. Belle Ave San Tan Valley, AZ 85142";
$contents = file_get_contents($url);
echo $contents;
I have searched and searched and I don't know if I'm searching wrong or what the deal is but I can't find any relationship between the two numbers (49 and 7174) nor can I find anyone who is dealing with anything similar. FYI I tried fopen/fread - same results. | 0 | [
2,
4210,
13,
26120,
3893,
1,
3060,
1,
25424,
18,
3257,
800,
3726,
3726,
31,
57,
642,
21,
3893,
19,
13,
26120,
30,
25,
845,
109,
439,
14,
3918,
170,
17,
4815,
21,
1935,
234,
432,
27,
14,
1474,
164,
18906,
15,
19,
48,
610,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Dynamic Snap-On Widgets
===
I am trying to create a Javascript/Jquery based application that will eventually go into my blog. Here is the [jsFiddle][1]
[1]: http://jsfiddle.net/uzfwF/1/
I am using chrome and have not tested on other browsers, but what it does so far on my browser is allow for the white "moveable" divs to become "snappable" within the left and right columns. I have seemed to gotten that part figured out. There are 2 other things I would like that I cannot figure out how to do.
1) I would like to make it so if there are 2 or more "moveable" divs in the same column and you try to move them over each other, they do not overlap. Right now they overlap, but I want the other div(s) to just move as well when they come into contact with each other. I tried using css to just change the positioning to relative but the rest of the code.
2) When you hold down the mouse on the div and move, sometimes it tries to highlight the div with the mouse, which kind of "glitches" out the div, forcing you to re-click. Is there a way around this?
Thanks | 0 | [
2,
7782,
6877,
8,
218,
4807,
43,
3060,
18,
800,
3726,
3726,
31,
589,
749,
20,
1600,
21,
8247,
8741,
118,
728,
8190,
93,
432,
3010,
30,
129,
878,
162,
77,
51,
8146,
9,
235,
25,
14,
636,
728,
18,
1707,
12312,
500,
2558,
165,
500... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to play music from the ipod in custom app when the app goes to background
===
> I am developing a music app, where the music continues playing even
> when the app goes into background and also how to connect
> beginReceivingRemoteControlEvents so that the user can control the
> status of the playback by clicking home button twice on his
> iphone/ipad . I gone thro the "Music App" Sample developed by apple
> where it uses MPMusicPlayerController where it fetches songs from ipod
> library but it stops the song as soon as the app goes to background
> nor it even supports beginReceivingRemoteControlEvents. i checked few
> articles where it says use AVPlayer but it doesnt support fetching
> music from ipodLibrary so i am stuck in how to play the music when the
> app goes into background and it is controlled via remoteEvents. | 0 | [
2,
184,
20,
418,
232,
37,
14,
31,
10670,
19,
5816,
4865,
76,
14,
4865,
1852,
20,
2395,
800,
3726,
3726,
13,
1,
31,
589,
3561,
21,
232,
4865,
15,
113,
14,
232,
2622,
791,
166,
13,
1,
76,
14,
4865,
1852,
77,
2395,
17,
67,
184,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
compojure route with multiple parameters
===
Is it possible to define a compojure route that contains multiple parameters?
i.e:
(def my-routes
(routes
(GET "/something/:param1/:param2" [] my-handler))) | 0 | [
2,
6479,
12683,
4221,
858,
29,
1886,
12905,
800,
3726,
3726,
25,
32,
938,
20,
9267,
21,
6479,
12683,
4221,
858,
30,
1588,
1886,
12905,
60,
31,
9,
62,
45,
13,
5,
13862,
51,
8,
20179,
18,
13,
5,
20179,
18,
13,
5,
3060,
13,
7,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Core Data NSInternalInconsistencyException (different this time)
===
I know there are a million of these questions in SO, but this is different, and I am stumped.
I have a data model with about a dozen entities in it. Code ran just fine. Then I versioned the model, added an entity and a relationship, then updated the setting for the current versioned data model in the xdatamodeld file and am now getting NSInternalInconsistencyException when trying to access the new entity.
In my main VC I log the context, the persistent store coordinator, the managed object model, and all of the entities. Everything looks as I would expect, including the entity I am trying to access.
I have blown the SQLite DB away, and let Core Data recreate it, and can see the table, with correct column types.
Everything looks correct.
Here is the fetching code:
- (void)fetchMissions {
NSFetchRequest *request = [[NSFetchRequest alloc] init];
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Mission" inManagedObjectContext:self.managedObjectContext];
NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"title" ascending:YES];
NSArray *sortDescriptors = [[NSArray alloc] initWithObjects:sortDescriptor, nil];
[request setEntity:entity];
[request setSortDescriptors:sortDescriptors];
NSError *error = nil;
missionsArray = [[self.managedObjectContext executeFetchRequest:request error:&error] mutableCopy];
}
Here is the output from:
NSLog(@"Entities : %@",[[self.managedObjectContext.persistentStoreCoordinator.managedObjectModel entities] valueForKey:@"name"]);
Entities : (
Character,
CharacterClass,
CharacterCondition,
CharacterObjective,
CharacterPerception,
Condition,
Mission,
Objective,
Perception,
PlayerCharacter,
Scoreboard
)
I also see the detail for the Mission entity when I print out the entire managed object model with:
NSLog(@"MOM : %@", self.managedObjectContext.persistentStoreCoordinator.managedObjectModel);
The entity is dead simple... 3 columns, two are text/string and one is an integer. Entity description in the model editor matches the table definition in SQLite.
What am I missing?? | 0 | [
2,
2884,
1054,
13,
2172,
6280,
325,
1226,
12124,
702,
8883,
10066,
872,
13,
5,
15782,
48,
85,
6,
800,
3726,
3726,
31,
143,
80,
50,
21,
507,
16,
158,
2346,
19,
86,
15,
47,
48,
25,
421,
15,
17,
31,
589,
15781,
69,
9,
31,
57,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mechanics of partitioning
===
Imagine the following hypothetical database structure. Basically it's a top down structure (Country has Orders, Order has OrderLines, OrderLine has ShipLines, etc...).
![enter image description here][1]
I want to partition my SQL Server 2008 database by CountryID. As you can see, CountryID is only in the first 2 tables (e.g. amCountries and amOrders). Given that (as far as I understand) that partitioning is done at the table level, do I need to add CountryID to the remaining tables to be able to partition them? Or is there some type of cascade available in SQL Server that will allow me to skip adding CountryID to everything?
[1]: http://i.stack.imgur.com/Gfcmr.png | 2 | [
2,
9701,
16,
10711,
68,
800,
3726,
3726,
4382,
14,
249,
26161,
6018,
1411,
9,
11374,
32,
22,
18,
21,
371,
125,
1411,
13,
5,
10741,
63,
3204,
15,
389,
63,
389,
7939,
15,
389,
1143,
63,
995,
7939,
15,
2722,
9,
9,
9,
6,
9,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to access "core" include files from subdomain(s) & main domain
===
I'm looking to develop a website that will have the "main" site for the end-users, but also subdomains for admin, api, etc (admin.abc.com, api.abc.com, etc). I'd like to use one copy of certain files, such as database connection, config files, classes, etc. I'm only looking to include PHP; the CSS, headers and other things will all be different and I'll *want* different copies. I just don't want to have to edit three files when I update a class file.
I'll have full server access and such, but I'd like the least-modifications-necessary method. Can I just make a "common" folder in the same directory as `public_html` and access it with something like `$_SERVER['DOCUMENT_ROOT'] . "../common/file.php` - and then from a subdomain, assumed in `domains/abc/` as `$_SERVER['DOCUMENT_ROOT'] . "../../common/file.php`?
Thank you! | 0 | [
2,
184,
20,
1381,
13,
7,
10375,
7,
468,
6488,
37,
972,
537,
6232,
5,
18,
6,
279,
407,
4603,
800,
3726,
3726,
31,
22,
79,
699,
20,
2803,
21,
2271,
30,
129,
57,
14,
13,
7,
6232,
7,
689,
26,
14,
241,
8,
16704,
18,
15,
47,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Eclipse ADT (android Pugin) refuses to find images in drawable folder
===
Off the bat, version information:
* Eclipse: Juno Release, build 20120614-1722
* Android: 4.4
* ADT: 20.0.0v201206242043-391819
There are many, many questions on SO regarding the various `res/drawable` folders (standard, `drawable-hdpi`, `-mdpi`, `-ldpi`, `-xhdpi`) and on whether it's necessary to create the standard drawable folder if it doesn't exist, where Android/ADT/Eclipse will look for the `@drawable/*` files, etc. However, my question seems to not have been answered thus far.
It's a pretty striaghtforward problem. To put it simply, I placed a file name 'starbg.png' in my `drawable-hdpi` folder, then used the qualifier `@drawable/starbg.png` in a layout `xml` file. However, Eclipse is throwing an error:
error: Error: No resource found that matches the given name (at 'background'
with value '@drawable/starbg.png').
Why? Unsure. I have tried the following solutions based on SO questions, all without success:
* Cleaning the project (multiple times)
* Creating a `res/drawable` folder (as one was not auto-generated by my version of ADT) and adding the image there
* Copying the file into every single related folder
* Renaming the file to `star_bg.png`
* Restarting Eclipse
The project is not complicated. It's an incredibly simple setup, with 2 views, one of which has nothing more than a `LinearLayout` with an `android:background` attribute (with layout and orientation info, of course), the other of which works like a charm.
So I'm stumped. Any help is hugely appreciated. | 0 | [
2,
11652,
21,
43,
38,
13,
5,
290,
18524,
3323,
5831,
6,
10864,
20,
477,
3502,
19,
2003,
579,
19294,
800,
3726,
3726,
168,
14,
3570,
15,
615,
676,
45,
1637,
11652,
45,
21715,
830,
15,
1895,
563,
3370,
1419,
8,
1053,
2287,
1637,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
clear viewport in wpf
===
I create a model (cube) and add that to my viewport and it works properly without any problem.
this.mainViewport.Children.Add(model);
whenever I use the following code, the cube become black instead of it's original color.
this.mainViewport.Children.Clear();
this.mainViewport.Children.Add(model);
I need to clear the viewport as I am adding the cube in another position in next second. any suggestion to solve that problem would be highly appreciated. | 0 | [
2,
1207,
1418,
1993,
19,
619,
7721,
800,
3726,
3726,
31,
1600,
21,
1061,
13,
5,
23592,
6,
17,
3547,
30,
20,
51,
1418,
1993,
17,
32,
693,
7428,
366,
186,
1448,
9,
48,
9,
6232,
4725,
1993,
9,
17853,
9,
14854,
5,
13998,
6,
73,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
pandas pivoting a dataframe, duplicate rows
===
I'm having a little trouble with pivoting in pandas. The dataframe I'm working on has column A, a series of dates (also the index) that repeats (e.g. date1, date2, date3, date1,..), column B, a series of Locations (e.g. A, A, A, B, B, B...), and column C, a series of values (X, Y, Z...). I'm trying to pivot on location to get a dataframe where the index is the dates (column A), the columns are column B (the locations), and the dataframe is filled with the values from column C. Unfortunately, what happens is that the index/column A remains repeating (e.g. date1, date2, date3, date1...), the columns become the locations (column B), and I get a bunch of NAs for the values since the dates repeats X times (X = # of locations). Sorry I couldn't represent the dataframe better. I'm probably missing something simple. Does anyone know how to fix this problem? I want to get it so that the index no longer repeats (e.g. just date1, date2, date3 and the columns are the locations, so the filled values have no NAs).
Thanks. | 0 | [
2,
16982,
18,
20670,
68,
21,
1054,
8361,
15,
19429,
11295,
800,
3726,
3726,
31,
22,
79,
452,
21,
265,
2572,
29,
20670,
68,
19,
16982,
18,
9,
14,
1054,
8361,
31,
22,
79,
638,
27,
63,
4698,
21,
15,
21,
231,
16,
4076,
13,
5,
25... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Incompatible types: 'TDownloadProgressEvent' and 'Procedure'
===
I am trying to download a file while having the status shown in a progress bar.
I followed the instructions located here:
http://delphi.about.com/cs/adptips2003/a/bltip0903_2.htm
Here is my code:
unit unitUpdate;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, StdCtrls, ComCtrls, ExtActns;
type
TForm5 = class(TForm)
ProgressBar1: TProgressBar;
SaveDialog1: TSaveDialog;
private
procedure URL_OnDownloadProgress
(Sender: TDownLoadURL;
Progress, ProgressMax: Cardinal;
StatusCode: TURLDownloadStatus;
StatusText: String; var Cancel: Boolean) ;
function DoDownload: boolean;
public
{ Public declarations }
end;
var
Form5: TForm5;
implementation
{$R *.dfm}
procedure TForm5.URL_OnDownloadProgress;
begin
ProgressBar1.Max:= ProgressMax;
ProgressBar1.Position:= Progress;
end;
function TForm5.DoDownload: Boolean;
begin
ShowMessage('A new update is available!');
savedialog1.Title := 'Save Update';
savedialog1.Filter := 'Exe Files (*.exe)|*.exe';
savedialog1.Execute;
if savedialog1.filename = '' then
Application.Terminate
else begin
with TDownloadURL.Create(self) do
try
URL:='linktofile';
FileName := savedialog1.FileName + '.exe';
OnDownloadProgress := TForm5.URL_OnDownloadProgress;
ExecuteTarget(nil) ;
finally
Free;
end;
end;
end;
end.
Upon compiling i get the following error:
[DCC Error] unitUpdate.pas(50): E2010 Incompatible types: 'TDownloadProgressEvent' and 'Procedure'
It is referring to this line of code:
OnDownloadProgress := TForm5.URL_OnDownloadProgress;
I am having trouble fixing this error..
Any help would be greatly appreciated.
Thanks. | 0 | [
2,
19,
20049,
2551,
45,
13,
22,
38,
2968,
8294,
2740,
13026,
4943,
38,
22,
17,
13,
22,
15617,
69,
4221,
22,
800,
3726,
3726,
31,
589,
749,
20,
7121,
21,
3893,
133,
452,
14,
1782,
1721,
19,
21,
3455,
748,
9,
31,
709,
14,
7650,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ios - problems after encoding a url string
===
I have some code to send a url to a remote server. If I do not encode the url, it works perfectly. But if I encode the url, it does not work. So I am pretty sure something is not right with the way I encode the url query string.
Here is my code:
// URL TO BE SUBMITTED.
NSString *urlString =
@"http://www.mydomain.com/test.php?";
// NOW CREATE URL QUERY STRING
NSString *unencoded_query_string =
@"name=%@&user_id=%@&person_name=%@&person_email=%@&privacy=%@";
// PUT PREVIOUSLY SET VALUES INTO THE QUERY STRING
NSString *unencoded_url_with_params =
[NSString stringWithFormat:unencoded_query_string, business , user_id , name , email , privacy_string];
// ENCODE THE QUERY STRING
NSString *escapedString = (__bridge_transfer NSString *)CFURLCreateStringByAddingPercentEscapes(
NULL,
(__bridge CFStringRef)unencoded_url_with_params,
NULL,
(CFStringRef)@"!*'();:@&=+$,/?%#[]",
kCFStringEncodingUTF8);
// NOW APPEND URL TO QUERY STRING
NSString *full_encoded_url_string =
[urlString stringByAppendingString: escapedString];
and then I send this string to the server, and the server does have the correct request file invoked, but isn't able to read the parameters.
Would anyone know what I doing incorrectly here? I am using arc by the way.
Thanks! | 0 | [
2,
13,
7760,
13,
8,
1716,
75,
19608,
21,
287,
6362,
3724,
800,
3726,
3726,
31,
57,
109,
1797,
20,
2660,
21,
287,
6362,
20,
21,
5388,
8128,
9,
100,
31,
107,
52,
20523,
14,
287,
6362,
15,
32,
693,
5759,
9,
47,
100,
31,
20523,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mvc 3 - Use the same view and viewmodel for standard and admin screen?
===
I have two screens, a standard user screen and an admin screen. The changes between the two are fairly minor - a few extra buttons and options on the admin screen.
As far as MVC best practices, is it better to:
1. Use the **same view and the same viewmodel** for both the admin and the standard user screen. That way there is no code duplication, but I will have several if...else statements in the view and controller
2. Use **separate views and viewmodels** for the admin and user screens. This leads to some code duplication, but is ultimately the most flexible if the screens end up diverging more than they currently are.
3. Some other great solution for this?
| 0 | [
2,
307,
8990,
203,
13,
8,
275,
14,
205,
1418,
17,
1418,
13998,
26,
1236,
17,
21,
43,
2160,
2324,
60,
800,
3726,
3726,
31,
57,
81,
14236,
15,
21,
1236,
4155,
2324,
17,
40,
21,
43,
2160,
2324,
9,
14,
1693,
128,
14,
81,
50,
664... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sphinx sql_attr_bigint on a 32-bit machine
===
I am running sphinx on a 32 bit machine and want to get the sql_attr_bigint to work.
1. Can this be done?
2. Should it work by default?
3. Do I have to re-compile and make any changes at compile time?
4. What effect will it have on performance?
My table id fits in 32-bits. I just need this with one attribute and it must be 64 bits.
Could the problem be in PHP? | 0 | [
2,
27274,
4444,
255,
1,
10303,
139,
1,
6407,
6391,
27,
21,
2512,
8,
3326,
1940,
800,
3726,
3726,
31,
589,
946,
27274,
27,
21,
2512,
1142,
1940,
17,
259,
20,
164,
14,
4444,
255,
1,
10303,
139,
1,
6407,
6391,
20,
170,
9,
137,
9,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Handling async workflow with javascript
===
I'm writing a browser extension for chrome that uses Web SQL for local storage. The code for both of these components seems to heavily rely on async operations. I have a good understanding of asynchronous operations but not a whole lot of experience writing code that relies heavily on them.
For Example:
var CSUID = "";
//this is an async callback for handling browser tab updates
function checkForValidUrl(tabId, changeInfo, tab) {
getCookies("http://www.cleansnipe.com/", "CSUID", handleCookie);
if(CSUID != ""){ //this could be in handleCookie if i could access the tab
//do stuff with the tab
}
}
function handleCookie(cookie) {
if (cookie != "" && cookie != null) {
CSUID = cookie;
}
}
In order to overcome the lack of ability to pass/return variables into/from these handlers I find myself creating global variables and setting them in the handlers. Of course this doesn't work as expected because the variable is often accessed before the callback has executed.
What is the best practice for handling this situation? I thought to use global flags/counters with a while loop to pause execute but this seems messy prone to application hang. | 0 | [
2,
7988,
21,
9507,
150,
170,
9990,
29,
8247,
8741,
800,
3726,
3726,
31,
22,
79,
1174,
21,
16495,
3896,
26,
13,
12985,
30,
2027,
2741,
4444,
255,
26,
375,
4326,
9,
14,
1797,
26,
156,
16,
158,
5090,
2206,
20,
2991,
12139,
27,
21,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android : The rounded corners work different in different Android version
===
I have problem with the corners tag.
This is my shape file.
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<stroke
android:width="1dp"
android:color="#ff999999" />
<size android:height="40dp" />
<gradient
android:angle="90"
android:centerColor="#f5f5f5"
android:endColor="#fcfcfc"
android:startColor="#efefef"
android:type="linear" />
<corners
android:bottomLeftRadius="0dip"
android:bottomRightRadius="8dip"
android:topLeftRadius="8dip"
android:topRightRadius="0dip" />
</shape>
But when I set it for view's background. It display different shape in Android 2.2 and Android 4.3 .
When it is running on Android 4.3 :[running on Android 4.3][1]
And on Android 2.2 :[Running on Android 2.2][2]
Please see "ANNOUNCE" button.
Do you know why ? And how can I fix it ?
Please help me !
Sorry because my English is not really well.
[1]: http://imageshack.us/photo/my-images/94/screenshot20120727at110.png/
[2]: http://imageshack.us/photo/my-images/651/screenshot20120727at111.png/ | 0 | [
2,
13005,
13,
45,
14,
8472,
8894,
170,
421,
19,
421,
13005,
615,
800,
3726,
3726,
31,
57,
1448,
29,
14,
8894,
3383,
9,
48,
25,
51,
2539,
3893,
9,
13,
1,
25096,
23504,
2172,
45,
290,
18524,
3726,
7,
21127,
6903,
7526,
5250,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
how to configure https in ubuntu with apache over windows azure
===
I have an Ubuntu 12.04 server in Windows Azure with Apache. I have configured Apache with an SSL certificate.
I can access apache on port 443 locally, so apache is correctly working for HTTPS.
I have also configured an endpoint for the virtual machine with protocol TCP, public port 443, and private port 443 on windows azure.
And installed the certificate on the windows azure cloud service.
But the traffic is arriving correctly to the server for HTTPS (everything works for other ports like SSH and HTTP).
I have searched a lot over the Internet but all the information I found doesn't match the interface I'm using (I don't have any configuration files to edit...)
Is there anything else that needs to be done.
Any help would be apreciated. | 2 | [
2,
184,
20,
1065,
15951,
7775,
18,
19,
287,
12968,
2473,
29,
17140,
84,
1936,
25715,
800,
3726,
3726,
31,
57,
40,
287,
12968,
2473,
390,
9,
3277,
8128,
19,
1936,
25715,
29,
17140,
9,
31,
57,
28895,
17140,
29,
40,
13,
18,
18,
255... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Where am I losing my object context?
===
One more try at this. I've already had my previous question down voted.
I am loading a class through a class that is never instantiated via a static method. The class I am loading however is supposed to be instantiated but I suspect that execution never gets that far. There is nothing static in this class, but php keeps throwing:
**Fatal error: Using $this when not in object context**
Here is the class in it's entirety:
class Config{
public $_config;
public function load()
{
$modules = array();
$modules = scandir(MOD);
$n = count($modules);
for($i=0;$i<$n;$i++)
{
if($modules[$i]==='.'||$modules[$i]==='..'||strpos($modules[$i],'.'))
{ unset($modules[$i]); }
}
$modules = array_values($modules);
$m = count($modules);
for($i=0;$i<$m;$i++)
{
$mod = $modules[$i];
$this->_config[$mod] = array();// **Error thrown here.**
$cfgfiles = scandir(MOD.DS.$mod.DS.'config');
$num = count($cfgfiles);
for($i=0;$i<$num;$i++)
{
if($cfgfiles[$i]==='.'||$cfgfiles[$i]==='..')
{ unset($cfgfiles[$i]); }
}
$cfgfiles = array_values($cfgfiles);
$k = count($cfgfiles);
for($j=0;$j<$k;$j++)
{
include(MOD.DS.$mod.DS.'config'.DS.$cfgfiles[$j]);
$modcfg = substr($cfgfiles[$j], 0, -4);
$this->_config[$mod][$modcfg] = array();
$this->_config[$mod][$modcfg] = $cfg;
}
}
return $this->_config;
}
}
More information outlining my problem can be found here:
http://stackoverflow.com/questions/11653956/using-this-when-not-in-object-context-but-supposedly-i-am
I put a link rather than going into too much detail to avoid causing grief to those who are reluctant to read more than a couple of lines.
| 0 | [
2,
113,
589,
31,
2281,
51,
3095,
4141,
60,
800,
3726,
3726,
53,
91,
1131,
35,
48,
9,
31,
22,
195,
614,
41,
51,
1158,
1301,
125,
4097,
9,
31,
589,
12797,
21,
718,
120,
21,
718,
30,
25,
243,
6322,
49,
1669,
1197,
21,
12038,
21... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Setting a Storyboard Tab Controller, More Tab's Navigation Bar Colour
===
So throughout my application I implement `Navigation Bars` with the style Black Opaque.
**The Problem**
I can't seem to set the colour of the `Navigation Bar` that presents itself when the user selects the automatically generated `More Tab`
**The Question**
How do I set the colour of this Navigation Bar to Black Opaque?
Thanks in advance. | 0 | [
2,
2697,
21,
609,
2806,
6523,
9919,
15,
91,
6523,
22,
18,
8368,
748,
4609,
800,
3726,
3726,
86,
892,
51,
3010,
31,
8713,
13,
1,
325,
13227,
857,
6062,
1,
29,
14,
1034,
319,
29068,
9,
13,
1409,
124,
1448,
1409,
31,
92,
22,
38,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Power Nap downloading data for my Mac App while sleep
===
I would like to use Power Nap as developer to download data for my app. The automatically waking up feature is a nice thing.
Could this be possible with a Mac App?
I know, what apple allows, it is written everywhere.
But can I, say, update data in my app (that is not Documents in the Cloud, Mail, Reminders, bla bla bla), maybe big data, like new maps for a application, that needs always the newest maps of a country. And in the night, or at the weekend, while you don't use your mac (as normal user ;-) ), the mac wakes up and checks for updates and downloads them. BOOM!
Do you get the point? | 0 | [
2,
414,
12348,
7121,
68,
1054,
26,
51,
1572,
4865,
133,
1742,
800,
3726,
3726,
31,
83,
101,
20,
275,
414,
12348,
28,
10058,
20,
7121,
1054,
26,
51,
4865,
9,
14,
7499,
14333,
71,
1580,
25,
21,
2210,
584,
9,
110,
48,
44,
938,
29... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Incorrect memory leak in purify?
===
I ran purify on my code which runs in Solaris and it shows lot of memory leaks.
But I checked the code and most of the leaks seem to be invalid.
For eg,
**File1.cpp**
Obj* getMyObj()
{
Obj* obj = NULL;
if(condition)
{
obj = new Obj(); //Purify is reporting leak here
//Fill obj
}
...
return obj;
}
**File2.cpp**
void myfunc()
{
Obj* myobj = getMyObj();
if(myobj)
return;
...
...
delete myobj; //The object is deleted here
}
Even though the object is destroyed properly in `File2.cpp`, why is purify reporting leak in `File1.cpp`? | 0 | [
2,
18867,
1912,
11724,
19,
6771,
8612,
60,
800,
3726,
3726,
31,
717,
6771,
8612,
27,
51,
1797,
56,
1461,
19,
4535,
403,
17,
32,
1285,
865,
16,
1912,
11724,
18,
9,
47,
31,
6505,
14,
1797,
17,
127,
16,
14,
11724,
18,
2260,
20,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
XML to XML with XSLT (Remove, add, alter)
===
I have to convert from one XML (XHTML) file to another using XSLT. The rules of transformation are also mentioned in the comments of input file.
1. `<div id="ta12" class="bl" style="dis:bl">` has to be replaced with `<div class="pass" value="50">`
2. The values of id="t0b" and "t1b" have to be replaced with id="ta0b8" and "ta3b8" respectively.
3. `<input type="radio" name="o0" id="t0"/>` has to be replaced with `<input type="radio" name="key0b8" value="0" id="ta0q" class="block" />` (And likewise in the file)
**Input file:**
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="iDev">
<!--THIS HAS TO BE REPLACED WITH <div class="pass" value="50">-->
<div id="ta12" class="bl" style="dis:bl"></div>
<div class="q">
<!--THE VALUE OF ID HAS TO BE CHANGED WITH id="ta0b8"-->
<div id="t0b" class="block">1<span style="color">TEXT1</span>
</div><br />
<!--HERE VALUES OF ID AND NAME HAVE TO BE CHANGED+A NEW ATTRIBUTE VALUE HAS TO BE INCLUDED-->
T <input type="radio" name="o0" id="t0"/>
F <input type="radio" name="op0" id="f0"/>
<div id="sfb">
<div id="ta0"></div>
</div>
</div><br />
<div class="q">
<!--THE VALUE OF ID HAS TO BE CHANGED WITH id="ta3b8"-->
<div id="t1b" class="block">2<span style="color">TEXT2</span>
</div><br />
<!--HERE VALUES OF ID AND NAME HAVE TO BE CHANGED+A NEW ATTRIBUTE VALUE HAS TO BE INCLUDED-->
T <input type="radio" name="o1" id="t1" />
F <input type="radio" name="op1" id="f1" />
<div id="sfb">
<div id="ta1"></div>
</div>
</div>
</div>
</body>
</html>
**Output File:**
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<div class="iDev">
<div class="q">
<div id="ta0b8" class="block">1<span style="color">TEXT1</span>
</div><br />
T<input type="radio" name="key0b8" value="0" id="ta0q" class="block" />
F<input type="radio" name="key0b8" value="1" id="ta1q" class="block" />
<div id="sfb">
<div id="ta0"></div>
</div>
</div><br />
<div class="q">
<div id="ta3b8" class="block">2 <span style="color">TEXT2</span>
</div><br />
T<input type="radio" name="key3b8" value="0" id="ta0q3" class="block" />
F<input type="radio" name="key3b8" value="1" id="ta1q3" class="block" />
<div id="sfb">
<div id="ta1"></div>
</div>
</div>
</div>
</body>
</html>
In my XSLT I have created an identity template which includes the entire input file and then I'm trying to do the required modifications. I'm able to do the first task by-
<xsl:template match="xhtml:div[@id='ta12']">
<xsl:attribute name="class">pa</xsl:attribute>
<xsl:attribute name="value">10</xsl:attribute>
</xsl:template>
In the output it produces the required Div tag but it removes the `<div class="iDev">` tag. Can anyone please tell me the solution for producing the desired output from the given input. Thanking you! | 0 | [
2,
23504,
20,
23504,
29,
993,
18,
255,
38,
13,
5,
99,
16598,
15,
3547,
15,
7835,
6,
800,
3726,
3726,
31,
57,
20,
8406,
37,
53,
23504,
13,
5,
396,
15895,
6,
3893,
20,
226,
568,
993,
18,
255,
38,
9,
14,
1761,
16,
6978,
50,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Sort list for negatives are in the middle
===
I have a list of objects
public class foo
{
public decimal val1 {get;set;}
public decimal val2 {get;set;}
}
I `val1` and `val2` can contain both negative or positive values.
if I have a `List<foo>items` is there a clean way I can sort them so that a negative value in either val1 or val2 are not the first or last item in the list.
My list size can very from 1 - 100. if it is less then 3 I do not need to sort. But if it is `>= 3` I need to make sure any negative values are not first or last in the list. | 0 | [
2,
2058,
968,
26,
3682,
18,
50,
19,
14,
772,
800,
3726,
3726,
31,
57,
21,
968,
16,
3916,
317,
718,
4310,
111,
13,
1,
317,
26380,
3347,
165,
13,
1,
3060,
73,
3554,
73,
1,
317,
26380,
3347,
135,
13,
1,
3060,
73,
3554,
73,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to create a foaming or gases effect in flash?
===
I am trying to create an animation for lemon juice and baking soda experiment, and I was wondering how can I create a foaming effect such as the one shown in this image: http://www.sciencebob.com/blog/wp-content/uploads/2010/02/experiment.jpg (Sorry, can't post the picture yet)
The idea I have in mind is to simply draw a foam in photoshop and then use motion tween to change the size. I was hoping I could find a better solution to this.
Thank you for reading/helping out. | 0 | [
2,
184,
20,
1600,
21,
18483,
68,
54,
18851,
1590,
19,
4433,
60,
800,
3726,
3726,
31,
589,
749,
20,
1600,
40,
6236,
26,
12975,
10384,
17,
24812,
16207,
5737,
15,
17,
31,
23,
5712,
184,
92,
31,
1600,
21,
18483,
68,
1590,
145,
28,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
3taps iOS SDK create Posting
===
I am using [3taps ios SDK][1] to post to [http://craigslist.org/][2]
There is a method:
- (void) create:(Posting*)posting;
I am receiving responce from 3taps after this call, that it is successfully finished, postkey = DEJP9HA, errorCode = (null), errorMessage = (null). But i can not see my posting on craigslists.org
Has anyone worked with 3taps iOS SDK and successfully posted to craigslists?
[1]: http://3taps.com/
[2]: http://craigslist.org/ | 0 | [
2,
203,
536,
1919,
13,
7760,
13,
18,
43,
197,
1600,
15669,
800,
3726,
3726,
31,
589,
568,
636,
240,
536,
1919,
13,
7760,
13,
18,
43,
197,
500,
2558,
165,
500,
20,
678,
20,
636,
21127,
6903,
7519,
2816,
18,
5739,
9,
5583,
118,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Imagettftext - incorrect line spacing
===
I have an problem with PHP function imagettftext. I have code for generating card images from database with text informations. And with some cards I have problem - words are written over each other ([like here][1]).
My code looks like this (font size changes depending on the length of the text)
$length = strlen($cardInfo->description);
if ($length < 15) {
$divide = 15;
$fontSize = 16;
$lineHeight = 25;
$startPos = 220;
} else if ($length < 70) {
$divide = 25;
$fontSize = 12;
$lineHeight = 18;
$startPos = 210;
} else if ($length < 110) {
$divide = 28;
$fontSize = 10;
$lineHeight = 14;
$startPos = 210;
} else {
$divide = 38;
$fontSize = 8;
$lineHeight = 13;
$startPos = 210;
}
$description = wordwrap($cardInfo->description, $divide, ">>>");
$lines = explode(">>>", $description);
$count = 0;
foreach ($lines as $line) {
$position = $count * $lineHeight;
$count++;
imagettftext($image, $fontSize, 0, 28, ($startPos + $position), $black, $font, $line);
}
and the text in the database look like this:
Oblehací stroj
Imunita vůči střelám /Tato jednotka je imunní vůči střeleckým zraněním/
Other problem is with the line wrapping: [here][2]. I don't know why the word "jídlo" is on the next line.
Thank you for any answers!
[1]: http://dark-project.cz/CardManager/cards/lehky_katapult.png
[2]: http://dark-project.cz/CardManager/cards/sberac_korink_.png | 0 | [
2,
1961,
38,
11720,
11969,
13,
8,
18867,
293,
29177,
800,
3726,
3726,
31,
57,
40,
1448,
29,
13,
26120,
1990,
1961,
38,
11720,
11969,
9,
31,
57,
1797,
26,
13500,
2056,
3502,
37,
6018,
29,
1854,
676,
18,
9,
17,
29,
109,
4092,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
BundleActivator methods not getting notiifed in osgi
===
I have created a bundle with activator . While starting my bundle activator methods should be notified but it is not getting called. I have implemented it in the same way as mentioned in the tutorial . Please help.
package com.manning.sdmia;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator{
private BundleContext context;
public void start(BundleContext context) throws Exception {
System.out.println("In bundle");
}
public void stop(BundleContext context) throws Exception {
System.out.println("In stop");
}
}
And here is my MANIFEST.MF file
enter code here
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Spring DM Hello World
Bundle-SymbolicName: com.manning.sdmia.helloworld
Bundle-Version:1.0.0
Bundle-Activator: com.manning.sdmia.Activator
Export-Package:com.manning.sdmia
Import-Package: org.osgi.framework
Now when i am starting the bundle from osgi prompt with start command the system.out.println should get printed on command but it not printing. Please Help.
Thanks.
| 0 | [
2,
10194,
19516,
3457,
3195,
52,
1017,
52,
49,
821,
69,
19,
13,
759,
2234,
800,
3726,
3726,
31,
57,
679,
21,
10194,
29,
13,
19516,
3457,
13,
9,
133,
1422,
51,
10194,
13,
19516,
3457,
3195,
378,
44,
22904,
47,
32,
25,
52,
1017,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Error in Release mode but not in debug mode
===
I am getting following error only in release mode -
"**Collection was modified; enumeration operation may not execute**".
Here is code snippet -
foreach (AttachObject attachObject in _documentAttach.AttachObjects)
{
if (attachObject !=null)
{
if (!attachObject.Instance.CheckAccess(docId))
{
throw new COMException(string.Format("User does not have sufficient access to delete documents."));
}
}
}
Here AttachObjects is collection of AttachObject, which derives from CollectionBase.
This issue is replicable only in release mode. If I start debugging in release mode (I forefully generated PDB file in release mode by changing project settings) then also it is NOT reproducible.
I know it is difficult to pin point the reason by seeing this code but if i can get some clue on how to further debug then it will be helpful.
I verified that the list Attachobjects is not being modified. To check this I override OnInsert and OnRemove methods of CollectionBase.
Let me know if anyone knows other debuggin techniques like how to track state of object and raise an even if it is modified etc.
Thanks, | 0 | [
2,
7019,
19,
830,
3740,
47,
52,
19,
121,
16254,
3740,
800,
3726,
3726,
31,
589,
1017,
249,
7019,
104,
19,
830,
3740,
13,
8,
13,
7,
1409,
15015,
872,
23,
5372,
73,
26940,
872,
1453,
123,
52,
15644,
1409,
7,
9,
235,
25,
1797,
13... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Android NgN Stack Doubango caller id issue
===
Iam using doubango ngn stack for a sip application on android iam having issue in receiving the caller's number as i got my own number displayed instead of the caller's number at both the below statements
sipMessage.getSipHeaderValue("f")
sipMessage.getSipHeaderValue("From")
Please help me how to resolve it? as i could not go inside the implementation of getSipHeaderValue(String) method as it's coming from tinyWRAPJNI.java where i only have this call
public final static native String SipMessage_getSipHeaderValue__SWIG_1(long jarg1, SipMessage jarg1_, String jarg2);
Please suggest any idea??Thanks! & waiting Hope SomeOne could Answer | 0 | [
2,
13005,
13,
2723,
103,
7566,
107,
4502,
14541,
21326,
4924,
1513,
800,
3726,
3726,
31,
765,
568,
107,
4502,
14541,
13,
2723,
103,
7566,
26,
21,
8616,
3010,
27,
13005,
31,
765,
452,
1513,
19,
3396,
14,
21326,
22,
18,
234,
28,
31,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
calling a different action in the same controller
===
I'm developing a small app. using php and Zend Framework. I have a form, and I use it's controller to view the form. Now I need to manipulate the form data and redirect the user accordingly.
here is my controller
<?php
class NewuserController extends Zend_Controller_Action {
public function init()
{
/* Initialize action controller here */
}
public function newuserAction()
{
$this->view->newuser;
}
public function adduserAction(){
$data = $this->getRequest()->getParams();
$u = new User();
$u->setUserName($data['uName']);
$u->setPrepwd($data['pwd']);
$u->setPrepwd($data['pwd']);
if($u->isEqual()){
$val = $u->addUsers();
if($val)
$this->_helper->redirector('main','main');
}
else
$this->_helper->redirector('newuser','newuser');
}
}
?>
my view is `newuser.phtml`. In the `action` attributr of the `<form>` I have specified `Newuser/adduser` . But when I submit the form it again displays the `newuser.phtml`.
Why is this?
Thanks in advance
Charu | 0 | [
2,
2555,
21,
421,
1028,
19,
14,
205,
9919,
800,
3726,
3726,
31,
22,
79,
3561,
21,
284,
4865,
9,
568,
13,
26120,
17,
10526,
43,
6596,
9,
31,
57,
21,
505,
15,
17,
31,
275,
32,
22,
18,
9919,
20,
1418,
14,
505,
9,
130,
31,
376... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
having inners JPanel
===
is it possible to have inners JPanel?and if it so, is it convenient?
I have a JPanel
public class MyPanel extends JPanel
{
}
inside MyPanel I can put another jpanel? | 0 | [
2,
452,
3754,
18,
487,
3206,
532,
800,
3726,
3726,
25,
32,
938,
20,
57,
3754,
18,
487,
3206,
532,
60,
290,
100,
32,
86,
15,
25,
32,
12845,
60,
31,
57,
21,
487,
3206,
532,
317,
718,
51,
3206,
532,
9073,
487,
3206,
532,
13,
1,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... |
How to communicate Web and Worker dynos with Node.js on Heroku?
===
**Web Dynos** can handle HTTP Requests
and while **Web Dynos** handles them **Worker Dynos** can handle jobs from it.
But I don't know how to make **Web Dynos** and **Worker Dynos** to communicate each other.
For example, I want to receive a HTTP request by **Web Dynos**
, send it to **Worker Dynos**
, process the job and send back result to **Web Dynos**
, show results on Web.
Is this possible in Node.js? (With RabbitMQ or Kue or etc)?
I could not find an example in [Heroku Documentation][1]
Or Should I implement all codes in **Web Dynos** and scaling **Web Dynos** only?
[1]: https://devcenter.heroku.com/articles/background-jobs-queueing | 0 | [
2,
184,
20,
8709,
2741,
17,
7444,
9841,
251,
18,
29,
15421,
9,
728,
18,
27,
36,
9266,
60,
800,
3726,
3726,
13,
1409,
14113,
9841,
251,
18,
1409,
92,
3053,
7775,
12279,
17,
133,
13,
1409,
14113,
9841,
251,
18,
1409,
3053,
18,
105... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
jquery $(document).on
===
Is it only allowed to bind 1 event to 1 thing? What I mean is, that I have 2 js files i want to initialize on the same page load.
So I have tried the following:
js1:
$(document).on("pageinit", "#mapmode", function(event) {
alert('test');
initMapModeContent();
});
function initMapModeContent(){
var oldHTML = document.getElementById('mapmodeContent').innerHTML;
var newHTML = oldHTML + '<div><a href="pages/Beskeder.jsp#beskeder" id="mapLink" name="mapLink"><img id="mapLinkImage" alt="a map which links to the beskeder" src="images/beskeder.png"/></a></div>';
document.getElementById("firstPageContent").innerHTML=newHTML;
}
js2:
$(document).on("pageinit", "#mapmode", function(event) {
initPageHeader();
});
$(document).on("pageinit", "#mapmode", function(event) {
initPageHeader();
});
$(document).on("pageinit", "#beskeder", function(event) {
initPageHeader();
});
function initPageHeader(){
var id=document.getElementById('header').parentNode.id;
//TODO getdata with the id(page we are currently on).
$("#header").html(function(index, originalMarkup) {
return '<a data-theme="a" data-wrapperels="span" data-iconshadow="true" data-shadow="true" '+
'data-corners="true" class="ui-btn-left ui-btn ui-btn-up-a ui-shadow ui-btn-corner-all" href="#" '+
'data-rel="back" data-role="button"><span class="ui-btn-inner ui-btn-corner-all"><span class="ui-btn-text">'+
'<img src="../images/back.png" alt="back" align="middle" vspace="2"></span></span></a>'+
'<h1 aria-level="1" role="heading" class="ui-title">'+
'<img src="../images/main_header.png" alt="logo" align="middle" vspace="2">'+
'</h1><a data-theme="a" data-wrapperels="span" data-iconshadow="true" data-shadow="true"'+
'data-corners="true" class="ui-btn-right ui-btn ui-btn-up-a ui-btn-inline ui-shadow ui-btn-corner-all" '+
'href="#first" data-role="button" data-inline="true"><span class="ui-btn-inner ui-btn-corner-all">'+
'<span class="ui-btn-text">'+
'<img src="../images/home.png" alt="picture to take you to the first page" align="middle">'+
'</span></span></a>';
});
}
html5:
<%--
Document : mapMode
Created on : Jul 12, 2012, 10:36:22 AM
Author : ame
--%>
<!DOCTYPE html>
<html>
<head>
<title>Map</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="js/jquery.mobile-1.1.0.css" />
</head>
<body>
<!-- Start of first page -->
<div data-role="page" id="mapmode" name="mapmode">
<div data-role="header" id="header" name="header">
<p>TEEEST</p>
</div><!-- /header -->
<div data-role="content" id="mapmodePageContent" name="mapmodePageContent">
<p>I'm the first page in mapMode!.</p>
</div><!-- /content -->
</div><!-- /page -->
<script type="text/javascript" src="../js/jquery-1.7.2.js"></script>
<script type="text/javascript" src="../js/jquery.mobile-1.1.0.js"></script>
<script type="text/javascript" src="../js/Mapmode.js"></script>
<script type="text/javascript" src="../js/PageHeader.js"></script>
</body>
</html>
I just can't find in dokumentation that it shouldn't work? any suggestions for how it can be made, if it is not legal, or anyone that can spot my error. Thanks in advance <3 | 0 | [
2,
487,
8190,
93,
5579,
5,
28132,
6,
9,
218,
800,
3726,
3726,
25,
32,
104,
1159,
20,
10193,
137,
807,
20,
137,
584,
60,
98,
31,
884,
25,
15,
30,
31,
57,
172,
487,
18,
6488,
31,
259,
20,
2104,
2952,
27,
14,
205,
2478,
6305,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
launching spring batch job from another batch job - How
===
need help,
This is required to launch respective job from my main job based on conditions.
This is like to branching to one job to another. I am using a Tasklet where I am building a Job and JobParameters object. Just need to get a asynchronous JabLuncher object within the the Tasklet object to run the new Job.
====================================================================
It is mentioned in SpringSource below in another way. But, not sure how to use the same ...
http://static.springsource.org/spring-batch/reference/html/configureStep.html#conditionalFlow
The third form of an externalized flow is to use a JobStep. A JobStep is similar to a FlowStep, but actually creates and launches a separate job execution for the steps in the flow specified. Here is an example:
The job parameters extractor is a strategy that determines how a the ExecutionContext for the Step is converted into JobParameters for the Job that is executed. The JobStep is useful when you want to have some more granular options for monitoring and reporting on jobs and steps. Using JobStep is also often a good answer to the question: "How do I create dependencies between jobs?". It is a good way to break up a large system into smaller modules and control the flow of jobs.
==================================================================================
Regards,
Saikat | 0 | [
2,
13762,
1573,
13064,
1205,
37,
226,
13064,
1205,
13,
8,
184,
800,
3726,
3726,
376,
448,
15,
48,
25,
1390,
20,
3394,
7390,
1205,
37,
51,
407,
1205,
432,
27,
2039,
9,
48,
25,
101,
20,
1686,
68,
20,
53,
1205,
20,
226,
9,
31,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
h:commandButton action not executing and/or f:setPropertyActionListener not setting property
===
First, I am new to java, jsf, richfaces and this site etc, so pls bear with me. :)
I am using JSF 2.0 and richfaces on Glassfish server ver3.1.
Apologies for the long winded question. I guess, especially since it's my first on on this site. :)
I have a .xhtml page with a bunch of controls on it the users can use to search for database items (in this case phone numbers). After they click 'search' the items are displayed in a data table below. Each row in the table has a check box the users can use to select items they want to perform actions on.
Once they select the items, they can click a button to perform an action on the selected rows.
In this case, when the 'Reserve Numbers' button is clicked, a pop up is shown which requests the user to search the database for a customer to reserve the phone number for. In the pop a data table is shown based on the search criteria which lists the customers. On each row there is a button (I previously used h:commandLink but am now using h:commandButton, I have also tried a4j:commandButton etc.) which when clicked must perform a series of actions; first set two properties (one is a simple string which describes the action being performed, and the other is the selected object in the data table) and then call a method on the backing bean. Finally it shows another pop up which displays a message based on the selected data and action and requests confirmation from the user to proceed.
Everything works fine until the h:commandButton is clicked which must execute the series of actions "first set two properties (one is a simple string which describes the action being performed, and the other is the selected object in the data table) and then call a method on the backing bean. Finally it shows another pop up". It is displaying the pop up but it is not assigning the properties or calling the managed bean method.
Here are snippets of my code. I haven't put everything here b'cos there is alot.
<ui:define name="content">
<rich:panel>
<h:form id="portForm">
<rich:panel header="Database Search">
<h:panelGrid columns="4">
<h:outputLabel for="srchNumberType" value="Number Type" />
<rich:select id="srchNumberType" value="#{managementController.srchType}" enableManualInput="false"
defaultLabel="select a number type" required="false" disabled="#{login.isAuthenticated == false}">
<f:selectItems value="#{applicationContext.typesOptions}" />
</rich:select>
<!-- more search controls -->
</h:panelGrid>
</rich:panel>
<rich:panel header="Search Results">
<rich:toolbar height="26" >
<rich:toolbarGroup>
<h:commandButton value="Reserve" disabled="#{login.mayReserve == false}">
<rich:componentControl target="selectCustomer" operation="show" />
</h:commandButton>
<!-- more toolbar buttons -->
</rich:toolbarGroup>
</rich:toolbar>
<rich:panel id="list" >
<rich:dataTable id="expandedNumbers" value="#{managementController.numbers}" var="numb" rows="10">
<rich:column>
<f:facet name="header">
<h:outputText value="Select" />
</f:facet>
<h:selectBooleanCheckbox value="#{numb.selected}" immediate="true">
<f:ajax event="click" execute="@form" ></f:ajax>
</h:selectBooleanCheckbox>
<!-- more columns -->
</rich:column>
</rich:dataTable>
<rich:dataScroller for="expandedNumbers" maxPages="5" />
</rich:panel>
</rich:panel>
</h:form>
</rich:panel>
<rich:popupPanel header="Select Customer" id="selectCustomer" autosized="true" domElementAttachment="parent" >
<h:form id="selCustPopForm">
<h:panelGrid columns="3" id="custSelectGrid">
<h:outputText value="CRM Customer Number" />
<h:inputText value="#{managementController.selCustomerNumber}" id="selCustNumber">
</h:inputText>
<h:panelGroup />
<h:outputText value="Customer Name" />
<h:inputText value="#{managementController.selCustomerName}" id="selCustName">
</h:inputText>
<h:panelGroup />
</h:panelGrid>
<a4j:commandButton value="Search" action="#{managementController.doSearchCustomers}" render="custList" execute="@form" />
<a4j:commandButton value="Cancel" onclick="#{rich:component('selectCustomer')}.hide(); return false;" />
<rich:dataTable id="custList" value="#{managementController.selectCustomers}" var="cust" rows="10">
<rich:column>
<f:facet name="header">
<h:outputText value="Select" />
</f:facet>
<h:commandButton value="Allocate to" action="#{managementController.doMenuAction}" >
<f:setPropertyActionListener target="#{managementController.menuAction}" value="Reserve" />
<f:setPropertyActionListener target="#{managementController.selectedCustomer}" value="#{cust}" />
<rich:componentControl target="confirm" operation="show" />
</h:commandButton>
</rich:column>
<!-- more columns -->
</rich:dataTable>
<rich:dataScroller for="custList" maxPages="5" />
</h:form>
</rich:popupPanel>
<!-- more pop ups -->
<rich:popupPanel header="Confirm" id="confirm" domElementAttachment="parent" width="350" >
<h:form id="confirmForm" >
<p>
<h:outputLabel value="Alert" />
</p>
<p>
<h:outputLabel value="#{managementController.confirmAction}" /><br/>
<h:outputLabel value="Would you like to continue?" />
</p>
<h:commandButton value="Continue" actionListener="#{managementController.doExecuteAction}" type="submit" />
<a4j:commandButton value="Cancel" onclick="#{rich:component('confirm')}.hide(); return false;" />
</h:form>
</rich:popupPanel>
</ui:define>
and
@SessionScoped // was view scoped
@ManagedBean(name="managementController")
public class NumberManagementController implements Serializable {
//more properties here
private String menuAction; // + getters and setters
private int actionCount; // + getters and setters
private String confirmAction; // + getters and setters
//lots more properties here
public String doMenuAction() {
System.out.println("Doing menu action: " + menuAction);
//When the menu action set, we need to calculate the amount of numbers selected so we can confirm the action from the user (with a pop up).
for (ManagementNumber n : this.numbers) if(n.isSelected()) this.actionCount++;
if("Reserve".equals(menuAction)) this.confirmAction = "You are about to reserve " + this.actionCount + " numbers.";
// more actions here
return "";
}
public void doExecuteAction() {
System.out.println("Selected menu action is: " + menuAction);
if("Reserve".equals(menuAction)) doReserveNumbers();
// more actions here
}
public void doReserveNumbers() {
// perform reserve action on selected numbers
}
//More action methods etc.
}
Thanks and Regards,
To all who assist | 0 | [
2,
746,
45,
16239,
811,
444,
1028,
52,
25836,
17,
118,
248,
398,
45,
3554,
10890,
106,
1084,
8645,
13891,
106,
52,
2697,
1354,
800,
3726,
3726,
64,
15,
31,
589,
78,
20,
8247,
15,
487,
18,
410,
15,
2042,
6413,
18,
17,
48,
689,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Shared library loading and performance
===
I am writing a server side application in C/C++ which consists of 1 main daemon and several child processes.
I want the child processes to be extremely lightweight so that they can be spawned/killed without too much overhead (over and above that imposed by the OS).
I am building the main daemon and the children apps to make extensive use of shared libraries. In fact, the main daemon loads up all the shared libraries required by the child applications, and sets up the required (shared) memory structures etc.
My underlying assumption is that since the shared libraries (some of which are **huge**) are already loaded by the main daemon, the child applications will be able to launch quickly and simply attach to the loaded libraries - without having to load the shared libs, and thus resulting in a slightly fast time to be spawned - is this assumption correct?
**[[Added]]**
I am working on Ubuntu 10.0.4 LTS
| 0 | [
2,
2592,
1248,
12797,
17,
956,
800,
3726,
3726,
31,
589,
1174,
21,
8128,
270,
3010,
19,
272,
118,
150,
20512,
56,
2043,
16,
137,
407,
13127,
17,
238,
850,
5102,
9,
31,
259,
14,
850,
5102,
20,
44,
3898,
13613,
86,
30,
59,
92,
4... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Can you prevent a user logging in multiple times with Janrain, or similar social network logins?
===
I would like to enable logging in from multiple services on my site, but would not like users to login with, say, facebook and then logout and then back in with, say, Google+.
I am not sure if there is a practical way to detect that someone has done this?
I saw Janrain mentions account linking, is this provide this kind of service?
Security doesn't have to be watertight, but would like to make it hard to login multiple times and post from different accounts. At the same time, having multiple providers would be desirable to as not everyone uses Facebook.
Thanks for any help/info/suggestions. | 0 | [
2,
92,
42,
2501,
21,
4155,
13,
13919,
19,
1886,
436,
29,
2262,
8664,
15,
54,
835,
668,
982,
2205,
17040,
60,
800,
3726,
3726,
31,
83,
101,
20,
9240,
13,
13919,
19,
37,
1886,
687,
27,
51,
689,
15,
47,
83,
52,
101,
3878,
20,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
I cant stop my mediaplayer in android?
===
Am using mediaplayer to play tick sound in timer.But it continues to play after timer is over,Even after i called stop for media player. I played sound as seen below in ontick() in timer. In onfinish() called mp.Stop(),But it not working.
mp = MediaPlayer.create(getBaseContext(), sound);
mp.setOnCompletionListener(new OnCompletionListener() {
public void onCompletion(MediaPlayer mp) {
});
mp.setLooping(false);
// mp.setVolume(0.1, 0.1);
mp.start();
}
| 0 | [
2,
31,
2973,
747,
51,
941,
14049,
19,
13005,
60,
800,
3726,
3726,
589,
568,
941,
14049,
20,
418,
8809,
646,
19,
85,
139,
9,
811,
32,
2622,
20,
418,
75,
85,
139,
25,
84,
15,
4943,
75,
31,
227,
747,
26,
941,
517,
9,
31,
257,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Leaving traling / off messes up loading
===
If I leave the trailing / off of my URL, it messes up my jquery loading -- the page reloads itself in the comments section. For example:
http://www.songmeanings.net/songs/view/3530822107858857748
For what it should look like, put the trailing / at the end such as:
http://www.songmeanings.net/songs/view/3530822107858857748/
The root of the problem is how ajax is posting. My url has to be "./" -- if I make it "" the inline loading no longer happens, but the comments fail to load then in IE.
How can I fix? | 0 | [
2,
1107,
7957,
802,
13,
118,
168,
3957,
160,
71,
12797,
800,
3726,
3726,
100,
31,
767,
14,
14323,
13,
118,
168,
16,
51,
287,
6362,
15,
32,
3957,
160,
71,
51,
487,
8190,
93,
12797,
13,
8,
8,
14,
2478,
27339,
18,
1145,
19,
14,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Datapower Soap Envelope Header Values from Request
===
I am having a WS Proxy in Datapower . Both the client and the backends are HTTP . My request contains a soap header that has values like :
wsa:Action
wsa:MessageID
wsa:ReplyTo
timestamp
The backend doesnt require all these values , so they are stripped of before sending a cnverted request to the backend and obviously these are not there in the response which I get back from backend. Now when I send a response back to the client from Datapower , I need all these values back in the response soap headers . A
newly created timestamp which expires after 5 mins .
Action
MessageID
ReplyTo
Is there any way to put them back. I dont want to do it from xslt , as I beleive there is some inbuilt support from Datapower to handle this .
| 0 | [
2,
1054,
5484,
6447,
9127,
157,
106,
4070,
37,
3772,
800,
3726,
3726,
31,
589,
452,
21,
619,
18,
27188,
19,
1054,
5484,
13,
9,
156,
14,
6819,
17,
14,
97,
2451,
18,
50,
7775,
13,
9,
51,
3772,
1588,
21,
6447,
157,
106,
30,
63,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to install older Android SDK in Eclipse
===
I'm working at the moment at a simple app in eclipse for android. Just receiving and sending data, and using the camera API.
I've set the minSDKversion to 8, because I think that has the widest user base. But at the beginning of the project eclipse was asking me which target SDK version I would use, and because I had just one installed (the latest 4.0.3) I've took this.
Now I'm asking me if it wouldn't be wiser to install a lower SDK, like Android 2.2, because it would be not that big (compared to the 4.0.3) and my app would not have included all the fancy new features, which are not used in any way?! Or is this complete nonsense I'm talking here, and just should take my 4.0.3 SDK? When not, how can I install a lower version? `Help -> SDK Manager` is not showing old SDKs... | 0 | [
2,
184,
20,
16146,
1234,
13005,
13,
18,
43,
197,
19,
11652,
800,
3726,
3726,
31,
22,
79,
638,
35,
14,
688,
35,
21,
1935,
4865,
19,
11652,
26,
13005,
9,
114,
3396,
17,
4907,
1054,
15,
17,
568,
14,
3336,
21,
2159,
9,
31,
22,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why is video button grayed out in Windows Phone 7 camera chooser task?
===
I'm wondering why the video capture button is always grayed out (disabled) when using the both the `Camera Capture Task` and the `Photo Chooser Task` with `ShowCamera = true;`?
![enter image description here][1]
I've tried to find ways to enable it, but without any success.
I'm developing for Windows Phone 7.5.
Thank you in advance!
[1]: http://i.stack.imgur.com/fLG6P.jpg | 0 | [
2,
483,
25,
763,
5167,
2030,
69,
70,
19,
1936,
1132,
453,
3336,
3538,
139,
3005,
60,
800,
3726,
3726,
31,
22,
79,
5712,
483,
14,
763,
3683,
5167,
25,
550,
2030,
69,
70,
13,
5,
2906,
579,
43,
6,
76,
568,
14,
156,
14,
13,
1,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
LINQ to SQL - updating records
===
Using asp.net 4 though C#.
In my data access layer I have methods for saving and updating records. Saving is easy enough but the updating is tedious.
I previously used SubSonic which was great as it had active record and knew that if I loaded a record, changed a few entries and then saved it again, it recognised it as an update and didn't try to save a new entry in the DB.
I don't know how to do the same thing in LINQ. As a result my workflow is like this:
1. Web page grabs 'Record A' from the DB
2. Some values in it are changed by the user.
3. 'Record A' is passed back to the data access layer
4. I now need to load Record A again, calling it 'SavedRecord A', update all values in this object with the values from the passed 'Record A' and then update/ save 'SavedRecord A'!
If I just save 'Record A' I end up with a new entry in the DB.
Obviously it would be nicer to just pass Record A and do something like:
RecordA.Update();
I'm presuming there's something I'm missing here but I can't find a straightforward answer on-line.
| 0 | [
2,
6294,
1251,
20,
4444,
255,
13,
8,
71,
43,
1880,
742,
800,
3726,
3726,
568,
28,
306,
9,
2328,
268,
362,
272,
5910,
9,
19,
51,
1054,
1381,
5385,
31,
57,
3195,
26,
7599,
17,
71,
43,
1880,
742,
9,
7599,
25,
2010,
511,
47,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Cannot login into my prestashop admin
===
I am trying to login into my prestashop admin.
1) When use forgot password link it says =>employee does not exist
2)I try to change in phpmyadmin ps_employee table after changing when i try to login it again gives error => 1.employee does not exist, or bad password
Anyone please help me its urgent for me to resolve.
Thanks
| 0 | [
2,
1967,
6738,
108,
77,
51,
26481,
472,
5347,
21,
43,
2160,
800,
3726,
3726,
31,
589,
749,
20,
6738,
108,
77,
51,
26481,
472,
5347,
21,
43,
2160,
9,
137,
6,
76,
275,
9564,
20884,
3508,
32,
898,
800,
1,
1503,
13221,
3616,
62,
6... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
MATLAB - How to generate ANFIS output in MATLAB?
===
I am using ANFIS for my work and learned use ANFIS using MATLAB. However, I am getting my final FIS output in chart. I am not able to get output in array form. Would you please help me on how to get the final output in array form?
Thanks!
Sarath | 0 | [
2,
4277,
9086,
13,
8,
184,
20,
7920,
40,
1707,
18,
5196,
19,
4277,
9086,
60,
800,
3726,
3726,
31,
589,
568,
40,
1707,
18,
26,
51,
170,
17,
2691,
275,
40,
1707,
18,
568,
4277,
9086,
9,
207,
15,
31,
589,
1017,
51,
426,
6028,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
sending javascript array to external php file using POST
===
I am trying to send a javascript array to an external php page, but the only thing the php page is picking up is the fact that I am sending array, not the actual data within the array.
javascript -
var newArray = [1, 2, 3, 4, 5];
$.ajax({
type: 'POST',
url: 'array.php',
data: {'something': newArray},
success: function(){
alert("sent");
}
});
External PHP Page -
<?php
echo($_POST['something']));
?>
I know this question has been asked before, but for some reason, this isn't working for me. I have spent the last couple days trying to figure this out as well. Can someone please point me in the right direction.
current output (from php page) -
Array (thats all the page outputs)
| 0 | [
2,
4907,
8247,
8741,
7718,
20,
4886,
13,
26120,
3893,
568,
678,
800,
3726,
3726,
31,
589,
749,
20,
2660,
21,
8247,
8741,
7718,
20,
40,
4886,
13,
26120,
2478,
15,
47,
14,
104,
584,
14,
13,
26120,
2478,
25,
7833,
71,
25,
14,
837,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Two UILabels rendered differently in retina and non retina iPhone displays
===
I have designed an interface in a NIB which has two UILabels. The labels are in close proximity to highlight one particular word in a different colour.
The issue is that on a non retina display the two labels render as desired. See Image 1:
![enter image description here][1]
However on a retina display the label for the white text overlaps some of the blue text. See Image 2:
![enter image description here][2]
Note that the frame of the white text label doesn't seem to have moved rather the issue seems to be the word wrap on the blue text label.
Has anyone seen this before and figured out a quick/ painless cure?
[1]: http://i.stack.imgur.com/8cFWl.png
[2]: http://i.stack.imgur.com/zHU0f.png | 0 | [
2,
81,
13,
5661,
21018,
18,
10877,
12670,
19,
24325,
17,
538,
24325,
21024,
9412,
800,
3726,
3726,
31,
57,
1006,
40,
6573,
19,
21,
1781,
220,
56,
63,
81,
13,
5661,
21018,
18,
9,
14,
13173,
50,
19,
543,
10493,
20,
14373,
53,
1498... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
What are the must have tools for Flex developers?
===
I have started flex coding from last 2 months and the only tool I use is Flash Builder.<br/> What are the other tools/plugins which can help with flex development. | 0 | [
2,
98,
50,
14,
491,
57,
4672,
26,
14409,
10168,
60,
800,
3726,
3726,
31,
57,
373,
14409,
13,
15458,
37,
236,
172,
818,
17,
14,
104,
5607,
31,
275,
25,
4433,
14960,
9,
1,
5145,
118,
1,
98,
50,
14,
89,
4672,
118,
18527,
17040,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
Converting sqlite database to postgres yields DatabaseError: value too long for type character varying(50)
===
I'm uploading the database for my Django app to Heroku using using `db:push` which converts my database from sqlite to postgres.
However, during the process I get the error:
`Taps Server Error: PGError: ERROR: integer out of range`
When I try to create a clean database on Heroku's server using `python manage.py syncdb`, I get a similar message:
Installing index for django_openid.UserOpenidAssociation model
Installing json fixture 'initial_data' from '/app/.heroku/venv/lib/python2.7/site- packages/oembed/fixtures'.
Installing json fixture 'initial_data' from '/app/.heroku/venv/lib/python2.7/site- packages/pinax/apps/photos/fixtures'.
Installing json fixture 'initial_data' from '/app/store/fixtures'.
Problem installing fixture '/app/store/fixtures/initial_data.json': Traceback (most recent call last):
File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/management/commands/loaddata.py", line 169, in handle
obj.save(using=using)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/core/serializers/base.py", line 165, in save
models.Model.save_base(self.object, using=using, raw=True)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/models/base.py", line 501, in save_base
rows = manager.using(using).filter(pk=pk_val)._update(values)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/models/query.py", line 491, in _update
return query.get_compiler(self.db).execute_sql(None)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 861, in execute_sql
cursor = super(SQLUpdateCompiler, self).execute_sql(result_type)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/models/sql/compiler.py", line 727, in execute_sql
cursor.execute(sql, params)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/util.py", line 15, in execute
return self.cursor.execute(sql, params)
File "/app/.heroku/venv/lib/python2.7/site-packages/django/db/backends/postgresql_psycopg2/base.py", line 44, in execute
return self.cursor.execute(query, args)
DatabaseError: value too long for type character varying(50)
It looks to me that the problem lies in the initial data, but not entirely sure. I found a post here that said it could be a problem with encoding of a field but even if I were to look into that not exactly sure how to read the error message to find out what exactly is causing the problem and also to pinpoint which table/column might be causing the problem.
| 0 | [
2,
19583,
4444,
10601,
6018,
20,
678,
6879,
18,
18733,
6018,
29992,
45,
1923,
266,
175,
26,
1001,
925,
9852,
5,
2290,
6,
800,
3726,
3726,
31,
22,
79,
71,
16866,
14,
6018,
26,
51,
3857,
14541,
4865,
20,
36,
9266,
568,
568,
13,
1,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
wcf streamed a file, how to know if the file finish? how long does it take to transfer 5MB?
===
I have have a service has two contract, one of the to transfer files from the client to the service, to store this files in the database.
I have done probes and I get some doubts.
How long doe it take to transfer the file? I have the service in one virtual machine and the client in the principal operative system. I ask this because at a first time I have set my binding to 1 minute the timeouts, but this is not enough time to transfer the entire file. So I set 10 minutes and now I have time to transfer all the file, the problem is that transfer more the the size of the file.
So, how is it possible that the transfer takes this time? About 3 minutes to transfer the 5MB. And why I continue to receive data once it has transferred all?
So I would like to know two things:
- How can I improve the speed of the transfer? 3 minutes for 5MB I think is a lot of time.
- How can I know when I receive the all data I stop the transfer?
I am using two files as log to know that I still receive data beyond the size of the original file. One file is a text file and other a binary file.
This code is in the service side, it is the way that I am trying to create the file from the stream that I receive from the client:
System.IO.StreamWriter file = new System.IO.StreamWriter("c:\\log.txt");
FileStream fs = File.Create("C:\\binary.dat", 2048, FileOptions.None);
BinaryWriter bw = new BinaryWriter(fs);
dato = paramFichero.Fichero.ReadByte();
file.WriteLine(dato.ToString());
bw.Write(dato);
while (dato != -1)
{
datoBinario = Convert.ToByte(dato);
miFicheroAux.Add(datoBinario);
dato = paramFichero.Fichero.ReadByte();
file.WriteLine(dato.ToString());
bw.Write(dato);
}
This is my binding configuration. This is the app.config of the service, but is the same configuration than the client.
<binding name="ServiceDocumentos" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647"
transferMode="Streamed" closeTimeout="00:10:00"
openTimeout="00:10:00" receiveTimeout="00:20:00"
sendTimeout="00:10:00" maxConnections="100">
<security mode="None"/>
<readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxStringContentLength="2147483647"/>
</binding>
Thanks. | 0 | [
2,
11801,
410,
21822,
21,
3893,
15,
184,
20,
143,
100,
14,
3893,
2106,
60,
184,
175,
630,
32,
247,
20,
2617,
331,
5024,
60,
800,
3726,
3726,
31,
57,
57,
21,
365,
63,
81,
1305,
15,
53,
16,
14,
20,
2617,
6488,
37,
14,
6819,
20... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
ASIHttprequest Muliple request with one progressview
===
After the purchase is completed ,i want to donwload image, audio and video from server.
Currently i am able to download the image and can see the progress in uiprogressview but i am not sure how can we show the single progress view for multiple url requests.
I would like to know whether we can show one uiporgressview for multiple url request using asihttprequest.
please let me know how to proceed? and thanks a lot
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
self.request=nil;
}
return self;
}
- (void)fetchThreeImages1:(id)sender
{
[imageView1 setImage:nil];
if (!networkQueue) {
networkQueue = [[ASINetworkQueue alloc] init];
}
failed = NO;
[networkQueue reset];
[networkQueue setRequestDidFinishSelector:@selector(requestForDownloadOfFileFinished:)];
[networkQueue setRequestDidFailSelector:@selector(requestForDownloadOfFileFailed:)];
[networkQueue setShowAccurateProgress:YES];
[networkQueue setDelegate:self];
self.request=nil;
NSURL *url;
NSString *urlString=@"http://www.digitalreview.ca/cams/pics/DSCN0044.JPG";
url = [NSURL URLWithString:urlString];
request = [ASIHTTPRequest requestWithURL:url];
NSString *Filename = [urlString lastPathComponent];
[request setDownloadProgressDelegate:imageProgressIndicator1];
[request setUserInfo:[NSDictionary dictionaryWithObject:@"request1" forKey:@"name"]];
[request setDownloadDestinationPath:[[NSHomeDirectory() stringByAppendingPathComponent:@"Documents"] stringByAppendingPathComponent:Filename]];
[request setShouldContinueWhenAppEntersBackground:YES];
[request setDelegate:self];
[request setDidReceiveDataSelector:@selector(request:didReceiveBytes:)];
[request setShowAccurateProgress:YES];
[networkQueue addOperation:request];
[networkQueue go];
}
- (void)requestForDownloadOfFileFinished:(ASIHTTPRequest *)request1
{
NSLog(@"req finish.........");
NSLog(@"Content will be %llu bytes in size",[request1 contentLength]);
goButton.hidden=YES;
[imageProgressIndicator1 removeFromSuperview];
UIImage *img = [UIImage imageWithContentsOfFile:[request1 downloadDestinationPath]];
array=[[[NSMutableArray alloc]init]autorelease];
[array addObject:img];
image = [[UIImage alloc ]initWithData:[request1 responseData]];
NSString *receivedString = [request1 responseString];
NSLog(@"received string %@",receivedString);
NSData *responseData = [request1 responseData];
NSString *response = [[NSString alloc] initWithData:responseData encoding:NSUTF8StringEncoding];
NSLog(@"Server response:%@", response);
NSLog(@"response data %@",[request1 responseData]);
NSLog(@"download destination path %@",[request downloadDestinationPath]);
NSLog(@"download destination path1 %@",[request1 downloadDestinationPath]);
NSLog(@"image %@",img);
NSLog(@"image1 %@",image);
if (img) {
[imageView1 setImage:img];
}
UIAlertView *alertView = [[[UIAlertView alloc] initWithTitle:@"Download" message:@"Download Completed" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] autorelease];
[alertView show];
//completed=true;
NSLog(@"mutablearray count %@",[array objectAtIndex:0]);
}
// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath *)indexPath
//-------------------------------------------------------------------------------
{
int tablePadding = 40;
int tableWidth = [self.tblViewDownload frame].size.width;
if (tableWidth > 480) {
tablePadding = 110;
}
static NSString *CellIdentifier = @"TypeCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero]autorelease];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
if([indexPath row]==0)
{
NSString *urlString=@"http://www.digitalreview.ca/cams/pics/DSCN0044.JPG";
NSString* theFileName = [urlString lastPathComponent];
NSLog(@"%@ the filename",theFileName);
goButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
[goButton setTitle:@"Go" forState:UIControlStateNormal];
[goButton sizeToFit];
[goButton setFrame:CGRectMake(220,30,50,30)];
[goButton addTarget:self action:@selector(fetchThreeImages1:) forControlEvents:UIControlEventTouchUpInside];
[cell addSubview:goButton];
//-------------
NSString *workSpacePath=[[self applicationDocumentsDirectory] stringByAppendingPathComponent:theFileName];
NSLog(@"%@ workSpacePath ",workSpacePath);
if ( workSpacePath ){
NSLog(@"%@ workSpacePath ",workSpacePath);
//--------------
UIImage *imgBack = [UIImage imageNamed:@"btn-back.png"];
imageView1 = [[[UIImageView alloc] initWithFrame:CGRectMake(0,0,20,20)] autorelease];
[imageView1 setBackgroundColor:[UIColor grayColor]];
//imageView1.image = [UIImage imageWithData:[NSData dataWithContentsOfFile:workSpacePath]];
imageView1.image = [UIImage imageWithContentsOfFile:workSpacePath];
[cell addSubview:imageView1];
NSLog(@"dfdfD");
NSLog(@"sdfdsf");
}
imageProgressIndicator1 = [[[UIProgressView alloc] initWithFrame:CGRectZero] autorelease];
[cell addSubview:imageProgressIndicator1];
}
NSUInteger imageWidth = (tableWidth-tablePadding-20)/3;
NSUInteger imageHeight = 35;
[imageView1 setFrame:CGRectMake(tablePadding/2,20,imageWidth,imageHeight)];
[imageProgressIndicator1 setFrame:CGRectMake(120,40,imageWidth,20)];
}
return cell;
}
| 0 | [
2,
28,
49,
21127,
99,
10351,
6633,
49,
5106,
3772,
29,
53,
3455,
4725,
800,
3726,
3726,
75,
14,
3301,
25,
1066,
13,
15,
49,
259,
20,
221,
499,
8294,
1961,
15,
4023,
17,
763,
37,
8128,
9,
871,
31,
589,
777,
20,
7121,
14,
1961,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
custom cursor in metro app
===
I am developing a paint like application. I want to change cursor at some instance. So, how can I use the custom cursor in metro app ?
I have found this
Window.Current.CoreWindow.PointerCursor = new Windows.UI.Core.CoreCursor(Windows.UI.Core.CoreCursorType.Custom, uint id);
In above method, there is one enum for "Custom" cursor and the second argument is for resource ID. So how can I get that ? | 0 | [
2,
5816,
29588,
19,
3986,
4865,
800,
3726,
3726,
31,
589,
3561,
21,
5107,
101,
3010,
9,
31,
259,
20,
753,
29588,
35,
109,
4851,
9,
86,
15,
184,
92,
31,
275,
14,
5816,
29588,
19,
3986,
4865,
13,
60,
31,
57,
216,
48,
1463,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Spring bean not injected in CXF Restful Service on JBoss6
===
I am writing a CXF Restful service with Spring on JBoss 6. The Spring bean is not injected. Instead of showing gobs of code here, I have shared a sample project [here][1]. My understanding is that the spring context is not creating the rest service class and hence the spring bean (CoreService in the project) is not injected. However the same works well in TomCat. I want to get it working on JBoss6.
Please share your thoughts and help me resolve the issue. Your help highly appreciated. Thanks.
[1]: https://sites.google.com/site/kenbase/misc/restservice.zip | 0 | [
2,
1573,
15322,
52,
23256,
19,
272,
396,
410,
760,
1566,
365,
27,
487,
10349,
18,
379,
800,
3726,
3726,
31,
589,
1174,
21,
272,
396,
410,
760,
1566,
365,
29,
1573,
27,
487,
10349,
18,
400,
9,
14,
1573,
15322,
25,
52,
23256,
9,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a core dump on clr exception thrown
===
I'm trying to create a dump using windbg every time a clr exception of some sort is THROWN.
I know about !soe, but I don't want the execution to stop, I just want it to create a dump.
Is this possible?
If it's not possible using windbg, I'm also open to other recommendations on how to achieve this... | 0 | [
2,
2936,
21,
2884,
11424,
27,
10842,
139,
5391,
6027,
800,
3726,
3726,
31,
22,
79,
749,
20,
1600,
21,
11424,
568,
1511,
19924,
352,
85,
21,
10842,
139,
5391,
16,
109,
2058,
25,
6027,
9,
31,
143,
88,
13,
187,
18,
8018,
15,
47,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
compile large project within emacs
===
A large project may have directory with several level depth. Emacs's default compile command is `"make -k"`, if I modified a certain source code, then typed `"M-x compile RET RET"`, it will execute `"make -k"` under the directory which the source code lies.
I think I can write a function to determine if the Makefile exist under current directory, if yes, keep searching under the parent directory until find the top level directory, then execute the building command, it would be right like my expectation.
However, I'm not very clearly how to start, could anyone give me some hints to start? Like the function or variable I may encounter. Thanks. | 0 | [
2,
26561,
370,
669,
363,
13,
62,
6893,
18,
800,
3726,
3726,
21,
370,
669,
123,
57,
16755,
29,
238,
662,
5204,
9,
13,
62,
6893,
18,
22,
18,
12838,
26561,
1202,
25,
13,
1,
7,
11115,
13,
8,
197,
7,
1,
15,
100,
31,
5372,
21,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Uncaught TypeError: Object
===
I want to search two item (name=string and location=json). this search is (one input box and two columns for search).
at the moment with this code I can find 'name' but i need I need to find location also.
if(textToCheck !== '') {
if((searchArray[i]['location']).toLowerCase().search(textToCheck) === -1) {
display = false;
}
}
the code that I suggest and doesn't work is:
if(textToCheck !== '') {
if((searchArray[i]['name']).toLowerCase().search(textToCheck) === -1 || (searchArray[i]['location']).toLowerCase().search(textToCheck) === -1) {
display = false;
}
}
error is :
> Uncaught TypeError: Object 123 Street,xxx,xx,Canada,123rd Street,xxx,xx,123 xxx,12345 xxx,France has no method 'toLowerCase' FilterController.showFilteredSet (anonymous function) | 0 | [
2,
16061,
12647,
1001,
29992,
45,
3095,
800,
3726,
3726,
31,
259,
20,
2122,
81,
9101,
13,
5,
7259,
3726,
11130,
17,
1474,
3726,
728,
528,
6,
9,
48,
2122,
25,
13,
5,
849,
6367,
1649,
17,
81,
7498,
26,
2122,
6,
9,
35,
14,
688,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Creating a thread in a SharedLibrary raises segmentation fault
===
I am very new to the linux OS so I am trying to design a shared library witch will start a thread i have the followin code :
1. The function init_log doesn't raise a segmentation fault it doesn't display noting in the log though can some one tell me why ?
2. The function pthread_create raises a segmentation fault i use derror() to print that in the log!
void __attribute__ ((constructor)) setup();
void init_log()
{
setlogmask(LOG_UPTO(LOG_NOTICE));
openlog("TRACKER",LOG_CONS | LOG_PID | LOG_NDELAY, LOG_LOCAL1);
}
void loop()
{
while (0 == 0)
{
syslog(LOG_NOTICE,"OK BOSS");
sleep(1000);
}
}
void setup()
{
pthread_t thread_id;
init_log();
syslog(LOG_NOTICE,"LIB LOADED"); // this doesn't display
pthread_create(&thread_id,0,&loop,(void*)(NULL));
} | 0 | [
2,
2936,
21,
9322,
19,
21,
2592,
1210,
2559,
622,
15303,
5631,
857,
4173,
800,
3726,
3726,
31,
589,
253,
78,
20,
14,
13024,
13,
759,
86,
31,
589,
749,
20,
704,
21,
2592,
1248,
5722,
129,
799,
21,
9322,
31,
57,
14,
1740,
108,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Reading content from an Excel file
===
package jexcel.jxl.nimit;
import java.io.*;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import jxl.read.biff.BiffException;
import jxl.read.biff.File;
public class ExampleJxl {
/**
* @param args
*/
public static void main(String[] args)throws IOException, BiffException {
ExampleJxl.ExcelFile("D:/nimit.xls");
}
public static String ExcelFile(String path){
Workbook workbook = Workbook.getWorkbook(File(path));
Sheet sheet = workbook.getSheet(0);
Cell a1 = sheet.getCell(0,0);
Cell a2 = sheet.getCell(0,1);
String s1=a1.getContents();
String s2=a2.getContents();
System.out.println("My name is"+a1+"\t"+a2);
}
}
I don't understand why the File(path) show a error __The method File(String) is undefined for the type ExampleJxl__
I'm trying to print my name entered in the excel file. | 0 | [
2,
1876,
2331,
37,
40,
20700,
3893,
800,
3726,
3726,
6030,
487,
1706,
11040,
9,
728,
396,
255,
9,
889,
5130,
73,
9010,
8247,
9,
1963,
9,
2483,
73,
9010,
487,
396,
255,
9,
9725,
73,
9010,
487,
396,
255,
9,
17627,
73,
9010,
487,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Unix/Perl - Remove contents of a file before a pattern
===
I have a file like this
### SECTION 1 ###
data data
data data
### SECTION 2 ###
data data
data data
Now I want everything before **SECTION 2** to be removed.
How can I do this in Perl or Unix? | 0 | [
2,
22540,
118,
1432,
255,
13,
8,
4681,
8478,
16,
21,
3893,
115,
21,
3732,
800,
3726,
3726,
31,
57,
21,
3893,
101,
48,
6926,
5910,
5910,
1050,
137,
6926,
5910,
5910,
1054,
1054,
1054,
1054,
6926,
5910,
5910,
1050,
172,
6926,
5910,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
perfecto mobile review
===
Can anyone let me know is perfecto mobile the right option for testing compared to a physical device, what are the effects of this on a native application and hybrid, does perfecto uses a emulator in the backend somewhere since its on a cloud it can only offer that.
Please help.
Thanks
deepesh
| 0 | [
2,
2107,
111,
3241,
1487,
800,
3726,
3726,
92,
1276,
408,
55,
143,
25,
2107,
111,
3241,
14,
193,
4255,
26,
4431,
2428,
20,
21,
1825,
3646,
15,
98,
50,
14,
2292,
16,
48,
27,
21,
1275,
3010,
17,
6957,
15,
630,
2107,
111,
2027,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
All possible combinations of a 2D array
===
I want to generate all possible combinations from a 2D [m x n] array except for the first element of each array. That element will stand for the 'type' signifying the rest elements. For example, if I've an array
shirts[][] =
{
{"colour", "red", "blue", "green", "yellow"},
{"cloth", "cotton", "poly", "silk"},
{"type", "full", "half"}
};
w
The desired output should be combination of all the possibilities of shirt. For the above example,
colour red
colour blue
...
cloth silk
type full
type half
colour red cloth cotton
colour red cloth poly
...
colour yellow type half
cloth cotton type full
...
cloth silk type half
colour red cloth cotton type full
...
colour yellow cloth silk type half
I tried something like this (also took help from other Stack Overflow [Question][1] )
String shirts[][] =
{
{"colour", "red", "blue", "green", "yellow"},
{"cloth", "cotton", "poly", "silk"},
{"type", "full", "half"}
};
majorCombinations = new int[possibilities][shirts.length];
int currentCombination;
int offset = 1;
for (int i=0; i < shirts.length; i++)
{
currentCombination = 0;
while (currentCombination < possibilities)
{
for (int j=0; j < shirts[i].length; j++)
{
for (int k=0; k < offset; k++)
{
if (currentCombination < possibilities)
{
majorCombinations[currentCombination][i] = shirts[i][j];
currentCombination++;
}
}
}
}
offset *= shirts[i].length;
}
but it gives values of ALL n combinations only i.e.
colour cloth type
colour cloth full
...
yellow silk half
It doesn't take into account smaller combinations. A help in VBA would be highly appreciated. I'm comfortable with C, Java and C# as well.
Thanks in advance :)
[1]: http://stackoverflow.com/questions/127704/algorithm-to-return-all-combinations-of-k-elements-from-n | 0 | [
2,
65,
938,
17908,
16,
21,
172,
43,
7718,
800,
3726,
3726,
31,
259,
20,
7920,
65,
938,
17908,
37,
21,
172,
43,
636,
79,
993,
13,
103,
500,
7718,
1613,
26,
14,
64,
4520,
16,
206,
7718,
9,
30,
4520,
129,
1261,
26,
14,
13,
22,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Multiple domains one sign on (without logging in to each one)
===
I have been asked to oversee the development of a handful of sites. The people running the show want it so that if you sign onto one of the sites, then you are automatically signed onto the rest of them.
One of my buddies who is a great programmer says there is no safe way to do this, is he right?
I had an idea that the main site (parent site) could host the daughter sites as sub domains, with each site having its own unique domain name.
What do you think? | 0 | [
2,
1886,
15544,
53,
1676,
27,
13,
5,
14506,
13,
13919,
19,
20,
206,
53,
6,
800,
3726,
3726,
31,
57,
74,
411,
20,
14063,
14,
522,
16,
21,
8893,
16,
3259,
9,
14,
148,
946,
14,
298,
259,
32,
86,
30,
100,
42,
1676,
1204,
53,
1... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Github Java API - search repos
===
I want to search Github repos based on size and keyword parameters. Here is the Java code I wrote:
<!-- language: java -->
package searchTest;
import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.eclipse.egit.github.core.SearchRepository;
import org.eclipse.egit.github.core.client.GitHubClient;
import org.eclipse.egit.github.core.service.RepositoryService;
public class GithubSearch {
private static Map<String, String> searchQuery = new HashMap<String, String>();
public static void main(String[] args) throws IOException {
GitHubClient client = new GitHubClient();
client.setCredentials("username", "password");
RepositoryService service = new RepositoryService(client);
searchQuery.put("keyword","microsoft");
searchQuery.put("size","304");
List<SearchRepository> searchRes = service.searchRepositories(searchQuery);
System.out.println("Search result "+searchRes.toString());
}
}
But the output I get is empty:
Search result []
I checked the [GitHub Java API][1] javadoc, but could not find a solution.
Thanks!
[1]: https://github.com/eclipse/egit-github/tree/master/org.eclipse.egit.github.core | 0 | [
2,
13,
10404,
20926,
8247,
21,
2159,
13,
8,
2122,
302,
12551,
800,
3726,
3726,
31,
259,
20,
2122,
13,
10404,
20926,
302,
12551,
432,
27,
1072,
17,
1246,
9587,
12905,
9,
235,
25,
14,
8247,
1797,
31,
738,
45,
13,
1,
187,
8,
8,
8... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
JFace Dialog maximize programmatically
===
I am currently trying to maximize a JFace `Dialog` programmatically.
Usually calling `setMaximized(true)` on the `parentShell` of the `Dialog` would be sufficient to achieve this.
However, it does not work for my `Dialog`. Maximizing it manually using the window buttons works.
Does anybody have an idea how to do it? | 0 | [
2,
487,
6413,
28223,
23952,
625,
6732,
1326,
800,
3726,
3726,
31,
589,
871,
749,
20,
23952,
21,
487,
6413,
13,
1,
4286,
5567,
1,
625,
6732,
1326,
9,
951,
2555,
13,
1,
3554,
8304,
1660,
1333,
5,
13398,
6,
1,
27,
14,
13,
1,
1890... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
.htaccess 301 Redirects to 404 error
===
Hope you're all well.
I'm trying to redirect page by page to a new site using the following command:
redirect 301 / http://www.example.com/<br>
redirect 301 /about-us.html http://www.example.com/about/
And so on. While the homepage redirects fine, for anything deeper, it keeps heading to a 404 page that returns the following string on the end of the domain:
/**about.html?page=about**
I'm not sure where I'm going wrong, but any assistance would be grateful, and if you require more information, please let me know.
Thanks :)
Aaron | 0 | [
2,
13,
9,
9020,
20604,
13,
18979,
302,
14706,
18,
20,
13,
23397,
7019,
800,
3726,
3726,
1376,
42,
22,
99,
65,
134,
9,
31,
22,
79,
749,
20,
302,
14706,
2478,
34,
2478,
20,
21,
78,
689,
568,
14,
249,
1202,
45,
302,
14706,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Jquery Radio Button On Posts
===
Hi I have a form that data post something weird...
HTML:
<form>
<input type="radio" name="datatype" value="1"/> <label>Datatype 1</label>
<input type="radio" name="datatype" value="2"/> <label>Datatype 2</label>
<button type="submit">Submit</button>
</form>
FORM 1:
$('form').submit(function(){
var dt = $(this).serializeArray();
$.ajax({
url: 'post.php',
data: dt,
..................
})
})
FORM 2:
$('form').submit(function(){
var opt = $(['input[name=datatype]').val();
var dt = [{name:'dtype',value: opt }];
$.ajax({
url: 'post.php',
data: dt,
..................
})
})
In FORM 1 datatype properly post with the correct value either 1 or 2. In this part I am using serialize array. Now the weird thing is on FORM 2 if you choose datatype 2 it always post the value of 1. I need to use FORM 2 for some reason... Am glad if anyone could help. Thanks | 0 | [
2,
487,
8190,
93,
603,
5167,
27,
9868,
800,
3726,
3726,
4148,
31,
57,
21,
505,
30,
1054,
678,
301,
5455,
9,
9,
9,
13,
15895,
45,
13,
1,
4190,
1,
13,
1,
108,
4881,
1001,
3726,
7,
11129,
7,
204,
3726,
7,
18768,
4474,
7,
1923,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How do I resolve error C2059: syntax error : '__asm' in Visual C++ 2010 Express
===
The file in which there is inline asm code is of the form xyz.c I'm using Visual C++ 2010 Express IDE. I get the error mentioned in the title. Any help is appreciated! Thanks!
My code roughly looks like this.
#include "xyz.h"
/*
; Multi-line comments
;
*/
__asm{
Assembly code
}
/*
; Multi-line comments
;
*/
.
.
.
__asm{
Assembly code
}
/*
; Multi-line comments
;
*/
__asm{
Assembly code
}
| 0 | [
2,
184,
107,
31,
9854,
7019,
272,
1323,
3902,
45,
22649,
7019,
13,
45,
13,
22,
1,
472,
79,
22,
19,
3458,
272,
20512,
498,
2999,
800,
3726,
3726,
14,
3893,
19,
56,
80,
25,
19,
1143,
28,
79,
1797,
25,
16,
14,
505,
13,
15161,
3... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Androip 2.3 SipDemo Failed to register
===
I have tried the SipDemo as a starting point of developing a softphone but have not yet modified the code. My sip credentials entered on SipDemo are working on other softphones and did a double check whether they are correct or not. The error code returned is -4(No data connection). I'm using an HTC wildfire S with android 2.3 as my testing handset.
When I googled around, I found that someone had the same problem and his solution was to hardcode tcp because the handset was not working with udp hence the "registration failed" message was shown. | 0 | [
2,
17,
661,
4307,
172,
9,
240,
8616,
19274,
1702,
20,
2243,
800,
3726,
3726,
31,
57,
794,
14,
8616,
19274,
28,
21,
1422,
454,
16,
3561,
21,
1856,
7709,
47,
57,
52,
768,
5372,
14,
1797,
9,
51,
8616,
5059,
43,
10107,
18,
1297,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Detect dot11 association packet etc
===
i actually encountered some problem of detection on scapy and python. Okay, i started with create mon0 by airmon-ng after which my I ran my script.
`if p.haslayer(Dot11AssoReq):
print p.sprintf("%Dot11.addr1% | %Dot11Elt.info%")`
It can work in Ubuntu 12.04 and Backtrack 5r2 but when i run it on raspberry pi, it cannot be detected smoothly. Any kind souls can help me? | 0 | [
2,
9092,
14123,
1306,
607,
12795,
2722,
800,
3726,
3726,
31,
1121,
8208,
109,
1448,
16,
11643,
27,
11583,
6448,
17,
20059,
9,
1705,
15,
31,
373,
29,
1600,
3521,
387,
34,
282,
2111,
8,
2723,
75,
56,
51,
31,
717,
51,
3884,
9,
13,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
detect cross domain redirects on ajax request
===
We have our authentication delegated to another domain (Window Identify framework, federated authentication setup). Now, if the the session timed out before an ajax request , server redirects the request to authentication server. Since it becomes a cross domain call, ajax request is cancelled by the browser. Is there a way i can detect this in jquery/javascript ?
I inspected the status property of the xhr object which set to 0 in such case, but is it a good indicator for cancelled requests? (I am using jquery $.ajax to make ajax requests) | 0 | [
2,
9092,
919,
4603,
302,
14706,
18,
27,
20624,
3772,
800,
3726,
3726,
95,
57,
318,
27963,
11300,
43,
20,
226,
4603,
13,
5,
27508,
5808,
6596,
15,
29391,
27963,
18161,
6,
9,
130,
15,
100,
14,
14,
3723,
85,
43,
70,
115,
40,
20624,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Undefined index, and undefined variable, but both are defined! (I think....)
===
I am using the HTML form below to pass a file to PHP for handling. But PHP says that the index is undefined.
Also, similarly, a variable I defined in config.php is showing as undefined.
What am I missing here?
**classes.php**
<?php
require('config.php');
error_reporting(E_ALL);
/*
* Classes required by the script
*
*/
class database extends PDO
{
public $conURL;
public function __construct($config) {
$conURL = "mysql:host=" . $config['host'] . ";dbname=" . $config['db'];
try {
parent::__construct($conURL, $config['user'], $config['pass']);
} catch (PDOException $e) {
$e->getMessage();
}
}
}
class upload
{
public $_FILES;
public function uploadFile() {
if ($_FILES['file']['size'] >= 2000000) {
echo "File is too large!";
}
elseif (isset($_FILES['file'])) {
$stmt = $this->prepare("INSERT INTO upload (name, type, size, content) VALUES (?, ?, ?, ?)");
$stmt->execute(array($_FILES['file']['name'], $_FILES['file']['type'], $_FILES['file']['size'], $_FILES['file']['file']));
}
}
}
**config.php**
<?php
$config = array(
'host' => 'localhost', // db host
'user' => 'root', // db user
'pass' => 'mypassword', //db pass
'db' => 'files' // db name
);
**upload.php**
<?php
error_reporting(E_ALL);
require('config.php');
require('classes.php');
$dbh = new database($config);
$upload = new upload();
$upload->uploadFile();
**HTML form**
<form name="uploaddb" action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="2000000" />
<input type="file" name="file" />
<br/>
<input type="submit" name="submit" value="Upload!" />
</form>
And for reference, here are the errors:
> Notice: Undefined variable: config in
> /Applications/MAMP/htdocs/files/classes.php on line 28
>
> Notice: Undefined index: file in
> /Applications/MAMP/htdocs/files/classes.php on line 34 | 0 | [
2,
367,
13439,
4348,
15,
17,
367,
13439,
7612,
15,
47,
156,
50,
2811,
187,
13,
5,
49,
277,
9,
9,
9,
9,
6,
800,
3726,
3726,
31,
589,
568,
14,
13,
15895,
505,
1021,
20,
1477,
21,
3893,
20,
13,
26120,
26,
7988,
9,
47,
13,
261... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
NSManagedObject's willSave not being called for invalid object
===
I have an NSManagedObject class with a `updatedOn` attribute. I was hoping to implement the logic to set its value in the class's `willSave` method. When I tried to do this, I found that willSave was never being called on my instances of this class.
After some investigation, I determined that the `willSave` method was not being called for newly created instances, where `updatedOn` was not initialized to any value. Because this attribute was not set to be optional, the validation fails and apparently the `willSave` method only gets called if the instance is valid.
My question is this: Is there a best practice for doing this kind of thing? Do I need to make the `updatedOn` attribute optional to work around this? Or should I implement the `awakeFromInsert` method of my class to set an initial value there, and then overwrite that value when the `willSave` method eventually gets called? Or is there some simpler approach that makes more sense? | 0 | [
2,
13,
2172,
177,
8030,
23793,
22,
18,
129,
19863,
52,
142,
227,
26,
16671,
3095,
800,
3726,
3726,
31,
57,
40,
13,
2172,
177,
8030,
23793,
718,
29,
21,
13,
1,
576,
8209,
804,
1,
35,
14755,
9,
31,
23,
3935,
20,
8713,
14,
7085,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to backup Bitnami redmine 1.2.1 and use it in Bitnami Redmine 1.4.4?
===
I installed and used Bitnami redmine version 1.2.1 1 year ago on Amazone EC2. And now, I need to backup and use them in local server. But, I have not found bitnami redmine version 1.2.1. Then, I installed Bitnami redmine lastest version is 1.4.4.
I had backup database Bitnami redmine 1.2.1 on Amazone EC2 and restore backup file in Bitnami redmine local server ( version 1.4.4). But, I can't used redmine in local server by get errors as follows
![enter image description here][1]
How to backup Bitnami redmine 1.2.1 and use it in Bitnami Redmine 1.4.4 ?
[1]: http://i.stack.imgur.com/AA0Ik.png | 0 | [
2,
184,
20,
10119,
1142,
20654,
402,
7640,
137,
9,
135,
9,
165,
17,
275,
32,
19,
1142,
20654,
402,
7640,
137,
9,
300,
9,
300,
60,
800,
3726,
3726,
31,
4066,
17,
147,
1142,
20654,
402,
7640,
615,
137,
9,
135,
9,
165,
137,
159,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
The android emulator is out of view, how can i move it?
===
I used an additional display with my laptop and moved the android emulator there. It seems to remember the location even if the display is not connected anymore.
Is there any way to reset the position of the window so it becomes visible again? | 0 | [
2,
14,
13005,
3579,
14868,
25,
70,
16,
1418,
15,
184,
92,
31,
780,
32,
60,
800,
3726,
3726,
31,
147,
40,
1351,
3042,
29,
51,
12294,
17,
385,
14,
13005,
3579,
14868,
80,
9,
32,
2206,
20,
1518,
14,
1474,
166,
100,
14,
3042,
25,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Get raw data from POST request in Flask
===
How can I get the raw data from a POST request in Flask?
I am moving from web.py to Flask and have some clients in production that unfortunately are using the content-type header application/x-www-form-urlencoded, so changing the header value of the request is not an option (unless it is overwritten on the server)
I cannot use:
data = request.form.keys()[0]
Because occasionally the '&' character shows up in my data and trying to loop through the form.keys adding the '&' seems to corrupt the data for some reason.
I'm currently using the solution proposed in this post:
http://stackoverflow.com/questions/10999990/python-flask-how-to-get-whole-raw-post-body
But I'm not too sure if this has any performance issues.
I'm looking for one of three things:
1. Confirmation that the WGSICopyBody method won't have any adverse performance issues
2. Ability to make this (data = request.form.keys()[0]) method work by looping through the keys and properly restoring the & in the data
3. Another solution to the problem, possibly by subclassing the Request class? | 0 | [
2,
164,
4333,
1054,
37,
678,
3772,
19,
28972,
800,
3726,
3726,
184,
92,
31,
164,
14,
4333,
1054,
37,
21,
678,
3772,
19,
28972,
60,
31,
589,
1219,
37,
2741,
9,
6448,
20,
28972,
17,
57,
109,
7421,
19,
637,
30,
6200,
50,
568,
14,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Retrieving big size images for links from stream table
===
We have the need to displaying hi-res images on iOS devices for the links shared in the wall from users friends.
For that we make a SELECT to the stream table including the field 'attachment' in the request.
From the 'attachment' array we get the 'media' dictionary.
After that, from the 'media' dictionary, src key give us the value of the thumbnail.
For links, the image size provided by src is normally small and it is difficult to offer a good presentation of the data in that size.
My question is:
Is there any other way to retrieve big size images of the links shared in the wall by friends?
Thanks in advance. | 0 | [
2,
13,
6239,
3272,
8397,
580,
1072,
3502,
26,
6271,
37,
3766,
859,
800,
3726,
3726,
95,
57,
14,
376,
20,
17418,
4148,
8,
99,
18,
3502,
27,
13,
7760,
4690,
26,
14,
6271,
2592,
19,
14,
769,
37,
3878,
954,
9,
26,
30,
95,
233,
2... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
2D Game map movement
===
I have a 2d randomly genrated map for a platformer made of block(squares 40 by 40) stored in an array of 30, i have a push function to move the blocks around push changes the xpos aswell as the position on the array i'm only ever drawing the 5-25 position on the array.
When i move i'll only be moving the character within the first half of the screen. so there is collision between the middle part and the 0xpos of the screen now the problem i'm having is moving the blocks .
I cant think of a way to move them so it looks natural. Any ideas on how to do it? so far i have it so that every time the character collides with one side of the screen equivilant to 40 pixels worth of velocity it pushes a block and randomly genorates another. | 0 | [
2,
172,
43,
250,
2942,
1018,
800,
3726,
3726,
31,
57,
21,
172,
43,
21324,
4380,
7432,
2942,
26,
21,
2452,
106,
117,
16,
1921,
5,
12300,
18,
1417,
34,
1417,
6,
8214,
19,
40,
7718,
16,
712,
15,
31,
57,
21,
3250,
1990,
20,
780,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Connect to MS SQL Server 2008 with PHP
===
Using the PHP drivers from Microsoft, we cannot connect using either Windows Authentication or SQL Server authentication. We use the following PHP code:
$serverName = "(A\B)";
$connectionInfo = array( "UID"=>"u1",
"PWD"=>"p1",
"Database"=>"db1");
$conn = sqlsrv_connect( $serverName, $connectionInfo); | 0 | [
2,
6379,
20,
4235,
4444,
255,
8128,
570,
29,
13,
26120,
800,
3726,
3726,
568,
14,
13,
26120,
5783,
37,
7099,
15,
95,
1967,
6379,
568,
694,
1936,
27963,
54,
4444,
255,
8128,
27963,
9,
95,
275,
14,
249,
13,
26120,
1797,
45,
5579,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
How to display different components in a JFrame?
===
I am very new to Java AWT. My question header must seem ridiculous to you, sorry about that. In my application I have three buttons which display different threads when clicked on. Now I want to add maybe a button or checkboxes or choicelist, etc when clicked on a particular button. For eg, if I click on yes button, it should display a choice list, something like that. How do I achieve something like that? Here is my code so far:
import java.awt.Button;
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class AppWindow extends Frame implements ActionListener{
String keymsg = "Test message";
String mousemsg = "Nothing";
int mouseX=30, mouseY=30;
String msg;
public AppWindow(){
//addKeyListener(new MyKeyAdapter(this));
//addMouseListener(new MyMouseAdapter(this));
addWindowListener(new MyWindowAdapter());
}
public void paint(Graphics g){
g.drawString(msg, 150, 100);
}
//Here the window is created:
public static void main(String args[]){
AppWindow appwin = new AppWindow();
appwin.setSize(new Dimension(300,200));
appwin.setTitle("My first AWT Application");
appwin.setLayout(new FlowLayout(FlowLayout.LEFT));
appwin.setVisible(true);
Button yes,no,maybe;
yes = new Button("yes");
no = new Button("no");
maybe = new Button("maybe");
appwin.add(yes);
appwin.add(no);
appwin.add(maybe);
yes.addActionListener(appwin);
no.addActionListener(appwin);
maybe.addActionListener(appwin);
}
@Override
public void actionPerformed(ActionEvent ae) {
// TODO Auto-generated method stub
String str = ae.getActionCommand();
if(str.equals("yes")){
msg = "You pressed Yes";
}
if(str.equals("no")){
msg = "You pressed No";
}
if(str.equals("maybe")){
msg = "You pressed Maybe";
}
repaint();
}
}
class MyWindowAdapter extends WindowAdapter {
public void windowClosing(WindowEvent we){
System.exit(0);
}
} | 0 | [
2,
184,
20,
3042,
421,
5090,
19,
21,
487,
8361,
60,
800,
3726,
3726,
31,
589,
253,
78,
20,
8247,
13,
3885,
38,
9,
51,
1301,
157,
106,
491,
2260,
9080,
20,
42,
15,
1875,
88,
30,
9,
19,
51,
3010,
31,
57,
132,
12861,
56,
3042,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
looking for a good and correct java implementation of mvc pattern
===
I'm trying to search on the net some good implementation of java mvc pattern but I found a lot of things and all those things confused me so much.I start from the knowledge of mvc pattern in php language but I don't know how apply on java because I have never done.someone can show me a good and correct implementation? | 1 | [
2,
699,
26,
21,
254,
17,
4456,
8247,
6123,
16,
307,
8990,
3732,
800,
3726,
3726,
31,
22,
79,
749,
20,
2122,
27,
14,
4275,
109,
254,
6123,
16,
8247,
307,
8990,
3732,
47,
31,
216,
21,
865,
16,
564,
17,
65,
273,
564,
4230,
55,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Prevent JAR from being imported into Eclipse Java project
===
I have a Java project which is heavily used by all sorts of other Java and Android projects. The project contains some JAR libraries which shall be used by all projects, except for the Android one (in fact the Android project is a Android library project to be precise).
I marked the JARs as "export" in the Eclipse build path preferences of the Java project. However, the Android project shouldn't import these libraries (as they are Java libraries which make use of some classes which are not available on Android), but it shall import the rest of the code (which doesn't really use the libraries, but they are stored in there for convenience reasons and to ensure, that all other projects use the same library.
How can I prevent the JARs from being exported to the Android projects? | 0 | [
2,
2501,
5112,
37,
142,
11808,
77,
11652,
8247,
669,
800,
3726,
3726,
31,
57,
21,
8247,
669,
56,
25,
2991,
147,
34,
65,
14357,
16,
89,
8247,
17,
13005,
2314,
9,
14,
669,
1588,
109,
5112,
8649,
56,
3004,
44,
147,
34,
65,
2314,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mysql query - using Locate function in case statement to group traffic by source
===
I'm basically trying to group my traffic based on the traffic source
Lets say the table has the following columns
<pre>
Enrollment_ID | last_modified | referrer
1 | 2012-07-01 15:00:00 | http://www.facebook.com/l.php?xyz
2 | 2012-07-01 16:00:00 | http://www.facebook.com/l.php?abc
</pre>
Now the referrer is different - so even if I group it by referrer - it wont say 2
So this is the query I used
<pre>
select count(*) as 'Enrollments',date_format(e.last_modified,'%d/%m/%y') as 'Date', if(LOCATE('facebook', referrer)>0,'facebook',referrer) as 'referrer'
from enrollment e
where e.last_modified >='2012-07-01 00:00:00'
group by date_format(e.last_modified,'%d/%m/%y'),3
</pre>
This works fine. But obviously I'm going to have more than one referrer.
So I thought of using case statement
<pre>
select count(*) as 'Enrollments',date_format(e.last_modified,'%d/%m/%y') as 'Date',
case referrer
when LOCATE('facebook', referrer)>0 then 'facebook'
when LOCATE('google', referrer)>0 then 'google'
else referrer
end as 'referrer'
from enrollment e
where e.last_modified >='2012-07-01 00:00:00'
group by date_format(e.last_modified,'%d/%m/%y'),3
</pre>
This does not work as expected.
For the first and second query - I have created a sql fiddle
First - http://sqlfiddle.com/#!2/70f6b/2
Second - http://sqlfiddle.com/#!2/ad890/3
I'll appreciate if someone can take a quick glance at it
Thanks for your time
| 0 | [
2,
51,
18,
22402,
25597,
13,
8,
568,
12717,
1990,
19,
610,
3331,
20,
214,
2227,
34,
1267,
800,
3726,
3726,
31,
22,
79,
11374,
749,
20,
214,
51,
2227,
432,
27,
14,
2227,
1267,
6884,
395,
14,
859,
63,
14,
249,
7498,
13,
1,
3515,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
perl windows IPv6
===
I have a Perl/Windows app that uses TCP/IP sockets and I need to add IPv6 support.
I have a Windows 7 64-bit machine that is running IPv6 with a Hurricane Electric tunnel and it scores 10 out 10 on http://test-ipv6.com/ and will access IPv6-only sites such as http://loopsofzen.co.uk/.
It has ActivePerl 5.14.2 (I also tried Strawberry Perl 5.16.0.1).
Here's a simple test script:
use Socket qw( getaddrinfo );
$host = 'loopsofzen.co.uk';
$port = 80;
$hints = (socktype => SOCK_STREAM, family -> Socket::AF_INET6);
($err, @addrs) = getaddrinfo($host, 0);
die $err if $err;
and this produces the error:
"no address associated with nodename at ip.pl line 6."
The (new) getaddrinfo() function appears to be available and it does work if I set $host to use an IPv4 hostname. But IPv6 doesn't appear to work at all.
What am I missing? Or is Perl/Windows/IPv6 still a lost cause for the time being?
| 0 | [
2,
416,
255,
1936,
31,
10166,
379,
800,
3726,
3726,
31,
57,
21,
416,
255,
118,
27508,
18,
4865,
30,
2027,
13,
38,
7439,
118,
4307,
18482,
18,
17,
31,
376,
20,
3547,
31,
10166,
379,
555,
9,
31,
57,
21,
1936,
453,
4384,
8,
3326,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why doesn't scope declaration in object class not working
===
I'm using Ruby on Rails 3 and I created a few scopes in my object class but when I call them from within my code it returns an error:
>irb>Transaction.first.committed
>=> undefined method `commited' for #<Transaction:0x007f8ebc651f38>
object class:
>class Transaction < ActiveRecord::Base
> attr_accessible :amount, :description, :published, :task_description_id, :discrete_task_id, :transaction_type
>
> belongs_to :discrete_task
>
> scope :committed, where(:transaction_type => "committed")
>
scope :obligated, where(:transaction_type => "obligated")
>
scope :expensed, where(:transaction_type => "expensed")
>end | 0 | [
2,
483,
1437,
22,
38,
9914,
7098,
19,
3095,
718,
52,
638,
800,
3726,
3726,
31,
22,
79,
568,
10811,
27,
2240,
18,
203,
17,
31,
679,
21,
310,
9914,
18,
19,
51,
3095,
718,
47,
76,
31,
645,
105,
37,
363,
51,
1797,
32,
4815,
40,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Exiting C code to R on error
===
What's the best practice for exiting C code on discovery of an error back to R? Package guidance says don't use `error()`, which makes sense (as you kill everything), but how do you exit to R and indicate an error has occurred. Obviously you could have an error flag in the return vector, but is there a better way? | 0 | [
2,
24999,
272,
1797,
20,
761,
27,
7019,
800,
3726,
3726,
98,
22,
18,
14,
246,
1345,
26,
24999,
272,
1797,
27,
4291,
16,
40,
7019,
97,
20,
761,
60,
6030,
8193,
898,
221,
22,
38,
275,
13,
1,
29992,
5,
6,
1,
15,
56,
1364,
1259,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Why does my web service call fail when calling a different site
===
I am making a JQuery ajax call to a web service like so:
$.ajax({
type: "POST",
url: "https://WebsiteName.com/Service.asmx/LoginExternal",
data: "{loginData: " + JSON.stringify(LoginData) + "}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
... Stuff ...
},
error: {
... Error Alert ...
}
});
When I am on the actual web site, this succeeds. When I am on localhost and use a relative path, it succeeds. However, when I am trying to access the web site (using an absolute path) from localhost, I get the error message that the call failed.
This would seem to indicate that it is a permissions problem and I've made sure that the web.config doesn't require authentication for access to the web service but I'm not sure what else to check. Any help would be greatly appreciated! | 0 | [
2,
483,
630,
51,
2741,
365,
645,
7476,
76,
2555,
21,
421,
689,
800,
3726,
3726,
31,
589,
544,
21,
487,
8190,
93,
20624,
645,
20,
21,
2741,
365,
101,
86,
45,
5579,
9,
6881,
7522,
5,
1,
1001,
45,
13,
7,
6962,
7,
15,
287,
6362,... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Alfresco Share constraint default empty value
===
i have a simple question.
Is there a simple config file or line that can be edited in order to achieve this:
I need that constraints from Alfresco content model have an empty field (like "unselected") in Advanced Search and Edit Metadata forms.
So a constraint of:
<constraint name="custom:customList" type="LIST">
<parameter name="allowedValues">
<list>
<value>first type</value>
<value>second type</value>
</list>
</parameter>
</constraint>
I need to view these in a "SELECT" form but with the first selection empty, like:
<select>
<value></value>
<value>first type</value>
<value>second type</value>
</select>
Hope I made that clear.
P.S. I don't want to insert a <value></value> in the custom content model XML file. There should be another way to achieve this.
Thanks to all.
| 0 | [
2,
14307,
99,
8328,
1891,
28804,
12838,
2424,
1923,
800,
3726,
3726,
31,
57,
21,
1935,
1301,
9,
25,
80,
21,
1935,
13,
14093,
2816,
3893,
54,
293,
30,
92,
44,
4802,
19,
389,
20,
4689,
48,
45,
31,
376,
30,
16747,
37,
14307,
99,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Pop up for registration form in ASp
===
I want to use a ajax popup for registration form in my asp page. What will be the best approach to get this.
How can i get this thing that my database got updated without refreshing the page.
| 0 | [
2,
1675,
71,
26,
8587,
505,
19,
28,
306,
800,
3726,
3726,
31,
259,
20,
275,
21,
20624,
1675,
576,
26,
8587,
505,
19,
51,
28,
306,
2478,
9,
98,
129,
44,
14,
246,
2141,
20,
164,
48,
9,
184,
92,
31,
164,
48,
584,
30,
51,
6018... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... |
How to send facebook api batch request with node.js
===
I spent a whole day frustrated with FB's examples that would not work, and not finding answers elsewhere... | 0 | [
2,
184,
20,
2660,
9090,
21,
2159,
13064,
3772,
29,
15421,
9,
728,
18,
800,
3726,
3726,
31,
1111,
21,
979,
208,
10645,
29,
13,
13478,
22,
18,
3770,
30,
83,
52,
170,
15,
17,
52,
3007,
6709,
6040,
9,
9,
9,
3,
0,
0,
0,
0,
0,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... |
TransactionScope occasionally not rolling back sqlserver2005 transactions
===
I am a .NET developer of a system that uses .net 3.5 and transactionScope to make interactions with our database atomic. We occasionally use more than 1 datasource, but I am occasionally seeing this problem when using TransactionScope against a single sql2005 database.
I am not a DBA so am unable to provide detailed database information, but can ask questions of our DBA's and post results here.
I am constructing a new TransactionScope within my business logic logical layer, and then within this using block calling 3 data access code layer methods. Each DAL layer method causes an insert stored procedure to be executed on the database.
This generally works for days or weeks, handling thousands of inserts and ensuring that either all 3 insert stored procedures are committed, or none are committed.
however, more and more frequently, we are finding that our database is completely locked up. all 100 spids in the connection pool are being blocked, and always by the same sql text. The sql text is a single row insert statement into a table called 'offender'. This insert statement holds locks on the table, which given the tables importance prevents almost everything from running on the db - everything is being held in a blocking chain. The last batch time of that spid can be hours old. Meanwhile i can see the following .NET exception in my application error log. this is showing me that the MS DTC transaction timeout has been hit and the application has raised a .NET execpetion - but why is the insert (first stored procedure) still have a transaction open and locks being held? I would have thought that after the DTC transaction timeout had occured, that the TransactionScope would have rolled back the transaction, and therefore freed up the locks?
The DTC is configured with its default 60 sec timeout, and the transaction scope is using a default timeout as well.
Example stacktrace:
System.TimeoutException: Transaction Timeout
at System.Transactions.TransactionState.EnlistPromotableSinglePhase(InternalTransaction tx, IPromotableSinglePhaseNotification promotableSinglePhaseNotification, Transaction atomicTransaction) at
System.Transactions.Transaction.EnlistPromotableSinglePhase(IPromotableSinglePhaseNotification promotableSinglePhaseNotification) at
System.Data.SqlClient.SqlInternalConnection.EnlistNonNull(Transaction tx) at
System.Data.SqlClient.SqlInternalConnection.Enlist(Transaction tx) at
System.Data.SqlClient.SqlInternalConnectionTds.Activate(Transaction transaction) at
System.Data.ProviderBase.DbConnectionInternal.ActivateConnection(Transaction transaction) at
System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) at
System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) at
System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) at
System.Data.SqlClient.SqlConnection.Open()
Example of how creating transactionScope
using (TransactionScope scope = new TransactionScope())
{
int offenderID = offender.OffenderID.Value;
OffenderDAL offenderDAL = new OffenderDAL();
if (offenderID > 0)
{
if(offenderDAL.Update(offender) == false)
return false;
}
else
offenderID = offenderDAL.Insert(offender);
if(offenderID == 0)
return false;
offender.OffenderID = offenderID;
offence.OffenderID = offenderID;
offence.CreationDate = DateTime.Now;
int offenceID = dal.Insert(offence);
if (offenceID == 0)
return false;
offence.OffenceID = offenceID;
AttendanceDTO attendance = new AttendanceDTO();
attendance.OffenceID = offenceID;
attendance.AttendanceStatusID = 1;
AttendanceDAL attendanceDAL = new AttendanceDAL();
int attendanceID = attendanceDAL.Insert(attendance);
scope.Complete();
InvalidateCache();
return attendanceID > 0;
} | 0 | [
2,
12799,
11555,
4533,
52,
3929,
97,
4444,
255,
10321,
106,
2835,
13147,
800,
3726,
3726,
31,
589,
21,
13,
9,
2328,
10058,
16,
21,
329,
30,
2027,
13,
9,
2328,
203,
9,
264,
17,
12799,
11555,
20,
233,
11224,
29,
318,
6018,
9692,
9... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Mutex in Obj-c / Cocoa
===
I'm pretty new to multithreaded programming & cocoa.
I'm going to need a lock to access/modify a `NSMutableArray` iVar. What's the simpliest way to do it ?
And where i'm here, do you guys have some reading about multithreaded programming with Obj-c/Cocoa ?
Thx. | 0 | [
2,
20562,
396,
19,
5122,
728,
8,
150,
13,
118,
24507,
800,
3726,
3726,
31,
22,
79,
1772,
78,
20,
1889,
96,
10647,
69,
3143,
279,
24507,
9,
31,
22,
79,
228,
20,
376,
21,
3991,
20,
1381,
118,
13670,
8612,
21,
13,
1,
2172,
7903,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Java LDAP get direct reports Multiple Levels in a single query
===
I need to write a Java application in which it queries LDAP and gets all the User hierarchy information by reading the "Direct Reports" attributes or any other way if possible. i.e.Multiple Levels of a user/Manager and their subordinates and their subordinates etc.
I can do this by querying individually for each users.
There is a disadvantage in this case, it queries LDAP for each user and doing so will take a enormous time to get the result set.
I am looking for a single individual query/LDAP filter or a robust code that can fetch up to 3-4 levels of data, so that I can enumerate and use the data as required.
please help me if anyone has done this before or having fair idea/suggestions on this issue.
regards,
Srinath | 0 | [
2,
8247,
644,
20472,
164,
1744,
2813,
1886,
2216,
19,
21,
345,
25597,
800,
3726,
3726,
31,
376,
20,
2757,
21,
8247,
3010,
19,
56,
32,
9386,
2829,
644,
20472,
17,
3049,
65,
14,
4155,
14417,
676,
34,
1876,
14,
13,
7,
14706,
2813,
... | [
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.