Posts

Showing posts from January, 2015

javascript - Validate a form in AngularJS -

Image
i working on angularjs form validation. below form i have 3 variables toolid , timeremaining , maxqtyobj in javascript file , want validate form fields " tool id " , " time remaining " 2 variables i.e. field toold id should equal variable toolid & field time remaining should less variable timeremaining. and show alert when user enter values qty fields greater value stored in maxqtyobj contains sx & qty. if user clicks on yes, proceed or else cancel process. please help. i solved problem using ng-blur attribute. on ng-blur of elements defined function , set boolean values variables inside these function. if true proceed in ng-click of defined function.

Swift CGRectMake Center button -

i'm programming button swift spriest project. location of button messing up. wan in middel goes random place. let button = uibutton(type: .system) // let preferred on var here button.frame = cgrectmake(self.frame.width / 2, self.frame.height / 2, 100, 50) print(self.frame.height / 2) button.backgroundcolor = uicolor.greencolor() button.settitle("button", forstate: uicontrolstate.normal) self.view!.addsubview(button) i don't know why cgpoint works can't use cgpoint here. try this... button.frame = cgrectmake( self.view.center.x - (widthofbutton / 2), self.view.center.y - (heightofbutton / 2), widthofbutton, heightofbutton)

python 2.7 - mapper_parsing_exception error when indexing pdf in elasticsearch -

i trying index pdf using elasticsearch 2.3.4 , python. want extract text , metadata pdf index. using mapper_attachment plugin. when trying index, getting 'mapper_parsing_exception'error. following code, #configuration dir = 'd:/qa_testing/testing/data' es_host = {"host" : "localhost", "port" : 9200} index_name = 'testing' type_name = 'documents' url = "d:/xyz.pdf" es = elasticsearch(hosts = [es_host]) mapping = { "mappings": { "documents": { "properties": { "cv": { "type": "attachment" } }}}} file64 = open(url, "rb").read().encode("base64") data_dict = {'cv': file64} data_dict = json.dumps(data_dict) res = es.indices.create(index = index_name, body = mapping) es.index(index = index_name, body = data_dict ,doc_type = "attachment", id=1) error: traceback (most recent call last): fi...

javascript - Open download windows using jQuery's each() -

i've got table containing several rows each row represents exportable file, e. g.: <tr> <th class="text-center" scope="row"> <input id="exportid-23" type="checkbox" /> </th> <td class="text-center text-nowrap">2016-08-24</td> <td>name</td> <td>city</td> <td class="text-center text-nowrap">person</td> </tr> [...] <button id="exports" class="btn btn-success" type="button"> <span class="glyphicon glyphicon-export"></span> export </button> in order return files requested upon user's click on export button, wrote this: $('#exports').click(function () { var exports = $(this); $('[id^=exportid-]').each(function () { if (this.checked) { window.open('ajax/get-exports.php?exportid=' + this.id.substring(9)); } }); }); ...

java - Searching for a '$' in a string -

how can make working. want check if string contains $ sign. if(messagesuccess.îndexof('$')>0) this error getting: no signature of method: java.lang.string.îndexof() applicable argument types: (java.lang.string) values: [$] thanks you invoking method not exist : îndexof() change indexof() , change î i

php - warning : creating default object from empty value in cakephp -

i working on cakephp 3.2 i have function find product types if exists if ($product['product_type'] != null) { $getproducttype = $this->producttypes->find() ->where(['title like' => '%'.$product['product_type'].'%']) ->first(); debug($product['product_type']); // not empty debug($getproducttype); // shows 'id' => 1 in array debug($getproducttype->id); // shows 1 if (!empty($getproducttype)) { $p->product_type_id = $getproducttype->id; // line 11 $p->subcategory_id = $getproducttype->subcategory_id; $p->category_id = $getproducttype->category_id; return $this->savenewbulkproduct($product, $p->category_id, $p->subcategory_id, $p->product_type_id); } } but giving warning as creating default object empty value on line 11 edit 2 output of print_r($getproducttype) app\model\entity\pro...

python - Django: Search Engine -

i trying make search engine of sorts in django, user enters query via form , gets output if query exists in database. here's code: urls.py: from django.conf.urls import url django.contrib import admin search import views urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^', views.form), url(r'^search/', views.data,name='search'), ] models.py: from __future__ import unicode_literals abc import abcmeta django.db import models # create models here. class album(models.model): artist = models.charfield(max_length=100) album_title = models.charfield(max_length=100) genre = models.charfield(max_length=100) album_logo = models.charfield(max_length=100) def __str__(self): return self.album_title + "-" + self.artist views.py: from django.http import httpresponse,http404 models import album forms import formquery django.shortcuts import render django.template import loader . import * def dat...

