Tuesday, 3 September 2013

hi I want to know how to make a playlist like http://www.howcast.com/videos/508430-How-to-Place-Your-Punches-Boxing-Lessons

hi I want to know how to make a playlist like
http://www.howcast.com/videos/508430-How-to-Place-Your-Punches-Boxing-Lessons

hi I want to know how to make a playlist like ![enter image description
here][1]
[1]: http://i.stack.imgur.com/UaE5O.jpg. I took this image from howcast.
Pls help me!!!

Enterprise Library with Oracle and ExecuteScalar

Enterprise Library with Oracle and ExecuteScalar

I recently had to flip from using the standard Oracle Data Access Library
to implementing it inside of the Enterprise Library due to a coding
standards issue. All my logic seems to be working out fine so far, except
I'm having an issue with the Execute Scalar. The other queries function
correctly (Non-Scalar calls, inserts, updates, deletes, etc) but I'm hung
up on these scalar values.
Stored Procedure:
PROCEDURE "GET_VIEW_COUNT"
(whereClause IN VARCHAR2,
o_rc OUT sys_refcursor)
is
rowQuery varchar2(32000);
begin
rowQuery := 'SELECT COUNT(*) FROM My_VW WHERE ' || whereClause;
OPEN o_rc FOR rowQuery;
end;
C# Code
Database database =
DatabaseFactory.CreateDatabase(DataCommon.GetConnectionStringStatic());
using (DbCommand command =
database.GetStoredProcCommand("GET_VIEW_COUNT"))
{
database.DiscoverParameters(command);
database.SetParameterValue(command, "whereClause",
whereClause);
totalRows = (decimal)database.ExecuteScalar(command);
}
However the issue is that ExecuteScalar always returns null. Running the
query straight up returns a 1 column 1 row table (just the count). This
worked previously using the old Oracle.DataAccess but now that it's in the
EntLib I can't get it to work.

jQuery $.ajax POST Request with IE 9 results empty array

jQuery $.ajax POST Request with IE 9 results empty array

I have a problem with my Coding, so in Firefox it works fine but in IE9 it
only works for the first ~5 seconds. After that time i don't receive any
POST Data anymore.
I want to load a PHP page via AJAX using the values of form inputs as POST
variables. The first 5 seconds i can receive the POST on the requested
page but after that i only receive an empty string.
Here is my Code:
function reload_form(){
var data = $("#formularfelder").serialize()
$.ajax({
type: 'POST',
url: 'content/formular.php',
data: data,
success: function(msg) {
$("#form_container").html(msg);
}
});
}
Is it a bug of IE9 and is there a workaround available?
It would be awesome if you could help me! :)

How to prevent triggering mouseleave after mouseup?

How to prevent triggering mouseleave after mouseup?

In my javascript app I am having issues with event "propagation"(?),
namely I would like not to trigger mouseleave after mouse up on an element
( have implemented dragging behavior therefore it moves and mouse leaves
it).
How can I do that ?

DragTabFrame closing inconsistently

DragTabFrame closing inconsistently

