Posts

git mirroring to GitHub and filtering private files -

currently working on project. want open-source our day-to-day commits full info (author, etc...) while filtering out specific private folders. let's commit a/file1 , b/file2 in branch master, have mirrored on github b folder filtered (this commit have a/file1). one way thinking remote update hook that: list new commits added newref (let's lastfoundcommit..newref) amend commits 1 one (from lastfoundcommit newref) remove unwanted files in process, might create local master-filtered branch (if helps have locally) push branch public repository somehow keep mapping of commit id between private , public commits, compute "lastfoundcommit" on next push ideally go both way (i.e., nice if import github branches , pull requests , have them "rebased" on top of our private repository, either automatically or simple process -- not hard rebase). this similar git-subtree can do, except not extract subdir filter various files instead. does seem feasible...

javascript - How to decrease number [value] before post? -

i not sure possible if user type numbers in input, want decrease number in hidden before post? example if type 1 output 0 or if type 2 output 1 <input class="decrease" type="text" name="number" value="" /> <input class="output" type="hidden" name="number" value="//decrease number//" /> hope 1 helps. $(document).ready(function(){ $('.decrease').keyup(function(){ if($('.decrease').val()!="") { $('.output').val($('.decrease').val()-1); } else { $('.output').val(""); } }); }); you have make sure user types in numbers. if user types in character, value of hidden input nan. see documentation more examples , information.

vector graphics - What are binormals used for? -

i know binormal orthogonal both surface normal , tangent in point on plane used exactly? there lot of uses, more can covered in simple answer. one of common usage in shaders. normal, tangent , binormal can used navigate in surface space. can used create matrix lets transform vector model space surface space or texture space. in turn used lot of different shader effects, e.g. advanced lighting or effects parallax mapping.

How to copy all the files in certain Directory and recreate the directory structure dynamically using python -

i want move files of type existing directory structure new dynamic directory structure.for e.g: if file is c://users//desktop//635289512-251.txt i need place file in c://users//desktop//635_users//2895_access//635289512-251.txt should copy each , everyfile , paste them in directory or can zip them , unzip them dynamically? using below code create directory. please me if there better way of doing this. thank you help. src = "folder1/folder2/file1" dst = "folder3"+src dstfolder = os.path.dirname(dst) if not os.path.exists(dstfolder): os.makedirs(dstfolder) shutil.copy(src,dst) use shutil.copytree copy entire directory new location. import shutil src = "folder1/folder2/file1" dst = "folder3"+src dstfolder = os.path.dirname(dst) shutil.copytree(src,dstfolder)

json - Error getting Object from NSDictionary -

i have array below ( ( "id:19", "name:virgin club house heathrow", "address:heathrow airport, 234 bath road, hayes, middlesex", "postcode:ub3 5ap", "latitude:51.48127", "longitude:-0.448696" ), ( "id:20", "name:le bilboquet", "address:20 e 60th st, new york, united states", "postcode:ny 10022", "latitude:40.764072", "longitude:-73.970834" ) ) which enumerating through using [venuesarray enumerateobjectsusingblock:^(nsdictionary* obj, nsuinteger index, bool *stop) { nsstring* tmpstr; tmpstr = [obj objectforkey:@"id"]; }]; however i'm getting error -[__nscfarray objectforkey:]: unrecognized selector sent instance 0x7ff26866a690. like said, have array. though block calling objects getting nsdictionary , being gi...

c# - WPF DataGrid shows no data -

this constructor of usercontrol includes datagrid element. public results(list<cartitem> items) { initializecomponent(); this.items.datacontext = items; } and xaml of datagrid. <datagrid autogeneratecolumns="false" name="items" isreadonly="true" minheight="300"> <datagrid.columns> <datagridcheckboxcolumn> <datagridcheckboxcolumn.headertemplate> <datatemplate> <checkbox style="{staticresource stylecheckbox}" ischecked="{binding isselected}"/> </datatemplate> </datagridcheckboxcolumn.headertemplate> </datagridcheckboxcolumn> <datagridtextcolumn header="abone no" binding="{binding subscriberno}" /> <datagridtextcolumn header="adı soyadı" binding=...

php - How to get user id in session? -

kinda noob problem i'm working on 2 hours , can't solve i have login system works fine (thanks tutorials), i'd save id in session when user's logging this login.php: <?php session_start(); require_once 'config.php'; if(isset($_post['btn-login'])){ $uname = $_post['txt_uname_email']; $umail = $_post['txt_uname_email']; $upass = $_post['txt_password']; $sth = $bdd->prepare("select user_id users user_name=$uname"); $sth->execute(); $result = $sth->fetch(pdo::fetch_assoc); $uid = $result; if($user->login($uname,$umail,$upass)){ $_session['user_name'] = $uname; $_session['user_mail'] = $umail; $_session['user_session'] = $userrow['user_id']; $_session['user_id'] = $uid; $uname = $_post['txt_uname_email']; $umail = $_post['txt_uname_email']; $upass = $_p...