Posts

jquery - First image on a Nivo Slider appears distorted -

i have nivo slider on site , every time reload first image on slider appears stretched height, don't know reason, defined max-height fixed value , have added height: auto !important; .nivo-main-image even facing same problem without solution, appreciate you'll. here code: ** .nivoslider { position:relative; width:100%; height:auto; overflow: hidden; } .nivoslider img { position:absolute; top:0px; left:0px; max-width: none; } .nivo-main-image { display: block !important; position: relative !important; width: 100% !important; height:auto !important; } /* if image wrapped in link */ .nivoslider a.nivo-imagelink { position:absolute; top:0px; left:0px; width:100%; height:100%; border:0; padding:0; margin:0; z-index:6; display:none; background:white; filter:alpha(opacity=0); opacity:0; } /* slices , boxes in slider */ .nivo-slice { display:block; positio...

android - socket.io does'nt work on chrome mobile, but it does in incognito mode -

i'm working nodejs , socket.io under angularjs. the sockets work on desktop (all browsers). not on mobile. well... socket d'ont work on chrome mobile, expect in incognito mode. here bit of code: server side: io.on('connection', function(socket){ user = { id: socket.id, socket: socket }; console.log('connection received'); console.log(user.id); socket.emit('files', lib.all()); client side socket.on('files', function(data){ var streams = data; if(streams){ $scope.streams = streams; } }); the lib.all() function work fine. , i've got angular factory handle socket.io (which work fine). in chrome mobile socket not received or emit anything. work expected in incognito mode. work in firefox android. i'm not expert in android neither in chrome. suspect there special/strange happening. firewall? proxy? does know workaround this? thanks, , have day! p.s : on ch...

Wordpress menu and WooCommerce categories -

is possible add categories/subcategories links automatically wp menu woocommerce plugin? have many categories (20) , more subcategories (100+) , need them shown in main menu @ top, in hierarchical way. have tried "appearance->menu" section select categories @ once in menu, messed up, no hierarchy @ all. there solution avoid inserting categories/subcategories manually menu items? please check plugin https://wordpress.org/plugins/jc-submenu/screenshots/ with need 1 time add menu showing screenshot

mocha - How to unit test file upload with Supertest -and- send a token? -

how can test file upload token being sent? i'm getting "0" instead of confirmation of upload. this failed test: var chai = require('chai'); var expect = chai.expect; var config = require("../config"); // contains call supertest , token info describe('upload endpoint', function (){ it('attach photos - should return 200 response & accepted text', function (done){ this.timeout(15000); settimeout(done, 15000); config.api.post('/customer/upload') .set('accept', 'application.json') .send({"token": config.token}) .field('vehicle_vin', "randomvin") .attach('file', '/users/moi/desktop/unit_test_extravaganza/hardwork.jpg') .end(function(err, res) { expect(res.body.ok).to.equal(true); expect(res.body.result[0].web_link).to.exist; ...

Chrome Application Doesn't Use System Proxy -

a chrome packaged application under windows 10 doesn't seem using public proxy settings under internet options. i'm trying monitor application's network activity via fiddler installed on computer. every http , https requests monitored there, except ones packaged application. i'm pretty sure uses http requests behind, because generated android apk file, using arc welder. , can see http requests android application on phone. not generated packaged chrome application on windows. there can manifest file or else? thank you. chrome.sockets api not use chrome browser proxy settings. on chromeos, chrome.sockets respect system-wide vpn settings, however.

facebook - FBSDKAppInviteDialog: How to know when a friend have accepted -

using fbsdkappinvitedialog how know when friend has accepted invitation? the result in following delegate method not give information: - (void)appinvitedialog:(fbsdkappinvitedialog *)appinvitedialog didcompletewithresults:(nsdictionary *)results{ so app know when "app friends". i know sure cannot ids or information friends invited using fbsdkappinvitedialog . more information in question: app invite dialog delegate methods result parameter contains no request id and i'm pretty sure there no way friends accepted invitation directly neither. use dynamic app link end point referral code, though. can have here: https://developers.facebook.com/docs/app-invites/ios#app_links the above applies if developing non-game app. easier if doing game. can use fbsdkgamerequestdialog or invitable_friends method of graph api, if want draw custom interface that. unrelated directly question, might interesting if trying implement kind of referral system: https://dev...

javascript - Chrome + JSFiddle OPTION element bug -

Image
this has me scratching head. the option text cleared using code in snippet: document.queryselector('option').textcontent = ''; <select> <option>ipso</option> </select> it works in codepen , plus works on website. however, in jsfiddle fails – but in chrome . if set textcontent prior clearing it, it works . this issue doesn't seem occur other type of element. if use innertext or innerhtml instead of textcontent , same behavior – again, in chrome. jquery's text() method gives same behavior. is chrome bug or jsfiddle bug? i don't know reason bug, try setting load type (click cog in top right corner of javascript frame) , select no wrap - in <body> . it works on chrome browser on phone (whilst fiddle didn't), , possibly explain what's gone wrong.

angular2 services - Angular 2 RC 4 Http post not firing -

i trying fire post request app , it's not working, tried multiple ways. don't see request being fired under network tab in chrome. not sure problem is, appreciated. import { injectable } '@angular/core'; import { http, headers } '@angular/http'; @injectable() export class userservice{ private _url="users"; constructor(private _http: http){ } checkifusernameexists(username){ return this._http.get(this._url+"/"+username) .map(response => response.json()) } createuser(user){ let headers = new headers(); headers.append('content-type', 'application/json') console.log(json.stringify(user)); return this._http.post(this._url, json.stringify(user),{headers: headers}) .map(response => response.json()) } } first need capture error , solve error: this._http.post(this._url, json.stringify(user),{headers: headers}) .subscribe( ...

list comprehension with multiple conditions (python) -

the following code works in python var=range(20) var_even = [0 if x%2==0 else x x in var] print var,var_even however, thought conditions need put in end of list. if make code var_even = [0 if x%2==0 x in var] then won't work. there reason this? there 2 distinct similar-looking syntaxes involved here, conditional expressions , list comprehension filter clauses . a conditional expression of form x if y else z . syntax isn't related list comprehensions. if want conditionally include 1 thing or different thing in list comprehension, use: var_even = [x if x%2==0 else 'odd' x in var] # ^ "if" on here "this or that" a list comprehension filter clause if thing in elem x in y if thing . part of list comprehension syntax, , goes after for clause. if want conditionally include or not include element in list comprehension, use: var_even = [x x in var if x%2==0] # ^ "if" on here "...

php - Beginner trouble updating records PDO -

i have read lot of articles/blogs cannot find wrong. trying update records using pdo when press send nothing happens, no error, , not work. php: $stmt = $conn->prepare('update products set name = :name id = :id'); $stmt->bindvalue(':id', $_post['id'], pdo::param_int); $stmt->bindvalue(':name', $_post['name'], pdo::param_str); $stmt->execute(); html: <form name="prodform" class="pure-form pure-form-aligned" method="post"> <input name="name" type="text" value="<?php echo $data['nome']; ?>"> <input name="id" type="hidden" value="<?php echo $data['id']; ?>"> <input name="send" type="submit" value="send"> </form> it seems found way make work don't know why works this. changed input name different 1 , worked magic, don't know why ...

sql server - How to make dynamic updates to the database using a list in python -

if year in year: #print 'executing' rows in range(1,sheet.nrows): records = [] fip = str(sheet.cell(rows, 1).value) cols in range(9,sheet.ncols): records.append(str(sheet.cell(rows,cols).value)) cur.execute("update " + str(table_name) + " set " + (str(variables[0]) + "= \'{0}\', ".format(records[0]) + str(variables[1]) + " = \'{0}\', ".format(records[1]) + str(variables[2]) + " = \'{0}\', ".format(records[2]) + str(variables[3]) + " = \'{0}\', ".format(records[3]) + str(variables[4]) + " = \'{0}\',".format(records[4]) + str(variables[5]) + " = \'{0}\', ".format(records[5]) + str(variables[6]) + " = \'{0}\' ".format(records[6])+ "where data_yea...

javascript - Get data-value of each individual div -

i'm using couple of plugins animate progress bars using javascript. i'm setting data value of each 1 in html avoid defining in javascript each time. <div class="progress-circle" data-value="0.65"> i want data value animate , stop @ value each time code have @ moment stops of them @ 1st divs value. var el = $('.progress-circle'), inited = false; el.appear({ force_process: true }); el.on('appear', function() { if (!inited) { el.circleprogress({ value: el.attr('data-value') }); inited = true; } }); $('.progress-circle').circleprogress({ size: 80, startangle: -math.pi / 4 * 2, linecap: "round", fill: { color: "#64b46e" } }).on('circle-animation-progress', function(event, progress, stepvalue) { $(this).find('.inner').text(string(stepvalue.tofixed(2)).substr(2)+ '%'); }); how...

javascript - Angular directive attributes cause an error -

i trying write angular directive make substring of attribute passed in. below code: html: <body ng-controller="mainctrl"> <div><substring message="this test."></substring></div> <div><substring message="so this." ></substring></div> </body> angular/javascript: var app = angular.module('myapp', []); app.controller('mainctrl', function($scope) { }); app.directive('substring', function () { return { restrict: 'ae', replace: true, scope: { text: '=message' }, link: function (scope, elem, attrs) { //alert(attrs.message); var str = attrs.message; scope.text = str.substring(1, 4); }, template: '<h1>{{text}}</h1>' }; }); when try running following error: html1300: navigation occurred. file: directive.html error: [$parse:syntax] syntax error: token 'is' ...

In Java, what is meant by this "double cannot be dereferenced" error? -

this question has answer here: double cannot dereferenced? 3 answers i have following code : public class randomcompliment { static final string[] comps = { "gorgeous butterfly!", "strawberry milkshake!", "calm waterfall", "smart cookie", "big genius", "friendly cat" }; public static void main(string[] args) { (int = 0; < 200 ; i++ ) { system.out.print("good monring, " + comps[(((20) * math.sin(i)).intvalue()) % comps.length]); } } } and giving me error : c:\misc_stuff\randomscratch>javac randomcompliment.java randomcompliment.java:14: double cannot dereferenced system.out.print(" " + comps[ ( ((20) * math. sin(i)).intvalue() ) % comps.length ]); ^ 1 error what meant "dereferenced" here...

unity3d - C# OnTriggerEnter, Pick up an object. OnTriggerExit, drop the object -

i'm trying sprite pick cube when encounters one, if isn't carrying one. if is, drop cube carrying. this have right now. void ontriggerenter(collider other) { if (other.tag == "cube") { other.transform.position = this.transform.position; } } i tried telling cube become child of sprite. wasn't working. put cube sprites position when trigger entered, cube stays in position while sprite wonders off. with code,you can change cubes position players position 1 time.if want cube move character should make child of character. try using code; void ontriggerenter(collider other) { if (other.tag == "cube") { other.transform.parent = gameobject.transform; } } ps:i don't have access unity now.some coding mistakes can occur.

Splitting Date and specially Time in C#. How to get the AM/PM thing -

this question has answer here: how am/pm value datetime? 12 answers i have value #7/13/2016 3:20:00 pm# , want separate out date , time. format date "07/13/2016" , time "03:20 pm". have got values startdatetime.tostring("mm/dd/yyyy") , startdatetime.tostring("hh:mm") not sure "am or pm" thing. if understand correctly, have datetime value trying break separate date , time. microsoft has great documentation on datetime formatting think looking for time element this: somedatetime.tostring("hh:mm tt"); which should output "03:20 pm" or whatever case may be.

ios - How to change height of Annotation callout window Swift -

how change size of annotation callout window on map in swift. tried make bigger cgsize on each of component of right , left view without success height of view in end still same. here code: func mapview(mapview: mkmapview, viewforannotation annotation: mkannotation) -> mkannotationview? { print("delegate called") if !(annotation custompointannotation) { return nil } let reuseid = "test" var anview = mapview.dequeuereusableannotationviewwithidentifier(reuseid) if anview == nil { anview = mkannotationview(annotation: annotation, reuseidentifier: reuseid) selectedustanova = (annotation as! custompointannotation).ustanova anview!.canshowcallout = true } else { anview!.annotation = annotation } //set annotation-specific properties **after** //the view dequeued or created... let cpa = annotation as! custompointannotation anview!.image = uiimage(named:cpa.image...

haskell - Parsing with Happy: left-recursion versus right-recursion -

section 2.2 of happy user manual advises use left recursion rather right recursion, because right recursion "inefficient". they're saying if try parse long sequence of items, right recursion overflow parse stack, whereas left recursion uses constant stack. canonical example given is items : item { $1 : [] } | items "," item { $3 : $1 } unfortunately, means list of items comes out backwards. now it's easy enough apply reverse @ end (although maddeningly annoying have everywhere parser called , rather once it's defined ). however, if list of items large, surely reverse also going overflow haskell stack? no? basically, how make can parse arbitrarily-large files , still results out in correct order? if want entire items reverse d every time, can define items : items_ {reverse $1} items_ : item { $1 : [] } | items_ "," item { $3 : $1 } reverse won't overflow stack. ...

c# - How to dynamically create drop down lists and enumerate them at view? asp.net MVC 5 -

i want create drop down list in foreach loop, , send list of drop downs view , enumerate them there. how can accomplish that? view bags hold one, instance have 3 location drop down lists, want loop through country, region, city, , create drop down each , send them view. note: it's not 3 locations, locations added dynamically pointer parent id, have list of parent locations final selected location (in example have city, , want backtrack country while creating appropriate drop down lists) i'm using asp.net mvc 5 thanks comments, solved issue using ajax track parent ids instead of using multiple drop downs , sending them view.

c# - Repository with Multiple Entities Creating a DTO -

doing c# code review here, , noticed developer doing join 5 additional tables, , inline iqueryable projection dto. tables being joined in repository user , appointment , communicationpreference , userproduct , , product . didn't design system, , i'm simplifying somewhat, let's go now. using entity framework , web api. this little long apologize, curious hear others' thoughts on matter. so these tables relate in each user has list of upcoming service appointments service products. userproduct table shows relationship between product , user, , product table shows kinds of products. communicationpreference deals how want contacted things when service due, if coming service product, how want contacted (phone email text etc). so developer joins these tables in repository itself, , creates dto called "userserviceoverviewdto" returned controller , front end , has information display in grid customer representative (who user is, upcoming appointments, produc...