php - Select from database without duplicate -

i'm trying develop php page have problem, data data base without duplicate. $tsql = "select count(id) factoriesviolations"; $rowsperpage = 25; $stmt = sqlsrv_query($conn, $tsql); please me. thanks in advance. what columns expecting in output. if id $tsql = "select count(distinct(id)) factoriesviolations"; if want columns table , eliminate duplicate records query needful. select col1, col2,... coln factoriesviolations group col1, col2,... coln; here col1, col2,... coln column names of factoriesviolations table.

Delphi How can I check the cport status? -

how can check cport status using comled or label displaying enabled/disabled. i've try if cport1.connected then not satisfy me, status keeps on telling connected though not. does here have better solution? note: use timer check port status. if understand question correctly,first should find ports connect device code : procedure findports(s:tstrings); var r:tregistry; i:integer; begin r:=tregistry.create(key_read); r.rootkey:=hkey_local_machine; if r.openkey('hardware\devicemap\serialcomm',false) begin r.getvaluenames(s); i:=0 s.count-1 s[i]:=r.readstring(s[i]); end; r.closekey; end;

ios - UICollectionView changing layout selected item and frame/constraints -

Image
i've got collection view i'm dynamically changing between layout looks uitableview , layout looks sort of timemachine carousel i'm calling "swipelayout" (which doesn't swiping right now, eventually). btw, entire project here: https://github.com/supertango/collectionviewlayoutswitching . under master branch tag "initial_question" the initial layout table layout, when item tapped, change layout "swipelayout" animation (and again). in viewcontroller, have: func collectionview(collectionview: uicollectionview, didselectitematindexpath indexpath: nsindexpath) { nslog("index path chosen: \(indexpath)") changelayouttapped(self) } @ibaction func changelayouttapped(sender: anyobject) { if (self.collectionview.collectionviewlayout == tablelayout) { self.collectionview.setcollectionviewlayout(swipelayout, animated: true) self.mode = mode.swipe } else { self.collectionview.setcollectionview...

onclicklistener - Android - Click buttons through a viewpager -

i have layout contain 2 items. relativelayout several buttons inside , viewpager . but, can't click buttons since buttons behind viewpager . there way can click buttons behind viewpager ? here's layout. <framelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/sliding_down_toolbar_layout" android:layout_width="match_parent" android:layout_height="match_parent"> <relativelayout android:layout_width="match_parent" android:layout_height="match_parent" android:splitmotionevents="true" android:id ="@+id/content_container"> (buttons) </relativelayout> <android.support.v4.view.viewpager android:id="@+id/viewpager" android:layout_width="wrap_content" android:layout_height=...

html - making a parent div vertically scroll-able without changing the child divs height -

i have html table created using divs. html code: <div class = "content-table"> <div class = "table-row table-row1"> <div class = "left-align column1">&nbsp;</div> <div class = "left-align column2">header</div> <div class = "left-align column3"> <span><strong>order activities</strong></span><br/> <table style="width:100%"> <tr> <th>act no</th> <th>type</th> <th>status</th> <th>required-by</th> </tr> <tr> <td>01</td> <td>d1pr01ag<br/> phonebooks (autogen) not com/can manually</td> <td><br/>act</td> <td...

javascript - how to retrieve data from google book api url? -

