Posts

Showing posts from July, 2010

mongodb - Enabling Access Control -

i installed mongo db , ran first time. encountered warning, access control not enabled database. read , write access data , configuration unrestricted. i fixed enabling access control using these commands db.createuser( { user:"myusername", pwd:"mypassword", roles:[{role: "useradminanydatabase", db:"admin"}] }) from docs, have restart mongodb command: mongod --auth --port 27017 --dbpath /data/db but when try restart mongodb after access control, error. 2017-08-17t19:11:14.337+0530 e query [thread1] syntaxerror: missing ; before statement @(shell):1:9 is command wrong or missing here. please walk me through this. thanks.

Django - Object with many categories and many subcategories -

i have been struggling model this. im developing directory of companies in music industry. have data base of 500 companies. have categories: audio, video, ilumination, stages, music intruments, talent, schools , dj. this categories have subcategories. - audio: recording, installation, rent, retail - video: installation, rent, retail - ilumination: installation, rent, retail - stages: bars, discos, theaters, stadiums - music intruments: retail, rent - talent: manager, record label, booking - schools: audio, production, theater, dance - dj: booking, retail many companies enter in many of categories, , inside categories enter in many subcategories. example: company x sells video , audio products offer installation service audio products. company x - audio: retail, installation. - video: retail in opinion how can manage design models???? thanks in advance. this code far, wrong. the following method simple way of solving problem, may not efficient way of doing solv

javascript - ionic : Get public facebook posts without Graph API -

i'm new facebook graph api. know if can public facebook page , parse in json format extract posts. theses posts used in ionic application. i remarked graph api requires authentication. what i'm seeking read-only mobile application. no need authenticate ! any please?

Apache 2.4 on Windows - Include folder out of DocumentRoot -

i need include folder on httpd.conf out of documentroot directory. know there lot of info not apache 2.4 running on windows . tried lot of things works, forbidden error, , driving me mad. here default config made wamp: <directory /> allowoverride none require denied </directory> documentroot "${install_dir}/www" <directory "${install_dir}/www/"> options +indexes +followsymlinks +multiviews allowoverride require local </directory> that's ok need include folder project on e:\ disk. have tried of these, restarting apache server after every attempt: attempt #1 <directory "e:/development/[git]/projectname/public/"> require granted </directory> attempt #2 <directory "e:/development/[git]/projectname/public/"> options +indexes +followsymlinks +multiviews allowoverride require local </directory> attempt #3 alias /projectname "e:/developm

css - Top Align ULs When Parent Text Wraps -

i have nav when parent text wraps, drops ul down not top align adjacent uls. in fiddle below, find park top aligned adjacent golf preserve , recreation center lis , not top aligned adjacent lis. https://jsfiddle.net/vge8vuxd/ <div class="row topnavmain"> <ul class="nav mobile-nav"> <li class="active level0"> <a class="has-sub-menu active" href="http://www.someurl.com/playrecreation"><span>play &amp; recreation</span><span class="border"></span></a><i class="fa fa-chevron-down"></i> <ul class="sub-menu"> <li class="level1"> <a class="has-sub-menu " href="http://www.someurl.com/playrecreation/golfhere"><span>golf here</span><span class="border"></span></a><i class="fa fa-chevron-down"></i&g

node.js - mongodb: how to populate a single nested subdocuments -

