Posts

Showing posts from February, 2014

javascript - jQuery filters sometimes showing all elements -

when toggle between jquery filters show elements class, selected filter shows elements , not ones respective class. you can see in below fiddle. switch between select options , they'll show results. fiddle. function activatebuttons(_data){ $('.jobs-teams select').on("change", function(e) { e.preventdefault(); for(i = 0; < _data.length; i++) { var teamraw = _data[i].title; var team = cleanstring(teamraw); var jobs = $(".jobs-list"); if ($(this).find(":selected").hasclass(team)) { if ($(this).hasclass("active")) { $(this).removeclass("active"); jobs.find(".job").fadein("fast"); } else { $(".jobs-teams").find("a").removeclass("active"); $(this).addclass("active"); jobs.find("."+team).fadein("fast"); jobs.find(".j

linux - getopts: How to accept arguments that aren't tied to an option in my script? -

this question has answer here: how parse command line arguments in bash? 28 answers i'm writing bash script has following usage: ci-badge -t|-a [-b branch] [-m] [-d description] [-l [link] ] repo examples: $ ci-badge -t foo/bar $ ci-badge -ab dev foo/bar -m $ ci-badge quux/bar -md 'hello, world.' more samples can found here on github. anyway, i'm wondering how implement argument parsing script using getopts . after few hours looking @ this basic getopts guide , scouring so, code looks far: #!/usr/bin/env bash generate_url=false # set true if -l passed no arg markdown=false # true -> surround url markdown # parse options while getopts ':tab:md:l:' opt case "$opt" in a) service=appveyor ;; b) branch=$optarg ;; d) description=$optarg ;; l) url=$optarg ;; m) markdown=true ;;

c# - Serialize an instance of a Fragment -

so i'm using newtonsoft json serializer in visual studio 2015 programming android xamarin..i want serialize fragment store in sql database. fragment inheriting android.support.v4.app.fragment , @ point i'm trying serialize, object has been created , layout inflated well. i'm relatively new developing android , c# , .net, making major blunders elsewhere. the class bit big post here, holds lot of other objects such buttons, imageviews , other data types. fields private i've tried making public properties them. i've tried , without [serializable] although don't think has json. so event triggers tries run: var test = jsonconvert.serializeobject(mmemoriesfragment); console.writeline("length: " + test.length); console.writeline("data: " + test); and each time value returned 2, "{}" the json serializer working fine mock classes have properties, returns no values when try serialize fragment. there specific trick this?

variable in javascript not showing on html page using innerHTML -

i have form radio buttons , when click on submit calculates score (js variable). want display scores on page (profiel page). tried using innerhtml didn't show , error: uncaught typeerror: cannot set property 'innerhtml' of null. looked , found out innerhtml has in onload function. tried also, didn't work either. there maybe way this? or there in code isn't right? thank in advance! here's code: quiz page:(ignore questions) call javascript function in submit button element. <div class="content"> <div id="quiz_form"> <form action="<?php echo site_url("home/profiel"); ?>" method="post" name="quizform"> maak de volgende quiz om je persoonlijkheidstype te bepalen: </br> <h2>quiz</h2> <p>extrovert (e) versus introvert (i)</p> <!--totaal:50%--> <p>vraag 1:</p> <input type="radio" id="e" na

google maps - using multi-markers with multi info-windows -

