fancy sliding form add more tabs
Using Fancy sliding form I'm adding more tabs (fieldset and li element ) .
i follow this link .
http://tympanus.net/codrops/2010/06/07/fancy-sliding-form-with-jquery/
my code of navigation Div is
<div id="navigation">
<ul>
<li class="selected">
<a href="#" id="gi">General Info</a> </li>
<li><a href="#" id="ci">Contact Info</a> </li>
<li><a href="#" id="pd">Credentials</a></li>
<li><a href="#" id="pi">Alerts & Directives</a> </li>
<li><a href="#" id="si">Record Releases</a> </li>
<li><a href="#" id="em">Employer</a> </li>
<li><a href="#" id="pid">Patient ID</a> </li>
<li><a href="#" id="A1">Contact</a> </li>
<li><a href="#" id="abcd">AB</a> </li>
<li><a href="#" id="e">CD</a> </li>
<li><a href="#" id="d">EF</a> </li>
<li><a href="#" id="s">GH</a> </li>
<li><a href="#" id="Aew2">IJ</a> </li>
<li><a href="#" id="Awe2">KL</a> </li>
<li><a href="#" id="ewe">MN</a> </li>
</ul>
</div>
These are around 15 Tabs ,But i only can see first 7 tabs in form and
they sliding also.But after 7 tab i can not sliding form
below ,just can seenter code heree tabs name ,but when i click on tabs after
Patient ID
then its not work for me , Please give me any solution ,what should i need
change in JQuery files or Css.I've not idea . Thanks,
Bolyard
Thursday, 3 October 2013
Wednesday, 2 October 2013
turn a list of strings into a list of xyz cooridnates python
turn a list of strings into a list of xyz cooridnates python
First off i will start by saying I am new to python so any help will be
greatly appreciated.
I have a .dat file that is in the following format
J
366 -1722 583
366 356 1783
866 789 1033
866 -1289 -167
366 -1722 583
J
-500 -1472 150
0 -1039 -600
0 1039 600
-500 606 1350
-500 -1472 150
The numbers are xyz coordinates and the J represents a Jump bit so every
time the J occurs I need to lift the pencil and go to the next point to
continue drawing.
I want to read this file into a python file and store the values in a list
as xyz coordinates so i can draw lines from them using pygame.
So far i can read the file into a list using this code
file = open('file.dat', 'r')
vlist = file.readlines()
file.close
Thanks in advance for any help
First off i will start by saying I am new to python so any help will be
greatly appreciated.
I have a .dat file that is in the following format
J
366 -1722 583
366 356 1783
866 789 1033
866 -1289 -167
366 -1722 583
J
-500 -1472 150
0 -1039 -600
0 1039 600
-500 606 1350
-500 -1472 150
The numbers are xyz coordinates and the J represents a Jump bit so every
time the J occurs I need to lift the pencil and go to the next point to
continue drawing.
I want to read this file into a python file and store the values in a list
as xyz coordinates so i can draw lines from them using pygame.
So far i can read the file into a list using this code
file = open('file.dat', 'r')
vlist = file.readlines()
file.close
Thanks in advance for any help
PHP extending in "controllers"
PHP extending in "controllers"
I am creating web application with facebook login. And i have a problem
with stylizing login button. The default facebook login button is inside
iframe and my css styles doesn't aply to this element. I tried also to use
jquery .click() function to trigger hidden button but it doesn't work too.
this is default facebook button:
and this is the final effect what I want to achieve:
this button is already in my html, it looks great but it doesn't work
because default button must be clicked. My question are:
1)Is there any way to stylize facebook login button?
2)How to trigger working click event on facebook button using jquery?
I am creating web application with facebook login. And i have a problem
with stylizing login button. The default facebook login button is inside
iframe and my css styles doesn't aply to this element. I tried also to use
jquery .click() function to trigger hidden button but it doesn't work too.
this is default facebook button:
and this is the final effect what I want to achieve:
this button is already in my html, it looks great but it doesn't work
because default button must be clicked. My question are:
1)Is there any way to stylize facebook login button?
2)How to trigger working click event on facebook button using jquery?
Tuesday, 1 October 2013
AVCam example iPad landscape
AVCam example iPad landscape
I am working with Apple's AVCam code example. I have altered the interface
to work only with the iPad, things seem to be working okay. I have the
video preview on screen but it seems scaled and out of place, almost as if
it is a portrait orientation?
Here is a picture of what is going on:
Obviously I would like the preview to be in landscape (ie take up the full
width of the screen). Although it is not clear from the context of the
image, but it is zoomed in very far by default, I am assuming is is a
product of AVLayerVideoGravityResizeAspectFill and this view somehow being
in portrait?
I have the app setup to only allow Landscape Left and Right, and I would
like the video preview to flip when the device orientation is changed, I
can't seem to get it to do that, even in its current state.
Here are what I assume to be the important parts (if more is needed for
you all to see, please tell me!)
From AVCamViewController.m:
AVCaptureVideoPreviewLayer *newCaptureVideoPreviewLayer =
[[AVCaptureVideoPreviewLayer alloc] initWithSession:[[self
captureManager] session]];
UIView *view = [self videoPreviewView];
CALayer *viewLayer = [view layer];
[viewLayer setMasksToBounds:YES];
//orientation
newCaptureVideoPreviewLayer.orientation =
UIInterfaceOrientationLandscapeLeft;
CGRect bounds = [view bounds];
[newCaptureVideoPreviewLayer setFrame:bounds];
/*if ([newCaptureVideoPreviewLayer isOrientationSupported]) {
NSLog(@"Hello");
[newCaptureVideoPreviewLayer
setOrientation:AVCaptureVideoOrientationLandscapeLeft|AVCaptureVideoOrientationLandscapeRight];
}*/
if ([newCaptureVideoPreviewLayer
respondsToSelector:@selector(connection)])
{
if ([newCaptureVideoPreviewLayer.connection
isVideoOrientationSupported])
{
NSLog(@"hello1");
//self.interfaceOrientation
[newCaptureVideoPreviewLayer.connection
setVideoOrientation:self.interfaceOrientation];
}
}
else
{
// Deprecated in 6.0; here for backward compatibility
if ([newCaptureVideoPreviewLayer isOrientationSupported])
{
NSLog(@"hello2");
[newCaptureVideoPreviewLayer
setOrientation:self.interfaceOrientation];
}
}
Now AVCaptureManager.m:
- (void)deviceOrientationDidChange
{
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice]
orientation];
/*if (deviceOrientation == UIDeviceOrientationPortrait)
orientation = AVCaptureVideoOrientationPortrait;
else if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown)
orientation = AVCaptureVideoOrientationPortraitUpsideDown;
// AVCapture and UIDevice have opposite meanings for landscape left
and right (AVCapture orientation is the same as
UIInterfaceOrientation)
else*/ if (deviceOrientation == UIDeviceOrientationLandscapeLeft){
orientation = AVCaptureVideoOrientationLandscapeRight;
NSLog(@"right");
}
else if (deviceOrientation == UIDeviceOrientationLandscapeRight){
orientation = AVCaptureVideoOrientationLandscapeLeft;
NSLog(@"left");
}
// Ignore device orientations for which there is no corresponding
still image orientation (e.g. UIDeviceOrientationFaceUp)
}
From the init method:
NSNotificationCenter *notificationCenter = [NSNotificationCenter
defaultCenter];
[self setDeviceConnectedObserver:[notificationCenter
addObserverForName:AVCaptureDeviceWasConnectedNotification
object:nil queue:nil usingBlock:deviceConnectedBlock]];
[self setDeviceDisconnectedObserver:[notificationCenter
addObserverForName:AVCaptureDeviceWasDisconnectedNotification
object:nil queue:nil usingBlock:deviceDisconnectedBlock]];
[[UIDevice currentDevice]
beginGeneratingDeviceOrientationNotifications];
[notificationCenter addObserver:self
selector:@selector(deviceOrientationDidChange)
name:UIDeviceOrientationDidChangeNotification object:nil];
orientation = AVCaptureVideoOrientationLandscapeLeft;
Any help is greatly appreciated!
I am working with Apple's AVCam code example. I have altered the interface
to work only with the iPad, things seem to be working okay. I have the
video preview on screen but it seems scaled and out of place, almost as if
it is a portrait orientation?
Here is a picture of what is going on:
Obviously I would like the preview to be in landscape (ie take up the full
width of the screen). Although it is not clear from the context of the
image, but it is zoomed in very far by default, I am assuming is is a
product of AVLayerVideoGravityResizeAspectFill and this view somehow being
in portrait?
I have the app setup to only allow Landscape Left and Right, and I would
like the video preview to flip when the device orientation is changed, I
can't seem to get it to do that, even in its current state.
Here are what I assume to be the important parts (if more is needed for
you all to see, please tell me!)
From AVCamViewController.m:
AVCaptureVideoPreviewLayer *newCaptureVideoPreviewLayer =
[[AVCaptureVideoPreviewLayer alloc] initWithSession:[[self
captureManager] session]];
UIView *view = [self videoPreviewView];
CALayer *viewLayer = [view layer];
[viewLayer setMasksToBounds:YES];
//orientation
newCaptureVideoPreviewLayer.orientation =
UIInterfaceOrientationLandscapeLeft;
CGRect bounds = [view bounds];
[newCaptureVideoPreviewLayer setFrame:bounds];
/*if ([newCaptureVideoPreviewLayer isOrientationSupported]) {
NSLog(@"Hello");
[newCaptureVideoPreviewLayer
setOrientation:AVCaptureVideoOrientationLandscapeLeft|AVCaptureVideoOrientationLandscapeRight];
}*/
if ([newCaptureVideoPreviewLayer
respondsToSelector:@selector(connection)])
{
if ([newCaptureVideoPreviewLayer.connection
isVideoOrientationSupported])
{
NSLog(@"hello1");
//self.interfaceOrientation
[newCaptureVideoPreviewLayer.connection
setVideoOrientation:self.interfaceOrientation];
}
}
else
{
// Deprecated in 6.0; here for backward compatibility
if ([newCaptureVideoPreviewLayer isOrientationSupported])
{
NSLog(@"hello2");
[newCaptureVideoPreviewLayer
setOrientation:self.interfaceOrientation];
}
}
Now AVCaptureManager.m:
- (void)deviceOrientationDidChange
{
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice]
orientation];
/*if (deviceOrientation == UIDeviceOrientationPortrait)
orientation = AVCaptureVideoOrientationPortrait;
else if (deviceOrientation == UIDeviceOrientationPortraitUpsideDown)
orientation = AVCaptureVideoOrientationPortraitUpsideDown;
// AVCapture and UIDevice have opposite meanings for landscape left
and right (AVCapture orientation is the same as
UIInterfaceOrientation)
else*/ if (deviceOrientation == UIDeviceOrientationLandscapeLeft){
orientation = AVCaptureVideoOrientationLandscapeRight;
NSLog(@"right");
}
else if (deviceOrientation == UIDeviceOrientationLandscapeRight){
orientation = AVCaptureVideoOrientationLandscapeLeft;
NSLog(@"left");
}
// Ignore device orientations for which there is no corresponding
still image orientation (e.g. UIDeviceOrientationFaceUp)
}
From the init method:
NSNotificationCenter *notificationCenter = [NSNotificationCenter
defaultCenter];
[self setDeviceConnectedObserver:[notificationCenter
addObserverForName:AVCaptureDeviceWasConnectedNotification
object:nil queue:nil usingBlock:deviceConnectedBlock]];
[self setDeviceDisconnectedObserver:[notificationCenter
addObserverForName:AVCaptureDeviceWasDisconnectedNotification
object:nil queue:nil usingBlock:deviceDisconnectedBlock]];
[[UIDevice currentDevice]
beginGeneratingDeviceOrientationNotifications];
[notificationCenter addObserver:self
selector:@selector(deviceOrientationDidChange)
name:UIDeviceOrientationDidChangeNotification object:nil];
orientation = AVCaptureVideoOrientationLandscapeLeft;
Any help is greatly appreciated!
Error: Message: Expected '}'
Error: Message: Expected '}'
visit http://jsfiddle.net/ghAkB/4/
got an error from I8 saying :
Message: Expected '}'
Line: 59
which in this script is this:
backgroundColor: $el.attr("rel")
where second example is located
$(function(){
var $el, leftPos, newWidth,
$mainNav = $("#example-one"),
$mainNav2 = $("#example-two");
/*
EXAMPLE ONE
*/
$mainNav.append("<li id='magic-line'></li>");
var $magicLine = $("#magic-line");
$magicLine
.width($(".current_page_item").width())
.css("left", $(".current_page_item a").position().left)
.data("origLeft", $magicLine.position().left)
.data("origWidth", $magicLine.width());
$("#example-one li").find("a").hover(function() {
$el = $(this);
leftPos = $el.position().left;
newWidth = $el.parent().width();
$magicLine.stop().animate({
left: leftPos,
width: newWidth
});
}, function() {
$magicLine.stop().animate({
left: $magicLine.data("origLeft"),
width: $magicLine.data("origWidth")
});
});
/*
EXAMPLE TWO
*/
$mainNav2.append("<li id='magic-line-two'></li>");
var $magicLineTwo = $("#magic-line-two");
$magicLineTwo
.width($(".current_page_item_two").width())
.height($mainNav2.height())
.css("left", $(".current_page_item_two a").position().left)
.data("origLeft", $(".current_page_item_two a").position().left)
.data("origWidth", $magicLineTwo.width())
.data("origColor", $(".current_page_item_two a").attr("rel"));
$("#example-two li").find("a").hover(function() {
$el = $(this);
leftPos = $el.position().left;
newWidth = $el.parent().width();
$magicLineTwo.stop().animate({
left: leftPos,
width: newWidth
backgroundColor: $el.attr("rel")
});
}, function() {
$magicLineTwo.stop().animate({
left: $magicLineTwo.data("origLeft"),
width: $magicLineTwo.data("origWidth"),
backgroundColor: $magicLineTwo.data("origColor")
});
});
});
I would appreciate if someone can help me, it's been weeks since I've been
with this website :(
visit http://jsfiddle.net/ghAkB/4/
got an error from I8 saying :
Message: Expected '}'
Line: 59
which in this script is this:
backgroundColor: $el.attr("rel")
where second example is located
$(function(){
var $el, leftPos, newWidth,
$mainNav = $("#example-one"),
$mainNav2 = $("#example-two");
/*
EXAMPLE ONE
*/
$mainNav.append("<li id='magic-line'></li>");
var $magicLine = $("#magic-line");
$magicLine
.width($(".current_page_item").width())
.css("left", $(".current_page_item a").position().left)
.data("origLeft", $magicLine.position().left)
.data("origWidth", $magicLine.width());
$("#example-one li").find("a").hover(function() {
$el = $(this);
leftPos = $el.position().left;
newWidth = $el.parent().width();
$magicLine.stop().animate({
left: leftPos,
width: newWidth
});
}, function() {
$magicLine.stop().animate({
left: $magicLine.data("origLeft"),
width: $magicLine.data("origWidth")
});
});
/*
EXAMPLE TWO
*/
$mainNav2.append("<li id='magic-line-two'></li>");
var $magicLineTwo = $("#magic-line-two");
$magicLineTwo
.width($(".current_page_item_two").width())
.height($mainNav2.height())
.css("left", $(".current_page_item_two a").position().left)
.data("origLeft", $(".current_page_item_two a").position().left)
.data("origWidth", $magicLineTwo.width())
.data("origColor", $(".current_page_item_two a").attr("rel"));
$("#example-two li").find("a").hover(function() {
$el = $(this);
leftPos = $el.position().left;
newWidth = $el.parent().width();
$magicLineTwo.stop().animate({
left: leftPos,
width: newWidth
backgroundColor: $el.attr("rel")
});
}, function() {
$magicLineTwo.stop().animate({
left: $magicLineTwo.data("origLeft"),
width: $magicLineTwo.data("origWidth"),
backgroundColor: $magicLineTwo.data("origColor")
});
});
});
I would appreciate if someone can help me, it's been weeks since I've been
with this website :(
Can Helium Disappear from Earth=?iso-8859-1?Q?=3F_=96_physics.stackexchange.com?=
Can Helium Disappear from Earth? – physics.stackexchange.com
Can Helium disappear? As we know Helium is lighter than air, so basically
Helium fly off from Earth. Is it possible that in the future we will run
out Helium?
Can Helium disappear? As we know Helium is lighter than air, so basically
Helium fly off from Earth. Is it possible that in the future we will run
out Helium?
Why does nginx sometimes silently redirect?
Why does nginx sometimes silently redirect?
Nginx.conf, in brief:
...
server {
listen 80;
server_name ec2-54-234-175-21.compute-1.amazonaws.com;
location / {
root /var/www/static/;
default_type text/html;
try_files $uri $uri/index.html /index.html;
}
location /api/2.0 {
...
proxy_pass http://localhost:8080/;
}
location /api/ {
...
proxy_pass http://localhost:8000/;
}
}
I have two APIs. Essentially, I am trying to make them at reside at the
URIs of /api/1.0 and /api/2.0 respectively. Because of the internal
routing of the 1.0 app, it appends the 1.0 part, so to achieve the effect
I want, the nginx location for it is simply at /api/.
Without exactly understanding the location precedence rules that Nginx
uses, I was hoping /api/ coming after /api/2.0 in my configuration would
cause all things that began with /api/ but are not /api/2.0 to fall into
this second location block. This seems to work, however it is very
inconsistent.
The biggest problem--and I can't seem to find rhyme or reason to it--is
that sometimes /api/1.0 redirects to just /1.0, resulting in it being
handled by my try_files clause. If I put a full URI into the address bar,
'localhost/api/1.0/countyinmate?format=json', sometimes it redirects to
'localhost/1.0/countyinmate?format=json'. But then if I edit the URI by
putting 'api/' back in, this usually works. Anytime this problem occurs,
nginx is oblivious to it, and records in my access log that /1.0 was
accessed.
Any help is appreciated, sorry if I'm missing something obvious.
Nginx.conf, in brief:
...
server {
listen 80;
server_name ec2-54-234-175-21.compute-1.amazonaws.com;
location / {
root /var/www/static/;
default_type text/html;
try_files $uri $uri/index.html /index.html;
}
location /api/2.0 {
...
proxy_pass http://localhost:8080/;
}
location /api/ {
...
proxy_pass http://localhost:8000/;
}
}
I have two APIs. Essentially, I am trying to make them at reside at the
URIs of /api/1.0 and /api/2.0 respectively. Because of the internal
routing of the 1.0 app, it appends the 1.0 part, so to achieve the effect
I want, the nginx location for it is simply at /api/.
Without exactly understanding the location precedence rules that Nginx
uses, I was hoping /api/ coming after /api/2.0 in my configuration would
cause all things that began with /api/ but are not /api/2.0 to fall into
this second location block. This seems to work, however it is very
inconsistent.
The biggest problem--and I can't seem to find rhyme or reason to it--is
that sometimes /api/1.0 redirects to just /1.0, resulting in it being
handled by my try_files clause. If I put a full URI into the address bar,
'localhost/api/1.0/countyinmate?format=json', sometimes it redirects to
'localhost/1.0/countyinmate?format=json'. But then if I edit the URI by
putting 'api/' back in, this usually works. Anytime this problem occurs,
nginx is oblivious to it, and records in my access log that /1.0 was
accessed.
Any help is appreciated, sorry if I'm missing something obvious.
Subscribe to:
Comments (Atom)