Posts

git - How to see contents of remote (dirs and files) before cloning locally? -

this question has answer here: browse , display files in git repo without cloning 6 answers i new git , frustrated lack of functions used other vcss. 1 such feature able see directory structure of remote without having cloned locally . imagine wanted see if path existed on remote did not have space locally have cloned. me seems basic function , can't see why wouldn't readily available in both command line plain git egit in eclipse. excluded add shroud of mysterious difference others vcss? there no way preview repository without cloning. git dvcs, d stands distributed. looking non-local repo against git ideology. online wrappers github or bitbucket scripts using corresponding apis can accomplish want though.

R check if parameters are specified: general approach -

i include in r functions general approach check if parameters have been specified. using missing() don't want specify parameter names. want make work inside arbitrary function. more specific, want able copy/paste code in function have without changing , check if parameters specified. 1 example following function: tempf <- function(a,b){ argg <- as.list((environment())) print(argg) } tempf(a=1, b=2) try function: missing_args <- function() { calling_function <- sys.function(1) all_args <- names(formals(calling_function)) matched_call <- match.call( calling_function, sys.call(1), expand.dots = false ) passed_args <- names(as.list(matched_call)[-1]) setdiff(all_args, passed_args) } example: f <- function(a, b, ...) { missing_args() } f() ## [1] "a" "b" "..." f(1) ## [1] "b" "..." f(1, 2) ## [1] "..." f(b = 2) ## [1] "a" "....

Python Kernel died when using Gurobi in Enthought Canopy on Win 7 -

i trying use gurobi python solve mixed integer optimization problem, every time run code wrote according gurobi tutorial, message popped up, saying: "the kernel has died, restart it? if not restart kernel, able save notebook, running code nor work until notebook reopened." i used enthought canopy python 2.7 , gurobipy gurobi on win 7. here small trial optimization problem tried solve, , message above showed after run it: import gurobipy import numpy gurobipy import * def minvol(n1,solution): model=model() x=model.addvar(lb=0.0,ub=1.0,vtype=grb.continuous) y=model.addvar(lb=0.0,ub=1.0,vtype=grb.continuous) model.update() varibles=model.getvars() model.setobjective(2*x+y,grb.maximize) model.update() model.optimize() if model.status==grb.optimal: s=model.getattr('s',varibles) in range(n1): solution[i]=s[i] return true else: return false n1=2 solution=[0]*(n1) success=minvol(n1,solution)...

javascript - Sending Email via PHP Not Working -

i have site running on windows azure contains simple contact form people in touch. unfortunately, form isn't work right now... i have index.php file contains form: <div class="form">name="name" placeholder="name" id="contactname" /> <input type="text" name="email" placeholder="email" id="contactemail" /> <textarea name="message" placeholder="message" id="contactmessage"></textarea> <button>contact</button> </div> i have js file this: if ($('#contact').is(":visible")) { $("#contact button").click(function() { var name = $("#contactname").val(); var message = $("#contactmessage").val(); var email = $("#contactemail").val(); var emailreg = /^[a-za-z0-9._+-]+@[a-za-z0-9-]+\.[a-za-z]{2,4}(\.[a-za-z]{2,3})?(\.[a-za-z]{2,3})?$/; ...

jquery button event function to target button by ID -

i have page full of divs contain 1 button each submit function successfully. however trying isolate buttons id , trigger addition of class , message 2 spots within div (input value & #msgsc). however, event not triggering @ all. , think may missing something. how can change/add class , message sibling input tag , #msgsc of particular button clicked (and not of inputs in divs on page simultaneously)? <form id="hello" target="someplace" action="#" method="post"> <table> <tr> <td> <select name="os0"> <option value="item1">item1</option> <option value="item2">item2</option> <option value="item3">item3</option> <option value="item1">item4</option> </select> ...

java - Return Min/Abs of 3 numbers -

i'm working on assignment i'm supposed return smallest of 3 values (absolute values, program states). worked when there 2 values needed returned, added 3rd one, started saying "cannot find symbol" @ math.min inside method. :( can't see problem is? public class threeseven_rasmusds { //start of smallerabsval public static int smallerabsval(int a, int b, int c) { int val = (math.min(math.abs(a), math.abs(b), math.abs(c))); return val; } //end of smallerabsval public static void main(string[] args) { int val = smallerabsval(6, -9, -3); system.out.println(val); } //end of main } //end of class the math.min lib method accepts 2 parameters. if want min of 3 values, need this: math.min( a, math.min(b, c) ); in context: int val = math.min(math.abs(a), math.min(math.abs(b), math.abs(c)));

mysql - SQL date format convert? [dd.mm.yy to YYYY-MM-DD] -

is there mysql function convert date format dd.mm.yy yyyy-mm-dd? for example, 03.09.13 -> 2013-09-03 . since input string in form 03.09.13 , i'll assume (since today september 3, 2013) it's dd-mm-yy. can convert date using str_to_date : str_to_date(myval, '%d.%m.%y') then can format string using date_format : date_format(str_to_date(myval, '%d.%m.%y'), '%y-%m-%d') note year %y (lowercase "y") in str_to_date , %y (uppercase "y") in date_format . lowercase version two-digit years , uppercase four-digit years.