Posts

Showing posts from July, 2011

c - Why doesn't CGo recognize my struct declared in a header file? -

i getting error "./test.h:10:3: error: unknown type name 'process'" when include header file test.h has struct definition process part of c go lang application. code compiles in c no problems imagine i'm doing simple incorrectly... package main // #include <sys/mman.h> // #include <errno.h> // #include <inttypes.h> // #include <stdlib.h> // #include "test.h" import "c" import ( "fmt" _"unsafe" ) func main() { fmt.println("retrieving process list"); } the contents of test.h below... #include <sys/mman.h> #include <errno.h> #include <inttypes.h> #include <stdlib.h> struct process { char *name; int os_type; addr_t address; process *next; //fields care unsigned int uid; unsigned int gid; unsigned int is_root; unsigned int io_r; unsigned int io_wr; unsigned int io_sys_r; unsigned int io_sys_wr;

apache - Enable rewrite to internal sub folder and add slashes to access files -

i need enable htaccess rewrite url sample bellow: home http://test.com/ -> /view/template/index.php rewritebase /view/template/ rewrite other file or directory css/ js sample content url http://test.com/post/12345 -> /view/template/post.php?id=12345 i try rewriteengine on # rewrite default theme dir rewriterule ^(.*)$ /app.view/assis/$1 [l,nc] rewriterule ^(.*) $1 [l] rewriterule ^post/$ /app.view/assis/post.php?id=31 [l] can us! i don't think following rule useful @ all: rewriterule ^(.*) $1 [l] as question, try: rewriterule ^/?$ /app.view/template/index.php [l] rewriterule ^post/(\d+)/?$ /view/template/post.php?id=$1 [l]

ios - Animate UIView with the default UINavigationInteractiveTransition interactive -

in app animate uiview along default uinavigationinteractivetransition . it's working charm when don't use interactive pangesture . is there way react current state of interactive animation via uiviewcontrollertransitioncoordinator ? for implementation details see playground created: //: playground - noun: place people can play import uikit import xcplayground class customnavigationcontroller: uinavigationcontroller { var customview: uiview! override func viewdidload() { customview = uiview(frame: cgrect(x: 0, y: 400, width: 300, height: 300)) customview.backgroundcolor = uicolor.redcolor() view.addsubview(customview) } } class customviewcontroller: uiviewcontroller { var dismissbutton: uibutton! dynamic func dismisscustomviewcontroller() { navigationcontroller?.popviewcontrolleranimated(true) } override func viewwilldisappear(animated: bool) { super.viewwilldisappear(animated) trans

android - Broadcasting intents from a remote process service -

i have service defined run on it's own process: <service android:name="com.package.myservice" android:enabled="true" android:process=":remote"> and have class runs service: intent intent = new intent(context, myservice.class); intent.setaction(constants.action); context.startservice(intent); i trying broadcast intent as following: intent broadcastintent = new intent(receiver); broadcastintent.setaction(action); broadcastintent.putextra(data, msg); sendbroadcast(broadcastintent); here declare receiver: private final broadcastreceiver receiver = new broadcastreceiver() { @override public void onreceive(context context, intent intent) { //dosomething }; but seems onreceive never called

video - FFmpeg concatenation, no Audio in Final Output -

i have following command working in ffmpeg, adds 1 second of black frame beginning of video. however, lose audio original video in output video. how can adjust command make sure original audio stays final output, or better yet, there 1 second of "blank" audio @ beginning matches new output video. ffmpeg -i originalvideo -f lavfi -i color=c=black:s=1920x1080:r=25:sar=1/1 -filter_complex "[0:v] setpts=pts-startpts [main]; [1:v] trim=end=1,setpts=pts-startpts [pre]; [pre][main] concat=n=2:v=1:a=0 [out]" -map "[out]" finaloutputvideo.mp4 you need generate or add audio associated black video because each concatenated section needs same number of video , audio streams. ffmpeg \ -i originalvideo \ -f lavfi -i color=c=black:s=1920x1080:r=25:sar=1/1:d=1 \ -t 1 -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 \ -filter_complex \ "[0:v]setpts=pts-startpts[mainv]; \ [0:a]asetpts=pts-startpts[maina]; \ [1:v][2:a][mainv][maina]concat=