i wan retrieve title, authors https://www.googleapis.com/books/v1/volumes?q=isbn:9780439023528 in javascript , result display in html. html: <p id="demo"></p> javascript: function getbookdetails(isbn) { isbn = "9780439023528"; var url = "https://www.googleapis.com/books/v1/volumes?q=isbn:" + isbn; var response = urlfetchapp.fetch(url); var results = json.parse(response); if (results.totalitems) { var book = results.items[0]; var title = (book["volumeinfo"]["title"]); document.getelementbyid("demo").innerhtml = book; } } }); urlfetchapp class not available in client-side javascript, looks trying do. can use in server-side google apps script .gs files. you can use xmlhttprequest fix problem. function getbookdetails(isbn) { isbn = "9780439023528"; var xmlhttp = new xmlhttprequest();...

list - How to iterate over a property file in Spring xml -

i have property file details2.txt , filled values : list.value=34 list.value=35 list.value=38 list.value=45 list.value=23 now want iterate in spring xml , unable xml code (parts only) : <context:property-placeholder location="details2.txt" /> <constructor-arg> <list> <value>${list.value}</value> </list> </constructor-arg> this gives last value in property file a property file translated properties object, in turn subclass of hashtable , contains one-to-one mapping key value. means properties object indeed contain last value (since previous ones have been overwritten). one common way of handing problem in property files add suffix keys: list.value.1=34 list.value.2=35 list.value.3=36 list.value.4=37 but doesn't when using spring, since each property key need explicitly specified in xml file (and i'm assuming don't know exact number of items). your best bet ...

JQuery - travel inside of elements using Each() function -

