Posts

Showing posts from January, 2014

android - GoogleAPIClient connection failed -

i trying connect googledrive through application. drive gets connected through gmail_id's connection fails few ids. can guide me change need do? why connection vary id id? code: @override protected void onresume() { super.onresume(); if (maccountname == null) { return; } if (mgoogleapiclient == null) { mgoogleapiclient = new googleapiclient.builder(this) .addapi(drive.api) .addscope(drive.scope_file) // .addscope(drive.scope_appfolder) // required app folder sample // .setaccountname(maccountname) .addconnectioncallbacks(this) .addonconnectionfailedlistener(this) // .addapi(plus.api) .build(); } mgoogleapiclient.connect(); } @override public void onconnectionfailed(connectionresult result) { super.connectionfailed(result); ++count; if(...

php - wordpress plugin custom activation message -

i created wordpress plugin .when activated plugin got "plugin activated" flash msg. want customize message "connect my-plugin" , provide link plugin settings page. try add_action( 'admin_notices', 'your_custom_function' ); function your_custom_function() { echo "connect my-plugin"; if( $error ) { // put here } } results connect my-plugin msg shown on every page in admin panel.i want show custom msg @ time of activation on plugins page got error plugin generated 2 characters of unexpected output during activation. if notice “headers sent” messages, problems syndication feeds or other issues, try deactivating or removing plugin. i guess 1 filter hook looking plugin_action_links_(plugin_file_name) allows add custom links plugin entry on plugins page. to display activation message, see this tutorial . you have found these 2 research on own.

rest - How to deal with GET request and (not to) changing the application state? -

this generic question method. imagine need store last pagination size selected user: +-------------+ +-------------+ +--------------------+ +----------+ | size change |-> | request | -> | server store pref. | -> | response | +-------------+ +-------------+ +--------------------+ +----------+ browsing list of products of course request , changing paging size request (we change size parameter): <ul> <li><a href="/catalog/browse/size=10&page=1">size 10</a></li> <li><a href="/catalog/browse/size=25&page=1">size 25</a></li> <li><a href="/catalog/browse/size=50&page=1">size 50</a></li> </ul> every time user changes size need store new size in backend. how deal the fact should not change state? issuing query (thus changing state of application) fees wrong me. there alternative? get requests representation o...

c++ - Serializing polymorphic classes with environment-specific state -

i have classes this: class base { public: virtual ~base() {} ... }; class derived1 { outerstate1& outerstate; innerstate1 innerstate; ... template <typename ar> void serialize(ar& ar, const unsigned int /*version*/) { ar & innerstate; } public: derived1(outerstate1& outerstate) : outerstate(outerstate) {} ... }; class derived2 { outerstate2& outerstate; innerstate2 innerstate; ... template <typename ar> void serialize(ar& ar, const unsigned int /*version*/) { ar & innerstate; } public: derived1(outerstate2& outerstate) : outerstate(outerstate) {} ... }; basically, classes have state depends on outside environment, , don't want serialize it. state may different different subclasses. want serialize class. thing boost::serialization handles polymorphic classes well, seems me not enough me. find following ways serialize these objects, neither lik...

Hash table in C always yields Seg fault -

i trying develop hash table in c programming language fails seg fault. trying seperate chaining created struct has 2 properties: word , next. word char* , next pointer next node, creating hash table conatains array of linked list. typedef struct node { char* word; struct node* next; }node; node* table[26]; after indexing table using hashing function indexes table. do have fix? #include <stdio.h> #include <stdlib.h> #include <string.h> #include <ctype.h> #include <cs50.h> typedef struct node { char* word; struct node* next; }node; node* table[26]; int hash(char* key); void index(); int main(int argc, char* argv[]) { index(); return 0; } int hash(char* key) { int hash = toupper(key[0]) - 'a'; int res = hash % 26; return res; } void index() { printf("insert word: "); char* k = getstring(); node* predptr = malloc(sizeof(node)); node* newptr = malloc(size...

android - Delay popping up a dialog fragment till a webview within has completed loading -

i have dialog fragment contains single web view. want dialog popup once web view has completed loading url. this oncreateview of dialogfragment public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { view view = inflater.inflate(r.layout.dialog_a, container, false); webview = (webview) view.findviewbyid(r.id.web_view); webview.clearcache(true); webview.loadurl(url); } the problem have web view object created after oncreateview() method called called after show() called; in turn cause dialog popup. is there anyway can preload web view before popup dialog? i wouldnt use dialogfragment because of lifecycle of fragment. u want load webview prior showing user. therefore use customlayout visibility=gone , when webview (inside layout) finish loading ill fadein layout. use framelayout , put @ topof hierarchy.

boolean expression - Why do logical operators negate their argument when there is only one argument in R? -

Image
when passing single vector logical and/or operator, operator negates argument: > x = c(f,t,t) > `&`(x) [1] true false false > `|`(x) [1] true false false to make logical operator work idempotent, 1 needs pass single element vector second argument: > `&`(x,t) [1] false true true > `|`(x,f) [1] false true true why logical operators negate argument when there 1 argument passed? this was modified in r 3.2.1 result of a bug report . you've pointed out, previous behavior made little sense:

javascript - How to retrieve data achieved through PHP and JSON properly (with parse) -

everybody! i'm thinking have problem json.parse i submitted form ajax php page. index.php - full code jquery('#inserir_certificado_usuario').submit(function(){ var dados = jquery( ).serialize(); jquery.ajax({ type: "post", url: "../classes/processa_evento.php", data: dados, success: function(data) { var data = data; var arr = json.parse(data); var i; var out = ""; for(i = 0; < arr.certificado.length; i++) { out += "trabalho: " + arr.certificado[i].id_trabalho + " - " + arr.certificado[i].titulo_trabalho + "<br />usuário: " + arr.certificado[i].id_usuario + " - " + arr.certificado[i].nome_autor + "<br />autenticador ...

select 1 random number from mysql database using asp.net c# -

how can select 1 random number database thats id autoincrement field.i have 25,000[id] records in database.each every time select 1 new random id. how can it. use following sql(slow) 'select * tablename order rand() limit 1' or can use(fast) select * mytable, (select floor(max(mytable.id) * rand()) randid mytable) somerandid mytable.id = somerandid.randid the inner select gives random id in right range. outer select looks right row in table.

javascript - why image is not display in angular js -

i make simple demo in angular js call service .actually not able display image in list . first check web service url http://timesofindia.indiatimes.com/feeds/newsdefaultfeeds.cms?feedtype=sjson i call web service using display web security on macc /applications/google\ chrome.app/contents/macos/google\ chrome --disable-web-security --allow-file-access-from-files --allow-file-access --user-data-dir=~/chrome-test/ spec/runner.h tml on desktop : --disable -websecurity i able call service image not display on list here code on code pen http://codepen.io/anon/pen/qdpoyn <div class="list" ng-repeat="d in data"> <a class="item item-thumbnail-left" href="#"> <img src={{d.image.thumb}}> <h2>{{d.headline}}</h2> <p>{{d.dateline}}</p> </a> </div> </div> use ng-src : using angular markup {{hash}} in src attribute doesn't work ri...

jsp - On clicking search button display update button and hide save button -

<s:if test='%{cust_id!=""}'> <s:submit cssclass="pagebutton" action="custmer_ entry" theme="simple" value="update" on click="validate"/> on loading page,i want hide update button.on clicking search button display update button , hide save button. sorry wrong. when check <s:if test='%{cust_id!=""}'> you need check if null like <s:if test='%{cust_id!="" || cust_id!=null}'> please check way

mapreduce - Why hadoop slave cannot run a job? -

i run yarn mapreduce job 1 node. but job stuck on accepted state, , still 0% completed. checked jps command on slave, there no mr app master or yarn child complete job. on slave daemons have ran datanode , nodemanager. there no wrong configuration on master node, because i've tried t before different slave , it's works. how can fix it? thanks....

asp.net - Element's clickable area drifted up from actual position on Ipad Safari -

i'm having little problem asp .net site on ipad safari. have following form: a div overlayed on top of main form. in div have update panel 4 or 5 drop down lists. each drop down list when changed pull data db , populate gridview on same div. on pc using chrome, ff, ie..., site works great. on ipad safari, have weird problem: after user changing drop down list, there chance clickable area of elements drift upward elements's actual position. for example, when click on button, nothing happens, if want use button, have click empty area few dozen pixel above it. same goes textarea, radio button,... the amount clickable area drift upward not seem fixed, time drift hundreds of pixels, while other time drift dozen pixels or so, clickable area drift same amount. zoom in/zoom out on page or select textbox reset clickable areas right positions. i'm using .net framework 4.5, , testing on ipad using ios 8.3. unfortunately, can't reproduce using js , html alone....

selenium webdriver - Protractor - Wait for async promise before doing next -

first of all, i've checked various post , blogs concerning point , still can't figure out how make correctly. i have tried many different combinaison of : browser wait protractor.controlflow().execute protractor.controlflow().await( ...still no success.. my problem within beforeeach function, i'd call protractor promise , wait resolve before performing rest of code. my code i've prepared simple test willing me describe('testasync', function() { beforeeach(function() { console.log('beforeeach - step 1 ') browser.get("https://angularjs.org/"); console.log('beforeeach - step 2 ') testfunc() console.log('beforeeach - after testfunc - step 3') }); var testfunc = function(){ console.log("testfunc - step 1") browser.wait(function() { var deferred = protractor.promise.defer(); element(by.id('twitter-widget-1')).ispresent() .then(functio...

Cannot create branch in Github -

Image
i trying create branch on else's repo. trying follow official instructions, stuck here because github apparently should offer create branch when type in? here, nothing happens. so figured out problem was. not added collaborator repo. did not know had collaborator make new branch.

powershell - How to create CSV output from JSON? -

my json query returns weather data parse using powershell. want delete unnecessary items , export final file csv or txt. $json = get-content -raw $path | convertfrom-json #get json object directory , convert powershell object $hourly = $json.hourly_forecast $fcttime = $hourly.fcttime $pretty = $fcttime | select pretty $temp = $hourly.temp $eng = $temp | select english $parsed = $eng, $pretty it seems work okay when output $parsed in csv has object properties rather values of $eng , $pretty . there easier way parse json files or way can combine arrays in last step? expand properties. also, export-csv exports properties of objects, not values of array. should work: get-content -raw $path | convertfrom-json | select -expand hourly_forecast | select @{n='pretty';e={$_.fcttime | select -expand pretty}}, @{n='english';e={$_.temp | select -expand english}} | export-csv 'c:\output.csv' -notype

javascript - Angular service field is undefined for one controller only -

i have defined simple service: app.service('authenticationservice', function() { var auth = { islogged: false }; return auth; }); i use set , share authentication state between controllers. reads fine in loginctrl: app.controller('loginctrl', ['$scope', '$location', '$window', 'userservice', 'authenticationservice', function loginctrl($scope, $location, $window, userservice, authenticationservice) { $scope.login = function login(username, password) { if (username !== undefined && password !== undefined) { userservice.login(username, password) .success(function(data) { authenticationservice.islogged = true; //sets value correctly $window.sessionstorage.token = data.token; $location.path("/main"); }) .error(function(status, data) { console.log(status); console.log(data); }); } }; ...

css - Recreate Similar Travis CI Console Log Interface -

Image
the first time saw travis ci live updating build console log, was, i'll admit, nerdily impressed. , know time consuming css styling , js coding, half nice. but, question is, there libraries out there make building easier? realize travis ci uses ember web app framework, i'm guessing isn't component of ember, right? "travis-web" uses ember, functionality "log-container" custom. contains text of log file ("download log"). please download raw version of log , take look. you see, log file has several "annotations". it's syntax indicate areas, custom styles applied. these lines processed log script , removed. ok, let's decompose this: ► code-folds folds start "travis_fold:start:section_name" , end "travis_fold:end:section_name" the content inside fold placed in span. default span height 0. content not shown. on-click, additional css-style open added span. style open sets height ...

brew link boost to homebrew python -

after installing boost brew using system layout option --layout=system (set using brew edit boost155 ) brew install boost155 --with-python --with-mpi --without-single i discovered boost library talks osx python, not homebrew version $ otool -l `brew list boost155 | grep python.dylib` | grep -i python /usr/local/cellar/boost155/1.55.0_1/lib/libboost_mpi_python.dylib: /usr/local/opt/boost155/lib/libboost_mpi_python.dylib (compatibility version 0.0.0, current version 0.0.0) @loader_path/libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/local/frameworks/python.framework/versions/2.7/python (compatibility version 2.7.0, current version 2.7.0) /usr/local/cellar/boost155/1.55.0_1/lib/libboost_python.dylib: /usr/local/opt/boost155/lib/libboost_python.dylib (compatibility version 0.0.0, current version 0.0.0) /usr/local/frameworks/python.framework/versions/2.7/python (compatibility version 2.7.0, current version 2.7.0) how can link...

asp.net mvc - Nuget Requirement Conflict -

my mvc 5 project requires newtonsoft.json version 6.0 i'm using api library intuit built on newtonsoft.json verison 5.0.1 , doesn't work newer version. is there way run both versions on same site? you're not alone friend. have microsoft blend installed? if yes, that's 1 should blame to. blend installs newtonsoft.json dll version 5.0.1 gac , unfortunately if have nuget installed visual studio project prefers version installed in gac placed under blend's installation directory under program files. resolution : not recommended, should needful. change path of installed blend. e.g. blend's installation path is: c:\program files(x86)\microsoft blend\.... rename c:\program files(x86)\microsoft blend_unused\.... this give quick fix. issue been reported microsoft connect site.

How to access calendar information from Microsoft Outlook Exchange 2010 SP2 -

i want make website capability: have 5 people have individual calendars on outlook exchange 2010 sp2. want website have 1 calendar shows available spots. who's calendar comes doesn't matter. if 2 people have 2 spots available @ 10am calendar show there 10am spot open. doesn't matter person client goes to. i'm trying figure how access calendars data have no idea start. suggestions? you may consider using ews (exchange web services). see ews managed api, ews, , web services in exchange more information.

How to initiate a file download using a crossrider request? -

i'm storing custom images on our servers. i'd have user download images using our plugin. when send request server can see started correctly file save dialog never comes up. does know how or can point me example? thanks! in general, security reasons, extensions created on crossrider or otherwise not provide functionality access/save local files system. there various workaround suggestions on various stack overflow threads (e.g. chrome extension: how save file on disk ) may work on browsers. whilst crossrider not support or guarantee work, can of course try make them work in crossrider extension. [ disclosure : crossrider employee]

ios - Checkbox in UICollectionViewCell -

Image
hello question has been raised more once here, can not find problem when adding checkbox in uicollectionviewcell well, i've tried lot of ways no avail image shows located in uicollectionviewcell well, when click inside checkbox, choice, rest of foods selected, want do, click inside checkbox when selects box in cell , updated uicollectionview custom checkbox code var ischeckedglobal = bool() // !! global variable // might need change '= bool()' '= false' or '= true' class checkbox: uibutton { //images let checkedimage = uiimage(named: "checked") uiimage? let uncheckedimage = uiimage(named: "unchecked")as uiimage? //bool propety var ischecked:bool = false{ didset{ if ischecked == true{ self.setimage(checkedimage, forstate: .normal) }else{ self.setimage(uncheckedimage, forstate: .normal) } } } override func awakef...

google bigquery - Problems with translating MYSQL query using date_add function and time intervals for BQ -

i have query runs on our mysql database. takes forever run, use bigquery instead. relevant table (a.xxx) in cloud, , i've tried adjusting code bq, i'm not having luck. query pulls number of individuals making purchases day, , number of same individuals, made purchase 1-7 days after initial purchase. appreciate help!!!! here query: select f.fts_date, count(distinct f.fts_id) fts_count, count(distinct s.passportid) svs_count, (count(distinct s.passportid)/count(distinct f.fts_id)) return_rate (select passportid fts_id,addressid, date(signdatetime) fts_date a.xxx date(signdatetime)>'2015-6-10' , fts="y" , disposition="accepted") f left join a.xxx s on f.passportid=s.passportid , f.addressid=s.addressid , s.disposition="accepted" , s.signdatetime between date_add(f.signdatetime, 1, "day") , date_add(f.signdatetime, 7, "day") group 1 bigquery doesn't support interval keyword in da...

c# - How I implement Multithread pool for a repetitive process -

i need test() calculations, want put cpu core @ work find solution faster. for (int i= 0; i<1000000; i++) { result[i] = test(i); if (result[i] == 0) { break; } } i have work backgroundworker before. , create array of n bgworker , handle queue myself looks trouble. so found task.factory, seem similar want, still don't know how handle each separate task wait result , stop when found asnwer. task<string> task = task.factory.startnew<string> (() => downloadstring("http://www.google.com/")); string result = task.result; or maybe there other solution problem. parallel.for(0, 1000000, (i, loopstate) => { result[i] = test(i); if (result[i] == 0) { loopstate.stop(); return; } }); how to: write simple parallel.for loop how to: stop or break parallel.for loop

ios - UIScrollview w/ one large view, or UITableview w/ multable views? -

Image
im working on project has detailed view of company's information. on lower half of view have buttons don't move, above them have more content, can not fit screen 4s. i'm thinking should create new view , insert view or views tableview, or scrollview. what i'm not sure if should create sectional views each part of page, e.g. hero image header of page, company titles , description, other photos, etc, take each view , add them tableview, or should create 1 big view them elements , insert scrollview. standard/best choice displaying content in app thats beyond height of area? i provided example of detailed view. want above message/call buttons scroll up/down can fit more content. you can static uitableview. take @ blog. explains in detail how this. you don't need datasource or anything. http://www.oliverfoggin.com/using-a-static-uitableview-as-a-layout-device/

c# 4.0 - how to validate text properties in a given groupbox using c#code for ranorex tool,can some one help me out -

i have tried validating text properties in group boxes c# code failed develop code tool ,can 1 me out? you can use validate.attribute() method. public static void attribute( repoiteminfo iteminfo, string name, object value ) parameters: iteminfo (repoiteminfo): repoiteminfo object repository item. name (string): name of attribute validate. value (object): value of attribute match. some more methods can found in ranorex api documentation http://www.ranorex.com/documentation/ranorex/ example: validate.attribute(repo.explorer.startinfo, "text", "yourtext"); i hope helps.

drupal 7 - Style radio groups differently from each other -

i have form i'm trying build in druapal 7, managed use theme_radio style first group of radio buttons have class 'visible-xs' on label hide label phones (as it's displayed in table heading desktop). works fine, have second group of radios need label visible on devices don't know how make happen since of radios share same code. how supposed in drupal? you can use theme_radio specific form , not forms. if mean have 2 radio groups inside same form suggest using theme_radios() function appropriate. if none of these work please provide code using , html output (of form).

python - How to take an inputted file and count the letters in each word and print it -

i have text document of 7000 words have go through , count letters in each word. stuck on trying break each line @ '/n' , having count it. if point me in right direction, appreciated. from string import * def main(): fname = raw_input("enter filename: ") infile = open(fname,'r') lines = 0 line in infile.readlines(): lines = lines + 1 letters = line.split(line) x = str(letters) print len(x) print line print lines main() you don't need break file lines using linefeed, python you. in comment said file had 1 word per line, this: line_count = 0 open("test.txt") f: line in f: line_count += 1 print len(line) print line print line_count

powershell - SQL Server 2000 Get Ip Address From Connected Client -

i trying find out machine coming connection. querying select * sysprocesses i can see hostname of client gives me host008 . however, when try ping host008 cmd host not found. using exec xp_cmdshell 'ping host008' or using powershell gives me nothing, either. what other options? there no host connected. info's source dsn file link tables in access.

android - accessing shared preferences from broadcast receiver -

this click event main activity. s3 edit text value want use in broadcast receiver when incoming call arrives. public void clicksave(view shilpa) { sharedpreferences sharedpreferences = getsharedpreferences("my_prefs", mode_private); sharedpreferences.editor editor = sharedpreferences.edit(); editor.putstring("message", s3); editor.commit(); } this using in broadcast receiver access value of s3 : string pref = preferencemanager.getdefaultsharedpreferences(context).getstring("message", "does not exist"); but when try value here ,it comes "does not exist" instead of correct value. please tell me going wrong might because using getdefaultsharedpreferences , try using sharedpreferences prefs = getsharedpreferences("my_prefs", context.mode_private); string yourstring = prefs.getstring("message", "doesn't exist");

oop - PHP OO - How should I handle soft errors in multiple classes? -

i apologise if has been answered somewhere, haven't managed find answer far - maybe i'm searching wrong thing! i trying figure out how handle errors in oo php system, used generate web pages. example explain mean. imagine have content class, form class , formobject class, hold information on page content, web forms , form fields. classes can run multiple mysql queries via db class. users can create new content or forms in back-end. when this, use classes create , store data in database. i have system class, used generate web pages. system class checks should displayed on front-end, builds appropriate content , form objects, generates html , outputs screen. i have checks serious errors, stop code going further. however, problem want feed "soft errors" front-end. example, maybe system class builds form object, in-turn builds fields using formobject class. formobject class queries database field name, field name not found. db class returns error. want able fe...

javascript - Show and hide a div every 1s -

hi want show div 1s , hide 1s , loop code : <div>flashing</div> <script> $(document).ready(function(){ hide(); function show(){ settimeout(function(){ $('div').show(); }, 2000); hide(); } function hide(){ settimeout(function(){ $('div').hide(); }, 2000); show(); } }); </script> but browser give me error: error: uncaught rangeerror: maximum call stack size exceeded you show , hide function call not in async part of function, resulting infinite loop. put call inside timer event : $(document).ready(function(){ hide(); function show(){ settimeout(function(){ $('div').show(); hide(); }, 2000); } function hide(){ settimeout(function(){ $('div').hide(); show(); }, 2000); } });

Betamax is not recording calls to RESTClient in Grails -

i have betamax test i'm trying configure intercept calls web service using restclient. calls web service aren't getting recorded. test code looks this: @betamax(tape = 'pending_transfer_success') void "test creatependingtransfer"() { betamaxrouteplanner.configure(restclient.client) betamaxhttpssupport.configure(restclient.client) when: transfer transfer = service.creatependingtransfer( beneficiaryfirstname, beneficiarylastname, beneficiaryuseremail, lineitemsidstotransfer) then: ... } inside setup() method i'm configuring restclient so: restclient = new restclient("${grailsapplication.config.acme.account.api.url}/") service.restclient = restclient the app grails 2.2.3 app , test written using spock. explaining why calls isn't being recorded appreciated.

how does nix know what binary a machine needs? -

they write in nix documentation: however, nix can automatically skip building source , instead use binary cache, web server provides pre-built binaries. instance, when asked build /nix/store/b6gvzjyb2pg0…-firefox-33.1 source, nix first check if file https://cache.nixos.org/b6gvzjyb2pg0 ….narinfo exists, , if so, fetch pre-built binary referenced there; otherwise, fall building source. i wonder how nix know kind of binary machine needs? if ran nix on arm or intel or amd or name it. how binaries cache selected right architecture? nix purely functional package manager. such takes package needs input function, including called stdenv , contains information architecture. using these inputs nix generates hash. see in front of package name. so architecture needed encoded in hash, why when downloading binary cache hash needs checked.

If condition with group_concat in mysql -

i have table has 2 columns empid & depid. table not have primary key. below data of table. +-------+-------+ | empid | depid | +-------+-------+ | 1 | 1 | | 1 | 2 | | 1 | 3 | | 1 | 4 | | 2 | 1 | | 2 | 2 | | 2 | 3 | | 2 | 4 | +-------+-------+ now select depids employee wrote below query. select empid, group_concat(depid separator ':') emp group empid; it giving me expected output. +-------+-----------------------------------+ | empid | group_concat(depid separator ':') | +-------+-----------------------------------+ | 1 | 1:2:3:4 | | 2 | 1:2:3:4 | +-------+-----------------------------------+ now want select depids greater 2. how can use if group_concat? try below : select empid, group_concat(if(depid>2,depid,null) separator ':') emp group empid;

c# - iteration over a bunch of objects -

i have 8 objects sub classes of super class. share same fields , properties. wanting somehow iterate on group of objects , find first 1 status field set false update other fields associated object. i have been trying accomplish string of if statements. not pretty , works 1 time through group of objects. if (!light7.status) { if (!light6.status) { if (!light5.status) { if (!light4.status) { if (!light3.status) { if (!light2.status) { if (!light1.status) { if (!light0.status) { light0.email = newid; ...

css - Background image not showing in some phones -

everything works fine phones, when tested example on htc background image isn't showing. css header { background-image: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.8)), url(../images/lets-get-down-to-business.jpg); background-size: cover; height: 100vh; background-position: center; } and query touches bg image @media screen , (max-height:600px){ header { height: 600px; } } any appreciated explanation. thank you! i guess because whatever browser using on htc not support linear-gradient css function. gradients compatibility - mobile it seems me stock android browser doesn't support yet. that's start though, might able change syntax little , work.

apache - Default domain to HTTP instead of HTTPS -

i did self signed ca https want use https api . main website , wish remain http if not it's gonna warning. i added ssl code config it's directing domain.com https. when try www.domain.com , it's directed http

android - Why RecyclerView is scrolling way too more above the first item and flickering while scrolling? -

Image
edit : problem solved !! my recyclerview flickers while scrolling. there 5-6 items in single screen. when scroll down, screen flickers , scroller jumps top of recyclerview . after if scroll again, reccyclerview scrolls way more above first item. if repeated scrolling , down process fast, recycler view scrolls down leaving empty background. , after if scroll either ways nothing shows up. scroller not work again after this. i using lucasr 2 way view . problem discussing mentioned in some weird recyclerview.adapter , uil not solved yet. have more 20 images in recyclerview , increased. each image of size greater 100kb. for loading image, tried universal image loader(uil) caching enabled. didn't help.the flickering persists uil . tested glide problem still there. to make more clearer here snapshots adm . here's holder class: public class tileadapter extends basetwowayviewadapter { private static final string tag = makelogtag(tileadapter.class); private context ...

sublimetext3 - Is there a way to trigger a "folder open" from Sublime Text 3 API? -

i working on plugin generate file , need prompt user somehow selects folder these files generated. is there way sublime text 3 api? probably straightforward way open input box ( sublime.show_input_panel() ) default value , allow user enter own path if desired. if using standard python 3 distribution python.org, use tkinter.tix.dirselectdialog() or tkinter.filedialog , stripped-down version of python 3.3.3 shipped sublime text 3 not include several modules, including tkinter . if graphical interface important you, may want consider including small gui toolkit easygui plugin.

ruby - Why does this regular expression for ranges fail? -

the intention create regular expression parses inclusive ( .. ) , exclusive ( ... ) ranges given string. my edge cases following: the initial , final values of range can't contain spaces. only inclusive ( .. ) , exclusive ( ... ) ranges accepted. the final value can't contain dots ( . ) @ beginning. the whole string should valid range. that said, string invalid representation of range be: "1 2..20" , "1 2...20" , "12..2 0" "1....10" or " 1.10` this regular expression got far /\a([^.\s]+)(\.{2,3})([^.][^\s]+)\z/ however fails. seems cause [^.] part in third capture group. works without [^.] , unfortunately not cover cases. i'm using ruby 2.2.1. try /\a([^\s]*[^.])(\.{2,3})([^.][^\s]*)\z/ this uses * in place of + , third capture group allowed capture 1 character (your previous expression required capture @ least 2 characters).

c++ - Arduino timed void draw() loops -

i have arduino uno set sense light level , draw text file via processing when gets dark. i'd modify processing code interrupt draw loop 5 seconds , restart draw loop. continuously write , overwrite .txt file that's not important right now. the purpose of excercise understand how insert break endless draw loop. i'm still newbie programming , trying wrap head around how commands interact eath other. can me understand how make work? eample code great i'd happy conceptual description of how it's supposed work...learn doing , all. i've tried putting void draw() loop within void loop() erred out. on right path? <setup...myserial , createwriter path/file.txt>{ } void draw() { //this needs terminate & restart if (myserial.available() > 0 ) { string value = myserial.readstring(); if ( value != null ) { output.println( value ); } } } void keypressed , end i believe you're looking called "state machine". make variable...

python 3.x - PyQt4: Wait on modeless dialog -

is there way of waiting on closure of modeless dialog? here example application: start program needs startup stuff , needs user log-in. since user logging in takes time, i'd have login box modeless, can continue doing other startup stuff in background. @ point not going able continue until login process completed. ideally i'd able call dialog.wait_until_complete() when point , have act modal dialog, continuing once user accepts/rejects dialog. connect dialog's finished signal: self.login.finished.connect(self.handleloginfinished) ... def handleloginfinished(self, result): if result == qdialog.accepted: # register login... else: # deal cancelled login... to prevent user interaction, hide() main window until login completed. otherwise, change dialog's modality, need like: self.login.hide() self.login.setmodal(true) self.login.show()

java - Email configuration from lotus notes -

i need read email using java application. have javamail samples http://java.net/projects/javamail/downloads/download/javamail-samples.zip how email server parameters lotus notes configured on system should use in javamail program? javamail implements protocols pop3, imap , smtp. on "normal" domino- server protocol started smtp , can send mails using qualified hostname of domino- server. but work, if administrator not restrict access smtp. receiving mails not possible unless domino administrator loads , configures tasks "pop3" , / or "imap". most admins wont that, these protocols not necessary normal use of domino server communication clients goes on protocol nrpc (port 1352), proprietary protocol ibm.

c++ - Emplace_back instead of push_back on stl containers? -

i'm not quite sure if can replace push_back emplace_back . i know emplace_back can forward parameters construct object directly in vector without copying twice (perfect forwarding etc...) and if soemthing this: vector<a> o; o.emplace_back(a{}); then should call copy constructor of a. correct ? same push_back . doesn't ? are there exceptions? there reasons use push_back ? because easier use emplace_back without thinking it. the main purpose of emplace perform explicit conversions : #include <chrono> #include <vector> using namespace std::chrono_literals; std::vector<std::chrono::seconds> time; time.push_back(1s); // ok // time.push_back(1); // error, thank god time.emplace_back(1); // ok, assume know you're doing use push_back add element of given value container. use emplace_back explicitly construct element constructor arguments.

asp.net mvc - Validate static dropdown in MVC5 -

i have on drop down. model [required(errormessage = "please selectvehicle")] public string vehiclerequested { get; set; } index.cshtml @html.dropdownlist("vehiclerequested", new list<selectlistitem> { new selectlistitem{ text="active", value = "1" }, new selectlistitem{ text="not-active", value = "0" } }) @html.validationmessagefor(model => model.vehiclerequested) i cannot see required feild validation append, m wrong , please suggst your dropdownlist has 2 items, 1 value="0" , other value="1" both "0" , "1" valid strings (neither null ) validation passes. property can never invalid never validation error. its not clear why binding int value string property, , fact display 2 values ("active" , "not-active") suggests property...

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

i'm running strange behavior powershell start-process call. here call: $process = start-process ` "c:\somepath\mybinary.exe" ` -passthru ` -credential $defaultcredential ` -wait ` -workingdirectory "c:\somepath" ` -loaduserprofile if ($process.exitcode -ne 0) { #do } this call return exit code - 1073741502 . after quick search, exit code seems related generic error when program not load required dll (aka. status_dll_init_failed ). when run without -credential $credential program runs correctly. in order isolate problem, manually launched some.exe in prompt target credential , runs smoothly. so problem seems come way start-process cmdlet launch process. i found potential solutions problem tried apply no luck : link , link . would have idea of what's going on here ? edit 1: run proc mon monitoring program activities when launched directly or via powershell script. problem seems occur when loading kernelbase...

javascript - Chrome crashing on page load -

i'm developing site on silex + twig. of time, looks great, once in while, without js errors, chrome crash page after loading content. happens on computers, made me think might memory problem. unfortunately, cannot provide code, because have provide whole source code, since cannot pinpoint problem. have of ever had problems this? if so, how did solve it? should first? please, if can, send me light on matter. edit: on beginning of project, started happening lot, 3 out of 4 refreshes, switched symfony silex... in machine, solved problem, in others, still happens, in minor frequency. i got it... it problem flexslider plugin. in question there's explanation , solution: bootstrap + flexslider: loading flexslider within hidden element causes jquery unresponsive thanks anyway... :d

c# - Asp.NET user control referenced from another project/dll has NULL properties -

trying move common custom control new class library (also tried new web project), other projects can use it, properties null when used in project. searching similar questions unfortunately not solve problem. i register new control in our web.base.config project-a <add tagprefix="controls" namespace="comp.userwebcontrols.controls" assembly="comp.userwebcontrols" /> the comp.userwebcontrols added project reference in project-a (i tried adding build dll reference in project-a, no difference) the markup looks like <asp:content id="content4" contentplaceholderid="rightplaceholder" runat="server"> <controls:uxmycontrol id="testingthing" runat="server" /> in code behind, "testingthing" control instantiated, properties null (labels, textboxes, etc) normally, if control within same project (project-a) register control this: <add tagprefix="contols" tagn...

perl - Remove space from a filename -

i stuck @ finding answer question, made windows-cmd program , 1 of feature rename file. fine if theres no whitespace in old name / new name, long theres space doesn't work. i've been looking on how remove whitespaces both old , new names (if theres one), proceed rename , put whitespace i've no idea on how proceed.. i've been reading few things "trim" doesn't help. here part of code : elsif ($fr eq 'ren') { $getmenu =~ s/ren //g; ($rf,$kb) = split /[ ]/,$getmenu; rename($rf, $kb) || die "error\n"; print "\n>$rf has been renamed $kb\n"; } since white space character problem, would: replace them placeholder symbol (like hyphen, pipe, or @) rename file replace placeholder symbol spaces again this question shows how that: replace whitespace hyphen in perl

oop - How to extract variable from one function into another in same class in php -

i want use variable value 1 function function of same class. using abstract class using declaring variable global indirectly. can not declare variable global in class. demo code follows: <?php abstract class abc { protected $te; } class test extends abc { public function team() { $te = 5; $this->te += 100; } public function tee() { $tee = 51; return $this->te; } } $obj = new test(); echo $obj->tee(); //echo test::tee(); ?> is possible can echo 105 answer there? my main motive want learn how variable value 1 function using without declaring global in same class please let me know possible or need delete question ? <?php abstract class abc { protected $te; } class test extends abc { public function __construct() { $this->te = 5; } public function team() { $this->te += 100; } public function tee() { return $this->te; } } $obj = new test(); $o...

How would I get SQL Server stored procedure parameter types to their equivalent C# types? -

i'm running unknown sql server stored procedures @ runtime can query sql output parameter types (varchar, int, etc). using ado or dapper, how equivalent data types in c#? values dynamic parameters in dapper, i'd able map them specific c# types. my use case running stored procedure , and creating class hold output data in respective c# data types, known @ runtime. have found query allows me see sql server data types, , i've heard orms i'm not sure how or if can used case. here mapping of sql server data types .net https://msdn.microsoft.com/en-us/library/cc716729(v=vs.110).aspx

java - Can't Open Fragment when clicked button -

i have created 2 fragment , layout, when click button on profile fragment should open flat layout, force stop application , not opening second fragment, have included fragment code , layout code.. profilefragment.java public class profilefragment extends fragment { view rootview; @override public view oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { rootview = inflater.inflate(r.layout.profile, container, false); button button = (button) rootview.findviewbyid(r.id.button); button.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { onbuttonclicked(v); } }); return rootview; } public void onbuttonclicked(view view) { //do stuff here.. final fragmenttransaction ft = getfragmentmanager().begintransaction(); ft.replace(r.id.button, new flatview(), "newfragmenttag"); ft.commit(); } ...