Posts

Showing posts from January, 2011

TFS 2013 On-Premises Sprint Board Statuses Customization -

Image
in tfs 2013 web access when go sprint board see 2 states active , closed. i wanted add few more statuses in progress , blocked. downloaded process template using process editor part of tfs power tools. when looked @ process template workflow there do, in progress, done , removed shown in figure attached.. but these not showing in task work item. see in state dropdown active , closed. how change see active, in-progress, completed , blocked states. please help. by default, states on sprint board do, in progress, , done (assume you're working scrum project template). in order add state on sprint board, need to: run witadmin.exe exportcommonprocessconfig command export common process config tfs project. customize file similar followings: <taskworkitems category=”microsoft.taskcategory”> <states> <!-->states want have<--> </states> </taskworkitems> run witadmin.exe importcommonprocess...

javascript - jquery datepicker highlight eventDates between two dates -

please can me solve these below issues in jquery datepicker i want highlight start date '09/01/2015' end date '09/30/2015' without adding every single day, like: eventdates[ new date( '09/01/2015', 09/31/2015 )] = 'unavailable'; this code looks like: var eventdates = {}; eventdates[ new date( '09/01/2015' )] = 'unavailable'; eventdates[ new date( '09/02/2015' )] = 'unavailable'; eventdates[ new date( '09/03/2015' )] = 'unavailable'; eventdates[ new date( '09/04/2015' )] = 'unavailable'; eventdates[ new date( '09/05/2015' )] = 'unavailable'; eventdates[ new date( '09/06/2015' )] = 'unavailable'; eventdates[ new date( '09/07/2015' )] = 'unavailable'; eventdates[ new date( '09/08/2015' )] = 'unavailable'; eventdates[ new date( '09/09/2015' )] = 'unavailable'; ...

php - Variables wont insert into table ~ mysqli -

i'm posting form in html php. i have connect.php connects database: <?php $db = mysqli_connect('localhost','adam','password','easyfix', '3306'); if(mysqli_connect_errno()){ echo "failed connect mysql: " . mysqli_connect_error(); } ?> i have register.php want insert variables html form. <?php require 'connect.php'; $username = $_post["username"]; $email = $_post["email"]; $password = $_post["password"]; $cpassword = $_post["cpassword"]; //echo $username; //echo $email; //echo $password; //echo $cpassword; mysqli_query($db,"insert users (username, email, password) values ('". $username ."', '". $email ."', '". $password ."')"); or die(mysqli_error($db)); $mysqli->close($db); ?> i've used echos make sure data posted, ha...

Add DBLookupCombobox to Delphi DBGrid -

Image
i'd add dblookupcomboboxes columns in dbgrid. there nice article on about.com on how here . problem table having many columns, if select dblookupcombobox in 1 column , try scroll left, combobox move left shown in included images. how can about.com code can changed prevent behavior? web search showed 2 others complaining of exact same problem no solution. note want use dblookupcombobox show name enter id, using simple picklist not do. procedure tform1.dbgrid1colexit(sender: tobject); begin if dbgrid1.selectedfield.fieldname = dblookupcombobox1.datafield dblookupcombobox1.visible := false end; procedure tform1.dbgrid1drawcolumncell(sender: tobject; const rect: trect; datacol: integer; column: tcolumn; state: tgriddrawstate); begin if (gdfocused in state) begin if (column.field.fieldname = dblookupcombobox1.datafield) dblookupcombobox1 begin left := rect.left + dbgrid1.left + 2; top := rect.top + dbgrid1.top + 2; width := rect.right ...

c# - Sharing KeyHandlers from MainWindow with a UserControl -

i have usercontrol has few previewkeydown event listeners, move these listeners mainwindow work not when usercontrol active focus, there way achieve this? the reason have them in usercontrol action of previewkeydown event depends on tabitem selected in usercontrol. you can handle previewkeydown @ mainwindow level , keydown , usercontrol level. best handle preview events @ container level grid/stackpanel etc. because @ window level many preview events reached various controls. <window x:class="wpfusercontrol.mainwindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:uc="clr-namespace:wpfusercontrol" title="mainwindow" height="605.263" width="701.316" previewkeydown="window_previewkeydown"> <grid> <grid.rowdefinitions> <rowdefinition hei...

ruby on rails 4 - disable ssl verification on gem active_rest_client -

i'm creating model in ruby/rails uses gem "active-rest_client" ( https://github.com/whichdigital/active-rest-client ). target server 'speaks' https mismatched ssl cert. need disable ssl verification when query (long story, accept that). the gem doesn't seem have native way disable ssl verification. however, relies on faraday gem can disable ssl verification ( https://gist.github.com/mislav/938183 ). when do: activerestclient::base.faraday_config |faraday| faraday.ssl = false end it tells me "ssl" undefined method. does know way? thanks in advance!

javascript - Authorization header using OAuth1.0A for Twitter API v1.1 -

i building search engine start-up project in web development. search engine takes string , queries wiki , twitter api. have been working on days and, believe, have found nice, clean way implement it. boycook's twitterjsclient in code (which beautifully written) has set twitter function takes in config variable , sets authorization us. there missing? have been through , looks great. new javascript , might missing something.. my code: var error = function (err, response, body) { console.log('error [%s]', err); }; var success = function (data) { console.log('data [%s]', data); }; var config = { "consumerkey": "{mine}", "consumersecret": "{mine}", "accesstoken": "{mine}", "accesstokensecret": "{mine}", "callbackurl": "" } var twitter = require('twitter-node-client').twitter; var twitter = new twitter(config); twitter.g...

java - Obscuring JNI Code From End Users in Android -

i've written bunch of android jni code want make library customer. obviously, don't want customer able see jni code. there way can include file in library project them? i've tried using system.loadlibrary(<library>); unsatisfied link error every time. one thing that's worked, i've compiled project , deleted c files. i'm still able use .so file, if make clean, deletes file , there's no way recover without source. in short, want able compile file on own, , give customer java code interfaces it. don't care if see java 'wrapper' source don't want them able see jni code. want them able treat library other (ie make cleans don't wreck it). thanks! is there way can include file in library project them? package aar containing libraries, , host aar artifact customers. see cwac-anddown library example. aar contain .so files whatever architectures supporting, plus jar of compiled java code provides java api na...

angularjs - Save form before state change with uirouter -

i have multi steps form in application , save before go next step... did simple example, i'm not sure if it's right approach. used resolve config , service access formdata. config app.config(function($stateprovider, $urlrouterprovider) { $urlrouterprovider.otherwise("/"); $stateprovider .state('home', { url : '/', controller : 'appctrl', templateurl : 'partials/home.html', resolve : { saveform : function($state, formdata){ } }, }) .state('home.state1', { url: "state1", templateurl : 'partials/item1.html', resolve : { saveform : function($state, formdata){ return formdata.save(); } ...

php - Change architecture of User Table from old design to new -

i looking general information in regards user table design. i have old table design 'users', need update not breaking entire site's structure. current table design userid | email | firstname | last name | ... 1 | a@a.com | john | doe | ... 2 | b@b.com | jane | doe | ... i need able create "primary" users, "assitant" users. now believe should have few tables designed: users accounts users > accounts - (relationships & permissions) ie: of users > accounts tableid | userid | accountid | perm 1 | 1 | 1 | 001 so guess question is. there better way this? if there current design being used? hope makes sense. direction in appreciated. here's example you'd have table each group, plus users table. can filter users group using join. don't love this. if else has better suggestion, i'd hear it. http://sqlfiddle.com/#!9/993dd/1

java - textview on arraylist Android -

my "stress" place hyperlink on item of arraylist . dont have textview on xml, simple listview. private void preparelistdata() { listdataheader = new arraylist<string>(); listdatachild = new hashmap<string, list<string>>(); //header listdataheader.add("text example"); //itens list<string> itemal = new arraylist<string>(); itemal .add("text example"); itemal .add(**"watch clip - http://videos.sapo.pt/testtesttest**"); listdatachild.put(listdataheader.get(0), itemal ); } and xml file: <relativelayout... <listview android:layout_margintop="100dp" android:id="@+id/lvexp4" android:layout_height="match_parent" android:layout_width="match_parent" tools:listitem="@android:layout/simple_list_item_checked" /> </relativelayout> first of create adapter listview,and se...

In C how do I break a multiple word string stored in a variable into an array with each word holding an array value -

what looking have users input of multiple words in 1 variable split apart , each of words stored in array value. for example user types input of: "when in course" , it's stored in single variable "input" how each word of variable array such: array[0] = when array[1] = in array[2] = array[3] = course etc. my end goal able run if statement against first word typed , use determine course of action follows. for example user types: add when in course and run if statement against it: if array[0] = add file_ptr = fopen ("file1.txt", "a+"); fprintf(file_ptr, "%s" , buf," "); } fclose(file_ptr); else if array[0] = delete then delete etc. thank guys assistance. i don't understand question well, start function first, can split string: the c library function char *strtok(char *str, const char *delim) breaks string str series of tokens using delimit...

c++ - unable to compile mongo-cxx-driver -

from cxx driver quickstart guide i've been unable finish compilation of new driver on either ubuntu or centos vm. i've followed steps letter several time, i'm not sure have gone wrong. in file included /home/sam/downloads/mongo-cxx-driver/src/mongocxx/private/bulk_write.hpp:20:0, /home/sam/downloads/mongo-cxx-driver/src/mongocxx/bulk_write.cpp:19: /home/sam/downloads/mongo-cxx-driver/src/mongocxx/private/libmongoc.hpp:31:63: error: ‘mongoc_client_pool_set_ssl_opts’ not declared in scope #define mongocxx_libmongoc_symbol(name) constexpr auto name = mongoc_##name; ^ /home/sam/downloads/mongo-cxx-driver/src/mongocxx/private/libmongoc_symbols.hpp:42:1: note: in expansion of macro ‘mongocxx_libmongoc_symbol’ mongocxx_libmongoc_symbol(client_pool_set_ssl_opts) i've redone several times. several times have reinstalled entire operating system. error in question relates 1.2 development v...

spring boot - Unable to start embedded container; nested exception is java.lang.NoClassDefFoundError: java/nio/charset/StandardCharsets -

Image
i created starter project spring tool suite config shown below when run app changing of @springbootapplication @restcontroller public class firstapplication { public static void main(string[] args) { springapplication.run(firstapplication.class, args); } @requestmapping("/greet") public string hellogreeting() { return "salam rest"; } } it crashes saying . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: spring boot :: (v1.2.6.release) 2015-10-03 08:18:45.362 info 4100 --- [ main] c.rhcloud.arshad.demo.firstapplication : starting firstapplication on arshad pid 4100 (f:\boot-work\first\target\classes started arshay in f:\boot-work\first) 2015-10-03 08:18:45.487 info 4100 --- [ ...

How to change headers in a CSV file with 'CSV' then save the new headers in Ruby? -

i came across exact question i'm looking answer: " how change headers in csv file fastercsv save new headers? " unfortunately, answer out of date because fastercsv no longer available solution. here's example code given an answer question : require 'fastercsv' input = file.open 'original.csv', 'r' output = file.open 'modified.csv', 'w' fastercsv.filter input, output, :headers => true, :write_headers => true, :return_headers => true |row| change_headers(row) if row.header_row? end input.close output.close but when tried implement recommended solution in own program realized ruby no longer allows fastercsv. , command line said: please switch ruby 1.9's standard csv library. it's fastercsv plus support ruby 1.9's m17n encoding engine. so tried removing 'faster' everywhere said "fastercsv'. except gave me: undefined method `change_headers' main:object (nomet...

erlang - Passing arguments to a function: a two element tuple v. two separate arguments? -

in situations, find clearer if pass 2 arguments function, e.g. 2 lists, rather passing tuple containing 2 lists. considered better style? differences in efficiency? thanks. it matter of taste , designed api. if follow "don't make me think" philosophy, might end using both ways. using tuple in argument can confusing, because non-trivial , has documented. example, lists:zip({list1, list2}) confusing because sending in lists separately more intuitive. if 2 lists belong , passed through several functions before being used, can handy group them 1 tuple functions on way don't have pass them separately. makes tuple lightweight "object" can pass around. functions understand "object" can either it, or split , call deeper functions operate on elements separately. sometimes 2 lists related each other makes more sense keep them in tuple: aquire(caller, {[item|free], busy}) -> {free, [{caller, item}|busy]}; aquire(_caller, {[], _bus...

html - How to Get Labels to Line Up -

Image
i'm done calculator application. last thing have 2 labels ("first number:" , "second number:") line perfectly. move "first number:" right little bit colon : lines colon below it. i've tried assigning label class , moving right in css, moving textbox right well. here full html: <!doctype html> <html> <head> <meta charset="utf-8"> <title>calculator</title> <link rel="stylesheet" href="styles.css"> <script src="calculator.js"></script> </head> <body> <section> <h1>calculator</h1> <label> </label> <input class="nolabel" type="text" id="sum" disabled="disabled"> <br> <label>first number:</label> <input type="text" id="firstnumber"> <br> <label>second number:</label> <input type="text" id...

python - Finding the same numbers in an input and summing the paired numbers -

i want find number pairs in input, sum pairs, leave out unpaired numbers. mean 8 8 8 = 16 8 8 8 8 8 = 32 so numbers pair of 2 counted number doesn't have pair won't counted. sorry if worded weird don't know how explain it, example help. for example: 8 3 4 4 5 9 9 5 2 would output: 36 4+4+5+5+9+9 = 36 in python. as correction of answer @avinash-raj gave: import collections s = "8 3 4 4 5 9 9 5 2" l = s.split() print(sum([int(item) * 2 * (count // 2) item, count in collections.counter(l).items()])) as explanation: we vacuum numbers in counter , tell number of times key has been seen the expression (count // 2) integer division, , gives number of complete pairs. if we've seen key 9 times, (count // 2) -> 9 / 2 -> 4.

javascript - How to remove a div without removing its children? -

for example http://jsfiddle.net/skpfknxo/ it removes div #test along children #test2 , #test3 . want remove #test without removing children. how done? $( "button" ).click(function() { $( "#test2" ).unwrap(); }); demo the .unwrap() method removes element's parent. inverse of .wrap() method. matched elements (and siblings, if any) replace parents within dom structure.

python - I am trying to get an upper triangle in a matrices, but i did not get an expected output. Could everyone help me out -

# timestable.py t = int(input("what size of multiplication table see (enter 1 – 12)?")) if (t <=12): s = input("what kind table display, enter either r, u, or l? (r regular full matrix, u upper triangular matrix, l lower triangular matrix)?") if s=="r": row in range (1,t+1): col in range (1,t+1): prod = row * col if prod < 10: print(' ', end = '') print(row * col, ' ', end = '') print() elif s== "l" : in range(1,t+1): j in range (1, i+1): prod = *j if prod < 10: print(' ', end = '') print(i * j, ' ', end = '') print() elif s== "u" : in range(1,t+1): j in range (1, i-1): prod = *j ...

How can I create a recursive menu in HTML / Javascript? -

Image
take @ image below: i want create menu don't know how start. thoughts? it's pretty simple, in fact. consists in recursive nodelist. you can achieve using ul , li , a simultaneously: <ul> <li> <a>text here</a> <!-- repeat --> </li> </ul> and perform behavior, it's pretty simple too. must see if a element has nextelementsibling , , if has, it's because current node has child. take @ example below created: (function() { var tree = document.getelementbyid('tree'); /* firstly, hide child items */ [].foreach.call(tree.queryselectorall('ul li a'), function(el, i) { if (el.nextelementsibling) el.nextelementsibling.classlist.add('hidden'); }); /* here make event delegation, add event handler hole tree */ tree.addeventlistener('click', function(e) { var el = e.target; /* if element clicked anchor, it's because it...

.htaccess - Htaccess 301 Redirect Issue With External Domain -

basically using registrar 301 redirect domain different domain [example.org] , trying redirect of inner pages using htaccess on [example.org] problem 1: i'm trying redirect es/notice.php?file=news.php to es/ but though redirection works, appears es/?file=news.php problem 2: redirection of individual pages (e.x; len.php /es/) still doesn't work, shows 404 # use php5.4 default addhandler application/x-httpd-php54 .php rewriteengine on options -multiviews rewriteengine on rewritebase / options +followsymlinks rewriterule ^/?pricing$ http://example.org/buy-stuff [r=301,l] rewriterule ^/?stuff-tour$ http://example.org/stuff-stuff-tour [r=301,l] rewriterule ^/?fr/stuff-tour$ http://example.org/stuff-stuff-tour [r=301,l] rewriterule ^/?es/notice.php$ http://example.org/es/ [r=301,l] rewriterule ^/?len.php$ http://example.org/es/ [r=301,l] rewriterule ^/?latest-blog-posts$ http://example.org/blog [r=301,l] rewriterule ^/?por/(.*)$ http://example.or...

swift - Getting 403 forbidden error while retrieving locations from quickblox -

i getting status 403 forbidden when use retrieve locations,if sending location sent. here code implementing override func viewdidload() { super.viewdidload() qbchat.instance().delegate = self user.login = uname user.password = pass qbrequest.loginwithuserlogin(uname, password: pass, successblock: nil, errorblock: nil) qbrequest.userwithlogin(uname, successblock: { (response: qbresponse!,user: qbuuser!) in self.userdetails = user qbuuser }, errorblock: { (response: qbresponse!) in println(response.error) }) // additional setup after loading view. } @ibaction func getlocationtapped(sender: anyobject) { qbrequest.geodatawithid(self.userdetails!.id, successblock: { (response: qbresponse!,geodata: qblgeodata!) in println("geodata: \(geodata)") }, errorblock: nil) } and error log. quickbloxchat[2332:33100] request he...

javascript - How to get value of selected element? -

i have multi level buttons such select 1 of button in level 1 , want show button in next level. now, want value of button selected javascript code. below code. bring code show multi level buttons: <script type="text/javascript"> var menuarray = ['0']; $(function () { $('.showbutton').click(function () { //get target div show var targetid = $(this).attr('target'); //hide divs $('.targetdiv').hide(); //show menu items in chain var found = false; //get containing div target number var current = $(this).parent().attr('id').tostring().charat(3); var length = menuarray.length; //remove elements of array lower clicked button for(var i=0; i<length; i++) { //check if next menu item button pressed , never delete root menu (elem == 0) if(menuarray[0] == cu...

javascript - How to Detect Mousedown + Mousemove Left or Right Direction -

can please take @ demo , let me know how can detect whether mousemove toward left or right? $('.container').mousedown(function(){ $(this).mousemove(function(){ //if moves left { console.log("moving left"); } //if moves right { console.log("moving right"); } }); }); $('.container').mouseup(function(){ $(this).unbind("mousemove"); }); .container { height:200px; width:200px; background-color:#1abc9c; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="container"></div> definitely 1 off many solution: $('.container').mousedown(function(e1){ var mx = e1.pagex;//register mouse down position $(this).mousemove(function(e2){ if (e2.pagex > mx){ //right w.r.t mouse down position console.log("moved right"); ...

AWS custom TCP port access for ejabberd in ubuntu Linux? -

Image
i want access custom tcp port on aws ubuntu ejabberd. eajjb erd installation working when accessed via wget on terminal of system. not able access via browser. access rule inbound traffic have been set in aws security group. i'm not able figure out problem why interface not avalilable on browser. --2015-10-03 07:02:00-- http://iglimped.com:5280/admin/ resolving iglimped.com (iglimped.com)... 52.74.228.147 connecting iglimped.com (iglimped.com)|52.74.228.147|:5280... connected. http request sent, awaiting response... 401 unauthorized it seems putting incorrect login , password credentials on admin interface.

mysql - Why does ExtractValue() fail in an UPDATE and succeed in a SELECT? -

when execute query... update tbl a, (select id, extractvalue(content, '//a[contains(text(), "view")]/@href') url tbl) b set tbl.`url` = b.`url` ...i see error: error code: 1525 incorrect xml value: 'parse error @ line 57 pos 195: '</div>' unexpected (end-of-input wanted)' but when execute query... select id, extractvalue(content, '//a[contains(text(), "view")]/@href') url tbl ...the query succeeds. why update query fail standalone select query succeeds?

javascript - Gridster auto resize by content height -

i trying append content inside gridster widget no luck 2 days already. tried with: .resize_widget( $widget, [size_x], [size_y], [reposition], [callback] ) but sizes x , y accept numbers - default re-sizing mechanism , not pixels. sort of steps. if increment +1 size_y widget re-sized more needed , again own mechanism. looking way reduce step. no luck. tried change widget height, min-height, etc. not re-sizing. have suggestions, ideas? just in case comes question later. the x , y numbers number of columns , rows widget takes up. define number of rows , columns, width , height of each when create gridster grid.

javascript - How can i get refresh time from html input box and refresh it with that parameter? -

i want use auto refresh page in html code,i use html code: <meta http-equiv="refresh" content="5" > every thing ok,but want user enter number html input box: <input type="text" ><br> , refresh time time set enter number,for more explain,user enter 10 , page refresh every 10 second.how can solve that?thanks. this untested. to meta tags var metatags = document.getelementsbytagname("meta"); to loop on them find right one for (var = 0; < metatags.length; i++) { if (metatags[i].getattribute("http-equiv") === "refresh") { } } and change refresh interval (inside if) metatags[i].setattribute("content", yourvalue); hope works.

android - Why I can't play video when I set maxDuration -

i made camera records video when it's opened. problem when put maxduration (3 sec) stops recording after 3 seconds video can not played. how fix that. when delete recorder.setmaxduration(3000); records , stops recording after exit app , video works, when put maxduration 3sec doesn't play video. import android.annotation.suppresslint; import android.annotation.targetapi; import android.content.context; import android.hardware.camera; import android.media.mediarecorder; import android.os.environment; import android.util.attributeset; import android.view.surfaceholder; import android.view.surfaceview; /** * created admin on 3.10.2015. */ public class videocapture extends surfaceview implements surfaceholder.callback { private mediarecorder recorder; private surfaceholder holder; public context context; private camera camera; public static string videopath = environment.getexternalstoragedirectory() .getpath() +"/your_v...

regex - How to specify case insensitive mode in ansible lineinfile regexp? -

simple question. i'm trying match "usedns", "usedns" , other variations. - name: disable dns checking on login (huge speedup) sudo: true lineinfile: dest: "/etc/ssh/sshd_config" regexp: "^[# \t]*[uu][ss][ee][dd][nn][ss] " # how 1 specify case insensitive regexp in lineinfile? line: "usedns no" state: "present" create: true insertafter: eof notify: - sshd restart ansible uses python re module . can use inline modifiers , such (?ism) in pattern. use i case-insensitive matching: regexp: "(?i)^[# \t]*usedns "

Google Place API not working for Android Key -

i using google autocomplete place api. https://maps.googleapis.com/maps/api/place/autocomplete/json?key= "my android key"&input=mg%20ro&components=country:in the key generated console android-key the api enabled in google api console google places api web service google places api android google maps android api and sha-1 finger print of debug-keystore. on hitting, i'm getting output link is {"error_message":"this ip, site or mobile application not authorized use api key. request received ip address 122.177.199.201, empty referer","predictions":[],"status":"request_denied"} while in case of server-key i'm getting proper response {"predictions":[{"description":"mg road metro station","id":"9db78081a8f0e59874d51baff0df2c007e8c8dde","matched_substrings":[{"length":2,"offset":0}],"place_id":"chijy8g_a...

json.net - Json to C# Object. Cant create proper class -

im trying deserialize json c# object newtonsoft's json library ,but cant create proper class it.i dont know why cant generate class json2sharp , etc. thats json data: [130,18063676,[["i",{"currencypair":"xmr_blk","orderbook":[{"0.00229667":"22.10045806","0.00229668":"2.24052467","0.00230580":"0.66824024","0.00231496":"1.82565395","0.00231688":"0.69843078","0.00232910":"0.72274387","0.00233835":"1.91615041","0.00234029":"0.70761459","0.00235264":"0.78457456","0.00235612":"0.26512460","0.00236198":"1.99131201","0.00236394":"0.71414743","0.00236971":"2686.26872112","0.00237641":"0.80664194","0.00238585":"2.11842456","0.00238663":"...