Posts

Showing posts from June, 2014

ios - How to pass content of UITextField to another UITableViewController linked by UITabbarController -

Image
i new ios development in swift 3 , encountering trouble. in picture below have 2 uitableviewcontrollers textfield in first 1 . 2 tableviews linked tabbarcontroller , recover content of textfield use in secondtableviewcontroller. dont know how it, common tutorials data passing explain button action recover data in changing tableview if possible. i hope clear in question. here in first uitableviewcontroller: class investmenttableviewcontroller: uitableviewcontroller, uitabbarcontrollerdelegate var somevariable: float? override func viewdidload() { super.viewdidload() self.tabbarcontroller?.delegate = self } func tabbarcontroller(_ tabbarcontroller: uitabbarcontroller, shouldselect viewcontroller: uitableviewcontroller) -> bool { let selectedvc:extrachargestableviewcontroller = viewcontroller as! extrachargestableviewcontroller selectedvc.totalinvest = self.somevariable return true } in other tabview class extrachargestableviewcontro...

postgresql - SQL Retrieve rows that have all rows from other table -

i facing issues retrieving data using sql in 1 specific scenario: suppose have following tables: a (id, attr_a, attr_b); b (id, attr_d, attr_e); c (id_a, id_b); as can see, table c have fk referencing id table a , , referencing id table c . i need retrieve table a rows each a row relates every b row. in real life scenario, assuming a means users, b means privileges, , c many many entity relates users privileges, want users have privileges select a.* join c on id_a = id group id having count(id) = (select count(*) b) there no need use subquery because a.id primary key (or unique @ least) column referenced c.id_a .

ruby on rails - Why is my view file moving all my head content into the body section? -

i'm confused how application.html.erb file , view files combine. have in application.html.erb file following (minimized content brevity): <!doctype html> <html> <head> <!-- bootstrap css --> <link href="/bootstrap-assets/css/bootstrap.css" rel="stylesheet"> <%= yield :head %> </head> <body> <nav> <!--long navbar section --> </nav> <%= yield %> </body> </html> in view file: <html> <head> <!-- view specific stylesheet --> <link href="/css/viewspecific.css" rel="stylesheet" /> </head> <body> <!-- view specific body --> </body> what expect when these 2 files combine, view specific stylesheet load in <head> section, , view specific body load in <body> section. final result sends view specific stylesheet <body> section, after navbar applica...

for loop - How can I create subplots in plotly using R where each subplot is two traces -

Image
here toy example have got stuck on library(plotly) library(dplyr) # construct data.frame df <- tibble(x=c(3,2,3,5,5,5,2),y=c("a","a","a","b","b","b","b")) # construct data.frame of last y values latest <- df %>% group_by(y) %>% slice(n()) # plot 1 value of y (nb not sure why value 3 appears?) p <- plot_ly() %>% add_histogram(data=subset(df,y=="b"),x= ~x) %>% add_histogram(data=subset(latest,y=="b"),x= ~x,marker=list(color="red")) %>% layout(barmode="overlay",showlegend=false,title= ~y) p how can set these subplots, 1 each unique value of y? in real world example, have 20 different y's ideally loop or apply code. in addition, set standard x scales of c(1:10) , have, example, 2 rows tia build list containing each of plots set bin sizes manually histograms, otherwise automatic selection choose different...

xcode - Can I submit iOS 10 app for review before iOS 10 comes out? -

i have app released on app store day ios 10 comes out. possible have reviewed submission before ios 10 released? thanks yes can. however, must wait gm (golden master) version of xcode 8 in order that. you can't submit app via xcode betas (try upload archive: won't let you). this gm version released bit before new public/official xcode release. it available @ usual xcode download page . source: xcode support

php ensure file_get_contents images not corrput -

