Posts

Showing posts from September, 2010

object() takes no parameters in django 1.10 -

i'm trying allow cors in app, cross-domain javascript client can access api, i've installed django-cors-headers . , i'm trying add middleware: middleware = [ 'corsheaders.middleware.corsmiddleware', # remove , works 'django.middleware.security.securitymiddleware', 'django.contrib.sessions.middleware.sessionmiddleware', 'django.middleware.common.commonmiddleware', 'django.middleware.csrf.csrfviewmiddleware', 'django.contrib.auth.middleware.authenticationmiddleware', 'django.contrib.messages.middleware.messagemiddleware', 'django.middleware.clickjacking.xframeoptionsmiddleware', ] however gives me typeerror: typeerror: object() takes no parameters this worked fine before django 1.10 update. ideas? this issue says django-cors-headers no longer supported, , suggests using django-cors-middleware instead.

java - Retrofit calls are adding up -

i have button in application logging out user's session , when clicked retrofit sends basic post request localhost , technically logged out , if click logout button again following happens: 1st time : 1 request goes through 2nd time click logout : 2 requests made logout @ same time 3rd time click logout : 3 requests made logout and on .. honestly , situation puzzling me , yes use retrofit okhttp interceptors , token management . note : - (tinydb simple shared preference manager) code posted below: apiinterfacer.java - api interface @formurlencoded @post("/api/token/logout") call<basicresponse> log_out(@field("guid") string guid); apiservice.java - api service creator public class apiservice { public static final string baseurl = staticvars.localhost; public static okhttpclient.builder httpclientbuilder = new okhttpclient.builder(); private static retrofit.builder retrofitbuilder = new retrofit.builder().baseurl(baseurl).addconverte

When pushing code to Google Cloud remote repo git manually requires password -

context : try push code google remote repo from git bash , in project folder : ran below cmd : git push --all google and got : fatal: remote error: invalid username/password. may need use oauth token password; note generated google.com passwords not compatible private repositories investigation i have tried possible solution there link as explained, tried command unset manager settings , got: $ git config --system --unset credential.helper error: not lock config file c:\program files\git\mingw64/etc/gitconfig: permission denied to bypass permission denied, ran git bash in admin mode, worked !! :smiley: then retried push code gcloud : git push --all google username 'https://source.developers.google.com': "username input " `*( put gmail adress not sure if it's right thing)*` then after validating username got openssh pop asking me password.... tried 1 gmail adress...and failure username 'https://source.developers.google.com'

angularjs - Angular and Laravel Apache / htaccess Rules -

i deploying angular , laravel application on apache2 / ubuntu 14. i having issues rewrites make work ok. the angular application redirected index needs call laravel api routes. i using laravel few api routes i using angular ui router in html5 mode. i have set laravel application render: route::get('/', function () { return file::get(public_path().'\index.html'); }); in apache or htaccess should render angular html file or render index.php renders angular html file? my angular htaccess file options -multiviews rewriteengine on # redirect trailing slashes if not folder... rewritecond %{request_filename} !-d rewriterule ^(.*)/$ /$1 [l,r=301] # handle front controller... rewritecond %{request_filename} !-d rewritecond %{request_filename} !-f rewriterule ^ index.php [l] # handle authorization header rewritecond %{http:authorization} . rewriterule .* - [e=http_authorization:%{http:authorization}] my apache virtual host file

javascript - Import and syntax highlight code from external source -