wpf - Binding to ViewModel with ControlTemplate -

i'm using dockpanel . <dockpanel> <frame x:name="_mainframe"> <frame.template> <controltemplate targettype="{x:type frame}"> <dockpanel margin="7"> <stackpanel margin="7" orientation="horizontal" dockpanel.dock="top"> <button margin="5" content="avast! go back!" command="{x:static navigationcommands.browseback}" isenabled="false" /> <button margin="5" content="{binding buttonforwardtext}" command="{x:static navigationcommands.browseforward}" isenabled="false" width="52" /> </stackpanel> <border borderbrush="black" borderthickness="2" padding="7" cornerradius="4">

android - Activity back stack button from push intent -

when click push notification(from app), intent trigger , open message activity. stack arrow close app in way. how add appropriate activity stack / flag use return previous activity (not close app), there necessary override onnewintent()? thanks you can either add parent activity have deep linked in manifest, or can add state when starting activity. manifest: <application ... > ... <!-- main/home activity (it has no parent activity) --> <activity android:name="com.example.myfirstapp.mainactivity" ...> ... </activity> <!-- child of main activity --> <activity android:name="com.example.myfirstapp.displaymessageactivity" android:label="@string/title_activity_display_message" android:parentactivityname="com.example.myfirstapp.mainactivity" > <!-- meta-data element needed versions lower 4.1 --> <meta-data android:name="android.support.parent_activit

python - Airflow: How to SSH and run BashOperator from a different server -

is there way ssh different server , run bashoperator using airbnb's airflow? trying run hive sql command airflow need ssh different box in order run hive shell. tasks should this: ssh server1 start hive shell run hive command thanks! i think figured out: create ssh connection in ui under admin > connection. note: connection deleted if reset database in python file add following from airflow.contrib.hooks import sshhook sshhook = sshhook(conn_id=<your connection id ui>) add ssh operator task t1 = sshexecuteoperator( task_id="task1", bash_command=<your command>, ssh_hook=sshhook, dag=dag) thanks!

java - GoogleMap object is null in AppCompatActivity -

this question has answer here: google maps returning null pointer exception 3 answers i have activity want display map. thus, use mapview along googlemap object so. however, got null object error in maps activity when trying change map type of map. have read topics on such problem problem persists. public class maps extends appcompatactivity { private googlemap map; private mapview map_view static final latlng hamburg = new latlng(53.558, 9.927); static final latlng kiel = new latlng(53.551, 9.993); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.maps); log.i("debug", "dans maps"); // mapview display further display clicked place map_view = (mapview)findviewby

Python extract italic content from html -

i trying extract 'italic' content pdf in python. have converted pdf html can use italic tag extract text. here how html looks like <br></span></div><div style="position:absolute; border: textbox 1px solid; writing-mode:lr-tb; left:71px; top:225px; width:422px; height:15px;"><span style="font-family: ttpgfa+symbol; font- size:12px">•</span><span style="font-family: yuwtqx+arialmt; font- size:14px"> kornai, janos. 1992. </span><span style="font-family: pucjzv+arial-italicmt; font-size:14px">the socialist system: political economy of communism</span><span style="font-family: yuwtqx+arialmt; font-size:14px">. this how code looks: from bs4 import beautifulsoup soup = beautifulsoup(open("/../..myfile.html")) btags = [] in soup.findall('span'): btags.append(i.text) i not sure how can italic text. try this: from bs4 import be

c++ - Feed std::vector<unsigned char> from unsigned char * -