i have php script use file_get_contents download remote images server, sometime corrupted $contents = file_get_contents($url); list($width,$height) = getimagesizefromstring( $contents ); if($width <= 300 ){ $contents = base64_decode('isdfafasfgoaaaansuheugaaaaeaaaabaqmaaaal21bkaaaaa1bmveuaaacnej3aaaaaaxrstlmaqobyzgaaaapjrefucndjyaaaaaiaaeihvdmaaaaasuvork5cyii='); $downloadlog->log( "ignore file width below 300 : " . $url ); } $aws->writetoaws( $target_path , $contents ); $contents = null; are there ways ensure images downloaded correctly without corruption or way validate images against remote url? you can validate using getimagesize note: formats may contain no image or may contain multiple images. in these cases, getimagesize() might not able determine image size. getimagesize() return 0 width , height in these cases. on failure, false returned. edited: for example <?php $array = getimagesize('https:...

php - How to interpret CURL headers sent by user -

i creating api using laravel , apache backend. predicament this, when type curl command in terminal like, curl -h "api key: nikapikey" --data "param1=value1&param2=value2" http://localhost:8888/awesome-calendar/public/config how read header api key in php backend? can read post parameters $_request. answered @nogad the function apache_request_headers acts var_dump http headers http://php.net/manual/en/function.apache-request-headers.php

javascript - Hapijs query parameters undefined -

i'm working hapi , i've come across issue can't seem find solution or previous mention of. when send following request first query parameter in request.query object. curl -h "content-type: application/json" -x put https://localhost:3000/lists/{username}/{listname}?token='token'&resource_id='resource_id' with items in {} , '' replaced actual names. my route written such server.route({ method: 'put', path: '/lists/{username}/{listname}', handler: function(request, reply) { const username = encodeuricomponent(request.params.username); const listname = encodeuricomponent(request.params.listname); const resource_id = request.query.resource_id; const token = request.query.token; console.log(request.query); verify(token, username, {callback}, listname, resource_id, reply); } }); the console.log call results in { token: 'token' } if cons...

ios - How to take advantage of enum string in Swift 2 or greater? -

Image
so bellow image shows buttons in app. have enum different choices this enum legal: string { case term = "terms of service" //link: www.google.com/terms case licenses = "licenses" //link: www.google.com/license case privacy = "privacy policy" //link: www.google.com/policy } i want know if there efficient way store links instead of storing in variable. don't have knowledge swift memory management, know there way can away without having store links in heap using enums. may have function in enum or something. currently passing button title , returning link accordingly func getlinke(legal: string) -> string { if legal == legal.term.rawvalue { return "www.google.com/terms" } else if legal == legal.licenses.rawvalue { return "www.google.com/license" } else if legal == legal.privacy.rawvalue { return "www.google.com/policy" } return ...

php - inner join 4 table in datatables server-side -

i had code php showing data in datatables, php (server-side) not working . whats datatables cannot use inner join ? if can, how fix code ?. , 1 more again, how active searching data in datatables inner join. much: <?php require_once '../config/config.php'; // use require. can not use include function // storing request (ie, get/post) global array variable $requestdata = $_request; $columns = array( // datatable column index => database column name 0 => 'id_hanca', 1 => 'id_detail_po', 2 => 'ukuran', 3 => 'jumlah_hanca', 4 => 'status_hanca', 5 => 'id_user', 6 => 'id_vendor' ); // getting total number records without search $sql = "select po_detail.id_detail_po, hanca.id_hanca, hanca.ukuran, hanca.jumlah_hanca, user.name_usr, vendor.nama_vendor"; $sql.= "from hanca"; $sql.= "inner join po_detail on po_d...

sybase - While loop goes on forever -

i wanted create while loop in sybase loops while there entry left in temporary table "nodesnothavingcriteria". procedure created below seems go on forever , think because while loop going on don dnt seem find reason it. can help? seems fine me , unable find reason of never ending loop. create procedure createcriteria begin declare @uid varchar(10) while (select count(*) #nodesnothavingcriteria) > 0 set rowcount 1 select @uid = nodes #nodesnothavingcriteria -- pull 1 uid temp table set rowcount 0 delete #nodesnothavingcriteria nodes = @uid -- delete uid temp table -- uid have --insert backtestingcriteria (nodeid,hierarchyviewid,varcriteriaid,pnlcriteriaid) values -- (@uid,16008,16,3) --insert backtestingcriteria (nodeid,hierarchyviewid,varcriteriaid,pnlcriteriaid) values --(@uid,16008,16,4) end i think while loop not check criteria ever again. select count once , check > 0 forever mayb...

ios - I am facing two errors in this code help me to solve it -

Image
code: var bgtask: backgroundtaskmanager! = uiapplication.sharedapplication().beginbackgroundtaskwithexpirationhandler({() -> void in print("ending background task") uiapplication.sharedapplication().endbackgroundtask(self.bgtask) self.bgtask = uibackgroundtaskinvalid }) self.timer = nstimer.scheduledtimerwithtimeinterval( 60, target: self.locationmanager, selector: #selector(self.startupdatinglocation), userinfo: nil, repeats: true) you using self.bgtask , self.timer , self.locationmanager etc have declare globally like, var bgtask: uibackgroundtaskidentifier! = uibackgroundtaskidentifier() var timer: nstimer! = nstimer() var locationmanager : cllocationmanager! = cllocationmanager() second thing var bgtask: backgroundtaskmanager! wrong, should var bgtask: uibackgroundtaskidentifier!

Docker Remote API with Weave -

i trying create docker container using docker remote apiv1.23 i not able create docker container in weave. i have started weave-proxy following command: weave launch-proxy -h tcp://0.0.0.0:12375 -h unix:///var/run/weave/weave.sock and in post body of container creation call setting enviornment docker_host=tcp://0.0.0.0:12375 can me in this? solution: instead of hitting docker daemon on docker port(in case 4242) hit weave proxy port (in case 12375) for example: docker -h tcp://0.0.0.0:12375 run ..... when using remote api, use 12375 port instead of 4242. there no need set environment variable related weave.

javascript - AutoFill chrome extension not updating the ng-model values -

i build small auto fill chrome extension using jquery. when click extension values updated in view of angular app. modal values not updated. how update modal values in content.js have code like $(document).ready(function(){ $.each($('body').find('input:visible'),function(data,element){ var arr=[]; (var = 0, attrs = element.attributes, n = attrs.length, arr = []; < n; i++){ $.each(valuefillers,function(d,e){ if(valuefillers[d].stringmatch.indexof(attrs[i].nodevalue.tolowercase())!=-1){ console.log(valuefillers[d].stringmatch) $(element).val(values[d]); settimeout(function () { $(element).triggerhandler('input'); }); } }); } }); }) how bind values ng-model. pls help please see jquery documentation ....

javascript - Tinymce blur function not working when there are multiple editable textareas -

tinymce blur function not working . have multiple elements using tinymce editor . using dblclick event edit textarea every thing working fine blur event not triggering when click on other textarea element , blur event triggering when click out side of element mean page area(body) this have done far : function my_function(element_id) { tinymce.init({ selector: '#editable_' + element_id, inline: true, fixed_toolbar_container: "#element_"+element_id, plugins: [ "advlist autolink lists link charmap anchor", " code fullscreen", "insertdatetime table paste textcolor" ], menubar: false, toolbar1: " undo redo | styleselect | fontselect | hr | removeformat", toolbar2: " forecolor backcolor | bold italic underline | fontsizeselect", toolbar3: "alignleft aligncent...

javascript - Java Script Array SIMPLE -

hello new first question. completing javascript primer bloc, , stuck on simple checkpoint. i trying create function named arraylengthplusone . function should: take 1 argument, array return number 1 greater number of elements in array.. example: arraylengthplusone([0,0,1,0,2,1]); // returns 7 code tried: var arraylengthplusone = function () { return arraylengthplusone.length + 1; }; i getting error message telling me isnt' passing tests. maybe i'm not grasping array/function relationship. understand array object not data type. how make function take 1 argument, array ? only need add argument in function declaration. var arraylengthplusone = function(data) { // data argument in function. it's array. return data.length + 1; }; // calling function. var arraydata = [0, 1, 3, 4]; // declare array variable 4 elements. alert(arraylengthplusone(arraydata)); // show alert result. returns 4 + 1 elements.

asp.net mvc - A dependent property in a ReferentialConstraint is mapped to a store-generated column. Column: -

i having 2 table [tblmaincheckpoint]( [id] [int] identity(1,1) not null, [checkpointname] [nchar](100) null, [checkpointdescription] [nchar](1000) null ) and [dbo].[tblsubcheckpoint]( [subcheckpointid] [int] identity(1,1) not null, [maincheckpointid] [int] not null, [subcheckpointname] [nchar](500) null ) on [primary] id maincheckpoint primary key , maincheckpointid foreign key in subcheckpoint table whenever trying save subcheckpoint entity throws below error "a dependent property in referentialconstraint mapped store-generated column. column: 'subcheckpointid'." i dont want set subcheckpointid manually code made identity column in database throws error. please me

codenameone - How to remove commands added to overflow menu -

when add commands toolbar using toolbar.addcommandtooverflowmenu(cmd) and try remove them using form's removecommand (as described here ) doesn't work. right approach? this seems missing. we'll add toolbar.removeoverflowcommand(command) method next update.

ibm mobilefirst - MFP 8 - Spring JPA integration which can be used across multiple adapters -

we need create scalable application single instance of db connection used across adapters , possibly want use spring hibernate same - how can use mfp v 8 implement such use case. would use spring context use common service beans across adapters i not believe can use across adapters , each adapter lives in own sandbox. you'll need add each adapter separately maven dependency in pom.xml file.

json - How can we set a limit to the results came in @POST request in retrofit android -

i trying retrieve data web api in json format using retrofit. result returns 5 items has 20 items. need show top 10 items. there way set limit no. of results retrieve? the interface http request looks this: public interface testservice { @post("apiurl") call<apirespone> testbytype(@body testrequest request); } this depends on api, if allows set pagination might able set number of items returned server. double check api documentation if standard 1 have pagination.

How many json LD can I put in a web page? -

as title, need insert 2 json ld in pages. the requirement is: 1) insert in pages json ld relating "@type": "organization" 2) insert in product pages json ld relating "@type": "car" i read documentation did'nt find example 2 json ld in page. question is: can put 2 json ld in same page? thanks in advance yes, can put multiple json-ld blocks page. btw. can use google structured data testing tool test markup.

Why we are using <!DOCTYPE html> in every Html document? -

why using in every html document? . without doctype executing website , why have mention doctype. <!doctype> - definition , usage declaration must first thing in html document, before tag. the declaration not html tag; instruction web browser version of html page written in. in html 4.01, declaration refers dtd, because html 4.01 based on sgml. dtd specifies rules markup language, browsers render content correctly. html5 not based on sgml, , therefore not require reference dtd. tip: add declaration html documents, browser knows type of document expect. from : w3 schools html declaration

Basic PHPMailer SMTP configuration issue -

i trying configure phpmailer smtp. here code: if ($_server["request_method"] == "post") { $recipient_email = $_post["eb_email_m"]; $recipient_name = $_post["eb_firstname"] . $_post["eb_lastname"]; $recipient_reference = $_post["eb_reference_m"]; $mail = new phpmailer; $mail->issmtp(); $mail->host = 'smtp.strato.de'; $mail->smtpdebug = 2; $mail->port = 587; $mail->smtpauth = true; $mail->username = 'contact@vroum.biz'; $mail->password = 'xxxxxxxxxx'; $mail->smtpsecure = 'tls'; $mail->addreplyto("contact@vroum.biz", "vroum gabon -- appli mobile"); $mail->setfrom('contact@vro...

Specifying RabbitMQ messaging strategy on memeory or disc -

i new @ rabbitmq wonder saving message strategy. default rabbitmq saves message queuses on memeory. way high performance. messages important , should save on disc. because server may down @ time. way shows slower performace. stuation should prefable. real world experience? there whole lot regarding persistance here . can make queues durable, in way messages saved disk. of course until acknowledged! you didn't use case , need for, bare in mind rabbitmq not database.

go - convert int array to byte array in Golang -

i'm trying create random int arrays , write xyz.txt file in golang. how convert ids int array byte array, file.write accepts []byte parameter. correct way achieve writing random integer arrays text file. func main() { var id int var ids []int var count int f, err := os.create("xyz.txt") check(err) defer f.close() j := 0; j < 5; j++ { count = rand.intn(100) := 0; < product_count; i++ { id = rand.intn(1000) ids = append(product_ids, product_id) } n2, err := f.write(ids) check(err) fmt.printf("wrote %d bytes\n", n2) } } you may use fmt.fprint , simplified working sample: package main import ( "bufio" "fmt" "math/rand" "os" ) func main() { f, err := os.create("xyz.txt") if err != nil { panic(err) } defer f.close() w := bufio.newwriter(f...

opengl - LWJGL - Interleaved VAO/VBO not texturing -

i have been attempting transition game's prototype renderer it's immediate mode testing implementation actual vao/vbo implementation. vbo rendering on screen, refusing texture. below simplest test class shows problem: public static void main(string[] args) throws exception { // vertx,verty texx, texy float[] data = new float[] {0.0f, 0.0f, 0.25f, 0.75f, 0.0f, 64.0f, 0.25f, 1.0f, 64.0f, 64.0f, 0.5f, 1.0f, 0.0f, 0.0f, 0.25f, 0.75f, 64.0f, 64.0f, 0.5f, 1.0f, 64.0f, 0.0f, 0.5f, 0.75f}; glfwseterrorcallback(glfwerrorcallback.createprint(system.err)); if (!glfwinit()) throw new illegalstateexception("unable initialize glfw"); long window = glfw.glfwcreatewindow(1600, 900, "test", 0, 0); glfw.glfwmakecontextcurrent(...

angularjs - turn off view engine doesn't work in express 4 -

i create app start using express generator, doing express myapp. plan setup angularjs front end. end getting error in console: error: no default engine specified , no extension provided. @ new view (...\node_modules\express\lib\view.js:41:42) i think it's cause these 2 line, commented out. /*app.set('views', path.join(__dirname, 'views')); app.set('view engine', 'jade');*/ i don't need view folder jade template inside it, because i'm using angularjs. how resolve issue? express expects either specify view extension: res.render('index.html'); or specify default view engine , name views after it: app.set('view engine', jade'); and if working angular think send response json format, in case, work like send res.send({name:"jack"})

php - Cannot get back the total count of friends - Facebook -

i user php facebook api facebook's user data. , trying total friends. i using graph api , return this: { "id": "12312312312312", "name": "myname", "friends": { "data": [ ], "summary": { "total_count": 89 } } } but when use code: $profile_request = $fb->get('/me?fields=name, friends'); $profile = $profile_request->getgraphnode()->asarray(); print_r($profile); //it return these me: array ( [name] => myname [friends] => array ( ) [id] => 12346677888 ) the friend array return null value me. how can total count ? thx helping facebook v2.0 upgraded can try "user_friends". upgrade link

angular - Only instances of Provider and Type are allowed, got: [object Object] -

this configuration in package.json: "dependencies": { "@angular/common": "2.0.0-rc.4", "@angular/compiler": "2.0.0-rc.4", "@angular/core": "2.0.0-rc.4", "@angular/http": "2.0.0-rc.4", "@angular/platform-browser": "2.0.0-rc.4", "@angular/platform-browser-dynamic": "2.0.0-rc.4", "@angular/platform-server": "2.0.0-rc.4", "@angular/router": "3.0.0-beta.1", "angular2-universal": "^0.104.5", "aspnet-prerendering": "^1.0.2", "css": "^2.2.1", "es6-shim": "^0.35.1", "isomorphic-fetch": "^2.2.1", "preboot": "^2.0.10", "rxjs": "5.0.0-beta.6", "webpack-externals-plugin": "^1.0.0", "zone.js": "^0.6.12" } and code: bootstrap(app, [ ...http_provid...

Delphi 10.1 Berlin android 5.0.1 app crash on TEdit focus -

i have minimal firemonkey test app 1 button , 1 tedit control on form. if run app on acer tablet b1-770 on andoid 5.0.1 happen following: if click (or touch) in edit control app crashes. have no problems other android versions. tried solution no success (but seattle version) https://stackoverflow.com/questions/34595492/delphi-android-application-is-raising-issue-in-lennova-a5000-mobile some suggestions? thanks

html - How to access data on third page in php -

i new php facing trouble transferring data problem folow:- page1.php <form id="form1" name="form1" method="post" action="page2.php"> <table> <tr> <td><input type="text" name="bankcode" id="bankcode" /></td> <td><input type="submit" id="submit" name="submit"/></td> </tr> </form> page2.php echo value $_post['bankcode']; but facing real problem, if try access $_post['bankcode']; on third page shows me error page3.php how access page1.php's textfield data on third page. please give solution. in order access 1 page's data in page, data has sent in post/get format. or can stored in session . using session best option in such cases. data stored securely in server, , can access data page want. page2.php - store post data in session. echo...

c# - "Nuget failed to restore packages", but it worked fine before -

after corrupt registry warning @ boot up, succesfuly got pc running again restoring windows state before update. however, unknown reason, visual studio started behaving oddly. start didn't detect reference renci.ssh.net, though there. went in nuget package manager, uninstalled ssh.net, hope reinstall after , fine. obviously, nothing went quite smoothly. if use package manager gui, visual studio tells me "failed restore package. restoring package modifications 'blankapplication'.". if use nuget console , type pm > install-package ssh.net , highlighted in red nightmare: install-package : ssh.net 2016.0.0 not compatible uap,version=v10.0. au caractère ligne:1 : 1 + install-package ssh.net + ~~~~~~~~~~~~~~~~~~~~~~~ + categoryinfo : notspecified: (:) [install-package], exception + fullyqualifiederrorid : nugetcmdletunhandledexception,nuget.packagemanagement.powershellcmdlets.installpackagecommand install-package : sshnet.security.cryptograp...

performance - GPU affects core calculation and or RAM access (high jitter)? -

i have kthread runs alone on 1 core multi-core cpu. kthread disables irqs core, runs loop fast possible , measures maximum loop duration of tsc. whole acpi stuff disabled (no frequency scaling, no power saving, etc.). my problem is, maximum loop duration apparently depends on gpu. when system used normal (a little bit office, internet , programming stuff / not busy) maximum loop duration around 5 :-( the same situation, stressed cpu (the other 3 cores 100% busy) leads maximum loop duration of approximately 1 :-| but when gpu switching idle mode (turning-off screen), maximum loop duration going down less 300 ns :-) why that? , how can influence behavior? thought cpu , ram directly connected. recognized, maximum loop duration becomes better on system external graphic card first situation. second , third case couldn't see difference. tested amd , intel systems without success - same :-( i'm fine second case. possible achieve without stressing cpu additionally? ma...

shell - wget won't stop after the surrounding subshell is killed -

see: (wget http://stackoverflow.com/questions/ask && echo 'ok' || echo 'failed') & pid=$! sleep 1 # curcial kill $pid if took out second line, there no hanging wegt after script finishes. want achieve kill wget process(or subshell whole) @ time , more processing based on exit code of wget. can explain me why wget in above script doesn't killed properly, , how make ? or there way can achieve want ? consider following: $ foo=foo $ export foo $ (foo=bar; echo foo $foo); echo foo $foo foo bar foo foo a processes doesn't change parent's environment. goes shell processes , subshells, too. braces alter logical priority without creating subshell: $ foo=foo $ export foo $ { foo=bar; echo foo $foo); }; echo foo $foo foo bar foo bar so think want { wget http://stackoverflow.com/questions/ask \ && echo 'ok' || echo 'failed'; } & kill $! i want ... kill wget process (or subshell) ... , m...

angularjs - Cell class change is postponed till next edit or scroll -

i'm trying mark edited in ui grid cell blue color. purpose in aftercelledit event make changes in row entity. cellclass function checks these marks , returns corresponding class name. call $scope.$apply (specified in documentation) used. following example simplified there no check, column has been edited. in real app have more complicated code mark specific cell. example enough show problem: select cell in company column (but not in last row). change value there. press enter . tha value changes, edited column changes true, selection moves next row, the text in edited cell still black . press enter again. text in edited on step 2 cell becomes blue. how can force color change on step 3 instead of 4? http://plnkr.co/edit/seef4dpha3cb1mx7r4i8?p=preview var app = angular.module('app', ['nganimate', 'ngtouch', 'ui.grid', 'ui.grid.selection', 'ui.grid.edit', 'ui.grid.cellnav']); app.controller('...

c++ - Concurrency parallel_for using too much memory -

i have vector of gray scale images (loaded using opencv 3). each image 2560x64800 pixels , vector can hold 23 images. max size of vector approximately 3.6 gb. need "blob detection" on each image , speed things, run image analysis using parallel processing of images. detected blobs small 40x40 pixels image should returned. entire data set consists of 13 sets of images - have chosen make outer loop normal sequential for-loop: for (size_t cn = 0; cn < numberofchannels.size(); ++cn) { vector<mat> imagevector = readimages(...); // loop through images in "imagevector" concurrency::parallel_for(size_t(0), size_t(imagevector.size()), [&](size_t ii) { // detect blobs vector<keypoint> keypoints = detectblobs(imagevector[ii], false); // return result thesnips[cn][ii] = collectimagesnips(imagevector[ii], keypoints, 40); }); }; the function declaration 2 functions "detectblobs" (based on o...

wordpress - htaccess does not redirect primary URI -

i have 2 wordpress installation example -> contains installation example.com |_ blog -> contains installation example.com/blog blog directory inside example has wordpress installation. works fine. wanted redirect users visiting without www (example : http://example.com/blog/some-topic http://www.example.com/blog/some-topic ) hence added following wild card rule .htaccess redirection rule inside of blog directory, find below content of .htaccess of blog directory # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase /blog/ rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /blog/index.php [l] </ifmodule> rewriteengine on rewritecond %{http_host} !^www\. rewriterule ^(.*)$ http://www.%{http_host}/$1 [r=301,l] # end wordpress # wordfence waf <files ".user.ini"> <ifmodule mod_authz_core.c> require denied </ifmodule> <ifmodule !mod_authz_co...

c++ - static_assert always triggering in constexpr -

i wrote following code find first index in tuple containing given type. #include <cstdio> #include <tuple> #include <type_traits> #include <utility> namespace detail { template <typename t, typename tuple, std::size_t h, std::size_t... i> constexpr std::size_t tuple_type_index_impl(tuple tup, std::index_sequence<h, i...> seq, std::size_t ret = 0) { if (std::is_same<t, typename std::tuple_element<h, tuple>::type>::value) ret = h; else ret = tuple_type_index_impl<t>(tup, std::index_sequence<i...>{}); return ret; } template <typename t, typename tuple, std::size_t h> constexpr std::size_t tuple_type_index_impl(tuple tup, std::index_sequence<h> seq) { static_assert(std::is_same<t, typename std::tuple_element<h, tuple>::type>::value, "type not in tuple!"); return h; } } template <typename t, typename tuple> c...

Get specific text from xml using python -

i have xml string looks this: <?xml version="1.0" encoding="utf-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/xmlschema" xmlns:geonode="http://www.geonode.org/" xmlns:gml="http://www.opengis.net/gml" elementformdefault="qualified" targetnamespace="http://www.geonode.org/"> <xsd:import namespace="http://www.opengis.net/gml" schemalocation="http://localhost:8080/geoserver/schemas/gml/3.1.1/base/gml.xsd"/> <xsd:complextype name="test_24type"> <xsd:complexcontent> <xsd:extension base="gml:abstractfeaturetype"> <xsd:sequence> <xsd:element maxoccurs="1" minoccurs="0" name="attribute_1" nillable="true" type="xsd:string"/> <xsd:element maxoccurs="1" minoccurs="0" name="the_geom" nillable="true" ...

visual studio - C++ getting LNK2019 error, even though no circular dependency, and nothing included twice -

Image
okay i'm trying create entity component system, , until been working pretty decent, i've encountered linker errors i'm not sure why, i've tried different variations hours can't work, know have made silly mistake can't find it, here files:(general nothing!, , haven't touched main, suppose linker errors caused entity , public files) and have giant wrapper thats 'public.h' includes necessary headers, , has reusable methods, here public.h: #pragma once #include <iostream> #include <vector> #include <string> using namespace std; static int counter = 0; static int namcounter = 0; static int tagcounter = 0; static vector <string> allnames; static vector <string> alltags; //static vector <entity> allentities; //static void addtoallent(entity* newe){ //} int getcounter(); int getnamcounter(); int gettagcounter(); string uniquename(string un = "lol"); string uniquetag(string ut = "lol"); al...

python - Model create using dictionary in django -

in django possible create through dictionary similar filtering? here models.py: class personnels(models.model): name = models.charfield(max_length=100) here views.py: from . models import * def artists(request): personnels = personnels.objects.all() if request.method == "post": data = {"name": "dean armada"} personnels.objects.create(data) however code above throw error. trying do create function coming "request.post" views above serves simple example on doing it simply unwrap dictionary within create function like: personnels.objects.create(**data)

liferay - Render()'s Method different reactions -

Image
i have render() method no code. and have action-method: @processaction(name = "viewbook") public void viewbook(actionrequest actionrequest,actionresponse actionresponse) throws systemexception, portalexception { long bookid = paramutil.getlong(actionrequest, "bookid"); book book = booklocalserviceutil.getbook(bookid); actionrequest.setattribute(finalstrings.book_entry, book); actionresponse.setrenderparameter("jsppage", "/html/libraryportlet/view_book.jsp"); how can rewrite "get" method render() method? mean need run public void render(renderrequest renderrequest, renderresponse renderesponse){ super.render(renderrequest, renderresponse) } in default situation , public void render(renderrequest renderrequest, renderresponse renderesponse){ \\this code not working, it's show want! long bookid = paramutil.getlong(actionrequest, "bookid"); book book = booklocalserviceutil.g...

vb.net - Is it possible to create an immutable property on a domain model? -

we have a number of logical domain objects reside in same physical database table workstep . simple sample of metadata in sql table id |name| type , such type fk table defines types possible. however, once selected database each row might represent different domain model, different business rules must applied. business rule working right once created, worksteptype property 1 of these objects can never change. so, call cause this change bad thing. so, possible make object can constructed via add-ons automapper, , dapper, can have property set once. , never changed? also, types can not cast each other. i haven't tried much, i'm not sure possible without hacky code dapper maps private properties (or private setters/mutators). public class workstep { public worksteptype worksteptype { get; private set;} } if need resulting domain object specific type, make above class simple factory generates type looking for. public class workstepfactory { ...

c# - How to await async method inside ExecutePostProcessingAsync -

i use code http://arcware.net/upload-and-download-files-with-web-api-and-azure-blob-storage/ upload blobs azure. method executepostprocessingasync() call method resizes images , uses async code. the method want use in looks(shrinked) this: public override task executepostprocessingasync() { //some code //i await image resizer method here before going further resizer.scaleimage(); //some more code here before returning return base.executepostprocessingasync(); } if add async method this: public override async task executepostprocessingasync() 5+ errors pop reference issues , error: "is async method returns 'task', return keyword must not followed object expression. did intend return 'task'?" questions: is there anyway await method inside method? or input appreciated, thanks! the async keyword enables use of await keyword. said...