Posts

Showing posts from February, 2015

excel - Allow text overflow despite data in adjacent cells -

is possible have text populate in cell , allow overflow adjacent cells though there data in cells? here layout , situation: i have worksheet acts "report" sheet populates data based on drop down selections @ top of report sheet. user can select 1 of 8 countries view specific data, , report sheet populates cells d16 through p25. user can select view 8 countries. in instance, country data populate in blocks of data (d16:p25, d27:p36, d38:p47, etc.) when looking @ 1 country, other cells data blank (the formulas return ""). i need text overflow because asked incorporate summary of applicable limitations below first data table when viewing 1 country in report. example, if report selected view belgium, data populates in cells d16:p26. now, need show in cell d18:d22 summary of local laws. can incorporate necessary text using if statements column d, cut off because there formulas in columns e - p returning no values need return values "all countries" view.

ruby on rails - Listing all posts from a certain category -

i have posts model has category:string column on it. i'm looking display posts in categories. e.g. on click of 'technology' category link - load posts have apple category. couldn't find on stack overflow on this, may looking wrong thing. brilliant , appreciated! thanks post.where(category: 'animals') would return posts specified category. as comments under question - yeah, can benefit having additional model category , because post can have more, 1 category. you define relation 1 of following: hbtm has_and_belongs_to_many :categories # post.rb has_and_belongs_to_many :posts # category.rb has_many through post.rb has_many :categories_posts has_many :categories, through: :categories_posts category.rb has_many :categories_posts has_many :posts, through: :categories_posts categories_posts.rb belongs_to :category belongs_to :post edit to add selecting category(ies) form, add following (assuming category has name at

calendar - Creating custom DatePicker dialog -