i have write piece of code: unsigned char *buffer = ... ... std::vector<unsigned char> vec(buffer,128); this works feed vector after declaration (suppose vector field of class) unsigned char *buffer = ... ... std::vector<unsigned char> vec; ... vec = vec(buffer,128) ??? i not know on last line. thing works resize vector memcpy. there better way? well, move semantics, can do vec = std::vector<unsigned char>(buffer, buffer + 128); if ruffles feathers, can use std::copy std::back_inserter : vec.reserve(128); std::copy(buffer, buffer+128, std::back_inserter(vec)); another option use vector::assign .

iTunes Connect and Xcode 8: your app has changed to invalid binary -

last week, xcode 7, able upload without issue. today getting message app has changed invalid binary. i have seen xcode 8 new icon 20x20 2x , 3x added. added one, still getting error. does had similar problem? Сheck email! in case, wasted lot of time because did not check email. when such error, apple sends email it's description. for example, apple sent me: "this app attempts access privacy-sensitive data without usage description. app's info.plist must contain nscamerausagedescription key string value explaining user how app uses data."

Ignoring duplicate entry at table records 130045, No further warning will be generated in this table in lookup of datastage -

when datastage run seeing warning ignoring duplicate entry @ table record 130045,no further warning generated in table, so number 130045 means , how resolve issue these warnings shown if duplicates reference link in lookup. problem in case might hit wrong "duplicate". make sure reference data duplicate free regarding lookup key. otherwise provide more information job structure , stages used.

Upgrade sqlite database file -

i use sqlite database in .net application, , need upgrade database version 3.8.x 3.8.y. there no problem newly createad database create updated sqlite .dlls, existing files? thanks! you have no problem because according offical website , sqlite maintains backwards compatibility: the sqlite database file format stable. releases of sqlite version 3 can read , write database files created first sqlite 3 release (version 3.0.0) going 2004-06-18. "backwards compatibility". developers promise maintain backwards compatibility of database file format future releases of sqlite 3.

javascript - Trouble displaying Native Ads in Mobile Web in AngularJS view -

