Posts

Showing posts from August, 2015

sql server - How to find out how many times identity column is RESEEDED -

i using sql server 2008 r2, can reset identity using dbcc reseed command, or using truncate table statement. is there information stored how many times identity value of column has been reseeded? you can not information sql server. once reseed updated. more details check link

javascript - Toggling two CSS animations with jQuery only works once through -

i trying toggle between 2 css animations using jquery, work once! how can keep toggling? also, doesn't seem work in jsfiddle @ reason. please , thank you. //hide , show counter-button $('#counter-button').click(function() { $('#counter').toggle(); //move button down/up on click if ($('#counter-button').attr('class') === 'movedown') { $('#counter-button').addclass('moveup'); } else { $('#counter-button').addclass('movedown'); } }); #counter-button { font-size: 20px; position: fixed; right: 90px; bottom: 190px; z-index: 2; cursor: pointer; } .movedown { animation: down ease forwards 0.5s; } @keyframes down { { right: 90px; bottom: 190px; } { right: 90px; bottom: 100px; } } .moveup { animation: ease forwards 0.5s; } @keyframes { { right: 90px; bottom: 100px; } { right: 90px; b

django - Set field as the second field of my form -

i use django-allauth. how can set item_name form field second field of form?(currently first field after rendering in html) class customsignupform(forms.form): item_name = forms.charfield(...) def signup(self, request, user): pass account_signup_form_class = 'app.forms.customsignupform'

java - Data from list of objects of model class is not retrieving correctly? -