requirement: when user clicks on textview, date picker should open up. default date selected should date in textview. if date in past, datepicker dialog's 'set' button should disabled. if clickable textview empty, default date in datepicker should today's date. this scenario i've solved , sharing here in order xamarin community. code isn't optimized, fyi. so, need in scenario access event user changing dates on datepicker dialog. can done if use datepicker inside own dialog more control. in opinion, cannot access event if use default datepickerdialog. thus, create dialog extending dialogfragment class , implement datepicker inside of it. when user clicks textview, use show fragment. let's begin: here's mainactivity: using system; using android.app; using android.content; using android.runtime; using android.views; using android.widget; using android.os; using java.util; using java.text; namespace datepickertest { [activity(label

dc.js - Bubbles are not showing in Bubble chart using dc.jc -

Image
i making bubble chart using dc.js , crossfilter.js bubbles not showing in chart !!!! showing x axis , y axis bubbles disappeared. i trying make bubble chart in click see here code : var datedim = ndx.dimension(function(d) {return d.date;}); var mindate = datedim.bottom(1)[0].date; var maxdate = datedim.top(1)[0].date; console.log(mindate); console.log(maxdate); //var agedim = ndx.dimension(function(d){return +d.age;}); var daysum = datedim.group().reducesum(function(d){return 1;}); //print_filter("agesum"); // var hits = datedim.group().reducesum(function(d) {return d.age;}); var brush = d3.svg.brush(); suicidebubblechart .width(990).height(200) .transitionduration(1500) .dimension(datedim) .group(daysum) .colors(d3.scale.category10()) .x(d3.time.scale().domain([mindate,maxdate])) .y(d3.time.scale().domain([mindate,maxdate])) .r(d3.scale.linear().domain([0, 4000])) .minradiuswithlabel(15) .yaxislabel("suicides"

Google Plus credentials for application Login -

i creating app , want confirm user using google credentials in java environment. can done using google api not sure how code servlet. i found code snippet authorize credentials authorizationcodeinstalledapp() throwing error , not sure api use. private static credential authorize() throws exception { // load client secrets googleclientsecrets clientsecrets = googleclientsecrets.load(json_factory, new inputstreamreader(test.class.getresourceasstream("/client_secrets.json"))); if (clientsecrets.getdetails().getclientid().startswith("enter") || clientsecrets.getdetails().getclientsecret().startswith("enter ")) { system.out.println( "enter client id , secret https://code.google.com/apis/console/?api=plus " + "into plus-cmdline-sample/src/main/resources/client_secrets.json"); system.exit(1); } // set authorization code flow googleauthorizationcodeflow flow = new g

android - Converting decimal number into ascii in java -

i want break decimal number , convert ascii format can view in text view. i getting battery percentage device decimal.i cant display directly passing decimal number, need pass ascii text view. for eg: getting data in byte array; consider arr[7] has value 98 means battery 98% want display value 98 need pass 0x39 , 0x38 respectively how can break 98 0x39 , 0x38 respectively. tried doing bitwise ending 0x0f , 0xf0 , added 0x30 gave me wrong value. use string.valueof(byte) string representation of byte. if must have ascii representation, can use tochararray() method in string .

Python Apply Image Threshold on Block Size? -

Image
i have 2d array shown below: [[118 127 133 ..., 213 211 211] [125 128 130 ..., 213 213 213] [119 124 130 ..., 214 213 213] ..., [ 36 54 44 ..., 109 101 101] [ 37 52 47 ..., 112 101 101] [ 39 50 51 ..., 104 99 99]] i need apply threshold on matrix locally , without overlapping them. need break 2d matrix smaller 2d matrix. , compute new threshold smaller 2d matrix , apply threshold smaller 2d matrix , same smaller matrices. have combine them in end. there python function easily? thank you. edit import sys numpy import * import scipy.misc matplotlib import pyplot def otsu1( hist, total ): no_of_bins = len( hist ) # should 256 intra_class_variances = [] threshold in range( 0, no_of_bins ): # first try find weight , variance on background sum_background = float(sum( hist[0:threshold] )) weight_background = sum_background / total mean_background = 0.0 variance_background = 0.0 # print weigh

c# - Selected radio button is changed when selected tab is changed -

i have tab control bound observable collection. each tab displays single radio button group. when tab changed, reason deselects selected radio button. each item in observable collection stores selected radio button own tab. believe means can't interfere each other. recognize 1 radio button can selected per group. yet, each tab in own group. why selected radio button being changed when tab changes? xaml <tabcontrol x:name="maintabcontrol" > <tabcontrol.itemtemplate> <datatemplate> <textblock text="{binding tabname}"></textblock> </datatemplate> </tabcontrol.itemtemplate> <tabcontrol.contenttemplate> <datatemplate> <grid> <grid.columndefinitions> <columndefinition width="1*" /> <columndefinition width="1*" /> <columnde

c# - Not all code return a value for lists -

i dont know error is, im trying retrieve values list , add them, dont know happening in code, error occurs @ returnattacks , attackloop. public class test{ public static list<int> attacks = new list<int>(); public static void addattack(int attack){ attacks.add (attack); } public static int returnattacks(){ int numofattacks = attacks.count; int returnval = 10; if (numofattacks > 5) { return returnval; } attackloop(); } public static int attackloop(){ foreach (int attack in attacks) { return attack; } } public static void main() { addattack(1); addattack(2); addattack(3); addattack(4); addattack(5); addattack(6); int selection = returnattacks(); } } in attackloops () function, function returns value of attack in first iteration of loop, , it. try returning value outside lo

iphone - Does Facebook SDK distinguish between iOS debug vs release build -

Image
does facebook distinguish between debug , release ios builds? testing app before submitting new build itunes. app uses single permission of posting photo on facebook (i.e. publish_actions). strange thing when test facebook account, goes through fine. when test partner's facebook account, not go through: developer account linked facebook account; not partner's. following method // convenience method perform action requires "publish_actions" permissions. - (void)performpublishaction:(void(^)(void))action { // defer request permission post moment of post, check permission if ([fbsession.activesession.permissions indexofobject:@"publish_actions"] == nsnotfound) { // if don't have permission, request nslog(@"requesting publish permission"); [fbsession.activesession requestnewpublishpermissions:@[@"publish_actions"] defaultaudience:fbsessiondefaultaudiencefr

parse.com - how do I format a python script to run cloud code on Parse? -

parse's quickstart guide gives python code started using cloud code: import json,httplib connection = httplib.httpsconnection('api.parse.com', 443) connection.connect() connection.request('post', '/1/functions/hello', json.dumps({ }), { "x-parse-application-id": "xxxxxxxxxxxx", "x-parse-rest-api-key": "xxxxxxxxxxxxx", "content-type": "application/json" }) result = json.loads(connection.getresponse().read()) print result this code gives me syntax error when run matter it. how change quotes or formatting work? this seems resolve whatever syntax problem there was: # -*- coding: utf-8 -*- import json,httplib connection = httplib.httpsconnection('api.parse.com', 443) connection.connect() headers = {'content-type': 'application/json'} jdump = {'x-parse-application-id': 'xxxxxxxxxxxxxx', 'x-parse-rest-api-key'

c - Let gcc inline AND export a function -

given function needs inlined performance reasons (because it's called in loop , don't want call overhead). simplified example: void increment(int *single_value) { *single_value++; } void increment_values(int *array, size_t length) { for(size_t i=0;i<length;i++) { increment(&a[i]); } } but want unit test function, example void test_increment() { int value = 5; increment(&value); assert_equal(value, 6); } is possible tell compiler inline function and export it, can link against tests? i'm using gcc , methods working compilers ( clang , icc , ...) preferred. using inline mere hint compiler might @ inline: "[ . . . ] inline definition not provide external definition function, , not forbid external definition in translation unit. inline definition provides alternative external definition, translator may use implement call function in same translation unit. unspecified whether call function uses inline definit

button - Simple PIC16F684 Input/Output -

i'm having trouble should simple piece of code. objective turn led on while button being pressed. in case input logic go low when press button. led connected portc.2 , button connected portc.0. here code: dim test bit main: trisc = %00000001 ansel = %00000000 portc= 0 cmcon0=0 testbutton: test = portc.0 if test = 0 portc = %00000100 goto testbutton end if portc = %00000000 end. the problem pic outputs high no matter input is. far have used multimeter verify input indeed changing 5v 0v when button pressed, have tried using different input pin, , have tried using different pic. suspect since input being read low pic may not initialized i'm not entirely sure. thanks insight might able give me the datasheet of 16f684 states on page 42 : the ansel , cmcon0 registers must initialized configure analog channel digital input. pins configured analog inputs read ‘0’. these registers initialized in code. ansel initialized 0, analog input

c# - XslCompiledTransform ignores ordering of XPathNodeIterator -

i have xslt stylesheet consumes document , outputs soap message, body in specific format defined wcf data contract (not specified here). issue wcf has peculiar notion of constitutes 'alphabetical' ordering , considers following order correct: ac ab this because uses ordinal string comparison internally. details not interesting, suffice xslt <sort> doesn't natively support ordering in order transform input document format may vary, acceptable soap message, stylesheet must able order output elements according peculiar ordering. i've therefore decided implement node sorting in script block. part of c# solution , uses xslcompiledtransform , therefore msxsl:script available. given stylesheet: <?xml version="1.0" encoding="utf-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform" xmlns:fn="urn:functions" xmlns:msxsl="urn:schemas-microsoft-c

r - creating a function which extracts a user specified column from a set of files -

i have set of csv files. of them have same structure. want create function extracts particular column files. finds mean of values in column , store in vector. column name should passed user. i have coded following program. somehow can not identify "pollutant" contains name of column. pollutantmean<-function(pollutant) { file_names<-dir("c:/users/keval/desktop/project r/r_courseera_programming_exercise/specdata",pattern= glob2rx("*.csv")) for(file_name in file_names) { file_reader<-read.csv(file_name) pollutant_data<-file_reader$pollutant } pollutant_data pollutant }`enter code here` use string, e.g., call function with pollutantmean(pollutant = "mercury") and use [ (which accepts strings) instead of $ , doesn't: # replace line pollutant_data <- file_reader$pollutant # this: pollutant_data <- file_reader[, pollutant] this won't error out, still need take mean , store it. i

haskell - Using cabal to compile but not run the test suite? -

cabal test compile test suite executable , run it. however, removes console colouring (because logs result). i'd use cabal build executable , run script, can't figure out how build executable. if cabal configure --enable-tests , cabal build build not library/executables, test suites. can build individual test suites name, saying cabal build name-of-test-suite . you can run them manually appropriate subdirectories under dist/build if don't want use cabal test . furthermore, if it's e.g. tasty test suite, may able color output saying like cabal test --show-details=always --test-option=--color --test-option=always you can try --show-details=streaming . don't know how robust is, though, , whether works may depend on platform on.

svn - VisualSVN server connection outside a network -

i'm trying setup visualsvn server in windows 7 sudenly can't connect host ( name or ip ). when i'm in same network pc installed program can access svn pc name server name , checkouting http://external_ip/svn/reponame apache must listen on interfaces, have on lan. reconfigure server

sharepoint 2010 - Is it feasible to dynamically assign a VisualWebPart instance to a WebPart? -

i working on webpart needs morph based on current user; if 1 person, see collection of controls, person see else (based on role/the situation). is sensible way of accomplishing create n visualwebparts, , swap out specific vwp hosted webpart based on current user? or there standard way of doing better/easier (i new sharepoint, hence don't know what's "normal"). i think there many ways dynamically change webpart's contents. 1 way accomplish in single visualwebpart have multiple sections of controls each encapsulated panel control. control visibility of panels using code create dynamic rendering. <asp:panel id="defaultpanel" runat="server" visible="true"> <h3>default text or controls here</h3></asp:panel> <asp:panel id="specialpanel" runat="server" visible="false"> <h3>special text or controls</h3></asp:panel> then in code bool sh

ios - Getting Current Location using Parse SDK -

i'm trying current location of user using build in geopointforcurrentlocation method. try set geopoint in custom field created in user class called location , attempt save using saveinbackground method. [pfgeopoint geopointforcurrentlocationinbackground: ^(pfgeopoint *geopoint, nserror *error) { if (!error) { [[pfuser currentuser] setobject: geopoint forkey: @"location"]; [[pfuser currentuser] saveinbackground]; } }]; no errors thrown user's location not saved database. edit: my viewdidload method looks this: self.locationmanager = [[cllocationmanager alloc] init]; self.locationmanager.delegate = self; if ([self.locationmanager respondstoselector:@selector(requestwheninuseauthorization)]) { [self.locationmanager requestwheninuseauthorization]; } } and set info.plist key when in use authorization. did not mark implementation file cllocationm

java - Which is the better way to create instance of PageObject? -

i know below better option creating instance of pageobject class(ex: loginpage):- 1) create instance of pageobject class in tests , steps (wherever required)? loginpage loginpage = pagefactory.initelements(webdriver, loginpage.class); (or) 2) create class static method return instance requested pageobject class. in method, check if instance null before creating new instance requested class? loginpage loginpage = pageutil.getpageobject("login"); please advise. there multiple ways it. create baseclass() , instantiate pagefactory.initelements(driver, this); there. see gist . also, public repository here import org.openqa.selenium.webdriver; import org.openqa.selenium.support.pagefactory; /** * created saifur on 2/14/2015. */ public class baseclass { //global driver instance. webdriver driver; //super constructor public baseclass(webdriver _driver) { //assigning driver instance globally. driver = _driver; /*instantiating elements since

jquery - Push Json filtered key values to nested ul with Javascript -

i need pushing values filtered json, need generate nested ul list, can not modify json format @ point, check console.log see values create list, @ point can't figure how complete 'for loop' render html markup needed, appreciated, jsfiddle http://jsfiddle.net/43jh9hzz/ , , if check console log see values. this js: var json=''; var property_set = new set(); function iterate(obj, stack) { json="<ul>"; (var property in obj) { if (obj.hasownproperty(property)) { if (typeof obj[property] == "object") { iterate(obj[property], stack + '.' + property); } else { // console.log(property); property_set.add(property); json+="<li>";

java - Libgdx how to set space between the check box and the text label -

Image
i've created checkbox skin libgdx scene2d problem there no space between checkbox , text label , here code checkbox : final checkbox vsynccheckbox = new checkbox("vsync", skin); vsynccheckbox.setchecked(vsync()); vsynccheckbox.getcells().get(0).size(30, 30); and in table layout tried use spaceright(10); nothing happens : table.add(vsynccheckbox).top().expandy().spaceright(10); here image on checkbox looks moment: like can see checkbox , vsync stack on how provide space between them ? this how solved similar problem: table.add(yourbutton).padleft(distance).other_stuff; next time please refer the wiki table page solve problems of or relating table layout if have problems in understanding concept turn on debugging table.setdebug(true); if check box , label 1 single item, can put space " vsync" in declaration of object instead of "vsync".

angularjs - Testing ui.router $stateChangeSuccess -

i have simple function in main controller updates $scope.loading based on ui.router's $statechangestart , $statechangesuccess events. $scope.$on('$statechangestart', function(event, tostate) { if (tostate.resolve) { $scope.loading = true; } }); $scope.$on('$statechangesuccess', function(event, tostate) { if (tostate.resolve) { $scope.loading = false; } }); this works great until try unit test. can't find way trigger $statechangesuccess event. my jasmine unit test looks this: it('should set $scope.loading true', function () { expect(scope.loading).tobe(false); $state.go('home'); expect(scope.loading).tobe(true); scope.$digest(); expect(scope.loading).tobe(false); }); the test fails because $statechangesuccess never fires. ideas appreciated. this works me. you need $broadcast event. read below bit of pseudocode. hope helps you. // note: pseudocode // controller // assu

hapijs - What are authentication artifacts used for in hapi.js authentication schemes? -

Image
in hapi.js api specify authentication schemes can return artifacts part of credentials object. what authentication artifacts , why useful? there example why hapi team included part of api? result - object containing: credentials - authenticated credentials. artifacts - optional authentication artifacts. http://hapijs.com/api#serverauthschemename-scheme short answer on request.auth have access following properties: credentials - things identify or represent unique user artifacts - optional authentication-related data isn't credentials hapi auth schemes aren't stateful can store important auth data in request.auth.artifacts can accessed other auth functions in scheme @ later time. what authentication artifacts? first let's @ general definition of artifact (from wikipedia): [artifacts] refer arises process in hand rather issue itself, i.e., result of interest stems means rather end. an authentication scheme can optionally p

mongoose - Error occured: MongoError: driver is incompatible with this server version -

var mongoose = require('mongoose'), locationmodel = mongoose.model('location') exports.createlocation = function(req, res, next) { var locationmodel = new locationmodel(req.body); locationmodel.save(function(err, article) { if (err) { res.status(200); res.json({ type: false, data: "error occured: " + err }) } else { res.json({ type: true, data: article }) } }) } while trying save using model file getting driver incompatible server version. install latest version of mongoose & update dependencies in package.json. latest version of mongoose here . at npm repository of package dependencies of mongodb described.

Can we create a web application (web site) using WinJS? -

i trying out winjs & know if possible create web application using winjs. something typically create using html5 + bootstrap + js framework (like angularjs). i need create line of business hosted on server & can accessed through browser device. i thinking of considering winjs because - primary audience on microsoft devices & in future if need create cordova wrapper can create one. - benefit microsoft support. absolutely. of april 2014, winjs became open source, cross-platform framework, no longer exclusive windows. it's licensed use on web, , work has been done make compatible other frameworks. can find info on try.buildwinjs.com, http://try.buildwinjs.com/#get tells different ways acquire libraries needs. includes doing custom build of subset of functionality, takes https://github.com/winjs/winjs-modules source lives. you can find details on sept 2014 release of winjs 3.0 @ http://blogs.windows.com/buildingapps/2014/09/17/winjs-everywhere/ .

continuous integration - TeamCity : How to define build and deployment steps for database objects -

i working on continuous integration project auto build , deploy database changes target environment. using perforce p4 source code repository, nexus artefacts repository , ms sql 2008. not using redgate database repository. check-in process - developers manually extract database objects (e.g. table, stored proc, function) using management studio , check-in source repository of perforce. requirement: part of ci process, when developers check-in code source repository, build process should triggered , create artefacts of checked-in code , copied artefacts repository. deployment process should automatically triggered when finds new artefacts , deploy artefact target environment. highly appreciate if helps me know : build , deployment steps requirement of manifest file if possible extract incremental changes get ssdt in visual studio (express works if don't have licenses) this mean developers check in create statements , deploy incremental changes, pretty

ios - Xcode 6 application crash log -

is there way see list of crash logs after xcode application crash (i don't need device crash log)? or @ least, there log similar info xcode app ? you can find mac applications (including xcode) crash logs here: ~/library/logs/diagnosticreports/

c# - Removing child entity not deleting in database entity framework -

Image
i have 2 entities "yogaspace" , "yogaspaceimage" i'm deleting image , trying row removed, instead nulls out reference yogaspace entity. here entities. public class yogaspace { public int yogaspaceid { get; set; } public virtual icollection<yogaspaceimage> images { get; set; } } public class yogaspaceimage { public int yogaspaceimageid { get; set; } public byte[] image { get; set; } public byte[] imagethumbnail { get; set; } public string contenttype { get; set; } public int ordering { get; set; } } here method deleted 1 image db. [httppost] public actionresult removeimage(string id, string imageid) { yogaspace yogaspace = yogaspacerepository.find(convert.toint16(id)); yogaspaceimage image = yogaspace.images.firstordefault(si => si.yogaspaceimageid == convert.toint16(imageid)); yogaspace.images.remove(image); yogaspacerepository.insertorupdate(yogaspace); yogaspacer

Polymer camelCase attributes -

i'm writing wrapper around js library polymer components. basically, need able assign attributes component, , forward them instance of js object. the problem polymer (or webcomponents in general?) forces attribute names lowercase. declaring element <some-element foobar="baz"></some-element> generic change listener attributechanged: function(attrname, oldval, newval){ // attrname -> foobar, not member of someinstance this.someinstance[attrname] = newval; } is there way camel-cased name? maybe can create hash publish object on prototype... how reference that? aha! publish available on component instance! allows me grab names , make map lowercase camelcase. var map = {}; object.keys(this.publish).foreach(function(key){ map[key.tolowercase()] = key; });

ios - How can I draw multiple instances of a UIView without using CAReplicatorLayer? -

i have uiview, , want make multiple replicas of can position on different points of screen. want able apply different masks/transforms each of replicas each 1 can potentially show different portion of original. for example, let's that have view, a , , make 2 replicas of it, b , , c . want apply mask b shows top half of a , want apply different mask c shows bottom half of a . how go doing this? careplicatorlayer isn't usable i'm trying in application replicas need in different parts of view hierarchy. also, can't use method makes use of snapshotting original view may contain animated content or video. want sort of view can mirror contents of view have 2 views same.

c# - Cannot initialize TimeSpan with a collection initializer in linq query ¿Syntax error? -

i build viewmodel linq query entities , following foreach: _result.foreach(t => t.horarioiniafsp = (from u in model.asistenciacurso join t in model.parametros on u.idcurso equals t.valornumerico u.userid.equals(t.userid) && t.nombreparametro == "modulo1" select new timespan { u.horarioinicio }).tolist()); however can't rid of error: "cannot initialize system.timespan collection initalizer because not implement ienumerable. what wrong? suspect matter of syntax can't figure out, formerly did this: _result.foreach(t => t.horariofinafsp = model.asistenciacurso.where(u => u.userid.equals(t.userid)).select(x =&

Caching data using $cacheFactory vs regular javascript variable AngularJS -

the invoicemodel below has getbycustomer() function lists invoices given customer. i'm wondering what's difference between caching data regular javascript variable compared using $cachefactory. regular javascipt variable: angular.module('app', ['ngresource']) .factory('invoice', ['$resource', function($resource) { return $resource('http://foo.bar/invoices'); } ]) .factory('invoicemodel', ['invoice', function(invoice) { var customer_invoices = []; return { getbycustomer: function(customer_id) { if (customer_invoices[customer_id] == undefined) { customer_invoices[customer_id] = invoice.get({customer_id: customer_id}); } return customer_invoices[customer_id]; } }; } ]); $cachefactory angular.module('app', ['ngresource']) .factory('invoice', ['

The usage of HitTestResult class in pygtk webkit -

i write callback function context_menu popup through right-click in order url of link mouse pointing at, know can use webkit.hittestresult class information gdk event(i assume right-click event). however, code below give me nothing. i find problem may incorrect usage of hittestresult. can find little document talking usage of class, me this? def callback(self, widget, context_menu, hit_result_event, event): option = gtk.imagemenuitem('do it') option.connect('activate', self.option_activate_cb) context_menu.append(option) option.show() def option_activate_cb(self, image_menu_item): test = webkit.hittestresult() action = test.props.link-uri print action here example. basically, have use hittestresult.get_link_uri() . from gi.repository import gtk, webkit2 class test: def __init__(self): view = webkit2.webview() view.load_uri('https://stackoverflow.com') view.connect('context-menu'

css - How to customize dropdown background-color while hover zurb-foundation 5 -

Image
how can customize background-color while hovering <a href="#">find me</a> . want change background-color while i'm hovering. this's picture before hovering. and this's picture after hovering i want customize background-color @ " find me " should add customize background color. and this's code <nav style="width: 1000px; margin: auto;" class="top-bar" data-topbar role="navigation"> <ul style="margin-right: 80px;" class="title-area"> <li class="name"> <h1><a href="#">my site</a></h1> </li> <!-- remove class "menu-icon" rid of menu icon. take out "menu" have icon alone --> <li class="toggle-topbar menu-icon"><a href="#"><span>menu</span></a></li> </ul> <section c

php - Mysql LIKE show unknown characters -

i tried filter data mysql table. <?php include ("connection.php"); $name = "cable"; $sql = "select * stock item '%$name%'"; ?> <a target="_blank" href="test2.php?link=<?php echo $sql; ?>" >click</a> i tried sql statement using $_get[link] next page. (test2.php). here's code test2.php <?php include ("connection.php"); $link = $_get['link']; echo $link; then echo $link show me different value. doesn't display "cable". instead, displays select * stock item 'Êble%' can tell me why cable became Êble ? as ayyanar said, yes, not idea pass sql query in url . but if still want achieve can this: test1.php <?php $name = "cable"; $sql = "select * stock item '%--$name--%'"; ?> <a target="_blank" href="test2.php?link=<?php echo $sql; ?>" >click</a> test2.php

android - Getting Google Fit data that matches Google Fit -

i trying step count data on day day basis google fit display in application. seems code i'm using correct, getting data, numbers way off when compare data google fit app. example, in google fit (both on web , in android app) march 19 shows 2269 steps. in app march 19 shows 64 steps. data in app consistently lower power of 10. requesting data incorrectly? relevant code below. client builder code googleapiclient.builder builder = new googleapiclient.builder(main.instance) .addapi(fitness.api) .addscope(new scope(scopes.fitness_activity_read)); request builder code private datareadrequest queryfitnessdata(long date) { // build single day range. calendar cal = calendar.getinstance(); cal.settimeinmillis(date); cal.set(calendar.hour_of_day, 0); cal.set(calendar.minute, 0); cal.set(calendar.second, 0); cal.set(calendar.millisecond, 0); long starttime = cal.gettimeinmillis(); cal.add(calendar.date, 1);

android - How to open a file using installed apps? -

i want open given file using installed apps in android. how can that? i using following code google returns "no app open file" . if open file in other file managers, see different options open file. code: public void open(view v) { string name = ((textview) v).gettext().tostring(); file f = new file(path + name); if (f.isdirectory()) { showfiles(f); } else if (f.isfile()) { intent openfileintent = new intent(intent.action_view); openfileintent.setdata(uri.fromfile(f)); if (openfileintent.resolveactivity(getpackagemanager()) != null) { startactivity(openfileintent); } else { toast.maketext(this, "no app open file.", toast.length_short).show(); } } else { toast.maketext(this, "selected item not file.", toast.length_short).show(); } }

javascript - Getting text from all the classes on a click event -

there multiple elements each class p1,p2,p3....p14 so, when try text class clicked,i text classes! example, when the text has 80 808080080808080808080 . there work-around this, else giving each id ? $('.p1,.p2,.p3,.p4,.p5,.p6,.p7,.p8,.p9,.p10,.p11,.p12,.p13,.p14').click(function(event) { if(!playerselected) { playername = this.title; // gets text classes playernumber = $('.' + this.classname + '>strong').text(); console.log(playername + " : " + playernumber); playerselected = true; } }); you need @ target element alone: playernumber = $(this).find("strong").text(); now text target element alone. in case: playernumber = $('.' + this.classname + '>strong').text(); you querying elements matching classname. it's returning text elements same classname.

android - How to replace the values in table while the insert name already exist in the table -

how update values while insert if exist same name in table. example: table have values(bala,100,chennai).again try insert values if inserting name same want replace values(bala,100,chennai) (bala,50,mumbai). while insert(bala,50,mumbai). beginner in database side. in advance. public class horizantaldbhandler extends sqliteopenhelper { // static variables // database version private static final int database_version = 1; // database name private static final string database_name = "hrlist"; // contacts table name // private static final string table_contacts = "breakfast"; private static final string table_breakfast = "hrlist"; // contacts table columns names private static final string key_id = "id"; private static final string key_number = "number"; private static final string key_name = "name"; private static final string key_image = "image"; public horizantaldbhandler(context context) { super(cont

c++ - What happens when we cast char to a number greater than 256? -

i created program create 256 unique symbols, , works fine. works writing binary (char) cast of 1-256. if decide print (char)257 file, file still has 256 unique symbols. when cout (char)257, don't see on screen. empty character or point something? also if ascii 128 letters, call term 256 characters? utf-8? when cast 257 char , value truncated 1. assuming sizeof(int) 4 in platform, 257 represented 0x00000101 in hex. when truncate char performing cast, 0x01 , equal 1 . ascii character represented 1 not printable character. hence, don't see output when use: std::cout << (char)257; if use: char c = (char)257; std::cout << (int)c << std::endl; you should see 1 output. what call term 256 characters? i believe talking extended ascii characters .

python - "Edit with IDLE" option missing from context menu -

i have python 2.7.5 installed arcgis 10.2.2. when first right-clicked .py script i'd written listed "edit idle" option in context menu. however, option no longer appears when right-click .py file. i have read numerous threads concerning issue , attempted of them, such modifying/removing registry keys , reinstalling/repairing software. not interested in using ide @ point, though many happy know intend use ide later on. right now, purpose fix problem rather avoid , work around it. i appreciate i've gotten online community in past, , i'm confident come through solution me. how "edit idle" in context menu? directly from: https://superuser.com/questions/343519/python-idle-disappeared-from-the-right-click-context-menu here's reg file add command edit idle python.file (.py) , python.noconfile (.pyw) file types. it's python 2.7, installed in c:\python27, substitute paths pythonw.exe , idle.pyw relevant installation. save .reg fil

excel - Need to append data to the next blank row instead of creating data in a new worksheet -

i trying download historical stock prices moneycontrol.com. here code have...the current code extracts data each webpage , pastes new worksheet each time. but, append data next blank row instead of creating data in new worksheet. can please me this? private const url_template string = "url;http://www.moneycontrol.com/stocks/hist_stock_result.php?sc_id=ri&pno={0}&hdn=daily&fdt=2000-01-01&todt=2015-12-31" private const number_of_pages byte = 1 sub datadownload() dim page byte dim querytableobject querytable dim url string page = 1 number_of_pages url = vba.strings.replace(url_template, "{0}", page) set querytableobject = activesheet.querytables.add(connection:=url, destination:=thisworkbook.worksheets.add.[a1]) querytableobject.fieldnames = true querytableobject.rownumbers = false querytableobject.filladjacentformulas = false querytableobject.preserveformatting = true que