Posts

Showing posts from January, 2015

Tensorflow Incompatable Shapes Error in Tutorial -

i've been trying create convolutional network tensorflow tutorial , i've been having trouble. reason, i'm getting errors size of y_conv 4x larger size of y_, , have no idea why. found this question , appears different problem mine, though looks similar. to clear, batch size in below code 50, error it's coming is tensorflow.python.framework.errors.invalidargumenterror: incompatible shapes: [200] vs. [50] and when change batch size 10, get tensorflow.python.framework.errors.invalidargumenterror: incompatible shapes: [40] vs. [10] so it's related batch size somehow, can't figure out. can tell me what's wrong code? it's pretty straight tutorial linked above. from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets('mnist_data', one_hot=true) import tensorflow tf sess = tf.interactivesession() def weight_variable(shape): initial = tf.truncated_normal(shape, stddev=0.1) return tf.var

Pass javascript variables into PHP use AJAX -

i have 1 javascript variable , want pass php file. search , find use ajax don't know how use ! here code . wrong ? .js file : var message1 = message.message; var jq = document.createelement('script'); jq.src = "https://code.jquery.com/jquery-1.10.2.js"; document.queryselector('head').appendchild(jq); $(document).ready(function() { $.ajax({ type: "post", url: 'http://localhost/a.php', data: { newmessages : message1 }, success: function(data) { alert("success!"); } }); }); my a.php file : <?php if(isset($_post['newmessages'])) { $uid = $_post['newmessages']; echo $uid; } ?> listen onload event of asynchronously loa

javascript - Are AWS server-side TemporaryCredentials usable for client-side S3 upload? -

