Friday, October 27, 2017

Access Camera HTML 5

Access camera and video, the INPUT element with a type of file is necessary:
<input type="file" accept="image/*">
To isolate only a photos as the type to be uploaded, the accept attribute must match the pattern above.
HTML 5 CAPTURE MEDIA DEVICE

<p>Capture Image: <input type="file" accept="image/*" id="capture" capture="camera"> 

<p>Capture Audio: <input type="file" accept="audio/*" id="capture" capture="microphone"> 

<p>Capture Video: <input type="file" accept="video/*" id="capture" capture="camcorder"> 

Friday, December 4, 2015

Bootstrap basic stuff

creating bootstrap breadcurmb using twitter bootstrap
<ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu">
  <li><a tabindex="-1" href="#">Action</a></li>
  <li><a tabindex="-1" href="#">Another action</a></li>
  <li><a tabindex="-1" href="#">Something else here</a></li>
  <li class="divider"></li>
  <li><a tabindex="-1" href="#">Separated link</a></li>
</ul>
creating bootstrap pagination and use .disabled for unclickable links and .active to indicate the current page.
  1. <div class="pagination">
  2. <ul>
  3. <li><a href="#">Prev</a></li>
  4. <li><a href="#">1</a></li>
  5. <li><a href="#">2</a></li>
  6. <li><a href="#">3</a></li>
  7. <li><a href="#">4</a></li>
  8. <li><a href="#">5</a></li>
  9. <li><a href="#">Next</a></li>
  10. </ul>
  11. </div>

Monday, January 5, 2015

Datediff Function Sql Server

DateDiff function returns the  difference between to dates

Suppose we have employee table and it has following rows and columns
Id
Name
Description
JoiningDate
1
Test1
Executive
10/5/2013 0:00
2
Test2
S.Executive
10/5/2012 0:00
3
Test3
Team Lead
10/5/2012 0:00
4
Test4
Jr Engineer
10/11/2014 0:00


Calculate the Employee joining Year, month and days
  select name, datediff(year,JoiningDate,getdate()) Year  , datediff(year,JoiningDate,getdate()) month ,datediff(DAY,JoiningDate,getdate()) day from Employee  where joiningdate is not null

Calculate the age   Sql server in years-month and days

  Declare @dateofbirth datetime
  Declare @years int
  declare @months int
  declare @days int
  declare @temp date
  set @dateofbirth='1983-04-27';
  set @temp  =@dateofbirth

  set @years = (select DATEDIFF(yy, @temp, GETDATE())- CASE WHEN (MONTH(@dateofbirth) > MONTH(GETDATE())) OR (MONTH(@dateofbirth) = MONTH(GETDATE()) AND DAY(@dateofbirth) > DAY(GETDATE())) THEN 1 ELSE 0 END)

SET @temp = DATEADD(yy, @years, @temp)

SET @months = DATEDIFF(m, @temp, GETDATE()) - CASE WHEN DAY(@dateofbirth) > DAY(GETDATE()) THEN 1 ELSE 0 END

SET @temp = DATEADD(m, @months, @temp)
SET @days = DATEDIFF(d, @temp, GETDATE())

select @years as TotalYear ,@months as M
http://blogsiteslist.com