Posts

Showing posts from April, 2014

java - FailoverClientConnectionFactory is not threadsafe? -

i had code working tcpnioclientconnectionfactory , has been working fine. until when made change tcp client perform failover in case of down time of server using failoverclientconnectionfactory , starts return me response different request, single abstractclientconnectionfactory provided failover factory. my code using @messaginggateway , method wrapped using completablefuture without completablefuture still return wrong response (most of time). the log file showing error o.s.i.i.t.tcpoutboundgateway - cannot correlate response - no pending reply i can reproduce issue using test. please help.

c# - implementing a locking/checking mechanism for stock quantity when users concurrently buy the same thing -

im new please forgive mistakes. im building ecommerce platform sell goods. want ensure if multiple users buy same product @ around same time. user should not allowed go payment if enough stock not available. problem im not decreasing stock database until payment made.while 1 user makes payment others stock might still appear full , in turn place orders stock doesnt exist. need direction implement kind of locking mechanism product stock under processing. how while booking movie tickets seat blocked until transaction completes else released.i want implement same stock. ideas? im using asp.net c# well, reason why can't come solution because don't have implementation, rather business problem. once business policies defined, implementation easy. for example, amazon allows ordering or products running out saying "we'll deliver in 2-4 weeks". meaning, can still order, you'll product later / emailed once it's on way. in case, however, if have f

c# - Unable to call Post ActionResult from View -

i trying make post request view calling actionresult in controller. there list of events in view , user can view details of event clicking event. part works. however, once view details have ability sign event. part not working. a sample action i'm trying view: @html.actionlink("signup", "signup", new {id = "2"}, null) this should access action result: [httppost] [validateantiforgerytoken] public actionresult signup(int id) { if (modelstate.isvalid) { var registratie = new registratie(user.identity.getuserid(), id); _db.registraties.add(registratie); _db.savechanges(); return redirecttoaction("index"); } return view("index"); } however, getting 404 error. think can't find actionresult? the details action result on same page , works: // get: /eventplanner/details/5 public actionresult details(int id) { var evenement = _db.evenementen.single(e => e.id == id);

php - Adding text formatting to textarea -

i've got textarea accepts html , sends message user types email. i'd go step further , make easier users no html knowledge further utilize textarea. how go making textarea formatting @ top 1 in stackoverflow's ask question? edit great answers, i've decided go hanoncs's answer that's straight forward. if likes better looking one, check out bakerstreet's answer. in below demo, need click on text area before buttons enables. <div id="sample"> <script type="text/javascript" src="http://js.nicedit.com/nicedit-latest.js"></script> <script type="text/javascript"> //<![cdata[ bklib.ondomloaded(function() { new niceditor().panelinstance('area1'); new niceditor({fullpanel : true}).panelinstance('area2'); new niceditor({iconspath : '../niceditoricons.gif'}).panelinstance('area3'); new niceditor({buttonlis

ios - change backgroundimage tint of a button on select -

is possible in objective c? have layout uses random colors , i'd selected buttons match i'd tint them on click not sure if it's possible. i don't think can change color of image , set image state highlighted.

javascript - Imacros Creat facebook fanpages -

i recorded imacros script creat new facebook fanpage, when replay script, aways showed: runtimeerror: element not found. (google search said: facebook random tags id, buy xpath faild) does can help? i have macros creating , using fan pages automatically. have update them every month or because facebook changes tags lot! 1)some tags change refresh refresh 1 of 2-3 options once them down not bad. 2) use experimental recording , better job facebook elements 3) if cant seem work out id tags use x/y position problematic button. 4) real problem facebook comes later after got automation working. stop loading random buttons , pages see using automation , hard overcome.

python - How to read MySQL timestamp(6) into pandas? -