in angularjs application attempting add facebook native web ad 1 of views. followed steps outlined in documentation generate necessary html snippet , added view. my application using ui-router resolve routes. when visiting route/view containing code snippet fb ad not displayed , neither of callbacks invoked (onadloaded or onaderror). facebook generated html snippet (added view): <div style="display:none; position: relative;"> <iframe style="display:none;"></iframe> <script type="text/javascript"> var data = { placementid: 'xxxxxxxxxxx_xxxxxxxx', format: 'native', testmode: true, onadloaded: function (element) { console.log('audience network ad loaded'); element.style.display = 'block'; }, onaderror: function (errorcode, errormessage) { console.log('audi

swift3 - Parsing JSON using Swift 3 -

i have json data want consume in swift 3. i'm learning swift , building basic app displays list of items in tableuiview json. { "expertpainpanels" : [ { "name": "user a", "organization": "company a" }, { "name": "user b", "organization": "company b" } ] } i'm trying data using swift 3. if (statuscode == 200) { do{ let json = try? jsonserialization.jsonobject(with: data!, options:.allowfragments) // [[string:anyobject]] /* if this: let json = try? jsonserialization.jsonobject(with: data!, options:.allowfragments) as! [string:any] if let experts = json?["expertpainpanels"] as! [string: any] { "initializer conditional binding must have optional type, not '[string: any]'" */ // type 'any' has no subscript members. if let experts = json["exp

convert a STRING from LPCWSTR and vice verca c++ -

i want compare lpcwstr value ensure they're equal. , can't figure out how compare it. create string value , tried various conversions nothing worked. be: request->id // lpcwstr value string str = "value" // string value want compare if (request->id != str) { //something } enable mfc/atl , use cstring object: if (cstring(request->id) != str) although it's not clear me type string either. use cstring both: string str = "value" // string value want compare if (cstring(request->id) != str) or use literal directly: if (cstring(request->id) != "value")

jsonschema - Create JSON schema based on a json object -

given following json object, how can build json schema? product1, product2 , product3 dynamic "keys" , have many more that, each of them have same "value" object required keys packageid1, packageid2, packageid3 , corresponding values strings. { "product1": { "packageid1": "basicpackage", "packageid2": "basicpackage", "packageid3": "basicpackage" }, "product2": { "packageid1": "newpackage", "packageid2": "newpackage", "packageid3": "newpackage" }, "product3": { "packageid1": "thirdpackage", "packageid2": "thirdpackage", "packageid3": "thirdpackage" } } i think figured how it. in case interested, answering own question. also, welcome better suggestions. { "title": "json schema fulf

OneLogin - How can I retrieve user password needed for 3rd party API calls? -

we're using onelogin w/active directory achieve single sign on saml enabled 3rd party application. additionally perform api calls related 3rd party app. api calls require 'basic authentication' header depend on 3rd party app's username , password being available. possible retrieve username/password information through onelogin saml integrated application? from understand, apps integrated via saml or oauth not store passwords onelogin. means cannot them in our integrated active directory (they encrypted anyway). however... if during user provisioning, force 3rd party accounts have same username/password onelogin account... might work? any assistance or suggestions appreciated. have flexibility work here have not yet created onelogin or 3rd party accounts. passwords not provided saml protocol. you find thread interesting: saml assertion username/password - messages like? alternatives: use saml on api calls (oauth2 saml2 token). when pr

wcf - Adding some customBinding properties to a netTcpBinding -

i have tcp config looks this. <nettcpbinding> <binding name="bindingconfig" maxreceivedmessagesize="2147483647" sendtimeout="10675199.02:48:05.4775807" closetimeout="10675199.02:48:05.4775807" opentimeout="10675199.02:48:05.4775807" receivetimeout="10675199.02:48:05.4775807"> <security mode="message"> <transport clientcredentialtype="windows" /> <message clientcredentialtype="windows" /> </security> <readerquotas maxdepth="2147483647" maxstringcontentlength="2147483647" maxarraylength="2147483647" maxbytesperread="2147483647" maxnametablecharcount="2147483647" /> <reliablesession inactivitytimeout="10675199.02:48:05.4775807" /> </binding> </nettcpbinding> i need add keys avail in cust.

Convert C# DateTime to C++ std::chrono::system_clock::time_point -

i need, in c++/clr code, convert datetime coming c# c++ std::chrono::system_clock:time_point equivalent. will code job os there better way ? std::chrono::system_clock::time_point convertdatetime(datetime datetime) { int32 unixtimestamp = (int32)(datetime.utcnow.subtract(new datetime(1970, 1, 1))).totalseconds; std::chrono::system_clock::time_point ret = std::chrono::system_clock::from_time_t(unixtimestamp ); return ret; } i don't think code works, though don't have datetime available test (i'm not on windows). utcnow "static" function returns current expressed "the current utc time", means: time duration past 1970-01-01 00:00:00 utc. believe formulation independent of value of parameter datetime . i recommend trafficking in terms of datetime.ticks number of 100-nanosecond ticks past 1900-01-01 00:00:00 utc utc defined proleptically. using free, open source, header-only library , can find difference between dateti

osx - Mac Terminal insert [ ] at start and beginning -

Image
updated os x on mac. using mac default terminal app.i start noticing add [ ] @ start , end of new line time , go away. not able capture that. keep [ , ] when use python. can see on screen shot. not happening if use iterm2. don't know that.

How to convert a PNG to BGR 565 format using ImageMagick -

i'm trying use image magick convert png file bgr 565 bitmap image. i've done fair amount of research , haven't been able come answer. can me out? compile c program , install in search path "rgbtobgr565" /* rgbtobgr565 - convert 24-bit rgb pixels 16-bit bgr565 pixels written in 2016 glenn randers-pehrson <glennrp@users.sf.net> extent possible under law, author has dedicated copyright , related , neighboring rights software public domain worldwide. software distributed without warranty. see <http://creativecommons.org/publicdomain/zero/1.0/>. use imagemagick or graphicsmagick convert 24-bit rgb pixels 16-bit bgr565 pixels, e.g., magick file.png -depth 8 rgb:- | rgbtobgr565 > file.bgr565 note 16-bit pixels written in network byte order (most significant byte first), blue in significant bits , red in least significant bits. changlog: jan 2017: changed bgr565 int unsigned short (suggested

office365 - Write to Public calendar in 365 from SQL Server 2016 -

we hoping write public calendar within our office 365 tenant operating hours of our business. hours originated within sql server (now updated 2016). hoping can graph api haven't seen explicit docs on put endpoints shared calendar objects. are these resources readily available or roadblock issue? this work in progress, , update thread when access calendars other signed-in user's calendars available through microsoft graph.

javascript - clearTimeout vs setInterval -

i have wordpress site made plugin slider for. i want pause settimeout on hover , resume or reset on mouseout. my code has gotten little messy have been adding things go. i think should've used setinterval method, i'm not sure. the site @ ** and here .js file: $(document).ready(function(){ addactive(); }) function addactive(){ $time = constants.transition; $delay = constants.delay+'000'; $control = constants.control; var $change = $($control); console.log($time); console.log($delay); console.log($control); var $slider = $('.slider-plus'); var $value1 = $slider.find('li:nth-child(1) .sas-values').html(); $('.slider-plus li:nth-child(1)').addclass('active').css({'z-index':'1','opacity':'1'}); $change.html($value1); settimeout(translate1, $delay); function translate1(){ var $change = $($control); var $value2 = $slider.find('li:nth-child(2) .sas-values').html(); $sli

cocoa - How to insert emoji into NSTextView without shifting the line down? -

Image
how insert emoji nstextview without moving line down? if insert emoji character nstextview , whole line shift down couple pixels. if remove emoji character, move original position. on other hand, if insert emoji nstextfield , line doesn't move @ all, when text in line same font , size in nstextview . you can see behavior in textedit. when typing in main editor area (an nstextview ), emoji make lines move down. when typing in find search bar ( nstextfield ) emoji don't affect line position. i've tried setting typingattributes various nsparagraphstyle settings ( lineheight , linespacing , lineheightmultiple , max/minlineheight ) , raising or lowering baseline no avail. in fact, of these settings don't emoji behavior, mess vertical alignment of spelling error indicators.

datagridview - ASP.net GridView Handle Sorting -

i have following , i'm not sure how implement sorting function on gridview? data , paging work fine. not sure how handle sorting method? want sort columns asc , desc. public partial class inlinksauthgrid : system.web.ui.page { protected void page_load(object sender, eventargs e) { registerasynctask(new pageasynctask(loadsomedata)); } public async task loadsomedata() { try { var client = new webclient(); client.credentials = new networkcredential("test", "test"); var myinlinks = client.downloadstringtaskasync("http://inlink-xxxxxx.net:5000/inlinks"); await task.whenall(myinlinks); var links = jsonconvert.deserializeobject<rootobject>(await myinlinks); gridview1.datasource = links.inlinks; gridview1.databind(); } catch (exception ex) { //todo: } } protected v

Firebase chat notifications via PHP to SMS + EMAIL -

we have firebase chat application (check chat example or tutorial) have same copy our. we sent email notification or sms message, if user hasn't seen chat message yet. we can connect firebase database php , check messages, if seen or not. it's not proper way of doing it. does have idea how can implement that, can track of messages , if haven't seen it, sent email / sms notification based on user preference? i want know how can firebase. if php , mysql. easy this. not sure if can done efficiently in firebase. have setup cron job fetch messages not seen , trigger sms/email fallback. i recommend using applozic ( https://www.applozic.com ) chat related stuff , firebase storing user meta data , other data. applozic provides single click configuration enable webhook/sms/email fallback, along whatsapp chat features along full ui no need write additional code.

unix - Using Contiguous Memory of C Struct Members -

before mark duplicate, please read question. so may potentially stupid question bothering me. know, reading, many other questions fields in struct in c not guaranteed contiguous due padding added compiler. example, according c standard: 13/ within structure object, non-bit-field members , units in bit-fields reside have addresses increase in order in declared. pointer structure object, suitably converted, points initial member (or if member bit-field, unit in resides), , vice versa. there may unnamed padding within structure object, not @ beginning. i working on writing program similar unix readelf , nm fun , involves lot of work dealing bytes @ specific offsets file read values. example, first 62 bytes of object file contains "file header". file header's bytes 0x00-0x04 encode int, while 0x20-0x28 encode pointer etc. however, noticed in original implementation of readelf.c programmer this: first, declare struct (lets call elf_h) fields corresponding th

angular promise - AngularJs controller value doesn't update after factory resolve -

i'm trying build user page shows it's main data, details, address, etc.. when make first load, doesn't show on screen until change page , go user page. it's problaby because of promise return after went page. i can't (don't want to) use data loaded during resolve on statechange because make app feels freezing, since change screen after data resolved , , if take time, seems page isn't working. i tried using $scope.$digest() (on controller ) , $rootscope.$apply() on factory , both situations give me digest running error. using .then() isn't option (unless there proper way) because if i'm returning page after first load, there errors. the way i'm loading parent (abstract) controller , storing values in factory , this: //parent controller function parentcontroller(requestfactory, storefactory, $q) { var user = storefactory.userget(), data = storefactory.dataget() [...more load...]; if(!user || !d

SQL subquery on how to distinguished what has been ordered -

Image
i need list books @ least 4 copies have been ordered bookstore , copies may come multiple orders. not understanding how copies when don't see field close that. here pic of tables , fields i'm working with. select t2.title,t3.qty books t2 join ( select t1.isbn,t1.sum(quantity) qty orderlines t1 group t1.isbn) t3 on t2.isbn=t3.isbn t3.qty >= 4

javascript - Get shared OneDrive documents using Microsft Graph and OneDrive JS SDK -

the microsoft graph can provide list items shared signed-in user . want integrate rest functionality onedrive file picker javascript v7.0 sdk. goal of integration use onedrive sdk open view of documents shared signed in user. as first step hoping give guidance on advanced options can add following code in order integrate microsoft graph calls onedrive integration. var odoptions = { clientid: "insert-app-id-here", action: "share | download | query", multiselect: true, openinnewwindow: true, advanced: {}, success: function(files) { /* success handler */ }, cancel: function() { /* cancel handler */ }, error: function(e) { /* error handler */ } } unfortunately, onedrive js sdk not support showing shared files in view far. want build view yourselves depending on story. assuming have valid graph access token, means files.read in scope, can make request https://microsoft.graph.com/v1.0/me/drive/view.sharedwithme more info graph: http:/

jquery - How to get HTML5 video to take up full height and width of browser window? -

i need video take full width , height of browser on first page load, using bootstrap. how achieve this?: the following code kind of it, height more 100% of browser. want able scroll down text underneath, video showen @ top. demo html, body { height: 100%; } #homepage-video { height: 100%; width: 100%; } <div class="container-fluid"> <div class="row"> <video id="homepage-video" autoplay="true" loop="true" > <source src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4" type="video/mp4" /> browser not support html5 videos. </video> </div> </div> <div class="container"> // text in here.... </div> you can set via jquery, include jquery library , add below code $(function(){ $('video').css({width:$(window).width(), height:$(window).heigh

php - Symfony 2.7.18 throws "Unknown 'truncate' filter" error in prod but not in dev -

i learning symfony, coming laravel background. far have found bit quirky, least. ran strange issue , wanted know if has seen this. i use http://myapp.local/web/app_dev.php route can see dev toolbar , more verbose error messaging. 1 thing noticed when use prod route: http://myapp.local/web/app.php following error: unknown "truncate" filter in "post/post.html.twig" @ line 12 the offending line is: <p> {{ post.body | truncate(400) }} </p> why line of code work in dev not prod? i've tried messing cache, etc. nothing seems work. neither app.php nor app_dev.php file has been modified. check if have in services.yml: services: twig.extension.text: class: twig_extensions_extension_text tags: - { name: twig.extension }

Java IO: Resource file getting modified in IDE but not in jar -

this question has answer here: how can app use files inside jar read , write? 5 answers i able read , write file in eclipse. able read file in jar. however, not able write file in jar. located in class folder called res. have unzipped jar file , contains file need write not modified after first run. how can this? i have tried bufferedwriter , printwriter no effect. tried using fileoutputstream cannot construct using getclass().getresourceasstream(path) returns inputstream . jar archive, not supposed write file of jar. write file outside , create jar later.

javascript - Map class in typescript giving an error -

i getting error saying "cannot find name map" in typescript . var mymap = new map(); var keystring = "a string", keyobj = {}, keyfunc = function () {}; // setting values mymap.set(keystring, "value associated 'a string'"); mymap.set(keyobj, "value associated keyobj"); mymap.set(keyfunc, "value associated keyfunc"); mymap.size; // 3 // getting values mymap.get(keystring); // "value associated 'a string'" mymap.get(keyobj); // "value associated keyobj" mymap.get(keyfunc); // "value associated keyfunc" mymap.get("a string"); // "value associated 'a string'" // because keystring === 'a string' mymap.get({}); // undefined, because keyobj !== {} mymap.get(function() {}) // undefined, because keyfunc !== function () {} i dont understand why not considering moreover have map in javascript

html - Getting background image to scroll -

i'm running background video when visitors enter landing page. scroll down page video stays in place change video scrolls out well. i'm not sure how that. here css: video#bgvid { position: fixed; top: 50%; left: 50%; min-width: 100%; min-height: 100%; width: auto; height: auto; z-index: -100; -ms-transform: translatex(-50%) translatey(-50%); -moz-transform: translatex(-50%) translatey(-50%); -webkit-transform: translatex(-50%) translatey(-50%); transform: translatex(-50%) translatey(-50%); background: url() no-repeat; background-size: cover; } .video-container { min-height: 100vh; } .video-container-bg { padding-top: 45vh; color: #fff; } and here html uses it: <div class="video-container"> <div class="video-container-bg"> <video playsinline autoplay muted loop poster="{{page.image.url}}" id="bgvid"> <source

AngularJs website templates not opening in Internet Explorer -

when open angularjs website in internet explorer gives warnings (html 1300 navigation occured) , errors somecontroller got undefined. website working fine chrome , firefox. problem ie , safari code sample $scope.loadmoresubcat = function (pageno = 2) { blockui.stop(); $http.get(apiurl).success(function (data) { $http.get(apiurl).success(function (data) { if (data.length) { angular.foreach(data, function (value, key) { $scope.listings.push(value); }); $scope.busy = false; } else { $scope.busy = true; $('#status').html('no more listings'); } }).error(function (err) { $('#status').html('no more listings'); }); pageno++; $rootscope.pageno = pageno; } } you using es6 feature "default parameters", not implemented in ie. function( pageno =2) {} https://kan

javascript - How do I stop my menu from saving its state in the URL? -

i have menu when click on goes /#0 of page indicate has been opened, i'm wondering how either prevent showing or find alternative way of opening menu. here's menu trigger html: <header class="cd-header"> <a href="#0" class="cd-3d-nav-trigger"> menu <span></span> </a> </header> and full javascript file can found here jquery(document).ready(function($){ //toggle 3d navigation $('.cd-3d-nav-trigger').on('click', function(){ toggle3dblock(!$('.cd-header').hasclass('nav-is-visible')); }); //select new item 3d navigation $('.cd-3d-nav').on('click', 'a', function(){ var selected = $(this); selected.parent('li').addclass('cd-selected').siblings('li').removeclass('cd-selected'); updateselectednav('close'); }); $(window).on('r

ios - RegisterForRemoteNotifications throws com.apple.UNSNotificationRegistrarConnection -

the app called following methods register push notification when app launched [[uiapplication sharedapplication] registerusernotificationsettings:[uiusernotificationsettings settingsfortypes:(uiusernotificationtypebadge | uiusernotificationtypesound | uiusernotificationtypealert) categories:nil]]; [[uiapplication sharedapplication] registerforremotenotifications]; however there small chance app throw following exception when executes registerforremotenotifications crashed: com.apple.unsnotificationregistrarconnection exc_bad_access kern_invalid_address it difficult reproduce , not happens. know root cause of issue? many thanks.

html - Bootstrap CSS Grid Customize -

i wanted create image grid 1 full image on left , 4 thumbnail images on right of big image. i've done here: https://codepen.io/ashwindkini/pen/qabrok <div class="container"> <div class="row"> <div class="col-md-6"> <img src="https://placehold.it/450x450" alt="" /> </div> <div class="row"> <div class="col-md-3"> <img src="https://placehold.it/450x450" alt="" class="img-responsive" /> </div> <div class="col-md-3"> <img src="https://placehold.it/450x450" alt="" class="img-responsive" /> </div> <div class="col-md-3"> <img src="https://placehold.it/450x450" alt="" class="img-responsi

javascript - $_POST without refreshing -

i got associative array use generate images. these images want select 2 or more pictures 1 random. code works got 2 questions: how can improve code? , how can use json or else site doesn't refresh after submit? <style> .check { opacity: 0.5; color: #996; } </style> <script> function getrandomint( min, max ) { return math.floor( math.random() * (max - min + 1) ) + min; } function debug() { console.log( $( "img.check" )[0] ); } $( document ).ready( function() { $( "form" ).submit( function() { var images = $( "img.check" ); if( images.length > 0 ) { $( "input[name=images]" ).attr( "value", $( images[getrandomint( 0, images.length )] ).data( "id" ) );

Error "pkg_resources.DistributionNotFound: Django==1.9" when startproject -

i have problem when try create new project. happens after updating django 1.8 version 1.9. when use command: django-admin.py startproject myproject i've got error: commanderror: /var/www/myproject/manage.py exists, overlaying project or app existing directory won't replace conflicting files when type command: django-admin startproject myproject i've got error: traceback (most recent call last): file "/usr/local/bin/django-admin", line 5, in <module> pkg_resources import load_entry_point file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2749, in <module> working_set = workingset._build_master() file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 446, in _build_master return cls._build_from_requirements(__requires__) file "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 459, in _build_from_requirements dists = ws.resolve(reqs, environment()) file &q

php - Total Import Pro Prestashop Error -

hi use total import pro , cant import csv file. there error - no idea if there problem on module, prestashop or webhosting warning: invalid argument supplied foreach() in /data/web/virtuals/130258/virtual/www/domains/napilu.cz/modules/totalimportpro/totalimportpro.php on line 2107 warning: cannot modify header information - headers sent (output started @ /data/web/virtuals/130258/virtual/www/domains/napilu.cz/modules/totalimportpro/totalimportpro.php:2107) in /data/web/virtuals/130258/virtual/www/domains/napilu.cz/classes/tools.php on line 252 all can see code 2107 line error, have effect of planting page. without seeing code in question it's going complicated help. regards,