The code below is supposed to work a little like the Multi-Document
Interface (MDI) you might see in a browser like FF, IE or Chrome. It
presents 'documents' (a black buffered image as spacer) in a tabbed pane
such that they can be dragged from the pane into a new (or existing)
window by user choice.
But it has had issues with closing frames once they have no more tabs, as
well as closing the JVM when there are no further visible windows. I think
I fixed them by checking with a Timer in the DragTabManager:
It checks open frames for instances of DragTabFrame
If it finds one, it check the tab count. If 0 the frame is set invisible
and disposed.
If it finds no instances of the frame that are visible, it ends the Timer
to allow the JRE to exit.
At least that is how it is supposed to work. It seems to be working
reliably here, and I have seen no 'empty frame or VM failing to shut down'
for quite a few tests. Does it work as advertised for others, or do I need
to look further?
import java.awt.*;
import java.awt.event.*;
import java.awt.image.BufferedImage;
import javax.swing.*;
import javax.swing.border.EmptyBorder;
public class DragTabFrame extends JFrame {
private JTabbedPane tabbedPane = new JTabbedPane();
private final static DragTabManager dragTabManager = new
DragTabManager();
final MouseAdapter ma = new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
JComponent c = (JComponent) e.getSource();
dragTabManager.setCurrentComponent(c);
DragTabFrame dtf = (DragTabFrame)c.getTopLevelAncestor();
dragTabManager.setCurrentFrame(dtf);
JTabbedPane tp = dtf.getTabbedPane();
int index = tp.indexOfComponent(c);
if (index<0) index = 0;
String title = tp.getTitleAt(index);
dragTabManager.setCurrentTitle(title);
}
@Override
public void mousePressed(MouseEvent e) {
JComponent c = (JComponent) e.getSource();
DragTabFrame dtf = (DragTabFrame)c.getTopLevelAncestor();
dragTabManager.setCurrentComponent(c);
dragTabManager.setCurrentFrame(dtf);
JTabbedPane tp = dtf.getTabbedPane();
int index = tp.indexOfComponent(c);
if (index<0) index = 0;
String title = tp.getTitleAt(index);
dragTabManager.setCurrentTitle(title);
}
@Override
public void mouseReleased(MouseEvent e) {
JComponent c = (JComponent) e.getSource();
if
(c.getTopLevelAncestor().getBounds().contains(e.getLocationOnScreen()))
{
// do nothing, the drop point is the same frame
} else {
DragTabFrame dtf = getTargetFrame(e.getLocationOnScreen());
if (dtf == null) {
dtf = new DragTabFrame();
dtf.init();
dtf.setLocation(e.getLocationOnScreen());
} else {
DragTabFrame fromFrame =
dragTabManager.getCurrentFrame();
fromFrame.removeTabComponent(c);
JTabbedPane tp = fromFrame.getTabbedPane();
if (tp.getTabCount() == 0) {
fromFrame.setVisible(false);
fromFrame.dispose();
}
}
dtf.addTabComponent(dragTabManager.getCurrentTitle(), c);
dtf.pack();
dtf.setVisible(true);
}
}
};
public JTabbedPane getTabbedPane() {
return tabbedPane;
}
public DragTabFrame getTargetFrame(Point p) {
Frame[] frames = Frame.getFrames();
for (Frame frame : frames) {
if (frame instanceof DragTabFrame
&& frame.getBounds().contains(p)) {
return (DragTabFrame) frame;
}
}
return null;
}
public void init() {
// the GUI as seen by the user (without frame)
JPanel gui = new JPanel(new BorderLayout());
gui.setBorder(new EmptyBorder(2, 3, 2, 3));
gui.add(tabbedPane, BorderLayout.CENTER);
add(gui);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
// See http://stackoverflow.com/a/7143398/418556 for demo.
setLocationByPlatform(true);
}
public void addTabComponent(String name, Component c) {
tabbedPane.addTab(name, c);
c.addMouseListener(ma);
c.addMouseMotionListener(ma);
}
public void removeTabComponent(Component c) {
tabbedPane.remove(c);
c.removeMouseListener(ma);
c.removeMouseMotionListener(ma);
}
public static void main(String[] args) {
Runnable r = new Runnable() {
@Override
public void run() {
DragTabFrame dtf = new DragTabFrame();
dtf.init();
BufferedImage bi = new BufferedImage(
200, 40, BufferedImage.TYPE_INT_RGB);
for (int ii = 1; ii < 4; ii++) {
JLabel l = new JLabel(new ImageIcon(bi));
dtf.addTabComponent("Tab " + ii, l);
}
dtf.pack();
// should be done last, to avoid flickering, moving,
// resizing artifacts.
dtf.setVisible(true);
}
};
// Swing GUIs should be created and updated on the EDT
//
http://docs.oracle.com/javase/tutorial/uiswing/concurrency/initial.html
SwingUtilities.invokeLater(r);
}
}
class DragTabManager {
private DragTabFrame currentFrame;
private JComponent currentComponent;
private String currentTitle;
private Timer timer;
public DragTabManager() {
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
Frame[] frames = Frame.getFrames();
if (frames.length==0) {
timer.stop();
}
System.out.println("frames.length: " + frames.length);
boolean allInvisible = true;
for (Frame frame : frames) {
if (frame instanceof DragTabFrame) {
DragTabFrame dtf = (DragTabFrame)frame;
if (dtf.isVisible()) {
allInvisible = false;
}
if (dtf.getTabbedPane().getTabCount()==0) {
dtf.setVisible(false);
dtf.dispose();
}
}
}
if (allInvisible) {
timer.stop();
}
}
};
timer = new Timer(200,actionListener);
timer.start();
}
/**
* @return the currentFrame
*/
public DragTabFrame getCurrentFrame() {
return currentFrame;
}
/**
* @param currentFrame the currentFrame to set
*/
public void setCurrentFrame(DragTabFrame currentFrame) {
this.currentFrame = currentFrame;
}
/**
* @return the currentComponent
*/
public JComponent getCurrentComponent() {
return currentComponent;
}
/**
* @param currentComponent the currentComponent to set
*/
public void setCurrentComponent(JComponent currentComponent) {
this.currentComponent = currentComponent;
}
/**
* @return the currentTitle
*/
public String getCurrentTitle() {
return currentTitle;
}
/**
* @param currentTitle the currentTitle to set
*/
public void setCurrentTitle(String currentTitle) {
this.currentTitle = currentTitle;
}
}

Monday, 2 September 2013

Will BLE peripheral role support be added to Android API in a future version?

Will BLE peripheral role support be added to Android API in a future version?

Apple did not initially include peripheral role support in iOS5, but then
did in iOS6. Peripheral role support in Android would also be useful. Any
insight on this topic would be helpful.
-Vik

NSException - no crash?

NSException - no crash?

I'm having a rather odd problem with my cocoa application. Whenever an
NSException is raised, the exception is printed to Console.app's log, but
doesn't cause the application to crash and the UI remains responsive. I do
not have an NSExceptionHandler installed and Xcode has created the app
bundle in "Release" mode.
What gives?