how travel inside elements in jquery using each function? consider elements structure: <div id="first-div"> <div id="check-div1"> <input type="checkbox" name="choices" id="mobile-check" value="mobile">mobile </div> <div id="check-div2"> <input type="checkbox" name="choices" id="charger-check" value="charger">charger </div> <div id="check-div3"> <input type="checkbox" name="choices" id="headphone-check" value="head phone">head phone </div> </div> i want print value of each checkbox in alert using each method. i tried following $("#first-div").each(function(){ alert($(this).id.div); // struck here travel inner of first-div }); ...

NameError: name 'ElementNotVisibleException' is not defined Python Selenium -

i'm trying make little python script, keep getting error codes: file "c:\users\eddie\appdata\local\programs\python\python35-32\selenium xpath testing.py", line 30, in <module> driver.find_element_by_xpath(".//*[@id='page-content']/section[1]/div[1]/nav/div/div[1]/a[1]/i[1]").click() file "c:\users\eddie\appdata\local\programs\python\python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 293, in find_element_by_xpath return self.find_element(by=by.xpath, value=xpath) file "c:\users\eddie\appdata\local\programs\python\python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 752, in find_element 'value': value})['value'] file "c:\users\eddie\appdata\local\programs\python\python35-32\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 236, in execute self.error_handler.check_response(response) file "c:\users\eddie\appdat...

orchardcms - Orchard CMS: Upgrade from 1.3.9 to 1.10.1 -

i have old 1.3.9 version of orchard i'd upgrade latest version. i'd happy upgrade in steps (i.e. 1.3.9 -> 1.4.2 -> ... -> 1.10.1) can't find install zips older versions. appears earliest on github 1.8.2. tried upgrading didn't work. so i'm looking recommendations on how proceed.

security - SecKeyEncrypt SecPaddingNone iOS -

i trying raw rsa encryption on ios. please not try , talk me out of it. i doing encryption 2 keys. first step, using key a, uses secpaddingpkcs1 , gives me output of 256 bytes. after that, using key b, use secpaddingnone. assume output remain 256 bytes, becomes 512 bytes. not sure doing wrong, know? thinking wrong? i use swiftyrsa library perform encryption. thanks edit code: the encryptdata function has been copied on swiftyrsa. assume data 256 bytes, , result of first encryption key a. let datastring = text.datausingencoding(nsutf8stringencoding) let certificatelabel = "certificate" let certificateref = self.getcertificatefromkeychain(certificatelabel) let certificatedata = self.getdatafromcertificate(certificateref) let cryptoimportexportmanager = cryptoexportimportmanager() let publickeyref = cryptoimportexportmanager.importpublickeyreferencefromdercertificate(certificatedata) let encrypteddata = self.encryptdata(data, publickey: publickeyref!, padding: s...

swift - Can't convert string to UTF-8 with Alamofire -

i have api want use alamofire library, need use utf-8 make api url support spaces , arabic. have tried these 2 ways no success. let d = "ddd dd" let f = string(d.utf8)! let bb = string(utf8string: f.cstringusingencoding(nsutf8stringencoding)!)! let encodedname = d.stringbyaddingpercentescapesusingencoding(nsutf8stringencoding) these lines wrong: let f = string(d.utf8)! let bb = string(utf8string: f.cstringusingencoding(nsutf8stringencoding)!)! you not need or want c string. , not need convert utf8; swift string unicode. , every time use exclamation mark ( ! ) saying "please crash me" - cannot surprised when in fact crash.

python 2.7 - Openstack output in json format -

i using novaclient details openstack. able retrieve information, want convert json format. using "to_dic()" it;s throwing "attribute" error on "server_details = server_id_name.to_dict()", not sure why. attributeerror: "'tuple' object has no attribute 'to_dict'" code given below, from novaclient import client novaclient import json nova = novaclient.client(version='2.0',username='xxxx',api_key='xxxx',project_id='xxxx',auth_url='http://192.168.12.3:5000/v2.0/',insecure='true') server_details = dict() server = nova.servers.list() server in nova.servers.list(): print server.id, server.name server_id_name = server.id, server.name server_details = server_id_name.to_dict() network in server.networks.items(): print network it's error in python code. should use server_details[server.id] = server.name to replace code server_id_name = serve...

sql server - SQL Get Total Column from Dynamic Pivot -

i have problem getting total column dynamic pivot query. code got result : the result without total , want total column column 32,33,34,35 , place after column 35 (vertical total column) here code : set datefirst 1; declare @cols nvarchar(max), @colnames nvarchar(max), @query nvarchar(max) select @cols = stuff((select distinct ',' + quotename(datepart(wk,oinv.taxdate)) oinv year(oinv.taxdate) = 2016 , month(oinv.taxdate) = 8 xml path(''), type).value('.', 'nvarchar(max)'),1,1,'') select @colnames = stuff((select distinct ', isnull(' + quotename(datepart(wk,oinv.taxdate)) +', 0) '+ quotename(datepart(wk,oinv.taxdate)) oinv year(oinv.taxdate) = 2016 , month(oinv.taxdate) = 8 xml path(''), type).value('.', 'nvarchar(max)'),1,1,'') set @query = 'select salesman, cabang, '+ @colnames +...

Run powershell command on slave - Jenkins -

i'm getting console output when running jenkins job on slave. job should create file , put in c:\foo\services.csv . here job powershell command: get-service | export-csv c:\foo\service.csv note word “bypass” in console output. cannot past it. think issue: [anonymousjwtapi] $ powershell.exe -noninteractive -executionpolicy bypass "& 'c:\users\xxx\appdata\local\temp\hudson1582303083838020200.ps1'" i found online error happens when running script sitting on master, on slave. so manually created script on slave , put in c:\foo\listservices.ps1 . in jenkins (master) command gets run on slave: “c:\foo\listservices.ps1” invoke script run directly slave. im still getting same console output…something “bypass” seems still causing not work. csv file not being put in foo folder. bypass preventing working, , if so, solution? and full console output: started user anonymous building remotely on slave1 in workspace c:\jenkins\master\workspace\a...

javascript - Chartjs fiddle not working -

i'm new jsfiddle. i'm trying scatter chart show nothing displaying. can point me in right direction? here's fiddle: http://jsfiddle.net/roka545/qf8ejytt/ //get context jquery - using jquery's .get() method. let canvas = <htmlcanvaselement>document.getelementbyid("mychart"); let ctx = canvas.getcontext("2d"); let xaxismin: number = 4; let xaxismax: number = 7; var scatterchart = new chart(ctx, { type: 'line', data: { datasets: [{ label: 'scatter dataset', data: [{ x: -10, y: 0 }, { x: 0, y: 10 }, { x: 10, y: 5 }] }] }, options: { scales: { xaxes: [{ type: 'linear', position: 'bottom' }] } } }); you need add link actual source such as: ...

php - Contextual binding of interface via config in laravel 5 -

lets assume have interface so: interface repositoryinterface{ public function getbyid($id); } this interface gets implemented x amount of classes. as example: class sqliterepository implements repositoryinterface{ public function getbyid($id) { return $id; } } i have config file in config folder(do note, not database.php file, it's whole different file): 'default' => 'sqlite', 'connections' => [ 'sqlite' => [ 'database' => env('db_database', storage_path('database.sqlite')), ], 'some_other_db' => [ 'database' => env('db_database', storage_path('some_other_db')), ], ], the connections can anything. database, api, heck csv file. the main idea behind can switch in between storage mediums changing config. don't ask me why i'm not using default laravel database file, it's long story. t...

javascript - Node.js Async Promises within a forEach Loop inside another then statement -

i have been trying understand promises nesting simple code. both functions i'm calling async, 1 giving entire collection , other individual information of each of elements. what doing wrong? const piratebay = require ('thepiratebay'); var os = require ('os'); var sys = require('util'); var util = require('util'); var cfg = require('./config/appconf.js'); var mysql = require('mysql'); var torrent = require('./models/torrent.js'); var parsetorrent = require('parse-torrent') var async = require('async'); function saveresults (results) { console.log( "save results"); var ctorrents = []; (var key in results) { var t =results[key]; var torrent = new torrent() torrent.id = t.id; torrent.name = t.name; torrent.size = t.size; torrent.seeders = t.seeders; torrent.leechers = t.leechers; torrent.verified = t.verified; ...

python - using beautifulsoup to get second and third child in BeautifuSoup -

this question has answer here: error beautifulsoup 'resultset' object has no attribute 'findall' 1 answer i have table similar below: <table> <thead> <tr> <th></th> <th></th> <th></th> <th></th> <tr> </thead> <tbody> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> <td></td> <td></td> </tr> <tr> <td></td> ...

angular - Property binding vs attribute interpolation -

i have read article difference between property , attribute bindings. understood, of time, angular2 prefers property bindings, because after each change in data, dom updated. (if mistaken, please correct me). i have custom component , use parent component. in it, have @input named truevalue . when initiate truevalue parent via property binding, sometimes, not change. used following code: <my-checkbox [(ngmodel)]="chkitems" [disabled]="!editmode" [truevalue]="y"></my-checkbox> if send true or "1" truevalue works, if send "y" or "yes" , not work. forced use attribute binding. don't know problem. i have changed it, following: <my-checkbox [(ngmodel)]="chkitems" [disabled]="!editmode" truevalue="y"></my-checkbox> thanks in advance property binding like [truevalue]="..." evaluates expression "..." , assigns value ...

javascript - Method in React component not rendering HTML -

hello new react , have having bit of trouble don't think should experiencing. have component has 2 methods first method test , second standard render . check out: var projects = react.createclass({ test: function(){ return( <h1>why</h1> ) }, render: function(){ return ( <div classname="postwrapper"> <div id="projectsheader"> <h1>projects</h1> </div> <div id="projectsbody"> {this.test} </div> </div> ) } }); the problem when calling test method using {this.test} within projects component, nothing renders. want method available within component can render multiple items programmatically. doing wrong? since using react router don't know how pass children props when being rendered programmatically using {this.props.children} , tried...

javascript - How do I get the value of a cell in a loop using jquery -

i want value of cell related row calculate difference of values in cell want add of same row. the snippet shows mean wanting data same row on row land on , selected row in instance. other has nothing code. $(document).ready(function() { $('tbody tr').eq(0).find('td').eq(7).css('background-color', 'green'); $('tbody tr').eq(3).find('td').eq(7).css('background-color', 'green'); $('tbody tr').eq(4).find('td').eq(7).css('background-color', 'green'); }); table, td { border: 1px solid #000; } td { width: 40px; height: 40px; } <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <body> <table> <tbody> <tr> <td></td> <td></td> <td></td> <td></td> <td></td> ...

html - Access iframe node given element node inside iframe using Javascript only -

say i'm given html element node, such <div id = "content"></div> and that's contained in iframe. it's passed in me node. want able iframe node element's in -- there's no specific id , want able access element node. i've tried elnode.window and elnode.parent but gives me undefined. i'm passed in current window, trying curwindow.parent just passes me in window, led no avail. want iframe element node. if has pointers, that's appreciated. this issue due same-origin policy: browser won’t allow original script inspect contents of cross-origin document. more details sop https://en.wikipedia.org/wiki/same-origin_policy . generally, there following ways solves issue: using element has never been subject same-origin policy: download , execute script, regardless of origin. cross-document messaging,allows script 1 document pass textual messages script in document, regardless of script origins. callin...

mercurial - How to do a pull --rebase only on the current branch -

i want execute hg pull -b [branch] --rebase [branch] whatever branch i'm on. how do this? here's solution ended (for powershell): hg pull -r $(& hg branch) --rebase

How to store an array of images in Firebase Storage all under 1 path using iOS Swift -

i have 2 views, viewone , viewtwo. inside viewone there 4 imageview outlets , postbutton. once user presses postbutton images sent firebase storage , there retrieved shown in viewtwo. inside viewtwo there 4 imageview outlets receive images posted firebase storage viewone. using firebase storage don't see anyway store multiple images inside storage under same path. understand how store 1 image per post storage , access it, not multiple images. how post multiple images array in storage kept under 1 path(viewone)? how access of images(viewtwo)? btw got awesome code (the custom function) viewtwo brian voong via youtube: https://youtu.be/b1vrjt7nvb0 this class image url strings go into. didn't bother putting init. class imagedata: nsobject{ var imageoneurl: string? var imagetwourl: string? var imagethreeurl: string? var imagefoururl: string? } this imageviewone. didn't add in imagepicker delegates because seemed unnecessary how know how use them. import fir...

firebase - How to make an observer to return as observable? -

i'm new rxjs , on how solve this. i want pass observer onauthstatechanged() , takes observer object. observer work , emit boolean value such boolean value can returned observable . how go implement bridge of observable observer? export class authguard implements canactivate { constructor(private firebase: firebaseservice, private router: router) { } canactivate(): observable<boolean> { this.firebase.auth.onauthstatechanged(/* observer */) return /* observable<boolean> */ } } to benefit others, here's ended writing , seems work well. import 'rxjs/add/operator/do'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/take'; import { observable } 'rxjs/observable'; import { replaysubject } 'rxjs/replaysubject'; import { injectable } '@angular/core'; import { canactivate, router } '@angular/router'; import { firebaseservice } '../shared/firebase.service'; @injecta...

javascript - change value of submit button onclick with angularjs -

i'm implementing function where, when button clicked, text of button changed works properly. button appears when condition true works perfectly. when button appears when condition true when it's clicked values doesn't change. <button ng-if ="item.user == 'login'" class="{{love_default}}" ng-click=" love=!love">{{lovetext}}</button> js $scope.love = true; $scope.love_default = "button button-small button-positive icon icon-left ion-ios-heart"; $scope.$watch('love', function() { $scope.lovetext = $scope.love ? 'login' : 'already logged in'; }) when take out ng-if , click on button works <button class="{{love_default}}" ng-click=" love=!love">{{lovetext}}</button> but want working ng-if applied button

sorting - mysql query of 2 tables with inner join -

i want join table , table b , display recent entry each truck. table columns: ta id,truck_num,serial_num table b columns: tb id,serial_num,lat,long,datetime desired output truck | datetime | serial_num | lat | long 1 | datestamp | 123 | 1 | -1 2 | datestamp | 456 | 2 | -2 using join query select a.truck b.lat b.long b.datetime tb b inner join ta a.serial_num=b.serial_num; i'v tried giving me recent entry's time. select a.truck b.lat b.long b.datetime tb b inner join ta a.serial_num=b.serial_num b.datetime = (select max(b.datetime) tb tb a.truck_num=truck_num); this show recent item per truck. if rest of information want show same in rows can put on group clause, if not have join result select serial_num, max(datetime) tb group serial_num; this join have if data not equal , cannot...

javascript - Google Spreadsheets: conditional, includes rows imported from different spreadsheets -

i have imported columns several spreadsheets , different tabs (using importrange within query) 1 column in master sheet. need formula fill in different column specific strings depending on cell in first column came from. more specifically, have spreadsheet file documenting information school's students (their names, ages, id numbers, etc.), each section has seperate sheet. on other hand, working on master sheet, imported names of students sections 1 column -the goal summarize information in 1 place-, want corresponding name, find it's source (the specific sheet document), , copying name (since name of sheet=the section). how difficult that? it great help! thanks in advance :) from understand you're trying achieve, seems me you're going in reverse. the importrange function requires information want in second column (where range comes from) doesn't ? if need actual name of spreadsheet google apps script may come in handy, notably spreadsheet.ge...

React-native: Port related error -

Image
i'm trying run app on emulator , see error - i did run command react-native start in other terminal , packager , running on 8081 . any idea issue of ? thanks there must syntax error may defining property called 'name' twice. try check it.

javascript - How do I replace part of the embed code with the input field of my HTML? -

<body> username: <input type="text" id="username"> <input type="button" value="submit" onclick="timeout()"> <br> <br> <embed id="avatarstudio" wmode='transparent' width='150' height='275' src='http://static.poptropica.com/avatarstudio/charembed.swf?a=b'></embed> <script> function timeout() { settimeout(encode(), 200); settimeout(embed(), 250); } function encode() { var = document.getelementbyid("username"); a.value = btoa("123456"+ btoa(document.getelementbyid("username").value.tolowercase())); } function embed() { var url = document.getelementbyid("avatarstudio"); var b = document.getelementbyid("username").value; var c = "http://static.poptropica.com/avatarstudio/charembed.swf?a=b"+b; url.src= c.value; } </script> i want replace st...

windows - Hooking Python code using Detours -

i built simple python gui application("app.py") trying hook using detours. understanding python should use windows dll's @ point , trying hook these function calls. for purpose using detours withdll.exe : withdll.exe /d:"mydll.dll" "myprogram.exe" because withdll.exe doesn't accept running program arguments ("python.exe app.py"), tried creating bat file starter.bat follows: cd appdir python app.py and running: withdll.exe /d:"mydll.dll" "starter.bat" however approach hooks background cmd process. is there workaround make detours hook python.exe process of script ? i looked through detours withdll.exe source code , found out can take command line arguments, issue solved using: withdll.exe /d:"mydll.dll" "pathtopython/python.exe" "pathtoscript/myscript.py"

ruby - Correct way to schedule a task -

i'm coding cache server in ruby , need make expiration times data i'm storing. when user stores data under key foo example sets expiration time in seconds. data needs deleted @ moment thought scheduling create thread , put sleep until time comes. thread.new(@options[:exp_time], key) |t, k| exp = time.now + t sleep(t) if @data.key?(k) && @data[k][:exp_time] <= exp #check if hasn't been updated @data.delete(k) end end t time user sent , key key under data stored. expiration time changed if user replaces data stored @ key check it. wondering if use of threads or if consumes resources or there's easier way. can't use gems or libraries of type. in advance help that's going create crazy number of threads in short time if put under load. want priority queue elements sorted expiration time , periodic timer checks if first entry expired, processes it, , repeats until there's nothing left expire, goes sleep briefly....

css3 - CSS Rem Unit for Element Sizes -

i've noticed rem unit can usable element's sizes, not font-sizes. , usefull html font-size property. html { font-size:1vw } @media , (max-width:720px) { html { font-size:10px } } #el { width:20rem;height:5rem } but proper , trustable? i think thats you. i apply: rem font-sizes px callback, best ! em paddings , margins px, %, vw , vh element sizes and media queries use em, rem , px used too. you can mess children element if use em font-size, not recommended. rem size elements interesting, i'm enjoying lot vw , vh responsive behaviors cases % not enough. and can cool stuff css calc function like width: calc(100% - 85px); fixed size within design. this recommended read units :) hope you.

What is the equivalent of getDefaultProps function using ES6 in React Native? -

i looking @ documentation datepickerios component , use getdefaultprops() initialize props in component. getdefaultprops: function () { return { date: new date(), timezoneoffsetinhours: (-1) * (new date()).gettimezoneoffset() / 60, }; }, getinitialstate: function() { return { date: this.props.date, timezoneoffsetinhours: this.props.timezoneoffsetinhours, }; }, what equivalent of using es6 syntax? because have been using: constructor(props) { super(props); this.state = { //equivalent getinitialstate here }; } should this.props = { } set default props? see this: https://github.com/facebook/react/issues/3725 class x extends react.component { } x.defaultprops = {...} if using babel-plugin-transform-class-properties package, can this: class x extends react.component { static defaultprops = {...} }

asp.net mvc - SlickGrid not displaying SQL data in an MVC application -

Image
this post on stackoverflow describes issue data sql not displaying in slickgrid in mvc application. having same issue. when navigate www.example.com/aqi/products/index, slickgrid displays, data article_creator column in sql not appear. the web inspector network tab displays data in article_creator column sql should appear in slickgrid. in example, text "test" should appear in slickgrid. in other post, solution check web inspector console errors. browsers web inspector console has no errors, unsure next. controllers/appcontroller.cs using system; using system.collections.generic; using system.data; using system.data.entity; using system.linq; using system.net; using system.web; using system.web.mvc; using aqi.models; namespace aqi.controllers { public class productscontroller : controller { public actionresult index() { return view(db.products.tolist()); } public jsonresult getslickgriddata() { ...

java - Issue with prepared statement when using select query with string -

i have written simple jdbc program query , trying create prepared statement, result set coming empty. when same query executed through general statement creation gives output , through sql plus. package com.aexp.balu.jdbc; import java.io.reader; import java.sql.*; public class simpleconnection { public static void main(string[] args) { // todo auto-generated method stub // string url="url"; // string uname="uname"; // string pass="password"; string url = "url"; string uname = "uname"; string pass = "password"; string query = "select card_no mdc.cas_unmch_rocs card_no = ?"; string cardnumber = "3222222222222222223"; try { // step1 load driver class system.out.println("registering driver"); class.forname("oracle.jdbc.driver.oracledriver"); // step...

Playing multiple videos simultaneously with WPF C# -

i have 12-hd-monitor setup, using 2 radeon firepro w600 graphic cards (2gb ram each), running windows 10 os, 16gb ram, , brand new i7-6th gen. cpu. i'm trying write program runs 4 videos across monitors (each video stretched on 3 monitors), yet no matter component use (mediaplayer, vlc.net...) when 3rd video loaded videos start skipping frames. the cpu , memory stats indicate there's no problem system's resources, peaks 20-30%. what's best way play multiple videos simultaneously (smoothly) on 12-monitor system, described, using c#? as turns out, problem lack of vram. 2gb vram each video card, computer can run 2-3 fullhd (1920x1080) monitors smoothly. there's no way force computer use system's memory rendering monitors, our system's bottleneck. by decreasing monitors' resolution, able run more videos, more smoothly, simultaneously on 12 monitors.

Google Universal Analytics Principal Domain Self Referral -

i need solve self referral scenario: domain exclude self referral: example.com domain preserve referral: alpha.example.com; beta.example.com; all subdomains. with configuration referral exclusion doesn't work. have solution in case? try write own javascript function check document.referrer before sending pageview , then: preserve referrer if contains subdomain etc. or set empty if referral == 'example.com' docs: https://developers.google.com/analytics/devguides/collection/analyticsjs/field-reference#referrer think should work. or if you're using gtm check this: http://www.simoahava.com/gtm-tips/implement-referral-exclusions-via-gtm/