Posts

Showing posts from May, 2010

sitecore8 - Sitecore 8.1 email experience manager - How to create a segmented list? -

Image
i new sitecore 8.1 , having problem in creating segmented list in email experience manager. have created new profile sitecore, want can assign segmentation rules profiles , create segmented list. as can see in 1st image right hand side stated " matched condition: 4 ", however, in section below "contacts", equal 0. in 2nd image, 4 profiles have unique email can searched within sitecore system (they juju.shen123, juju.shen444, juju.shen333 , juju.shen111). why cannot displayed while creating segmented list? can me on this? lot! 1st image 2nd image it needs sometime process list. several minutes. so, have tea/coffee , contacts appear.

php - Math operation in yii 2 Active Query -

is there way subtract value in int column 1?i have button when clicked call function save data in table want know how subtracting number in database using yii 2 have tried following code below had no effect. can me how make math operations in yii 2? public static function addsubject($subjectid, $clientid){ $subject = activecurriculum::findone(['subjectid' => $subjectid]); $activesubject = new activesubject(); $activesubject->clientid = $clientid; $activesubject->subjectid = $subject->subjectid; $activesubject->subjectcode = $subject->subjectcode; $activesubject->days = $subject->days; $activesubject->time = $subject->time; $activesubject->section = $subject->section; $activesubject->room = $subject->room; $activesubject->units = $subject->units; $subject->units = $subject->units - 1; //this should subtract number //of slots 1 not working. $activesubject->save(); ...

Why Push Pull Can not work in this manner? -

Image
why push pull type wrong? want switch positive or negative. can explain me? because haven't limits of current , / or tension. in pnp, , npn transistors, in pin allways blow-up transistors. suppose in pin @ 0v or gnd. pnp transistor have more -0,7v of vbe , blows up. same every voltage of in pin below of vcc-0,7v = 11,3v. the pnp transistor not blows if 11,3v<=in<=12v=vcc. when in in high (11,3v<=in), vbe of npn if more 0,7v , blows npn transistor. you need resistor limit current , tension of both bases of transistor (r in serial base) moreover. in both circuits, when in's voltage vcc/2=6v. both transistors saturated , acts shortcircuit (vce 0v). there not limits current , blow both transistors. when change 1 0 or change 0 1, both transistors blows up you need sure 1 transistor active, saturated or closed, , not other transistor (opened)

c++ - Enable/disable OpenMP locally at runtime -

is possible enable or disable openmp parallelisation @ runtime? have code should run in parallel under circumstances , not in parallel under different circumstances. @ same time, there other computations in other threads use openmp , should run in parallel. there way tell openmp not parallelise in current thread? know of omp_set_num_threads , assume globally sets number of threads openmp uses. an alternative can use add if condition #pragma omp constructs. these skip invocation openmp runtime calls derived pragmas whenever condition false. consider following program uses conditionals based on variables t , f (respectively true , false): #include <omp.h> #include <stdio.h> int main (void) { int t = (0 == 0); // true value int f = (1 == 0); // false value #pragma omp parallel if (f) { printf ("false: thread %d\n", omp_get_thread_num()); } #pragma omp parallel if (t) { printf ("true : thread %d\n", omp_get_thr...

css - Flex box is not working in Safari 5.1 -

i getting sooooo frustrated .... using flex box table , working great chrome , firefox not in safari. safari version 5.1. tried find out solution on net cudnt find it. people asked use display: -webkit-box not working too. magic trick ????????? i tried fixes has been told on net. here code .my-table ul li { display: -webkit-flex; display: -webkit-box; display: -ms-flex; display: flex; } flexbox works in safari 5.1.7 i used project notice of flex properties didn't work. flex-wrap, flex-direction, flex-grow, , etc. display: -webkit-box; display: -moz-box; display: box; display: -webkit-flex; display: -moz-flex; display: -ms-flexbox; display: flex;

Import css files in LESS vs. enqueue styles in wordpress -

Image
i want know there problem importing plugin styles including bootstrap working stylesheet.less , compile of them stylesheet.css instead of using wp_enqueue_style , minify , compine of them cache plugins? result same (1 minified css) want know there standard not allow importing instead of enqueue? it depends on lot's of factors, better enqueue 1 stylesheet.css if less files being compiled 1 file. note imported concatenated 1 file because from page speed standpoint, @import css file should never used, can prevent stylesheets being downloaded concurrently. another difference compiling happening locally before upload server, quite obvious faster compared loading cache plugins etc. same you. that being said if have server running http/2 downloading lot of tiny style sheets won’t matter, http requests cheap in world of http/2. organizing css-files according page-templates on used far better. can serve code visitor needs. i'm trying may not need cache plugins ...

Instaparse: there's an error but it is not reported -

i trying build grammar instaparse. quite find code fails first assertion, emitting "empty list": (defn parse-it [] (let [parser (insta/parser ebnf) res (insta/parses parser input) _ (assert (seq res) (str "empty list")) choices (count res) _ (assert (= choices 1))] (first res))) i resolve problem, involves trial , error. there way error can pinpointed? an example of fixing problem removing trailing spaces file becomes input in above code. edit based on stefan's answer i've changed code: (defn parse-it [] (let [my-parser (insta/parser ebnf) xs (insta/parses my-parser input) num-choices (count xs) msg (cond (zero? num-choices) "insta/parses might able corrected" (> num-choices 1) (str "insta/parses shows more 1 way parse: " num-choices) (= 1 num-choices) "insta/parses shows 1 choice, good") res (con...

spring-data-cassandra 1.5.0.M1 BeanInstantiationException -

Image
when running spring boot application, getting following beaninstantiationexception: org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'samplecassandraapplication': unsatisfied dependency expressed through field 'repository': error creating bean name 'customerrepository': cannot resolve reference bean 'cassandratemplate' while setting bean property 'cassandratemplate'; nested exception org.springframework.beans.factory.unsatisfieddependencyexception: error creating bean name 'cassandratemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/cassandra/cassandradataautoconfiguration.class]: unsatisfied dependency expressed through method 'cassandratemplate' parameter 0: error creating bean name 'session' defined in class path resource [org/springframework/boot/autoconfigure/data/cassandra/cassandradataautoconfiguration.cla...

c# - Database not getting created on EntityFramework-CodeFirst Approach -

i new entityframework.i trying create database using codefirst approach of entityframework. have code in dal layer here : [table("category")] public class category { [key] public int categoryid { get; set; } [required] [column(typename="varchar")] [stringlength(200)] public string categoryname { get; set; } } public class databasecontext:dbcontext { public databasecontext() : base("dbconnection") { //added following still doesnt work //database.setinitializer<databasecontext>(new createdatabaseifnotexists<databasecontext>()); } public dbset<category> categories { get; set; } } connection string in app.config file of dal layer <connectionstrings> <add name="dbconnection" connectionstring="data source=(localdb)\v11.0;initial catalog=dbpdtcgry;uid=admin;password=admin123;" providername="system.data.sqlclient"></a...

Handle transaction when invoking SQL stored procedure in side a C# loop -

i'm working on system developed other developers. , in system have invoked stored procedure use insert records in side loop in c# without using user define table types. and need add transaction scenario. problem have no idea place have transaction. i know whether have in c# code warping loop or inside stored procedure. you can have inside c# loop. transaction started inside procedure must commit before procedures exits. sql server checks @@trancount before , after running procedure , if results don't match exception raised. impossible procedure start transaction has committed caller. the easiest think wrap c# code in transaction scope: using(var scope = new transactionscope( transactionscopeoption.required, new transactionoptions() { isolationlevel = isolationlevel.readcommitted })) { // work here scope.complete(); } note passing isolationlevel = isolationlevel.readcommitted critical .

Swift (Xcode 7.3.1) and sorting using values in a Dictionary -

i have array of dictionaries appears below , want sort , store such objects sorted based on 'value' of 'like' key ? how do in swift ? thanks. { dislike = 0; = 5; username = t; } { dislike = 0; = 0; username = s; } { dislike = 0; = 10; username = n; } i suppose that's array of dictionaries? if case, can sort them follows //anyobject in case number nsnumber var array: [[string:anyobject?]] = yourarray array.sort{ $0["like"]!! > $1["like"]!! } basically mutates array , sort based on "like" key.

sonarqube - Directory excluding in sonar-project.properties file doesn't work (for me) -

i have excluded directory in project properties sonar doesn't exclude it. can me find problem? sonar.sources=./ sonar.exclusions=./utility/excel/** i realized first should have written directory name below exclude folders , file on directory: sonar.exclusions=utility/excel/**/* second should have used comma separated directory names exclude more 1 directory: sonar.exclusions=utility/excel/**/* , utility/mailer/**/*

JAVA get unit of measure and measurement from a string -

i have string: string = "2 ltr. btl., select varieties when buy 6 $1.25 ea.-50¢ mix or match"; is possible extract unit of measurement given string? (2 ltr) note: unit of measurement , measurement appear anywhere in string. edit: 1 of these keywords should appear oz. oz lbs. lbs lb. lb kg. kg k g. g pk. pk ea. ea ml. ml pck. pck ct. ct qt. qt liter ltr ltr. fl oz fl oz. i unit of measurement , corresponding measurement. the regex extract amount (with optional decimal part) , measure unit is: (?x)\d+(?:\.\d+)?\s+ (?: (?:fl )?oz(?:\.|\b)|lbs?(?:\.|\b)|kg(?:\.|\b)|kg?\b|g(?:\.|\b) | pc?k(?:\.|\b)|ea(?:\.|\b)|ml(?:\.|\b)|[cq]t(?:\.|\b) | liter\b|ltr(?:\.|\b) ) demo: https://regex101.com/r/uz7yz6/4 corresponding java code: string input = "2 ltr. btl., select varieties when buy 6 $1.25 ea.-50¢ mix or match"; pattern pattern = pattern.compile( "(?x)\\d+(?:\\.\\d+)?\\s+" + " (?:" + ...

php - Too many redirects error -

my .htaccess file has 3 rewrite rules, i'm facing redirect issue: rewriteengine on rewritebase / rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] rewritecond %{remote_addr} =ip block goes here rewritecond %{remote_addr} =another ip block goes here rewritecond %{request_uri} !^/blocked rewriterule ^(.*)$ http://www.myhost.com/blocked [r=307,l] rewritecond %{remote_addr} !=authorized ip here rewritecond %{request_uri} !^/maintenance rewriterule ^(.*)$ http://www.myhost.com/maintenance [r=307,l] errordocument 400 /400.php errordocument 401 /401.php errordocument 403 /403.php errordocument 404 /404.php errordocument 500 /500.php the problem if blocked ip tries access site when under maintenance, receive "incorrect redirect" error. how stop rewrite processing if ip 1 of denied ips? you can use: rewriteengine on rewritebase / rewritecond %{remote_addr} =ip block goes here rewritecond %{remote_addr} =another ip bl...

java - Longest Subsequence where an integer in the output is 5 times greater than the previous -

i'm practicing uva problems , i'm stuck in this. need longest subsequence consecutive integers 5 times greater previous sample input: 7, 100, 3, 80, 3, 5, 18, 25, 73, 125 output: 3 (5, 25, 125) i thought of solution take n^n compare integer rest of integers, not ideal. possible faster solution? if traverse list , build map of values seen far, mapped length sequence ending in number, can solve problem in o(n) . given sample list of 7, 100, 3, 80, 3, 5, 18, 25, 73, 125 , resulting map be: 7 → 1 ⇐ not divisible 5, length=1 100 → 1 ⇐ 100 / 5 = 20, 20 hasn't been seen, length=1 3 → 1 ⇐ not divisible 5, length=1 80 → 1 ⇐ 80 / 5 = 16, 16 hasn't been seen, length=1 3 ⇐ skipped since 3 in map 5 → 1 ⇐ 5 / 5 = 1, 1 hasn't been seen, length=1 18 → 1 ⇐ not divisible 5, length=1 25 → 2 ⇐ 25 / 5 = 5, , 5 has length 1, length=2 73 → 1 ⇐ not divisible 5, length=1 125 → 3 ⇐ 125 / 5 = 25, , 25 has length 3, length=3 ...

javascript - How to bind events to an array of elements in a loop using closure? -

this question has answer here: javascript closure inside loops – simple practical example 32 answers i believe use javascript run problem because don't know how closure works can't solve myself. var hint = ["str", "str", "str", "str", "str"]; var inputids = ["ip-name", "ip-pwd", "ip-pwd-cfm", "ip-email", "ip-phone"]; var errormsg = []; (var = 0; i<hint.length; i++) { document.getelementbyid(inputids[i]).addeventlistener("focus", function (e) { var tar = e.target.parentelement.getelementsbyclassname("alert")[0]; tar.innerhtml = hint[i]; }); } i want bind focus event every element iteratively. if use code above, every time function executed, i 5. i think should use closure ...

scala - How to find field annotations for a MethodSymbol? -

suppose have found set of methods type: case class x() object a{ @someannotation val x=x() } def totype[t](a:t)(implicit tag: typetag[t]): type = tag.tpe val typ = totype(a) // public methods return x val intmethods = typ.members.collect{ case m: ru.methodsymbol if m.isgetter && m.ispublic && m.returntype <:< typeof[x] => m } how efficiently find corresponding annotations each element of intmethods? intmethods.head.annotations is empty because there 2 entries in typ.decls x. 1 found method , other non-method field holds annotations. can search matching on: getannotations(intmethods.head.toterm.name.tostring.trim) def getannotations( name: string) ={ typ.decls.filter{ s=>s.name.tostring.trim==name.trim && !s.ismethod}.flatmap(_.annotations) } but tostringing , trimming extremely slow (the trim required because, 1 of decls contains trailing space, , other not). there better way directly lookup corresponding class field...

Create Installer for Java Application Which run as Windows Service -

i have requirement create installer java application. application should serve native windows service. have seen following projects can used execute java application windows service. java service wrapper yajsw .... issue: have deploy service on more 20 systems (can increased passage of time). think enough create installer , distribute installer file. so how can create installer file java application run windows service ? this example, using built-in support java advanced installer. advanced installer generate @ end msi install application, wrapper exe can run , install win32 service. along contains many other options handy, automatic updater, etc...

java 8 - How to solve Android Studio rendering problems? -

this question has answer here: android n requires ide running java 1.8 or later? 16 answers created new project in android studio choosing android n minimum sdk else default. once created open layout/activity_main.xml expected result: the layout editor correctly displays empty activity. actual result: the following error message displayed: rendering problems: android n requires ide running java 1.8 or later. install supported jdk (links to: https://developer.android.com/preview/setup-sdk.html#java8 ). you have old jdk (java development kit) installed build apps android n. go link ( http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html ) , install java 1.8 or later.

css - Less can define the function like sass “@function” ? -

enter image description here can less define functions sass, eg. @function ? .px-to-percent(@px, @base){ @percent: unit(((@px / @base) * 100), %); } .myclass{ .px-to-percent(456, 1200); width: @percent; }

python - Using FFMPEG to convert Numpy text file to mp3 -

i have text file contains output of numpy array , use ffmpeg convert mp3 file. i've been following this tutorial , , put in perspective have written audio_array created text file, read later on in program ffmpeg , convert mp3 file. i tried modifying part below follows, doesn't seem give me output: pipe = sp.popen([ ffmpeg_bin, '-y', # (optional) means overwrite output file if exists. "-f", 's16le', # means 16bit input "-acodec", "pcm_s16le", # means raw 16bit input '-r', "44100", # input have 44100 hz '-ac','2', # input have 2 channels (stereo) '-i', '[path/to/my/text_file.txt]', '-vn', # means "don't expect video input" '-acodec', "libfdk_aac" # output audio codec '-b', "3000k", # output bitrate (=quality). here, 3000kb/second 'my_awesome_o...

php - Running query inside loop -

good day. i'm trying running query inside loop . here did far. function scan_folder() { $this->load->library('word'); $this->load->helper('directory'); $map2 = directory_map('./assets/filenya/hukum acara', true, true); for($x=0;$x<count($map2);$x++) { $map3 = directory_map('./assets/filenya/hukum acara/'.$map2[$x]); for($xy = 0;$xy<count($map3);$xy++) { $category[$xy] = $this->modelmodel->showsingle("select menu_id kategori name '%".stripslashes($map2[$x])."%'"); echo $map3[$xy]." ".$category[$xy]->menu_id."<br>"; } } } with script above. error trying property of non-object . array $map2 array ( [0] => h.i.r\ [...

angular ui router - Angularjs $stateProvider and singleton service issue -

i using angular-ui-router make app organized routing little confused. know have add 'ui-router' dependencie in module use $stateprovider. though not add 'ui-router' dependencie, working well. i know angular service singleton object if add 'ui-router' dependencie once. can use $stateprovider service in module? below code angular code defined in app. angular.module('app', ['ui-router','app.pages']); angular.module('app.pages', ['app.pages.core']); angular.module('app.pages.core',[]) .config(function ($stateprovider, $urlrouterprovider) { $stateprovider .state('common.default', { abstract: true, views: { header: { templateurl: '/public/app/common/components/header/header.html', controller: 'headercontroller' }, content: { template: ...

acumatica approval notification back to originator -

i know can trigger approval email approver of document when condition met. however, possible trigger email originator of document when approver makes decision. po originator gets email saying po approved. thanks much you looking changes notification feature. have @ http://www.timrodman.com/acumatica-financial-report-change-email-notifications/ great tutorial on this. in po case, have set condition status equal approved , set email adresses receive message.

Python group dates within close range of each other -

i found 2 references appear relevant problem described below: http://freshfoo.com/posts/itertools_groupby/ group arbitrary date objects within time range of each other i have structure of signals sorted in ascending order date similar sample structure in code below. adapted example in first reference above group exact date not date range: # python 3.5.2 itertools import groupby operator import itemgetter signals = [('12-16-1987', 'q'), ('12-16-1987', 'y'), ('12-16-1987', 'p'), ('12-17-1987', 'w'), ('11-06-1990', 'q'), ('11-12-1990', 'w'), ('11-12-1990', 'y'), ('11-12-1990', 'p'), ('06-03-1994', 'q'), ('11-20-1997', 'p'), ('11-21-1997', 'w'), ('11-21-1997', 'q')] ke...

python - Converting a dictionary into a square matrix -

i wanting learn how convert dictionary square matrix. have read, may need convert numpy array , reshape it. not want use reshape want able based on information user puts in. in other words, want code give out square matrix no matter how many owners , breeds input user. note: owners , breeds dictionary vary upon user input. user can input 100 names , 50 breeds, or can input 4 names , 5 breeds. in example, did 4 names , 3 dogs. dict1 = {'bob vs sarah': {'shepherd': 1,'collie': 5,'poodle': 8}, 'bob vs ann': {'shepherd': 3,'collie': 2,'poodle': 1}, 'bob vs jen': {'shepherd': 3,'collie': 2,'poodle': 2}, 'sarah vs bob': {'shepherd': 3,'collie': 2,'poodle': 4}, 'sarah vs ann': {'shepherd': 4,'collie': 6,'poodle': 3}, 'sarah vs jen': {'shepherd': 1,'collie': 5,'poodle': 8}, 'jen vs bob...

node.js - In Sublime, why does my node process not exit naturally? -

when run node script in sublime 3 (as build system ... ctrl-b), if add listener stdin's data event, process stays running until killed. makes sense, since there's potentially still work do. process.stdin.on('data', (d)=> { // ... work `d` }); however, expected if removed listener data event, process naturally exit. doesn't! // program never exits naturally. function processdata(d) { // ... work `d`, then... process.stdin.removelistener('data', processdata); } process.stdin.on('data', processdata); even if remove event handler after adding it, process still sticks around... function processdata() {} process.stdin.on('data', processdata); process.stdin.removelistener('data', processdata); in exact case, use once() function instead of on() , doesn't clear me. missing? why stdin stream prevent process exiting, given has no listeners of kind?

java - Having trouble with creating a JFrame and adding text to it -

i've been trying setup jframe text i'm having trouble. can create jframe, can't background color or text work it. import java.awt.color; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; class fundmanager { jframe window; jpanel panel; jlabel text; public void createwindow() { //create window window = new jframe(); window.setvisible(true); window.setsize(960, 540); window.setdefaultcloseoperation(jframe.exit_on_close); window.setlocationrelativeto(null); //create panel panel = new jpanel(); panel.setbackground(color.red); //create label text = new jlabel("test"); } public static void main(string args[]) { fundmanager.createwindow(); } } my createwindow() method not running , error: cannot make static reference to non-static method. however, when make static whole program breaks....

javascript - React-Redux vs ReactCSSTransitionGroup -

i've encountered issue connecting redux , reactcsstransitiongroup. i'm wanting transition old elements out , new ones in. movement fine because redux breaking parent/child prop relationship, old elements being rendered new data before exiting. there's fiddle below shows relationship single child , 1 level deep. <parent> <child/> </parent> for case easy enough pass props directly, hoping solution play nicer more complex structure: <greatgrandparent> <grandparent> <parent> <child/> <child/> ... how might 1 prevent children updating when transition triggered? https://jsfiddle.net/haygoodjon/wx0l0bx7/2/ ^ fiddle updating old time before removing dom. expected behavior can achieved removing connect on child , passing time prop directly app

javascript - String replace regex character classes using regex -

this string has regex character classes need removed. reduce multiple spaces single space. can chain replace() thought ask if 1 can suggest 1 regex code whole job @ 1 go. how can done? thanks "\n\t\t\t \n\n\t \n\t \t\tfood , drinks \n \t\n" this needed: "food , drinks" var newstr = oldstr.replace(/[\t\n ]+/g, ''); //<-- failed job you want remove leading , trailing whitespace (space, tab, newline) leave spaces in internal string. can use whitespace character class \s shorthand, , match either start or end of string. var oldstr = "\n\t\t\t \n\n\t \n\t \t\tfood , drinks \n \t\n"; // ^\s+ => match 1 or more whitespace characters @ start of string // \s+$ => match 1 or more whitespace characters @ end of string // | => match either of these subpatterns // /g => global i.e every match (at start *and* @ end) var newstr = oldstr.replace(/^\s+|\s$/g/, ''); if want r...

go - How do I set GODEBUG environment variables in Golang so I can use godebug with net/http -

i want step through program using godebug . because i'm using net/http errors such as: /home/heath/go/src/net/http/h2_bundle.go:45:2: not import golang_org/x/net/http2/hpack (cannot find package "golang_org/x/net/http2/hpack" in of: /home/heath/go/src/golang_org/x/net/http2/hpack (from $goroot) /x/net/http2/hpack exist in gopath in ~heath/go/src/golang.org ... not golang_org (not sure what's happening there) i have read error occurs because godebug doesn't support http2 yet (can't find source). i have tried disable http2server , http2client setting godebug env both in init() , on command line. have confirmed these settings being set doing fmt.println("godebug", os.getenv("godebug"). per instructions located here godebug=http2client=0 # disable http/2 client support godebug=http2server=0 # disable http/2 server support my simple code example replicate error is: package main import "fmt" import "n...

scala - Using SBT for and libraries for the first time: lots of errors -

Image
i'm working on first larger project, newbie developer. i found needed external library (junrar), downloaded sbt , made simple build.sbt. when try run program (with intellij) huge block of error messages. information:8/23/16, 8:13 pm - compilation completed 1 error , 8 warnings in 10s 420ms error:scalac: error: org.jetbrains.jps.incremental.scala.remote.serverexception error compiling sbt component 'compiler-interface-2.9.1.final-52.0' @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1$$anonfun$apply$2.apply(analyzingcompiler.scala:145) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1$$anonfun$apply$2.apply(analyzingcompiler.scala:142) @ sbt.io$.withtemporarydirectory(io.scala:291) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1.apply(analyzingcompiler.scala:142) @ sbt.compiler.analyzingcompiler$$anonfun$compilesources$1.apply(analyzingcompiler.scala:139) @ sbt.io$.withtemporarydirectory(io.scala:291) @ sbt.com...

ios - webview overlaps with status bar only on first load -

the status bar overlaps top of webview, how looks in this post . situation different his, because overlap present @ first load of webivew, before of these things happen: things make webview spaced properly: i switch away tab of webview, , switch back i press of js buttons on page i rotate device example vid of 1 , 2 on list in video, starts showing wikipedia improperly spaced, once press sidebar button, fixes spacing. scroll stackoverflow.com, improperly spaced, when scroll away , come fixes itself. i have of webviews constrained webview.top = top layout guide.bottom it happens classes simple this: class testweb: uiviewcontroller { @iboutlet weak var webview: uiwebview! override func viewdidload() { let url = nsurl (string: "https://stackoverflow.com") let requestobj = nsurlrequest(url: url!) webview.loadrequest(requestobj) } } it happened before added animation. happens in simulator, on real device, , both ios9/ios8 a...

meekro - MySQL Left Join (using MeekroDB) -

this meekrodb exclusive issue, trying wrap head around left_join. i have 2 tables: comp_checklis t , comp_checklist_items i want rows comp_checklist user id matches , worked fine: db::query("select * comp_checklist user_id = %i", $user_id ); now wand same query ( rows comp_checklist user id matches ) , add comp_checklist_items rows checklist_id matches in both tables ( checklist_id primary key in comp_checklist table). used below false db::query("select * comp_checklist user_id = %i left join comp_checklist_items on checklist_id = comp_checklist.checklist_id", $user_id ); join should come before where, , columns should have table name or error: db::query("select * comp_checklist left join comp_checklist_items on comp_checklist_items.checklist_id = comp_checklist.checklist_id comp_checklist.user_id = %i ", $user_id );

python - discord channel link in message -

using discord.py, making bot send users direct message if keyword of choosing mentioned. everything working, except want add channel mentioned in message. here code: print("sending message") sender = '{0.author.name}'.format(message) channel = message.channel.name server = '{0.server}'.format(message) await client.send_message(member, server+": #"+channel+": "+sender+": "+msg) this results in correct message being composed, #channel part of message not clickable link if typed chat window myself. there different object should feeding message? in discord: there channel mention. try way, message.channel.mention instead of message.channel.name should able link channel in pm or everywhere. source: discord documentation

css - LESS - Using nested @import with parent selector -

i use "&" parent selector in less in combination nested @import statement overide variable definitions within specific scope. consider following files style.less: @import 'component-variables.less'; @import (multiple) 'component.less'; .@{contrastwrapperclass}, .@{contrastwrapperclass}&{ @componentbackgroundcolor:#00ff00; @import (multiple) 'component.less'; } component-variables.less: @contrastwrapperclass: componentcontrast; @componentbackgroundcolor: #ff0000; component.less: .component { background-color: @componentbackgroundcolor; } i expect compile to .component { background-color:#ff0000; } .componentcontrast .component, .componentcontrast.component { background-color:#00ff000; } it compiles to: .component { background-color:#ff0000; } .componentcontrast .component, .componentcontrast .component { background-color:#00ff000; } in example, goal switch background-color .component...

c# - Rendering a View in another View (Not a partial view) -

so have reviewscontroller , actionresults queries table in db , return them in different views e.g. in reviewscontroller public actionresult studentwellnessreviews() { using (var context = new sizafakeentities()) { var userreview = context.reviews.sqlquery("select * dbo.review wellnessservice='student wellness service'").tolist(); return view(userreview); } } and public actionresult haicureviews() { using (var context = new sizafakeentities()) { var userreview = context.reviews.sqlquery("select * dbo.review wellnessservice='haicu' ").tolist(); return view(userreview); } } studentwellnessreviews view: <table class="table text-center width:50%"> <tr> <td> @html.actionlink("make review", "create", "reviews", n...

Has anyone had any success using Dojo in Liferay 7 (Liferay DXP) -

we trying include dojo in our liferay 7 application , running major difficulties, seems amd loader clashing amd loader of liferay, , preventing dojo's define , require working properly. if solution getting dojo liferay 7 appreciate advice or tips have getting work. when using dojo application liferay suggest you: keep dojo loader requiring amd modules dojo , not liferay, use dojo dojo , liferay liferay. same when building application, need have 2 separate build processes, dojo uses own tools called dojo/util , won't able build dojo app using builder.

css - How can I force bg-primary on my ul using Bootstrap 3? -

i have mouse-over highlights li using themed bootstrap color. however, list-group-item overriding background style white. this component used multiple people , knows set bg-primary as? don't want force specific color. is there way override cascade case , have bg-primary override list-group-item instead of other way around? here fiddle showing problem: https://jsfiddle.net/scottieslg/5bqtr8dn/1/ <div class='container'> <ul class='list-group'> <li class='bg-primary list-group-item'>test1</li> <li class='list-group-item'>test2</li> <li class='list-group-item'>test3</li> </ul> </div>

Visual Studio - AppBuilder - Git Hub - .sou file issue -

i started project on telerik's appbuilder , started working on project in visual studio 2015. able commit. note have desktop , laptop, both vs2015 , working on project. so, able commit , sync on desktop , laptop few weeks ago. then, made changes on desktop , tried checkin, , "unable access .suo file writing" when trying sync , have been unable checkin git since on desktop, on laptop can push/pull w/o issue. any idea what's wrong , how fix it? you should not checking in .suo files git, contain user data should not shared. instead, should marking them "ignored" git, never checked in , never detected untracked file. however, git ignore files not in repository. must remove them before can ignore them. first, add .suo file .gitignore . create .gitignore file @ base of git repository, , add following line it: *.suo or , better yet, download visualstudio.gitignore file , name .gitignore , placing @ root of repository. file exce...

math - R optim(){fExtremes} gets 0 hessian matrix -

i using r {fextremes} find best parameters of gev distribution data (a vector). following error message error in solve.default(fit$hessian) : lapack routine dgesv: system singular: u[1,1] = 0 i traced fit$hessian, found hessian matrix sigular matrix, of elements 0s. source code ( https://github.com/cran/fextremes/blob/master/r/gevfit.r ) of gevfit() shows fit$hessian calculated optim(). output parameters same value initial parameters. wondering problems of data cause problem? copied code here > min(sample); [1] 5.240909 > max(sample) [1] 175.8677 > length(sample) [1] 6789 > mean(sample) [1] 78.04107 >para<-gevfit(sample, type = "mle") error in solve.default(fit$hessian) : lapack routine dgesv: system singular: u[1,1] = 0 fit = optim(theta, .gumllh, hessian = true, ..., tmp = data) > fit $par xi -0.3129225 mu 72.5542497 beta 16.4450897 $value [1] 1e+06 $counts function gradient 4 na $convergence [1] 0 $...

Can't produce an executable jar from Spring Boot, Gradle, and IntelliJ-Idea -

Image
i have created spring boot microservice using intellij-idea , gradle build engine. have made no changes initial spring boot configuration. have made no modifications build.gradle file provided. built application using starter.spring.io through intellij-idea , have following dependencies: compile('org.springframework.boot:spring-boot-starter-data-jpa') compile('org.springframework.boot:spring-boot-devtools') compile('org.springframework.boot:spring-boot-starter-web') runtime('org.postgresql:postgresql') testcompile('org.springframework.boot:spring-boot-starter-test') the application contains 12 classes , 2 interfaces , web service provider. runs fine on system when build gradle, manifest.mf contains no main-class entry. i created simple hello world app , tried several combinations of ide’s , build tools(gradle , maven) , got following results:     interestingly, able produce executable jars in eclipse has separate runnable jar ex...

firewall - How to evaluate whether a port should be closed or open? -

so meet pci compliance, need have justification every port that's open on windows server 2012 r2. looked @ firewall, , there's ton of rules. started going through each rule , deciding if should closed or not, i'm looking more efficient process. my goals close ports without disrupting live site in way, , ones can't close, have clear reasoning behind why i've left open. my first thought check ports being listened using: netstat -aon but i'm not positive comprehensive @ ports being used - example, there processes use ports sometime , aren't listening on ports other times? ports used scheduled activities, listed here? the way see it, need figure out firewall rules below not being used server, , able track down service using each rule i've left in rules. here current active rules. recommendations on process doing correctly? nsclient++ monitoring agent prtg_network_monitor_admin_tool prtg_network_monitor_probe prtg_network_monitor_server ...

powershell - Find multiple keywords in a sentence -

i trying search multiple keywords in rather large text document example: need search if regional , new york show in 1 sentence. current script have provides me 1 or other not both. my current script is: get-content <file name>.txt | select-string '(phrase)' any thoughts? here how results multiple patterns: get-content "yourtextfile.txt" | select-string -pattern '(regional.*new york)|(new york.*regional)' essentially, looks 2 phrases occur in same line in either order.

r - Can I replace NAs when joining two data frames with dplyr? -

i join 2 data frames. of column names overlap, , there na entries in 1 of data frame's overlapping columns. here simplified example: df1 <- data.frame(fruit = c('apples','oranges','bananas','grapes'), var1 = c(1,2,3,4), var2 = c(3,na,6,na), stringsasfactors = false) df2 <- data.frame(fruit = c('oranges','grapes'), var2=c(5,6), var3=c(7,8), stringsasfactors = false) can use dplyr join functions join these data frames , automatically prioritize non- na entry "var2" column have no na entries in joined data frame? now, if call left_join , keeps na entries, , if call full_join duplicates rows. coalesce might need. fills na first vector values second vector @ corresponding positions: library(dplyr) df1 %>% left_join(df2, = "fruit") %>% mutate(var2 = coalesce(var2.x, var2.y)) %>% select(-var2.x, -var2.y) # fruit var1 var3 var2 # 1 apples 1 na ...

ios - iPad force connection to WiFi WITHOUT Internet -

i'm working on embedded device communicate (wifi-only) ipads on wifi. however, these devices not connected internet. connecting specific port, relaying information. ipad connects access point, receives ip address dhcp, , can reach desired what i'm seeing frequent disconnects, or interruptions in connection. my suspicion ipad's inability connect captive.apple.com/library/test/success.html causing either re-scan wifi networks or in other way momentarily disrupt connection. is there way disable behavior, or ensure ipad remains connected intended wifi, in absence of internet connection? either through setting on ipad, or configuration setting on embedded router/access point? if don't mind breaking backwards compatibility older ios devices (ios 3, example), i'm told (by in dts, iirc) can send dhcp advertisement without router advertisement field, , ios right thing. have not tried personally, though. you might try using captivenetwork framework ...

reporting - How do you add a .jar to the class-path in jaspersoft studio? -

i need add commons-lang3 , commons-math3 can generate medians in report. have downloaded these files, how add them classpath jaspersoft studio can reference it? i using jaspersoft studio professional 5.6.1 i tried going project explorer , right clicking on project, there no classpath option. this not duplicate of use external jar file in jaspersoft studio because solution suggested: right click on project folder > properties > java build path > libraries > add external jars.. not appear option me. thanks!

Oracle query select sum count -

i have data below query looks first table below, here if observe results based on count desc. want display data in form of second table , having trouble query. if pagetype details,items want sum count id, , if pagetype singe-item want leave alone , order results count desc. first query gist looks below, have many other things in here simplified version of it. select id, title, count(id) count_num , pagetype , row_number() on ( order count(id) desc ) the_row table1, table2 pagetype in ('details','items','single-item') , table1.id = table2.id , ct.page_view_dt > sysdate - 90 order the_row id title count pagetype -------------------------------------------------------------- 33969 title 1 523 details 33969 title 1 494 items 198068 title 3 400 single-item 33968 title 2 395 details 19...

c# - Standard Windows Forms reference .NET Core project -

is possible have standard windows forms project , reference project written in .net core? this .net core project json: { "version": "1.0.0-*", "dependencies": { "microsoft.entityframeworkcore.sqlite": "1.0.0", "microsoft.entityframeworkcore": "1.0.0", "netstandard.library": "1.6.0" }, "frameworks": { "net461": { } } } i added project reference nothing happens. trying use entity framework 7 windows forms. so far know, windows forms project cannot reference .net core project though .net core project targeting full framework, can reference dll file of .net core project. you can more information referencing .net core project regular .net csproj

rest - RESTful HTTP API design pattern for specifying file pairs? -

i attempting design http api whereby callers upload n pairs of files per call. utilize toy example guide discussion. imagine i'm collecting database of photos have been doctored. each record uploaded, need 2 files: (1) original photo, , (2) doctored photo. users upload records in batches. example, let's assume user upload 2 records. i have considered 2 options: nested forms: curl -f "record=@orig0.jpg,doc0.jpg" -f "record=@orig1.jpg,doc1.jpg" this results in top-level form parts containing records, each record contains sub-form parts photo files. pros: logically accurate. can done curl. cons: sub-form parts don't have field names. difficult through other clients. form parts dynamic field names: curl -f "record0_original=@orig0.jpg" -f "record0_doctored=@doc0.jpg" -f "record01_original=@orig1.jpg" -f "record1_doctored=@doc1.jpg" pros: field labels present , expressive. cons: uses dynamic fie...

python - How to specify a variable as a member variables of a class or of an instance of the class? -

in latest python 2.7.x: given member variable inside definition of class, member variable @ class level in sense single variable shared instances of class? in definition of class, how can specify which member variables in definition of class belong class , shared instances of class, , which belong particular instance of class , not instance of class? how can refer member variable of class? how can refer member variable of instance of class? do answers above questions appear somewhere in official python language reference https://docs.python.org/2/reference/ ? can't find them there. thanks. you might want use terminology "class variable" , "instance variable" here, that's usual language in python. class foo(object): var1 = "i'm class variable" def __init__(self, var2): self.var2 = var2 # var2 instance variable the scoping rule need know in python lookup order names - "legb", local,...