i'm not front-end developer , have been struggling hours highlight.js want. need display code nicely in blog. okay, works in renders code post into <pre><code>...</code></pre> ...very nicely , colourfully chosen style, idea.css example. i've got styles , highlight.pack.js ready go in directory. but messy paste whole program between tags! more cleanly reusable other things if code can stay in file. what shortest , elegant way (without loading in external libraries if possible) pull code out of python file in same directory mycode.py in between tags? the main reference library here . i assuming code file highlight lives on webserver. import file using jquery get . put content code tags. call appropriate function hightlight.js make highlight code . here html/js code: <pre><code></code></pre> <script type="text/javascript"> $.get("/mycode.py", function(response) { //(1)

Angular 2 app cannot find my directory -

in console in browser says: app/app.module.ts(4,33): error ts2307: cannot find module 'customer/app.customer'. app/customer/app.customer.service.ts(1,29): error ts2307: cannot find module 'customer/app.customer.model'. app/customer/app.customer.ts(2,29): error ts2307: cannot find module 'customer/app.customer.model'. app/customer/app.customer.ts(3,31): error ts2307: cannot find module 'customer/app.customer.service'. those files created! this basic app. did make new directory , generated project angular's quickstart guide. main.ts import { platformbrowserdynamic } '@angular/platform-browser-dynamic'; import { appmodule } './app.module'; platformbrowserdynamic().bootstrapmodule(appmodule); app.module.ts @ngmodule({ imports: [ browsermodule ], declarations: [ appcomponent, customercomponent ], bootstrap: [ appcomponent ] }) export class appmodule { } app.component @component({ selector: 'my-app'

java - Cannot set Spark memory -

i trying set max memory spark application running locally. have tried many different ways. in program sparkconf conf = new sparkconf(); conf.setmaster("local[2]"); conf.setappname("app"); conf.set("spark.executor.memory", "4g"); conf.set("spark.driver.memory", "4g"); sc = new javasparkcontext(conf); and when executing ./bin/spark-submit.cmd ./local/app.jar --master local[2] --driver-memory 4g but following info [memorystore] memorystore started capacity 366.3 mb and spark spills rdd disk. spark version 2.0. what do? when running locally, spark not used more memory java process has available. should try running application memory vm params: -xms2048m -xmx4096m

Where are NSUserDefaults stored on El Capitan? -

in mac xcode project have bundle identifier of "com.gargoylesoft.dts-macos". i'm trying blow away stored defaults on user did this: find ~ -name 'com.gargoylesoft.d*' -exec rm -rf {} \; when run app, through xcode, i'm still getting values previous runs when query nsuserdefauls . in world storing this??? you must never delete (or edit) preference files directly on macos! macos caches preferences using background daemon named cfprefsd . daemon won't notice delete (or alter) files, keeps cached copy in ram expire if system gets memory pressure. memory pressure means: app needs ram no unused ram available, system signals memory pressure, causing kind of system services flush caches still better swapping disk (will work in own application, try use nscache when caching data, automatically react memory pressure). if want delete prefs, use defaults in terminal, this # defaults delete com.gargoylesoft.dts-macos this delete file , make su

amazon web services - Why does grails websockets connection fail but continue to receive messages that have been subscribed to in the browser while using an AWS ELB? -

using grails 2.5.5 spring-websockets plugin 1.3.1 , tomcat 8.0.37. while using aws elastic load balancer, following error shown in javascript console when loading application in browser websocket connection 'ws://...s.com/application/stomp/059/uyqk9cdn/websocket' failed: error during websocket handshake: unexpected response code: 400 from research has been found elb doesn't support websockets , proxying within elb, third party load balancer or potentially using new application load balancer (the applications not in vpc not easy solution) might required. however, after error, following logging received: web socket opened... >>> connect accept-version:1.1,1.0 heart-beat:10000,10000 <<< connected version:1.1 heart-beat:0,0 user-name:admin connected server undefined >>> subscribe id:sub-0 destination:/topic/sometopic messages received client fine when broadcast <<< message destination:/topic/sometopic content-type:applica

javascript - How to use es6 import for images -

i'm using es6 , want import image use webpack. looking @ file-loader doc , example gave: var url = require("file!./file.png"); url return /static/351f9446b3ba577b6a79e373e074d200.png this works require, how use import this, i've tried - import * url '../images/151.png'; but doesn't work because url remains undefined. how set variable i'm importing when it's image? import * url '../images/151.png'; but doesn't work because url remains undefined. how set variable i'm importing when it's image? using webpack 2.0 file-loader plugged-in. works in case, import returns object bytemap instead of data-uri string; and object has 'default' property, contains same data, if required. honestly im'not sure object, , why there default property thats how i'v made works. import '../css/bootstrap.css'; import '../css/app.scss'; import * url '../images/webpack_logo

python - How to select json data randomly -

i have following json file , need way randomly select json data , prints value. json file : { "base": [{"1": "add"},{"2": "act"}], "past": [{"add": "added"},{"act": "acted"}], "past-participle": [{"add": "added"},{"act": "acted"}], "s-es-ies": [{"add": "adds"},{"act": "acts"}], "ing": [{"add": "adding"},{"act": "acting"}] } example user_input = 'past' >> past code randomly selects 'add' or 'act' past >> add prints out value >> added use random.choice supplying choices sequence contained selected key : user_input = input('> ') > past list(choice(j[user_input]).values())[0] out[177]: 'added' factor in function make more compact: d

ASP.NET / C# - Ajax Cascading DropDown - Second DDL Not Populating -

i'm creating simple web form driven cascading ddl. first list populates list of given values; second populated sql query selected value in first ddl acting parameter second's query. seems simple enough piecing examples found online, but, unfortunately, second ddl not populating @ all. i've checked query fine , populate when clause / parameter eliminated. here's code: c# using ajaxcontroltoolkit; using system; using system.collections.generic; using system.linq; using system.web; using system.web.services; using system.data; using system.data.sqlclient; using system.configuration; namespace web_form___chart_review { /// <summary> /// summary description programcs /// </summary> [webservice(namespace = "http://tempuri.org")] [webservicebinding(conformsto = wsiprofiles.basicprofile1_1)] [system.componentmodel.toolboxitem(false)] // allow web service called script, using asp.net ajax, uncomment following line. [system.web.script.services.sc

office365 - How to know which occurrence of recurring event has been removed? -

Image
my app has subscription office365 calendar called conferenceroom. when event created/modified/deleted office365 servers send notification application of 3 happened. in calendar create recurring event standup meeting every monday (via browser). after app gets notification changetype: created , here recurring part of notification's event: recurrence: { pattern: { type: 'weekly', interval: 1, month: 0, dayofmonth: 0, daysofweek: [object], firstdayofweek: 'sunday', index: 'first' }, range: { type: 'noend', startdate: '2016-09-12', enddate: '0001-01-01', recurrencetimezone: 'fle standard time', numberofoccurrences: 0 } }, and whole data of event (id got notification): { '@odata.context': 'https://outlook.office.com/api/v2.0/$metadata#users(\'2ce6a929-0b04-40fb-9c73-d812370e0d46%40ea38f869-d755-40c7-9c95-e6277325b7ae\')/events/$

Does SQL Server expand a view's sql inline during execution? -

let's have (hypothetical) table called table1 500 columns , there view called view1 select column1, column2,..., column500, computedorforeignkeycolumn1,... table1 inner join foreignkeytables ..... now, when execute select column32, column56 view1 which 1 of below 3 sql server turn into? query #1: select column32, column56 (select column1, column2,..., column500, computedorforeignkeycolumn1,... table1 inner join foreignkeytables ......) v query #2: select column32, column56 table1 query #3: select column32, column56 (select column32, column56 table1) v the reason i'm asking have wide table , view sitting on top of (that inner joins bring texts foreign key ids) , can't figure out if sql server fetches columns , selects ones needed or fetches needed (while ignoring unnecessary joins etc)...if former view not best performance. sql server query compilation can split ph

mysql - COALESCE and IFNULL not working as expected -

i'm trying output default row when there's no row found in query. sample of query: select coalesce(site, 'ste') site, instrument, field table1 site in ('east', 'west') , date(tstamp) = "2016-09-07" order id desc the output is +------+------------+-------+ | site | instrument | field | +------+------------+-------+ | west | 0 | 0 | +------+------------+-------+ for tsamp 2016-09-07 have row site "west" , there's no row "east". tried search , found can use coalesce , tried ifnull i'm getting output above. tried if(count(site) = 0, "ste", site) can't work. my expected result +------+------------+-------+ | site | instrument | field | +------+------------+-------+ | west | 0 | 0 | | ste | null | null | +------+------------+-------+ i hope guys can me. in advance both coalesce() , ifnull() work on row basis, meaning can replace null value if

regex - python pandas.Series.str.contains words with space -

i'm trying find strings contain either " internet ", " program ", " socket programming " in pandas dataframe. df.col_name.str.contains(" internet | program | socket programming ", case=false) is right way so? or need escape space using \ , raw string? here small demo: in [250]: df out[250]: txt 0 internet 1 there no internet in apartment 2 program2 3 learning socket programming in [251]: df.txt.str.contains(" internet | program | socket programming ", case=false) out[251]: 0 false 1 true 2 false 3 true name: txt, dtype: bool if want "match" first row: internet : in [252]: df.txt.str.contains(r"\b(?:internet|program|socket\s+programming)\b", case=false) out[252]: 0 true 1 true 2 false 3 true name: txt, dtype: bool

xcode - iOS app localisation, how to organise localisable data? -

i have app, quizzes , have bunch of questions in localise. ui , resources easy done, data? i have 1 solution in mind, add additional flag model, smth 'locale' (for example {locale: "eng"} , filter data storage according user settings, wonder there way. couldn't find far. yes there better way one. have add strings files in project each language want show in app. can refer a internationalisation tutorial !

javascript - Can't figure out regex match, how far off am I? -

super basic question (which admittedly shouldn't post on so, here goes): i'm trying create regex match (and exclude function) links begins //images , cannot life of me work. right have: $('a:not([href^=/\/\images])').each(function(){ but since isn't correct, , don't know begin looking set straight, i'm asking advice. i'm used escaping strings etc., seems quite different(?). also, tried using http://regexr.com/ , https://txt2re.com/ (didn't understand how work latter...) feel have no clue put @ point since i'm guessing. again, sorry posting such basic question, right gibberish me, sadly. this has little jquery or regular expressions. you're asking css selector has different behaviour altogether. problem /\/\ vs \/\/ . note don't have escape slashes here. let images = document.queryselectorall('a:not([href^="//images"])'); console.log(images); <a href="//images/cat.jpg">

python 3.x - Unicode characters to Turkish characters -

(edit: original question posted here, issue has been resolved , code below correct). looking advice on how convert unicode characters turkish characters. following code (posted online) scrapes tweets individual user , outputs csv file, turkish characters come out in unicode characters, i.e. \xc4. using python 3 on mac. import sys default_encoding = 'utf-8' if sys.getdefaultencoding() != default_encoding: reload(sys) sys.setdefaultencoding(default_encoding) import tweepy #https://github.com/tweepy/tweepy import csv import string import print #twitter api credentials consumer_key = "" consumer_secret = "" access_key = "" access_secret = "" def get_all_tweets(screen_name): #twitter allows access users recent 3240 tweets method #authorize twitter, initialize tweepy auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.set_access_token(access_key, access_secret) api = tweepy.api(auth) #initialize list hold tweepy t

php - Laravel Elixir Public Path -

Image
how can change laravel elixir public path? change laravel root directory this: but when execute command gulp show error: fetching version source files... - layout/assets/css/styles.css <-- not found saving to... - public/build i tried in gulpfile.js, doesn't work. =/ elixir.config.publicdir = '../'; /* |-------------------------------------------------------------------------- | elixir asset management |-------------------------------------------------------------------------- | | elixir provides clean, fluent api defining basic gulp tasks | laravel application. default, compiling sass | file our application, publishing vendor resources. | */ elixir(function(mix) { // mix.styles('styles.css', 'public/layout/assets/css') mix.version(['../layout/assets/css/styles.css']); }); you can change destination path (and source path, optional parameter here set null) in mix.styles: mix.styles('style

terminal - Python: how to instal "requests" -

i have python version 3.5.2. trying use requests called through import requests following error: traceback (most recent call last): file "<pyshell#26>", line 1, in <module> import requests importerror: no module named 'requests' reading guides, can see have instal module because not present in system. so downloaded file don't know do. have read should instal on terminal (i have mac). have never used terminal: code should used? first check version of python shell running; python 3 executable installed python3 in /usr/bin (or wherever else installed; ie. /usr/local/bin) , i've seen plain python on machines depending on how installed. python --version if see python 3.5.2 ; run: python -m pip install requests if not; try doing same python3 instead of python .

tsql - Why using COUNT with SELF JOIN gives different result value -

Image
can explain me why if use self join , count gives me different result using count command? same table controlno column. value in column not unique. query gives me total counts 15586 . select (select count(controlno) tblquotes q1 q1.controlno = a.controlno ) quotedtotal tblquotes inner join lstlines l on a.lineguid = l.lineguid l.linename = 'earthquake' , year(effectivedate) = 2016 but then, if run query gives me total counts of 15095 . select count(controlno) quotedtotal tblquotes inner join lstlines l on a.lineguid = l.lineguid l.linename = 'earthquake' , year(effectivedate) = 2016 what changing total amount , why? , why use first scenario? , way modify first query sum of 15586 without breaking down each row? thank it seems because field controlno not unique , there records sharing value, although not of them join against lstlines table condition. last query

java - RESTEasy 404 not found -

i'm trying create api using resteasy, i've been looking hours on differents topics none resolve issues. i spent 1 hour trying different url's, none worked, project used work when using jersey fact i'm on wildfly 10 it's bit complicated deal without runtime (or maybe not lost time configuring i'm exhausted such steps). here web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd" id="webapp_id" version="3.1"> <display-name>api</display-name> <servlet> <description>jax-rs tools generated - not modify</description> <servlet-name>resteasy</servlet-name> <servlet-class>org.jboss.resteasy

java - Kafka Consumer Properties to read from the maximum offset -

i have written java kafka consumer. make sure how explicitly ensure once kafka consumer started reads messages sent producer time onwards i.e. should not read messages have been sent producer kafka. can explain how ensure this? : here snippet of properties use properties properties = new properties(); properties.put("zookeeper.connect", zookeeperhost); properties.put("group.id", group); properties.put("auto.offset.reset","largest"); consumerconfig consumerconfig = new consumerconfig(properties); consumerconnector = consumer.createjavaconsumerconnector(consumerconfig); update sept14: i using following properties, seems consumer still reads beginning @ times, can tell me what's wrong now? i using kafka version 0.8.2 properties.put("auto.offset.reset","largest"); properties.put("auto.commit.enable","false"); based on answers above, seems correct mechanism follows setting properties

jquery - Extra comma when concatenate JavaScript Arrays -

Image
i trying write few javascript arrays csv file. however, need add line break @ locations. following code works, accidently add , first element in row 2 (or add , since row 2). wondering caused this? in advance! current output chemical, cas, mw , water, 00566, 666 desire output chemical, cas, mw water, 00566, 666 code var chem1 = "water" var cas1 = "00566" var mw1 = "666" var csv_content = [] var csv_content_final = [] csv_content[0] = ["chemical, cas, mw"]; var chem_property = [chem1, cas1, mw1]; csv_content[1] = chem_property; (kkk = 0; kkk < ($(csv_content).size()); kkk++) { csv_content_final[kkk] = csv_content[kkk] + '\n'; } alert(csv_content_final) jsfiddle the reason , because definition csv format ' c omma s eparated v alues' a new line not considered delimiter, comma. edit: if want not have comma @ start, work: console.log(csv_content_final.join('')); http://fiddle.j

subquery - Sub-queries in MySQL -

i have 2 working queries , i'm having hard time figuring out how make 2nd subquery in first query. query 1: select w.ws_property_id wid, w.property_type wprop watershed_property_info w exists (select distinct w.property_type st_property_info s w.property_type=s.property_type) query 2: select d.st_property, count(d.rental_date) st_rental_dates d year(rental_date) = '2015' group st_property the result should return d.rental_date in st_rental_dates 244 matching st_property rows in st_rental_dates every time try combine these 2 queries 14,888 rows. i'm having hard time understanding put when doing sub-queries. advice?

OWASP ZAP proxy over ssh tunnel -

i have remote machine running docker owaspzap image. when connect directly machine , run command curl http://localhost:8080 i default zap proxy homepage. when setup ssh tunnel machine (lets bound local port 52000 remote port 8080) error when running curl http://localhost:52000 zap error [java.net.connectexception]: connection refused stack trace: java.net.connectexception: connection refused @ java.net.plainsocketimpl.socketconnect(native method) @ java.net.abstractplainsocketimpl.doconnect(abstractplainsocketimpl.java:339) @ java.net.abstractplainsocketimpl.connecttoaddress(abstractplainsocketimpl.java:200) @ java.net.abstractplainsocketimpl.connect(abstractplainsocketimpl.java:182) @ java.net.sockssocketimpl.connect(sockssocketimpl.java:392) @ java.net.socket.connect(socket.java:579) @ java.net.socket.connect(socket.java:528) @ java.net.socket.(socket.java:425) @ java.net.socket.(socket.java:280) @ org.apache.commons.h

mysql - Use text from record to paste into an Access form controlbox -

based on user's job id number, create recordset of id different unit types (think pipe sizes) , unit (think footage of pipe). each unit type record has name of form textbox total footage goes in different column. want go through each recordset , plugin footage each unit type job id number (that user puts in form). dim rst_unitentrycounts recordset set rst_unitentrycounts = currentdb.openrecordset("select tbl_unittypes.unittypes_weeklytextboxuserentryform, " _ & " tbl_pmentry.pmentry_week_ending, " _ & " tbl_unittypes.unittypes_cumalativetextboxuserentryform, " _ & " sum(tbl_unitentry.unitentry_unit_count) sumofunitentry_unit_count " _ & "from tbl_unittypes

PHP how to handle when there is no foreach loop? -

i have foreach loop runs without flaw. foreach ($row $row) { echo $row['id']; } there times there no rows returned. want echo out 'there no rows'; when there no rows. problem if try follows: foreach ($row $row) { if (!isset($row['id'])) { echo 'there no rows'; } else { echo $row['id']; } } it never returns echo "there no rows". assume because when there no rows, foreach loop doesn't run. question becomes, how echo "there no rows" if , if there no rows while not interfering foreach when there rows. i have tried code such as: $row1 = $stmt->fetch(); $row = $stmt->fetchall(); if (isset($row1['id'])) { foreach ($row $row) { still no luck so desired outcome follows: when loop runs: 1 2 3 4 when loop doesn't run: there no rows you should check before loop so if(count($row)>0){ //foreach ... }else{ echo 'no data'; }

sorting - Javascript - sort colors based on visible difference -

i have array of rgb values: var arr = [[255, 255, 255], [100, 100, 100], [255, 0, 0], etc...] i wanting arrange rgb values based on visible difference using ciede2000 part of https://github.com/markusn/color-diff similar colors close together. what have been doing far converting rgb values lab, creating second array of arrays. each value [i, difference] i represents original place in first array difference value refers to. , difference value difference calculated ciede2000 between specific color in original array , black. then sort second array ascending difference. problem doesn't result in sorted array i'm looking for. imagine following scenario: original colors: [[dark blue], [orange], [light blue], [slightly brighter orange]] (i'm not writing rgb values clarity sake.) that sorted [[dark blue], [orange], [slightly lighter orange], [light blue]] the problem blues split up. split because dark blue closest visually black , light blue farthest. th

Refreshing a div using javascript in PHP -

Image
so creating approve or deny page several users in php , page building needs refresh 1.what trying refreshing specific div function refresh in javascript working there sudden duplication of div. i checked several times , there no double(2) input="type" search. what line should modify in remove duplicate search in div ref1 ? can guys please suggest alternative way refresh div ? <style> #ref2{ background-color: darkseagreen; } #ref1{ background-color: pink; } </style> <body> <div id="ref1"> shortcut preview ** php -> isset ....add, delete, approve, search view content (select * dbname) see image ^ </div> <div id="ref2"> <form action="tor.php" method="post"&g

laravel 5 - OctoberCMS Builder Plugin to Show Data on Front End -

this first time use octobercms, , provide builder plugin in order developer builds plugin in minutes. i try use plugin show data on front end when using components > builder > record list , documentation didn't give enough example data fields. example on internet show how data 1 field. my code shown below: [builderlist] modelclass = "budiprasetyo\employees\models\employee" scope = "-" displaycolumn = "name" norecordsmessage = "no records found" detailspage = "-" detailsurlparameter = "id" pagenumber = "{{ :page }}" in case, want data not "name" field, want add "email", "facebook" fields. i have tried make into: displaycolumn = "name", "email", "facebook" but returns no data shown , have tried make array: displaycolumn = ["name", "email", "facebook"] and it's same result, no data shown. i

scala - Intellij not understanding a String method -

Image
the following not compiling in intellij: val leader = "_" * 8 val nameplaceholder = " " * 12 naturally code fine in repl : scala> val leader = "_" * 8 leader: string = ________ scala> val nameplaceholder = " " * 12 nameplaceholder: string = " " providing "assistance" intellij did not have effect: e.g. import stringlike._ or val leader = "_".*(8) any ideas how mollify ij ? on 2016.2 ultimate

php - Displaying a custom notice on Emails based on item custom field highest value -

on woocommerce have custom field days_manufacture each product different (integer) values. also have code displays message on cart page highest value of "days of manufacture" : add_action('woocommerce_before_cart', 'days_of_manufacture'); function days_of_manufacture() { $day_txt = ' ' . __('day', 'your_theme_domain_slug' ); $days_txt = ' ' . __('days', 'your_theme_domain_slug' ); $text = __('your order produced in: ', 'your_theme_domain_slug' ); $max_days = 0; foreach( wc()->cart->get_cart() $cart_item ) if($cart_item['days_manufacture'] > $max_days) $max_days = $cart_item['days_manufacture']; if($max_days != 0) { if ($max_days == 1) $days_txt = $day_txt; $output = $text . $max_days . $days_txt; echo "<div class='woocommerce-info'>$output</div>"; }

java - User input from scanner method to array of 5 indexes also gives user ability to delete any index -

user input scanner method array of 5 indexes gives user ability delete index matching string 1 of index. want achieve in in while loop settle city (option 1), means creating 1 can see code. user type name no restrictions. once settle city loops starts again. remember user created city earlier. can have upto 5 cities. there cost associate settling new city. know how conditionals. not sure string array. arraylist or array class not allowed. where as, option 2 can demolish of city have created giving user lists of city have made earlier. have keep minimum of @ least 1 city. if wondering based on civilization game. please ask clarification may not straight forward. thanks while (playing) { system.out.println("\nplease make selection!"); system.out.println("\n1. settle city" + "\n2. demolish city" + "\n3. build militia" + "\n4. research technology"

google bigquery - Upload CSV files as partitioned table -

i have folder of csv files separated date in google cloud storage. how can upload directly bigquery partitioned table? you can following: create partitioned table (for example: t) run multiple load jobs load each day's data corresponding partition. example, can load data may 15th, 2016 specifying destination table of load 't$20160515' https://cloud.google.com/bigquery/docs/creating-partitioned-tables#restating_data_in_a_partition

draw - cocos2dx 3.13 - DrawNode with animation -

i newbie in cocos2d-x 3.13, want draw animation in drawnode video: art gurus . draw line same when draw hand. suggest solutions ? thanks in openframeworks, ofpath . afaik, cocos2dx has no such class, need create own.

javascript - span tags not getting applied after using regular expression -

the following function working , noticing strange behavior. inside $("#mypanel").on('cellclick', function (event) , not seeing highlighted class getting applied along span tags. see span tags applied following line of code: html = html.replace(new regexp(records[i].concept_text, 'ig'), '<span style="color:' + color + ';">' + records[i].concept_text + '</span>'); . for example : <span style="background-color:#f3f315;"><span style="background-color:#f3f315;">myeloma</span></span> . on other hand, jsfiddle doing same thing works fine here what issue in code? this.mydocument = function (data_) { var source = { localdata: data_, datafields: [{ name: 'doc_content', type: 'string' }, { name: 'concept_text',