i writing node.js application using mongodb , mongoose. seems having issue in understanding how query "single nested subdocuments". if have example following: var childschema = new schema({ name: 'string' }); var parentschema = new schema({ // array of subdocuments children: [childschema], // single nested subdocuments. caveat: single nested subdocs work // in mongoose >= 4.2.0 child: childschema }); from mongoose documentation, how populate child subdocument single nested scenario? tried use ".populate("child").exec..." child object returns null though can find if run db.child.find() mongo command line. saw in documentation, have call "parent.children.id(_id)" in case not know _id ahead of time. update: removed populate , appears working now. you storing child document embedded 1 inside parent document, there no need populate. populate cases storing reference other document want populated while runnin

How to export selected row DataGridView to Word Document in vb.net -

Image
i export value selected datagridview row ms word normal document format not table. code below working, exporting table format. please help. thanks! private sub btnword_click(byval sender system.object, byval e system.eventargs) handles btnword.click try 'private sub btnword_click(byval parcelsdatagridview datagridview, byval filename string) dim objword word.application dim objdoc word.document objword = createobject("word.application") objword.visible = true objdoc = objword.documents.add dim _rowcount integer = parcelsdatagridview.rows.count - 1 dim _colcount integer = parcelsdatagridview.columns.count - 1 dim ht1 word.table ht1 = objdoc.tables.add(objdoc.bookmarks.item("\endofdoc").range, _ _rowcount + 1, _colcount + 1) ht1.borders.outsidecolor = word.wdcolor.wdcolorblack ht1.borders.outsidelinestyle = word.wdlinestyle

python - Topics for teaching in assiment -

i in year 9, doing task teaching class skill. going teach security (i.t based, cyptogrpy, security alogryths , programming tools shells , key-loggers) course avoiding threats, sadly i.t department @ school had fit security (they paranoid, because have been hacked before) , said no, ideas can teach?

How can I check if a radio button is selected using JavaScript and PHP -

i have few images should radio button , uses should select , proceed page, isn't working, returns "please mark product". php code $shoppingtable = array( array("radiovalue" => 001, "url_image" => "/images/a.png", "price" => 19.99, "coins" => 25, "package" => 1), array("radiovalue" => 002, "url_image" => "/images/b.png", "price" => 34.99, "coins" => 40, "package" => 2), array("radiovalue" => 003, "url_image" => "/images/c.png", "price" => 49.99, "coins" => 80, "package" => 3), array("radiovalue" => 004, "url_image" => "/images/d.png", "price" => 89.99, "coins" => 125, "package" => 4), array("radiovalue" => 005, "url_image&qu

angularjs - nodejs: calculate distance from location to user -

this question exact duplicate of: geojson: display distances in table [duplicate] i'm building api stores locations (with coordinates), , want query them based on distance user. in view controller, have code: var geolocation = angular.module('geolocation', []); navigator.geolocation.watchposition(render); var lat, lon = 0; function render(pos) { lat = pos.coords.latitude; lon = pos.coords.longitude; console.log(lat +","+ lon); } that returns user current position. schema modeled this: var locationschema = new schema({ locationname: { type: string, required: 'enter name of location.' }, description: { type: string, required: 'enter description of location.' }, geolocation: { type: { type: string, default:"point" }, coordinates: [number], }, and in apicontr

algorithm - Count number of lines that will be seen by pilot as intersecting in a 2d plane -

Image
the question goes this: there 2 parallel buildings on each side of street. n number of ropes attached 1 floor of 1 building floor of other building ( (a[i],b[i]) , a[i] floor in first building on ith rope attached , b[i] floor on other building) . helicopter approaching building. how many intersections of ropes able see? you can imagine tunnel scene movie dark knight when gcpd helicopter comes rescuing harvey dent gets strangled ropes. you can imagine intersections in 2-d plane. in picture attached below pilot see 1 intersection. approaches the 1 approach think of brute-force, compare each rope other ropes intersection. want better that. i thought of sorting ropes according points of contact on 1 of building couldn't work out. notes no, it's not of running competitions. i want approach, not code. thanks in advance. put left end positions binary search tree (rb, avl), right end positions sorted array/list, set l

Lotus Notes Custom Form -

i given task of creating custom form in lotus notes , need please. form simple auto fill style form pulls data other forms in lotus notes. able figure out how of can not figure out last part. there 3 forms completed @ time customer purchases car. first form called customer, second form called vehicle , third form called history. custom form created clicking "new form". new form pull customer's name, phone number , address customer form , auto fills in on new form. problem retrieving information vehicle , history forms. think problem not know how type path correctly. if under customer form , type lastname in new form take last name customer form , auto fill on new form have typed [lastname]. type tell new form retrieve information form called vehicle , field in same form called lastname. input appreciated your new form has property set new documents inherit values parent. if document created customer form parent (because that's had selected when clicked c

how to stop table duplicating (html, javascript) -

me , friend making chatbot in python , want send unknown words website(using firebase), when word added in real time, table displays of previous words , new word. know how fix it? not big of problem because condenses when refresh page. my website on var ref = new firebase("https://chatbot-errors.firebaseio.com/errors"); ref.on("value", settable , function (errorobject) { console.log("the read failed: " + errorobject.code); }); function settable(data){ var = 0; var table = data.val(); var keys = object.keys(table); console.log(table); var newtable1 = '<tr><td>one</td>'; var newtable2 = '<td>two</td>'; var newtable3 = '<td id="data1">three</td>'; var newtable4 = '<td id=>four</td> <td></td></tr>'; (i; < keys.length; i++){ console.log(i); var k = keys[i] v

node.js - Error in installation of npm dependecies during firebase cloud functions initiation -

i trying initialize firebase cloud functions , part installation of dependencies fails. show npm err! code z_buf_error npm err! errno -5 npm err! unexpected end of file here package.json { "name": "functions", "description": "cloud functions firebase", "dependencies": { "firebase-admin": "~4.2.1", "firebase-functions": "^0.5.7" }, "private": true } below full logs created during installation: 0 info worked if ends ok 1 verbose cli [ 'c:\\program files\\nodejs\\node.exe', 1 verbose cli 'c:\\program files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js', 1 verbose cli 'install' ] 2 info using npm@5.3.0 3 info using node@v8.3.0 4 verbose npm-session 9486ab817502fd95 5 silly install runpreinstalltoplevellifecycles 6 silly preinstall functions@ 7 info lifecycle functions@~preinstall: functions@ 8 silly install loadcurrenttree 9 silly install readloca

mapbox - Why mapboxgl api returns 304 status code? -

Image
i getting http code 304 status code map box api request in ios application. works in browsers such chrome, safari, firefox getting 200 code. works in android. https://api.mapbox.com/styles/v1/mapbox/streets-v9?access_token="my token" the 304 status code stays "not modified" meaning device (e.g. browser or ios app) recognizes content present. means cached , can served there , not need downloaded again. status 304 not "a bad thing" or "wrong", describe in question. i guess 304 in ios app because don't have caching disabled in browser developer tools might have ticked "disable cache" box. fresh , new 200 responses. if uncheck box see status 304 there too you might wanna take more in depth here: https://httpstatuses.com/304

Python SpaCy Create nlp Document - Argument 'string' has incorrect type -

i'm relatively new python nlp , trying process csv file spacy. i'm able load file fine using pandas, when attempt process spacy's nlp function, compiler errors out approximately 5% of way through file's contents. code block follows: import pandas pd df = pd.read_csv('./reviews.washington.dc.csv') import spacy nlp = spacy.load('en') parsed_doc in nlp.pipe(iter(df['comments']), batch_size=1, n_threads=4): print (parsed_doc.text) i've tried: df['parsed'] = df['comments'].apply(nlp) with same result. the traceback i'm receiving is: traceback (most recent call last): file "/users/john/downloads/spacy_load.py", line 11, in <module> parsed_doc in nlp.pipe(iter(df['comments']), batch_size=1, n_threads=4): file "/usr/local/lib/python3.6/site-packages/spacy/language.py", line 352, in pipe doc in stream: file "spacy/syntax/parser.pyx&qu

python - Can we Use Z3 SMT Solver for SW testing -

can use z3 functional verification of software. example , if have code lets vending machine controller , can use z3 functionally test , if yes, how depth , if no why? using smt solvers verification both "routinely done" , topic of current research in both academia , industry. , nikolaj being modest: i'd recommend reading excellent , highly accessible cacm article start with, contains many useful further references.

spring web - Prevent query parameter from appearing in `@RequestParam` map -

there may better way structure api i'm open suggestions legacy code. have similar following: class foo { string bar string bat } and @requestmapping(value = '/path', method = requestmethod.get) string func(foo foo, @requestparam map<string, string> map) { ... } if have query string of bar=one&baz=two , instance of foo correctly have bar property set one map parameter contain key/value pair of [bar:one] . suppose makes sense, not expected. short of removing map properties or dealing directly httpservletrequest , know of way keep happening? thanks.

String to BSON conversion using MongoDB java driver -

i performing collection.find() operation using mongo-java-driver 3.4 , taking input end user string variable. the string variable try replicate bson query. string qur = " or(eq(\"columname1\", \"value1\"),eq(\"columname2\",\"value2\"))"; however find operation takes bson argument shown below bson query= or(eq("columname1", "value1"),eq("columname2","value2")); facing challenge while converting string input bson format. there solution convert same or there other input can provide perform find() operation ? any kind of appreciated. in advance.

Login to yahoo.co.in email redirects to yahoo.com -

i have yahoo email address ending @yahoo.co.in . when login account, login successful, shows @yahoo.com id. also, when sending mail yahoo.co.in id, gets bounced , error saying email not found. what done? i found post because have same problem, , although don't have solution this, know how may one. yahoo! has community can post topics issues regarding services. created topic there problem more month ago, didn't answer — guess people read , think confused e-mail address or maybe stupid, ignoring topic. however, if post problem there might attention , maybe find solution. check out topic , please answer saying have same problem: https://forums.yahoo.net/t5/password-and-sign-in/my-yahoo-com-e-mail-account-redirects-me-to-my-yahoo-com-br/m-p/329916#m57357 if happen find way solve this, please let me know!

jquery - Javascript store table in a variable with conditions -

this how page looks like: <div class="bgsmtitle smtitle">customer addresses</div> <table class="bglttable"> <tr> <td class="bgltrow1 padded">new york</td> </tr> <tr> <td class="bgltrow1 padded">osaka</td> </tr> <tr> <td class="bgltrow1 padded">los angeles</td> </tr> </table> <div class="bgsmtitle smtitle">family members</div> <table class="bglttable"> <tr> <td class="bgheader1 padded" style="width:24%;">name</td> <td class="bgheader2 padded" style="width:10%;">relationship</td> <td class="bgheader1 padded" style="width:30%;">age</td> </tr> <tr> <td class="bgltrow1 padded">jordan</td> <td class="bgltrow2 padd

html - <font color='#ff0000'> does't work in Android -

i use tag in android textview this, mnamestr = "<font color='#ff0000'>" + "myword" + "</font>"; result = html.fromhtml(mnamestr, html.from_html_mode_legacy); mname.settext(result); but , does't work.why? use easiest way mynametv.settext("myword"); mynametv.settextcolor(color.parsecolor("#fd0101"));

appmaker - Excel/Sheets copy-compatible table widget -

for sake of app's end-users, tried copy data app maker's basic table widget excel , gsheets. however, results in getting data in single column in spreadsheet. i noticed kind of copying possible using table chart widget. still, need basic table widget's functionalities row click events. is there way common users easy exporting excel (while using basic table widget)? kind of copying possibility implemented widget (i.e. there sense in making feature request)? other suggestions make data usable in other programs? thanks in advance! it unlikely, implemented app maker, since basic table customizable , can contain widget , display model relations well. makes more sense think copying datasource items clipboard or exporting them spreadsheet. here reference code, can try use generate serialized string compatible google spreadsheet datasource: // onclick event handler 'copy clipboard' button var ds = app.datasources.mydatasource; var items = ds.items; var

Testlink login error -

i have installed , configured testlink 1.9.16 on centos7 server using following link https://sysadmin.compxtreme.ro/how-to-install-testlink-on-centos-6-3/ i made changes according centos7 after completing procedure, when open ip_of_my_server/login.php following error message ============================================================================== db access error - debug_print_backtrace() output start attention: enabling more debug info produce path disclosure weakness (cwe-200) having additional information useful reporting issue development team. ============================================================================== my log entry is error on exec_query() - database.class.php - - /* class:tlevent - method: writetodb */ insert events (transaction_id,log_level,description,source,fired_at,object_id,object_type,activity) values (0,2,'','',1503033721,0,null,'') the message : /* class:tlevent - method:

AngularJS views not working -

Image
this project structure the view "index.cshtml" works fine if create view in /views/home , open it, following error: how resolve this?

database - Fetching data from two tables in oracle -

i have 2 result sets : set 1: student| count ------ | ------ mohit | 4 rohit | 2 tanvi | 2 jhanvi | 1 set 2: student| count_star ------ | ------ mohit | 2 rohit | 3 tanvi | 1 arjun | 1 abhay | 3 abhi | 1 expected result set : student| count | count_star ------ | ------ | ---------- mohit | 4 | 2 rohit | 2 | 3 tanvi | 2 | 1 arjun | na | 1 abhay | na | 3 abhi | na | 1 jhanvi | 1 | na can me sql query ? you need union distinct name both table , left join values count count_star select t.student , table1.count, table2.count_star ( select student table1 union select student table2 ) t left join table1 on table1.student = t.student left join table2 on table1.student = t.student

javascript - I am new to node js how to get dependent dynamic dropdown from database -

my node code: app.get('/block_name', function (req,res){ var sql='select `block_name`,`block_id` `tbl_block` '; connection.query(sql,function(err, result) { if (err) throw err; res.json(result); }); }); app.get('/site_name', function (req,res){ var sql='select `site_name`,`site_id` `tbl_site` '; connection.query(sql,function(err, result) { if (err) throw err; res.json(result); }); }); html site <select name="site" id="dropdown" > <option value="">- select -</option> </select> <label class="field" >block</label> <select name="block" id="dropdown1" > <option value="">- select -</option> </select> script <script> $(document).ready(function(){ $.ajax({ url : "/site_name", type : "get",

Azure Event Grid failed retries -

documentation on retries states after pre-defined retries period of 2 hours (24 hours when service gas) retries seized. happens events not delivered successfully? there way store using storage blob? i'm microsoft program manager working on azure event grid team. documentation correct, while in preview service drop messages not delivered in 2 hours. when make service available (no set date yet of typing this) or before increase time 24 hours. idea have storing messages in blob storage considering before make service available.

mysql - counting rows only if on both days of a weekend -

i have table this: id|shift| date| 1| s1|2017-08-12| 2| s2|2017-08-14| 3| s3|2017-08-20| 4| s2|2017-08-26| 5| s3|2017-08-27| 6| s1|2017-08-28| i'd count number of times shifts worked on both days of weekend (saturday , sunday of same weekend) , on both days. in example above, full weekend worked 8/26-8/27 answer should 1. any appreciated. join table itself. (join sundays the previous day). select count(*) yourtable sun -- sunday join yourtable sat -- saturday on sat.shift = sun.shift , sat.date = sun.date - interval 1 day dayofweek(sun.date) = 1 -- sunday

Get specific region of canvas in android -

i using canvas in android , have drew circle 4 partitions in center of screen , radius 300 i blocked how first potion of arc in circle , fill or manipulate progratically , dont want redraw above instead user has drew in first arc want region , repaint in other area i tried getting computebounds gives me region out of first arc i need closed boundry region of first arc in circle has 4 arcs means 4 partitions any or hints appreciated public class circleview extends view { paint paint,paint1,paint2,paint3; public circleview(context context) { super(context); } public circleview(context context, @nullable attributeset attrs) { super(context, attrs); paint = new paint(); paint.setcolor(color.green); paint1 = new paint(); paint1.setcolor(color.black); paint2 = new paint(); paint2.setcolor(color.cyan); paint3 = new paint(); paint3.setcolor(color.magenta); } public

android - React-native : Unable to use react-native-fast-image -

my apps app/build gradle: android:compilesdkversion 23, buildtoolsversion '26' android/build gradle: subprojects { subproject -> afterevaluate{ if((subproject.plugins.hasplugin('android') || subproject.plugins.hasplugin('android-library'))) { android { compilesdkversion 25 buildtoolsversion "25.0.1" } } } } package json dependencies: "react-native-fast-image": "^1.0.0", "react": "16.0.0-alpha.12", "react-native": "0.45.1", i have installed react-native-fast-image, , linked react-native. while running on android , getting error: :react-native-fast-image:compilereleasejavawithjavac - not incremental (e.g. outputs have changed, no previous execution, etc.). d:\react practice\myproject\myproject\node_modules\react-native-fast-image\android\src\main\java\com\dylanvann\fastimage\fastimage

git - can find the password it is asking for Gitlab -

i trying clone project gitlab account laptop. have ssh key on labtop , has been added gitlab account. when try clone project, asking me following password. idk password asking for. ssh key password, account password, or other password. logged docker through terminal this coming up... docker login login docker id push , pull images docker hub. if don't have docker id, head on https://hub.docker.com create one. username (omarjandali): omarjandli password: login succeeded git clone git@107.170.239.166:alpha-testing/opentab.git opentab cloning 'opentab' ... git@107.170.239.166's password: update::: [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = https://github.com/omar-jandali/opentab.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [remote "

ios - Tableview rounded corner not showing up in bottom -

Image
i using corner radius set rounded border of uitableview, following code self.tableview.layer.cornerradius = 8.0 self.tableview.layer.maskstobounds = true but showing without rounded corner in bottom :( if table height proper then, second cell inner view's height greater height. try removing inner view cell or if there no inner view check tableview height. thanks.

How to extract data using XML stylesheet? -

Image
we have xml , need extract line index having patch string <output> <line index="68">patch 26030218 : applied on tue aug 01 08:22:54 edt 2017</line> <line index="69">unique patch id: 21310870</line> <line index="70"> created on 30 may 2017, 10:51:03 hrs pst8pdt</line> <line index="71"> bugs fixed:</line> <line index="72"> 26030218, 25423453</line> <line index="73"></line> <line index="74">patch 25879656 : applied on tue aug 01 08:22:50 edt 2017</line> <line index="75">unique patch id: 21310870</line> <line index="76"> created on 10 may 2017, 06:43:45 hrs pst8pdt</line> <line index="77"> bugs fixed:</line> <line index="78"> 20299015, 21972320, 22502493, 25369547, 18681862

php - Parse sql response to array -

sql response seems this: name|locality|date|address. rows can contains same name, locality , date, addres changed every time. so, need put response array this: [0] => 'name':'...', 'locality':'...', 'date':'...', 'address': [0] => '...', [1] => '...', [2] => '...', ... ... i have tryed use code, does't work =( while($r = mysqli_fetch_assoc($q_res)){ $i = 0; if(!in_array($r['watcher_name'], $daily_quests)){ $daily_quests[$i]['name'] = $r['name']; $daily_quests[$i]['date'] = $r['date']; $daily_quests[$i]['locality'] = $r['locality']; } else{ $daily_quests['address'] = $intrnal_addr[$i => $r['address']]; } } try : //initialisation $name = ''; $daily_quests

r - How to maximize the width of ggplot bar chart? -

Image
assume have used ggplot works quit well. code below: female<-subset(fl_estonia,sex=="f" ) roles<-ggplot(female,aes(role,fill=role))+ geom_bar(col=rainbow(length(table(female$role)))) roles+theme(axis.text.x = element_text(angle = 90,hjust=1),legend.position="none") the output such below picture: point is, plot bit condense, i use empty space on right handside of image? you can example increase width ( width = ... ) and/or space between bars ( position_dodge(width = ...) ) in geom_bar() : ...+ geom_bar(width = 1, position = position_dodge(width = 1)) + in case exactly: female<-subset(fl_estonia,sex=="f" ) roles<-ggplot(female,aes(role,fill=role))+ geom_bar(width = 1, position = position_dodge(width = 1),col=rainbow(length(table(female$role)))) roles+theme(axis.text.x = element_text(angle = 90,hjust=1),legend.position="none") [!] solution not work in rmarkdown or shiny ! have not specified in environ

email - odoo 9 Gmail setup but fetching mails from Gmail not working sometimes -

i had setup gmail setting incoming , outgoing mails. server name : pop.gmail.com port : 995 ssl/tls : true username : blabla@myusername.com password : blabla server priority : 5 and looked working well. but when use project alias email create task through client sending email alias mail, it've been working fine doesn't create task though client sent email alias mail address. so took @ logs @ specific time when client sent email. shows odoo tried fetch mails did nothing. seems there no mails fetch mail sent before time when odoo fetch. is there can go further debug? again works doesn't. setup more verbose logging see if more information. use print statements / pdb debug fetchmail process directly. check lingering mail.mail objects being stored. monitor postgres logs query executions during fetch mail. check emails directly in gmail inbox, check status (read, unread, etc.) odoo may not fetch mail sees being processed.

datetime - Google Spread Sheet Script. Working with Dates -

i reading list of google sheet cells containing datetime, using google script. values in cells are: a1: jul 26 13:00 a2: jul 27 0:00 var datevalues = spreadsheetapp.getactivesheet().getrange("a1:a2").getvalues(); however, values read 1 hour behind. see in debugger: datevalues[0] = wed jul 26 2017 12:00:00 gmt+0200 (eet) datevalues[1] = wed jul 26 2017 23:00:00 gmt+0200 (eet) i guess time zone issue, don't understand concept. time zone currently (due dts) gmt + 3 . indeed, outside dts period gmt +2. spread sheet time zone jerusalem gmt+2. eet - don't underrated why being used. basically, expect in code values in sheet. what concept? there 2 ways solved this use getdisplayvalues () rather getvalues (). force conversions, getdisplayvalues () returns strings not dates make script editor time zone match sheet tz. in case sheet (gmt+2 jerusalem), script editor different (gmt+2 moscow) reason. setting script editor tz, solved problem.

c# - Use GMap.Net with Spatial Data Layers on Map MouseDrag Issue -

i developing window form application gmap asset management, populate tile containing polygon , points on map , , update tile according position of assets (lat/long) on mouse zoom or mouse drag , issue want update layer spacial data having lat/long centered screen.. how can make sure when ever mouse dragged , updated center of screen , give me tile bounds x1,y1,x2,y2 tile in center always. view image, red area on map layer generated lat/long of polygon & points, on mouse dragged update data not center screen. this function called when ever change zoom or drag mouse.. private void updatetilesinview() { int z = (int)this.zoom;//map zoom level double x1 = fromlocaltolatlng(0, 0).lng; double y1 = fromlocaltolatlng(0, 0).lat; double x2 = fromlocaltolatlng(width, height).lng; double y2 = fromlocaltolatlng(width, height).lat; tile tx1y1 = gettilebounds(x1, y1, z); tile tx2y1 = gettilebounds(x2, y1, z); tile tx1

selenium webdriver - Unable to validate title of URL of a website -

i tried validate title of url, code have mentioned below show no error gave wrong output. please see code below: public static void main(string[] args) { webdriver driver=new firefoxdriver(); driver.get("https://www.google.com"); string c; c = driver.gettitle(); if (c!="google") system.out.println("true"); driver.close(); } why output true . title of url google https://stackoverflow.com/a/513839/366348 == tests reference equality (whether same object). .equals() tests value equality (whether logically "equal"). so correct code if (!c.equals("google"))

wordpress - Woocommerce product variation selection with color image or dropdown menu? -

Image
i have product 1 variation. change product image either user can select image color or select value dropdown. suppose user select first image shades images display corresponding color show in drop down menu , change product image or suppose user select color drop down menu select corresponding image. in short user can select 1 either image or color change product image. plz me

java - first questions and answers is repeating when i set into the textview? -

i have lot of questions , answers in mysql database , creating quiz app when set them up, getting questions , answer through mysql database using json first question , answers it. how can set questions , answers how can using loop in code please help? json_string=getintent().getextras().getstring("j"); try { jsonobject=new jsonobject(json_string); jsonarray=jsonobject.getjsonarray("server_response"); if(jsonarray.length()!=0){ jsonobject jo=jsonarray.getjsonobject(count); ques = jo.getstring("questiontext"); options=jo.getstring("options").split("##"); ans = integer.parseint(jo.getstring("correctanswer")); } } catch (jsonexception e) { e.printstacktrace(); } if (savedinstancestate == null) { bundle extras = getintent().getextras(); if (extras == null) { } else { answers=ext

scriptlet - Scripplets not working inside a javascript function -

friends writing code on jsp have use button call class , use method.however when tried same received unexpected output.i tried search reason , came across various related questions still struck don want use el or jstl.so when calling javascript function on button click working put java code lets response.sendredirect("/abc.jsp") page getting redirected before click button.please struck , not able solution.below working fine.but when add java code.it performed without click event. </head> <body> <button id="dounzip" type="submit" name="unzip">unzip</button> <script> document.getelementbyid('dounzip').onclick=function (){ alert("welocome"); }; </script> </body> now below not working <body> <button id="dounzip" type="submit" name="unzip">unzip</button> <script> document.geteleme

How to get all files from all folders in JSON from Google Drive API in Java -

is there chance files in folders in json using google drive api, simple sending method? yes, possible. can use files.list . corresponding request, returns files default. get https://www.googleapis.com/drive/v2/files take closer here . there online demo test it. the java code request this: private static list<file> retrieveallfiles(drive service) throws ioexception { list<file> result = new arraylist<file>(); files.list request = service.files().list(); { try { filelist files = request.execute(); result.addall(files.getitems()); request.setpagetoken(files.getnextpagetoken()); } catch (ioexception e) { system.out.println("an error occurred: " + e); request.setpagetoken(null); } } while (request.getpagetoken() != null && request.getpagetoken().length() > 0); return result; }

c# - filling List<Tuple<string,string>> with linq -

there list of string this {'123', '234', '345', '123c', '456', '234c'} and task create list<tuple<string><string>> , fill every tuple first value 'x' , second value 'xc' example tuple<123,123c> , if there not pair ending 'c' char, put second value null, in tuple tuple<345,null>. there way linq?. you try this: var result = list.groupby(word => !word.endswith('c')) .select(gr => tuple.create(gr.key, gr.firstordefault(i=>i.contains(gr.key)))); essentially, group list elements based on if word ends caracter 'c'. have sequence of keys, words doesn't end character 'c' , associated sequence each of keys words end 'c'. project result in sequence of tuples first element key of gropu , second element corresponding value ends 'c' if exists @ or null if doesn't exists.

javascript - What problems could occur declaring a variable inside an if condition twice? -

what problems occur declaring variable inside if condition twice? i understand not best way of doing it! know can declare variable outside if condition. i'm not looking solution! i'm not looking how can declare variables. want understand why bad approach declare variable inside if-condition block. /* yes know can have condition instead of condition === true, simplicity */ if(condition === true){ var stuckups = "over 9000"; }else if(condition === false){ var stuckups = "nothing"; } alert(stuckups) /* yes can access outside if condition!*/ why bad habit if 1 condition executed, means variable declare once anyway. real problems it? you correct it's not wrong, specified in ecmascript, hoisted top of nearest function definition. this lead problems when having large codebase , "hard" find.

ruby on rails - cannot load such file -- coffee_script -

i'm going remove active_admin angular rails app. ran following commands. rails destroy active_admin:install rails destroy active_admin:resource product and met error. cannot load such file -- coffee_script <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> <%= javascript_include_tag 'application' %> try rake tmp:cache:clear or try adding "gem 'coffee-rails', '~> 4.1.0'" gemfile , running bundle:install .

sql server - Saving datetime to MSSQL database from PHP - throws error -

i have php web app, has been deployed several computers without problem. in 1 case, have problem when saving datetime mssql database. message says: sqlstate[22007]: [microsoft][odbc driver 11 sql server][sql server] conversion of varchar data type datetime data type resulted in out-of-range value. i've been saving datetime format php database date('y-m-d h:i:s') (but need save dates, not current date). when make insert (which throwed error php) directly through sql management studio, works. when saved using php, throws error. now i've edited saving date php date('y-m-d\th:i:s') works on particular instance, i'd rather found way how detect format work when saving datetime php database or change format (i dont know if php configuration, driver or else). i've been searching way found how conversion, etc.

c++11 - C++ map of a key and file doesn't work -

this question has answer here: std::map<>::insert using non-copyable objects , uniform initialization 1 answer handling map of files in c++ 1 answer i want create map of key , corresponding file in c++. used below snipper, giving mean exception @ last line *m_jstabfilesmap[key] << text; : std::map<std::string, std::ofstream*> m_jstabfilesmap; std::string text = "hello all"; std::string key = "a"; *m_jstabfilesmap[key] << text; the copy constructor of std::ofstream explicitely deleted. have store streams pointer or in different way doesn't try copy stream object if want them in map.

sql server - Alternative way to select row value without using scalar value function in sql -

i have 2 table in sql pricetable , targettable . want price item based on few conditions joining 2 tables. 2 tables are, pricetable pricetable image itemrelation fromdate todate amount 12-pbst 2016-09-30 1900-01-01 85.31 12-bbst 2016-08-08 1900-01-01 95.31 12-mbst 2016-09-08 1900-01-01 15.31 12-tbst 2016-07-20 1900-01-01 65.31 targettable target table image itemid itemname periodstart targetquantity 12-pmch meadow chandan 05-01-16 36 12-pmch meadow chandan 06-01-16 36 12-pmgu meadow gulab 04-01-16 36 12-pmlv meadow lavendor 04-01-16 36 have written scalar valued function price , it's working fine when try retrieve less 10 rows. try pull more 50 records takes long time produce results, scalar function is, create function [dbo].[gettargetitemprice](@item nvarchar(50),@date nvarchar(50)) returns integer begin declare @id integer set @id= (select top(1) amount pricedisctable itemrelation

javascript - gulp.src from a separate file doesnt work -

i trying write gulpfile follows : var gulp = require('gulp'); // other dependencies go here .... // source of files var inputs = require('./asset_source.js'); // simple task gulp.task('css', function () { gulp.src(inputs.css) .pipe(debug()) .pipe(plumber()) .pipe(maps.init()) .pipe(concatcss('libs.css')) .pipe(maps.write('../srcmaps')) .pipe(plumber.stop()) .pipe(gulp.dest('assets/css')); }); // watcher gulp.task('watch', function () { gulp.watch('./asset_source.js', ['css']); }); // default task gulp.task('default', ['browser-sync', 'watch']); and source of assets (asset_source.js) file : module.exports = { css: [ 'path/to/a/file.css', 'path/to/another/file.css', ....... ....... ], js: [ 'path/to/a/file.js', 'path/to/another/file.js', ....... ....... ] }