when try retrieve single object listconcard (in activity class contactcard.class), "conname" contactcards receives correctly not getting correct data sibling arrays "conphonetype", "conphonevalue", "conemailtype", "conemailvalue". listconcard list of objects of model class contactcardmodel.class. i adding "contactcardmodel" objects in listconcard follows listconcard.add(new contactcardmodel(conname, conphonetype, conphonevalue, conemailtype, conemailvalue)); and retrieving data of "contactcardmodel" objects follows for(int = 0; < listconcard.size(); i++){ log.e("inadp", listconcard.get(i).getconname()); // name returing correctly. for(int x = 0; x < listconcard.get(i).getconphonetype().size(); x++) log.e("inadp conphone", listconcard.get(i).getconphonetype().get(x) + ": " + listconcard.get(i).getconphonevalue().get(x)); for(int x = 0; x <

node.js - POST request 404 (Not Found) - express-http-proxy -

Image
i'm trying send post request api gives me following error: i'm using express-http-proxy package node send request. here code: app.use('/api', proxy(targeturl, { forwardpath: (req, res) => { return require('url').parse(req.url).path; } })); in reactjs application, i'm using superagent pass request , here request creation code: methods.foreach((method) => this[method] = (path, data = {}, params = {}) => new promise((resolve, reject) => { const request = superagent[method](formaturl(path)); request.set('token', 'cb460084804cd40'); if (params) { request.query(params); } if (__server__ && req.get('cookie')) { request.set('cookie', req.get('cookie')); } if (data) { request.send(data); } console.log('sending: ', request); // request.end((err, { text } = {})

java - My Second Activity [TabLayout] Not Supporting on all other device -

i beginner of android development.i planed create application helps education seeker of country.at posting time have created 2 activity. first activity created listview. , second activity created tablayout contains 3 fragments. when launched app on lollipop device,all activity working fine.but when launched on marshmallow device,first activity working when clicked on other list item,my apps getting closed automatically.but why??? here important information understood easily. build.gradle apply plugin: 'com.android.application' android { compilesdkversion 25 buildtoolsversion "24.0.2" defaultconfig { applicationid "waystoprogram.mcquniversityadmission" minsdkversion 10 targetsdkversion 25 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false

spring - log4j configuration in Hibernate -

i want show sql queries executed ihbernate in logs. this current log4j configuration: <?xml version="1.0" encoding="utf-8" ?> <!doctype log4j:configuration system "log4j.dtd"> <log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'> <appender name="ca" class="org.apache.log4j.consoleappender"> <layout class="org.apache.log4j.patternlayout"> <param name="conversionpattern" value="%d{dd-mm-yyyy hh:mm:ss,sss} [%t] %-5p %c %x - %m%n" /> </layout> </appender> <root> <level value="info" /> <appender-ref ref="ca" /> </root> <logger name="org.hibernate.sql" additivity="false"> <level value="debug" /> <appender-ref ref="ca" /> </logger> <logger name="org.hibernate.hql" additivity="false"&

sql - mysql "paste" two results together (side by side) -

i want paste command in unix, takes 2 files , prints first line, of first file, separator, first line second file, newline, second line first file separator second line second file, etc. so want in sql, take columns 2 tables, output result, columns of first rows (as 1 row) first , second table, second rows both tables etc. without cross join stuff first row first table second row second table etc. possible? hard search on net... edit: table 1: table 2: column bla column cla 80 z 7 f 15 k expected result: column bla, column cla a, 80 z, 7 f, 15 k, null very simple :), except not @ all... edit2: please no @variables create table if not exists first_40482804 ( bla varchar(50) ) ; create table if not exists second_40482804 ( cla int ) ; truncate table first_40482804 ; truncate table second_40482804 ; insert first_40482804 ( bla ) values ('a') ; insert first_40482804 ( bla ) values (&

How to execute a simple Linux cmdline with PHP -

i want execute simple commands via network , process results php. environment: linux mint 18 cinnamon 64 bit vers. 3.0.6 (linux kernel 4.4.0-21-generic) opt/lampp/htdocs/cmd.php <?php //error_reporting(0); error_reporting(e_all ^ e_notice); // execute cmdline $output = array(); exec('/usr/bin/sudo /var/sudowebscript.sh cmd=ifconfig', $output, $return_var); echo $return_var; $response = $_get["callback"]."(".json_encode($output).")"; echo $response; ?> /opt/lampp/etc/php.ini ; safe mode ; http://php.net/safe-mode safe_mode=off /var/sudowebscript.sh #!/bin/bash # # sudo web script allowing user www-data run commands root privilegs case "$1" in cmd=iwconfig) /sbin/iwconfig ;; cmd=ifconfig) /sbin/ifconfig ;; *) echo "error: invalid parameter: $1 (for $0)"; exit 1 ;; esac exit 0 sudo visudo entry # allow members of group sudo execute command %s

sql - If not found insert into -

i initate insert sql incase select not found. code far res, err, errno, sqlstate = db:query("select * stream_session username = " .. quoted_user,0) if not res res1, err, errno, sqlstate = db:query("insert stream_session (username) values (" .. quoted_user .. ")") end it checking if user exists it's not inserting incase user not found.

c# - how to get property details from all nodes in .aspx file -

i have .aspx file (the aspx page in local machine , reading content). in file there different nodes have common property "fieldname". want fetch value of property nodes property available, in form of list or dictionary. fore example if node <div> <pagefieldrichimagefield:richimagefield fieldname="3de94b06-4120-41a5-b907-88773e493458" runat="server"> </pagefieldrichimagefield:richimagefield> </div> i want "fieldname" value. nodes. nodes have property might have different name, there name start <pagefield... note: have entire content of .aspx file in string format of now.so ok if can same kind of string manipulation using normal windows form task , simple c# code cant tell why need field values the .aspx file content this

asp.net mvc - How attach NServiceBus to SQL Server -

i try use nservicebus sql server transport in project. asp.net mvc application. downloaded test example here https://docs.particular.net/samples/sqltransport-nhpersistence/ , use endpoint configuration described in example. code configurate endpoint: var hibernateconfig = new configuration(); hibernateconfig.databaseintegration(x => { x.connectionstringname = "nservicebus/persistence"; x.dialect<mssql2012dialect>(); }); hibernateconfig.setproperty("default_schema", "sender"); var endpointconfiguration = new endpointconfiguration("samples.sqlnhibernateoutboxef.sender"); nservicebus.logging.logmanager.use<defaultfactory>().directory(server.mappath("~/").trim('/') + "/logs"); endpointconfiguration.licensepath(server.mappath("~/").trim('\\').trim('/') + "/license.xml"); endpointconfiguration.useserializati

sql - VBA query a MySQL database -

i'm getting crazy right now. found posts in here it's not working me... what i'm trying have piece of vba code in excel can make query in database select * blabla i'm having problems getting connection! seems examples found bit older. i'm using mysql 5.7. i appreciate lot if can give me easy example our post online tutorial how that. because found code no explanation! if have little bit context code great! because don't have idea vba or making connection mysql databse : set cn = new adodb.connection cn.open "driver={mysql odbc 5.3 unicode driver};server=" & server_name & ";database=" & database_name & _ ";uid=" & user_id & ";pwd=" & password & ";" for example (one thing found). this whole code found ' carl sql server connection ' ' code work ' in vbe need go tools references , check microsoft active x data objects 2.x library '

ios - Alamofire 4.0.1 does not work in Xcode 8.1 -

i updated alamofire latest version (4.0.1) using carthage . working in xcode 8.1 , swift 3.0.1 after update, when try build ios app in xcode error regarding alamofire : module compiled swift 3.0 cannot imported in swift 3.0.1 i've been looking information issue in github , thing found this issue , related warnings when updating alamofire get. has else experienced issue? should work xcode 8.1 , swift 3.0.1 missing something? use command carthage update --platform ios --no-use-binaries this compile alamofire local language (swift 3.0.1). think solve problem

entity framework - Entityframework code based config -

i'm trying rid of app.config entityframework (v6) settings , move code (don't want deploy config connection string , password). following exception thrown on opening: system.data.entity.core.entityexception: underlying provider failed on open. i'm using sqlite3 db encryption , database first entity model. [dbconfigurationtype(typeof(databaseconfiguration))] public partial class testentities : dbcontext { public testentities () : base((databaseconfiguration.getconnectionstring("testentities", @"\\\\abt\01_tools\test\db\test.db", "somedummypw"))) { } protected override void onmodelcreating(dbmodelbuilder modelbuilder) { throw new unintentionalcodefirstexception(); } public virtual dbset<employee> employees { get; set; } } public class sqliteconnectionfactory:idbconnectionfactory { public dbconnection createconnection(string nameorconnectionstring) { return new sqliteco

reactivex - Many observer connected to one observable receive events one at a time -

this how create observable: observable.fromcallable(new eventobtainer()).flatmap(observable::from).subscribeon(schedulers.io()).repeat(); and after that, through http request i'm trying add different observers. thing if have more 1 observer can't predict observer obtain emitted item. why doesn't observable emit item every subscribed observer, 1 item @ time different observers? i resolved this, in observable contract: http://reactivex.io/documentation/contract.html there information: there no general guarantee 2 observers of same observable see same sequence of items. so resolved making observable connectable observable publish, , invoke connect method on it: observable.fromcallable(new eventobtainer()).flatmap(observable::from).subscribeon(schedulers.io()).repeat().publish(); observable.connect(); and if asynchronously add more observers emit obtained item every observers.

sql server - How to rollback database only with MDF and LDF files but without backup file? -

is possible rollback mdf , ldf files without backup file? i worked days it's gone. it's important me. yes, possible, if: your database in full or bulk-logged recovery mode, and you had taken @ least 1 full backup prior point of failure, and there complete chain of transaction log backups since last full backup, or there no transaction log backups since then. what need is: take transaction log backup of database; restore last full backup new database no_recovery option; restore necessary transaction log backups, if any, again no_recovery ; restore recent transaction log backup made in #1 recovery , stopat options. in latter, can specify exact time on want database restored. for full syntax, see restore .

c# - Using same method to download different file -

i'm working on web app i'm using c# , asp.net mvc. on 1 of page have requirement users able download files , fill in relevant data upload them. due users having old machine i'm working .xls , .xlsx . file can downloaded based upon dropdown value user must select. i have 2 buttons 1 .xls , 1 xlsx file. question how can use same backend code swap between files. if .xls clicked user gets .xls file , if other click receive .xlsx file. this code far: public fileresult downloadtemplates(string policytype) { string templatename = string.empty; string basedirectory = "base path"; string templatedirectory = "temnplate directory path"; switch (policytype) { case "administrative": templatename = "admin xls file"; //how can swap between .xls , .xlsx file? break; case "policy": templatename = "policy xls file"; //how can swap between .xls , .xlsx file

android - What's the possible reason of non-custom signed APK (generated via debugging) running fine but the custom signed APK (release) not working? -

this very strange problem me. android app coming end. debugging runs ok many many times without error. runs fine. it's time me build release , publish app. follow steps can found via google easily. in fact signed apk installed ok , app starts ok but if user interacts navigate between screens of app, crashed no reason. not screen switching causes app crash, of them , can notice maybe involves reflection here. design own binding system bind viewmodel behind fragment , using reflection must, no other way. i totally believe not fault in code because the app runs fine in debug mode. , @ time of losing hope publish app, found signed version of apk file in debug folder (that signed version generated if start debugging app run in targeted device - emulator, building in debug mode won't generate file). it's lucky me that signed apk works perfectly. can deploy apk new device , install normally, app runs expectedly. so must wrong releasing process. here info configurati

python - Azure api returns "at least one of the claims 'puid' or 'altsecid' or 'oid' should be present" -

when try access azure api, returns following error. {u'error': {u'message': u"the received access token not valid: @ least 1 of claims 'puid' or 'altsecid' or 'oid' should present. if accessing application please make sure service principal created in tenant.", u'code': u'invalidauthenticationtoken'}} have tried following, endpoint = 'https://management.azure.com/subscriptions/{subscription_id}/providers/microsoft.security/alerts?api-version=2015-01-01' headers = {"authorization": 'bearer ' + access_token} responce = requests.get(endpoint, headers=headers).json() print responce i suggest use azure sdk python, generic "get": example of generic "create" (for kv): https://github.com/azure-samples/resource-magnager-python-resources-and-groups/blob/master/example.py#l54 generic on readthedocs: http://azure-sdk-for-python.readthedocs.io/en/latest/ref/azu

javascript - ExecJS::RuntimeError while implementing Angular Js in Rails -

Image
i trying implement angular js in rails project, following tutorial http://angular-rails.com/bootstrap.html , after going through of steps getting error: i have searched web didn't enough info, somewhere mentioned due node.js, have installed node.js on system. so found solution . problem coffee script, there missing parenthesis, controllers = angular.module('controllers',[]) controllers.controller("recipescontroller", [ '$scope', ($scope)-> ] " ) " missing in above script. thanks reference .

c# - Add foreign key relationship to existing read-only database in Entity Framework -

i have existing database read , cannot alter structure. the tables in database have columns can use join in sql queries, want use entity framework create model these columns linked if foreign keys. is there way create relationship in class structure, if key not present in actual database? with legacy database schema not recommend trying introduce navigation properties , artificial relationship in ef model. if need "related" data in 1 query use manual linq joins or stored procedures join data , map loaded items specialized class.

php - How to pass value from view to modal? -

i have link open modal: <li><a href="#deleteproperty{{$property->id}}" data-toggle="modal"><i class="fa fa-times"></i></a></li> and have modal in seperate page modals.blade.php <div class="modal fade modal_form" id="deleteproperty{{$property->id}}" tabindex="-1" role="dialog" aria-labelledby="examplemodallabel5" aria-hidden="true"> <div class="modal-dialog" role="document"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-label="close"> <span aria-hidden="true">&times;</span> </button>

jquery - how to write a callback function, after the datapicker date selection? -

i using datapicker on field pop out calender . after selection of date using datapicker want execute callback function, in function want set selected date value another field. this currrent code <%= text_field_tag "from_date",date.today.beginning_of_month.strftime("%d-%b-%y") , :class=>"form-control from_picker", :id => "start",'data-behaviour' => 'datepicker',:placeholder =>"from" %> <script type="text/javascript"> $.fn.datepicker.defaults.format = "dd-m-yyyy"; $(document).on("focus", "[data-behaviour~='datepicker']", function(e){ $(this).datepicker({"autoclose": true, onselect: function(selecteddate) { alert(selecteddate); var from_picker = $(".from_picker").val(); $("#d_start").val(from_

google maps - iOS How can I move googlemap marker to the front? -

Image
i added 2 marks on google maps. 2 markers overlapping. want selected marker in front. means when select marker marker covers marker. looked @ google maps development documentation, not provide relevant api. how can this?

virtual machine - Why the docker keeps both image and image container on VM? -

the problem encounter when working large images docker copies data when create container it: having 25gb image , container totally takes 50gb on docker vm. am doing wrong or docker function that? if so, why? e. g. in git may use code directly after clone repo, of time don't need make 1 more additional copy of branch or whatever. p. s. use case following: want keep different versions of mysql database (because changed exclusively developers , happens not often) , because want enable fast restoration (the way mysql allows restoration *.sql file , takes 7 hours - long able play db freely) mysql databases use volumes @ least official image. need 2 containers withe same image using different named volumes: docker create volume devdb docker run --name devdb -v devdb:/var/lib/mysql -p 3306:3306-e mysql_root_password=my-secret-pw -d mysql then you: docker create volume mydb docker run --name mydb -v mydb:/var/lib/mysql -p 3307:3306 -e mysql_root_password=my-secret-pw

animation - Animate component out Angular 2 -

i want animate component in , out while navigating on site. have code: @component ({ moduleid: module.id, selector: 'animated-component', template: '<div [@flyinout]="state"> animated section </div>', animations: [ trigger('flyinout', [ state('in', style({transform: 'translatex(0)'})), transition('void => *', [ style({transform: 'translatex(-100%)'}), animate(1000) ]), transition('* => void', [ animate(100, style({transform: 'translatex(100%)'})) ]) ])] export class animatedcomponent { public state : string; constructor() { this.state = "in"; } } the in animation works, when navigate other component, current component disapears instead of animate out. how can trigger void state correctly?

python 3.x - Xlwings 0.10 ValueError on a read only workbook: "Cannot open two workbooks named foo.xlsm" -

i'm getting error when run xlwings script on read workbook: valueerror: cannot open 2 workbooks named 'foo.xlsm', if saved in different locations. i'm using python 3.5.x , xlwings 0.10. note script works fine if open in non-read workbook. has run issue before?

java - log4j RollingRandomAccessFile rollover when event received -

just quick question couldn't find concrete in log4j documentation. rollingrandomaccessfile behave in same way rollingfileappender in checks rollover when writes events, or difference in buffering affect this? here few snippets config: <policies> <timebasedtriggeringpolicy interval="1" modulate="true"/ <sizebasedtriggeringpolicy size="100 mb" /> </policies> with file pattern of: filepattern="${sys:logging.path}${sys:logging.file}-%d{mm-dd-yyyy}-%i.log.gz"> the rollover behavior of rollingrandomaccessfile same rollingfileappender. note both appenders accept crontriggeringpolicy gives time based rollover trigger.

html5 - The font-size shown in browser is different from the set in css -

Image
i want use meta tag , set css, font-size 30px, when typing more code in tag p, font-size became 38.317px in chrome browser; please tell me why? <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no"> <title>document</title> <style> p{ word-break: break-all; font-size: 30px; } </style> </head> <body> <p>ssssssss</p> </body> </html> i tried code , both chrome , firefox don't change font-size.

ms access - Saving data from a form to table -

this baffling me. i have userform listbox showing in table (connected using rowsource) on form have combo boxes , text boxes, when user updates them want data overwrite whats in table. when click account in list box text/combo boxes populate data, when change come data not save , don't know why. on text/combo boxes have following code save in table: runcommand accmdsaverecord docmd.domenuitem acformbar, acrecordsmenu, acsaverecord, , acmenuver70 me.refresh me.dirty = false any idea why wont save? this alternative code 1 have dim db database dim rec recordset set db = currentdb set rec = db.openrecordset("select * <<insert table name>> <<textbox>>= primary key") rec.edit rec("<<table field name>>") = me.<<form textbox etc>> rec("<<table field name>>") = me.<<form textbox etc>> rec.addnew

c# - issue with using DbContext and returning view with the model -

this question has answer here: the operation cannot completed because dbcontext has been disposed using mvc 4 1 answer i need fetch database , return model if modelstate not valid, seem not able use using , want to. so code works: [httppost] public actionresult editproduct(productvm productvm, httppostedfilebase file) { // check model state if (!modelstate.isvalid) { db db = new db(); productvm.categories = new selectlist(db.categories, "id", "name"); return view(productvm); } return view(productvm); } and code throws following error: the operation cannot completed because dbcontext has been disposed. [httppost] public actionresult editproduct(productvm productvm, httppostedfilebase file) { // check

android - imoji implementation not synincg with gradle -

i trying implement sticker in app link https://developer.imoji.io/#/home#platform-android as as,i add dependency, getting error: warning:module 'com.android.support:recyclerview-v7:24.1.1' depends on 1 or more android libraries jar error:a problem occurred configuring project ':app'. > not find recyclerview-v7.jar (com.android.support:recyclerview-v7:24.1.1). searched in following locations: https://jcenter.bintray.com/com/android/support/recyclerview-v7/24.1.1/recyclerview-v7-24.1.1.jar gradle: dependencies { compile 'testfairy:testfairy-android-sdk:1.3.4@aar' compile filetree(include: ['*.jar'], dir: 'libs') //google play services lib // compile 'com.google.android.gms:play-services:9.2.1' // recommended location services compile 'me.grantland:autofittextview:0.2.1' compile 'com.google.android.gms:play-services-location:9.2.0' compile 'com.google.android.gm

ReactJS: How can I monitor the re-rendering process? -

is there way can keep track of react components being re-rendered? for example, i'm making api call, , upon reply, change state of parent components, child components being re-rendered (am right in one?). how can monitor parent component initiates re-render process , children rendered result (and how many times every component being re-rendered)? i'm aware can inject kind of console.log pattern in every component , monitor browser console, looking more sophisticated solution. you start logging new state or properties in componentwillupdate() life cycle method, called before each render (except first one). https://facebook.github.io/react/docs/react-component.html#componentwillupdate

asp.net - Increment Tablix objects in c# -

i converting crystal reports ssrs reports , converting area sections of crystal reports tablix in ssrs. below code object declaration. tablix tab = new tablix(); tab.name = crsec.objname; tablixbody tabb = new tablixbody(); tablixcolumn tabcol = new tablixcolumn(); tablixrow tabrow = new tablixrow(); tablixhierarchy tcolhier = new tablixhierarchy(); tablixhierarchy trowhier = new tablixhierarchy(); now how can increment these object names in each loop, each object have unique id on each iteration.

angularjs - Change styles of specific column -

i have following declaration of table columns created dynamically: <table> <tr ng-repeat="row in rows"> <td ng-class="{ 'tdhead' : $index == 0 }" ng-repeat="col in row.cols">{{col.val}}</td> </tr> </table> in example ng-class depends on row variable , changes td classes in first row. need change td classes in specific column. there way achieve this? hope helps add below condition in ng-class ng-class="{ 'tdhead' : $index == 0 && $parent.$index == 1 }" var app = angular.module('plunker', []); app.controller('mainctrl', function mainctrl($scope) { $scope.rows = [{ name: "abc1", empid: 10215, cols: ["heading1", "heading2", "heading3"] }, { name: "abc2", empid: 10216, cols: ["heading1", &quo

python libarchive to get mtime of the archive -

i have python libarchive 0.4.3 installed. i'd mtime of 7z file stored inside 7z file. different mtime of file stored locally on disk. let's underlying source c tarball lzma1604.7z. the following program list of files , mtime of that. don't see time entire 7z "tarball" given in 7z file. from libarchive.public import memory_reader open('lzma1604.7z', 'rb') f: buffer = f.read() memory_reader(buffer) archive: entry in archive: print(entry.pathname, entry.mtime) the above program prints: ('asm/arm/7zcrcopt.asm', datetime.datetime(2009, 10, 8, 5, 12)) ('asm/x86/7zasm.asm', datetime.datetime(2012, 12, 30, 3, 41, 54)) ... ('bin/7zsd.sfx', datetime.datetime(2016, 10, 4, 11, 12, 31)) ('bin/lzma.exe', datetime.datetime(2016, 10, 4, 11, 12, 30)) ('bin/x64/7zr.exe', datetime.datetime(2016, 10, 4, 10, 58, 29)) but if run 7z l lzma1604.7z gives @ end: 2016-10-04 10:12:31 ....a

c# - Convert Windows store javascript app into website -

i have simple windows store javascript app, , having problems writing , playback coded ui tests. Аnd had idea: convert win store js app website , test in of plurality of web-frameworks. unfortunately, find information how convert site win store app, , nothing on idea. how can convert windows store javascript app website?? grateful information in matter. how can convert windows store javascript app website?? grateful information in matter. it not documented, it's not difficult convert uwp(js) app web app. need following work on app: copy html,css , javascript(including js libraries) , related assets files newly created web app folder. as there no application lifecycle in web app. need remove/modify lifecycle events in project. (ex: windows.ui.webui.webuiapplication.onactivated event or winjs.application.onactivated event if using winjs). windows runtime apis not available in web app. avoid errors, necessary remove or comment out related codes calls win

html - Align hr vertically behind div with text -

Image
i trying create banner/tittle have line behind main div. want line , text of tittle in middle (vertically) shown : the problem if change size of browser, hr , text not aligned (vertically). below first version : .section { clear: both; padding: 0px; margin: 0px; } .col { text-align:center; display: block; float:left; margin: 1% 0 1% 0%; } .col:first-child { margin-left: 0; } .group:before, .group:after { content:""; display:table; } .group:after { clear:both;} .group { zoom:1; /* ie 6/7 */ } .span_3_of_3 { width: 100%; } .span_2_of_3 { width: 66.66%; } .span_1_of_3 { width: 33.33%; } @media screen , (max-width: 480px) { .col { margin: 1% 0 1% 0%; } .span_3_of_3, .span_2_of_3, .span_1_of_3 { width: 100%; } } #middle { background:#ccc; color:#fc3699; height:100px; margin-top:0; line-height:100px; } hr { margin-top:40px; border:2px solid #fc3699; } <div class="section group"&g

c++ - Changing the build output based on x86/x64 and debug/release Code::Blocks/Xcode -

a little background information think here. in project school building cross-platform libraries use future students. has been mandated use popular ide/compiler per platform targeting. means using visual studio 2015 visual c++ compiler windows, code::blocks gcc linux (ubuntu), , xcode clang mac. we in process of developing test sweet our libraries, have ran of wall. test sweet need know find libraries configurations (x86 debug, x86 release, x64 debug, x64 release). visual studio makes easy because can choose output directories these different builds. code::blocks, on other hand, gives me release , debug build options output directories. xcode whole other issue. gives me 1 option of put output. doesn't care if debug/release or x86/x64. says name folder , i'll put in there. is there way expand these options in code::blocks , xcode? have looked post build scripts move these libraries me, can't figure out how tell in script if libraries build configuration. i'v

Internal server error from YouTube Analytics API -

since yesterday receiving code 500 errors youtube analytics api. nothing has changed in relevant code since few months ago, , went smoothly before yesterday. this sample query (but queries yt analytics fail): https://www.googleapis.com/youtube/analytics/v1/reports?ids=channel%3d%3d<channelid>&metrics=views,averageviewduration,estimatedminuteswatched,comments,likes,dislikes,shares,subscribersgained,subscriberslost&dimensions=channel&start-date=2016-06-01&end-date=2016-06-30&start-index=1 (with appropriate channelid , authorization header set). getting back: { "code": 500, "message": "the remote server returned error: (500) internal server error.", "response": { "error": { "errors": [{ "domain": "global", "reason": "internalerror", "message": "unk

javascript - AngularJS Calling function in controller after data is loaded in another file -

i have function in app.js connects api using promises. app selected opened depends on user id. me.boot = function () { me.getuserid().then(me.openappfunction); }; also, have function in home.js controller getobjectsfromapp(); this function needs executed after application loaded in other file, have no idea how this. app.js file not service or factory, file called when application loads scripts require.js. thing file select app open in api, why called once. an event looking for... you should stay in angular environment, so, should use $rootscope.$broadcast , $rootscope.$on , can used everywhere in application because $rootscope  is singletone. this why use $rootscope.$broadcast in angularjs? you.

windows - C++: How to simulate different timezones in unit tests using google test -

i'm working in c++ google test unit testing. in our companies code still have problem, system data types example ctime use example timezone of actual system (we use ctime datatype same way in production code). unit testing, want simulate different time zones because have many problems that. i invested hours researching how others because can't be, other companies don't have problem :) didn't find solution that. thoughts this: ctime saves time in utc , converts on demand local time. assumption these functions need gettimezoneinformation() functionality declared in timezonapi.h. winbaseapi _success_(return != time_zone_id_invalid) dword winapi gettimezoneinformation(_out_ lptime_zone_information lptimezoneinformation); so solution maybe exchange gettimezoneinformation() functionality customized function returns object can change on demand. don't know how , not know if working or not because it's maybe calling function once when application starts. does

angular - Angular2 username or email taken async validation -

i need implement async validation github api. hope me. export class usernamevalidator { static usernametaken(control: formcontrol): promise<validationresult> { return new promise((resolve, reject) => { settimeout(() => { //how can use github api this: // if (control.value === "this._http.get('http://api.github.com/users/'+this.username)")) { if (control.value === "david") { console.log('username taken') resolve({"usernametaken": true}) } else { resolve(null); }; }, 1000); }); } } thank you. this implemented within reactive form, should modifiable solution form driven met

javascript - Getting old records from Sails Models -

im trying build complete chat sails.js websockets im facing troubles. i succeed send , new messages when new client connect chat new client get older messages (like 20 last messages sent in chat). message.js (model) module.exports = { attributes: { name : { type: 'string' }, message : { type: 'string' } } }; messagecontroller.js (controller) module.exports = { new: function(req, res) { var data = { name: req.param('name'), message: req.param('message'), }; message.create(data).exec(function created(err, message){ message.publishcreate({id: message.id, name: message.name, message: message.message}); }); }, subscribe: function(req, res) { message.watch(req); } }; i had idea using "find" function on model not conclusive. i hope im not missing big sails possibilities ! need :) ! message.find({sort

Python XPath with ElementTree Invalidate Predicate -

i have probleme max value of categorylevel write says invalidate predicate. document=xmlparser.parse("categories.xml") xpathquery="{0}categoryarray/{0}category[not({0}categoryarray/{0}category/{0}categorylevel>{0}categorylevel)]".format(namespace) categories=root.find(xpathquery) the xml file <getcategoriesresponse xmlns="urn:xxxxxxxx:xxxxx:xxxxxxxx"> <categoryarray> <category> <categorylevel>1</categorylevel> </category> <category> <categorylevel>2</categorylevel> </category> <category> <categorylevel>3</categorylevel> </category> <category> <categorylevel>2</categorylevel> </category> i want check if xpath query suitable extract maximum value of categorylevel or not, , don't understand answer of other pos

python - How to play music in background Tkinter with winsound -

i trying make program , have pokemon theme in background while tkinter running. program doesnt start before song over. how can make python keeps winsound active while running rest of program.' winsound.playsound('song.wav', winsound.snd_alias) this have. after code whole program starts. use winsound.snd_async make call return immediatly: winsound.playsound('song.wav', winsound.snd_alias | winsound.snd_async)

python - pychromecast api connect to chromecast -

i trying connect pychromecast api chromecast home project make. connect chromecast assisted "how use" api repo on github. problem when need print status next error : attributeerror: 'chromecast' object has no attribute 'status' and next part of code influenced this. appreciate ! thanks. code - from __future__ import print_function import pychromecast cast = pychromecast.get_chromecast(friendly_name="chromecast") #print(cast.device) print(cast.status) mc = cast.media_controller mc.play_media('http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/bigbuckbunny.mp4', 'video/mp4') print(mc.status) mc.pause() time.sleep(5) mc.play() it seems installation not proper possibly because of version of dependencies such package of zerconf , netifaces. have @ steps deep because had same problem , resolved. http://www.ozturkibrahim.com/playing-with-google-chromecast/

c - Why this piece of code can get environment variable address? -

Image
64-bit linux stack smashing tutorial: part 1 uses get environment variable address gist environment variable address. prerequisite first disable aslr via echo 0 > proc/sys/kernel/randomize_va_space . the content of gist is: /* * i'm not author of code, , i'm not sure is. * there several variants floating around on internet, * 1 use. */ #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char *argv[]) { char *ptr; if(argc < 3) { printf("usage: %s <environment variable> <target program name>\n", argv[0]); exit(0); } ptr = getenv(argv[1]); /* env var location */ ptr += (strlen(argv[0]) - strlen(argv[2]))*2; /* adjust program name */ printf("%s @ %p\n", argv[1], ptr); } why *2 used adjust program name? my guess program name saved twice above stack. the following diagram https://lwn.net/articles/631631/ gives more details: ---------

vb.net - Acrobat API reading text from a specific area -

i have piece of code worked fine 3 years. i'm not sure happened server made stop working. reads text in funky characters !..||+$% instead of actual text. i'm using vb.net , windows forms in visual studio 2010 acrobat pro can use api. please me. dim objpdfpage acropdpage dim objpdfdoc new acropddoc dim objpdfavdoc new acroavdoc dim objacroapp new acroapp dim objpdfrecttemp object dim objpdfrect new acrorect dim textrangecount integer dim objpdftextselection acropdtextselect dim temptextcount long dim strtext string = "" dim pagecount integer = 0 dim pageindex integer dim itemname string = "" dim column integer = 0 objpdfdoc.open(txt_path.text) pagecount = objpdfdoc.getnumpages pageindex = 0 pagecount - 1 'get pages in pdf document objpdfpage = objpdfdoc.acquirepage(pageindex) 'get page real size objpdfrecttemp = objpdfpage.getsize 'draw rectangle around area want read objpdfrect.left = 50 objpdfrect.right

ios - Best way to reload UICollectionView -

i have uicollectionview load collection of photos photo library. for asset: phasset in self.photoassets! { sfsimagemanger.imagefromasset(asset, isoriginal: false, tosize: cgsize(width: 150, height: 150), resulthandler: { (image: uiimage?) in guard image != nil else { return } dispatch_async(dispatch_get_main_queue(), { self.photos.append(image!) self.albumcollection.reloaddata() }) }) } this how load photos. problem when have many photos, more 500, collectionview flickers when scroll , collectionview selection doesn't work until loop completes. i not want app show loading progress , freeze ui also. so, how increase performance in case? what create didset in photos array this: var photos = [uiimages]() { didset {

swift - file upload using Vapor -

i can't find example of handling file upload, how save specific folder. here code, addvideo http post multipart/form-data: videos.post("addvideo") { req in // need save req.multipart["video"] /data/videos/ return try json(node: ["status": 0, "message": "success"]) } from multipart.file bytes , convert data . guard let file = request.multipart?["video"]?.file else { return "not found" } try data(file.data).write(to: url(fileurlwithpath: "/data/videos/filename")) you can filename file object or make own.

json - How do I access an object property dynamically using a variable in JavaScript? -

i’m trying filter data json in javascript. i define variable a . want property of whatever value a equal (not item.a ). far i’ve been unable find way of doing it. everything else working correctly because when changed specific entry (item.date example) works fine. cannot figure out correct syntax. while(i< elements.length){ var a=elements[i].id; if(elements[i].name == 'targetfeild'){ $(elements[i]).val($.map(result,function(item){var test = elements[i].id;return item.a;})); } i++; } try item[a] , javascript objects can accessed way.