PostId
int64 4
11.8M
| PostCreationDate
stringlengths 19
19
| OwnerUserId
int64 1
1.57M
| OwnerCreationDate
stringlengths 10
19
| ReputationAtPostCreation
int64 -55
461k
| OwnerUndeletedAnswerCountAtPostTime
int64 0
21.5k
| Title
stringlengths 3
250
| BodyMarkdown
stringlengths 5
30k
⌀ | Tag1
stringlengths 1
25
⌀ | Tag2
stringlengths 1
25
⌀ | Tag3
stringlengths 1
25
⌀ | Tag4
stringlengths 1
25
⌀ | Tag5
stringlengths 1
25
⌀ | PostClosedDate
stringlengths 19
19
⌀ | OpenStatus
stringclasses 5
values | unified_texts
stringlengths 32
30.1k
| OpenStatus_id
int64 0
4
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
11,411,096 | 07/10/2012 10:13:01 | 258,418 | 01/25/2010 12:43:05 | 325 | 18 | Prevent JPanel from cutting off subcomponents | I am trying to prevent a JPanle to get so small that it cuts off it subcomponents, is there anyway to enforce this? After reading [this](http://stackoverflow.com/questions/849684/jpanel-size-by-inner-components) I tried (in jython):
frame= JFrame('example', size=(200,200))
pan = JPanel()
pan.add(JLabel('beer'))
pan.add(JButton('get one', actionPerformed=printer))
pan.setMinimumSize(panel.getPreferredSize())
frame.add(pan)
frame.visible = True
however the panel can still be shrunk so far that it cuts off its components (in a JFrame or [here](http://stackoverflow.com/questions/11408971/use-button-as-renderer-for-list)), even if I apply the minimum size to the frame. How does one prevent this? ( I assume the preferred size I am getting si not what I want since with the default layout manager it seems to be the size of the largest subcomponent, but if I change it to e.g. `GridBagLayout` it seems to get smaller 9apply minsize to frame and try) | swing | jpanel | jython | null | null | null | open | Prevent JPanel from cutting off subcomponents
===
I am trying to prevent a JPanle to get so small that it cuts off it subcomponents, is there anyway to enforce this? After reading [this](http://stackoverflow.com/questions/849684/jpanel-size-by-inner-components) I tried (in jython):
frame= JFrame('example', size=(200,200))
pan = JPanel()
pan.add(JLabel('beer'))
pan.add(JButton('get one', actionPerformed=printer))
pan.setMinimumSize(panel.getPreferredSize())
frame.add(pan)
frame.visible = True
however the panel can still be shrunk so far that it cuts off its components (in a JFrame or [here](http://stackoverflow.com/questions/11408971/use-button-as-renderer-for-list)), even if I apply the minimum size to the frame. How does one prevent this? ( I assume the preferred size I am getting si not what I want since with the default layout manager it seems to be the size of the largest subcomponent, but if I change it to e.g. `GridBagLayout` it seems to get smaller 9apply minsize to frame and try) | 0 |
11,411,097 | 07/10/2012 10:13:07 | 1,190,417 | 02/05/2012 09:16:52 | 58 | 1 | Cursor is moving too slowly in Xcode | I' using XCode 4.3.2. Moving the caret is so slow that it's forcing me to use the mouse when I need to reach a given location on the screen.
Other applications behave normally. Keyboard sensitivity is set to the maximum speed. In XCode, it takes 10 seconds to go down 70 lines; in TextEdit, it takes 2.5 seconds.
It looks like it is related to the contextual help.
Is it a known problem in XCode, and is there a way to solve it ? | osx | xcode4.3 | null | null | null | null | open | Cursor is moving too slowly in Xcode
===
I' using XCode 4.3.2. Moving the caret is so slow that it's forcing me to use the mouse when I need to reach a given location on the screen.
Other applications behave normally. Keyboard sensitivity is set to the maximum speed. In XCode, it takes 10 seconds to go down 70 lines; in TextEdit, it takes 2.5 seconds.
It looks like it is related to the contextual help.
Is it a known problem in XCode, and is there a way to solve it ? | 0 |
11,411,089 | 07/10/2012 10:12:22 | 855,680 | 07/21/2011 10:11:58 | 116 | 5 | How to change cursor color of EditText in API level 4? | I see a lot of working solutions for Android 3.2 and higher but my minimum target API level is 4 (Donut, 1.6) and using `android:textCursorDrawable` in an `EditText` just doesn't work. Any suggestions? | android | null | null | null | null | null | open | How to change cursor color of EditText in API level 4?
===
I see a lot of working solutions for Android 3.2 and higher but my minimum target API level is 4 (Donut, 1.6) and using `android:textCursorDrawable` in an `EditText` just doesn't work. Any suggestions? | 0 |
11,411,090 | 07/10/2012 10:12:27 | 391,345 | 07/14/2010 08:25:05 | 1,815 | 111 | Requirement Modelling for SAAS application | I need to create an SRS(Software Requirements Specifications) document for a SaaS application we are building. Are there any methodologies or SRS standards or any info on how to best describe such a SaaS application ?
How do you describe your SaaS applications ? requirement documents, application flow? Program flows ....
It's very hard to find good information about it.
Thanks in advance.
| documentation | saas | srs | null | null | null | open | Requirement Modelling for SAAS application
===
I need to create an SRS(Software Requirements Specifications) document for a SaaS application we are building. Are there any methodologies or SRS standards or any info on how to best describe such a SaaS application ?
How do you describe your SaaS applications ? requirement documents, application flow? Program flows ....
It's very hard to find good information about it.
Thanks in advance.
| 0 |
11,411,009 | 07/10/2012 10:08:15 | 1,302,569 | 03/30/2012 06:24:42 | 50 | 2 | Delete margins in webView | I have a problem with webView. As you can see on the picture there are white margins. I want to fill my screen that picture. How I can do that?
This is picture:
![enter image description here][1]
this is code:
WebView web = new WebView(getContext());
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setBuiltInZoomControls(true);
String imagePath = id;
String html = "<html><body><img src=\""+ imagePath + "\"></body></html>";
web.loadDataWithBaseURL("file:///mnt/sdcard/DinEgen/", html, "text/html","utf-8",null);
web.setPadding(0, 0, 0, 0);
web.setInitialScale(1);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setLoadWithOverviewMode(true);
web.getSettings().setUseWideViewPort(true);
web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
web.setScrollbarFadingEnabled(false);
[1]: http://i.stack.imgur.com/G5ptL.png | android | webview | null | null | null | null | open | Delete margins in webView
===
I have a problem with webView. As you can see on the picture there are white margins. I want to fill my screen that picture. How I can do that?
This is picture:
![enter image description here][1]
this is code:
WebView web = new WebView(getContext());
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setBuiltInZoomControls(true);
String imagePath = id;
String html = "<html><body><img src=\""+ imagePath + "\"></body></html>";
web.loadDataWithBaseURL("file:///mnt/sdcard/DinEgen/", html, "text/html","utf-8",null);
web.setPadding(0, 0, 0, 0);
web.setInitialScale(1);
web.getSettings().setJavaScriptEnabled(true);
web.getSettings().setLoadWithOverviewMode(true);
web.getSettings().setUseWideViewPort(true);
web.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
web.setScrollbarFadingEnabled(false);
[1]: http://i.stack.imgur.com/G5ptL.png | 0 |
11,411,010 | 07/10/2012 10:08:21 | 1,484,649 | 06/27/2012 05:48:47 | 6 | 0 | Is it possible to display IsolatedStorage path in silverlight5 | Could you please tell me is there any way to display Isolated-storage path using In-browser type silverlight5 application. | silverlight-5.0 | null | null | null | null | null | open | Is it possible to display IsolatedStorage path in silverlight5
===
Could you please tell me is there any way to display Isolated-storage path using In-browser type silverlight5 application. | 0 |
11,411,107 | 07/10/2012 10:13:43 | 1,514,367 | 07/10/2012 09:46:00 | 1 | 0 | Dynamic ActionExpression on Primefaces MenuItem inside a DataTable? |
I ran into a strange problem with ActionExpression on dynamic Primefaces MenuItems inside a DataTable - the action is never called...
The xhtml-code is:
<!-- language: lang-xml -->
<h:form id="form">
<p:menuButton value="Menu1" model="#{modelBuilder.menuModel1}" />
<p:dataTable value="#{sampleTable.searchResult}" var="entry">
<p:column>
<p:menuButton value="Menu2" model="#{modelBuilder.menuModel2}" />
</p:column>
</p:dataTable>
</h:form>
The Java-code is:
<!-- language: lang-java -->
@Named
public class ModelBuilder {
public MenuModel getMenuModel1() {
return buildModel("MenuItem1");
}
public MenuModel getMenuModel2() {
return buildModel("MenuItem2");
}
private MenuModel buildModel(String label) {
MenuModel result = new DefaultMenuModel();
MenuItem menuItem = new MenuItem();
menuItem.setValue(label);
menuItem.setId(label);
result.addMenuItem(menuItem);
menuItem.setActionExpression(buildActionExpression());
return result;
}
private MethodExpression buildActionExpression() {
FacesContext facesCtx = FacesContext.getCurrentInstance();
ELContext elCtx = facesCtx.getELContext();
ExpressionFactory expFact = facesCtx.getApplication().getExpressionFactory();
MethodExpression expr = expFact.createMethodExpression(elCtx, "#{modelBuilder.action()}", String.class,
new Class[0]);
return expr;
}
public String action() {
System.out.println("ActionCalled");
return null;
}
}
The first MenuItem outside the DataTable works as expected, the method "action()" is called, but the action on the second MenuItem inside the DataTable is not called...
PrimeFaces-Version: 3.3.1
Any ideas?
Thx in advance! | jsf-2.0 | primefaces | null | null | null | null | open | Dynamic ActionExpression on Primefaces MenuItem inside a DataTable?
===
I ran into a strange problem with ActionExpression on dynamic Primefaces MenuItems inside a DataTable - the action is never called...
The xhtml-code is:
<!-- language: lang-xml -->
<h:form id="form">
<p:menuButton value="Menu1" model="#{modelBuilder.menuModel1}" />
<p:dataTable value="#{sampleTable.searchResult}" var="entry">
<p:column>
<p:menuButton value="Menu2" model="#{modelBuilder.menuModel2}" />
</p:column>
</p:dataTable>
</h:form>
The Java-code is:
<!-- language: lang-java -->
@Named
public class ModelBuilder {
public MenuModel getMenuModel1() {
return buildModel("MenuItem1");
}
public MenuModel getMenuModel2() {
return buildModel("MenuItem2");
}
private MenuModel buildModel(String label) {
MenuModel result = new DefaultMenuModel();
MenuItem menuItem = new MenuItem();
menuItem.setValue(label);
menuItem.setId(label);
result.addMenuItem(menuItem);
menuItem.setActionExpression(buildActionExpression());
return result;
}
private MethodExpression buildActionExpression() {
FacesContext facesCtx = FacesContext.getCurrentInstance();
ELContext elCtx = facesCtx.getELContext();
ExpressionFactory expFact = facesCtx.getApplication().getExpressionFactory();
MethodExpression expr = expFact.createMethodExpression(elCtx, "#{modelBuilder.action()}", String.class,
new Class[0]);
return expr;
}
public String action() {
System.out.println("ActionCalled");
return null;
}
}
The first MenuItem outside the DataTable works as expected, the method "action()" is called, but the action on the second MenuItem inside the DataTable is not called...
PrimeFaces-Version: 3.3.1
Any ideas?
Thx in advance! | 0 |
11,373,447 | 07/07/2012 08:16:43 | 1,492,679 | 06/30/2012 07:04:14 | 23 | 2 | How to Save all edited-situations and resume all the situations from the last time when opening Emacs again | I learned that to add those codes in .emacs can make Emacs saves automatically all situations before quitting and start it next time, Emacs can show the last situation and go on editing it.
(load "desktop")
(desktop-load-default)
(desktop-read)
(add-hook 'kill-emacs-hook
'(lambda()(desktop-save "~/")))
but this codes makes a problem that you only can open one Emacs, when you want to start another Emacs at the same time, only the previous one can run.
I want the function saving all situations for the next use, but I also need to start one more Emacs, How can I get the two sides work simultaneously?
Thank you for your help. I am waiting...... | emacs | elisp | null | null | null | null | open | How to Save all edited-situations and resume all the situations from the last time when opening Emacs again
===
I learned that to add those codes in .emacs can make Emacs saves automatically all situations before quitting and start it next time, Emacs can show the last situation and go on editing it.
(load "desktop")
(desktop-load-default)
(desktop-read)
(add-hook 'kill-emacs-hook
'(lambda()(desktop-save "~/")))
but this codes makes a problem that you only can open one Emacs, when you want to start another Emacs at the same time, only the previous one can run.
I want the function saving all situations for the next use, but I also need to start one more Emacs, How can I get the two sides work simultaneously?
Thank you for your help. I am waiting...... | 0 |
11,373,452 | 07/07/2012 08:18:06 | 313,389 | 04/10/2010 08:52:41 | 1,330 | 14 | Is it possible to show a special category's new post in wordpress? | I want to display the new posts with these conditions:
a) if the page is a category list page, display only new posts of that category.
b) if the page is a post page,display only new posts of that post category.
Is it possible? Is there any plugin doing this ? | wordpress | wordpress-plugin | null | null | null | 07/31/2012 12:56:18 | not a real question | Is it possible to show a special category's new post in wordpress?
===
I want to display the new posts with these conditions:
a) if the page is a category list page, display only new posts of that category.
b) if the page is a post page,display only new posts of that post category.
Is it possible? Is there any plugin doing this ? | 1 |
11,373,453 | 07/07/2012 08:18:11 | 384,706 | 07/06/2010 15:28:06 | 9,338 | 493 | How does LCP help in finding the number of occurences of a pattern? | I have read that the `Longest Common Prefix -LCP` could be used to find the number of occurences of a pattern in a string.
Specifically, you just need to create the suffix array of the text, sort it, and then instead of doing binary search to find the range so that you can figure out the number of occurences, you just compute the `LCP` for each succesive entry in the suffix array.
Although using a binary search to find the number of occurences of a pattern is obvious I can't figure out how the `LCP` helps find the number of occurences here.
For example for this suffix array for "banana":
LCP Suffix entry
N/A, a
1 , ana
3 , anana
0 , banana
0 , na
2 , nana
how does the `LCP` help to find the number of occurences of "banana" or "na" is not obvious to me.
Any help figuring how `LCP` helps here? | algorithm | data-structures | pattern-matching | prefix | suffix-array | null | open | How does LCP help in finding the number of occurences of a pattern?
===
I have read that the `Longest Common Prefix -LCP` could be used to find the number of occurences of a pattern in a string.
Specifically, you just need to create the suffix array of the text, sort it, and then instead of doing binary search to find the range so that you can figure out the number of occurences, you just compute the `LCP` for each succesive entry in the suffix array.
Although using a binary search to find the number of occurences of a pattern is obvious I can't figure out how the `LCP` helps find the number of occurences here.
For example for this suffix array for "banana":
LCP Suffix entry
N/A, a
1 , ana
3 , anana
0 , banana
0 , na
2 , nana
how does the `LCP` help to find the number of occurences of "banana" or "na" is not obvious to me.
Any help figuring how `LCP` helps here? | 0 |
11,373,475 | 07/07/2012 08:21:27 | 1,122,359 | 12/30/2011 05:15:28 | 32 | 1 | Android: Assigning Values to a TextView from a different class | TestaActivity.java
public class TestaActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tvText=(TextView)findViewById(R.id.textView1);
tvText.setText("Sample");
}
}
Print.java
public class Print {
public Print(Context tempContext) {
//I want to assign the value to the tvText from here
}
}
In the above example, as you can see I have set the text in tvText to "Sample". In the same way, I need to assign the textView1 ID with some value inside Print class, once it is created.
Please help me to figure out the way to do it. Thank you for your time! | android | class | android-layout | context | settext | null | open | Android: Assigning Values to a TextView from a different class
===
TestaActivity.java
public class TestaActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tvText=(TextView)findViewById(R.id.textView1);
tvText.setText("Sample");
}
}
Print.java
public class Print {
public Print(Context tempContext) {
//I want to assign the value to the tvText from here
}
}
In the above example, as you can see I have set the text in tvText to "Sample". In the same way, I need to assign the textView1 ID with some value inside Print class, once it is created.
Please help me to figure out the way to do it. Thank you for your time! | 0 |
11,373,476 | 07/07/2012 08:21:40 | 398,706 | 07/22/2010 04:31:26 | 868 | 29 | Anchor UILabel to the Right when resizing inside UITableViewCell? | I have a label inside my UITableViewCell. I have set it up in Interface Builder with it's maximum width. After I have set the text on the label I am resizing it using "SizeToFit".
The problem I am having is that when I resize the label it resizes fixed to the left of it's original position.
I want to resize it to the right of it's original position so that it is anchored to the right.
How can I do this?
| objective-c | monotouch | null | null | null | null | open | Anchor UILabel to the Right when resizing inside UITableViewCell?
===
I have a label inside my UITableViewCell. I have set it up in Interface Builder with it's maximum width. After I have set the text on the label I am resizing it using "SizeToFit".
The problem I am having is that when I resize the label it resizes fixed to the left of it's original position.
I want to resize it to the right of it's original position so that it is anchored to the right.
How can I do this?
| 0 |
11,373,419 | 07/07/2012 08:09:45 | 736,519 | 05/03/2011 16:16:49 | 23 | 0 | Mapping UNC path on iis7 | I have a server with IIS 7 and a server with IIS6.
On the IIS6 server there is some data(images) which i would like to access as a virtual directory on the IIS7 server.
I have created a users on each server with the same username and password.
And when im mapping the drive in iis7 it works but when im browsing the files i get :
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\\10.0.50.2\MaskinWeb' because access is denied.
Source File: \\10.0.50.2\MaskinWeb\web.config Line: 0
What am i doing wrong ?
| iis7 | iis6 | unc | null | null | null | open | Mapping UNC path on iis7
===
I have a server with IIS 7 and a server with IIS6.
On the IIS6 server there is some data(images) which i would like to access as a virtual directory on the IIS7 server.
I have created a users on each server with the same username and password.
And when im mapping the drive in iis7 it works but when im browsing the files i get :
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: An error occurred loading a configuration file: Failed to start monitoring changes to '\\10.0.50.2\MaskinWeb' because access is denied.
Source File: \\10.0.50.2\MaskinWeb\web.config Line: 0
What am i doing wrong ?
| 0 |
11,373,481 | 07/07/2012 08:23:24 | 805,787 | 06/19/2011 22:24:50 | 475 | 22 | Social media buttons validation problems | When you add social media buttons to your site from Google+, Facebook, LinkedIn etc., they often contain a lot of homemade attributes and other things that don't validate.
I have fourteen errors on [this page in the validator][1] just because of social buttons.
Are there any tricks to make the page validate?
[1]: http://validator.w3.org/check?uri=http://www.eosweb.dk/om/&charset=%28detect%20automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator/1.3 | facebook | validation | linkedin | google-plus | social-media | null | open | Social media buttons validation problems
===
When you add social media buttons to your site from Google+, Facebook, LinkedIn etc., they often contain a lot of homemade attributes and other things that don't validate.
I have fourteen errors on [this page in the validator][1] just because of social buttons.
Are there any tricks to make the page validate?
[1]: http://validator.w3.org/check?uri=http://www.eosweb.dk/om/&charset=%28detect%20automatically%29&doctype=Inline&group=0&user-agent=W3C_Validator/1.3 | 0 |
11,500,103 | 07/16/2012 07:49:25 | 1,150,534 | 01/15/2012 15:48:17 | 170 | 2 | Bootstrap Footer | I have been looking at various examples of Sticky Footers to use in bootstrap, but cant see how they would fit into my current markup, for example I have a page that looks like this
<div class="container">
<div class="row">
<div class="span8 offset2">
<h1 class="ourservices">Registered Care</h1>
<img class="services" src="/assets/woodsidesign.jpg" alt="" align="left">
<p class="ourservices">We have three registered homes - two in Newport, South Wales, Ty Newydd and Woodside, which are registered with CSSIW, and one in Weston Super Mare, Sandpiper, registered with the Care Quality Commission in England.Woodside is registered for six service users and currently has two vacancies.<br />
<br>
This is an exciting new development which offers care and accommodation for up to six younger adults with learning disabilities; autistic spectrum disorder; mental health needs or acquired brain injury.</p>
</div><!--End of span8 offset2-->
</div><!--End of Row-->
</div><!-- End Of Container-->
<div class="container">
<div class="row">
<div class="span12">
<ul class="footer">
<li>Website built by <a href="#">foo</a></li>
<li>Email:[email protected]</li>
<ul>
</div>
</div>
</div>
What I would like to do is have the footer position it self at the bottom of the browser window rather than appear half way up the page
The css i am using is
ul.footer{
margin-top:10px;
text-align:center;
}
ul.footer li{
color:#333;
display:inline-block;
}
Real simple stuff I know.. So my question is "How do i get the footer to stick to the bottom of the page if the content is not as much as the browser window"
Any help appreciated | css | twitter-bootstrap | null | null | null | null | open | Bootstrap Footer
===
I have been looking at various examples of Sticky Footers to use in bootstrap, but cant see how they would fit into my current markup, for example I have a page that looks like this
<div class="container">
<div class="row">
<div class="span8 offset2">
<h1 class="ourservices">Registered Care</h1>
<img class="services" src="/assets/woodsidesign.jpg" alt="" align="left">
<p class="ourservices">We have three registered homes - two in Newport, South Wales, Ty Newydd and Woodside, which are registered with CSSIW, and one in Weston Super Mare, Sandpiper, registered with the Care Quality Commission in England.Woodside is registered for six service users and currently has two vacancies.<br />
<br>
This is an exciting new development which offers care and accommodation for up to six younger adults with learning disabilities; autistic spectrum disorder; mental health needs or acquired brain injury.</p>
</div><!--End of span8 offset2-->
</div><!--End of Row-->
</div><!-- End Of Container-->
<div class="container">
<div class="row">
<div class="span12">
<ul class="footer">
<li>Website built by <a href="#">foo</a></li>
<li>Email:[email protected]</li>
<ul>
</div>
</div>
</div>
What I would like to do is have the footer position it self at the bottom of the browser window rather than appear half way up the page
The css i am using is
ul.footer{
margin-top:10px;
text-align:center;
}
ul.footer li{
color:#333;
display:inline-block;
}
Real simple stuff I know.. So my question is "How do i get the footer to stick to the bottom of the page if the content is not as much as the browser window"
Any help appreciated | 0 |
11,500,110 | 07/16/2012 07:49:45 | 526,582 | 12/01/2010 13:14:48 | 3,419 | 155 | CMMotionManager attitude.yaw not calibrated with magnetic noth | I'm kicking of a CMMotionManager to give me a rotation matrix (i read the euler values) for displaying a AR like 3dmode.
[self.motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical toQueue:self.queue
withHandler:^(CMDeviceMotion *motion, NSError *error)
{
self.currentAttitude = motion.attitude;
printf("%f\t%f\n", motion.attitude.yaw,motion.magneticField.field.z);
}];
When reading motion.attitude.yaw, it's always calibrated to the device rotation i had when initializing the CMMotionManager.
The motion.magneticField.field.z shows the correct value (always the same value even when i initialize the CMMotionManager with a different device rotation).
How does this come?
Are the euler angles from CMAttitude not calculated agains the reference frame?
Any ideas how i get the euler angles calibrated to north?
| iphone | ios | opengl-es | core-motion | null | null | open | CMMotionManager attitude.yaw not calibrated with magnetic noth
===
I'm kicking of a CMMotionManager to give me a rotation matrix (i read the euler values) for displaying a AR like 3dmode.
[self.motionManager startDeviceMotionUpdatesUsingReferenceFrame:CMAttitudeReferenceFrameXMagneticNorthZVertical toQueue:self.queue
withHandler:^(CMDeviceMotion *motion, NSError *error)
{
self.currentAttitude = motion.attitude;
printf("%f\t%f\n", motion.attitude.yaw,motion.magneticField.field.z);
}];
When reading motion.attitude.yaw, it's always calibrated to the device rotation i had when initializing the CMMotionManager.
The motion.magneticField.field.z shows the correct value (always the same value even when i initialize the CMMotionManager with a different device rotation).
How does this come?
Are the euler angles from CMAttitude not calculated agains the reference frame?
Any ideas how i get the euler angles calibrated to north?
| 0 |
11,500,112 | 07/16/2012 07:49:47 | 251,304 | 01/08/2010 15:08:23 | 1,457 | 72 | Rotate sprite image according to user touch location? | I m start learning game development. As a beginner i create one demo game in which one cannon hit bullets to the enemies (coming toward cannon from different direction).
Now i stuck on cannon sprite image rotation anywhere user touch on the screen or enemies. How i do that, My initial code as following,
void HelloWorld:: ccTouchesBegan(CCSet *touches, CCEvent * event){
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCTouch* touch = (CCTouch*)( touches->anyObject() );
CCPoint location = touch->locationInView(touch->view());
location = CCDirector::sharedDirector()->convertToGL(location);
//Rotate cannon direction toward touch point
CCPoint diffPoint = ccpSub(_cannonImage->getPosition(), location);
float angleRadians = atanf((float)diffPoint.y/(float)diffPoint.x);
float angleOffset = CC_DEGREES_TO_RADIANS(180);
if(diffPoint.x < 0){
angleRadians += angleOffset;
}else{
angleRadians -= angleOffset;
}
CCLog("angle to be rotate = %f", angleRadians);
_cannonImage->runAction(CCRotateBy::actionWithDuration(0.1, angleRadians));
}
The code is written in cocos2d-x . I also accepting answer by someone who written in plain cocos2d.
Thanks
iHungry | iphone | ios | cocos2d-iphone | cocos2d-x | null | null | open | Rotate sprite image according to user touch location?
===
I m start learning game development. As a beginner i create one demo game in which one cannon hit bullets to the enemies (coming toward cannon from different direction).
Now i stuck on cannon sprite image rotation anywhere user touch on the screen or enemies. How i do that, My initial code as following,
void HelloWorld:: ccTouchesBegan(CCSet *touches, CCEvent * event){
CCSize winSize = CCDirector::sharedDirector()->getWinSize();
CCTouch* touch = (CCTouch*)( touches->anyObject() );
CCPoint location = touch->locationInView(touch->view());
location = CCDirector::sharedDirector()->convertToGL(location);
//Rotate cannon direction toward touch point
CCPoint diffPoint = ccpSub(_cannonImage->getPosition(), location);
float angleRadians = atanf((float)diffPoint.y/(float)diffPoint.x);
float angleOffset = CC_DEGREES_TO_RADIANS(180);
if(diffPoint.x < 0){
angleRadians += angleOffset;
}else{
angleRadians -= angleOffset;
}
CCLog("angle to be rotate = %f", angleRadians);
_cannonImage->runAction(CCRotateBy::actionWithDuration(0.1, angleRadians));
}
The code is written in cocos2d-x . I also accepting answer by someone who written in plain cocos2d.
Thanks
iHungry | 0 |
11,499,940 | 07/16/2012 07:36:57 | 239,610 | 12/07/2009 07:09:03 | 28 | 5 | Set dynamic ConnectionString Entity Framework | I developed Asp.net application with Entity Framework and now i need to change entity connection string at run time.I tried following way.
public class DataLayer(){
static DataLayer()
{
((EntityConnection)_dbEntity.Connection).StoreConnection.ConnectionString = GetConnectionString();
//GetConnectonString() returns "user id=xxxx;password=xxxx;database=xxxx;server=xxx.xxx.xx.xx"
}
static DBContext _dpEntity = new DBContext();
//other codes
}
And I checked following too.Still I couldn't change it.
http://msdn.microsoft.com/en-us/library/bb738533(v=vs.90).aspx
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/8a89a728-6c8d-4734-98cb-11b196ba11fd
| asp.net | entity-framework | c#-4.0 | null | null | null | open | Set dynamic ConnectionString Entity Framework
===
I developed Asp.net application with Entity Framework and now i need to change entity connection string at run time.I tried following way.
public class DataLayer(){
static DataLayer()
{
((EntityConnection)_dbEntity.Connection).StoreConnection.ConnectionString = GetConnectionString();
//GetConnectonString() returns "user id=xxxx;password=xxxx;database=xxxx;server=xxx.xxx.xx.xx"
}
static DBContext _dpEntity = new DBContext();
//other codes
}
And I checked following too.Still I couldn't change it.
http://msdn.microsoft.com/en-us/library/bb738533(v=vs.90).aspx
http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/8a89a728-6c8d-4734-98cb-11b196ba11fd
| 0 |
11,499,941 | 07/16/2012 07:37:00 | 1,276,891 | 03/18/2012 12:43:26 | 8 | 0 | I am having difficulties run Tcl script | I have started learning TCL scripting language. I use ActivateState Tcl Devkit 5.3.0.
When I create new simulator it gives mistake like this "invalid command name "new" while executing "new Simulator" invoked from within "set ns [new Simulator]""
| tcl | null | null | null | null | null | open | I am having difficulties run Tcl script
===
I have started learning TCL scripting language. I use ActivateState Tcl Devkit 5.3.0.
When I create new simulator it gives mistake like this "invalid command name "new" while executing "new Simulator" invoked from within "set ns [new Simulator]""
| 0 |
11,500,114 | 07/16/2012 07:49:53 | 1,528,196 | 07/16/2012 07:46:09 | 1 | 0 | How to send data to php from iPhone? | I have some data, like 2~selected books 3~selected pens.
I would like to insert this data from my iPhone app into php server. I just need to insert all these data into the corresponding tables.
How do I do this, thanks in advance.
| php | iphone | http | ios5 | null | 07/16/2012 14:58:15 | not a real question | How to send data to php from iPhone?
===
I have some data, like 2~selected books 3~selected pens.
I would like to insert this data from my iPhone app into php server. I just need to insert all these data into the corresponding tables.
How do I do this, thanks in advance.
| 1 |
11,500,116 | 07/16/2012 07:50:03 | 312,725 | 04/09/2010 11:37:00 | 486 | 5 | Can Unity be successfully mixed with Cocos2d project? | Since it's a very high-level and big question, I'll be thankful just for some useful links. | iphone | ios | xcode | cocos2d | unity3d | null | open | Can Unity be successfully mixed with Cocos2d project?
===
Since it's a very high-level and big question, I'll be thankful just for some useful links. | 0 |
11,500,119 | 07/16/2012 07:50:23 | 1,517,376 | 07/11/2012 09:54:08 | 1 | 0 | c# loop every minute - where to put the code? | Currently I'm moving from java to c# and I'm full of crazy questions.
I'm trying new things on a windows form application and now,I would like to create a loop wich is executing a code every 1 minute,the problem is that I have no idea where to put this code.
For example,the form structure is like:
using System;
namespace Tray_Icon
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
notifyIcon1.ShowBalloonTip(5000);
}
private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e)
{
label1.Text = "Baloon clicked!";
}
private void notifyIcon1_BalloonTipClosed(object sender, EventArgs e)
{
label1.Text = "baloon closed!";
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
}
private void option1ToolStripMenuItem_Click(object sender, EventArgs e)
{
//some code here
}
private void option2ToolStripMenuItem_Click(object sender, EventArgs e)
{
//some code here
}
private void option3ToolStripMenuItem_Click(object sender, EventArgs e)
{
label1.Text = "Option 3 clicked!";
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
option1ToolStripMenuItem_Click(this, null);
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnWrite_Click(object sender, EventArgs e)
{
//code here
}
}
}
Where should I put the loop code? :(
Thanks in advance for ANY replay!!! | c# | null | null | null | null | null | open | c# loop every minute - where to put the code?
===
Currently I'm moving from java to c# and I'm full of crazy questions.
I'm trying new things on a windows form application and now,I would like to create a loop wich is executing a code every 1 minute,the problem is that I have no idea where to put this code.
For example,the form structure is like:
using System;
namespace Tray_Icon
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
notifyIcon1.ShowBalloonTip(5000);
}
private void notifyIcon1_BalloonTipClicked(object sender, EventArgs e)
{
label1.Text = "Baloon clicked!";
}
private void notifyIcon1_BalloonTipClosed(object sender, EventArgs e)
{
label1.Text = "baloon closed!";
}
private void contextMenuStrip1_Opening(object sender, CancelEventArgs e)
{
}
private void option1ToolStripMenuItem_Click(object sender, EventArgs e)
{
//some code here
}
private void option2ToolStripMenuItem_Click(object sender, EventArgs e)
{
//some code here
}
private void option3ToolStripMenuItem_Click(object sender, EventArgs e)
{
label1.Text = "Option 3 clicked!";
}
private void notifyIcon1_MouseDoubleClick(object sender, MouseEventArgs e)
{
option1ToolStripMenuItem_Click(this, null);
}
private void closeToolStripMenuItem_Click(object sender, EventArgs e)
{
this.Close();
}
private void btnWrite_Click(object sender, EventArgs e)
{
//code here
}
}
}
Where should I put the loop code? :(
Thanks in advance for ANY replay!!! | 0 |
11,500,054 | 07/16/2012 07:46:31 | 1,528,175 | 07/16/2012 07:32:27 | 1 | 0 | While adding multiple web user control, an error occurs..Only one instance of a ScriptManager can be added to the page | i have created a user control "Calendar" of ajax date extender along with a text box for taking the date. Now im trying to create this control dynamically for all the rows populating in my table. Its gives the following error :-
Only one instance of a ScriptManager can be added to the page.
here's the code :-
tc = new TableCell();
tc.Style["width"] = "15%";
Calendar1 = (ASP.Calendar)LoadControl("../Calendar.ascx");
Calendar1.ID = "tbDate" + Convert.ToString(_id);
tc.Controls.Add(Calendar1);
tr.Cells.Add(tc);
tc.Dispose();
tc = null;
And i've declared a global variable :- public ASP.Calendar Calendar1;
Thanks in advance for ur suggestions | asp.net | null | null | null | null | null | open | While adding multiple web user control, an error occurs..Only one instance of a ScriptManager can be added to the page
===
i have created a user control "Calendar" of ajax date extender along with a text box for taking the date. Now im trying to create this control dynamically for all the rows populating in my table. Its gives the following error :-
Only one instance of a ScriptManager can be added to the page.
here's the code :-
tc = new TableCell();
tc.Style["width"] = "15%";
Calendar1 = (ASP.Calendar)LoadControl("../Calendar.ascx");
Calendar1.ID = "tbDate" + Convert.ToString(_id);
tc.Controls.Add(Calendar1);
tr.Cells.Add(tc);
tc.Dispose();
tc = null;
And i've declared a global variable :- public ASP.Calendar Calendar1;
Thanks in advance for ur suggestions | 0 |
11,500,055 | 07/16/2012 07:46:33 | 1,497,804 | 07/03/2012 05:34:42 | 46 | 1 | How can we implement drag and drop feature in html5 | Hello everyone please suggest me how to implement drag and drop feature inside CANVAS of html5 using kineticJS it drag and dropped object should be able to display the id of the object. | html5 | null | null | null | null | null | open | How can we implement drag and drop feature in html5
===
Hello everyone please suggest me how to implement drag and drop feature inside CANVAS of html5 using kineticJS it drag and dropped object should be able to display the id of the object. | 0 |
11,500,057 | 07/16/2012 07:46:39 | 1,379,734 | 05/07/2012 12:29:51 | 43 | 9 | choosing web framework for social network site | i will start a new website project, but i cant choose which web framework i must use. The website is about social network(like facebook,myspace) and it wont be simple. I want to use NoSql database for my project(Mongodb or Couchdb). Some people says "you must use graph database(especially Neo4J) to your website". First question is What are the disadvantages of Mongodb over Neo4J?
Actually Play framework and GWT are very popular in these days.I used GWT but i dont know anything about Play framework. Has anyone used Play before? What are the advantages and disadvantages? If you have any other suggestions please let me know.
By the way i know java,c#. | java | gwt | mongodb | playframework | neo4j | 07/16/2012 07:58:50 | not a real question | choosing web framework for social network site
===
i will start a new website project, but i cant choose which web framework i must use. The website is about social network(like facebook,myspace) and it wont be simple. I want to use NoSql database for my project(Mongodb or Couchdb). Some people says "you must use graph database(especially Neo4J) to your website". First question is What are the disadvantages of Mongodb over Neo4J?
Actually Play framework and GWT are very popular in these days.I used GWT but i dont know anything about Play framework. Has anyone used Play before? What are the advantages and disadvantages? If you have any other suggestions please let me know.
By the way i know java,c#. | 1 |
11,734,681 | 07/31/2012 06:52:50 | 1,564,918 | 07/31/2012 06:49:39 | 1 | 0 | How to get ISBN number from a book title and author programmatically? php | i want know Is there a way to get ISBN number from the title of the book and author programmatically using php. Please let me know Does Google Books provide any service for that?
And how can we use that?
--Thank You | php | null | null | null | null | null | open | How to get ISBN number from a book title and author programmatically? php
===
i want know Is there a way to get ISBN number from the title of the book and author programmatically using php. Please let me know Does Google Books provide any service for that?
And how can we use that?
--Thank You | 0 |
11,734,682 | 07/31/2012 06:52:54 | 470,760 | 01/16/2010 00:26:05 | 1,086 | 21 | Play VLC Stream in C# | I am using various methods of getting Live TV on my Media Center PC's in the house, such as network based HD tv tuners, various websites that provide RTSP/RTMP streams, etc. I decided to write an application in C# that would mimic the TV Guide provided by Cable, and the best solution I found was the VLC API.
However, for some reason I cannot get Streams to work that have spaces in the name. Apparently this was something previous versions of VLC worked with, but is considered a malformed URL now. I tried replacing the spaces with %20, but this did not work either, in my C# application or in VLC.
The stream I am using to test is the following, although the %20 and escape strings have been removed for readability...
rtmp://media2.lsops.net/live/ playpath=aljazeer_en_high.sdp swfUrl="http://www.livestation.com/flash/player/5.4/player.swf" pageUrl="http://www.livestation.com/channels/66-cnn-international" swfVfy=true live=true timeout=10
Does anyone have any thoughts of how I may be able to get this to work? | c# | video-streaming | rtmp | libvlc | rtsp-client | null | open | Play VLC Stream in C#
===
I am using various methods of getting Live TV on my Media Center PC's in the house, such as network based HD tv tuners, various websites that provide RTSP/RTMP streams, etc. I decided to write an application in C# that would mimic the TV Guide provided by Cable, and the best solution I found was the VLC API.
However, for some reason I cannot get Streams to work that have spaces in the name. Apparently this was something previous versions of VLC worked with, but is considered a malformed URL now. I tried replacing the spaces with %20, but this did not work either, in my C# application or in VLC.
The stream I am using to test is the following, although the %20 and escape strings have been removed for readability...
rtmp://media2.lsops.net/live/ playpath=aljazeer_en_high.sdp swfUrl="http://www.livestation.com/flash/player/5.4/player.swf" pageUrl="http://www.livestation.com/channels/66-cnn-international" swfVfy=true live=true timeout=10
Does anyone have any thoughts of how I may be able to get this to work? | 0 |
11,734,683 | 07/31/2012 06:52:53 | 1,545,217 | 07/23/2012 07:27:50 | 14 | 0 | How to add Item in Dropdown list in cs file | **This is my CS file for dropdown:**
protected void BindDropDownList()
{
DataTable dt = new DataTable();
string connString = System.Configuration.ConfigurationManager.AppSettings["EyeProject"];
SqlConnection conn = new SqlConnection(connString);
try
{
conn.Open();
string sqlStatement = "SELECT FirstName FROM tbl_UserDetails";
SqlCommand sqlCmd = new SqlCommand(sqlStatement, conn);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
sqlDa.Fill(dt);
if (dt.Rows.Count > 0)
{
DropDownList1.DataSource =dt;
DropDownList1.DataTextField = "FirstName"; // the items to be displayed in the list items
DropDownList1.DataBind();
}
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "No Data Found To display in the DropDown List";
msg += ex.Message;
throw new Exception(msg);
}
finally
{
conn.Close();
}
}
By using this one iam getting values of table Firstname values now i want to add one more item Called ALLrecords.
How can i add it.
this is my Aspx file
<div class="label">
Select Name:
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</div>
| c# | asp.net | sql-server-2008 | null | null | null | open | How to add Item in Dropdown list in cs file
===
**This is my CS file for dropdown:**
protected void BindDropDownList()
{
DataTable dt = new DataTable();
string connString = System.Configuration.ConfigurationManager.AppSettings["EyeProject"];
SqlConnection conn = new SqlConnection(connString);
try
{
conn.Open();
string sqlStatement = "SELECT FirstName FROM tbl_UserDetails";
SqlCommand sqlCmd = new SqlCommand(sqlStatement, conn);
SqlDataAdapter sqlDa = new SqlDataAdapter(sqlCmd);
sqlDa.Fill(dt);
if (dt.Rows.Count > 0)
{
DropDownList1.DataSource =dt;
DropDownList1.DataTextField = "FirstName"; // the items to be displayed in the list items
DropDownList1.DataBind();
}
}
catch (System.Data.SqlClient.SqlException ex)
{
string msg = "No Data Found To display in the DropDown List";
msg += ex.Message;
throw new Exception(msg);
}
finally
{
conn.Close();
}
}
By using this one iam getting values of table Firstname values now i want to add one more item Called ALLrecords.
How can i add it.
this is my Aspx file
<div class="label">
Select Name:
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList>
</div>
| 0 |
11,734,686 | 07/31/2012 06:53:09 | 770,103 | 05/25/2011 18:14:34 | 27 | 1 | How to upload file by giving a path in url? [Play framework] | Is it possible to upload a file in Play! framework only by giving a path in url?
For example I would like to call:
www.mywebsite.com/upload_PATH
It's for me quite important, because I would like to upload and process a lot of data. Selecting manually 1000 files is too much time consuming and I want to write a program which will make it for me :-) I'm using Play with Java. | java | playframework | playframework-2.0 | null | null | null | open | How to upload file by giving a path in url? [Play framework]
===
Is it possible to upload a file in Play! framework only by giving a path in url?
For example I would like to call:
www.mywebsite.com/upload_PATH
It's for me quite important, because I would like to upload and process a lot of data. Selecting manually 1000 files is too much time consuming and I want to write a program which will make it for me :-) I'm using Play with Java. | 0 |
11,734,637 | 07/31/2012 06:50:46 | 1,929 | 08/19/2008 14:25:01 | 1,305 | 14 | "Stop running the script error" in IE8 with large collection | While fetching quite a large Backbone collection from a REST service with IE8 I encounter a "A script on this page is causing Internet Explorer to run slowly" warning message.
I have around 25 properties of 4000 items (this is an intranet app, I do paging client side).
All the other browsers (IE9 too) work perfectly.
The warning appears when the received rest array is mapped to the collection of models after a fetch to the server.
This message appears as IE8 has [a limit of around 5 million operations][1] and it shows an annoying warning message when it reaches it.
I don't know how I can reach this limit with what it appears to me not a really huge amount of data.
I've learned that this limit can be increased by manipulating the windows registry on the client or with a [patch][2] Microsoft provides.
A more elegant solution is to use a workaround as described [here][3] that will insert a setTimeout on long running operation resetting the operation counter in IE8.
Now after the successful fetch of the data, backbone calls the parse method that will use internally the underscore.js map function.
I'd like to apply the workaround code without touching the underscore.js or backbone.js source code. Is this possible?
[1]: http://stackoverflow.com/a/2345724/1929
[2]: http://support.microsoft.com/kb/175500
[3]: http://www.picnet.com.au/blogs/Guido/post/2010/03/04/How-to-prevent-Stop-running-this-script-message-in-browsers | backbone.js | internet-explorer-8 | underscore.js | null | null | null | open | "Stop running the script error" in IE8 with large collection
===
While fetching quite a large Backbone collection from a REST service with IE8 I encounter a "A script on this page is causing Internet Explorer to run slowly" warning message.
I have around 25 properties of 4000 items (this is an intranet app, I do paging client side).
All the other browsers (IE9 too) work perfectly.
The warning appears when the received rest array is mapped to the collection of models after a fetch to the server.
This message appears as IE8 has [a limit of around 5 million operations][1] and it shows an annoying warning message when it reaches it.
I don't know how I can reach this limit with what it appears to me not a really huge amount of data.
I've learned that this limit can be increased by manipulating the windows registry on the client or with a [patch][2] Microsoft provides.
A more elegant solution is to use a workaround as described [here][3] that will insert a setTimeout on long running operation resetting the operation counter in IE8.
Now after the successful fetch of the data, backbone calls the parse method that will use internally the underscore.js map function.
I'd like to apply the workaround code without touching the underscore.js or backbone.js source code. Is this possible?
[1]: http://stackoverflow.com/a/2345724/1929
[2]: http://support.microsoft.com/kb/175500
[3]: http://www.picnet.com.au/blogs/Guido/post/2010/03/04/How-to-prevent-Stop-running-this-script-message-in-browsers | 0 |
11,734,672 | 07/31/2012 06:52:25 | 372,981 | 06/22/2010 09:15:51 | 334 | 6 | Psych YAML parsing including comments | According to http://yaml.org/spec/current.html#id2509980 comments in YAML files are a presentational detail and must not be in the serialization/representation graph (http://yaml.org/spec/current.html#representation/). It looks like Psych is parsing according to spec and loses the comments which means that it is not possible to parse a YAML file and serialize it again exactly the same way when the file contains comments. Which in my opinion is very strange because comments do matter in such file (e.g. configs).
Does anyone know if it possible to parse comments with an existing library or is the only way to go to do it all by myself? | ruby | yaml | psych | null | null | null | open | Psych YAML parsing including comments
===
According to http://yaml.org/spec/current.html#id2509980 comments in YAML files are a presentational detail and must not be in the serialization/representation graph (http://yaml.org/spec/current.html#representation/). It looks like Psych is parsing according to spec and loses the comments which means that it is not possible to parse a YAML file and serialize it again exactly the same way when the file contains comments. Which in my opinion is very strange because comments do matter in such file (e.g. configs).
Does anyone know if it possible to parse comments with an existing library or is the only way to go to do it all by myself? | 0 |
11,734,674 | 07/31/2012 06:52:35 | 1,423,586 | 05/29/2012 11:40:32 | 50 | 0 | How can I decide css class name dynamically in PHP ? | I want to decide a css class dynamically using ternary operator in PHP,I'm using following code but its some error
echo '<div '.count($photos) > 1 ? "class='slider'" : "class='image'".'>';
what's wrong in above code ? | php | ternary-operator | null | null | null | null | open | How can I decide css class name dynamically in PHP ?
===
I want to decide a css class dynamically using ternary operator in PHP,I'm using following code but its some error
echo '<div '.count($photos) > 1 ? "class='slider'" : "class='image'".'>';
what's wrong in above code ? | 0 |
11,734,689 | 07/31/2012 06:53:35 | 1,564,903 | 07/31/2012 06:44:14 | 1 | 0 | Can I reorder the steps of checkout page in opencart | Can I reorder the steps of checkout page in opencart.
Like <br>
**step 1** Login<br>
**step 2** Delivery method<br>
**step 3** if user choose Pickup, than show Payment tab, otherwise show Billing detail and Shipping Detail<br>
**step 4** Payment method<br>
**step 5** Confirm
Please Reply me fast
Thanks | opencart | null | null | null | null | 08/01/2012 02:07:38 | off topic | Can I reorder the steps of checkout page in opencart
===
Can I reorder the steps of checkout page in opencart.
Like <br>
**step 1** Login<br>
**step 2** Delivery method<br>
**step 3** if user choose Pickup, than show Payment tab, otherwise show Billing detail and Shipping Detail<br>
**step 4** Payment method<br>
**step 5** Confirm
Please Reply me fast
Thanks | 2 |
11,734,690 | 07/31/2012 06:53:36 | 1,164,626 | 01/23/2012 09:26:03 | 6 | 0 | Starting of Tomcat Failed | Starting of Tomcat failed, the server port 8084 is already in use.
D:\NetbeansProjects\Credit Card Management System\nbproject\build-impl.xml:731:
Deployment error:
Starting of Tomcat failed, the server port 8084 is already in use.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:200)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
I am working on credit card management system. It has having support for the hibernate and struts while deploying the project its giving me the following error | hibernate | tomcat | netbeans-7 | null | null | null | open | Starting of Tomcat Failed
===
Starting of Tomcat failed, the server port 8084 is already in use.
D:\NetbeansProjects\Credit Card Management System\nbproject\build-impl.xml:731:
Deployment error:
Starting of Tomcat failed, the server port 8084 is already in use.
See the server log for details.
at org.netbeans.modules.j2ee.deployment.devmodules.api.Deployment.deploy(Deployment.java:200)
at org.netbeans.modules.j2ee.ant.Deploy.execute(Deploy.java:106)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor128.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:284)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:539)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:154)
I am working on credit card management system. It has having support for the hibernate and struts while deploying the project its giving me the following error | 0 |
11,734,691 | 07/31/2012 06:53:38 | 1,366,117 | 04/30/2012 15:16:31 | 8 | 0 | Open multiple virtual hosts by local IP address | I'm using Apache, PHP (MAMP) in OSX environment, and Symfony framework for develpment.
Symfony requires the use of Virtual Host for development locally, so I've added these lines on my `/etc/apache2/hosts` file:
127.0.0.1 frontenda.dev
127.0.0.1 frontendb.dev
Then at my `/Applications/MAMP/conf/apache/extra/httpd.vhosts.conf`, I've added these lines:
<VirtualHost *:80>
ServerName frontenda.dev
DocumentRoot /Users/geo/Sites/frontenda/www/
</VirtualHost>
<VirtualHost *:80>
ServerName frontendb.dev
DocumentRoot /Users/geo/Sites/frontendb/www/
</VirtualHost>
I can open those folders from my browser by these urls `http://frontenda.dev` or `http://frontendb.dev`. My question is what should I do (if this is even possible) to use IP address instead of `frontenda.dev` or `frontendb.dev`? What I mean with that is, let say my machine ip `192.168.1.144`, can I do `192.168.1.144/frontenda` or even assigning different port number for different folder? | php | apache | symfony | osx-lion | mamp | null | open | Open multiple virtual hosts by local IP address
===
I'm using Apache, PHP (MAMP) in OSX environment, and Symfony framework for develpment.
Symfony requires the use of Virtual Host for development locally, so I've added these lines on my `/etc/apache2/hosts` file:
127.0.0.1 frontenda.dev
127.0.0.1 frontendb.dev
Then at my `/Applications/MAMP/conf/apache/extra/httpd.vhosts.conf`, I've added these lines:
<VirtualHost *:80>
ServerName frontenda.dev
DocumentRoot /Users/geo/Sites/frontenda/www/
</VirtualHost>
<VirtualHost *:80>
ServerName frontendb.dev
DocumentRoot /Users/geo/Sites/frontendb/www/
</VirtualHost>
I can open those folders from my browser by these urls `http://frontenda.dev` or `http://frontendb.dev`. My question is what should I do (if this is even possible) to use IP address instead of `frontenda.dev` or `frontendb.dev`? What I mean with that is, let say my machine ip `192.168.1.144`, can I do `192.168.1.144/frontenda` or even assigning different port number for different folder? | 0 |
11,734,701 | 07/31/2012 06:54:13 | 1,326,868 | 04/11/2012 14:32:50 | 40 | 1 | How to post multiple object data with socket.io in express | I managde to post singel data with socket.io, but if i add another(timestamp) then its showing nothing.
app.js
app.post('/update', function(req, res, next){
io.sockets.emit("update", req.body);
io.sockets.emit("update", Date.now());
res.send({});
});
add_users.jade
script(src='jquery-1.7.1.js')
script(src='http://localhost:3002/socket.io/socket.io.js')
script(type='text/javascript')
var socket;
socket = io.connect('http://localhost:3002');
socket.on('update', function(newUserAdded, time) {
console.log("update: ", newUserAdded + "update: ", time)
});
$(function() {
$("button").click(function() {
$.post("/update", {
newUserAdded: $("input").val(),
time: getTime()
});
});
}); | javascript | jquery | node.js | express | socket.io | null | open | How to post multiple object data with socket.io in express
===
I managde to post singel data with socket.io, but if i add another(timestamp) then its showing nothing.
app.js
app.post('/update', function(req, res, next){
io.sockets.emit("update", req.body);
io.sockets.emit("update", Date.now());
res.send({});
});
add_users.jade
script(src='jquery-1.7.1.js')
script(src='http://localhost:3002/socket.io/socket.io.js')
script(type='text/javascript')
var socket;
socket = io.connect('http://localhost:3002');
socket.on('update', function(newUserAdded, time) {
console.log("update: ", newUserAdded + "update: ", time)
});
$(function() {
$("button").click(function() {
$.post("/update", {
newUserAdded: $("input").val(),
time: getTime()
});
});
}); | 0 |
11,734,702 | 07/31/2012 06:54:14 | 1,152,182 | 01/16/2012 15:46:35 | 1 | 1 | Get List from .net Web Service on Android | I have .net Web Service and I want to use it on android. This web service's methods return List(Of String) and I didn't get response on android. What can I do ? Here is the code..
I'm working on it for 3 days and I didn't find any solution yet.
In short, I need some list from .net web service and add this list's items to spinner. Please help me.
public class MainActivity extends Activity {
private Spinner myspinner;
private static final String METHOD_NAME = "Sektorler";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String SOAP_ACTION = "http://tempuri.org/Sektorler";
private static final String URL = "http://www.xxxxxxxxxx.com/webservice1.asmx";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myspinner = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.activity_main , SektorDoldur());
myspinner.setAdapter(adapter);
}
private ArrayList<String> SektorDoldur() {
ArrayList<String> sektorler = new ArrayList<String>();
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
if (response.hasProperty("String")) {
if (response.getPropertyAsString("String") == null) {
//do something
} else {
for(int i=0;i<response.getPropertyCount();i++){
// sektorler.add(i, response.getPropertyAsString("String"));
sektorler.add(response.getPropertyAsString(i));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return sektorler;
} | android | web-services | ksoap2 | android-spinner | android-ksoap2 | null | open | Get List from .net Web Service on Android
===
I have .net Web Service and I want to use it on android. This web service's methods return List(Of String) and I didn't get response on android. What can I do ? Here is the code..
I'm working on it for 3 days and I didn't find any solution yet.
In short, I need some list from .net web service and add this list's items to spinner. Please help me.
public class MainActivity extends Activity {
private Spinner myspinner;
private static final String METHOD_NAME = "Sektorler";
private static final String NAMESPACE = "http://tempuri.org/";
private static final String SOAP_ACTION = "http://tempuri.org/Sektorler";
private static final String URL = "http://www.xxxxxxxxxx.com/webservice1.asmx";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
myspinner = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,R.layout.activity_main , SektorDoldur());
myspinner.setAdapter(adapter);
}
private ArrayList<String> SektorDoldur() {
ArrayList<String> sektorler = new ArrayList<String>();
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.debug = true;
try {
androidHttpTransport.call(SOAP_ACTION, envelope);
SoapObject response = (SoapObject) envelope.getResponse();
if (response.hasProperty("String")) {
if (response.getPropertyAsString("String") == null) {
//do something
} else {
for(int i=0;i<response.getPropertyCount();i++){
// sektorler.add(i, response.getPropertyAsString("String"));
sektorler.add(response.getPropertyAsString(i));
}
}
}
} catch (Exception e) {
e.printStackTrace();
}
return sektorler;
} | 0 |
11,734,703 | 07/31/2012 06:54:15 | 1,564,864 | 07/31/2012 06:23:42 | 1 | 0 | How to plot a graph with the motion in Python | I'm writing a code in Python to plot a graph. Upon giving the input the graph shall be start playing. Exactly as we see the ECG wave form playing in the ECG monitor. Upon providing the certain input the graph shall start playing as per the input value provided. Please help me regarding this...
Thanks in Advance.... | python-2.7 | null | null | null | null | null | open | How to plot a graph with the motion in Python
===
I'm writing a code in Python to plot a graph. Upon giving the input the graph shall be start playing. Exactly as we see the ECG wave form playing in the ECG monitor. Upon providing the certain input the graph shall start playing as per the input value provided. Please help me regarding this...
Thanks in Advance.... | 0 |
11,542,422 | 07/18/2012 13:22:24 | 1,534,876 | 07/18/2012 13:11:24 | 1 | 0 | HTML 5 : about stream and Chrome | I'm sorry I have a very bad english so be nice with my spelling :)
I'm looking for a video recorder in HTML5 and I found my happiness with getUserMedia of HTML5.
The problem is that getUserMedia require that user activate MediaStream (for webRTC) on chrome's interface : chrome://flags/
My question is : is it possible to activate this option by asking the user like in javascript ok with an url like chrome::/flags/mediastream=true or a function like setUserMedia?
Thank you | html5 | video | mediastreamsource | webrtc | null | null | open | HTML 5 : about stream and Chrome
===
I'm sorry I have a very bad english so be nice with my spelling :)
I'm looking for a video recorder in HTML5 and I found my happiness with getUserMedia of HTML5.
The problem is that getUserMedia require that user activate MediaStream (for webRTC) on chrome's interface : chrome://flags/
My question is : is it possible to activate this option by asking the user like in javascript ok with an url like chrome::/flags/mediastream=true or a function like setUserMedia?
Thank you | 0 |
11,542,435 | 07/18/2012 13:22:59 | 1,437,296 | 06/05/2012 11:58:19 | 11 | 1 | Is targeting additional platforms in titanium just a matter of UI changes? | If I have an iphone app in titanium and then want to also have that same app working on android and ipad, to have it working nicely on each platform is it just a matter of making some UI changes or does it require rewriting a significant amount of code? | android | iphone | ipad | titanium | titanium-mobile | null | open | Is targeting additional platforms in titanium just a matter of UI changes?
===
If I have an iphone app in titanium and then want to also have that same app working on android and ipad, to have it working nicely on each platform is it just a matter of making some UI changes or does it require rewriting a significant amount of code? | 0 |
11,542,235 | 07/18/2012 13:12:23 | 794,997 | 06/12/2011 18:24:22 | 44 | 0 | PHP gettext and non-ANSII charters | I have a PHP web application which is originally in Polish. But I was asked to locale it into Russian. I've decided to use gettext. But I've problem when I'm trying to translate string with Polish special characters. For example:
echo gettext('Urządzenie');
Display "Urządzenie" in web browser instead of word in Russian.
All files are encoded in UTF-8 and .po file was generated with --from-code utf-8 . Translations without Polish special chars such as
echo gettext('Instrukcja');
works well. Do you know what could be the reason of this strange behaviour? | php | utf-8 | translation | gettext | null | null | open | PHP gettext and non-ANSII charters
===
I have a PHP web application which is originally in Polish. But I was asked to locale it into Russian. I've decided to use gettext. But I've problem when I'm trying to translate string with Polish special characters. For example:
echo gettext('Urządzenie');
Display "Urządzenie" in web browser instead of word in Russian.
All files are encoded in UTF-8 and .po file was generated with --from-code utf-8 . Translations without Polish special chars such as
echo gettext('Instrukcja');
works well. Do you know what could be the reason of this strange behaviour? | 0 |
11,542,445 | 07/18/2012 13:23:17 | 629,685 | 02/23/2011 06:49:48 | 546 | 14 | blobstore.BlobReferenceProperty SQL interpreting | How to interpret blobstore.BlobReferenceProperty to SQL. The docs told:
> A reference to the BlobInfo entity corresponding to a Blobstore value (see ReferenceProperty).
What does it mean in SQL? At which table it refers to? | sql | gae-datastore | blobstore | null | null | null | open | blobstore.BlobReferenceProperty SQL interpreting
===
How to interpret blobstore.BlobReferenceProperty to SQL. The docs told:
> A reference to the BlobInfo entity corresponding to a Blobstore value (see ReferenceProperty).
What does it mean in SQL? At which table it refers to? | 0 |
11,542,446 | 07/18/2012 13:23:19 | 178,083 | 09/23/2009 21:18:23 | 306 | 1 | What is a principal type? | The OCaml compiler has a "-principal" option and the term "principal type" is sometimes mentioned in the mailing list. What exactly does it mean? The definition in Wikipedia is recursive, as it assumes the reader is already familiar with the notion. | ocaml | null | null | null | null | null | open | What is a principal type?
===
The OCaml compiler has a "-principal" option and the term "principal type" is sometimes mentioned in the mailing list. What exactly does it mean? The definition in Wikipedia is recursive, as it assumes the reader is already familiar with the notion. | 0 |
11,542,455 | 07/18/2012 13:23:53 | 1,108,948 | 12/21/2011 01:13:09 | 656 | 22 | Replace <li> with Html.ActionLink | in my master page. Origninal I had the code:
<ul>
<li>Home</li>
<li>About</li>
<li>Sermon</li>
</ul>
In my MVC 2 project, I want to use Html.ActionLink to replace <li> etc.
So my code:
<div id="leftcolumn">
<% @Html.ActionLink("Home", "Home", "Home") %>
<% @Html.ActionLink("About", "About", "Home") %>
<% @Html.ActionLink("Sermon", "Sermon", "Home") %>
</div>
The snapshot likes:
![MVC][1]
Please correct my code.
Thanks.
[1]: http://i.stack.imgur.com/7pyMd.png | asp.net-mvc | asp.net-mvc-2 | null | null | null | null | open | Replace <li> with Html.ActionLink
===
in my master page. Origninal I had the code:
<ul>
<li>Home</li>
<li>About</li>
<li>Sermon</li>
</ul>
In my MVC 2 project, I want to use Html.ActionLink to replace <li> etc.
So my code:
<div id="leftcolumn">
<% @Html.ActionLink("Home", "Home", "Home") %>
<% @Html.ActionLink("About", "About", "Home") %>
<% @Html.ActionLink("Sermon", "Sermon", "Home") %>
</div>
The snapshot likes:
![MVC][1]
Please correct my code.
Thanks.
[1]: http://i.stack.imgur.com/7pyMd.png | 0 |
11,542,457 | 07/18/2012 13:23:58 | 471,149 | 08/01/2010 10:11:33 | 1,478 | 39 | git navigation expressions | I have encountered following git command: `git diff ^master my_branch@{1} my_branch`. What does `^master`, `my_branch@{1}` and command itself mean?
I looked man for `git diff` but did not found any variants with three branches. | git | null | null | null | null | null | open | git navigation expressions
===
I have encountered following git command: `git diff ^master my_branch@{1} my_branch`. What does `^master`, `my_branch@{1}` and command itself mean?
I looked man for `git diff` but did not found any variants with three branches. | 0 |
11,350,910 | 07/05/2012 19:06:31 | 1,504,951 | 07/05/2012 18:59:25 | 1 | 0 | Bulk check the HTTP headers of a million domains | I'm looking to check the HTTP headers of a million+ domains (i.e. look for 200/404/302)
At this point I don't need the body HTML (although I might later) so it would likely be best to use HEAD requests rather than GET. I understand that some servers dont support HEAD and would be willing to sacrifice those as uncheckable for the sake of keeping things simple.
I've tried a number of solutions written in PHP (curl, multi curl, a couple of DIY curl parallel options) but none of them are fast enough.
I'm happy to use any language, the ideal outcome would be to find a C app that is already compiled and simply takes a list of urls and spits out the headers. For example I use an pre-rolled DNS application for checking the DNS settings of all those domains and all I have to do is open a pipe to it and feed it domains and it spits the answers back as they come in (not necessarily in the same order).
It would need to be asynchronous or threaded to be quick enough.
I explored some python options (like Twisted framework and liburl2) but couldn't get anything reliable up and running.
Hoping someone can help point me to a ready made solutioN! | php | python | ruby | http | asynchronous | 07/07/2012 06:03:30 | off topic | Bulk check the HTTP headers of a million domains
===
I'm looking to check the HTTP headers of a million+ domains (i.e. look for 200/404/302)
At this point I don't need the body HTML (although I might later) so it would likely be best to use HEAD requests rather than GET. I understand that some servers dont support HEAD and would be willing to sacrifice those as uncheckable for the sake of keeping things simple.
I've tried a number of solutions written in PHP (curl, multi curl, a couple of DIY curl parallel options) but none of them are fast enough.
I'm happy to use any language, the ideal outcome would be to find a C app that is already compiled and simply takes a list of urls and spits out the headers. For example I use an pre-rolled DNS application for checking the DNS settings of all those domains and all I have to do is open a pipe to it and feed it domains and it spits the answers back as they come in (not necessarily in the same order).
It would need to be asynchronous or threaded to be quick enough.
I explored some python options (like Twisted framework and liburl2) but couldn't get anything reliable up and running.
Hoping someone can help point me to a ready made solutioN! | 2 |
11,350,912 | 07/05/2012 19:06:35 | 1,460,533 | 06/16/2012 11:24:36 | 15 | 1 | Firefox Addon won't open new tab with url | I Tryed with this code:
var contextMenu = require("context-menu");
var menuItem = contextMenu.Item({
label: "Test name",
contentScript: 'self.on("click", function () {' +
' window.open("options.html", "_blank");' +
'});'
});
But when I click on the new Context menu item, I get the following error:
> Security Error: Content at *"le Site"* may not load or link to chrome://browser/content/options.html.
Wich permissions do I have to give of get? | javascript | firefox | firefox-addon | null | null | null | open | Firefox Addon won't open new tab with url
===
I Tryed with this code:
var contextMenu = require("context-menu");
var menuItem = contextMenu.Item({
label: "Test name",
contentScript: 'self.on("click", function () {' +
' window.open("options.html", "_blank");' +
'});'
});
But when I click on the new Context menu item, I get the following error:
> Security Error: Content at *"le Site"* may not load or link to chrome://browser/content/options.html.
Wich permissions do I have to give of get? | 0 |
11,350,913 | 07/05/2012 19:06:38 | 1,217,647 | 02/18/2012 05:26:39 | 49 | 2 | using C# in markup to get value from a datagrid | I want to start off by saying I am not sure how to properly word what I am aiming to do, so there may be plentiful examples on how to do what I am trying to do, I just cannot find them.
That being said my explanation might be a bit wordy so I appreciate any and all help.
I am including a new feature on a previously created .Net webpage and sql database. The code currently returns a DataSet from the database and binds it to a datagrid. From there it is loaded into a table on the webpage. What my new column needs to do is take the primarykey from the current row and use it to call a stored procedure to get more data.
<asp:TemplateColumn SortExpression="siteAdmin" HeaderText="SITE ADMIN">
<ItemTemplate>
<asp:Label runat="server" Text='<%# listAdmin("siteAdmin", ***issue is here*** ) %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
The code in the markup calls a method that calls the stored procedure I need to retrieve the string I am looking for. The issue I am having is figuring out how to get the primarykey, which is an int into the second parameter of the listAdmin() method. The primarykeys for each row are returned from the database in a column of the dataSet called "trackingId"
Any help would be gratefully received. If I can clear anything up, please ask. | c# | .net | markup | null | null | null | open | using C# in markup to get value from a datagrid
===
I want to start off by saying I am not sure how to properly word what I am aiming to do, so there may be plentiful examples on how to do what I am trying to do, I just cannot find them.
That being said my explanation might be a bit wordy so I appreciate any and all help.
I am including a new feature on a previously created .Net webpage and sql database. The code currently returns a DataSet from the database and binds it to a datagrid. From there it is loaded into a table on the webpage. What my new column needs to do is take the primarykey from the current row and use it to call a stored procedure to get more data.
<asp:TemplateColumn SortExpression="siteAdmin" HeaderText="SITE ADMIN">
<ItemTemplate>
<asp:Label runat="server" Text='<%# listAdmin("siteAdmin", ***issue is here*** ) %>'>
</asp:Label>
</ItemTemplate>
</asp:TemplateColumn>
The code in the markup calls a method that calls the stored procedure I need to retrieve the string I am looking for. The issue I am having is figuring out how to get the primarykey, which is an int into the second parameter of the listAdmin() method. The primarykeys for each row are returned from the database in a column of the dataSet called "trackingId"
Any help would be gratefully received. If I can clear anything up, please ask. | 0 |
11,340,521 | 07/05/2012 08:27:14 | 1,421,580 | 05/28/2012 11:16:13 | 45 | 3 | mysql : how to create a user and how to access the mysql loalhost server using php | I am new to mysql and php too, so please ignore my less knowledge in this.
I want to do the following:--
1. I want to have a mysql localhost server and have a table in it in which i will keep username and password.
2. I will create a webpage with login option and once user clicks on submit then i will autenticate the user using the database i create above.
Following is what i did as of now:--
I am new to mysql and php too. I did a lot of search but was not able to understand what exactly i installed in my machine.
I downloaded mysql and installed it. I see a mysql cmd prompt. I create a database and i created a table in it.
Now how to i create a user? I tried creating it using
CREATE user xyz;
but it says attempting to connect and connection failed (what exactly is it trying to connect?)
I did a search for accessing a localhost server and i got the code which is
<?PHP
$user_name = "root";
$password = "";
$database = "addressbook";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
print "Database Found ";
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
}
?>
which looks fairly decent to me.
My problem is how to i create a user in mysql? | mysql | null | null | null | null | null | open | mysql : how to create a user and how to access the mysql loalhost server using php
===
I am new to mysql and php too, so please ignore my less knowledge in this.
I want to do the following:--
1. I want to have a mysql localhost server and have a table in it in which i will keep username and password.
2. I will create a webpage with login option and once user clicks on submit then i will autenticate the user using the database i create above.
Following is what i did as of now:--
I am new to mysql and php too. I did a lot of search but was not able to understand what exactly i installed in my machine.
I downloaded mysql and installed it. I see a mysql cmd prompt. I create a database and i created a table in it.
Now how to i create a user? I tried creating it using
CREATE user xyz;
but it says attempting to connect and connection failed (what exactly is it trying to connect?)
I did a search for accessing a localhost server and i got the code which is
<?PHP
$user_name = "root";
$password = "";
$database = "addressbook";
$server = "127.0.0.1";
$db_handle = mysql_connect($server, $user_name, $password);
$db_found = mysql_select_db($database, $db_handle);
if ($db_found) {
print "Database Found ";
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
}
?>
which looks fairly decent to me.
My problem is how to i create a user in mysql? | 0 |
11,350,918 | 07/05/2012 19:07:04 | 402,731 | 07/26/2010 20:55:25 | 39 | 2 | Spring MVC request encode issue | I'm developing a Spring MVC app and I'm having some issues with enconding.
Here's the problem:
on the browser I type "**João**" and after I submit the form, on the Controller I've got "**João**". My Firefox is configured to UTF-8 and so my Eclispe. If I check the sent paramenters using Firebug the value still correct.
Here's my encoding config:
On the web.xml, the first thing I have:
<filter>
<filter-name>encoding-filter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<locale-encoding-mapping-list>
<locale-encoding-mapping>
<locale>pt-BR</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>pt</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>en</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
</locale-encoding-mapping-list>
<filter-mapping>
<filter-name>encoding-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
On the JSP:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
On the form:
<form:form method="post" ... acceptCharset="UTF-8">
On the servelt-context.xml:
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
<beans:property name="contentType" value="text/html;charset=UTF-8" />
</beans:bean>
Inside my pom.xml (Maven):
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.6</java-version>
<org.springframework-version>3.1.0.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.1</org.slf4j-version>
</properties>
To call the server I'm using JQuery load() function like this:
var params = form.serialize();
$.ajaxSetup({
contentType: 'text/html; charset=UTF-8'
});
$("#content").load(url, params);
I included this **$.ajaxSetup** as I desperated attempt, but it has no effect.
I noticed that on the **params** I have this "**João**" as "**Jo%C3%83%C2%A3o**". I changed back to "João" using Firebug but still getting the same issue.
Any magic ideas?
Thanks in advance.
| spring | jquery-ajax | spring-mvc | encode | null | null | open | Spring MVC request encode issue
===
I'm developing a Spring MVC app and I'm having some issues with enconding.
Here's the problem:
on the browser I type "**João**" and after I submit the form, on the Controller I've got "**João**". My Firefox is configured to UTF-8 and so my Eclispe. If I check the sent paramenters using Firebug the value still correct.
Here's my encoding config:
On the web.xml, the first thing I have:
<filter>
<filter-name>encoding-filter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
</filter>
<locale-encoding-mapping-list>
<locale-encoding-mapping>
<locale>pt-BR</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>pt</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
<locale-encoding-mapping>
<locale>en</locale>
<encoding>UTF-8</encoding>
</locale-encoding-mapping>
</locale-encoding-mapping-list>
<filter-mapping>
<filter-name>encoding-filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
On the JSP:
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
On the form:
<form:form method="post" ... acceptCharset="UTF-8">
On the servelt-context.xml:
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
<beans:property name="contentType" value="text/html;charset=UTF-8" />
</beans:bean>
Inside my pom.xml (Maven):
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java-version>1.6</java-version>
<org.springframework-version>3.1.0.RELEASE</org.springframework-version>
<org.aspectj-version>1.6.10</org.aspectj-version>
<org.slf4j-version>1.6.1</org.slf4j-version>
</properties>
To call the server I'm using JQuery load() function like this:
var params = form.serialize();
$.ajaxSetup({
contentType: 'text/html; charset=UTF-8'
});
$("#content").load(url, params);
I included this **$.ajaxSetup** as I desperated attempt, but it has no effect.
I noticed that on the **params** I have this "**João**" as "**Jo%C3%83%C2%A3o**". I changed back to "João" using Firebug but still getting the same issue.
Any magic ideas?
Thanks in advance.
| 0 |
11,350,898 | 07/05/2012 19:06:00 | 474,819 | 10/13/2010 17:32:45 | 742 | 10 | nested parentheses with P::RecDescent | I'm trying to make a parser which can parse parenthetical expressions and the unary operator "?". What I have so far is failing when I create the parser because the rule `expression` is left-recursive:
use strict;
use warnings;
use Parse::RecDescent;
my $test = <<END;
((foo)? bar)
END
#skip single/multi-line comments and spaces
$Parse::RecDescent::skip =
qr{
(
\s+ #whitespace
| #or
/[*] .*? [*]/ \s* #a multiline comment
| #or
//.*?$ #a single line comment
)* #zero or more
}mxs;#m allows '$' to match a newline, x allows comments, s allows '.' to match newlines.
my $grammar = q(
parse: expression(s)
expression: string | parend | expression(s)
parend : "(" (string | expression) ")" /\??/
string : /\w+/ /\??/
);
my $parser = Parse::RecDescent->new($grammar);
my $result = $parser->parse($test);
if($result){
print $result;
}else{
print STDERR "Invalid grammar\n";
}
| perl | parsing | parentheses | parse-recdescent | null | null | open | nested parentheses with P::RecDescent
===
I'm trying to make a parser which can parse parenthetical expressions and the unary operator "?". What I have so far is failing when I create the parser because the rule `expression` is left-recursive:
use strict;
use warnings;
use Parse::RecDescent;
my $test = <<END;
((foo)? bar)
END
#skip single/multi-line comments and spaces
$Parse::RecDescent::skip =
qr{
(
\s+ #whitespace
| #or
/[*] .*? [*]/ \s* #a multiline comment
| #or
//.*?$ #a single line comment
)* #zero or more
}mxs;#m allows '$' to match a newline, x allows comments, s allows '.' to match newlines.
my $grammar = q(
parse: expression(s)
expression: string | parend | expression(s)
parend : "(" (string | expression) ")" /\??/
string : /\w+/ /\??/
);
my $parser = Parse::RecDescent->new($grammar);
my $result = $parser->parse($test);
if($result){
print $result;
}else{
print STDERR "Invalid grammar\n";
}
| 0 |
11,350,922 | 07/05/2012 19:07:24 | 540,962 | 12/13/2010 19:15:05 | 187 | 27 | Are there any issues with the mongodb plugin with grails 2.x | I created a blank application and installed the mongodb plugin for grails and I get a context.GrailsContextLoader Error executing bootstraps: No bean named 'sessionFactory' is defined. I have no domain classes or any other code implemented.
Grails version: 2.0.4
BuildConfig.groovy
compile ":mongodb:1.0.0.GA"
DataSource.groovy
// environment specific settings
environments {
development {
mongo {
options {
autoConnectRetry = true
connectTimeout = 300
}
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb"
}
dataSource_lookup {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
}
production {
mongo {
options {
autoConnectRetry = true
connectTimeout = 300
}
}
}
}
Mongod when started from the command line is listening for connections on the default port
Thu Jul 5 12:48:14 [websvr] admin web console waiting for connections on port 28017
Thu Jul 5 12:48:14 [initandlisten] waiting for connections on port 27017
StackTrace:
grails> run-app
| Compiling 53 source files
| Running Grails application
context.GrailsContextLoader Error executing bootstraps: No bean named 'sessionFactory' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:95)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
[localhost].[/finz] Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:95)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
core.StandardContext Error listenerStart
| Server running. Browse to http://localhost:8080/finz
| Application loaded in interactive mode. Type 'exit' to shutdown.
| Enter a script name to run. Use TAB for completion: | mongodb | grails | grails-plugin | null | null | null | open | Are there any issues with the mongodb plugin with grails 2.x
===
I created a blank application and installed the mongodb plugin for grails and I get a context.GrailsContextLoader Error executing bootstraps: No bean named 'sessionFactory' is defined. I have no domain classes or any other code implemented.
Grails version: 2.0.4
BuildConfig.groovy
compile ":mongodb:1.0.0.GA"
DataSource.groovy
// environment specific settings
environments {
development {
mongo {
options {
autoConnectRetry = true
connectTimeout = 300
}
}
}
test {
dataSource {
dbCreate = "update"
url = "jdbc:h2:mem:testDb"
}
dataSource_lookup {
pooled = true
driverClassName = "org.h2.Driver"
username = "sa"
password = ""
}
}
production {
mongo {
options {
autoConnectRetry = true
connectTimeout = 300
}
}
}
}
Mongod when started from the command line is listening for connections on the default port
Thu Jul 5 12:48:14 [websvr] admin web console waiting for connections on port 28017
Thu Jul 5 12:48:14 [initandlisten] waiting for connections on port 27017
StackTrace:
grails> run-app
| Compiling 53 source files
| Running Grails application
context.GrailsContextLoader Error executing bootstraps: No bean named 'sessionFactory' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:95)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
[localhost].[/finz] Exception sending context initialized event to listener instance of class org.codehaus.groovy.grails.web.context.GrailsContextLoaderListener
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
at org.grails.datastore.gorm.plugin.support.PersistenceContextInterceptorAggregator.postProcessBeanFactory(PersistenceContextInterceptorAggregator.groovy:95)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
core.StandardContext Error listenerStart
| Server running. Browse to http://localhost:8080/finz
| Application loaded in interactive mode. Type 'exit' to shutdown.
| Enter a script name to run. Use TAB for completion: | 0 |
11,651,081 | 07/25/2012 13:40:05 | 523,346 | 11/29/2010 01:25:46 | 16 | 0 | Javascript and Scientific Processing? | Matlab, R, and Python are powerful but either costly or slow for some data mining work I'd like to do. I'm considering using Javascript both for
<a href="http://julialang.org/">speed</a>, good visualization libraries, and to be able to use the browser as an interface.
The first question I faced is the obvious one for science programming, how to do I/O to data files? The second is client-side or server-side? The last question, can I make something that is truly portable i.e. put it all on a USB and run from that?
I've spent a couple of weeks looking for answers. Server2go seems to address client/server needs which I _think_ means I can get data to and from the programs on the client side. Server2go also allows running from a USB. The data files I work with are usually XML and there seem to be several javascript converters to JSON.
However, after all the looking around, I'm not sure if my approach makes sense. So before I commit further, any advice/thoughts/guidance on Javascript as a portable tool for scientific data processing? | javascript | data-mining | scientific-computing | null | null | null | open | Javascript and Scientific Processing?
===
Matlab, R, and Python are powerful but either costly or slow for some data mining work I'd like to do. I'm considering using Javascript both for
<a href="http://julialang.org/">speed</a>, good visualization libraries, and to be able to use the browser as an interface.
The first question I faced is the obvious one for science programming, how to do I/O to data files? The second is client-side or server-side? The last question, can I make something that is truly portable i.e. put it all on a USB and run from that?
I've spent a couple of weeks looking for answers. Server2go seems to address client/server needs which I _think_ means I can get data to and from the programs on the client side. Server2go also allows running from a USB. The data files I work with are usually XML and there seem to be several javascript converters to JSON.
However, after all the looking around, I'm not sure if my approach makes sense. So before I commit further, any advice/thoughts/guidance on Javascript as a portable tool for scientific data processing? | 0 |
11,651,087 | 07/25/2012 13:40:28 | 1,539,776 | 07/20/2012 05:16:04 | 1 | 0 | jquery pre loader | i want to create a json object in java which will be returned to a JS by a ajax call JSON should have a format like this . I want to create some method which return JSONOdata which have structure like given bellow .
var JSONOdata = {
"val": [
{
"elementName": "Shopping",
"elementVal": "350",
"color": "#378284",
"elementData": "shopping data"
},
{
"elementName": "Cash",
"elementVal": "50",
"color": "#00FFFF",
"elementData": "cash data"
},
{
"elementName": "Boat",
"elementVal": "150",
"color": "#933015",
"elementData": "boat data"
},
{
"elementName": "Gas",
"elementVal": "250",
"color": "#0000A0",
"elementData": "gas data"
},
{
"elementName": "Movies",
"elementVal": "100",
"color": "#6A786E",
"elementData": "movies data"
},
{
"elementName": "Restaurants",
"elementVal": "250",
"color": "#ADD8E6",
"elementData": "restaurant data"
}
]
}; | java | json | null | null | null | 07/25/2012 13:58:12 | not a real question | jquery pre loader
===
i want to create a json object in java which will be returned to a JS by a ajax call JSON should have a format like this . I want to create some method which return JSONOdata which have structure like given bellow .
var JSONOdata = {
"val": [
{
"elementName": "Shopping",
"elementVal": "350",
"color": "#378284",
"elementData": "shopping data"
},
{
"elementName": "Cash",
"elementVal": "50",
"color": "#00FFFF",
"elementData": "cash data"
},
{
"elementName": "Boat",
"elementVal": "150",
"color": "#933015",
"elementData": "boat data"
},
{
"elementName": "Gas",
"elementVal": "250",
"color": "#0000A0",
"elementData": "gas data"
},
{
"elementName": "Movies",
"elementVal": "100",
"color": "#6A786E",
"elementData": "movies data"
},
{
"elementName": "Restaurants",
"elementVal": "250",
"color": "#ADD8E6",
"elementData": "restaurant data"
}
]
}; | 1 |
11,651,088 | 07/25/2012 13:40:32 | 630,372 | 02/23/2011 14:45:42 | 1,114 | 24 | How does Maven interacts with different repositories? | How does Maven interacts with different repositories like Nexus and Artifactory?
Is it done using their REST APIs? It is possible to resolve dependent artifacts to actual locations to get them from using these APIs, but the two APIs are somewhat different form each other (as far as i see [[Artifactory]][1] [[Nexus]][2]) and the repository definition element in Maven pom files does not contain a property to state the type of the repository.
So how does Maven resolves artifact's groupId, artifactId and version to an actual file in different repositories? Does these repositories implement some other standardized API that enables Maven to request files from them in an repository-agnostic way?
[1]: http://wiki.jfrog.org/confluence/display/RTF/Artifactory%27s+REST+API#ArtifactorysRESTAPI-ARTIFACTSSTORAGE
[2]: https://repository.sonatype.org/nexus-core-documentation-plugin/core/docs/rest.artifact.maven.resolve.html | java | maven | nexus | artifactory | null | null | open | How does Maven interacts with different repositories?
===
How does Maven interacts with different repositories like Nexus and Artifactory?
Is it done using their REST APIs? It is possible to resolve dependent artifacts to actual locations to get them from using these APIs, but the two APIs are somewhat different form each other (as far as i see [[Artifactory]][1] [[Nexus]][2]) and the repository definition element in Maven pom files does not contain a property to state the type of the repository.
So how does Maven resolves artifact's groupId, artifactId and version to an actual file in different repositories? Does these repositories implement some other standardized API that enables Maven to request files from them in an repository-agnostic way?
[1]: http://wiki.jfrog.org/confluence/display/RTF/Artifactory%27s+REST+API#ArtifactorysRESTAPI-ARTIFACTSSTORAGE
[2]: https://repository.sonatype.org/nexus-core-documentation-plugin/core/docs/rest.artifact.maven.resolve.html | 0 |
11,651,091 | 07/25/2012 13:40:43 | 1,551,582 | 07/25/2012 12:29:26 | 1 | 0 | Export Google My Maps to Google Maps API | I have a Google My Map that I have created with 3 markers. Is there a way to export this map and then import it into a Google Map API? At that point I could delete the map made as My Map.
IF NOT, I have spent hours looking for a straight-forward tutorial on creating a Google Map API that would replicate the My Map format:
1. multiple markers
2. info windows that have text and images
3. side bar with the summary content and markers listed
4. driving directions
I feel like this shouldn't be as complicated as I'm making it out to be. I've spent hours trying to get the information I need to get going.
Thank you for any help you can provide :) | api | google | map | null | null | null | open | Export Google My Maps to Google Maps API
===
I have a Google My Map that I have created with 3 markers. Is there a way to export this map and then import it into a Google Map API? At that point I could delete the map made as My Map.
IF NOT, I have spent hours looking for a straight-forward tutorial on creating a Google Map API that would replicate the My Map format:
1. multiple markers
2. info windows that have text and images
3. side bar with the summary content and markers listed
4. driving directions
I feel like this shouldn't be as complicated as I'm making it out to be. I've spent hours trying to get the information I need to get going.
Thank you for any help you can provide :) | 0 |
11,651,095 | 07/25/2012 13:40:55 | 867,975 | 07/28/2011 17:09:58 | 77 | 2 | EcmaError: TypeError in Rhino: not a function, a NativeJavaObject | Several months ago, I hacked together a mechanism for creating javascript functions from java interfaces like so:
public interface ReturnableScriptMethodSPI extends Runnable {
public String getDescription();
public String getFunctionName();
public String getCategory();
public void setArguments(Object[] args);
public Object returns();
}
This interface is then generated to a javascript function definition as follows:
public String generateScriptBinding() {
bindings.put("this"+method.getFunctionName(), method);
String scriptx = "function " + method.getFunctionName()+"() {\n"
+ "\tvar args = java.lang.reflect.Array.newInstance(java.lang.Object, arguments.length);\n"
+ "\tfor(var i = 0; i < arguments.length; i++) {\n"
+ "\t\targs[i] = arguments[i];\n"
+ "\t}\n"
+ "\tthis"+method.getFunctionName()+".setArguments(args);\n"
+ "\tthis"+method.getFunctionName()+".run();\n"
+ "\tvar tmp = this"+method.getFunctionName()+".returns();\n"
+ "\treturn tmp\n;"
+"}";
return scriptx;
}
...where bindings is a Bindings object as part of the class the generateScriptBinding() belongs to. Note that this method doesn't do the heavy lifting, it merely creates a string to pass to the heavy lifter--the Rhino script engine...more specifically, Sun's version.
Now for the most part, this works pretty well, but as the interface implementations grow, I'm beginning to see the following error:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: GetMyGroups is not a function, it is sun.org.mozilla.javascript.internal.NativeJavaObject. (<Unknown source>#4)
Now, GetMyGroups is just one implementation of ReturnableScriptMethodSPI so the errors look exactly the same but with a different name swapped in for GetMyGroups.
Has anyone seen this error before and can comment on why it occurs as well as what the generator code might be doing wrong to cause the function definition to cause such an error?
Many thanks in advance!
-jagwire
P.S.
I've looked at questions:
http://stackoverflow.com/questions/6822635/typeerror-object-is-not-a-function-when-it-is
http://stackoverflow.com/questions/5959045/typeerror-object-is-not-a-function
http://stackoverflow.com/questions/8262149/typeerror-error-1006-playcontent-is-not-a-function
and my particular environment is neither the web browser, nor flash so I'm not terribly sure the answers are that relevant or adequate for my particular situation. | java | javascript | scripting | rhino | null | null | open | EcmaError: TypeError in Rhino: not a function, a NativeJavaObject
===
Several months ago, I hacked together a mechanism for creating javascript functions from java interfaces like so:
public interface ReturnableScriptMethodSPI extends Runnable {
public String getDescription();
public String getFunctionName();
public String getCategory();
public void setArguments(Object[] args);
public Object returns();
}
This interface is then generated to a javascript function definition as follows:
public String generateScriptBinding() {
bindings.put("this"+method.getFunctionName(), method);
String scriptx = "function " + method.getFunctionName()+"() {\n"
+ "\tvar args = java.lang.reflect.Array.newInstance(java.lang.Object, arguments.length);\n"
+ "\tfor(var i = 0; i < arguments.length; i++) {\n"
+ "\t\targs[i] = arguments[i];\n"
+ "\t}\n"
+ "\tthis"+method.getFunctionName()+".setArguments(args);\n"
+ "\tthis"+method.getFunctionName()+".run();\n"
+ "\tvar tmp = this"+method.getFunctionName()+".returns();\n"
+ "\treturn tmp\n;"
+"}";
return scriptx;
}
...where bindings is a Bindings object as part of the class the generateScriptBinding() belongs to. Note that this method doesn't do the heavy lifting, it merely creates a string to pass to the heavy lifter--the Rhino script engine...more specifically, Sun's version.
Now for the most part, this works pretty well, but as the interface implementations grow, I'm beginning to see the following error:
javax.script.ScriptException: sun.org.mozilla.javascript.internal.EcmaError: TypeError: GetMyGroups is not a function, it is sun.org.mozilla.javascript.internal.NativeJavaObject. (<Unknown source>#4)
Now, GetMyGroups is just one implementation of ReturnableScriptMethodSPI so the errors look exactly the same but with a different name swapped in for GetMyGroups.
Has anyone seen this error before and can comment on why it occurs as well as what the generator code might be doing wrong to cause the function definition to cause such an error?
Many thanks in advance!
-jagwire
P.S.
I've looked at questions:
http://stackoverflow.com/questions/6822635/typeerror-object-is-not-a-function-when-it-is
http://stackoverflow.com/questions/5959045/typeerror-object-is-not-a-function
http://stackoverflow.com/questions/8262149/typeerror-error-1006-playcontent-is-not-a-function
and my particular environment is neither the web browser, nor flash so I'm not terribly sure the answers are that relevant or adequate for my particular situation. | 0 |
11,651,106 | 07/25/2012 13:41:45 | 959,671 | 09/22/2011 17:19:52 | 1 | 0 | ios 5.1 development "Message sent to deallocated instance" | I am seeing following error in my application. This happens when I am loading a new SubView in call back method. Below are complete details.
In my application I have RootViewController as the app launches it adds a subview called "AuthCheck". In it I perform authentication checks displaying to user details of what's happening. In the AuthCheckController I have a call back method to handle async auth process as shown below.
- (void)shellAuthRequired: (ServiceResponse *)response {
[super shellAuthRequired:response];
if (response.hasError) {
[self showTryAgainAlert: response.errorText];
return;
}
// TODO: go to main screen from here.
IntroViewViewController *intview = [[IntroViewViewController alloc]initWithNibName:@"IntroViewViewController" bundle:nil];
//[self.navigationController pushViewController:intview animated:YES];
[self.view addSubview:intview.view];
}
In this method as you see I forward the user to a new screen where I display necessary auth related details and the screen will have an continue button. When user clicks on "Continue" I load a new SubView called "WebViewController". Code below
-(IBAction)btnContinueToClicked:(id)sender
{
WebViewController *wview = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
[self.view addSubview:wview.view]
}
I get the exception "[IntroViewViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0xd062f50" when I add new subview to be forwarded to.
What is causing this error?
Thanks
Vish | ios | xcode4 | ios5.1 | null | null | null | open | ios 5.1 development "Message sent to deallocated instance"
===
I am seeing following error in my application. This happens when I am loading a new SubView in call back method. Below are complete details.
In my application I have RootViewController as the app launches it adds a subview called "AuthCheck". In it I perform authentication checks displaying to user details of what's happening. In the AuthCheckController I have a call back method to handle async auth process as shown below.
- (void)shellAuthRequired: (ServiceResponse *)response {
[super shellAuthRequired:response];
if (response.hasError) {
[self showTryAgainAlert: response.errorText];
return;
}
// TODO: go to main screen from here.
IntroViewViewController *intview = [[IntroViewViewController alloc]initWithNibName:@"IntroViewViewController" bundle:nil];
//[self.navigationController pushViewController:intview animated:YES];
[self.view addSubview:intview.view];
}
In this method as you see I forward the user to a new screen where I display necessary auth related details and the screen will have an continue button. When user clicks on "Continue" I load a new SubView called "WebViewController". Code below
-(IBAction)btnContinueToClicked:(id)sender
{
WebViewController *wview = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:nil];
[self.view addSubview:wview.view]
}
I get the exception "[IntroViewViewController performSelector:withObject:withObject:]: message sent to deallocated instance 0xd062f50" when I add new subview to be forwarded to.
What is causing this error?
Thanks
Vish | 0 |
2,966,510 | 06/03/2010 13:43:25 | 357,538 | 06/03/2010 13:40:57 | 1 | 0 | I want to run the examples of QtOpenCl, i.e. Qt in OpenCl. Installation and setup help? | The thing is I have to run the OpenCl examples, as given here:<a href="http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/">http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/</a>.
The problem is that I have no clue where to start. I downloaded the source for QtOpenCl but it needs a valid OpenCl installation. I have Qt installed already.
How do I install OpenCl? I don't have a GPU at home unfortunately, and need to implement it on my CPU for now. I have to later give a presentation where I will be supplied a system with a GPU. How do I go about installing OpenCl?
Thanks you. | c++ | qt | qt4 | opencl | null | null | open | I want to run the examples of QtOpenCl, i.e. Qt in OpenCl. Installation and setup help?
===
The thing is I have to run the OpenCl examples, as given here:<a href="http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/">http://labs.trolltech.com/blogs/2010/04/07/using-opencl-with-qt/</a>.
The problem is that I have no clue where to start. I downloaded the source for QtOpenCl but it needs a valid OpenCl installation. I have Qt installed already.
How do I install OpenCl? I don't have a GPU at home unfortunately, and need to implement it on my CPU for now. I have to later give a presentation where I will be supplied a system with a GPU. How do I go about installing OpenCl?
Thanks you. | 0 |
11,472,630 | 07/13/2012 14:34:15 | 1,495,838 | 07/02/2012 10:52:56 | 11 | 1 | Oracle: Format string for a IN statement | In a varchar2 field (table1.field1), I have something like this:
;number1;number2;.......;numberN;
I want use this value in a IN statement, something like:
SELECT * FROM table2 WHERE table2.field2 IN table1.field1 | sql | oracle | plsql | null | null | null | open | Oracle: Format string for a IN statement
===
In a varchar2 field (table1.field1), I have something like this:
;number1;number2;.......;numberN;
I want use this value in a IN statement, something like:
SELECT * FROM table2 WHERE table2.field2 IN table1.field1 | 0 |
11,472,633 | 07/13/2012 14:34:32 | 1,523,817 | 07/13/2012 14:21:29 | 1 | 0 | PuTTY in C# for file transfer | Can any one help me with a code snippet in C# for transferring a file on my local machine to a remote server using PSCP (PuTTY) transfer methodology? I would really appreciate the help.
Thanks | putty | null | null | null | null | null | open | PuTTY in C# for file transfer
===
Can any one help me with a code snippet in C# for transferring a file on my local machine to a remote server using PSCP (PuTTY) transfer methodology? I would really appreciate the help.
Thanks | 0 |
11,463,438 | 07/13/2012 02:40:54 | 791,018 | 06/09/2011 13:40:53 | 1,132 | 80 | CABasicAnimation with CALayer path doesn't animate | I'm trying to animation the transition of a CALayer from normal corners to rounded corners. I only want to round the top corners, so I am using a UIBezierPath. Here's the code:
UIRectCorner corners = UIRectCornerTopLeft | UIRectCornerTopRight;
UIBezierPath* path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(8.0f, 8.0f)];
CAShapeLayer* layer = [CAShapeLayer layer];
layer.frame = self.bounds;
self.layer.mask = layer;
CABasicAnimation* a = [CABasicAnimation animationWithKeyPath:@"path"];
[a setDuration:0.4f];
[a setFillMode:kCAFillModeForwards];
[a setRemovedOnCompletion:NO];
[a setFromValue:(id)layer.path];
[a setToValue:(id)path.CGPath];
layer.path = path.CGPath;
[layer addAnimation:a forKey:@"path"];
But when I run this, the corners are rounded, but there is no animation- it happens instantly. I have seen some similar questions here on SO, but they didn't solve my problem.
http://stackoverflow.com/questions/5065073/iphone-calayer-animation
http://stackoverflow.com/questions/5924734/animating-calayers-shadowpath-property
I'm sure that I'm just doing one little thing wrong which is causing the problem, but for the life of me I can't figure it out. | core-animation | calayer | uibezierpath | cgpath | cabasicanimation | null | open | CABasicAnimation with CALayer path doesn't animate
===
I'm trying to animation the transition of a CALayer from normal corners to rounded corners. I only want to round the top corners, so I am using a UIBezierPath. Here's the code:
UIRectCorner corners = UIRectCornerTopLeft | UIRectCornerTopRight;
UIBezierPath* path = [UIBezierPath bezierPathWithRoundedRect:self.bounds byRoundingCorners:corners cornerRadii:CGSizeMake(8.0f, 8.0f)];
CAShapeLayer* layer = [CAShapeLayer layer];
layer.frame = self.bounds;
self.layer.mask = layer;
CABasicAnimation* a = [CABasicAnimation animationWithKeyPath:@"path"];
[a setDuration:0.4f];
[a setFillMode:kCAFillModeForwards];
[a setRemovedOnCompletion:NO];
[a setFromValue:(id)layer.path];
[a setToValue:(id)path.CGPath];
layer.path = path.CGPath;
[layer addAnimation:a forKey:@"path"];
But when I run this, the corners are rounded, but there is no animation- it happens instantly. I have seen some similar questions here on SO, but they didn't solve my problem.
http://stackoverflow.com/questions/5065073/iphone-calayer-animation
http://stackoverflow.com/questions/5924734/animating-calayers-shadowpath-property
I'm sure that I'm just doing one little thing wrong which is causing the problem, but for the life of me I can't figure it out. | 0 |
11,463,440 | 07/13/2012 02:41:21 | 800,336 | 06/15/2011 19:57:52 | 609 | 37 | Upload image using UIImagePickerController to dragonfly on rails | I have a app for iOS and I have the user pick a image with a UIImagePickerController. How can I upload that image to my rails app using dragonfly. I think I would use multipart-image-data but I don't know how I would do this. | ruby-on-rails | ios | ruby | uiimagepickercontroller | dragonfly-gem | null | open | Upload image using UIImagePickerController to dragonfly on rails
===
I have a app for iOS and I have the user pick a image with a UIImagePickerController. How can I upload that image to my rails app using dragonfly. I think I would use multipart-image-data but I don't know how I would do this. | 0 |
11,472,641 | 07/13/2012 14:34:52 | 755,671 | 05/16/2011 13:05:47 | 73 | 1 | Eclipse/Java source file issues with Lucene | Everytime I run the following code in debug mode in eclipse:
public static void main(String[] args) throws IOException{
Index index = new Index();
Thing t = new Thing();
index.buildIndex(t);
}
I get the following error (at the end of a massive stack trace):
'The source attachment does not contain the source for the file URLClassPath.class'
following the first line.
The Index class just uses the default constructor and has no private fields, just methods that build indexes of Things in memory.
The entire project is to be run on a Jboss server, but this is currently being run as a stand alone application (under a different run configuration).
The application loader can find src.zip in the java folder.
Has anyone else had similar problems? This only occurs when I try to debug and not when I run the application properly. | java | eclipse | null | null | null | null | open | Eclipse/Java source file issues with Lucene
===
Everytime I run the following code in debug mode in eclipse:
public static void main(String[] args) throws IOException{
Index index = new Index();
Thing t = new Thing();
index.buildIndex(t);
}
I get the following error (at the end of a massive stack trace):
'The source attachment does not contain the source for the file URLClassPath.class'
following the first line.
The Index class just uses the default constructor and has no private fields, just methods that build indexes of Things in memory.
The entire project is to be run on a Jboss server, but this is currently being run as a stand alone application (under a different run configuration).
The application loader can find src.zip in the java folder.
Has anyone else had similar problems? This only occurs when I try to debug and not when I run the application properly. | 0 |
11,472,655 | 07/13/2012 14:35:39 | 1,229,258 | 02/23/2012 20:03:35 | 15 | 0 | Sharepoint Infopath saving as pdf | I currently have an infopath form attached to my sharepoint library and I'm trying to save the forms as pdf. That is when a user fills out the form and clicks save instead of saving as an infopath form template it saves as a pdf file. Is this possible, if so can someone point me in a starting direction? Thanks! | sharepoint | pdf | infopath | null | null | null | open | Sharepoint Infopath saving as pdf
===
I currently have an infopath form attached to my sharepoint library and I'm trying to save the forms as pdf. That is when a user fills out the form and clicks save instead of saving as an infopath form template it saves as a pdf file. Is this possible, if so can someone point me in a starting direction? Thanks! | 0 |
11,472,657 | 07/13/2012 14:35:43 | 988,125 | 10/10/2011 17:25:13 | 45 | 4 | BayesNetToolbox parameter learning | My question is specific to the "learn_params()" function of the [BayesNetToolbox][1]. In the user manual, "learn_params()" is stated to be suitable for use only if the input data is fully observed. I have tried it with a partially observed dataset where I represented unobserved values as NaN's.
It seems like "learn_params()" can deal with NaNs and the node state combinations that do not occur in the dataset. When I apply dirichlet priors to smoothen the 0 values, I get 'sensible' MLE distributions for all nodes. I have copied the script where I do this.
Can someone clarify whether what I am doing makes sense or if I am missing
something, i.e. the reason why "learn_params()" cannot be used with partially
observed data.
The MatLab Script where I test this is here:
% Incomplete dataset (where NaN's are unobserved)
Age = [1,2,2,NaN,3,3,2,1,NaN,2,1,1,3,NaN,2,2,1,NaN,3,1];
TNMStage = [2,4,2,3,NaN,1,NaN,3,1,4,3,NaN,2,4,3,4,1,NaN,2,4];
Treatment = [2,3,3,NaN,2,NaN,4,4,3,3,NaN,2,NaN,NaN,4,2,NaN,3,NaN,4];
Survival = [1,2,1,2,2,1,1,1,1,2,2,1,2,2,1,2,1,2,2,1];
matrixdata = [Age;TNMStage;Treatment;Survival];
node_sizes =[3,4,4,2];
% Enter the variablesmap
keys = {'Age', 'TNM','Treatment', 'Survival'};
v= 1:1:length(keys);
VariablesMap = containers.Map(keys,v);
% create the dag and the bnet
N = length(node_sizes); % Instead of entering it manually
dag2 = zeros(N,N);
dag2(VariablesMap('Treatment'),VariablesMap('Survival')) = 1;
bnet21 = mk_bnet(dag2, node_sizes);
draw_graph(bnet21.dag);
dirichletweight=1;
% define the CPD priors you want to use
bnet23.CPD{VariablesMap('Age')} = tabular_CPD(bnet23, VariablesMap('Age'), 'prior_type', 'dirichlet','dirichlet_type', 'unif', 'dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('TNM')} = tabular_CPD(bnet23, VariablesMap('TNM'), 'prior_type', 'dirichlet','dirichlet_type', 'unif', 'dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('Treatment')} = tabular_CPD(bnet23, VariablesMap('Treatment'), 'prior_type', 'dirichlet','dirichlet_type', 'unif','dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('Survival')} = tabular_CPD(bnet23, VariablesMap('Survival'), 'prior_type', 'dirichlet','dirichlet_type', 'unif','dirichlet_weight', dirichletweight);
% Find MLEs from incomplete data with Dirichlet prior CPDs
bnet24 = learn_params(bnet23, matrixdata);
% Look at the new CPT values after parameter estimation has been carried out
CPT24 = cell(1,N);
for i=1:N
s=struct(bnet24.CPD{i}); % violate object privacy
CPT24{i}=s.CPT;
end
[1]: http://bnt.googlecode.com/svn/trunk/docs/usage.html#prior | null | bayesian-networks | dirichlet | null | null | null | open | BayesNetToolbox parameter learning
===
My question is specific to the "learn_params()" function of the [BayesNetToolbox][1]. In the user manual, "learn_params()" is stated to be suitable for use only if the input data is fully observed. I have tried it with a partially observed dataset where I represented unobserved values as NaN's.
It seems like "learn_params()" can deal with NaNs and the node state combinations that do not occur in the dataset. When I apply dirichlet priors to smoothen the 0 values, I get 'sensible' MLE distributions for all nodes. I have copied the script where I do this.
Can someone clarify whether what I am doing makes sense or if I am missing
something, i.e. the reason why "learn_params()" cannot be used with partially
observed data.
The MatLab Script where I test this is here:
% Incomplete dataset (where NaN's are unobserved)
Age = [1,2,2,NaN,3,3,2,1,NaN,2,1,1,3,NaN,2,2,1,NaN,3,1];
TNMStage = [2,4,2,3,NaN,1,NaN,3,1,4,3,NaN,2,4,3,4,1,NaN,2,4];
Treatment = [2,3,3,NaN,2,NaN,4,4,3,3,NaN,2,NaN,NaN,4,2,NaN,3,NaN,4];
Survival = [1,2,1,2,2,1,1,1,1,2,2,1,2,2,1,2,1,2,2,1];
matrixdata = [Age;TNMStage;Treatment;Survival];
node_sizes =[3,4,4,2];
% Enter the variablesmap
keys = {'Age', 'TNM','Treatment', 'Survival'};
v= 1:1:length(keys);
VariablesMap = containers.Map(keys,v);
% create the dag and the bnet
N = length(node_sizes); % Instead of entering it manually
dag2 = zeros(N,N);
dag2(VariablesMap('Treatment'),VariablesMap('Survival')) = 1;
bnet21 = mk_bnet(dag2, node_sizes);
draw_graph(bnet21.dag);
dirichletweight=1;
% define the CPD priors you want to use
bnet23.CPD{VariablesMap('Age')} = tabular_CPD(bnet23, VariablesMap('Age'), 'prior_type', 'dirichlet','dirichlet_type', 'unif', 'dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('TNM')} = tabular_CPD(bnet23, VariablesMap('TNM'), 'prior_type', 'dirichlet','dirichlet_type', 'unif', 'dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('Treatment')} = tabular_CPD(bnet23, VariablesMap('Treatment'), 'prior_type', 'dirichlet','dirichlet_type', 'unif','dirichlet_weight', dirichletweight);
bnet23.CPD{VariablesMap('Survival')} = tabular_CPD(bnet23, VariablesMap('Survival'), 'prior_type', 'dirichlet','dirichlet_type', 'unif','dirichlet_weight', dirichletweight);
% Find MLEs from incomplete data with Dirichlet prior CPDs
bnet24 = learn_params(bnet23, matrixdata);
% Look at the new CPT values after parameter estimation has been carried out
CPT24 = cell(1,N);
for i=1:N
s=struct(bnet24.CPD{i}); % violate object privacy
CPT24{i}=s.CPT;
end
[1]: http://bnt.googlecode.com/svn/trunk/docs/usage.html#prior | 0 |
11,472,660 | 07/13/2012 14:36:12 | 975,469 | 10/02/2011 14:40:04 | 89 | 0 | Suggest a good TCP packet analyser which shows Signal Strength and Noise Level | Can anyone suggest a good TCP packet analyser or any other good network protocol analysis tool which shows properties like Signal Strength and Background noise? I tried using Wireshark and wavemon, but they dont seem to be showing these values.
Could someone help me out? | tcp | wireless | null | null | null | null | open | Suggest a good TCP packet analyser which shows Signal Strength and Noise Level
===
Can anyone suggest a good TCP packet analyser or any other good network protocol analysis tool which shows properties like Signal Strength and Background noise? I tried using Wireshark and wavemon, but they dont seem to be showing these values.
Could someone help me out? | 0 |
11,472,661 | 07/13/2012 14:36:13 | 1,523,844 | 07/13/2012 14:30:55 | 1 | 0 | uses pipe to communicate between two children | I'm trying to write some code which uses pipes to communicate between two children. children A sent children B "Hello" and children B return to children A "hELLO". I'm not really sure how to fix this problem, and any help will be greatly appreciated. | pipe | null | null | null | null | null | open | uses pipe to communicate between two children
===
I'm trying to write some code which uses pipes to communicate between two children. children A sent children B "Hello" and children B return to children A "hELLO". I'm not really sure how to fix this problem, and any help will be greatly appreciated. | 0 |
11,472,662 | 07/13/2012 14:36:17 | 1,481,372 | 06/26/2012 00:32:44 | 19 | 0 | Javascript MySQL What does insert return | In my script I execute my inserts like this
sql ="INSERT INTO table (fields) VALUES ("values")
connection.query(sql, function(error, rows, fields)
rows.InsertId seems to contain one of the inserted rows but I don't know if its the first or the last row inserted
this is the mysql node.js implementation I'm using, the documentation only says this.
https://github.com/felixge/node-mysql | javascript | mysql | node.js | null | null | null | open | Javascript MySQL What does insert return
===
In my script I execute my inserts like this
sql ="INSERT INTO table (fields) VALUES ("values")
connection.query(sql, function(error, rows, fields)
rows.InsertId seems to contain one of the inserted rows but I don't know if its the first or the last row inserted
this is the mysql node.js implementation I'm using, the documentation only says this.
https://github.com/felixge/node-mysql | 0 |
11,350,923 | 07/05/2012 19:07:25 | 1,449,316 | 06/11/2012 15:28:10 | 41 | 8 | sslv3 alert certificate unknown | When running the code
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert ECert.pem -key EKey.pem
I get the error
5155:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:/SourceCache/OpenSSL098/OpenSSL098-44/src/ssl/s3_pkt.c:1102:SSL alert number 46
5155:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/SourceCache/OpenSSL098/OpenSSL098-44/src/ssl/s23_lib.c:182:
I have tried to start over and get the certificate and I have tried to get the private key again but if anyone can give me advise on how to fix this would be great.
| openssl | apple-push-notifications | null | null | null | null | open | sslv3 alert certificate unknown
===
When running the code
openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert ECert.pem -key EKey.pem
I get the error
5155:error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown:/SourceCache/OpenSSL098/OpenSSL098-44/src/ssl/s3_pkt.c:1102:SSL alert number 46
5155:error:140790E5:SSL routines:SSL23_WRITE:ssl handshake failure:/SourceCache/OpenSSL098/OpenSSL098-44/src/ssl/s23_lib.c:182:
I have tried to start over and get the certificate and I have tried to get the private key again but if anyone can give me advise on how to fix this would be great.
| 0 |
11,350,924 | 07/05/2012 19:07:38 | 617,207 | 02/15/2011 04:32:35 | 98 | 1 | Yii Debug Toolbar error: not finding javascript lib | I downloaded the Debug Toolbar today (7/5/12) from github, and followed the installation instructions.
https://github.com/malyshev/yii-debug-toolbar
I'm getting the following javascript error:
"Uncaught ReferenceError: yiiDebugToolbar is not defined"
...on this line:
(function($) {$(function(){yiiDebugToolbar.init()})}(jQuery));
I checked and the yii.debugtoolbar.js lib is installed under 'assets/84af4f51'. I also stepped through the php code and confirmed registerScriptFile() is being called for this file in YiiDebugToolbar.php.
Kind of stuck what's going on here. Is it a bug or is there some setup step I missed?
I'm running:
Yii 1.1.9 | php | javascript | yii | toolbar | xdebug | null | open | Yii Debug Toolbar error: not finding javascript lib
===
I downloaded the Debug Toolbar today (7/5/12) from github, and followed the installation instructions.
https://github.com/malyshev/yii-debug-toolbar
I'm getting the following javascript error:
"Uncaught ReferenceError: yiiDebugToolbar is not defined"
...on this line:
(function($) {$(function(){yiiDebugToolbar.init()})}(jQuery));
I checked and the yii.debugtoolbar.js lib is installed under 'assets/84af4f51'. I also stepped through the php code and confirmed registerScriptFile() is being called for this file in YiiDebugToolbar.php.
Kind of stuck what's going on here. Is it a bug or is there some setup step I missed?
I'm running:
Yii 1.1.9 | 0 |
11,350,931 | 07/05/2012 19:07:58 | 1,504,940 | 07/05/2012 18:54:29 | 1 | 0 | how to pass input text value as method parameter from JSF page to Managedbean? | I want to pass input text value as method parameter from jsf page to managedbean as i submit the form. like
<h:form>
<p:inputText name="fname"/>
<P:commandButton value="Submit" action="#{myClass.save(inputText value as parameters)}">
</h:form> | jsf | java-ee | null | null | null | null | open | how to pass input text value as method parameter from JSF page to Managedbean?
===
I want to pass input text value as method parameter from jsf page to managedbean as i submit the form. like
<h:form>
<p:inputText name="fname"/>
<P:commandButton value="Submit" action="#{myClass.save(inputText value as parameters)}">
</h:form> | 0 |
11,350,934 | 07/05/2012 19:08:09 | 472,700 | 10/11/2010 21:18:44 | 401 | 8 | google visualization - Incompatible data table: Error: Table contains more columns than expected | I'm having an issue with creating a GeoChart. My code looks like this:
var table = new google.visualization.DataTable();
//set the columns for the table
table.addColumn('string', 'Latitude');
table.addColumn('string', 'Longitude');
table.addColumn({
type: 'string',
role: 'tooltip'
});
table.addColumn('number', 'Music Consumers');
var rows = [
["42.651445", "-73.755254", "Albany-Schenectady-Troy NY", 100],
["35.2225", "-80.837539", "Charlotte NC", 106],
...
];
table.addRows(rows);
The above code yields a red error box where the chart should be that reads:
Incompatible data table: Error: Table contains more columns than expected (Expecting 3 columns)
I've verified that all the lists in the rows list do have 4 members (lat, long, desc, value). Any idea why it's saying that it's expecting only 3 columns?
| javascript | google-visualization | null | null | null | null | open | google visualization - Incompatible data table: Error: Table contains more columns than expected
===
I'm having an issue with creating a GeoChart. My code looks like this:
var table = new google.visualization.DataTable();
//set the columns for the table
table.addColumn('string', 'Latitude');
table.addColumn('string', 'Longitude');
table.addColumn({
type: 'string',
role: 'tooltip'
});
table.addColumn('number', 'Music Consumers');
var rows = [
["42.651445", "-73.755254", "Albany-Schenectady-Troy NY", 100],
["35.2225", "-80.837539", "Charlotte NC", 106],
...
];
table.addRows(rows);
The above code yields a red error box where the chart should be that reads:
Incompatible data table: Error: Table contains more columns than expected (Expecting 3 columns)
I've verified that all the lists in the rows list do have 4 members (lat, long, desc, value). Any idea why it's saying that it's expecting only 3 columns?
| 0 |
11,350,929 | 07/05/2012 19:07:56 | 624,624 | 02/19/2011 18:54:00 | 1 | 0 | Rails application unable to connect to mysql, Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) (Mysql2::Error) | Hello lovely people of the stack!
I'm currently stuck on what is (I hope a newby) problem with a rails project (this is my first rails project and so I apologise if I miss anything crucial). I've been at this for a couple of hours and can't seem to find any solutions. I have tried the solutions to the following threads with no avail.
[connect to local MySQL server through socket][1]
[Can't connect to local MySQL server through socket][2]
[Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)][3]
[Can't connect to local MySQL server through socket '/tmp/mysql.sock'][4]
The list goes on, anyway some of the threads are similar to my situation others are just clutching at straws. Let me give you a quick overview of my situation.
- The project has been developed on a mac
- I have recently set up a test server as a means of learning the deployment process
- The server is running Ubuntu Server 12.04
I managed to follow some tutorials to set it up including the [Capistrano][5] deployment tutorial up to the point of:
$ rake RAILS_ENV=production db:schema:load
which was where I first encountered the Can't connect to local MySQL server error.
if I run it with --trace I get the following output:
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/model_schema.rb:308:in `clear_cache!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:418:in `_run__427268845__prepare__407057367__callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/little_oven_deploy/releases/20120705162026/config/environment.rb:5:in `<top (required)>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `load'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `<main>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/bin/ruby_noexec_wrapper:14:in `eval'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:schema:load => environment
my database.yml file is as follows:
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_devel
pool: 5
username: devel
password: Development1
socket: /var/run/mysqld/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_production
pool: 5
username: production
password: Production1
socket: /var/run/mysqld/mysql.sock
Note that I have changed the location of the socket variable to correspond with what I believe is the .sock file on ubuntu as this differs from a standard install on mac OSX.
finally, I also get the same error when running
rails c
with the following output:
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) (Mysql2::Error)
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:418:in `_run__485859349__prepare__1069885904__callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/www/little_oven_deploy/releases/20120705162026/config/environment.rb:5:in `<top (required)>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I would like to point out that the location /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb is valid. Also, mysql is running and I can access it with:
mysql -u production -p
I'm not sure how you could possibly need any more info from me but obviously if you do, let me know and I'll happily oblige, any help that you can give would be very much appreciated
Thanks in advance
[1]: http://stackoverflow.com/questions/6525917/connect-to-local-mysql-server-through-socket
[2]: http://stackoverflow.com/questions/2182919/cant-connect-to-local-mysql-server-through-socket
[3]: http://stackoverflow.com/questions/7843731/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock-2
[4]: http://stackoverflow.com/questions/7310967/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock
[5]: https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning
| mysql | ruby-on-rails | ubuntu | null | null | null | open | Rails application unable to connect to mysql, Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) (Mysql2::Error)
===
Hello lovely people of the stack!
I'm currently stuck on what is (I hope a newby) problem with a rails project (this is my first rails project and so I apologise if I miss anything crucial). I've been at this for a couple of hours and can't seem to find any solutions. I have tried the solutions to the following threads with no avail.
[connect to local MySQL server through socket][1]
[Can't connect to local MySQL server through socket][2]
[Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)][3]
[Can't connect to local MySQL server through socket '/tmp/mysql.sock'][4]
The list goes on, anyway some of the threads are similar to my situation others are just clutching at straws. Let me give you a quick overview of my situation.
- The project has been developed on a mac
- I have recently set up a test server as a means of learning the deployment process
- The server is running Ubuntu Server 12.04
I managed to follow some tutorials to set it up including the [Capistrano][5] deployment tutorial up to the point of:
$ rake RAILS_ENV=production db:schema:load
which was where I first encountered the Can't connect to local MySQL server error.
if I run it with --trace I get the following output:
** Invoke db:schema:load (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2)
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/model_schema.rb:308:in `clear_cache!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:418:in `_run__427268845__prepare__407057367__callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
/var/www/little_oven_deploy/releases/20120705162026/config/environment.rb:5:in `<top (required)>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:292:in `block (2 levels) in initialize_tasks'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `call'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:205:in `block in execute'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:200:in `execute'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:158:in `block in invoke_with_call_chain'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:176:in `block in invoke_prerequisites'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:174:in `invoke_prerequisites'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:157:in `block in invoke_with_call_chain'
/usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:151:in `invoke_with_call_chain'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/task.rb:144:in `invoke'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:116:in `invoke_task'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block (2 levels) in top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `each'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:94:in `block in top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:88:in `top_level'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:66:in `block in run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:133:in `standard_exception_handling'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/lib/rake/application.rb:63:in `run'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/gems/rake-0.9.2.2/bin/rake:33:in `<top (required)>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `load'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@global/bin/rake:19:in `<main>'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/bin/ruby_noexec_wrapper:14:in `eval'
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:schema:load => environment
my database.yml file is as follows:
# MySQL. Versions 4.1 and 5.0 are recommended.
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_devel
pool: 5
username: devel
password: Development1
socket: /var/run/mysqld/mysql.sock
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_test
pool: 5
username: root
password:
socket: /tmp/mysql.sock
production:
adapter: mysql2
encoding: utf8
reconnect: false
database: little_oven_production
pool: 5
username: production
password: Production1
socket: /var/run/mysqld/mysql.sock
Note that I have changed the location of the socket variable to correspond with what I believe is the .sock file on ubuntu as this differs from a standard install on mac OSX.
finally, I also get the same error when running
rails c
with the following output:
/usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `connect': Can't connect to local MySQL server through socket '/var/run/mysqld/mysql.sock' (2) (Mysql2::Error)
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb:44:in `initialize'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `new'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/mysql2_adapter.rb:16:in `mysql2_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:277:in `new_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:287:in `checkout_new_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:235:in `block (2 levels) in checkout'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `loop'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:230:in `block in checkout'
from /usr/share/ruby-rvm/rubies/ruby-1.9.2-p318/lib/ruby/1.9.1/monitor.rb:201:in `mon_synchronize'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:229:in `checkout'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:95:in `connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_pool.rb:374:in `retrieve_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:168:in `retrieve_connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:142:in `connection'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/model_schema.rb:308:in `clear_cache!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activerecord-3.2.2/lib/active_record/railtie.rb:91:in `block (2 levels) in <class:Railtie>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:418:in `_run__485859349__prepare__1069885904__callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:405:in `__run_callback'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:385:in `_run_prepare_callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/callbacks.rb:81:in `run_callbacks'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:74:in `prepare!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/actionpack-3.2.2/lib/action_dispatch/middleware/reloader.rb:48:in `prepare!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application/finisher.rb:47:in `block in <module:Finisher>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `instance_exec'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:30:in `run'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:55:in `block in run_initializers'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `each'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/initializable.rb:54:in `run_initializers'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:136:in `initialize!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/railtie/configurable.rb:30:in `method_missing'
from /var/www/little_oven_deploy/releases/20120705162026/config/environment.rb:5:in `<top (required)>'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `block in require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:236:in `load_dependency'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/activesupport-3.2.2/lib/active_support/dependencies.rb:251:in `require'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/application.rb:103:in `require_environment!'
from /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/railties-3.2.2/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
I would like to point out that the location /usr/share/ruby-rvm/gems/ruby-1.9.2-p318@rails_3_2/gems/mysql2-0.3.11/lib/mysql2/client.rb is valid. Also, mysql is running and I can access it with:
mysql -u production -p
I'm not sure how you could possibly need any more info from me but obviously if you do, let me know and I'll happily oblige, any help that you can give would be very much appreciated
Thanks in advance
[1]: http://stackoverflow.com/questions/6525917/connect-to-local-mysql-server-through-socket
[2]: http://stackoverflow.com/questions/2182919/cant-connect-to-local-mysql-server-through-socket
[3]: http://stackoverflow.com/questions/7843731/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock-2
[4]: http://stackoverflow.com/questions/7310967/cant-connect-to-local-mysql-server-through-socket-tmp-mysql-sock
[5]: https://github.com/capistrano/capistrano/wiki/2.x-From-The-Beginning
| 0 |
11,350,943 | 07/05/2012 19:09:17 | 1,502,288 | 07/04/2012 18:45:53 | 3 | 0 | Is python celery only for servers or websites? | Can I use celery for a windows machine? If so how does celery work, does it run in the task manger 24/7? Or is celery only for websites. I tired to use this code:
from celery.schedules import crontab
CELERYBEAT_SCHEDULE = {
"every-morning": {
"myprogram": "myprogram.py",
"schedule": crontab(hour=7, minute=30),
},
}
What I'm trying to achieve here is to have myprogram.py ran everyday at 7:30 using python. If theres a better way to do this I would love to hear it. Thanks in advance! | python | windows | celery | schedule | null | null | open | Is python celery only for servers or websites?
===
Can I use celery for a windows machine? If so how does celery work, does it run in the task manger 24/7? Or is celery only for websites. I tired to use this code:
from celery.schedules import crontab
CELERYBEAT_SCHEDULE = {
"every-morning": {
"myprogram": "myprogram.py",
"schedule": crontab(hour=7, minute=30),
},
}
What I'm trying to achieve here is to have myprogram.py ran everyday at 7:30 using python. If theres a better way to do this I would love to hear it. Thanks in advance! | 0 |
11,350,946 | 07/05/2012 19:09:28 | 927,989 | 09/04/2011 21:18:57 | 36 | 0 | how to get top 5 for each category | I am using mysql.
I have one table called flow_data
There is two attributes category and views.
category is int type and views is int type.
category has 1-5(for example num 0 is video and num 1 is pics) and numbers of view is based on how many times users click.
I want to query data that top5 views for each category.
SELECT DISTINCT id, cat, title, file , type , tags FROM flow_data ORDER BY views LIMIT 5
It only returns top5 views not based on each category.
Any thought? Thank you advance.
| mysql | null | null | null | null | null | open | how to get top 5 for each category
===
I am using mysql.
I have one table called flow_data
There is two attributes category and views.
category is int type and views is int type.
category has 1-5(for example num 0 is video and num 1 is pics) and numbers of view is based on how many times users click.
I want to query data that top5 views for each category.
SELECT DISTINCT id, cat, title, file , type , tags FROM flow_data ORDER BY views LIMIT 5
It only returns top5 views not based on each category.
Any thought? Thank you advance.
| 0 |
11,401,560 | 07/09/2012 19:14:56 | 749,090 | 05/11/2011 16:23:03 | 34 | 0 | PHP shut ignore_user_abort process | I was testing something that ran an ignore_user_abort process,
<br>now its running forever and i don't know how to handle or close it,
how is it possible ?
and is it possible to access them through terminal ? | php | loops | process | abort | null | null | open | PHP shut ignore_user_abort process
===
I was testing something that ran an ignore_user_abort process,
<br>now its running forever and i don't know how to handle or close it,
how is it possible ?
and is it possible to access them through terminal ? | 0 |
11,401,561 | 07/09/2012 19:14:58 | 409,536 | 08/03/2010 10:21:26 | 11 | 1 | Teacher-Student App; Communication between mobile devices | A client asked me to write an app(iOS) for him, in where the teacher does something on his tablet and the students see it in realtime on their mobile devices.
Now, what is the best way to approach that technologically?
I have thought of these ways so far:
- Setup a server and do the communication over the server -> Problem: the client devices would need some kind of push notification system
- register all the client devices to the teacher device and then communicate directly with them
Neither of these ways does sound nice to me. Does anyone of you have experience with this kind of use case? Is there maybe a another easier alternative to do it? Is there some kind of RMI for iOS?
Many thanks in advance for your answers! :) | ios | mobile | client-server | communication | null | null | open | Teacher-Student App; Communication between mobile devices
===
A client asked me to write an app(iOS) for him, in where the teacher does something on his tablet and the students see it in realtime on their mobile devices.
Now, what is the best way to approach that technologically?
I have thought of these ways so far:
- Setup a server and do the communication over the server -> Problem: the client devices would need some kind of push notification system
- register all the client devices to the teacher device and then communicate directly with them
Neither of these ways does sound nice to me. Does anyone of you have experience with this kind of use case? Is there maybe a another easier alternative to do it? Is there some kind of RMI for iOS?
Many thanks in advance for your answers! :) | 0 |
11,401,571 | 07/09/2012 19:15:47 | 1,510,063 | 07/08/2012 13:21:02 | 10 | 0 | NSTextField call IBAction on text change | In visual studio there is an event called **text_changed** for text boxes, how can I create a similar event/Action in Cocoa?
And in general how do you get these extra events for form controls? e.g. mouse over, in visual studio you just choose from a list of events. | xcode | cocoa | events | nstextfield | ibaction | null | open | NSTextField call IBAction on text change
===
In visual studio there is an event called **text_changed** for text boxes, how can I create a similar event/Action in Cocoa?
And in general how do you get these extra events for form controls? e.g. mouse over, in visual studio you just choose from a list of events. | 0 |
11,401,572 | 07/09/2012 19:15:52 | 759,405 | 05/18/2011 14:37:29 | 104 | 2 | How can I concatenate a file and string into a new file in UNIX as a one line command | So perhaps my inexperience is to blame, but I need a very simple (hopefully) 1 liner command that reads in a file appends a string and outputs to a new file, without changing the original data.
file1 string
------ ------
apple oranges
bananas
MAGIC COMMAND
filel file2
------ ------
apple apple
bananas bananas
oranges
basically, cat file1 + 'oranges' > file2
| unix | null | null | null | null | null | open | How can I concatenate a file and string into a new file in UNIX as a one line command
===
So perhaps my inexperience is to blame, but I need a very simple (hopefully) 1 liner command that reads in a file appends a string and outputs to a new file, without changing the original data.
file1 string
------ ------
apple oranges
bananas
MAGIC COMMAND
filel file2
------ ------
apple apple
bananas bananas
oranges
basically, cat file1 + 'oranges' > file2
| 0 |
11,401,573 | 07/09/2012 19:15:57 | 1,512,918 | 07/09/2012 19:10:45 | 1 | 0 | Realtime Stock Quotes | you had once mentioned that you were using boerse.de to get realtime stock quotes. I am working on a mobile application to pull in realtime stock quotes for US markets. Yahoo is not real-time enough, any other suggestions you might have? | jquery | ios4 | null | null | null | 07/10/2012 00:48:00 | not a real question | Realtime Stock Quotes
===
you had once mentioned that you were using boerse.de to get realtime stock quotes. I am working on a mobile application to pull in realtime stock quotes for US markets. Yahoo is not real-time enough, any other suggestions you might have? | 1 |
11,401,577 | 07/09/2012 19:16:04 | 1,212,047 | 02/15/2012 17:49:16 | 15 | 0 | Body Height pushing down footer to far | I am having trouble with my body extending my footer to far .
My CSS :
body{
background-color:#EDEDED !important;
background-image:url('http://static.lukepolo.com/public/assets/img/broken_noise.png') !important;
}
body > .container{
min-height:100%;
}
html, body {
height: 100%;
}
footer{
padding:10px;
background-image:url('http://static.lukepolo.com/public/assets/img/broken_noise.png') !important;
color:white;
}
footer p{
display:inline-block;
}
My HTML :
<div class="container">
</div>
<footer>
<?php echo $footer;?>
</footer>
Here is my link:
http://lukepolo.com/blog
Here is an image that may help to understand:
http://img18.imageshack.us/img18/6575/helpgh.png | css | css3 | twitter-bootstrap | null | null | null | open | Body Height pushing down footer to far
===
I am having trouble with my body extending my footer to far .
My CSS :
body{
background-color:#EDEDED !important;
background-image:url('http://static.lukepolo.com/public/assets/img/broken_noise.png') !important;
}
body > .container{
min-height:100%;
}
html, body {
height: 100%;
}
footer{
padding:10px;
background-image:url('http://static.lukepolo.com/public/assets/img/broken_noise.png') !important;
color:white;
}
footer p{
display:inline-block;
}
My HTML :
<div class="container">
</div>
<footer>
<?php echo $footer;?>
</footer>
Here is my link:
http://lukepolo.com/blog
Here is an image that may help to understand:
http://img18.imageshack.us/img18/6575/helpgh.png | 0 |
11,401,581 | 07/09/2012 19:16:20 | 1,433,094 | 06/03/2012 02:50:07 | 1 | 0 | Do not have permission to call getPageByUrl | Thanks all for your attention to this.
I have written a new script on a Google Site that accesses a spreadsheet and displays the data to an existing List page. Similar scripts on the Site are working properly, however, in this script this particular piece of code:
var page = SitesApp.getPageByUrl("https://www.google.com/a/domain.com/page-url");
returns an error message: "You do not have permission to call getPageByUrl".
I am the owner of the site and target page. Not sure what's going on here. Can anyone lend a hand?
Chris | google-apps-script | null | null | null | null | null | open | Do not have permission to call getPageByUrl
===
Thanks all for your attention to this.
I have written a new script on a Google Site that accesses a spreadsheet and displays the data to an existing List page. Similar scripts on the Site are working properly, however, in this script this particular piece of code:
var page = SitesApp.getPageByUrl("https://www.google.com/a/domain.com/page-url");
returns an error message: "You do not have permission to call getPageByUrl".
I am the owner of the site and target page. Not sure what's going on here. Can anyone lend a hand?
Chris | 0 |
11,594,550 | 07/21/2012 17:51:30 | 1,496,581 | 07/02/2012 16:13:23 | 66 | 6 | Persist using stored procedure with return id | PostgreSQL 9.1, Hibernate 4.1. <br>
How can I persist PropertyTypeEntity using stored procedure (problem in return id. GenerationType.IDENTITY) <br>
It impossible?
@Table(name = "property_types", schema = "public", catalog = "")
@Entity
public class PropertyTypeEntity implements IEntity<Long> {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
...
}
| java | hibernate | postgresql | jpa | null | null | open | Persist using stored procedure with return id
===
PostgreSQL 9.1, Hibernate 4.1. <br>
How can I persist PropertyTypeEntity using stored procedure (problem in return id. GenerationType.IDENTITY) <br>
It impossible?
@Table(name = "property_types", schema = "public", catalog = "")
@Entity
public class PropertyTypeEntity implements IEntity<Long> {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
...
}
| 0 |
11,567,309 | 07/19/2012 18:44:19 | 1,350,140 | 04/22/2012 21:56:01 | 1 | 0 | How to stop mysql table select query for any application user except one? | I know that my question is related to transactions or tables lock, but I could not able to manage it. My PHP application has to select some values from a table then it has to loop through the results to update some values in the same result.
I want the application to stop any user select when there is a select query is operating till the loop is completed.
I used lock tables write, but it prevented the application to do the update.
My application is built on CakePHP 1.2.11. | mysql | transactions | cakephp-1.2 | null | null | null | open | How to stop mysql table select query for any application user except one?
===
I know that my question is related to transactions or tables lock, but I could not able to manage it. My PHP application has to select some values from a table then it has to loop through the results to update some values in the same result.
I want the application to stop any user select when there is a select query is operating till the loop is completed.
I used lock tables write, but it prevented the application to do the update.
My application is built on CakePHP 1.2.11. | 0 |
11,567,312 | 07/19/2012 18:44:48 | 515,827 | 11/22/2010 09:00:47 | 432 | 31 | Active Admin Navigation Links | How do you add your own custom links dynamically to the ActiveAdmin global navigation header other than registering the pages/models? For example, if I want a link that can direct users to my home page for instance. | ruby-on-rails | ruby | ruby-on-rails-3 | ruby-on-rails-3.1 | rubygems | null | open | Active Admin Navigation Links
===
How do you add your own custom links dynamically to the ActiveAdmin global navigation header other than registering the pages/models? For example, if I want a link that can direct users to my home page for instance. | 0 |
11,573,110 | 07/20/2012 04:55:41 | 825,757 | 07/02/2011 04:22:41 | 889 | 34 | Flash Widget has visual errors | I am using a [Widget provided by NBC][1] to show a Medal Count on my website. When I install it on my site the widget has visual errors. Here is an example of what I talk about:
![Image of Error][2]
The image on the left has lines through it (showing the background image) while the one on the right is how it should look.
Here is the code I am using:
<div style="background: url(/images/blog/olympic-rings.jpg)
no-repeat scroll center center transparent; height: 572px; width: 920px;">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div style="width: 300px;" class="center">
<iframe width="300" scrolling="no" height="250" frameborder="0"
src="http://www.nbcolympics.com/widgetscore/medaltracker/medaltracker.html"
id="medaltracker2012"></iframe>
</div>
<p> </p>
<p> </p>
<p> </p>
</div>
Why is this happening and how do I fix the issue?
[1]: http://www.nbcolympics.com/widgets/index.html
[2]: http://i.stack.imgur.com/DiESv.jpg | flash | widget | widgets | null | null | null | open | Flash Widget has visual errors
===
I am using a [Widget provided by NBC][1] to show a Medal Count on my website. When I install it on my site the widget has visual errors. Here is an example of what I talk about:
![Image of Error][2]
The image on the left has lines through it (showing the background image) while the one on the right is how it should look.
Here is the code I am using:
<div style="background: url(/images/blog/olympic-rings.jpg)
no-repeat scroll center center transparent; height: 572px; width: 920px;">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<div style="width: 300px;" class="center">
<iframe width="300" scrolling="no" height="250" frameborder="0"
src="http://www.nbcolympics.com/widgetscore/medaltracker/medaltracker.html"
id="medaltracker2012"></iframe>
</div>
<p> </p>
<p> </p>
<p> </p>
</div>
Why is this happening and how do I fix the issue?
[1]: http://www.nbcolympics.com/widgets/index.html
[2]: http://i.stack.imgur.com/DiESv.jpg | 0 |
11,594,564 | 07/21/2012 17:53:45 | 1,542,998 | 07/21/2012 17:26:11 | 1 | 0 | UIButton image animation | <!-- language: lang-c -->
Hi,
i'm trying to animate the image of a UIButton between two different image.
Let's say i have two square images, on RED, on BLACK.
When i touch my Button, i want the image of the uibutton to loop from both images, in a smooth animation.
the loop animation must start whenever the user touch down the button and canceled when he touch Up inside or drag exit.
Here is what i do now :
-(void)startAnimation:(UIButton *)obj {
[UIView animateWithDuration:1 delay:0 options:(UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat) animations:^{
[obj setAlpha:0];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateNormal];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateHighlighted];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateDisabled];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateSelected];
} completion:^(BOOL finished) {
[obj setAlpha:1];
[obj setImage:nil forState:UIControlStateNormal];
[obj setImage:nil forState:UIControlStateHighlighted];
[obj setImage:nil forState:UIControlStateDisabled];
[obj setImage:nil forState:UIControlStateSelected];
}];
}
-(void)stopAnimation:(UIButton *)obj {
[obj.layer removeAllAnimations];
}
- (void)touchDownAnimation:(id)obj {
[self startAnimation:obj];
}
- (void)dragEnterAnimation:(id)obj {
[self startAnimation:obj];
}
- (void)dragExitAnimation:(id)obj {
[self stopAnimation:obj];
}
- (void)touchUpInsideAnimation:(id)obj {
[self stopAnimation:obj];
}
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = CGRectMake(110, 180, 100, 100);
UIImageView *animatedButtonBackground = [[UIImageView alloc] initWithFrame:frame];
[animatedButtonBackground setImage:[UIImage imageNamed:@"animated_off"]];
[self.view addSubview:animatedButtonBackground];
UIButton *animatedButton = [UIButton buttonWithType:UIButtonTypeCustom];
[animatedButton setFrame:frame];
[animatedButton addTarget:self action:@selector(touchDownAnimation:) forControlEvents:UIControlEventTouchDown];
[animatedButton addTarget:self action:@selector(dragEnterAnimation:) forControlEvents:UIControlEventTouchDragEnter];
[animatedButton addTarget:self action:@selector(dragExitAnimation:) forControlEvents:UIControlEventTouchDragExit];
[animatedButton addTarget:self action:@selector(touchUpInsideAnimation:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:animatedButton];
}
it's kinda works, but involving an UIImageView in the process looks like a bad trick to do what i want...
i'm looking for a cleaner solution. | objective-c | animation | uibutton | null | null | null | open | UIButton image animation
===
<!-- language: lang-c -->
Hi,
i'm trying to animate the image of a UIButton between two different image.
Let's say i have two square images, on RED, on BLACK.
When i touch my Button, i want the image of the uibutton to loop from both images, in a smooth animation.
the loop animation must start whenever the user touch down the button and canceled when he touch Up inside or drag exit.
Here is what i do now :
-(void)startAnimation:(UIButton *)obj {
[UIView animateWithDuration:1 delay:0 options:(UIViewAnimationOptionAutoreverse | UIViewAnimationOptionRepeat) animations:^{
[obj setAlpha:0];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateNormal];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateHighlighted];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateDisabled];
[obj setImage:[UIImage imageNamed:@"animated_on"] forState:UIControlStateSelected];
} completion:^(BOOL finished) {
[obj setAlpha:1];
[obj setImage:nil forState:UIControlStateNormal];
[obj setImage:nil forState:UIControlStateHighlighted];
[obj setImage:nil forState:UIControlStateDisabled];
[obj setImage:nil forState:UIControlStateSelected];
}];
}
-(void)stopAnimation:(UIButton *)obj {
[obj.layer removeAllAnimations];
}
- (void)touchDownAnimation:(id)obj {
[self startAnimation:obj];
}
- (void)dragEnterAnimation:(id)obj {
[self startAnimation:obj];
}
- (void)dragExitAnimation:(id)obj {
[self stopAnimation:obj];
}
- (void)touchUpInsideAnimation:(id)obj {
[self stopAnimation:obj];
}
- (void)viewDidLoad
{
[super viewDidLoad];
CGRect frame = CGRectMake(110, 180, 100, 100);
UIImageView *animatedButtonBackground = [[UIImageView alloc] initWithFrame:frame];
[animatedButtonBackground setImage:[UIImage imageNamed:@"animated_off"]];
[self.view addSubview:animatedButtonBackground];
UIButton *animatedButton = [UIButton buttonWithType:UIButtonTypeCustom];
[animatedButton setFrame:frame];
[animatedButton addTarget:self action:@selector(touchDownAnimation:) forControlEvents:UIControlEventTouchDown];
[animatedButton addTarget:self action:@selector(dragEnterAnimation:) forControlEvents:UIControlEventTouchDragEnter];
[animatedButton addTarget:self action:@selector(dragExitAnimation:) forControlEvents:UIControlEventTouchDragExit];
[animatedButton addTarget:self action:@selector(touchUpInsideAnimation:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:animatedButton];
}
it's kinda works, but involving an UIImageView in the process looks like a bad trick to do what i want...
i'm looking for a cleaner solution. | 0 |
11,594,565 | 07/21/2012 17:53:55 | 926,577 | 09/03/2011 11:52:10 | 1 | 0 | inserting special chracter in table | can any one plese help me,
i have one form and when i inserting record in database if some special character in my string then my string breck in database field. like.
INSERT INTO pbdata (id,title,title1) VALUES ('111','statt Josephshöfer kabinett feinherb 2008','Weis');
if i am inserting like this then on database field its only insert record
111 statt Josephsh Weis
missing character = öfer kabinett feinherb 2008
please help me
thanks, | php | php5 | joomla | null | null | null | open | inserting special chracter in table
===
can any one plese help me,
i have one form and when i inserting record in database if some special character in my string then my string breck in database field. like.
INSERT INTO pbdata (id,title,title1) VALUES ('111','statt Josephshöfer kabinett feinherb 2008','Weis');
if i am inserting like this then on database field its only insert record
111 statt Josephsh Weis
missing character = öfer kabinett feinherb 2008
please help me
thanks, | 0 |
11,594,566 | 07/21/2012 17:54:00 | 239,219 | 12/27/2009 16:44:10 | 119 | 5 | How do you represent missing value in Core Data? | What do you use to store missing value state in Core Data? Former I used NSString and stored numbers as string i.e. @"10.25". And I always converted it before any numeric calculations. And the missing value was just set with @"". But I move forward, and want to choose a primitive Numeric type to store, I can't indicate, that the value is missing. Do you have any idea? | ios | core-data | missing | nsnumber | null | null | open | How do you represent missing value in Core Data?
===
What do you use to store missing value state in Core Data? Former I used NSString and stored numbers as string i.e. @"10.25". And I always converted it before any numeric calculations. And the missing value was just set with @"". But I move forward, and want to choose a primitive Numeric type to store, I can't indicate, that the value is missing. Do you have any idea? | 0 |
11,594,576 | 07/21/2012 17:54:45 | 1,103,669 | 09/17/2011 18:38:32 | 151 | 5 | Getting current browser url in Firefox Addon | I within a panel and I want to get the current browser URL. Nothing so far works. Here's what I've tested:
Only thing that even returns anything, I get something like `resource://jid0-18z0ptaugyu0arjkaoywztggyzg-at-jetpack/` and then my current panel resource. Obviously this is a scope problem but I don't know how to refer to the actual browser.
window.location.href
I've tried literally everything in the biggest Stack Overflow thread on this: http://stackoverflow.com/questions/410411/get-current-page-url-from-a-firefox-sidebar-extension. None of them return anything.
If it helps, I am using the Firefox Addon Builder. | javascript | firefox | firefox-addon | null | null | null | open | Getting current browser url in Firefox Addon
===
I within a panel and I want to get the current browser URL. Nothing so far works. Here's what I've tested:
Only thing that even returns anything, I get something like `resource://jid0-18z0ptaugyu0arjkaoywztggyzg-at-jetpack/` and then my current panel resource. Obviously this is a scope problem but I don't know how to refer to the actual browser.
window.location.href
I've tried literally everything in the biggest Stack Overflow thread on this: http://stackoverflow.com/questions/410411/get-current-page-url-from-a-firefox-sidebar-extension. None of them return anything.
If it helps, I am using the Firefox Addon Builder. | 0 |
11,411,113 | 07/10/2012 10:13:48 | 927,554 | 09/04/2011 13:07:00 | 438 | 30 | No method error from the code when everything works fine on console | I am trying to implement a very simple comment system I have done this before and it used to work, I don't know what is going wrong this time. I get this error `undefined method `firstname' for nil:NilClass` however it works fine from console. Please Help!!
Here is my comments table :-
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.text :comment
t.integer :user_id
t.references :user
t.references :photo
t.timestamps
end
add_index :comments, :photo_id
add_index :comments, :user_id
end
end
Comment model :-
attr_accessible :comment, :user
belongs_to :user
belongs_to :photo
Comments controller :-
class CommentsController < ApplicationController
before_filter :authenticate_user!
before_filter :find_photo
def create
@comment = @photo.comments.build(params[:comment].merge!(:user => current_user))
if @comment.save
redirect_to [@photo.theme,@photo]
else
redirect_to :back
end
end
def destroy
end
private
def find_photo
@photo = Photo.find(params[:photo_id])
end
end
Comments form :-
=form_for [@photo.theme,@photo,@photo.comments.build] do |f|
=f.text_field :comment, :placeholder => "Write a comment ...", :class => "custom-textarea-custom-width"
=f.submit :value => "Comment", :class => "small black button"
Comment show :-
[email protected] do |comment|
.row
=comment.comment
=comment.user.firstname
I get error on the line `=comment.user.firstname` , this is the error message undefined method `firstname' for nil:NilClass
I tried to run the same thing from console and it was working fine.
What could be the issue ?
| ruby-on-rails | ruby-on-rails-3 | null | null | null | null | open | No method error from the code when everything works fine on console
===
I am trying to implement a very simple comment system I have done this before and it used to work, I don't know what is going wrong this time. I get this error `undefined method `firstname' for nil:NilClass` however it works fine from console. Please Help!!
Here is my comments table :-
class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.text :comment
t.integer :user_id
t.references :user
t.references :photo
t.timestamps
end
add_index :comments, :photo_id
add_index :comments, :user_id
end
end
Comment model :-
attr_accessible :comment, :user
belongs_to :user
belongs_to :photo
Comments controller :-
class CommentsController < ApplicationController
before_filter :authenticate_user!
before_filter :find_photo
def create
@comment = @photo.comments.build(params[:comment].merge!(:user => current_user))
if @comment.save
redirect_to [@photo.theme,@photo]
else
redirect_to :back
end
end
def destroy
end
private
def find_photo
@photo = Photo.find(params[:photo_id])
end
end
Comments form :-
=form_for [@photo.theme,@photo,@photo.comments.build] do |f|
=f.text_field :comment, :placeholder => "Write a comment ...", :class => "custom-textarea-custom-width"
=f.submit :value => "Comment", :class => "small black button"
Comment show :-
[email protected] do |comment|
.row
=comment.comment
=comment.user.firstname
I get error on the line `=comment.user.firstname` , this is the error message undefined method `firstname' for nil:NilClass
I tried to run the same thing from console and it was working fine.
What could be the issue ?
| 0 |
11,411,121 | 07/10/2012 10:14:11 | 1,071,339 | 11/29/2011 13:07:12 | 109 | 1 | wordpress sidebar content in different languages | I am developing a site in wordpress.I want the purticular page from the site in four different languages(English,spanish,french and Dutch).I have used a plugin called **WP Native Dashboard**.Using this I am able to get the page content in four different languages.I used the combobox to select the language and display the content.This works fine.
I am creating a new page,select the language ,and writing the content in it.For same content in different language i am just writing the page id beside the language name as follows:
![enter image description here][1]
Main problem is about the sidebars,footer and the header content.I have one set of sidebar,footer and header in English language.When I select the different language (for example french) the sidebar,footer and header content is displayed in English.
If i try to create another set of sidebar,footer and header in other language and try to create a diffrent page called French left sidebar .In french content if i select the page as shown below:
![enter image description here][2]
.and on the site its displayed in french language in all other languages.
so my question is how to get the sidebar content in different language when we select the different language from the combobox..
[1]: http://i.stack.imgur.com/g6iv3.png
[2]: http://i.stack.imgur.com/EJ2Ih.png | php | wordpress | website | null | null | null | open | wordpress sidebar content in different languages
===
I am developing a site in wordpress.I want the purticular page from the site in four different languages(English,spanish,french and Dutch).I have used a plugin called **WP Native Dashboard**.Using this I am able to get the page content in four different languages.I used the combobox to select the language and display the content.This works fine.
I am creating a new page,select the language ,and writing the content in it.For same content in different language i am just writing the page id beside the language name as follows:
![enter image description here][1]
Main problem is about the sidebars,footer and the header content.I have one set of sidebar,footer and header in English language.When I select the different language (for example french) the sidebar,footer and header content is displayed in English.
If i try to create another set of sidebar,footer and header in other language and try to create a diffrent page called French left sidebar .In french content if i select the page as shown below:
![enter image description here][2]
.and on the site its displayed in french language in all other languages.
so my question is how to get the sidebar content in different language when we select the different language from the combobox..
[1]: http://i.stack.imgur.com/g6iv3.png
[2]: http://i.stack.imgur.com/EJ2Ih.png | 0 |
11,411,126 | 07/10/2012 10:14:32 | 260,808 | 01/28/2010 09:22:12 | 78 | 16 | Select field: Custom picker does not work on IPad | See the attached Main.js (below) which is the one and only view and module of a test application. It shows a select field with a modified behaviour. It does not use the standard picker, but a custom-built panel of the class test.view.Select. On initializing the main panel, the onMaskTap event of the select field gets modified so that it creates the custom select panel (if necessary), sets a link to it via the "caller" variable and shows it. On tapping a button, the modal Select window sets the appropriate value in the underlying select field and hides itself.
This works fine in Windows/Chrome, Android, IPhone - but not on the IPad. Here the modal popup windows shows only once. On subsequent taps it does not show. If, however, a alert window is shown on the tap action (line 24), then first the alert shows and then the popup.
What can I do to get it to work on the IPad?
Ext.define("test.view.Main", {
extend: 'Ext.Panel'
, requires: [
'Ext.field.Select'
]
, config: {
items: [
{
xtype: 'selectfield'
, label: 'Select'
, id: 'select_test'
, options: [
{text:'one',value:'1'}
, {text:'two',value:'2'}
]
}
]
}
, initialize: function( object, options ) {
var cmp = this.getComponent('select_test');
console.log('cmp.xtype: ' + cmp.xtype);
cmp.onMaskTap = function(obj) {
// alert('tap');
if (!this.selectTest) {
this.selectTest = Ext.create('test.view.Select');
Ext.Viewport.add(this.selectTest);
}
this.selectTest.setCaller(cmp.getParent());
this.selectTest.show();
return false;
}
}
});
Ext.define( 'test.view.Select', {
extend: 'Ext.Panel'
, caller: null
, onButtonTap: function(obj) {
this.getCaller().getComponent('select_test').setValue(obj.getId().substr(7));
this.hide();
}
, config: {
title: 'Select some'
, zIndex: 99
, id: 'stuhlgangAuswahl'
, modal: true
, caller: null
, centered: true
, hideOnMaskTap: true
, toFrontOnShow: true
, style: 'background: transparent !important'
, layout: {
type: 'vbox'
, align: 'centered'
}
, defaults: {
xtype: 'button'
, iconAlign: 'left'
, minHeight: '40px'
, minWidth: '60px'
, listeners: {
tap: function(obj) {
this.getParent().onButtonTap(obj);
}
}
}
, items: [
{
text: 'one'
, id: 'button_1'
}
,
{
text: 'tow'
, id: 'button_2'
// , icon: 'resources/images/normal.gif'
}
,
{
xtype: 'button'
, text: 'Cancel'
, id: 'cancel'
}
]
}
});
| ipad | popup | touch | sencha | sencha-touch-2 | null | open | Select field: Custom picker does not work on IPad
===
See the attached Main.js (below) which is the one and only view and module of a test application. It shows a select field with a modified behaviour. It does not use the standard picker, but a custom-built panel of the class test.view.Select. On initializing the main panel, the onMaskTap event of the select field gets modified so that it creates the custom select panel (if necessary), sets a link to it via the "caller" variable and shows it. On tapping a button, the modal Select window sets the appropriate value in the underlying select field and hides itself.
This works fine in Windows/Chrome, Android, IPhone - but not on the IPad. Here the modal popup windows shows only once. On subsequent taps it does not show. If, however, a alert window is shown on the tap action (line 24), then first the alert shows and then the popup.
What can I do to get it to work on the IPad?
Ext.define("test.view.Main", {
extend: 'Ext.Panel'
, requires: [
'Ext.field.Select'
]
, config: {
items: [
{
xtype: 'selectfield'
, label: 'Select'
, id: 'select_test'
, options: [
{text:'one',value:'1'}
, {text:'two',value:'2'}
]
}
]
}
, initialize: function( object, options ) {
var cmp = this.getComponent('select_test');
console.log('cmp.xtype: ' + cmp.xtype);
cmp.onMaskTap = function(obj) {
// alert('tap');
if (!this.selectTest) {
this.selectTest = Ext.create('test.view.Select');
Ext.Viewport.add(this.selectTest);
}
this.selectTest.setCaller(cmp.getParent());
this.selectTest.show();
return false;
}
}
});
Ext.define( 'test.view.Select', {
extend: 'Ext.Panel'
, caller: null
, onButtonTap: function(obj) {
this.getCaller().getComponent('select_test').setValue(obj.getId().substr(7));
this.hide();
}
, config: {
title: 'Select some'
, zIndex: 99
, id: 'stuhlgangAuswahl'
, modal: true
, caller: null
, centered: true
, hideOnMaskTap: true
, toFrontOnShow: true
, style: 'background: transparent !important'
, layout: {
type: 'vbox'
, align: 'centered'
}
, defaults: {
xtype: 'button'
, iconAlign: 'left'
, minHeight: '40px'
, minWidth: '60px'
, listeners: {
tap: function(obj) {
this.getParent().onButtonTap(obj);
}
}
}
, items: [
{
text: 'one'
, id: 'button_1'
}
,
{
text: 'tow'
, id: 'button_2'
// , icon: 'resources/images/normal.gif'
}
,
{
xtype: 'button'
, text: 'Cancel'
, id: 'cancel'
}
]
}
});
| 0 |
11,411,122 | 07/10/2012 10:14:14 | 276,070 | 02/18/2010 12:59:37 | 11,054 | 405 | Changing Properties of IEnumerator<T>.Current | With great surprised I observed the following behavior today: Given a class
class Foo
{
prop int FooNumber { get; set; }
}
and this code
IEnumerable<Foo> foos = Enumerable.Range(0,3).Select(new Foo());
foreach (var foo in foos)
foo.Bar = 5;
foreach (var foo in foos)
Console.Write(foo.Bar); // Writes 000
while initializing `foos` to `new List<Foo>{ new Foo(), new Foo(), new Foo() }` makes the loop write "555".
My question: Why does this happen and is there a way to circumvent this whithout using `.ToList()` (which needs a comment, since it does not seem to be needed here). | c# | ienumerable | null | null | null | null | open | Changing Properties of IEnumerator<T>.Current
===
With great surprised I observed the following behavior today: Given a class
class Foo
{
prop int FooNumber { get; set; }
}
and this code
IEnumerable<Foo> foos = Enumerable.Range(0,3).Select(new Foo());
foreach (var foo in foos)
foo.Bar = 5;
foreach (var foo in foos)
Console.Write(foo.Bar); // Writes 000
while initializing `foos` to `new List<Foo>{ new Foo(), new Foo(), new Foo() }` makes the loop write "555".
My question: Why does this happen and is there a way to circumvent this whithout using `.ToList()` (which needs a comment, since it does not seem to be needed here). | 0 |
11,660,682 | 07/26/2012 00:26:53 | 577,306 | 01/16/2011 06:04:14 | 523 | 40 | jQuery Datepicker BeforeShowDay Second Parameter | jQuery's datepicker allows you to highlight dates using the BeforeShowDay callback.
Is it possible to pass a second parameter to the method?
$(selector).datepicker({beforeShowDay: selectedDay});
function selectedDay(date) {
// Do stuff
return [true, 'class_name'];
}
As you can see, the parameter `date` is automatically passed to the selectedDay method, thus making me unsure as to how to pass a second parameter.
Cheers. | javascript | jquery | datepicker | null | null | null | open | jQuery Datepicker BeforeShowDay Second Parameter
===
jQuery's datepicker allows you to highlight dates using the BeforeShowDay callback.
Is it possible to pass a second parameter to the method?
$(selector).datepicker({beforeShowDay: selectedDay});
function selectedDay(date) {
// Do stuff
return [true, 'class_name'];
}
As you can see, the parameter `date` is automatically passed to the selectedDay method, thus making me unsure as to how to pass a second parameter.
Cheers. | 0 |
11,660,683 | 07/26/2012 00:27:02 | 1,475,935 | 06/22/2012 21:02:41 | 1 | 0 | adding leading 0 in php | - tutorial 1 how to make this
- tutorial 21 how to make this
- tutorial 2 how to make this
- tutorial 3 how to make this
and i need
- tutorial 01 how to make this
- tutorial 21 how to make this
- tutorial 02 how to make this
- tutorial 03 how to make this
so i can order them properly. (adding leading 0 when single digit is found)
What would be a php method to convert?
thanks in advance | php | regex | null | null | null | null | open | adding leading 0 in php
===
- tutorial 1 how to make this
- tutorial 21 how to make this
- tutorial 2 how to make this
- tutorial 3 how to make this
and i need
- tutorial 01 how to make this
- tutorial 21 how to make this
- tutorial 02 how to make this
- tutorial 03 how to make this
so i can order them properly. (adding leading 0 when single digit is found)
What would be a php method to convert?
thanks in advance | 0 |
11,660,684 | 07/26/2012 00:27:05 | 1,553,137 | 07/26/2012 00:12:26 | 1 | 0 | php - how to write .htaccess | i have tried but not found proper soluction for php htaccess
**Folder and files information:**
.htaccess (on root)
/profile/personal.php
/profile/exam/exam_information.php
**sending urls from (personal.php) and (exam_information.php)**
/profile/2012/A1PPOAQU7
\-------------/ //friendly url
/profile/exam/2012/A1PPOAQU7
\-------------/ //friendly url
**i found, htaccess but it works for single url only. please check whats wrong in the code.**
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-/]+)$ /profile/personal.php?pid=$1
RewriteRule ^([a-zA-Z0-9-/]+)/$ /profile/personal.php?pid=$1
Thanks!
| php | .htaccess | null | null | null | null | open | php - how to write .htaccess
===
i have tried but not found proper soluction for php htaccess
**Folder and files information:**
.htaccess (on root)
/profile/personal.php
/profile/exam/exam_information.php
**sending urls from (personal.php) and (exam_information.php)**
/profile/2012/A1PPOAQU7
\-------------/ //friendly url
/profile/exam/2012/A1PPOAQU7
\-------------/ //friendly url
**i found, htaccess but it works for single url only. please check whats wrong in the code.**
RewriteEngine On
RewriteRule ^([a-zA-Z0-9-/]+)$ /profile/personal.php?pid=$1
RewriteRule ^([a-zA-Z0-9-/]+)/$ /profile/personal.php?pid=$1
Thanks!
| 0 |
11,660,685 | 07/26/2012 00:27:07 | 1,022,328 | 10/31/2011 16:26:37 | 11 | 0 | WebView horizontal scrolling fails | I've got a strange issue with a WebView inside a fragment. The horizontal scrolling doesn't work properly. It scrolls only a bit. It's no problem, to scroll the content vertically, pinch to zoom, and yes, moving the page with two fingers while pinching also works in all directions.
This is the onCreateView()-Method of the Fragment, that carries the WebView. I can't use WebViewFragment.
This Fragment is inside a Viewpager! The provided data is a valid html5 document. But I've not successfully tried a "real webpage" as well.
this.mView = inflater.inflate(R.layout.search_results, container, false);
mWebView = (WebView)this.mView.findViewById(R.id.search_results);
mWebView.setWebViewClient(new SearchResultsWebViewClient());
mWebView.setInitialScale(120);
mWebView.setScrollContainer(true);
mWebView.bringToFront();
mWebView.setScrollbarFadingEnabled(true);
mWebView.setVerticalScrollBarEnabled(true);
mWebView.setHorizontalScrollBarEnabled(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setJavaScriptEnabled(false);
mWebView.loadData(this.data, "text/html", "utf-8");
return this.mView;
This is the search_results.xml
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id ="@+id/search_results"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
And the layout-file in which the fragment is loaded
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
android:weightSum="1.0">
<LinearLayout android:layout_weight="0.5"
android:layout_width="0dip"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:drawSelectorOnTop="false"/>
</LinearLayout>
<LinearLayout android:layout_weight="0.5"
android:layout_width="0dip"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout android:id="@+id/resultsWebWiewFragmentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
Because I'm using ABS, it isn't possible to load the fragment directly in the xml file. This'll throw a ClassCastException. | android | android-webview | android-viewpager | null | null | null | open | WebView horizontal scrolling fails
===
I've got a strange issue with a WebView inside a fragment. The horizontal scrolling doesn't work properly. It scrolls only a bit. It's no problem, to scroll the content vertically, pinch to zoom, and yes, moving the page with two fingers while pinching also works in all directions.
This is the onCreateView()-Method of the Fragment, that carries the WebView. I can't use WebViewFragment.
This Fragment is inside a Viewpager! The provided data is a valid html5 document. But I've not successfully tried a "real webpage" as well.
this.mView = inflater.inflate(R.layout.search_results, container, false);
mWebView = (WebView)this.mView.findViewById(R.id.search_results);
mWebView.setWebViewClient(new SearchResultsWebViewClient());
mWebView.setInitialScale(120);
mWebView.setScrollContainer(true);
mWebView.bringToFront();
mWebView.setScrollbarFadingEnabled(true);
mWebView.setVerticalScrollBarEnabled(true);
mWebView.setHorizontalScrollBarEnabled(true);
mWebView.getSettings().setBuiltInZoomControls(true);
mWebView.getSettings().setJavaScriptEnabled(false);
mWebView.loadData(this.data, "text/html", "utf-8");
return this.mView;
This is the search_results.xml
<?xml version="1.0" encoding="utf-8"?>
<WebView xmlns:android="http://schemas.android.com/apk/res/android"
android:id ="@+id/search_results"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</WebView>
And the layout-file in which the fragment is loaded
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:baselineAligned="false"
android:weightSum="1.0">
<LinearLayout android:layout_weight="0.5"
android:layout_width="0dip"
android:layout_height="match_parent"
android:orientation="vertical" >
<ListView android:id="@id/android:list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#000000"
android:drawSelectorOnTop="false"/>
</LinearLayout>
<LinearLayout android:layout_weight="0.5"
android:layout_width="0dip"
android:layout_height="match_parent"
android:orientation="vertical" >
<FrameLayout android:id="@+id/resultsWebWiewFragmentFrame"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
</LinearLayout>
</LinearLayout>
Because I'm using ABS, it isn't possible to load the fragment directly in the xml file. This'll throw a ClassCastException. | 0 |
11,660,686 | 07/26/2012 00:27:15 | 679,601 | 02/04/2010 00:02:49 | 539 | 21 | How to Store and Parse RRULE data | I'm sure this has been asked a few times around here, but I haven't found a decent solution, or understanding the best way to do this.
I have a calendar (using jQuery FullCalendar). And I want to implement a recurrence structure to the calendar. The best way would be to use a standard, such as iCal RRULE.
But what i'm trying to figure out is, what is the best way to store it in a MySQL database?
A simple (varchar field), containing: RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=TU,WE,FR;UNTIL=20110713T075959Z;WKST=SU
Once I have it 'stored' in the database, how would I go about 'pulling' the data from the database to parse the recurrence to display onto my calendar?
Any help would be greatly appreciated. | php | date | recursion | calendar | fullcalendar | null | open | How to Store and Parse RRULE data
===
I'm sure this has been asked a few times around here, but I haven't found a decent solution, or understanding the best way to do this.
I have a calendar (using jQuery FullCalendar). And I want to implement a recurrence structure to the calendar. The best way would be to use a standard, such as iCal RRULE.
But what i'm trying to figure out is, what is the best way to store it in a MySQL database?
A simple (varchar field), containing: RRULE:FREQ=DAILY;INTERVAL=1;BYDAY=TU,WE,FR;UNTIL=20110713T075959Z;WKST=SU
Once I have it 'stored' in the database, how would I go about 'pulling' the data from the database to parse the recurrence to display onto my calendar?
Any help would be greatly appreciated. | 0 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.