Posts

Showing posts from January, 2015

c++ - Infix vs prefix syntax: name lookup differences -

operators in c++ considered alternative syntax functions/methods, in context of overloading. if so, 2 expressions below should synonymous: std::cout << 42; operator<<(std::cout, 42); in practise, second statement leads following error: call of overloaded ‘operator<<(std::ostream&, int)’ ambiguous as usual, such error message accompanied list of possible candidates, these are: operator<<(basic_ostream<_chart, _traits>& __out, char __c) operator<<(basic_ostream<char, _traits>& __out, char __c) operator<<(basic_ostream<char, _traits>& __out, signed char __c) operator<<(basic_ostream<char, _traits>& __out, unsigned char __c) such error raises @ least 2 questions: in way 2 statements different (in terms of name lookup)? why operator<<(basic_ostream<char, _traits>& __out, int __c) missing? it seems, infix , prefix notations not interchangeable -- different syntax ent

sql server - How to fix locale errors in RODBC (WAS: R CMD BATCH: "$ operator is invalid for atomic vectors" but not in Rstudio) -

maybe related: stack overflow: windoes not support utf-8 i have script can source rstudio , when try source rgui.exe or try batch cmd run, following error in rout file: error in easy_clean$sv_karakter: $ operator invalid atomic vectors the reason database table quering have latin charachter 'ø' in name (se third line below). result of query (as per str(easy)): "";"x" "1";"42000 102 [microsoft][odbc sql server driver][sql server]incorrect syntax near '¸'." "2";"[rodbc] error: not sqlexecdirect 'select * prøvedeltager left outer join aftaler b on b.cpr = a.cpr left outer join godk c on c.godk_id = b.godk_id a.slut >= '20140808' , a.slut <='20140818' , a.branche = 'vvs' , a.saleid not null , a.cpr in (select x.cprnr statistik x) order sv_karakter'" in rstudio query works. sys.getlocale('lc_ctype') returns danish_denmark.1252

android - how to use some features from another app and use it in my app? -

i want create small app witch scan texts camera , return in (edit text) this feature(scan texts camera)is available in google translate app so how can use in app ? if app set so, can call startactivityforresult , launch, run, , return result via onactivityresult. if app isn't set work way, can't @ all.

jsf - Why primefaces is not applying validation rules to components -

Image
i'm trying validate form using hibernate validations. hibernate not let data included without required fields, however, no message sent in primefaces. when sent form data, not included in database , screen not show error message. how can fix that? xhtml <h:form id="frm" > <p:messages /> <h:panelgrid columns="3" cellpadding="5"> <h:outputlabel class="form-label required" for="nome" value="nome" /> <p:inputtext id="nome" value="#{usuariomb.usuario.nome}"> </p:inputtext> <p:message for="nome"></p:message> <h:outputlabel class="form-label" for="email" value="e-mail" /> <p:inputtext id="email" type="email" value="#{usuariomb.usuario.email}" /> <p:message for="email"></p:messa

javascript - How to set up the ACL to allow everyone list all the Users from the REST API -

im trying list users in loopback 2.0 app using rest api , i'm getting following error: { "error": { "name": "error", "status": 401, "message": "authorization required", "statuscode": 401, "stack": "...." } } i manually added acl model-config.json file: "user": { "datasource": "db", "acls": [ { "principaltype": "role", "principalid": "$everyone", "permission": "allow", "accesstype": "*" } ] }, since failed, created model based on user built-in model: { "name": "admin", "base": "user", "properties": {}, "validations": [], "relations": {}, "acls": [ {

algorithm - Build a directed regular graph of elements in an array -