i have mysql table timestamps have microsecond resolution: +----------------------------+------+ | time | seq | +----------------------------+------+ | 2015-06-19 02:17:57.389509 | 0 | | 2015-06-19 02:17:57.934171 | 10 | +----------------------------+------+ i want read pandas dataframe. using import pandas pd con = get_connection() result = pd.read_sql("select * mytable;", con=con) print result returns nat (not time): time seq 0 nat 0 1 nat 10 how can read timestamp? in general, convert timestamps, can use pandas.to_datetime() . >>> import pandas pd >>> pd.to_datetime('2015-06-19 02:17:57.389509') timestamp('2015-06-19 02:17:57.389509') from docs , when reading in sql, can explicitly force columns parsed dates: pd.read_sql_table('data', engine, parse_dates=['date']) or more explicitly, specify format string, or dict of arguments pass pandas.to_d

java - Array Out of Bounce Exception for Jar, but not Eclipse -

when convert java project jar file, arrayindexoutofbounds exception of -2 occurs in line 3 of section of code: for (int = 0; < copy.get(copy.size() - 2).size(); i++) { if (!copy.get(copy.size() - 2).get(i).tostring().equals(" ")) { startlocations[index] = integer.parseint(copy.get(copy.size() - 2).get(i).tostring()); index++; } } i find strange because program runs fine in eclipse, , size of copy , 2d arraylist tempoarily holding grid of maze 9. code fails when convert jar , run cmd. here full relevant code below. files in correct locations. string filename = "maze.txt"; string line = null; arraylist < arraylist < square >> grid = new arraylist < arraylist < square >> (); try { // setup filereader, bufferedreader, , linereader filereader filereader = new filereader(filename); bufferedreader bufferedreader = new bufferedreader(filereader); int row = 0; // lines inside maze file

Counting Trello cards by month -

i want count cards in trello month trello doesn't have feature this. there easy way can count trello cards month? there available third party plugin this? the third party plugin can count cards in list, chrome plugin card counter( https://chrome.google.com/webstore/detail/cardcounter-for-trello/miejdnaildjcmahbhmfngfdoficmkdhi ) , ff plugin( https://addons.mozilla.org/en-us/firefox/addon/trello-card-counter/ ). they cannot count cards after filter cards. perhaps need it(by member, month) yourself, use trello api, or can ask question in card: https://trello.com/c/nz4bdwgs/11-trello-cardcounter .

javascript - Google Visualization Org Chart - dynamically reduce space between nodes -

i'm creating org chart using google's code google.setonloadcallback(drawchart); function drawchart() { var data = new google.visualization.datatable(); data.addcolumn('string', 'name'); data.addcolumn('string', 'manager'); data.addcolumn('string', 'tooltip'); data.addrows([ [{v:'mike', f:'mike<div style="color:red; font-style:italic">president</div>'}, '', 'the president'], [{v:'jim', f:'jim<div style="color:red; font-style:italic">vice president</div>'}, 'mike', 'vp'], ['alice', 'mike', ''], ['alice2', 'mike', ''], ['alice3', 'mike', ''], // ['alice4', 'alice3', ''], // ['alice5', 'alice3',

java - Login & Extract Data from a webpage Jsoup -

so trying logon website , element off other webpages within website " http://www.website.com " public class ticketingjsoup { public static void main (string [] args) throws ioexception{ try { string url = "www.website.com"; connection.response response = jsoup.connect(url).method(connection.method.get).execute(); response = jsoup.connect(url) .cookies(response.cookies()) .data("action", "login") .data("user", "myuser") .data("password", "mypass") .method(connection.method.post) .followredirects(true) .execute(); document document = response.parse(); system.out.println(document); map<string, string> logincookies = response.cookies(); elements ticketnumber = doc

scala - For-Comprehension Example with \/ and IO -

given following foo case class: scala> case class foo(x: int) defined class foo i check if it's valid foo before constructing inside of validatefoo : scala> def validatefoo(foo: foo): \/[string, foo] = (if(foo.x > 0) foo.success[string] else ("invalid foo").failure[foo]).disjunction validatefoo: (foo: foo)scalaz.\/[string,foo] lastly, f creates foo , , tries perform io action (example: save foo database). scala> def f(x: foo): io[\/[string,int]] = { | foo <- validatefoo(x) | iofoo <- io { foo } | } yield iofoo <console>:19: error: type mismatch; found : scalaz.effect.io[foo] required: scalaz.\/[?,?] iofoo <- io { foo } ^ <console>:18: error: type mismatch; found : scalaz.\/[string,nothing] required: scalaz.effect.io[scalaz.\/[string,int]] foo <- validatefoo(x) ^ however, ran above issue when trying chain bind

r - Error: failed to load external entity -

this question has answer here: r readhtmltable failed load external entity [duplicate] 1 answer i'm pretty new r. i'm trying run script site. http://www.thertrader.com/category/trading-strategies/ i've gotten far (not far @ all). library(tseries) library(quantmod) library(xml) startdate <- "2005-01-01" tables <- readhtmltable("http://en.wikipedia.org/wiki/list_of_s%26p_500_companies") error: failed load external entity can me working? there seems weird error in way readhtmltable trying access internet (i'm getting same error). workaround, try using httr download , parse using readhtmltable : library(httr) tables <- get("http://en.wikipedia.org/wiki/list_of_s%26p_500_companies") tables <- readhtmltable(rawtochar(tables$content))

PHP MYSQL: Delete user -

i have form that, when submitted, delete users profile processing deleteuser.php . <form method='post' action='deleteuser.php'> <input type='submit' name='delete' value='delete profile'> and here deleteuser.php session_start(); include("config.php"); if(isset($_post['submit'])){ $id = $_session['uid']; $sql = "delete users id='$id'"; mysql_query($sql) or die(mysql_error()); echo "user has been sucessfully deleted!"; } else{ echo "error: user not deleted"; } now getting "user not deleted". any idea why? as said @showdev, form post data associated name tag, i.e. since <input type='submit' name='delete' value='delete profile'> as name tag set "delete", must access via $_post['delete']

c++ - string to char* conversion -

i in code base there lots of function calls functions take pointer argument. however, function call passes "string" object if it's pointer. following code shown give idea. #include <vector> #include <unordered_map> #include <iostream> #include <stdlib.h> #include <string.h> #include <string> using namespace std; void dum(char *s) { printf("%s\n", s); } operator char* (string s) { return s.c_str(); } int main(int argc,char *argv[]) { string st("hello world"); dum(st); return 0; } i not allowed change syntax these functions or function calls. 1 possible solution came add operator overload, unfortunately doesn't work, here error g++ (ver 4.7.3), command line: g++ -std=c++11 te2.cc error: ‘operator char*(std::string)’ must nonstatic member function any ideas? thanks. update1 @ferruccio's answer reminded me mention there function calls like dum(dum2()); where dum2() fu

c# - how to close a RadContextMenu manually -

i trying use itemmouseleave , itemmouseenter events of radlistview in order add , remove items radcontextmenu , noticed dynamically adds items context menu while open. did not want. created bool variable keep track of open , closed state dropdownclosed , dropdownopened events of context menu. did not work, because if right click outside of item , right click on item while context menu open seems context menu not close moves mouse's location. question how can force context menu close can update bool using keep track of open state. thanks! here how can close context menu manually: contextmenu.dropdown.closepopup();

python - Tkinter: Tracing the state of a widget -

i aware possible trace changes of, say, entered value in entry widget using e.g. stringvar , variable observer trace. possible trace state of widget? let's have code: from tkinter import * class my_window: def __init__(self, root): self.button1 = button(root, text="enter", command = self.disable_entrybox) self.get_info_box1 = entry(root) self.button2 = button(root, text="enter", command = self.disable_entrybox) self.get_info_box2 = entry(root) self.button1.pack() self.get_info_box1.pack() self.button2.pack() self.get_info_box2.pack() self.get_info_box2.config(state="disable") def disable_entrybox(self): x = self.get_info_box1.get() self.get_info_box1.config(state="disable") root = tk() my_window = my_window(root) root.mainloop() and want trace if get_info_box1 is disabled or not, , if it's disabled, change state of get_info_box2

xml - add fo:marker marker-class-name="section.head.marker" to specific sections -

i have been trying figure out how can manually or automatically add fo:marker section.head.marker specific sections. i using fop convert xml files pdf. my format looks such article section a1 - section a2 - section a3 section b1 - section b2 - section b3 i can use the <xsl:param name="marker.section.level">3</xsl:param> to generate header of sections, not want header generated a3, want b3. i have tried switching a3 simplesect simplesect @ level still has header generated. i have tried manually adding fo:marker such: <section id="b3"> <fo:marker marker-class-name="section.head.marker"> b3 </fo:marker> <title id="b3.title">b3</title> ... but in pdf output get: <fo:marker> sensors </fo:marker> is there missing manually add fo:marker xml file, or there way prevent fo:markers being generated in simpl

java - Moving object when is touched -

i use code move object: if (gdx.input.istouched()) { gameobject1.y=gdx.graphics.getheight()-gdx.input.gety() + 30; gameobject1.x=gdx.input.getx() + 30; } but in case, object move when screen touched. in libgdx simple way move object when object clickedd/pressed? code above? the simple way use scene2d this. has hit detection feature, based on event system can use attaching listeners actors . another way use intersector in combination rectangle bounding box , hit detection yourself.

xcode - SampleBufferDelegate is not Working -

for odd reason avcapturevideodataoutputsamplebufferdelegate isn't triggering. i've added delegate , everything, i'm not sure why isn't being ran in code. can me figure out why? delegates in .h @class avplayer; @class avplayerclass; @interface camera : uiviewcontroller <uiimagepickercontrollerdelegate, uinavigationcontrollerdelegate, avcapturevideodataoutputsamplebufferdelegate, avcapturefileoutputrecordingdelegate> { .m code (initializecamera being called in viewdidload) -(void)initializecamera { session = [[avcapturesession alloc]init]; [session setsessionpreset:avcapturesessionpresetphoto]; avcapturedevice *audiocapturedevice = [avcapturedevice defaultdevicewithmediatype:avmediatypeaudio]; nserror *error = nil; avcapturedeviceinput *audioinput = [avcapturedeviceinput deviceinputwithdevice:audiocapturedevice error:&error]; [session addinput:audioinput]; // preview layer*************** avcapturevideopreviewlayer *previewlayer = [[avc

networking - virtualbox - connect from one vm to another -

in 1 vm, have win xp machine has service listening on 0.0.0.0:10000 can connect win xp service, have vm (centos) connect. when try connect centos, says connection refused. how can connect service on win xp other vm? one option use bridged networking opposed nat. makes each of vms nics appear if actual hardware. once dhcp server assigns each vm private ip address, communication between them , rest of local network should simplified.

android - Change the style of ActionBar -

im working on actionbar , i'm trying change style, want background white , text color blue, im doing following style.xml: <resources> <!-- base application theme. --> <style name="apptheme" parent="theme.appcompat.light"> <!-- customize theme here. --> <item name="colorprimary">@color/action_bar</item> <item name="coloraccent">@color/top_bar</item> <item name="colorprimarydark">@color/cyan_500</item> <item name="android:windowcontentoverlay">@null</item> <item name="android:actionbarstyle">@style/myactionbar</item> </style> <style name="myactionbar" parent="@style/widget.appcompat.light.actionbar"> <item name="android:actionbarsize">20dp</item> <item name="android:background">@color/white</item>

ios - '[CLPlacemark]?' is not convertible to '[CLPlacemark]' -> swift2 -

this part of code found on stackoverflow. working in swift 1.2 why code not working anymore in swift 2: geocoder.reversegeocodelocation(location, completionhandler: { (placemarks, error) -> void in let placearray = placemarks [clplacemark] // !!! error here !!! // place details var placemark: clplacemark! placemark = placearray[0] // address dictionary print(placemark.addressdictionary) // location name if let locationname = placemark.addressdictionary["name"] as? nsstring { print(locationname) } // street address if let street = placemark.addressdictionary["thoroughfare"] as? nsstring { print(street) } // city if let city = placemark.addressdictionary["city"] as? nsstring { print(city) } // zip code if let zip = placemark.addressdictionary["zip"] as? nsstring {

How to output the excel with filters enabled on columns in crystal reports -

i have crystal report need mail users data in excel attachment condition filters enabled in each columns of excel report . if have 10 columns in excel , user doesn't want apply filter explicitly rather want filter present can filter based on column . if there better way of filtering data on user side please suggest too. there no way within crystal reports. can write application, export report excel, open excel file , add filter. there free version of r-tag, supports feature. can see demonstrated here: http://www.r-tag.com/pages/preview_rtagandboe.aspx use menu jump "advanced report extensions" or go position 5:26 if works you, here link free edition: http://www.r-tag.com/pages/communityedition.aspx

php - mysql check next and previous available period in room availability query -

for project of mine add feature show previous , next available period in booking reservation system. i have query checks if house available: select id tbl_reservations ( `status` 'confirmed' or `status` 'total-payed' ) , ( '2015-08-12' between checkin , checkout or checkout between '2015-08-12' , '2015-08-13' or '2015-08-12' between checkin , checkout or checkin between '2015-08-12' , '2015-08-13' ); if finds reservation in period, php script return false, shows message "sorry, no availability in selected period" i show like: "the next available period stay of xx nights is: " and show checkin , checkout date. same thing previous period . i not mastering sql 100%, here asking suggestions of kind point me in right direction. here 2 solutions. get next available reservation expected stay: select id tbl_reservations ( `status` !

actionscript 3 - Adobe Flash CS6 AS3: KeyUp Handler triggers immediately after KeyDown Handler -

so in code attempting make had 2 players, each player had own key down , key handlers, labelled in attached code, , in handle movement, player 1 has wsad , player 2 uses left, right, , down keys, however, when ever press relative key down handler, fires key handler straight after, , not know why, here code, if great! :) import flash.display.movieclip; import flash.events.event; import flash.events.mouseevent; import flash.events.keyboardevent; import flash.ui.keyboard; public class main extends movieclip{ var playeroneleft:boolean = new boolean(false); var playeroneright:boolean = new boolean(false); var playeroneup:boolean = new boolean(false); var playeronedown:boolean = new boolean(false); var playertwoleft:boolean = new boolean(false); var playertworight:boolean = new boolean(false); var playertwoup:boolean = new boolean(false); var playertwodown:boolean = new boolean(false); var playerspeed:int = 5; var gamepage:gamepage; pub

powershell - Trying to rename several account types at once based on current displayName -

this morning awesome people helped me make script move user accounts based on displayname ou. tested , worked. cannibalized script make 1 rename same accounts based off of same criteria. i've gone through several errors boils down "i having identity crisis!". can't seem figure out need input $identity . here have: import-module activedirectory $renames = @( @{ filter = 'displayname -like "*supply*"' newname = "supplies" }, @{ filter = 'displayname -like "*accountant*"' newname = "accounting" } ) | foreach-object {new-object -typename pscustomobject -property $_} $originou = "ou=test,ou=standard users,ou=domain users,dc=com" foreach ($rename in $renames) { get-aduser -searchbase $originou -filter $rename.filter -properties displayname | where-object {($_.enabled -eq 'true') -and ($_.distinguishedname -notlike '*donttouch*')} | %{set-aduser $_ -di

angularjs - Dynamically add directive on an element that doesnt exist yet -

i'm using this plugin bootstrap dropdown angularjs. issue i'm having code want looks to <ol class="nya-bs-select" ng-model="city" name="city" required> <li nya-bs-option="city in subcities "> <a>{{ city.name }}</a> </li> </ol> which generates like <ol ng-model="city" class="nya-bs-select ng-pristine ng-untouched btn-group ng-invalid ng-invalid-required"> <button type="button" class="btn btn-default dropdown-toggle"><span class="pull-left filter-option">- select -</span>&nbsp;<span class="caret"></span></button> <div class="dropdown-menu open"> <ul class="dropdown-menu inner"> <li><a>- select -</a></li> &l

Rails console save not saving and is selecting from related table instead -

when testing things in rails console noticed strange thing happening when call record , attempt save it. 2.1.5 :026 > p = workorder.first workorder load (0.4ms) select `work_orders`.* `work_orders` order `work_orders`.`id` asc limit 1 => #<workorder id: 3, client_id: 4, created_at: "2015-06-17 17:12:07", updated_at: "2015-06-17 17:12:07", duedate: "2015-07-17", number: "0221506-003", project_type_id: 2, monthlysequencenumber: "003", projectdescription: "project", status_id: 1, labels_id: nil> 2.1.5 :027 > p.save (0.2ms) begin projecttype load (0.5ms) select `project_types`.* `project_types` `project_types`.`id` = 2 limit 1 (0.1ms) commit => true why appear performing select on associated object? records not being committed database. missing causes behave in such seemingly strange way? edit: prompted me start try save records pulled database had identical issue doing p.delete and then

html - Breaking a <form> tag between different table columns -

i have <form> using within simple table structure, attempting simple following fiddle: https://jsfiddle.net/avrahamcool/ldnfq/ i trying create 3 columns in row spans 100% of viewport, each of resize automatically based on size of viewport evenly distributed across length of viewport. i have haml structure unfortunately complicated fact breaking <form> , <input> 's across 3 columns. don't know how preserve <form> scope across 3 child <div> s of row out messing desired css behavior of each column acting proper column of 1/3 of size. past viewport size, column width not distributed evenly in implementation of table structure in first fiddle is. here .haml .front-page-test =form_for :proficiency_test |f| .column-test =f.label :first_name, 'first name' %br =f.text_field :first_name %br =f.label :family_name, 'family name' %br =f.text_field :family_name %br .col

How to enable YCM for MacVim only (while keep it disabled for terminal Vim) -

i've been using vim while still confused configuration. want config vim in such way ycm (youcompleteme, auto-complete plugin) only gets loaded if running in gui mode (e.g. macvim), while if terminal vim (maybe misnomer, mean text-based vim launched command line) runs, ycm won't loaded. this question can generalized "how selectively load plugins depending on running mode?". though must has been considered elsewhere, google gets me little useful information. if has("gui_running") ... enable gui stuff here else ... enable terminal stuff here endif (see h: feature-list )

java - Activate proximity sensor on button click -

i trying register proximity sensor listener when button clicked. nothing seems happen. ahve tried exploring internet of sort not anything. doing wrong? please help! the xml file : <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/pushupbg" android:orientation="vertical" > <textview android:id="@+id/tvtitlepu" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparenttop="true" android:layout_centerhorizontal="true" android:text="push counter" android:t

gitblit - how to get latest commit ref on giblit post commit hook -

i trying branch name of last commit pushed git triggered post-commit groovy script, has idea how can this?? there many examples of how info. try one: https://github.com/gitblit/gitblit/blob/master/src/main/distrib/data/groovy/blockpush.groovy the important thing remember git can push multiple refs (branches & tags) simultaneously it's easy receive more one.

html - Calculate percentage Javascript -

i have question javascript logic use percent of 2 inputs text fields. here code: var ppos = $('#pointspossible').val(); var pearned = $('#pointsgiven').val(); var perc = ((pearned/ppos) * 100).tofixed(3); $('#pointsperc').val(perc); for reason if inputs 600 , 200, result suppose 33.333 i'm getting 3.333. if hard code values works fine. if can appreciate that. in advance. it seems working : html : <input type='text' id="pointspossible"/> <input type='text' id="pointsgiven" /> <input type='text' id="pointsperc" disabled/> javascript : $(function(){ $('#pointspossible').on('input', function() { calculate(); }); $('#pointsgiven').on('input', function() { calculate(); }); function calculate(){ var ppos = parseint($('#pointspossible').val()); var pearned = pa

javascript - Jquery slidetoggle Show Hide One div at a time -

i having issue create jquery toggle opens 1 div @ time. i want 1 content shows when click on div ( show ). here, both open @ same time. $(document).ready(function(){ var $content = $(".content").hide(); $(".toggle").on("click", function(e){ $(this).toggleclass("expanded"); $content.slidetoggle(); }); }); js fiddle also: how can add option open div hide once open new 1 give option hide 1 open if don't open new div clicking on "hide" text) you several ways. current html markup use jquery's next function . $(".toggle").on("click", function(e){ $(this).toggleclass("expanded"); $(this).next().slidetoggle(); }); or wrap toggle , content in div , use parent , find functions. html <div class="wrapper"> <div class="toggle"></div> <div class="content">lorem

javascript - Tablesorter StickyHeaders shifts columns over on scroll -

Image
in 2 separate parts of our software, (entirely different code) sticky headers have done , we've lived it. apply stickyheader widget , put these in .wrapper container, , works intended: header follow on scroll. however, always causes our headings shift right. .wrapper simple: .wrapper { position: relative; overflow-y: auto; height: 652px; } th { background-color: #003366; color: #ffffff; font-weight: bold; padding: 3px; text-align: center; } please excuse obfuscation, not (legally) allowed make jsfiddle or provide more clarity this. notice second "black blob" shifted off while rec off-center. before scroll after scroll here, issue css: * {box-sizing: border-box;} however, when applied the demo , not reproduce error. i've tried determine else in conjunction causing issue, whatever tried, resolve solely border-box. answer own question advice: if happen upon rare bug affecting sticky tables, run like /* give elements, excluding repo

c# - Slider progress bar with MediaElement Windows Phone 8.1 -

i working within windows phone 8.1 (non silverlight) application. have mediaelement audioplayer plays audio files. have slider audioplayerseek want 'hooked' mediaelement, moves audio playing. i have gone through this tutorial word word, still can't work. when play audio (clicking on item in listview), audio plays, slider doesn't move! private dispatchertimer _timer; private bool _sliderpressed = false; // constructor public mainpage() { initializecomponent(); navigationcachemode = navigationcachemode.required; audioplayerseek.valuechanged += audioplayerseek_valuechanged; initializeaudiorecording(); datacontext = app.viewmodel; } // called when select audio file in listview private async void selector_onselectionchanged(object sender, selectionchangedeventargs e) { // cast xaml listview var listview = sender listview; // verify have listview if (listview == null) { return; } var listvmitem = listview.selecteditem rec

ios - UITextView vs UILabel: With respect to line-spacing -

so have uiview subview uilabel @ top, static text , minimum scale (to deal 4" vs 6 twins). under that, have 3 lines of text static string. under that, have button custom border, corner radius. i had issue size , spacing. 4" screen, want line spacing 0 uilabel , uibutton have same spacing between top , bottom of view. with 6/6+ screen, want line spacing 1.5~2.0: with uitextview , disable user interaction , scrolling, set font properties in ib , in viewcontroller , override layoutmanager/linespacingafterglyphatindex conditional operator :ui_user_interface_idiom , mainscreen bounds check height of screen , return float based on 4"/4.7"/5.5" screen sizes. it works great, looks great, has no interaction problems. but coworker insistent should using uilabel line count, because it's static text , shame on me using uitextview . is there programmatic systematic reason should using uilabel instead of uitextview ? , no, i'm not looking

mpdf - Alternative to CSS transform origin -

i using mpdf ignores following css: -webkit-transform-origin: top left; -moz-transform-origin: top left; -o-transform-origin: top left; -ms-transform-origin: top left; this render html file in browser fine when pdf created each div in pdf document on single line down entire page. every div in html document has absolute position left , top property set approximate px position in document. example : #tf_1{left:34px;top:161px;} #tg_1{left:239px;top:161px;} #th_1{left:239px;top:126px;} #ti_1{left:45px;top:394px;} can possible alternative?

conditional template based code execution c++ -

so have been battling time , first post here. wanted know, if passed in container forward container, defined in boost, how can write code in way further checks see if code either backinsertionsequence or frontinsertionsequence , executes depending on type is? template <class sequentialcontainer> void myclass<sequentialcontainer>::saysomething() { boost_concept_assert((boost::forwardcontainer<sequentialcontainer>)); if (boost::backinsertionsequence<sequentialcontainer> == true) { //do } else { //say else } } if did if check have there, both branches have compiled regardless of fact 1 branch ever executed particular type. severely limits usefulness of simple if - need construct such 1 of branches compiles. there 2 common ways of doing this. tag dispatch: template <class sequentialcontainer> void myclass<sequentialcontainer>::saysomething() { saysomething<sequentialcontainer>

bash - Grep for beginning of line while searching for a certain string -

i have file such: 1 role 2 role b what i'd search string "role a" , return value 1 in variable. so following: if grep "$i" role_info.txt <assign variable number associated string> else <no search string found - else> fi if columns delimited tabs can do: role='role a' number=$(awk -v role="$role" -f '\t' '$2==role {print $1}' role_info.txt) if it's spaces, try instead: role='role a' number=$(grep "$role" role_info.txt | cut -d' ' -f1) either way, can check if match found with: if [[ -n $number ]]; # number found else # not found fi another option is: while read number role; if [[ $role == 'role a' ]]; # match found fi done < role_info.txt this bit more robust: role has second item on line; can't in first position.

javascript - How to configure nginx to work with Node.js and PHP -

i have problem configuration nginx work node.js , php. want this: user open my-project.com node.js server running on port 3001 request node.js send my-project.com on port 80 http-proxy nginx (port 80) server run php scripts , display output users so want create php server node.js working in background special tasks. don't want node server on subdomain, need run time not particular requests. my nginx config server { listen *:80; server_name my-project.com www.my-project.com; client_max_body_size 1m; root /var/www/public; index index.html index.htm index.php; access_log /var/log/nginx/nxv_5rxici0o7b9k.access.log; error_log /var/log/nginx/nxv_5rxici0o7b9k.error.log; location / { proxy_pass http://localhost:3001; ### added line root /var/www/public; try_files $uri $uri/ /index.php$is_args$args; autoindex off; index index.html index.htm index.php;

ruby on rails - Submitting form in capybara -

i have form i'm testing capybara. once have spec fill in fields in form, have hit submit button. on submit, i'm getting error says following: failure/error: click_button 'submit contact information' actionview::template::error: no route matches {:action=>"create", :controller=>"information_forms", :lender_id=>"2293"} missing required keys: [] the form code looks following: <%= form_for @lenderinformationform, url: lender_lender_information_form_path(@user) |f| %> <%= f.submit "submit contact information", 'data-disable-with' => "please wait..", :class => "btn-u btn-u btn-block margin-bottom-20", :type => "submit", :id => "skyformbutton" %> <% end %> the spec: before :each user = factorygirl.create(:lender, :email => "1234@gmail.com") login_as(user) end "completes lender information form"

.net - Determine Facility Code and Card Number from ATR in C# -

Image
i have following card reader hid omnikey 5325. have contact-less card named proximity. the number written on card 1 33593 42101044091-3. by reading card, following atr hex: 3b050002f10673 using folowing applications have managed see following information. i need extract facility code , code number in order identify card. i have managed find following code, missing few pieces: /// <summary> /// extract data item wiegand raw data. data item card /// number or facility code. /// </summary> /// <param name="format"></param> /// <param name="identifier"></param> /// <returns></returns> public int getdata(int format, int identifier) { int byteoffset = 0; if (m_rawwieganddata == null) { throw new exception("no raw wiegand data available"); } //self-test byte[] testdata_h10301 = {0x02,0x02,0x00,0x7