How to save current Vim structural configuration across sessions?
pBy 'structural configuration' I mean the current open buffers, tabs,
windows, and their positions./p pBy 'across sessions' means that I want to
be able to type code:save/code, have it save to code~/.vimsconf/code, and
have typing code:load/code actually load those buffers and set up the
windows and tabs as they were before, for example./p pIs there maybe built
in functionality for that? Or maybe a plugin?/p pI'm using openSUSE 12.3/p
Friday, 9 August 2013
Can someone break down this line so I can understand it?
Can someone break down this line so I can understand it?
I'm having trouble understanding how an array of ArrayLists is initialized
in Java, can someone explain what's going on in this line of code?
edges = (ArrayList<Integer>[]) new ArrayList[nodeCount + 1];
I'm having trouble understanding how an array of ArrayLists is initialized
in Java, can someone explain what's going on in this line of code?
edges = (ArrayList<Integer>[]) new ArrayList[nodeCount + 1];
How to substract one month in SYSDATE() in mysql?
How to substract one month in SYSDATE() in mysql?
My Database date is like "2013-07-09" that is 9th August. SYSDATE() is
"2013-08-09" that is also 9th August. When i am going to take data into
database using this SYSDATE() in takes 08 which is month number is
September. So I want to subtract one month in SYSDATE().
My Database date is like "2013-07-09" that is 9th August. SYSDATE() is
"2013-08-09" that is also 9th August. When i am going to take data into
database using this SYSDATE() in takes 08 which is month number is
September. So I want to subtract one month in SYSDATE().
Using jQuery to switch to a tab with a validation error
Using jQuery to switch to a tab with a validation error
I'm trying to get jQuery to switch to a tab if it finds an error on it.
Right now it will find an error but won't go to the tab with the error.
This is the code I currently have
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#Form').validate({
ignore: ".ignore",
invalidHandler: function(){
jQuery("#tabs").tabs("select", jQuery("#Form
.input-validation-error").closest(".tab-pane").get(0).id);
}
});
});
jQuery('.Submit').click(function(evt) {
evt.preventDefault();
jQuery('#Form').submit()
});
</script>
Thanks for any responses
I'm trying to get jQuery to switch to a tab if it finds an error on it.
Right now it will find an error but won't go to the tab with the error.
This is the code I currently have
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#Form').validate({
ignore: ".ignore",
invalidHandler: function(){
jQuery("#tabs").tabs("select", jQuery("#Form
.input-validation-error").closest(".tab-pane").get(0).id);
}
});
});
jQuery('.Submit').click(function(evt) {
evt.preventDefault();
jQuery('#Form').submit()
});
</script>
Thanks for any responses
Thursday, 8 August 2013
Finding rules for two functions
Finding rules for two functions
What are rules for $\alpha(\Delta x, \Delta y) , \beta(\Delta x, \Delta
y)$ functions so that $f(x,y)=\mathrm{e}^{xy}$ to be differentiable on
$\mathbb{R}^2$ by the following definition?
$\textbf{DEFINITION}$: Suppose that for every point $(a+\Delta x, b+\Delta
y)$ in a deleted neighborhood of $(a,b)$ we can write: $f(a+\Delta x,
b+\Delta y)-f(a,b)=A\Delta x+\Delta y +\alpha(\Delta x, \Delta y)\Delta
x+\beta(\Delta x, \Delta y)\Delta y$ where $A,B$ are constant, and
$\alpha(\Delta x, \Delta y) , \beta(\Delta x, \Delta y)$ are functions of
$\Delta x, \Delta y$ such that $\displaystyle\lim_{(\Delta x, \Delta y)\to
(0,0)}\alpha(\Delta x, \Delta y) =\lim_{(\Delta x, \Delta y)\to
(0,0)}\beta(\Delta x, \Delta y) =0 $, then $f$ is said to be
$\underline{differentiable}$ at $(a,b)$.
$\textbf{Remark}$: We should be find $A,B$ , and functions $\alpha(\Delta
x, \Delta y) , \beta(\Delta x, \Delta y)$ at any point $(a, b)$ . Of
course I know that $A=\dfrac{\partial f}{\partial x}(a,b) \ , \
B=\dfrac{\partial f}{\partial y}(a,b)$ . But What are $\alpha(\Delta x,
\Delta y) , \beta(\Delta x, \Delta y)$ functions, exactly?
What are rules for $\alpha(\Delta x, \Delta y) , \beta(\Delta x, \Delta
y)$ functions so that $f(x,y)=\mathrm{e}^{xy}$ to be differentiable on
$\mathbb{R}^2$ by the following definition?
$\textbf{DEFINITION}$: Suppose that for every point $(a+\Delta x, b+\Delta
y)$ in a deleted neighborhood of $(a,b)$ we can write: $f(a+\Delta x,
b+\Delta y)-f(a,b)=A\Delta x+\Delta y +\alpha(\Delta x, \Delta y)\Delta
x+\beta(\Delta x, \Delta y)\Delta y$ where $A,B$ are constant, and
$\alpha(\Delta x, \Delta y) , \beta(\Delta x, \Delta y)$ are functions of
$\Delta x, \Delta y$ such that $\displaystyle\lim_{(\Delta x, \Delta y)\to
(0,0)}\alpha(\Delta x, \Delta y) =\lim_{(\Delta x, \Delta y)\to
(0,0)}\beta(\Delta x, \Delta y) =0 $, then $f$ is said to be
$\underline{differentiable}$ at $(a,b)$.
$\textbf{Remark}$: We should be find $A,B$ , and functions $\alpha(\Delta
x, \Delta y) , \beta(\Delta x, \Delta y)$ at any point $(a, b)$ . Of
course I know that $A=\dfrac{\partial f}{\partial x}(a,b) \ , \
B=\dfrac{\partial f}{\partial y}(a,b)$ . But What are $\alpha(\Delta x,
\Delta y) , \beta(\Delta x, \Delta y)$ functions, exactly?
jQuery Nested Sortable in Codeigniter
jQuery Nested Sortable in Codeigniter
I have adapted the nested sortable plugin to codeigniter, its updating the
order records in the database, but while i'm getting the all pages, its
not ordering in user interface, just ordering according to id there. I
have a get function in MY_Model, which is doing well, and ordering
everything else in the other pages, but only this one is lacking.
Order Controllers :
public function order ()
{
$this->data['sortable'] = TRUE;
$this->data['subview'] = 'admin/page/order';
$this->load->view('admin/_layout_main', $this->data);
}
public function order_ajax ()
{
// Save order from ajax call
if (isset($_POST['sortable'])) {
$this->page_m->save_order($_POST['sortable']);
}
// Fetch all pages
$this->data['pages'] = $this->page_m->get_nested();
// Load view
$this->load->view('admin/page/order_ajax', $this->data);
}
Order Model Functions:
public function save_order ($pages)
{
if (count($pages)) {
foreach ($pages as $order => $page) {
if ($page['item_id'] != '') {
$data = array('parent_id' => (int) $page['parent_id'],
'order' => $order);
$this->db->set($data)->where($this->_primary_key,
$page['item_id'])->update($this->_table_name);
}
}
}
}
public function get_nested ()
{
$pages = $this->db->get('pages')->result_array();
$array = array();
foreach ($pages as $page) {
if (! $page['parent_id']) {
$array[$page['id']] = $page;
}
else {
$array[$page['parent_id']]['children'][] = $page;
}
}
return $array;
}
Order Pages View :
<section>
<h2>Order Pages</h2>
<p class="alert alert-info">Hit the save, after you are done</p>
<div id="orderResult"></div>
<input type="button" id="save" value="Save" class="btn btn-primary" />
</section>
<script>
$(function() {
$.post('<?php echo site_url('admin/page/order_ajax'); ?>', {},
function(data){
$('#orderResult').html(data);
});
$('#save').click(function(){
oSortable = $('.sortable').nestedSortable('toArray');
$('#orderResult').slideUp(function(){
$.post('<?php echo site_url('admin/page/order_ajax'); ?>', {
sortable: oSortable }, function(data){
$('#orderResult').html(data);
$('#orderResult').slideDown();
});
});
});
});
</script>
Order Ajax View :
echo get_ol($pages);
function get_ol ($pages, $child = FALSE)
{
$str = '';
if (count($pages)) {
$str .= $child == FALSE ? '<ol class="sortable">' : '<ol>';
foreach ($pages as $page) {
#dump($item);
$str .= '<li id="list_' . $page['id'] .'">';
$str .= '<div>' . $page['title'] .'</div>';
// Do we have any children?
if (isset($page['children']) && count($page['children'])) {
$str .= get_ol($page['children'], TRUE);
}
$str .= '</li>' . PHP_EOL;
}
$str .= '</ol>' . PHP_EOL;
}
return $str;
}
?>
<script>
$(document).ready(function(){
$('.sortable').nestedSortable({
handle: 'div',
items: 'li',
toleranceElement: '> div',
maxLevels: 2
});
});
</script>
Thanks
I have adapted the nested sortable plugin to codeigniter, its updating the
order records in the database, but while i'm getting the all pages, its
not ordering in user interface, just ordering according to id there. I
have a get function in MY_Model, which is doing well, and ordering
everything else in the other pages, but only this one is lacking.
Order Controllers :
public function order ()
{
$this->data['sortable'] = TRUE;
$this->data['subview'] = 'admin/page/order';
$this->load->view('admin/_layout_main', $this->data);
}
public function order_ajax ()
{
// Save order from ajax call
if (isset($_POST['sortable'])) {
$this->page_m->save_order($_POST['sortable']);
}
// Fetch all pages
$this->data['pages'] = $this->page_m->get_nested();
// Load view
$this->load->view('admin/page/order_ajax', $this->data);
}
Order Model Functions:
public function save_order ($pages)
{
if (count($pages)) {
foreach ($pages as $order => $page) {
if ($page['item_id'] != '') {
$data = array('parent_id' => (int) $page['parent_id'],
'order' => $order);
$this->db->set($data)->where($this->_primary_key,
$page['item_id'])->update($this->_table_name);
}
}
}
}
public function get_nested ()
{
$pages = $this->db->get('pages')->result_array();
$array = array();
foreach ($pages as $page) {
if (! $page['parent_id']) {
$array[$page['id']] = $page;
}
else {
$array[$page['parent_id']]['children'][] = $page;
}
}
return $array;
}
Order Pages View :
<section>
<h2>Order Pages</h2>
<p class="alert alert-info">Hit the save, after you are done</p>
<div id="orderResult"></div>
<input type="button" id="save" value="Save" class="btn btn-primary" />
</section>
<script>
$(function() {
$.post('<?php echo site_url('admin/page/order_ajax'); ?>', {},
function(data){
$('#orderResult').html(data);
});
$('#save').click(function(){
oSortable = $('.sortable').nestedSortable('toArray');
$('#orderResult').slideUp(function(){
$.post('<?php echo site_url('admin/page/order_ajax'); ?>', {
sortable: oSortable }, function(data){
$('#orderResult').html(data);
$('#orderResult').slideDown();
});
});
});
});
</script>
Order Ajax View :
echo get_ol($pages);
function get_ol ($pages, $child = FALSE)
{
$str = '';
if (count($pages)) {
$str .= $child == FALSE ? '<ol class="sortable">' : '<ol>';
foreach ($pages as $page) {
#dump($item);
$str .= '<li id="list_' . $page['id'] .'">';
$str .= '<div>' . $page['title'] .'</div>';
// Do we have any children?
if (isset($page['children']) && count($page['children'])) {
$str .= get_ol($page['children'], TRUE);
}
$str .= '</li>' . PHP_EOL;
}
$str .= '</ol>' . PHP_EOL;
}
return $str;
}
?>
<script>
$(document).ready(function(){
$('.sortable').nestedSortable({
handle: 'div',
items: 'li',
toleranceElement: '> div',
maxLevels: 2
});
});
</script>
Thanks
Resolution help?
Resolution help?
I only have 1366x768, I need 1600x900, please help? I've installed nvidia
drivers, and still nothing. I've tried using the xrandr --newmode
"1600x900", but that doesn't work. Please, help? :c
I only have 1366x768, I need 1600x900, please help? I've installed nvidia
drivers, and still nothing. I've tried using the xrandr --newmode
"1600x900", but that doesn't work. Please, help? :c
Subscribe to:
Posts (Atom)