Image
given array, able define relationship between elements each element "points to" given number of elements, such no element should share more 1 target element other given element of array. i'm pretty sure can done solution graph theory, embarrassingly don't know graph theory , therefore don't know i'm looking for. best can graph describing links between elements regular , directed. the xy: have/want two-dimensional grid (i don't think dimension relevant math helpful visualization), each cell points around 16 (flexible on this) other cells minimum of duplication. grid texture it's anywhere in 256*256 4096*4096 size range, doesn't make significant difference algorithm. once visualized 2d texture, there obvious "intuitive" solution based on image masks, it's totally informal , relies on implementation details (using fewer targets purposes of illustration): using regular pattern pointed-to cells inappropriate: the next cel

objective c - Plists Loading On Simulator but Not On iPhone -

i have arrays filled strings being saved plists, runs fine on simulator when load app iphone arrays saved plists returned null. here code: nsfilemanager *filemanager = [nsfilemanager defaultmanager]; // path balance.plist in documents directory nsarray *paths = nssearchpathfordirectoriesindomains( nsdocumentdirectory, nsuserdomainmask, yes ); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"balance.plist"]; nsstring *path2 = [documentsdirectory stringbyappendingpathcomponent:@"interest.plist"]; nsstring *path3 = [documentsdirectory stringbyappendingpathcomponent:@"principal.plist"]; nsstring *path4 = [documentsdirectory stringbyappendingpathcomponent:@"dates.plist"]; nsstring *path5 = [documentsdirectory st

CSS multiple backgrounds issue -

why not working? how should change it? jsfiddle <div id="slider" class="middle"> </div> #slider{ height:467px; background:#eeeeee url(cercuri.png) no-repeat left top, url(cercuri2.png) no-repeat right top; } as can see, want background-color , 2 images, 1 left , 1 right. remove color , leave (sorry, used own images since had images @ localhost) #slider{ height:467px; background-color:#eee; background: url(http://c.dryicons.com/files/graphics_previews/sunset_landscape.jpg) no-repeat left top, url(http://media-cdn.tripadvisor.com/media/photo-s/01/e4/f8/e6/another-view-of-landscape.jpg) no-repeat right top; } you can see fiddle here

opencv - How to connect lines after probabilistic Hough transform? -

Image
i trying find cross on image. here steps: 1. canny operator 2. probabilistic hough transformation => set of sections - on image. i want connect dotted lines in order few long segments. unfortunately, didn't find standard tool that: standard hough transformation - returns infinite lines, not useful. dilation - cannot connect dotted lines. any ideas welcome.. update: don't have exact source of above image right now, here 1 of examples.

android - Call service method from activity -

i need call function service when item options menu pressed: if (id == r.id.action_connect) { if (misbound) { localservice.connect(); // cannot referenced static context } } i'm using these docs . read few answers i'm not sure one. you can call startservice(someintent); for example activity can this intent serviceintent = new intent(this, theservice.class); serviceintent.addcategory("some_unique_string"); startservice(serviceintent); then in service public int onstartcommand(intent intent, int flags, int startid) { if (intent != null) { if (intent.hascategory("some_unique_string")) { themethodyouwanttocall(); } else if (intent.hascategory("some_other_string")) { someothermethod(); } } return start_sticky; } you can call startservice like. the basic idea create intent represents "intended" method want call , in service onsta

c# - Is it possible to execute a task every time an event occurs in another app? -

is possible app execute task when event occurs in app? example: song starts playing on device. wanted app invoked , execute task every time happens. i know possible implement periodictask make tasks run every x minutes/hours... not i'm looking for. answer yes in limited way. can't catch specific events. from msdn site . you can use file , uri associations in windows phone 8 automatically launch app when app launches specific file type or uri scheme. when launched, deep link uri used send file (a reference file) or uri app. can use association launching api launch app in same way. file associations allow app automatically launch when user wants open particular file. file come variety of sources including, not limited to: email attachment, website via internet explorer, near field communications (nfc) tag or app store. so can enable app app communication via file , uri associations there lots of reserved types handled defaul

r - Referring values in a matrix (extended) -

i have r code friend takes numeric vector, , each number checks if number same upside down. numbers = (0:9) upside_down_numbers = c(0,1,na,na,na,na,9,na,8,6) ref_table = rbind(numbers,upside_down_numbers) invertible = function(n){ as.numeric(paste0( upside_down_numbers[ 1+rev(as.numeric(strsplit(as.character(n),"")[[1]])) ],collapse=""))} i want return true if number entered same number returned example: invertible(69) [1] 69 and false if number entered different number returned or returns na example: invertible(99) [66] i want code able work on multiple numbers example: invertible(c(1, 96, 99, 123, 1691)) [1] true true false false true really stuck @ point, appreciate advice. thank you this unusual task... work you. invertible_test <- function(n) { inverted <- suppresswarnings(invertible(n)) if (is.na(inverted)) { return(false) } return(n == inverted) } invertible_test_vector <- function(v) {

java - Maximum size of HashSet, Vector, LinkedList -

what maximum size of hashset , vector , linkedlist ? know arraylist can store more 3277000 numbers. however size of list depends on memory (heap) size. if reaches maximum jdk throws outofmemoryerror . but don't know limit number of elements in hashset , vector , linkedlist . there no specified maximum size of these structures. the actual practical size limit somewhere in region of integer.max_value (i.e. 2147483647, 2 billion elements), that's maximum size of array in java. a hashset uses hashmap internally, has same maximum size a hashmap uses array has size power of two, can @ 2 30 = 1073741824 elements big (since next power of 2 bigger integer.max_value ). normally number of elements @ number of buckets multiplied load factor (0.75 default). however , when hashmap stops resizing, still allow add elements, exploiting fact each bucket managed via linked list. therefore limit elements in hashmap / hashset memory. a vector uses array intern

regex - Single repetition for some of the symbols in a set of characters -

i need regular expression matches string containing letters , symbols: @ , . or space. symbols must appear once in whole string. ^[@][.][a-z]+$ - matches example@.asdf need match 1 @ , 1 dot in string. ^[a-z]+[@][a-z]+[.][a-z]+$ - best result now. i wondering if can use - ^[a-z[@]{1}]$ . you realize away writing 6 permutations of 3 symbols. unfortunately, that's best can plain regular expressions because definition way regexp (seen finite state automata) can remember happened before through current state, can't have set store what's you've seen far. so you'll have this. \a stands letters (you can expand [a-za-z]) because it's bad enough that. can use \a*([@]?\a*[.]?\a*[ ]?|[@]?\a*[ ]?\a*[.]?|[.]?\a*[@]?\a*[ ]?|[.]?\a*[ ]?\a*[@]?|[ ]?\a*[.]\a*[@]|[.]?\a*[ ]\a*[@]|)\a* i threw in question marks after charactacters, each can appear "at most" once, if want once drop question marks. evidently, if dealing 10 symbols , had wri

python - How to append an "checkbox" into dialog by using pywin32 -

i met problem here. create dialog , add button code below, because know constant "128" control "button" exsiting example not know 1 can used "checkbox" or "radiobutton"? import win32ui import win32api import win32con pywin.mfc import dialog # window frame , title dlg = [ [title, (0, 0, 300, 392), style, none, (8, "ms sans serif")], ] dlg.append([128, u"output", idc_btn_output, (142,56,50,14), win32con.bs_defpushbutton]) according source code , documentation, dialog template here list first item pydlgtemplate instance followed series of pydlgitemtemplate instances. the documentation says first member of pydlgitemtempalte structure: [0] string/int : windowclass the window class. if not string, must in integer defining 1 of built-in windows controls. if string, must pre-registered windows class name, built-in class, or clsid of ole controls. built-in classes include: control type string

java - Boolean method with string returns -

in homework have predicate method prints question , waits question. if user enters no, method should return false, if user enters yes method should return true. have done ! in part have problems: if user enters thing program must "wrong answer" , repeat question. can't return string because boolean method , dont know how resolve this. thank you!! import acm.program.consoleprogram; public class yesno extends consoleprogram{ public void run () { string answer = readline ("would instructions? "); println (strboo (answer)); } private boolean strboo(string answer){ if (answer.equals("yes")) { return true; } else if (answer.equals("no")) { return false; } else { return false; } } } first strboo poor method name. call getanswer() , , use like, private static boolean getanswer() { while (true) { string answerstr = readline ("would instructions? "); answerstr

Oracle procedure to move tablespace -

friends... i'm testing oracle procedure move tables, indexes of tablespace new tablespace... i'm trying debug , fix simple procedure gives me cursor error... please point error? i can generate manually there 200 tablespaces there plan move @ regular interval wanting automate task. objective: accept old tablespace , new tablespace @ procedure run , use move objects in tablespace new tablespace. i plan below: accept old_tbs, new_tbs @ procedure run move table old_tbs new_tbs rebuild indexes of table new_tbs move table b old_tbs new_tbs rebuild indexes of table b new_tbs loop... create or replace procedure movetbl (oldtbs in varchar2, newtbs in varchar2) tblsql varchar2(250); cursor curtable (vowner varchar2, vtblname varchar2, vtbsname varchar2) select owner, table_name, tablespace_name dba_tables tablespace_name = oldtbs order 2; rec1 curtable%rowtype; begin rec1 in curtable loop dbms_output.putline('rec1.owner |

css - CssStyleHelper calculateValue fails for a looked up value (-fx-cursor) -

i'm building app using javafx 8 , whenever run it, wall of text warning me looked value -fx-cursor rule of text input controls not resolved: aug 17, 2014 10:16:26 pm javafx.scene.cssstylehelper calculatevalue warning: not resolve 'a lookup value' while resolving lookups '-fx-cursor' rule '*.text-area *.content' in stylesheet jar:file:/library/java/javavirtualmachines/jdk1.8.0.jdk/contents/home/jre/lib/ext/jfxrt.jar!/com/sun/javafx/scene/control/skin/modena/modena.bss i received similar warning *.text-input style class , attempted manually specify rule in css file, did not remove warning, shown below: aug 17, 2014 10:16:26 pm javafx.scene.cssstylehelper calculatevalue warning: not resolve 'a lookup value' while resolving lookups '-fx-cursor' rule '*.text-input' in stylesheet file:/users/orionf22/netbeansprojects/myapp/target/classes/styles/myapp.css i saw similar questions online said have default css file not being loade

python - pytumblr ImportError: No module named pytumblr -

i receive error "importerror: no module name pytumblr" when trying run python script using tumblr's api. i installed pytumblr using following: sudo pip install pytumblr my script looks this: import pytumblr client = pytumblr.tumblrrestclient( '<consumer_key>', '<consumer_secret>', '<oauth_token>', '<oauth_secret>', ) client.info() note: parameters in tumblrrestclient method filled out in script. i'm new python , have never used api or installed module before. have hunch module not found because pytumblr not installed in proper directory script searches when making import call. thanks help! you try: uninstall existing packages sudo pip uninstall oauth oauth2 pytumblr reinstall sudo pip install oauth oauth2 pytumblr also, check python version correlates pip using. can use python --version , pip --version check.

Visual Studio 2013 upgrade 3 no windows phone project option? -

Image
i'm trying create first windows phone app can't find project type. is there trick getting option appear. i have latest update installed. 1 http://oi59.tinypic.com/iznqdk.jpg cheers. did install sdk? has checked during installation process or else not have option available you. http://dev.windows.com/en-us/develop/download-phone-sdk then menu point should appear. note under windows 8.x project under store apps.

javascript - WebRTC The ICE candidate could not be added -

i trying establish p2p audio/video connection b/w 2 peers. following: getting started webrtc . it works fine @ home in lan environment between 2 pcs, throws error message when running @ company's lan environment, there part javascript function processsignalingmessage(message) { var msg = json.parse(message); if (msg.type === 'offer') { // callee creates peerconnection if (!initiator && !started) maybestart(); // know jsep version after createpeerconnection(). if (isrtcpeerconnection) pc.setremotedescription(new rtcsessiondescription(msg)); else pc.setremotedescription(pc.sdp_offer, new sessiondescription(msg.sdp)); doanswer(); } else if (msg.type === 'answer' && started) { pc.setremotedescription(new rtcsessiondescription(msg)); } else if (msg.type === &

php - Incrementing a row in a column from an empty column -

i have question regarding incrementing column in table. trying achieve is, i using php program when user press button every row inserted do_no incremented 1 in every row insertion. what have sql command is, insert delivery (packing_no, do_no) values ('packing1', ((select max(do_no) delivery)+1)) packing_no inserted based on text input the problem is, when table empty, do_no not updated. means keeps emptied. i guess not efficient way implement kind of problem. anybody can suggest me better way solve ? thanks. you can use case condition , not see other way achieve this. declare varmax(int) set varmax = (select max(do_no) delivery); insert delivery (packing_no, do_no) values ('packing1', (case when varmax null 1 else (varmax +1)) or simplify, can check against row count well set varmax = (select count(do_no) delivery); further simplifying it, pointed in other answer, use isnull insert delivery (packing_no, do_no) values ('p

tcl - How to spawn from a variable in Expect -

there processes take in password partway through computation. wish insert password @ start of process, trying create generic expect script spawn process, give password. this expect script takes in password enter , process spawn: #!/usr/bin/expect set timeout 120 # program spawn , password send set pswd [lindex $argv 0] set program [lindex $argv 1] spawn $program expect "password:" send "$pswd\r" interact this called bash function: function vup { echo -n "enter password: " read -s pswd echo expectpassword.exp $pswd "vagrant up" } but error: couldn't execute "vagrant up": no such file or directory while executing "spawn [join $program]" this script seems work when use on program without arguments. i'm not sure how make work 1 variable number of arguments. one way use eval : eval spawn $program

How to make curve and rounded image in Blackberry 10 native? -

Image
i trying curve , round image not able perfectly. have tried create .amd file , set background not working perfectly. there other way through can make image round curved on blackberry - 10. ? i getting image response server below: i want following images.images not static dynamic it's comes web service. i have checked links blackberry forums did not proper solution. if knows please let me know. to put rounded corners on image use the 9 slice feature described in api . using drawing program crreate small square example of frame. using 9 slice system scale size of image , lay on image. the same procedure work cicularly vignetting images. depending on howmany sizes want may have draw them on fly or have several sizes , scale other sizes.

PHP Mysql multiple inserts (big dataset) -

i have been running relatively simple script, tends lock database. each time lookup value inserted, checked against make sure isnt inserted again. this works on small data sets (<50k), has issues large data sets (>2m). appreciated. $insertcounter = 20; $matchcounter = 200; $insertindex = 0; $sqlinsert = 'insert `database` (`lookup_value`, `timestamp`, `source`) values '; $matchindex = 0; $resetcount = 0; $indexcounter = 0; foreach ($matches $lookup) { $sqlselect = 'select `id` `database` `lookup_value` = \'' . $lookup . '\''; $qexisting = executesql($sqlselect); if (mysql_num_rows($qexisting) == 0) { $insertindex += 1; $sqlinsert .= '(\'' . strtolower($lookup) . '\', \'' . date('y-m-d h:i:s') . '\', \'database\'), '; if ($insertindex >= $insertcounter) { $sqlinsert = substr($sqlinsert, 0, strlen($sqlinsert) - 2); exec

Java why static prints out text first than method -

just wondering why static 1 print out first rather method. code: public class testme { static { system.out.println("d"); } { system.out.println("b"); } public void printme() { system.out.println("z"); } public static void main(string []args) { new testme().printme(); } } output: d b z you have 2 types of initializer block in class one static initializer executed time class initialized 8.7. static initializers a static initializer declared in class executed when class initialized 8.6. instance initializers two instance initializers executed when instance of class create an instance initializer declared in class executed when instance of class created those jls documentation so static initializer called directly when class initialized vs instance initializers called when instance of class created static initializer executed first.

css - How to Add flexibility to SASS for another color -

i've got sass i've inherited looks below. want able specify css tag differentiate between green , color (see anchor tag , comment). now, have- <div class="names"></div> the link shows green. want able like- <div class="names myblue"></div> and instead have different color. &.speakercount3 { .names { text-align: center; li { text-align: center; display: inline-block; width: 82px; margin-left: 5px; &:first-child { margin-left: 0; } } img { max-width: 100%; } h3 { margin-top: 0; { font-size: 10px; } } } } .names { min-height: 180px; .photo { margin-top: -21px; } img { display: block; border: 3px solid #282828; margin: 0 auto; }

javascript - jQuery not returning jquery.closest().text() -

i'm having issue jquery returning text closest td.index . heres i'm working with : $(document).ready(function() { $.getjson("http://ddragon.leagueoflegends.com/cdn/4.14.2/data/en_us/rune.json", function(response){ console.log(response.data); $.each(response.data, function (index, entry) { $('table.runes').append('<tr><td class="index">' +index+ '</td><td class="icon"> \ <div style="width:48px;height:48px;background:url(./assets/runes/rune0.png) -' +entry.image.x+ 'px -' +entry.image.y+ 'px no-repeat"> \ </div></td><td class="entry-name">' +entry.name+ '</td></tr> \ <tr><td></td><td class="entry-desc">' +entry.description+ '</td

html5 - jQuery Mobile Validation in Asp.Net MVC5 -

i'm creating jquery mobile based asp.net mvc 5 application utilizing jquery validation. ealier validation working fine stopped working suddenly. unable find reason. here sample of code in use: model: [displayname("select file(s) upload")] [required(errormessage = "select atleast 1 file")] public httppostedfilebase file { get; set; } [required] [stringlength(250, minimumlength = 3)] public string comments { get; set; } view: <div class="form-group"> @html.labelfor(model => model.file, new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.textboxfor(model => model.file, new { type = "file"}) @html.validationmessagefor(model => model.file) </div> </div> <br /> <div class="form-group"> @html.labelfor(model => model.comments, n

javascript - Angular - attach directive to future element -

first of all, ery new angular, sorry if question seems strange. i know how attach basic directives ng-click elements that: <button class="test" ng-click="clearoverlays()">remove</button> but how can attach directive input box dinamically generated django template language ? django code: <ul>{{ filter.form.as_ul }}</ul> the future element that: <input id="id_property_parent" name="property_parent" type="radio" value="12"> so ideal variant if able attach ng-change directive future element it's id ('id_property_parent') is possible angular js framework ? ok depends on trying achieve. see 2 different cases, can tell, yours quite simple solve. 2 cases : the dynamic piece of html generated django loaded dom via ajax; the dynamic piece of html inserted full document before page sent client. correct me if wrong think case second. in case, thing have add at

Does Mule ESB Supports Multi Tenancy -

hi working mule esb , want know supports multi tenancy or not ? the mule application server servlet container. in fact quite similar jboss. in other app serer can install different apps different client. however there risk 1 of apps dodgy instance: - eats memory, cpu, disk space - invokes bad program, groovy script system.exit(); command or other. so guess general answer is: long know applications running in parallel can run them. not "hosting server" rent web space on virtual host on apache httpd. sebastian

javascript - Take particular value from the variable having html -

below script taking closest sibling value var owner = $(this).closest('td').siblings('td.select_fly').html(); following output of owner variable now want take blr owner variable, can u please out :( <p> flight 235 <span style="margin-left:50px;">blr</span> </p> you can using find() way: $(owner).find("span").text(); or directly: var spantext = $(this).closest('td').siblings('td.select_fly').find("span").text();

gcc - Add dependency in libbacktrace -

i'm trying add dependency in makefile @ libbacktrace library. however, seems i'm not using correct syntax it, i've tried: depends+= +libbacktrace but receive following message - package xxxx missing dependencies following libraries although libbacktrace included in -l (lib) path. can offer solution? thank in advance. i've never seen plus sign in package name, want this: depends += libbacktrace

javascript - How to populate textboxes upon button click? -

i want create system needs textboxes populated current time , current data stored on $_session["username"]; upon clicking button. i know how time stamp , data on $_session["username"] ;, need steps on how populate textboxes these data. steps, modules or can lead me right direction appreciated, request make simple possible me able understand thoroughly. here's code test, got time inside textbox. want first textbox blank upon clicking of button or textbox itself, populate current time./ $_session["username"]`; . <html> <body> <?php echo date("y/m/d"); echo "<br>"; $time= date("h:i:s a", strtotime("now"-8)); echo "<input type=textfield name=time value='$time' size=9>"; ?> </body> </html> let's assume sake of simplicity have on textbox , 1 button: <input type="textfield" id="textbox" value=&#

Mysql Explain Query show type “ALL” -

select id raod_busroute from_des '%adheriya khal%' , to_des '%abhayapuri%' group from_des" when @ result, see reads entire table—all rows , columns. know bad, don't know how fix this. thanks because doing lookup wildcards in beginning of string, mysql cannot use indexes (if there any). needs full table scan.

jquery - Loading MVC Content Inside Web Forms -

using iframes content in existing web application loading asp.net web forms pages, load content mvc views using jquery load(). 2 reasons are: faster load time - web forms heavy. would learn mvc. is possible? practive? yes it's possible. think practice or not subjective question. if have huge web forms application, complete rewrite out of budget, time , skills available , ease want add more features using mvc or webapi (read it, might consider using instead), it's ok. depends on scenario. here read it: mixing webforms , mvc integrating webforms mvc

java - how to create watermark in PDF -

i have program generating money receipt organization. need add waterark in document sort of security. adding code below. pdf has been generating ok how add watermark? /* * change template, choose tools | templates * , open template in editor. */ package com.example; import com.lowagie.text.*; import com.lowagie.text.pdf.*; import java.awt.color; import java.io.filenotfoundexception; import java.io.fileoutputstream; /** * * @author chandan */ public class moneryrecipt { // document m_pdfdocument; public static void main(string[] args) throws documentexception, filenotfoundexception { document m_pdfdocument = new document(pagesize.letter, 5, 5, 5, 5); try { docwriter m_docwriter; // pdfwriter m_pdfwriter = null; pdfwriter writer = pdfwriter.getinstance(m_pdfdocument, new fileoutputstream("e:/aa.pdf")); image logo=image.getinstance("f:/gmc_report.jpg"); m_pdfdocument.open(); imag

sql server - Map columns to its ID using TSQL -

i have query gets duplicate records in table. see below: select column1, column2 table1 group column1, column2 having count(column1 + column2) > 1 now, need map column1 , column2 table id , can't incorporate in query above. i'm using tsql, how do this? this code worked ids: select id table1 inner join ( select column1, column2 table1 group column1, column2 having count(column1 + column2) > 1 ) thistable on table1.column1= thistable.column1and table1.column2= thistable.column2

cakephp - CakePHP3.x controller name in url when using prefix routing -

i trying use prefix routing in cakephp3. added following lines /config/routes.php. router::prefix("admin", function($routes) {     // routes here prefixed ‘/admin‘     // , have prefix => admin route element added.     $routes->connect("/",["controller"=>"tops","action"=>"index"]);     $routes->connect("/:controller", ["action" => "index"]);     $routes->connect("/:controller/:action/*"); }); after that, created /src/controller/admin/questionscontroller.php below. <?php namespace app\controller\admin; use app\controller\appcontroller; class questionscontroller extends appcontroller { public function index() { //some code here } } ?> finally tried access localhost/app_name/admin/questions/index , got error saying, error: questionscontroller not found . however, when capitalize first letter of controller na

apache - Enabling CORS .htaccess restrictions -

i encountering behaviour produciton server , wondering if confirm if possible , how might have been done. i have website www.example.com ssl enabled , traffic forwarding https on site have font file https://www.example.com/wp-content/assets/fonts/icons.ttf i have additional campaign sites (e.g www.examplecampaign.com) use css file example.com loads in font face using font file. adding relevant file types woff, etc refer ttf simplicity. icon font displays fine on www.example.com on www.examplecampaign.com because in firefox error cross-origin request blocked: same origin policy disallows reading remote resource @ https://www.example.com/wp-content/assets/fonts/icons.ttf. can fixed moving resource same domain or enabling cors. so here begins problem. on our stage server have full access can add # begin required webfonts addtype font/ttf .ttf addtype font/eot .eot addtype font/otf .otf addtype font/woff .woff <filesmatch "\.(ttf|otf|eot|woff)$"> <ifm

animation with delay android in ImageView -

i'm trying implement animation delay in android, in case imageview infinitely rotating, because don't know how can dynamically stop , start it. final rotateanimation anim = new rotateanimation(0f, 350f, 15f, 15f); anim.setinterpolator(new linearinterpolator()); anim.setrepeatcount(animation.infinite); anim.setduration(700); imageview.startanimation(anim); take @ setrepeatcount arguments , setstartoffset method. first 1 allows limit repeated animation, second 1 - introduce time delay.