I need a basic jQuery FancyBox [on hold]
i need a basic javaScript code to create a basic jQuery FancyBox. please
help me to create a javascript FancyBox ?
i am new for javascript programming.
Thank You !!!
Saturday, 14 September 2013
Friday, 13 September 2013
how to pass html table data to controller in mvc 4.0
how to pass html table data to controller in mvc 4.0
I have a HTML table in view . I want to pass the html table data to
controller in mvc 4.0. I read this Answer how to pass html table data to
controller in mvc2.0 But I don't know how to use jquery and Json to pass
data. Can any one help me.
I have a HTML table in view . I want to pass the html table data to
controller in mvc 4.0. I read this Answer how to pass html table data to
controller in mvc2.0 But I don't know how to use jquery and Json to pass
data. Can any one help me.
Using quit/q in a function causes RStudio to fatal error
Using quit/q in a function causes RStudio to fatal error
More of a curiosity but when you use q or quit inside of a function inside
of R studio it causes a fatal error as seen here:
But the same function in rgui causes R to stop as usual. And using just
q() in RStudio closes R as expected. Why does q in a function cause
RStudio to literally bomb?
Example function that causes the bomb:
FUN <- function() q()
FUN()
Here's my sessionInfo:
R Under development (unstable) (2013-09-04 r63830)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.0
RStudio Version 0.97.551
More of a curiosity but when you use q or quit inside of a function inside
of R studio it causes a fatal error as seen here:
But the same function in rgui causes R to stop as usual. And using just
q() in RStudio closes R as expected. Why does q in a function cause
RStudio to literally bomb?
Example function that causes the bomb:
FUN <- function() q()
FUN()
Here's my sessionInfo:
R Under development (unstable) (2013-09-04 r63830)
Platform: i386-w64-mingw32/i386 (32-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United
States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] tools_3.1.0
RStudio Version 0.97.551
Autocomplete from database mysqli
Autocomplete from database mysqli
I am using auto complete where the suggestions come from database and it
is working fine, however I tried to change it to mysqli but it doesn't
work. It doesn't show any suggestions;no error.
what I am missing on the mysqli end?
How can I be able to add more tables(I have like 40 tables)? Thanks.
MySQL:
<?php
mysql_connect("localhost","root","");
mysql_select_db("database");
$term=$_GET["term"];
$query=mysql_query("SELECT * FROM products1 where title like
'%".$term."%' order by id ");
$json=array();
while($student=mysql_fetch_array($query)){
$json[]=array(
'value'=> $student["title"],
'label'=>$student["title"]
);
}
echo json_encode($json);
?>
What I tried with MySQLi:
<?php
$mydb = new mysqli('localhost', 'root', '', 'database');
$q = $_POST['term'];
$stmt = $mydb->prepare(" SELECT * from products1 where title LIKE ? ");
echo $mydb->error;
$stmt->bind_param('s', $q);
$stmt->execute();
?>
<?php
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
$json[]=array(
'value'=> $student["title"],
'label'=>$student["title"]
);
}
echo json_encode($json);
?>
I am using auto complete where the suggestions come from database and it
is working fine, however I tried to change it to mysqli but it doesn't
work. It doesn't show any suggestions;no error.
what I am missing on the mysqli end?
How can I be able to add more tables(I have like 40 tables)? Thanks.
MySQL:
<?php
mysql_connect("localhost","root","");
mysql_select_db("database");
$term=$_GET["term"];
$query=mysql_query("SELECT * FROM products1 where title like
'%".$term."%' order by id ");
$json=array();
while($student=mysql_fetch_array($query)){
$json[]=array(
'value'=> $student["title"],
'label'=>$student["title"]
);
}
echo json_encode($json);
?>
What I tried with MySQLi:
<?php
$mydb = new mysqli('localhost', 'root', '', 'database');
$q = $_POST['term'];
$stmt = $mydb->prepare(" SELECT * from products1 where title LIKE ? ");
echo $mydb->error;
$stmt->bind_param('s', $q);
$stmt->execute();
?>
<?php
$result = $stmt->get_result();
while ($row = $result->fetch_assoc()) {
$json[]=array(
'value'=> $student["title"],
'label'=>$student["title"]
);
}
echo json_encode($json);
?>
Titanium - Error Loading Browser - MOZILLA_HOME_FIVE not set
Titanium - Error Loading Browser - MOZILLA_HOME_FIVE not set
Firstly, I am running on Manjaro Linux.
I downloaded Titanium, unzipped it, then ran it. All fine. However, at
startup it is throwing a "Cannot find chromimum. See documentation for
possible workaround/fixes" error which is then followed by a
MOZILLA_FIVE_HOME not set error and lastly it suggests that I should
terminate the workbench due to a SWT Error.
I've tried the many suggestions I've found online including:
Installing xulrunner. Did not work.
Setting an env variable called MOZILLA_FIVE_HOME according to
(http://www.eclipse.org/swt/faq.php#browserlinuxrcp). However, I may have
messeg up following these instructions. If anyone would kindly explain
what step number 2 means with a little bit of extra detail, I would
seriously appreciate it.
I will post the full error I am getting below:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path
(MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(SWT.java:4308)
at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1826) at
org.eclipse.swt.browser.Mozilla.create(Mozilla.java:687) at
org.eclipse.swt.browser.Browser.(Browser.java:99) at
org.eclipse.ui.internal.browser.BrowserViewer.(BrowserViewer.java:225) at
com.aptana.portal.ui.internal.BrowserViewerWrapper.createSWTBrowserViewer(BrowserViewerWrapper.java:26)
at
com.aptana.portal.ui.browser.AbstractPortalBrowserEditor.createBrowserViewer(AbstractPortalBrowserEditor.java:211)
at
com.aptana.portal.ui.browser.AbstractPortalBrowserEditor.createPartControl(AbstractPortalBrowserEditor.java:108)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) at
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198) at
org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597) at
org.eclipse.ui.internal.PartStack.add(PartStack.java:493) at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at
org.eclipse.ui.internal.PartStack.add(PartStack.java:479) at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at
org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at
org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at com.aptana.portal.ui.internal.Portal$1.runInUIThread(Portal.java:227)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95) at
org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563) at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212) at
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at
org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at
org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at
org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at
com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at
org.eclipse.equinox.launcher.Main.run(Main.java:1410) at
org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Firstly, I am running on Manjaro Linux.
I downloaded Titanium, unzipped it, then ran it. All fine. However, at
startup it is throwing a "Cannot find chromimum. See documentation for
possible workaround/fixes" error which is then followed by a
MOZILLA_FIVE_HOME not set error and lastly it suggests that I should
terminate the workbench due to a SWT Error.
I've tried the many suggestions I've found online including:
Installing xulrunner. Did not work.
Setting an env variable called MOZILLA_FIVE_HOME according to
(http://www.eclipse.org/swt/faq.php#browserlinuxrcp). However, I may have
messeg up following these instructions. If anyone would kindly explain
what step number 2 means with a little bit of extra detail, I would
seriously appreciate it.
I will post the full error I am getting below:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
No more handles [Unknown Mozilla path (MOZILLA_FIVE_HOME not set)]
org.eclipse.swt.SWTError: No more handles [Unknown Mozilla path
(MOZILLA_FIVE_HOME not set)] at org.eclipse.swt.SWT.error(SWT.java:4308)
at org.eclipse.swt.browser.Mozilla.initMozilla(Mozilla.java:1826) at
org.eclipse.swt.browser.Mozilla.create(Mozilla.java:687) at
org.eclipse.swt.browser.Browser.(Browser.java:99) at
org.eclipse.ui.internal.browser.BrowserViewer.(BrowserViewer.java:225) at
com.aptana.portal.ui.internal.BrowserViewerWrapper.createSWTBrowserViewer(BrowserViewerWrapper.java:26)
at
com.aptana.portal.ui.browser.AbstractPortalBrowserEditor.createBrowserViewer(AbstractPortalBrowserEditor.java:211)
at
com.aptana.portal.ui.browser.AbstractPortalBrowserEditor.createPartControl(AbstractPortalBrowserEditor.java:108)
at
org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
at
org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
at
org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
at org.eclipse.ui.internal.PartPane.setVisible(PartPane.java:313) at
org.eclipse.ui.internal.presentations.PresentablePart.setVisible(PresentablePart.java:180)
at
org.eclipse.ui.internal.presentations.util.PresentablePartFolder.select(PresentablePartFolder.java:270)
at
org.eclipse.ui.internal.presentations.util.LeftToRightTabOrder.select(LeftToRightTabOrder.java:65)
at
org.eclipse.ui.internal.presentations.util.TabbedStackPresentation.selectPart(TabbedStackPresentation.java:473)
at
org.eclipse.ui.internal.PartStack.refreshPresentationSelection(PartStack.java:1245)
at org.eclipse.ui.internal.PartStack.setSelection(PartStack.java:1198) at
org.eclipse.ui.internal.PartStack.showPart(PartStack.java:1597) at
org.eclipse.ui.internal.PartStack.add(PartStack.java:493) at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:103) at
org.eclipse.ui.internal.PartStack.add(PartStack.java:479) at
org.eclipse.ui.internal.EditorStack.add(EditorStack.java:112) at
org.eclipse.ui.internal.EditorSashContainer.addEditor(EditorSashContainer.java:63)
at
org.eclipse.ui.internal.EditorAreaHelper.addToLayout(EditorAreaHelper.java:225)
at
org.eclipse.ui.internal.EditorAreaHelper.addEditor(EditorAreaHelper.java:213)
at
org.eclipse.ui.internal.EditorManager.createEditorTab(EditorManager.java:808)
at
org.eclipse.ui.internal.EditorManager.openEditorFromDescriptor(EditorManager.java:707)
at
org.eclipse.ui.internal.EditorManager.openEditor(EditorManager.java:666)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2942)
at
org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
at
org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
at
org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2756)
at com.aptana.portal.ui.internal.Portal$1.runInUIThread(Portal.java:227)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95) at
org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35) at
org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3563) at
org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3212) at
org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701) at
org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665) at
org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499) at
org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679) at
org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149) at
com.appcelerator.titanium.rcp.IDEApplication.start(IDEApplication.java:125)
at
org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at
org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606) at
org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622) at
org.eclipse.equinox.launcher.Main.basicRun(Main.java:577) at
org.eclipse.equinox.launcher.Main.run(Main.java:1410) at
org.eclipse.equinox.launcher.Main.main(Main.java:1386)
How to swipe images up or down using the Gallery widget
How to swipe images up or down using the Gallery widget
I have a project for which I have to display some images. Even if the
Gallery widget is deprecated, it seems to be the best choice, since I have
not so much time to spend on it.
I would like to mimic Android's photo gallery and deleting an image when
swiping it up or down (see the screenshots below). I saw another in SO
question that we can detect vertical swipings (see the code below), but I
would like to move the image during the movement, as in Android's photo
gallery.
How could I implement this feature?
public class CustomGallery extends Gallery
{
[...]
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float
velocityX, float velocityY)
{
if (Math.abs(velocityX) > Math.abs(velocityY))
// Moving horizontally
else
// Moving vertically
return super.onFling(e1, e2, velocityX, velocityY);
}
}
NB: I can also accept an answer based on HorizontalScrollView if it
implements the up- or down-swiping feature and if it has center-locking.
!
I have a project for which I have to display some images. Even if the
Gallery widget is deprecated, it seems to be the best choice, since I have
not so much time to spend on it.
I would like to mimic Android's photo gallery and deleting an image when
swiping it up or down (see the screenshots below). I saw another in SO
question that we can detect vertical swipings (see the code below), but I
would like to move the image during the movement, as in Android's photo
gallery.
How could I implement this feature?
public class CustomGallery extends Gallery
{
[...]
@Override
public boolean onFling(MotionEvent e1, MotionEvent e2, float
velocityX, float velocityY)
{
if (Math.abs(velocityX) > Math.abs(velocityY))
// Moving horizontally
else
// Moving vertically
return super.onFling(e1, e2, velocityX, velocityY);
}
}
NB: I can also accept an answer based on HorizontalScrollView if it
implements the up- or down-swiping feature and if it has center-locking.
!
CKEdtor 4: How to add CSS stylesheet from plugin?
CKEdtor 4: How to add CSS stylesheet from plugin?
Tried this for now, but no luck
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
Full code
(function () {
CKEDITOR.plugins.add('tabber', {
init: function (editor) {
editor.ui.addButton('addTab', {
command: 'addTab',
icon: this.path + 'icons/tabber.png',
label: Drupal.t('Insert tabs')
});
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
editor.addCommand('addTab', {
exec: function (editor) {
editor.insertHtml('<dl>' +
'<dt>Tab title 1</dt>' +
'<dd><p>Tab content 1.</p></dd>' +
'<dt>Tab title 2</dt>' +
'<dd><p>Tab content 2.</p></dd>' +
'</dl>');
}
});
}
});
})();
Tried this for now, but no luck
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
Full code
(function () {
CKEDITOR.plugins.add('tabber', {
init: function (editor) {
editor.ui.addButton('addTab', {
command: 'addTab',
icon: this.path + 'icons/tabber.png',
label: Drupal.t('Insert tabs')
});
editor.addCss(this.path + 'tabber.css');
editor.document.appendStyleSheet(this.path + 'tabber.css');
editor.addCommand('addTab', {
exec: function (editor) {
editor.insertHtml('<dl>' +
'<dt>Tab title 1</dt>' +
'<dd><p>Tab content 1.</p></dd>' +
'<dt>Tab title 2</dt>' +
'<dd><p>Tab content 2.</p></dd>' +
'</dl>');
}
});
}
});
})();
Subscribe to:
Posts (Atom)