i have array of info-windows corresponding array of markers. now, have problem, use below code generate info-window, when clicking on marker markers disappear unless one, when click on marker there no info-window come out. wrong code ? or shall ? any answer appreciated, in advance. this code inside loop: infowindoarray[i][j] = new google.maps.infowindow({ content:"lat: "+this.position.lat() + "\nlng: " + this.position.lng() + "\n"+ this.custominfo, }); google.maps.event.addlistener(allmarkers[i][j], 'click', (function(x) { return function() {infowindoarray[i][j].open(map,allmarkers[i][j]);} })(x)); edited: added whole loop more clear: (var = 0; < arrayofallfilesdata.length-1; i++) {//to select file. var myarr = arrayofallfilesdata[i+1]; allmarkers[i] = new array(); (var j=0; j < myarr.length; j+

Access VBA Report Printing the Form Underneath -

Image
i have bit of strange issue can't work out. have access database split front , end. 1 of forms has series of radio buttons , launch button, allowing user select report open. have attached photo of form below: when user loads selected report, opens in print preview mode, should. however, when user clicks print button in top left hand corner, 25% of time doesn't print report displayed, prints form underneath print preview. can't work 1 out. understand, print preview has focus because user clicking access print button screen. as said, happens 25% of time, other 75% prints report normally. there nothing done different when prints incorrectly, , unable replciate issue, happens on own despite seemingly identical user inputs. can point me in right direction? edit following code run when display button clicked: dim strlibrary string, strfromdate string, strtodate string, strcategory string dim strbooktype string, strbook string, strborrower string dim boo

ios - Getting duplicate cells with UITableViewController cellForRowAtIndexPath -

i trying create table view using uitableviewcontroller. the 'cellforrowatindexpath' doesn't seem working right-- have pre-loaded photos , comments parse , put them in array, , want pictures fill screen width, doing manual calculations on them resize. i doing unusual things table view right, data duplicated. i know there here i'm not getting, i'm not sure is... maybe need else bind data, or "prepareforreuse" method? i have included code uitableviewcontroller subclass , uitablecell subclass wrote. import uikit class youtableviewcell: uitableviewcell { var recipeid:string = "" var recipename:string = "" var imageheight:cgfloat = 0 var labelheight:cgfloat = 0 // need this? override func prepareforreuse() { self.textlabel!.text = recipeid //put label name self.imageview!.image = nil } override func setselected(selected: bool, animated: bool) { super.setselected(selected, animated: animated) // configure vi

Python - Appending and Sorting a List -

i'm working on code i'm trying take argv (i, w or f) command line. using input, want take list of integers, float or words , execute few things. user enter 'f' on command line , input list of floating points values append empty list. program sort list of float , print output results. i want similar words , integers. if input list of words, output print words in alphabetize order. if input list of integers, output list in reverse order. this code have far, of right of input values appending values empty list. missing preventing code execute properly? for example, program start adding program name , 'w' word: $ test.py w >>> abc abc def def [abc, def,abc,def] # list length, alphabetizing words code import sys, re script, options = sys.argv[0], sys.argv[1:] = [] line in options: if re.search('f',line): # 'f' in command line a.append(input()) a.join(sorted(a)) # sort f

swift - Loading gif before adding cell in tableview -

i'm simulating chat , wanted know how show loading gif before message bubble added in tableview. add message function: func addmessage() { var message: imessage message = imessage.initimessagewithname(self.name, message: self.text, time:self.currenthour(), type "self") self.updatetableview(message) } updatetableview: func updatetableview(msg: anyobject) { self.chattable!.beginupdates() let row1 nsindexpath = nsindexpath(forrow: currentmessages!.count, insection: 0) currentmessages!.insertobject(msg, atindex: currentmessages!.count) self.chattable!.insertrowatindexpaths(nsarray(objects: row1) as! [nsindexpath], withrowanimation: uitableviewrowanimation.bottom) self.chattable!.endupdates() if self.chattable!.numberofrowsinsection(0) != 0 { let ip: nsindexpath = nsindexpath(forrow: self.chattable!.numberofrowsinsection(0)-1, insection: 0) chattable?.scrolltorowindexpath(ip, atscrollposition:uitablevie

Load PHP Into TinyMCE -

how load php tinymce have content : <?php echo "ok"; ?> image : http://i.stack.imgur.com/pqbkq.png i want put textarea (tinymce). try many way not working. please me. you. if want able put php source view of tinymce , have tinymce keep php tags can use protect attribute of tinymce configuration: protect: [ /<\?php[\s\s]*?\?>/g // protect php code ], from documentation: "this configuration option enables control contents should protected editing while gets passed editor. could, example, control codes in html. it's recommended not use inline control contents since breaks wysiwyg editing concept, can't avoided. the option takes array of regular expression match contents against , these invisible while editing."

java - Carry over variable value to new method -

i'm new java , can't seem method working without having reset variable value of 'null' or new object. need have user input carry on next method. public static void additem () { scanner console = new scanner(system.in); string desc, id, str=""; double price = 0, setupprice = 0, unitcost = 0, inventorycost = 0; int stock = 0, demand = 0; product product = new product(); system.out.print("please enter product description between 3 10 characters...: "); desc = console.next(); desc = desc.tolowercase(); product.setname(desc); /*if (desc.length < 3 || desc.length > 10) { system.out.print("this input incorrect, please try again."); }*/ system.out.print("please enter price in $ : "); price = console.nextdouble(); system.out.print("please enter set price. $ : "); setupprice = console.nextdouble(); system.out.print("please enter unit

c++ - Retrieving a variable from an array -

ok problem having have array contains 27 characters , need write function display specific character 0 - 25 based on user input. the array constant string: const string alphabet = "abcdefghijklmnopqrstuvwxyz"; and idea user enters value between 1 , 25 (int value) displays cosponsoring letter in array. doing using: cout << alphabet[value]; my questions appropreate way create array , able retrieve value array way. const string alphabet = "abcdefghijklmnopqrstuvwxyz"; int main() { int value; //variable defining user entered value cout << "please enter number between 0-25." << endl; cin >> value; if (value > 25) //if statement display "-1" if number entered past "z" cout << "-1" << endl; else cout << alphabet[value]; return 0; } my questions appropreate way create array , able retrieve value array way. although wor

angular - How to use JSPM to convert an Angular2 app into a single .js file? -

what simple steps can convert angular2 app single (or few) .js files? the angular2 app runs on local machine, uses node_modules folder close 200mb. said jspm can pack needed .js files 1 single file -- how done? like this . example, if have systemjs config this: <!doctype html> <script src="jspm_packages/system.js"></script> <script src="config.js"></script> <script src="build.js"></script> <script> system.import('app/main.js'); </script> you can bundle this jspm bundle app/main main-bundle.js --inject or, better, (to create output distributable script file can included entirely on own independent): jspm bundle-sfx app/main.js app.js app.js contains micro-loader implementation (1.4kb gzipped), converts module formats es5 (including compiling es6), , maintaining bindings , circular references normal bundles to use jspm need use s

.net - How to add a watermark to ms-word with Default \ Auto settings -

Image
i trying in .net using office interop add watermark word document. text these settings shown here; with emphasis on how set size = auto, , semitransparent == true? right use shapes.addtexteffect requires manually defining font size , fill.transparency exact values. i tries perform textframe.autosize = msoautosize.msoautosizetexttofitshape didn't seem change font size. so, how add watermark text above settings? thanks.

python - FFMPEG video conversion for pygame -

i making program on python (3) using pygame module. 1 of things need play video in avi format. from managed understand pygame.movie documentation have use ffmpeg , not program convert video mpeg (i tried nch prism , result quite memorable). i managed convert file mpg using sample command found in pygame.movie documentation ( ffmpeg -i <infile> -vcodec mpeg1video -acodec libmp3lame -intra <outfile.mpg> ) video quality dropped much. tried looking @ different cites never had working example... is there way keep current video quality? don't care file size... thanks in advance! there loss of quality, that's unavoidable, can try forcing high bitrate , stepping down while quality remains acceptable. start ffmpeg -i infile -vcodec mpeg1video -b:v 8192k -acodec libmp3lame -intra outfile.mpg and work there

html - iOS Fixed Elements Hidden on Input Focus -

this wasn't happening me, updated ios 9.3 2 weeks ago , hidden elements on web page hidden when keyboard displayed or input selected. annoyingly top fixed element hidden if page scrolled, , bottom hidden. seems way 'solve' issues encountered fixed elements being left in random positions on screen when keyboard displayed, i've got situation elements don't reappear reliably, meaning lose main navigation bar app. is there way disable auto-hiding behaviour? i've created barebones page shows behaviour here: http://128.199.171.247/test.html

Sending email through Python -

#!/usr/bin/python import smtplib email.mime.multipart import mimemultipart email.mime.text import mimetext email.mime.base import mimebase email import encoders fromaddr = "sender mail id" toaddr = "receiver mail id" msg = mimemultipart() msg['from'] = fromaddr msg['to'] = toaddr msg['subject'] = "test" body = "test mail" msg.attach(mimetext(body, 'plain')) filename = "foo.txt" attachment = open(r"f:\python\foo.txt", "rb") part = mimebase('application', 'octet-stream') part.set_payload((attachment).read()) encoders.encode_base64(part) part.add_header('content-disposition', "attachment; filename= %s" % filename) msg.attach(part) server = smtplib.smtp('smtp.gmail.com', 587) server.starttls() server.login(fromaddr, "password") text = msg.as_string() server.sendmail(fromaddr, toaddr, text) server.quit() this script working fine when

php - Preserve line breaks between images in DomDocument -

consider php code: $content = '<img />'."\n\n".'<img />'; $doc = new domdocument(); $doc->loadhtml($content); echo $doc->savehtml(); the output (including wrapping html/body etc) gives me: <img><img> with no space between images. calling: $doc->preservewhitespace = true; doesn't change anything. how preserve white space in original html? answering own question - it's buggy behaviour of old version of libxml2: https://bugs.php.net/bug.php?id=50278 this issue solved passing libxml_html_nodefdtd option when loading document. constant available of php 5.4.0 when libxml2 >= 2.7.8 used. see http://3v4l.org/qs4tc . the shared server i'm on uses 2.7.6 not sure helps me, can see if can upgrade. hope helps else.

regex - Regular Expression to match a number followed by that many characters? -

i match strings follow pattern: "n: n-character-string" valid examples: 5. fives 12. abcdabcdabcd 1. o 0. 3. tre is there way accomplish single regex? i'm happy accept flavor of regular expression. no can't regex. finite automation (underlying data structure used regex) has no support memory. is, on lexical analysis done regex, input broken down tokens , can not use token previous stage used further parsing on later stage. read theory of automata more theoretical background this.

search - How to get users by name using QuickBlox SDK iOS -

i integrating quickblox sdk in ios app.i wanted fetch users username.how done quickblox.what search query made.please suggest me ideas on this. use case: whenever user enters characters in searchbar have fetch quickblox users name. you should use method: + (qb_nonnull qbrequest *)userswithfullname:(qb_nonnull nsstring *)userfullname page:(qb_nullable qbgeneralresponsepage *)page successblock:(qb_nullable void (^)(qbresponse * qb_nonnull_s response, qbgeneralresponsepage * qb_nullable_s page, nsarray qb_generic(qbuuser *) * qb_nullable_s users))successblock errorblock:(qb_nullable void (^)(qbresponse * qb_nonnull_s response))errorblock; where userfullname string search bar pagination parameter (for example): qbgeneralresponsepage * page = [qbgeneralresponsepage responsepagewithcurrentpage:1 perpage:100]

c - Critical error when trying to retrieve text value of GTKEntry -

i'm learning basics of gtk school project , trying create basic program prints value of text entry changed. whilst getting output of kind, critical error says : gtk-critical **: gtk_entry_get_text: assertion 'gtk_is_entry (entry)' failed text : (null) my code follows : #include<gtk/gtk.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include "salesbase.h" #include <sqlite3.h> #include <unistd.h> static void change_text(gtkwidget *widget, gtkentry *data){ const char* output = gtk_entry_get_text(data); printf("the text : %s\n", output); } int main(int argc, char *argv[]){ gtkbuilder *builder; gtk_init(&argc, &argv); gobject *window; gtkentry *input; builder = gtk_builder_new(); gtk_builder_add_from_file(builder, "ui/main.ui", null); window = gtk_builder_get_object(builder, "mainwindow"); g_signal_connect (window, "destroy

php - Use preg_match_all from form post submission url -

i have been using preg_match_all url's can fetch data using get method, how data using post method. in case, want fetch pnr details http://www.indianrail.gov.in/pnr_enq.html (which form posts data) , fetch required details. know form post using jquery how go using preg_match_all in php? php , presents variables available http request in form of superglobals : http://php.net/manual/en/reserved.variables.get.php in case there's $_post superglobal array contains variables parsed current http post request: http://php.net/manual/en/reserved.variables.post.php

Kendo tree list two way data binding angular js -

i have create kendo ui tree list 2 way data binding. have try kendo grid working kendo tree list not working. please let me know if missing anything. kendo grid example :- http://dojo.telerik.com/ovuxu/2 kendo tree list example :- http://dojo.telerik.com/@vinay/arawo the treelist bit different in behavior due how process data related load-on-demand. in order make scenario work should defined datasource.data instead of directly datasource array. here updated example - http://dojo.telerik.com/@rusev/ojeho

ruby on rails - How to use methods define in http://www.rubydoc.info/ site -

i have open rails console , want use pluralize method getting error nomethoderror: undefined method pluralize' main:object` pluralize(1, 'person') i can see documentation method here http://www.rubydoc.info/docs/rails/4.1.7/actionview/helpers/texthelper#pluralize-instance_method don't know how use documentation. have tried below code didn't work actionview::helpers::texthelper.new.puralize(1, 'person') actionview::helpers.new.pluralize(1 , 'person') please thanks, use: include actionview::helpers::texthelper not: actionview::helpers::texthelper.new.puralize(1, 'person') or actionview::helpers.new.pluralize(1 , 'person')

llvm - tools for symbolic execution on binaries -

are there tools symbolic execution on binaries. mean using which, not require modify source code - klee_make_symbolic or can such changes in ir (llvm ir etc.) in advance maybe miasm can fit requirements. reverse engineer framework supports static symbolic execution. far know, more simple klee , s2e.

forms - @Url.Action in ASP.NET MVC to action formaction? -

i've spent of day chasing tail on this. there many wonderful suggestions out there, none address problems: we have existing website, someone's linked button href's absolute addresses, , trying figure out way that. i've got of it, 1 line styled button , formaction won't work. original code this: @using(html.beginform(null,null,formmethod.post)) { // ... <div>, stack of buttons, i've converted // <a href="@url.action(.... , buttons work <button class="submit" id="save" value="save" formaction="model/action" class="btn btn-primary"><span class="glyphicon glyphicon-floppy-save"></span></button> // ... stack of more buttons , checkboxes, working... }... i need retain glyphicon button image, , formaction when button clicked. if change button <input> , lose <span> , hence glyphicon. if call @url.action() in button, this: <but

qt - How to resize buttons automatically if the window changes its size? -

i have window , bunch of push buttons. window "main menu". after placing buttons, have these buttons fixed size of window. should fill window , change size if window changes (by user instance). how do that? you should use layouts. according documentation, the qt layout system provides simple , powerful way of automatically arranging child widgets within widget ensure make use of available space. example: main.cpp #include "widget.h" #include <qapplication> int main(int argc, char *argv[]) { qapplication a(argc, argv); widget w; w.show(); return a.exec(); } widget.h #ifndef widget_h #define widget_h #include <qwidget> class widget : public qwidget { q_object public: explicit widget(qwidget *parent = 0); ~widget(); private: }; widget.cpp #include "widget.h" #include <qpushbutton> #include <qhboxlayout> widget::widget(qwidget *parent) : qwidget(parent) {

graphics - Get true color from photo -

i have following problem. developing android app, allow real color photo captured phone camera. pick pixel , real color. how trying solve it: captured photo of real black , color in photo. not same every time captured, because of light , etc. close (0, 0, 0) in rgb. last time got (12, 13, 45). , captured image want true colors , when pick pixel there tried vector math. know (0, 0, 0) converted camera (12, 13, 45), , other color (x, y, z) should (x + 12, y + 13, z + 45). see not right assumption. so know how solve problem? edit not real color. want color close real one.

How to swap array index in php? -

$order_total_query = $this->db->query("select * `" . db_prefix . "order_total` order_id = '" . (int) $order_id . "' order sort_order asc"); if print result, shows: array ( [0] => array ( [order_id] => 1318 [code] => shipping [title] => uk shipping (weight: 0.00kg) [value] => 10.2000 [sort_order] => 1 ) [1] => array ( [order_id] => 1318 [code] => sub_total [value] => 4.7000 [sort_order] => 3 ) [2] => array ( [order_id] => 1318 [code] => coupon [title] => coupon (10p) [value] => -0.4700 [sort_order] => 4 ) [3] => array (

linux - How to find grid points nearest to given location using shell script? -

i have 2 different files. part of files are: file 1: ifile1.txt 21 10.3 70.32 09 32 11.3 71.43 10 33 15.4 75.00 00 54 17.3 68.03 12 95 19.2 65.02 21 99 20.1 80.10 11 , on...... 1st column id, 2nd column refers x-axis, 3rd column refers y-axis, 4th column refers value file2: ifile2.txt 10.10 70.12 10 10.11 73.33 08 11.05 72.40 00 11.30 69.13 15 12.00 64.02 27 12.05 79.20 25 13.10 80.32 10 13.11 75.43 06 14.05 74.00 02 14.20 69.03 15 16.40 65.02 13 16.55 68.10 14 , on...... 1st column refers x-axis, 2nd column refers y-axis, 3rd column refers value i llike make file output (for above example): ofile.txt 21 10.10 70.12 10 32 11.05 71.40 10 33 14.05 74.00 02 54 16.55 68.10 14 95 16.55 68.10 14 99 16.55 68.10 14 1st column id (taken ifile1.txt), 2nd , 3rd column refers x-axis , y-axis (taken ifile2.txt nearest of ifile1.txt), 4th column refer

php - setting default on full text search mysql -

this first time using full text search mysql using innodb. i've read in docs, have option prepend (+) plus sign trim result more. my question can have default searching automatically prepend + when user entered word/s. eg. user entered following: one 2 => (no + sign) result +one +two elliot wizard => (no + sign) result +elliot +wizard in mysql search words containing + though user didn't include +. ps: searched first in internet , did't find article has solution this.. please help. regards, you can achieve this: <?php $string = 'this string'; $stringwithplus = '+'.implode('+',explode(' ',$string)); echo $stringwithplus; ?>

startup - Windows 10 - start up and shut down on power -

i'm using windows 10 tablets museum's interactive exhibit. each tablet embedded in table , connected power supply. i'd to: - shut down windows when ac power goes off (i.e. device start feeding battery). there event can use in task scheduler? couldn't find it. - start when ac comes alive. suggestion appreciated. thanks. i not think there way start or stop windows ac power. however, can realize want by remote control .

java - Convert a string to a swt color -

the real problem want use color chooser (for awt color), swt component. thought awt color, .tostring on it, recover string, , convert swt color. harder expected. here string convert : string mycolor = "color {248, 248, 248}"; i did .tostring method on awt color. do have idea on how ? here sample method taken example , converts awt color swt color : public static color toswtcolor(device device, java.awt.color color) { return new org.eclipse.swt.graphics.color(device, color.getred(), color.getgreen(), color.getblue()); }

Android studio build fast but run wrong in emulator -

exactly problem, if have small change in app display ui (modify activity code or resource layout), android studio build fast , run app in emulator without kill "previous version" process (running in emulator), sometime it's run , display correct, sometime doesn't run correct want, must kill process manual , rebuild project, takes lot of time, , makes me confused because don't know go wrong, thought bug. it happen when update android studio, think feature powerful , helpful, application mustn't rerun beginning whenever build new version. but how enabled/disabled "fast build", sometime want android studio build project normally. you have 2 solution: 1)you can disable instant run settings > build,execution,deployment > instant run - , disable it 2)clean project when studio doesn't build properly

python - How to get media_url from tweets using the Tweepy API -

i using code: import tweepy tweepy.api import api import urllib import os = 1 consumer_key="xx" consumer_secret="xx" access_token="xx" access_token_secret="xx" auth = tweepy.oauthhandler(consumer_key, consumer_secret) auth.secure = true auth.set_access_token(access_token, access_token_secret) api = tweepy.api(auth) class mystreamlistener(tweepy.streamlistener): def __init__(self, api=none): self.api = api or api() self.n = 0 self.m = 10 def on_status(self, status): if 'media' in status.entities: image in status.entities['media']: global #picname = status.user.screen_name picname = "pic%s.jpg" % += 1 link = image['media_url'] filename = os.path.join("c:/users/charbo/documents/python/",picname) urllib.urlretrieve(link,filename) #use test print(status.user.screen_nam

sql server 2008 r2 - SQL retrieving tree structure query -

i have 2 tables products table: id productname category 0 t-shirt 15 1 aqua de gio 12 2 jacket 15 3 hot water 13 categories table: categoryid catagoryname highercategoryid 8 fragnance 0 99 clothing 0 15 armani clothing 99 12 armani fragnance 8 102 davidoff fragnance 8 expected result id productname category categorytree 0 t-shirt 15 clothing > armani cloting 1 aqua de gio 12 fragnance > armani fragnance 2 jacket 15 clothing > armani cloting 3 hot water 13 fragnance > davidoff fragnance for example take t-shirt products table its category 15. go categories table , see categoryid=15 look @ highercategoryid if = 0 stop, if not take value 99 look 99 in categoryid column, higher category 0 stop. based on above need "clothing > armani clothing".

What is Spring Security`secured-annotations="enabled"` analogue for Java Config? -

consider use java config spring security: @configuration @enablewebsecurity public class securityconfig extends websecurityconfigureradapter { ... } how can analogue of xml configuration <global-method-security secured-annotations="enabled" /> ? you can use @enableglobalmethodsecurity annotation configure , set securedenabled annotation attribute true . @enableglobalmethodsecurity enables spring security global method security similar <global-method-security> xml support.

bash - why diff utility show the similar text in result file? -

i using diff find differences between 2 text file. working great but, when change order of lines in text files, show similar text in result file. here file1.txt: >gi17 aaaaaa >gi30 bbbbbb >gi40 cccccc >gi92 dddddd >gi50 eeeeee >gi81 ffffff file2.txt >gi40 cccccc >gi01 bbbbbb >gi02 aaaaaa >gi30 bbbbbb result.txt: >gi17 aaaaaa >gi30 ??? bbbbbb ??? >gi92 dddddd >gi01 bbbbbb >gi50 eeeeee >gi81 ffffff >gi02 aaaaaa >gi30 ??? bbbbbb ??? diff statement: $ diff c:/users/user/desktop/file1.txt c:/users/user/desktop/file2.txt > c:/users/user/desktop/result.txt why displays >gi30 bbbbbb as defferent? edit 1: want search occurrence of each line in file 1 in whole file 2 because 2 files not ordered , cannot touch them (genetic data). edit 2: want execute join command php code. run in cygwin cmd application but, did not run php shell_exec("c:\\cygwin64\\bin\\bash.exe --login -

C deep copy struct with pointer -

i'm new c , need solve following problem. i have project reading small bmp (512x512) image. i've managed change colors , have mirrored (both horizontal vertical). though need turn -90°. function can't manage work deepcopybitmap() . i keep getting following error on *copy->raster[i] : indirection requires pointer operand ('pixel' (aka 'struct _pixel') invalid) rotation (512x512) typedef struct _pixel { unsigned char blue; unsigned char green; unsigned char red; } pixel; typedef struct _bitmap { char file_path[path_max+1]; char magic_number[3]; unsigned int size; unsigned char application[5]; unsigned int start_offset; unsigned int bitmapheadersize; unsigned int width; unsigned int height; unsigned short int depth; unsigned char* header; pixel* raster; } bitmap; void rotate(bitmap* bmp) { int i; int j; pixel* originalpixel; bitmap* originalbmp; deepcopybitmap(

linux - CMake: how to use if condition in add_custom_command(...) -

i want use linux if condition in cmakelists.txt add_custom_command(...) need run these if condition , judgement in makefile. this: cmake_minimum_required(version 2.8) add_custom_target(temp_target all) add_custom_command(target temp_target pre_build command if ["a" != "b"]; echo 1; fi; verbatim ) what should if want use if ["a" != "b"]; echo 1; fi; when make makefile? lot help! you may specify one-line shell code using /bin/sh -c command argument: command /bin/sh -c "if [ 'a' != 'b' ]; echo 1; fi;" note, [ extension of bash, may unknown simple shells "dash".

php - TCPDF Stretch Text Vertically -

Image
i working on project need texts stretched given sized rectangle. tried imagick there quality losses it. for example have box sizes 203x78 (any size), , wrote text "lorem ipsum lorem" (any text). want text fit given size 203x78, no matter font-size no matter other things, quality , fit box. i cound not find method better imagick way: firstly drawing transparent text closest font-size box (sure more little), , drawing image. after that, resizing box size. when resizing it, tried of filter in imagick. there no matter in way except little sized texts. eg. font size 20px , box size bigger draw 1-3px on side. mean, 20px drawn text size 40x18, box 41x20. resizing 41x20 blurred in effect , effect value. so want create text tcpdf , want resize text fit given size. fitting must fit both horizontal , vertical, totally stretched. chosed pdf because text in pdf in vectoral format , there no losses while resizing size. tcpdf has horizontal stretch not find way stretch both of s

How to convert date format using javascript -

this question has answer here: format following date yyyy-mm-dd in js 4 answers i new javascript, how convert date format('2016/5/6') ('06.05.2015'). want convert in because need manipulate date. ('06.05.2015') format used everywhere. please suggest me link or tutorial thanks var today = new date('2016/5/6'); var dd = today.getdate(); var mm = today.getmonth()+1; //january 0! var yyyy = today.getfullyear(); if(dd<10) { dd='0'+dd } if(mm<10) { mm='0'+mm } today = mm+'.'+dd+'.'+yyyy; alert(today); jsfiddle

css - Set text aligment on the right side -

i have table left text alignment. how can set checkbox right text alignment? <h:panelgroup styleclass="table-right"> <h:selectbooleancheckbox value="#{bean.method}"> </h:selectbooleancheckbox> </h:panelgroup> .table-right { text-align: right; } html output: <tr> <td>security question</td> <td><textarea id="form:securityquestion" name="form:securityquestion" cols="60" rows="3" onblur="mojarra.ab(this,event,'blur',0,'form:securityquestionvalidator')"></textarea><span id="form:securityquestionvalidator"></span></td> </tr> <tr> <td>security answer</td> <td><textarea id="form:securityanswer" name="form:securityanswer" cols="60" rows="3" onblur="mojarra.ab(this,event,

php - Premature end of file. XML response -

i getting premature end of file response xml request following code. cant figure out error. $xml = '<?xml version="1.0" ?>'; $xml .= '<pickupcitylistrq>'; $xml .= '<credentials username="'.$api->username.'" password="'.$api->password.'" remoteip="'.$api->remoteip.'" />'; $xml .= '<country>uk</country>'; $xml .= '</pickupcitylistrq>'; $url = 'https://secure.rentalcars.com/service/servicerequest.do?servername=www.rentalcars.com&xml='.utf8_decode(trim($xml)); $port = 443; $user_agent = $_server['http_user_agent']; $ch = curl_init(); // initialize curl handle curl_setopt($ch, curlopt_url, $url); // set url post curl_setopt($ch, curlopt_failonerror, true); // fail on errors if (ini_get('open_basedir') == '' &