using client-side version of aws javascript sdk v2.2.29 (e.g. bower aws-sdk-js ) possible (though unacceptable because exposes real aws credentials client): var region = 'us-east-1', accesskeyid = 'az12341234', secretaccesskey = 'abcde1fghij2klmnopqr3tuvwx4yz'; var creds = new aws.credentials(accesskeyid, secretaccesskey); creds.get(function() { s3location = new aws.s3({ region: my.region, credentials: creds }); ready(); // presents upload form, binds events, etc.. }); the dream split process 2 parts, 1 secure server-side , following client-side. part 1. use nodejs server-side version of aws javascript sdk (e.g. aws-sdk ) this: var creds = new aws.temporarycredentials(accesskeyid, secretaccesskey); creds.get(function() { var aws = { accesskeyid: creds.accesskeyid, sessiontoken: creds.sessiontoken, region: my.region, }; // e.g. makes aws var available client res.render('form', { aws: aws })

How should I go about finding a string within two chars in c++? -

hello been trying find way of finding string of characters within 2 characters. how should go doing in c++? sdfgkjr$joeisawesome$sdfeids -> joeisawesome edit: other answer looking if string exist within string. i'm looking string within 2 characters , outputting sting within 2 chars. thank looking pox. okay, when 2 characters, i'm assuming referring delimiters. in case have use string.find() find position of delimiters. after finding positions of delimiters, can can use string.substr(index1,index2-index1) return substring. example: #include <iostream> #include <string> int main() { std::size_t index1,index2; std::string mystring = "sdfgkjr$joeisawesome$sdfeids"; std::string sub= ""; index1 = mystring.find('$'); //string::npos -1 if unaware if(index1!=std::string::npos&& index1<mystring.length()-1) index2=mystring.find('$',index1+1); if(index2!=std::string:

javascript - Linking to specific twitter bootstrap tabs from URL on same page -

i'm javascript noob , i'm wondering how implement answer question? twitter bootstrap tabs: go specific tab on page reload or hyperlink i want use code on same page tabs located.... <script type="text/javascript"> // javascript enable link tab var url = document.location.tostring(); if (url.match('#')) { $('.nav-tabs a[href=#'+url.split('#')[1]+']').tab('show') ; } // change hash page-reload $('.nav-tabs a').on('shown', function (e) { window.location.hash = e.target.hash; }) </script> where inside page containing tabs should plugg in. again, sorry being such noob. try wrapping code in $(document).ready() function $(document).ready(function() { //your code here... }); what have above won't work dom won't ready when runs. using $(document).ready() function delay execution until dom has loaded. can go pretty anywhere in pa

elixir - Ecto association to more than one schemes -

let's have these schemas: defmodule sample.post use ecto.schema schema "post" field :title has_many :comments, sample.comment end end defmodule sample.user use ecto.schema schema "user" field :name has_many :comments, sample.comment end end defmodule sample.comment use ecto.schema schema "comment" field :text belongs_to :post, sample.post belongs_to :user, sample.user end end my questions how can use ecto.build_assoc save comment? iex> post = repo.get(post, 13) %post{id: 13, title: "foo"} iex> comment = ecto.build_assoc(post, :comments) %comment{id: nil, post_id: 13, user_id: nil} so far it's ok, need use same function set user_id in comment struct, since return value of build_assoc comment struct, can not use same function iex> user = repo.get(user, 1) %user{id: 1, name: "bar"} iex> ecto.build_assoc(user, :comment, comment) ** (undefinedfunctione

javascript - How to specify location of image on hover -

i have code display image directly on hyperlinks. unfortunately, if image populates directly on cursor, there seems conflict: website you can see code works small images. large images flicker. how can images stop flickering. think location of displayed image needs away hyperlink. jquery(document).ready(function() { jquery("<div id='player-image-hover'></div>").appendto("body").css("position", "absolute").css("z-index", "1000").css("padding", "2px").css("backgroundcolor", "#666"); jquery("a[href^='http://thepoolscene.com/player-profile']").each(function() { var title = jquery(this).attr("title"); title = title.tolowercase(); title = ucwords(title); var url = "http://" + window.location.host + "/wp-content/gallery/playerphotos/" + escape(title) + ".jp

css - Change table class in mobile view? -

i using bootstrap , table have table-condensed class applied in mobile view, , table-responsive class applied above mobile size. what best approach that? there way in sass ? i have stumbled across ' extend ' in sass don't think quite need when tried implement it, couldn't use within media query, outside of media query worked ok thank :) (i working on trying include code getting error) you can use jquery resize function example $( window ).resize(function() { var screenwidth = $(document).width(); if(screewidth <= 480) { $("#table").removeclass("table-responsive"); $("#table").addclass("table-condensed"); } else { $("#table").removeclass("table-condensed"); $("#table").addclass("table-responsive"); } });

javascript - codeigniter csrf not work in select option -

i want make step input select option, in case, make 3 step, when select first option show next option 2, option 3. using ajax , set $config['csrf_protection'] = true; in codeigniter config file. in first select option (#kategori) work , show next value in second select option, in step 3 select option (#sub1 or secon function of javascript) n't work. thank before. this view: <?php echo form_open_multipart('',array('class'=>'form-horizontal'));?> <?php echo form_label('kategori','id_kategori',array('class'=>'col-sm-2 control-label'));?> <select id="kategori" name="id_kategori"> <option value=""></option> <?php foreach($kategori $kategori_umum) { echo '<option value='.$kategori_umum->id.'>'.$kategori_umum->nama_kategori.'</option>'; } ?> </select> <select i

ios - what is the relation between CVBuffer and CVImageBuffer -

if check doc apple https://developer.apple.com/library/tvos/documentation/quartzcore/reference/cvbufferref/index.html#//apple_ref/c/tdef/cvbufferref in second line , says : "a cvbuffer object can hold video, audio, or possibly other type of data. can use cvbuffer programming interface on core video buffer." means can hold images . if yes , why have cvimagebuffer. i have done work on generating images video using avassetimagegenerator.now want merge frames make video.so,i have started reading this. my current status: 1.well right know need use avassetwriter. 2.then need provide input using avassetwriterinput. 3.i need use cv , cg classes. so please me know reason using cvimagebuffer if have cvbuffer.i know cvbuffer abstract cvimagebuffer doesn't inherit cvbuffer.this bamboozles me more. cvimagebuffer does inherit cvbuffer , in "simulated object orientation in c" way. is, if know cvbuffer 's type of subclass, can safely cast type, e

jsp - Struts 2 s:if with getText -

i want see if message key presented in message bundles. tried below none of them worked: <s:if test=" gettext('site.message') == 'site.message'"> <s:if test=" gettext('site.message').equals('site.message')"> <s:if test=" %{gettext('site.message').equals('site.message')}"> but workaround works fine: <s:text name="site.message" var="test"/> <s:if test=" #test=='site.message'"> please consider: <s:text name="site.message"/> </s:if> so possible omit #test variable , works in s:if it's possible if use body of <s:text> default message instead of body of <s:if> tag. docs page if named message not found in property file, the body of tag used default message . if no body used, stack searched, , if value returned, written output. if no value found on stack, key of message written out.

c - Reloading a Stopped process in xv6 OS -

want write program can save process's state when exits in file , program reload process's state , run left in xv6 os. keeping processes' state when changing among processes in scheduler. how can reload process state cpu , run ? know should run in kernel level mode , can adopt scheduler() , swtch() function in proc.c file.

C pointers and malloc confusion between &str,str -

im beginner in c,in following code can output value of &str , str when cast integer.?? int main() { char *str; /* initial memory allocation */ str = (char *) malloc(15); strcpy(str, "hello"); printf("string = %s, address = %d ,val=%d\n", str, &str,str); free(str); return(0); } this output got: string = hello, address = -1407247144 ,val=22335504

jquery - Is it possible to have a remote: true AJAX partial load into a bootstrap modal on desktop, but as a slide-in-from-the-side form on mobile devices? -

i have rails app working on desktop, ux on phone quite bad, bootstrap modals being loaded page. create new objects load form bootstrap modal using ajax , pop view on page. as part of redesign make mobile user experience better considering using responds_to block design different layout mobile users, , dynamically loaded rails forms (it's data entry) render single page , slide in right, slide out once user submits action. is possible? there suitable gem available might make easier? i considering using responds_to block design different layout mobile users don't. you can use same layout, set css styling different. responsive you're best using media-queries . lots of people confused / overwhelmed "responsive" interfaces; reality simple - use logic assign classes on per-platform basis, else should handled media queries. 99% of styling, logic & flow remains same. in case, believe bootstrap 's modals responsive (ie work on phon

Android One Activity Transition Different Views -

Image
i wondering if can advise best way following: i'm creating application i'm asking user question , user either answers question or proceeds next question fade in , fade out animation using animator instead of anim. of now, have 1 activity , in activity load layout have created in xml , remove view , load new view. i'm not sure if best way present multiple views in 1 activity , prevent need use multiple activities. reason why i'm doing because have several objects i'm storing data based on category of question (whether math, science, social studies, etc). here picture if helps visualize: if there better way this, please let me know. issue i'm having activity java class growing in code because have handle there despite having classes of objects defined in other java files. thank you. i think can build layout relativelayout(see structure) set layout1 android:visibility="visible" , layout2 android:visibility="invisible" @ firs

filenotfoundexception - HTTP Status 500 file not found error in jsp include -

i include file root directory. working fine in local when host site give me: error http status 500: "../connection.jsp" not found my files in public_html/myfolder/connection.jsp on shared hosting. i want include file in public_html/myfolder/process/user-login.jsp if public_html root folder of web application, can use absolute path included resource. <jsp:include page="${pagecontext.request.contextpath}/myfolder/connection.jsp"/>

javascript - Not able to click on label in google chart api -

Image
i new javascript , using google chart api creating charts. wanted click on left side label shows in below image. so, question can click on left side label? give me idea this. if possible me. function drawstackedchart(reqcategoryid,fcategoryname) { $.ajax({ url: "http://localhost:8080/thesanshaworld/sfcms/fetch-complaint-result-for-other-category?categoryid="+reqcategoryid, datatype: "json", success : function(jsondata) { var data = new google.visualization.datatable(); // add columns data.addcolumn('string','categoryname'); data.addcolumn({type: 'number',role: 'interval'}); var complaintstatus = jsondata[0].complaintstatus; for(var i=0;i<complaintstatus.length;i++) { data.addcolumn('number',complaintstatus[i].statusname); data.addcolumn({type: 'number',role: 'scope'}); }

node.js - Opening non-default browser with lite-server in angular2 quick start guide -

having followed typescript version of angular 2 quick start guide , wondering if possible, , if how configure lite-server launch browser other default. it seems lite-server take command line args, served via yargs.argv . , seems yargs attempt parse command line args based on common standards (i.e. if token begins -- , represents argument name, otherwise argument value) obtain argv . lite-server attempt use open property gets argv , launches browser via [one of of node packages launches processes]. node-open? xdg -open? not sure, not important me right long assumption (based on looking @ several of these process launchers) correct, optionally take argument defining process launch. if omitted, default browser used since file type open html, happens. if correct, or @ least gist of it, seems need specify --open chrome , example (assuming chrome in path - working on win machine btw), @ end of lite command defined in package.json . so like... "scripts": { &q

pull artifactory docker image -

i not able pull artifactory docker image using below command docker pull jfrog-docker-reg2.bintray.io/jfrog/artifactory-pro:latest it ends below error error response daemon: invalid registry endpoint https://jfrog-docker-reg2.bintray.io/v0/: unable ping registry endpoint https://jfrog-docker-reg2.bintray.io/v0/ v2 ping attempt failed error: https://jfrog-docker-reg2.bintray.io/v2/: dial tcp 119.81.184.206:443: i/o timeout v1 ping attempt failed error: https://jfrog-docker-reg2.bintray.io/v1/_ping: dial tcp 119.81.184.206:443: i/o timeout. if private registry supports http or https unknown ca certificate, please add `--insecure-registry jfrog-docker-reg2.bintray.io` daemon's arguments. in case of https, if have access registry's ca certificate, no need flag; place ca certificate @ /etc/docker/certs.d/jfrog-docker-reg2.bintray.io/ca.crt what shall here? why asking certificate? , if access link of jfrog repo, asks username , password. how can image. i following offi

actionscript 3 - Hindi Font not coming properly in some client computers -

we have developed adobe air application has option hindi , english. translation used microsoft office hindi pack , used on-screen keyboard write in hindi. have used arial font in application. in of client computers when language changed hindi see boxes in place of words. client computer having arial font available. we ready embed correct ttf file in our application not sure font file being used successful machines did not install special font. please help. == update=== found there option embed font of system application compiled on. used following code not working: [embed(systemfont="arial", fontname="myarial", mimetype="application/x-font", advancedantialiasing="true")] protected var fontclass:class; and in css file added global { font-family: "myarial"; } but getting errors: description resource path location type exception `during transcoding: cannot embed local font

android - samsung multiscreen Proguard conflict with exoplayer -

i want release app in proguard step face problem. generate warning when add lobmok ( or more specific when add samsung-multiscreen jar file) follows : warning:com.google.android.exoplayer.mediacodecaudiotrackrenderer: can't find referenced class android.media.playbackparams warning:com.google.android.exoplayer.audio.audiotrack: can't find referenced class android.media.playbackparams warning:com.google.android.exoplayer.audio.audiotrack$audiotrackutil: can't find referenced class android.media.playbackparams warning:com.google.android.exoplayer.audio.audiotrack$audiotrackutilv23: can't find referenced class android.media.playbackparams warning:com.google.android.exoplayer.audio.audiotrack$audiotrackutilv23: can't find referenced method 'void setplaybackparams(android.media.playbackparams)' in library class android.media.audiotrack warning:com.google.android.exoplayer.audio.audiotrack$audiotrackutilv23: can't find refe

php - Codeigniter Routing for static pages home page working other routes not pages -

Image
when access localhost:8080/ignite_me shows me contents of home.php header , footer when try localhost:8080/igniteme/test gives me apche 404 page , test.php exist in views/pages have put home.php even localhost:8080/igniteme/home not working localhost:8080/igniteme shows content of home.php routes.php $route['(:any)'] = 'pages/view/$1'; $route['default_controller'] = 'pages/view'; $route['404_override'] = ''; $route['translate_uri_dashes'] = false; pages.php <?php class pages extends ci_controller { public function _construct() { parent::_construct(); } public function view($page = 'home') { if ( ! file_exists(apppath.'/views/pages/'.$page.'.php')) { // whoops, don't have page that! show_404(); } $data['title'] = ucfirst($page); // capitalize first letter

multithreading - EDT in Java, how does it work, does it behave like normal thread (single or mutli)? -

this beginner question: working on small chat program use tcp deliver messages, , have simple gui display it, have finished program, edt has confused me lot... does edt behave "extends thread"? imagine single thread since need worker thread process heavy logic, apparently can not thread.sleep/yield (i have while loop reading message outputstream , append jtextarea, running in main thread , tried terminate while loop set false flag , yield main thread , did not work.) i not sure how listener works, if have write it...i start thread each listener, hear process it...but wrong because make edt multithread ( lot of ears ) singlethread during process ( 1 brain ) this must me lacking knowledge!! because in head can not figure out how fire event ... pressed button , java knows? must missed something. my first time post question, hope clear the event dispatching thread thread other thread in java. it responsible dispatching events , repaint requests (and

session - Information required about cookies in php -

i want enable cookies on site. used following code: $cookie_name = 'testing_cookie'; $cookie_value = 'test_cookie_set_with_php'; ($cookie_name, $cookie_value, time() + (86400 * 30), '/'); // 86400 = 1 day i not sure put in "cookie_name", "cookie_value", for. second want know user preference of pages, he/she visits on site. how can reports. third saw message on cookies enabled site, asked ok terms using cookies on site. how can it? i'll go through individual subquestions 1 one: cookies structure consisting of name (to differentiate them), value (your actual payload) , possibly few other fields. see php docs of setcookie() more in-depth explanation. if referring site analytics , there numerous off-the-shelf solutions available (which rely on cookies internally). google analytics (proprietary) , piwik (oss) 2 known examples of such software. further advice on picking best tool needs, please head on softwarerecs

IntelliJ annotate vs git blame -

i using intellij's annotate feature see in editor last changed line in file. now using jgit read same annotations , differ. me seems intellij checks line has not been changed between commits , still uses old commit message. jgit not see , makes other message. can confirm behavior of jgit blame , intellij differs? whats reason , how can force intellij behave same jgit? maybe intellij ignores whitespace changes? i using intellij 15.0.1 , jgit 4.1.1 intellij idea not have own algorithm calculating annotations; runs standard git blame command , parses output. there no way force behave differently. you can find code implementing annotate command in intellij idea git plugin here .

javascript - Add remove icon on image in canvas HTML5 and Fabric js -

Image
i using html5 , fabric.js. uploading multiple images. want user can remove uploaded image. show 1 screen shot. i want add 1 remove icon on image when user clicked on image. html code: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script src="https://rawgit.com/kangax/fabric.js/master/dist/fabric.min.js"></script> <input type="file" id="file"> <input type="color" value="blue" id="fill" /> <select id="font"> java sript code: var canvas = new fabric.canvas('canvas'); document.getelementbyid('file').addeventlistener("change", function (e) { var file = e.target.files[0]; var reader = new filereader(); console.log("reader " + reader); reader.onload = function (f) { var data = f.target.result; fabric.image.fromurl(data, function (img) { var oimg = img.s

Fatal error: Class 'Slim\Views' not found in ...vendor\slim\views\Twig.php -

i'm building simple website in php slim framework , twig template engine. i've installed slim , twig composer in command line. this index.php <?php require __dir__ . '/vendor/autoload.php'; date_default_timezone_set('europe/copenhagen'); $app = new slim\app( array ( 'view' => new slim\views\twig() )); $view = $app->view(); $view->parseroptions = array( 'debug' => true ); $view->parserextensions = array( new \slim\views\twig(), ); $app->get('/', function() use($app){ $app->render('about.twig'); }); $app->get('/contact', function() use($app){ $app->render('contact.twig'); }); $app->run(); ?> the error message is: fatal error: class 'slim\views' not found in c:\program files (x86)\easyphp-devserver-14.1vc11\data\localweb\projects\simple-php-website\vendor\slim\views\twig.php on line 46 it works without twig framework. guess tro

Eclipse : Open perl file in default editor -

how open perl script file in text editor ? as if i'm using below code open files in text editor iworkbenchpage page = activator.getdefault().getworkbench().getactiveworkbenchwindow().getactivepage(); ifilestore filestore = efs.getlocalfilesystem().getstore(new path(path)); try { ide.openeditoronfilestore(page, filestore); } catch (partinitexception e1) { e1.printstacktrace(); } text files opened perl script files executed. think uses default file association open file. how can change perl script opened in text editor ? try this. bypasses lookup default editor in geteditorid() (called openeditoronfilestore() ) , directly opens editor choice. string editorid = "some.editor.id"; ifilestore filestore = efs.getlocalfilesystem().getstore(new path(path)); page.openeditor(new filestoreeditorinput(filestore), editorid); (wild guess code, should work)

how to get domain name of an IP address in c++ -

how can domain name ip address in c++? there sites available in online that. need find out in c++ application. there apis that. found there ways available ip address domain name when googled. looking reverse of that.. that depend on particular networking library use. if have way determine ip name, use same way, name 4.3.2.1.in-addr.arpa figure out what's name ip address 1.2.3.4 (note reversed order in name). libraries allow automatically without bothering making weird name. in qt, example, this: printf("%s\n", qprintable(qhostinfo::fromname("188.35.142.38").hostname())); this prints cache.google.com . but since don't specify library use, it's hard more. need read documentation figure out how reverse dns lookups there. it's performed same function in example above ( fromname accepts both addresses , names).

javascript - onkeydown works on some websites and on some it doesn't -

i trying set keyboard shortcuts gmail. use tampermonkey , onkeydown function. found out gmail special website, because found on many websites approach works, not on gmail. tried these 3 options, none work. suggest? // @match https://mail.google.com // have line option 1 document.onkeydown = keydown; function keydown(evt){ console.log("hhwhehehheeheh"); } option 2 document.documentelement.onkeydown = keydown; function keydown(evt){ console.log("hhwhehehheeheh"); } option 3 document.body.focus(); document.documentelement.onkeydown = keydown; function keydown(evt){ console.log("hhwhehehheeheh"); } your option 1 correct, problem pattern: // @match https://mail.google.com use follow pattern instead: // @match https://mail.google.com/* the problem pattern fits https://mail.google.com without path, gmail content not served https://ma

algorithm - An exercise - cats in a hall -

there many mice in hall of length n. array of length n given a[i] describes number of mice between i-th , i+1-th meter of hall. you have k cats. each cat can guard connected fragment of hall. guarded segments may not intersect. segments may left unguarded. if cat guards segment i-th j-th meter of hall, s = a[i] + a[i+1] + ... + a[j-1] mice reside, catch max(s-(j-i-1)^2, 0) mice. what maximal number of mice can caught? i suspect algorithm should use dynamic programming, have no idea how solve it. i don't have code since don't have algorithm yet (i try create it), thoughts far. we can't use induction wrt number of cats. produce false results. example if there's 1 segment 1 cat can catch 7 mice , 2 disjoint places cat can catch 2 mice, we'll nothing result 1 cat. so should solve problem subsegment , calculate answer answer subsegment. but don't know how proceed further. a cat has better effectiveness of protecting smalle

android - onTextChanged prevet space / new line -

i trying , not work: trying prevent space key writing edittext , not prevent that, i`m trying code: @override public void ontextchanged(charsequence s, int start, int before, int count) { if((addresstextbox.gettext().tostring().contains(" "))) { return; } } how can prevent new line (ascii char number 10) ? for new line add android:singleline="true" "edittext" in xml file for blank space use (as said @aksiddique in answer) @override public void aftertextchanged(editable s) { string result = s.tostring().replaceall(" ", ""); if (!s.tostring().equals(result)) { ed.settext(result); ed.setselection(result.length()); // alert user } } give try , luck!

MongoDb aggregation query conversion to Spring-data -

i have aggregate function wherein structure of output of method : { "_id" : { "vehiclenumber" : "hr55w8395", "vehicletype" : "type_32" }, "mileage" : [ 3.4200838876537736, 3.6082731400212595, 3.7118590539249254, 2.9805899622661784, 5.227747018794297, 3.222515049264743, 3.8845896154778603, 3.548054585322907, 3.010341324091653 ] } the aggregate function db.hop.aggregate([{$group : {_id : {vehiclenumber : "$vehiclenumber", vehicletype : "$vehicletype"}, mileage: {$push : "$mileage"}}}]) and aggregate in spring written : aggregationoperation match = match(criteria.where("starthubouttime").gte(startdatetime).and("endhubintime").lte(enddatetime).and("vehiclenumber").exists(true).and("mileage").exists(true)); //groupoperationbuilder group

linux - ls command ignore specific directory [bash] -

tree: a.txt (file) tests/b.txt (directory) c.txt (file) ls : a.txt tests/b.txt c.txt ignore specific file: ls -i c.txt : a.txt tests/b.txt ignore specific directory: ls -i tests : (does not work - tests directory should not appear) a.txt tests/b.txt c.txt the "man page" ls command explains -i flag accepts pattern . can use wildcard in command: ls -i tests* see: man ls or commands online man page

html - www subdomain looks different than main domain on Google Chrome -

Image
i'm working on website looks different when browser pointed root domain , when pointed "www" subdomain. canvas width, font sizes, image sizes vary between root domain , "www" subdomain. edit 1: happens on google chrome. on firefox, both pages same. please refer these external links site in google chrome. without "www" - https://myshaadiwale.com with "www" subdomain - https://www.myshaadiwale.com even browser console not show amiss. possibly cause difference? the website based on python flask+apache stack. apache configuration file looks this: <virtualhost *:443> servername myshaadiwale.com serveralias www.myshaadiwale.com serveradmin webmaster@localhost sslengine on sslcertificatefile /root/ssl/myshaadiwale.com.crt sslcertificatekeyfile /root/ssl/myshaadiwale.com.key sslcertificatechainfile /root/ssl/intermediate.crt wsgidaemonprocess msw user=live group=live threads=5 python-

javascript - Dynamic Form validation in yii -

i can't seem javascript form validation working in yii i want point script towards user form , include in clientoptions it's saying validateform not defined. i tried default functionality working there doesn't seem anyway validate dynamically created fields in yii without creating own function this. know fields particular instance can put them in manually now $form = $this->beginwidget('booster.widgets.tbactiveform', array( 'id' => 'user-form', 'enableajaxvalidation' => true, 'clientoptions' => array( 'validateonchange' => false, 'validateontype' => false, 'validateonsubmit' => 'js:validateform', ), )); ?> <?php $varform = new dynamicform(); $varform->attributes = $user->getdynamicformconfig(); $varform->model_name = 'user'; echo $varform->run(); ?> js function validateform() { va

php - TYPO3 Femanager Template placeholder condition -

i have quite simple problem. want add star femanager inputfield if required. i tried: <f:form.textarea id="femanager_field_address" property="address" class="input-block-level" additionalattributes="{femanager:misc.formvalidationdata(settings:'{settings}',fieldname:'address')}" additionalattributes="{ng-model: 'address'}" placeholder="{f:translate(key: 'tx_femanager_domain_model_user.address')}{f:if(condition:{femanager:misc.isrequiredfield(fieldname: 'address', actionname: actionname)} == 1)->f:then('*')" /> </div> but got textbox following placeholder: adresse{f:if(condition:1 == 1)->f:then('*') {f:if(condition:{femanager:misc.isrequiredfield(fieldname: 'address', actionname: actionname)} == 1)->f:then('*') that's not valid fluid expres

How do I get a "select count(*) group by" using laravel eloquent -

i execute follow sentence using laravel eloquent select *, count(*) reserves group day the solution occurs me create view in db, pretty sure there way in laravel way. you use this: $reserves = db::table('reserves')->selectraw('*, count(*)')->groupby('day');

c# - Data type mismatch in criteria expression Oledb Access database -

i'm getting error: data type mismatch in criteria expression when using code. , using access database. oledbconnection bab = new oledbconnection(); bab.connectionstring = @"provider=microsoft.ace.oledb.12.0;data source=c:\users\sdega\onedrive\school\werknemersdata.accdb;persist security info=false;"; bab.open(); try { oledbcommand kaas = new oledbcommand(); kaas.connection = bab; kaas.commandtext = "insert werknemersdata (naam, adres, postcode, woonplaats, salaris) values ('" + txtnaam.text + "', '" + txtadress.text + "', '" + txtpostcode1.text + " " +txtpostcode2.text + "', '" + txtwoonplaats.text + "', '" + txtsalaris.text + "') "; kaas.executenonquery(); // goes wrong txtstatus.backcolor = color.green; messagebox.show("data saved"); bab.close(); } catch (exception ghakbal) { messa

html - How to use Adjacent sibling selectors in css -

here html code: <div id="main"> <h1> <div class="details-of-family-members">details of family members</div> </h1> <div class="wrap data"> <h1> hello</h1> </div> </div> here css hide .wrap.data div based on div of class .details-of-family-members inside h1 . in css3 there isn't option select parent based on child. we got sittuation: h1 sibling of .wrap.data , not details-of-family-members . therefore, should add class details-of-family-members h1 tag. , can: .details-of-family-members + .wrap.data { display:none; } .details-of-family-members + .wrap.data{ display:none; } <div id="main"> <h1 class="details-of-family-members"> <div>details of family members</div> </h1> <div class="wrap data"> <h1> hello</h1>

multithreading - C# Blocking collection data handoff time intermittent -

data handoff in blocking collection taking time sometimes... example code: producer: blockingcollection<byte[]> collection = new blockingcollection (5000); { while (condition) { byte[] data = new byte[10240] // fill data here.. read external source collection.add(data); } collection.completeadding(); } consumer: { while(!collection.iscompleteadding) { byte[] data = collection.take(); // write data disk.. } } both producer , consumer running on different task. runs sometime when adding array collection take around 50 milliseconds deal breaker , takes less 1 millisecond hand off data. theoretically consumer thread should not block when writing writing disk on separate thread. it's boundedcapacity value you're passing constructor: blockingcollection<byte[]> collection = new blockingcollection (5000 /* <--- boundedcapacity */ ); you initializing blocking collection

Enumerate installed Packages in Windows 8+ with Delphi 10 -

delphi 10 comes windows rt headers translated pascal. based on this c++ code trying enumerate installed metro applications in windows 8+. problem is, don't know how iterator correctly, iiterable_1__ipackage . findpackages method of deployment_ipackagemanager called correctly, , can confirm scanning memory process (before , after method call). process memory contains strings microsoft.skypeapp etc. packages ready iterated. once set iiterator_1__ipackage first package, becomes invalid pointer value (on pc $3). wonder now, if has incorrect rt headers in delphi or me approaching iteration process wrong way (most likely). current code: program packagesmanager; {$apptype console} {$r *.res} uses winapi.windows, system.sysutils, winapi.management, winapi.applicationmodel, winapi.winrt, system.win.comobj; var lclassid: hstring; pinspectable: iinspectable; pact: iactivationfactory; packagemanager: deployment_ipackagemanager; pkgs: iiterable_1__ipackage;

haskell - Call a function inside a hamlet file -

i have writen small language lookup function getvalue :: string -> string -> string getvalue lang key = ( head $ filter ((== key) . head) langdata) !! getlangindex lang now want call lookup function inside hamlet file. is possible , how have change function make callable? you can use haskell expression in scope using #{} interpolation. make sure function produces of tohtml instance.

relayjs - What do 3 dots/periods/ellipsis in a relay/graphql query mean? -

the relay docs contain fragment: query rebelsrefetchquery { node(id: "rmfjdglvbjox") { id ... on faction { name } } } what ... on faction on syntax mean? there 2 uses of ... related fragments. incorporating fragment reference query foo { user(id: 4) { ...userfields } } fragment userfields on user { name } has effect of composing fields fragment embedding query: query foo { user(id: 4) { name } } note fragments may compose other fragments. inline fragments these can used compose fields in type-dependent way. example: query foo { profile(id: $id) { url ... on user { homeaddress } ... on business { address } } } in example, server determine whether return homeaddress or address field @ runtime, based on whether requested object user or business .

android - Disable javadoc check for Bintray upload -

i trying upload new version of library bintray, getting errors. one of changes made add custom attribute javadoc. example: /** * method something. * * @param myparameter parameter * @see #anothermethod(int) * @attr ref r.styleable#mylibrary_anattribute */ the custom attribute tag added @attr ref show related xml attributes when generating javadoc html (like in android developer documentation). added custom tag in ide (android studio), causes error when uploading bintray. also, using novoda bintray plugin - here part of build.gradle . apply plugin: 'com.android.library' apply plugin: 'com.novoda.bintray-release' ... publish { ... } so when run following command in terminal: gradlew bintrayupload -pbintrayuser=me -pbintraykey=key -pdryrun=false i following error: :mylibrary:compiledebugjavawithjavac up-to-date :mylibrary:mavenandroidjavadocs c:\users\...\alibraryfile.java:216: error: unknown tag: attr * @attr ref r.styleable#mylibr

xcode - iOS simulator looking fuzzy and pixelated -

Image
after upgrading xcode 7.2 ios simulator looks fuzzy , pixelated. simulator version 9.2. simulator screenshot: go debug , untick "optimize rendering window scale" option

java - Prevent autoincrement of id after IGNORE INTO statement in sqlite -

i found few duplicate threads talking using option innodb_autoinc_lock_mode=0 don't know how in sqlite. here code: ps = conn.preparestatement("insert or ignore users(name, lastname) values(?, ?)"); ps.setstring(1, namefield.gettext()); ps.setstring(2, lastnfield.gettext()); int res = ps.executeupdate(); name , lastname set unique keys. works expected (doesn't insert if name , last name exist) autoincrements id every time. idea how approach either fixing autoincrement or changing sql code? i'm doing in java. just remove autoincrement table definition. a plain integer primaray key column still autoincrementing , not keep separate counter. instead, new rows next id after largest 1 in table. autoincrement useful if want prevent ids deleted rows being reused.

ios - Segue not updating delegate window -

i have controller chooses 1 of 2 segues , executes them @ viewdidappear: . 1 of them leads uinavigationcontroller , other leads uitabbarcontroller , both of them implement preferredstatusbarstyle . at point user can open overlay controller check presented view controller , replicate preferredstatusbarstyle my problem can never current view controller being displayed. i'm using code bellow current controller returning first controller ever showed (the storyboard root view controller) , not current one. internal override func preferredstatusbarstyle() -> uistatusbarstyle { if let rootviewcontroller = uiapplication.sharedapplication().delegate?.window??.rootviewcontroller { return rootviewcontroller.preferredstatusbarstyle() } else { return .default } } am doing wrong?

java - Unable to change the value of variable name? -

can change value inside compare method? error - variable need declared final, final wont allow me change. want compare other variables jsonarray(like total_transit_time, total_walking_time). cant think of solution that. teach me easier way it? public jsonarray findshortest(jsonobject json_object) throws jsonexception { jsonarray sortedjsonarray = new jsonarray(); list<jsonobject> jsonlist = new arraylist<jsonobject>(); (int = 0; < json_object.length(); i++) { int name = i; jsonobject json_array = json_object.optjsonobject(""+name); jsonlist.add(json_array); } system.out.println("jsonlist = " + jsonlist.tostring()); collections.sort(jsonlist, new comparator<jsonobject>() { public int compare(jsonobject a, jsonobject b) { string vala = new string(); string valb = new string(); try { vala = string.valueof(a.get("total_duration&