Posts

Showing posts from September, 2011

javascript - jquery selected how to select Checked checkboxes? -

this question has answer here: jquery: verify if in collection of inputs (of type checkbox) 1 checked 4 answers in html table have checkboxes colums following markup: <input type="checkbox" id="selection_2012-10-01-lin-c" class="selections" name="selection_checkbox" disabled="disabled"> <input type="checkbox" checked="checked" id="selection_2012-10-01-ade-c" class="selections" name="selection_checkbox"> on button click need validate if of check boxes selected, m using following code , getting false : var selectedlots = $('input[name^="selection_checkbox"]').prop("checked"); requriement count of selected checkboxes or true , please guide me how select this. thanks "requriement count of selected checkboxes&q

core graphics - Creating an Arc Path in Objective-C -

i trying create arc path in xcode , code. cgpathaddarc(thepath,null,100,200,300,200,100,yes); this code works creates weird arc. wondering each number in code represents. trying create arc in form of half circle. suggestions? according apple documentation (which easy going http://developer.apple.com/ios ), first parameter path ref building. transform next (you've passed null). then, numbers, cgfloats: x x-coordinate of center point of arc. y y-coordinate of center point of arc. r radius of arc. startangle angle (in radians) determines starting point of arc, measured x-axis in current user space. endangle angle (in radians) determines ending point of arc, measured x-axis in current user space. and ending "clockwise" bool.

Java structure holding multiple variables that can be written and read as an integer? -

i sure exists, , believe did similar in c quite while bit fields, cannot think of how should this. basically have series of options can either on or off. these options describe operations application can perform on file e.g. structure { execute read write } if structure bit field able set structure value represents both read , write not execute (e.g. 3). if read structure give me 3 know given value execute should denied. bit field solution may not best solution in case though. definitely enumset 'zapl' recommended ( check here ) or have list of enum, latter makes more sense.

Does Python optimize lambda x: x -

so wrote code max/min assumes bottleneck on generating data (else i'd use max , min ), , takes key function, if not given uses identity function: if key none: key = lambda x: x and later: for in iterable: key_i = key(i) and since bottleneck on generator, question might moot, if there's no key, call lambda x: x every item. i assume python optimize identity function away. can tell me if does? or if doesn't, how expensive it? there way better without doubling line count (e.g. ternary operators)? good question ! optimizer see foo might identity function under predictable conditions , create alternative path replace it's invocation it's known result let's see opcodes : >>> def foo(n): ... f = lambda x:x ... return f(n) ... >>> import dis >>> dis.dis(foo) 2 0 load_const 1 (<code object <lambda> @ 0x7f177ade7608, file "<stdin>", line 2>)

Adding domain to Google App Engine -

i writing little app google app engine. point domain own google app engine application. domain has been in possession years , unused , parked @ host. when go add domain admin console, sends me google apps signup page. looks google apps gmail accounts, google drive space, etc, , have these items. not sure why it's trying force me signup account when trying point domain google app engine application. what doing wrong? need google apps account point domain gae application? i feel i'm doing wrong or missing obvious, have no idea be. you should sign google apps, not have use gmail, etc., domain name if don't want to. google trying move of services single platform, makes integration easier (e.g. authentication, user management, etc.)

amazon web services - Using a wildcard SSL with a CNAME pointing to EC2 instance -

i have cname on domain pointing amazon ec2 instance. utilize wildcard ssl certificate secure connection - https://secure.mydomain.com point ec2 instance. is such thing possible? unfortunately new both ssl certificates , ec2 instances. route 53 might come play? any appreciated, thanks! another option put cert on elastic load balancer, , point instance. makes easier scale, , don't have worry elastic ip's or configuration when rolling out new instances.

caching - django cache downloaded file on browser side with login_requried -

server side cache has plenty documents , convenient implement. more sever send http304 tell browser content haven't changed since last visit. like special use case, authorized user open file reading, , file won't change quite time. how tell browser cache file before authorization still needed ? possible ? know login_required decorator has conflict cache_page decorator

graphics - Trouble drawing star with an even number of points with turtle in Java -

Image
alright, assignment, , have close figured out. basically, given code create turtle , test client draws polygon n sides. instructions modify test client draws star n points. odd-numbered values of n easy because made change turtle.turnleft(angle) turtle.turnleft(angle*2). i think of trouble coming complete ignorance of star geometry. tried draw out , kind of make triangles between points, , i've tested few different things, keep getting lines resemble this: vvvv , turn left. original code: public class turtle { private double x, y; private double angle; public turtle(double x0, double y0, double a0) { x=x0; y=y0; angle=a0;} public void turnleft(double delta) {angle += delta;} public void goforward(double step) { double oldx=x, oldy=y; x+=step*math.cos(math.toradians(angle)); y+=step*math.sin(math.toradians(angle)); stddraw.line(oldx, oldy, x, y); } public static void main(string[] args) { int n=integer.parseint(args[0]); double angle = 360.0/n;

javascript - Is there a way to tell Google map to zoom out centered on a marker and show a calculated bounding box? -

Image
when visitor clicks site shows streetview @ location. when exit picture code fetches nearest 2 marker coordinates (from mongodb) , zooms map out include calculated bounding box. i have map remain centered on marker visited , zoom out enough show complete bounding box. user keep track of they've been. click image calculate bounding box the marker image 1 on left. can see bounding box centered. i've had read through nothing seemed obvious me. google api v3 have method this? /**** collect data restful service code gets nearest 2 markers , calculates zoom set map include them in view. ****/ bounds = new google.maps.latlngbounds(); bounds.extend(new google.maps.latlng( data.locs.lat, data.locs.lng )); nearest = {}; $.ajax({ type: "get", datatype: "json", data: { lat : data.locs.lat, //the marker viewing lng : data.locs.lng}, async: false, url: "php/restful.get.nearest.markers.php", success: functio

Basics of AngularJS Controller defination syntax -

i new angularjs , not familar javascript, jquery hence may asking silly question. while going through angularjs sample application, notice things : define(['app'], function (app) { var customerscontroller = function ($scope, $location, $filter, dataservice, modalservice) {...} app.register.controller('customerscontroller', ['$scope', '$location', '$filter', 'dataservice', 'modalservice', customerscontroller]); i not understand complete syntax, example not know line means or do? define(['app'], function (app) where can learn basic stuff? tutorial links helpful. in advance help. that's requirejs semantics. in requirejs define creates module. here declare module, in case controller, first array dependencies module, in case it's app, our angular app definition. dependencies (first parameter of define, array) resolved , passed function (our controller), here app passed controller: define(['

math - Baking-Pi Challenge - Understanding & Improving -

i spent time yesterday writing solution this challenge published on reddit , , able through without cheating, left couple of questions. reference material here . this code. (ns baking-pi.core (:import java.math.mathcontext)) (defn modpow [n e m] (.modpow (biginteger n) (biginteger e) (biginteger m))) (defn div [top bot] (with-precision 34 :rounding half_even (/ (bigdec top) (bigdec bot)))) (defn pow [n e] (.pow (bigdec n) (bigdec e) mathcontext/decimal128)) (defn round ([n] (.round (bigdec n) mathcontext/decimal128)) ([n & args] (->> [n args] (flatten) (map round)))) (defn left [n d] (letfn [(calc [k] (let [bot (+' (*' 8 k) d) top (modpow 16 (-' n k) bot)] (div top bot)))] (->> (inc' n) (range 0) (map calc) (reduce +')))) (defn right [n d] (letfn [(calc [[sum'' sum' k]] (let [sum' (if (nil? sum') 0m su

SQL: Comparing count of 2 fields with specific value -

i have 2 tables, 1 (jobs) contains list of jobs , second contains details of records in each job. jobs jobid count 2 b 3 records jobid recordid tobeprocessed isprocessed a1 1 1 a2 1 1 b b1 1 1 b b2 1 0 b b3 1 0 how able create query list jobs have count of tobeprocessed has value of 1 equal count of isprocessed has value of 1? in advance. appreciated. start calculation of number of items tobeprocessed set 1 or isprocessed set one: select jobid , sum(case when tobeprocessed=1 1 else 0 end) tobeprocessedisone , sum(case when isprocessed=1 1 else 0 end) isprocessedisone records group jobid this gives counts, not ones tobeprocessedisone equal isprocessedisone . make sure records 2 same, use either having clause, or nested subquery: -- having clause

haskell - Can't compile a simple hello world using GHC 7.8rc2 and Windows 7 (or install packages with cabal) -

i can't compile simple hello world or install packages cabal install when using ghc 7.8 , cabal 1.18.1.3 , cabal-install 1.18.0.2 . when doing cabal install stm (or other package) command prompt windows shows "ghc.exe has stopped working" window, , output is: reading available packages... choosing modular solver. resolving dependencies... ready install stm-2.4.2 extracting waiting install task finish... c:\users\%user%\appdata\roaming\cabal\packages\hackage.haskell.org\stm\2.4.2\stm-2.4.2.tar.gz c:\users\%user%\appdata\local\temp\stm-2.4.2-6556... updating stm.cabal latest revision index. configuring stm-2.4.2... creating c:\users\%user%\appdata\local\temp\stm-2.4.2-6556\stm-2.4.2\dist\setup creating c:\users\%user%\appdata\local\temp\stm-2.4.2-6556\stm-2.4.2\dist creating c:\users\%user%\appdata\local\temp\stm-2.4.2-6556\stm-2.4.2\dist\setup "c:\ghc-7.8.0\bin\ghc.exe" "--make" "-odir" "c:\users\%user%\appdata\local\temp\stm-2.

java - Close WebDriver instance forcefully after test ends -

often after failures of test browser instance left open. make sure call quit() method @aftersuite ends, still due pop-up or not sure browser instance not closed. here sample code invoke after every test suite ends if (_driver.getwindowhandles().size() > 1) { _driver.close(); } if (isalertpresent()) { getalert(); } _driver.quit(); if (isalertpresent()) { getalert(); } wherein, first check if there more windows close, close them first , incase pop-up appears after closing of window accept alert box, , later try invoke quit method. not sure why browser instances left open. can please me out understand process in better way. selenium version 2.40.0 anything after method call driver.quit() dead code. to handle opened window, need try below code, set windows=driver.getwindowhandles(); iterator windowiterator=windows.iterator(); while(windowiterator.hasnext()) { windowiterator.next().close(); //handle pop here, if any. }

php - mysql - Fatal error: Call to a member function -

trying create login screen , error fatal error: call member function prepare() on non-object in c:\xampp\htdocs\login\classes\mysql.php on line 19 <?php require_once 'includes/constants.php'; class mysql { private $conn; function __construct() { $this->conn = new mysqli (db_server, db_user, db_password, db_name) or die('there problem connecting database.'); } function verify_username_and_pass($un, $pwd) { $query = "select * users username = ? , password = ? limit 1"; if($stmt = $this->conn->prepare($query)) { $stmt->bind_param('ss', $un, $pwd); $stmt->execute(); if($stmt->fetch()) { $stmt->close(); return true; } } } } constants.php <?php // define constants here define('db_server', '192.168.2

liferay - How to put an error message on the screen when the file size limit is reached? -

if try upload file exceeding on limit size.. there no error message shown on screen however, did find error message on logs saying: 03:24:20,890 error [uploadservletrequestimpl:101] org.apache.commons.fileupload.fileuploadbase$sizelimitexceededexception: request rejected because size (220546593) exceeds configured maximum (104857600) org.apache.commons.fileupload.fileuploadbase$sizelimitexceededexception: request rejected because size (220546593) exceeds configured maximum (104857600) i want show error message on screen saying: "you've reached maximum size of 10mb." thanks. in action class add error key along request object below, sessionerrors.add(actionrequest, "your-error"); in jsp add: <%@ taglib uri="http://liferay.com/tld/ui" prefix="liferay-ui" %> <liferay-ui:error key="your-error" message="your error message goes here!" /> also handled through exception class, sessionerrors c

osx - NSScrollView scrolling to the bottom of View -

in mac os ap development, have created form using different textfields inside scrollview. when load view, scrollview automatically scrolls bottom , every time need scroll view content starting. suggestions? by default document view of scroll view has origin in lower left. true on os x. if prefer document view has origin in upper left, need custom view document view override of isflipped returning yes. otherwise can save state , scroll area programatically.

javascript - Is there a standard design pattern for dealing with views that have both read and write states? -

i'm wondering if there standard design patterns employed backbone (and similar) community whole reflect "best practice" readability , design respect view components not presents data end-user allows editing contents. user toggle between read-and-write presentations interacting link, or button. example of type of behavior i'm thinking of stack overflow career's site permits edit entries , switches between read-and-write contexts. as see if there 2 approaches: create template includes read-only data <form> in single template , wire show/hide functionality. create two separate views, 1 read-only data , other <form> , , render both independently. are there others? there preference has emerged in community on how design pattern should approached? if change on presentation layer should change model (on events example). can manager @ view. example: vare view = backbone.view.extend({ classname: 'panel-body', templ

java - Why is resolve dependencies 'classpath' so slow? -

why gradle tasks become slow (longer 5 minutes) when add apache commons codec , apache commons io dependencies project? clear, executing build task still works, takes long time. when slow, gradle output is resolving dependencies: 'classpath' below offending portion of build.gradle: buildscript { repositories { maven { url "http://repo.spring.io/libs-snapshot" } mavencentral() mavenlocal() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:0.5.0.m6") classpath("org.mongodb:mongo-java-driver:2.11.3") classpath("org.seleniumhq.selenium:selenium-java:2.37.1") classpath("com.google.guava:guava:16.0.1") classpath('commons-codec:commons-codec:1.9') classpath("commons-io:commons-io:2.4") } } if not include last 2 classpath dependencies (codec , io), buildscript faster. using gradle 1.10 via gradlew. first question need add de

sql server - Optimise pivot table with many attribute columns -

i'm using excel pivot table give users access customer data that's stored in ssas cube, , finding data refresh time exorbitant. pivot table shows total revenue each customer, , includes following on rows (from 2 separate dimensions): customer id customer name phone email address a date indicating if/when email address bounced address line 1 address line 2 address line 3 address line 4 address line 5 a date indicating if/when address failed a couple of t/f indicators ... , financial year on columns. you'll recognise of customer attributes not grouping fields: customer id , year require data aggregation. using ssas , excel in way seems necessitate 13 attributes being treated grouping columns , hence there 13 levels of aggregation. consequently, subset of 20,000 customers, may take 30 minutes refresh pivot table. think majority of time on ssas rather excel side, don't know if that's because mdx excel generates crap or structure of cube responsi

Heroku custom domain in rails app -

in application 1 model have associated subdomains it. trying host application via custom domain (www.talentbase.ru) , have added *.talentbase.ru heroku app , cnames dns server. however, far understand, reason application thinking that domain name of application herokuapp.com instread of talentbase.herokuapp.com , tries find talentbase database entry. heroku domains: === talentbase domain names *.talentbase.ru talentbase.herokuapp.com talentbase.ru www.talentbase.ru heroku logs: 2014-03-09t15:32:45.584836+00:00 app[web.1]: 2014-03-09t15:32:45.584836+00:00 app[web.1]: activerecord::recordnotfound (couldn't find company alias = talentbase): 2014-03-09t15:32:45.584836+00:00 app[web.1]: app/controllers/application_controller.rb:12:in `load_company' 2014-03-09t15:32:45.584836+00:00 app[web.1]: 2014-03-09t15:32:45.584836+00:00 app[web.1]: 2014-03-09t15:32:45.587331+00:00 heroku[router]: at=info method=get path=/ host=talentbase.herokuapp.com request_id=560093ac-9023-

DOM xml parsing difficulties in java -

<xml> <log> <date>20022014</date> <time>2323</time> <schools> <school name="ahss"/> <student>shiva</student> <class>b</class> </schools> </log> <log>...</log> </xml> need parse xml format using dom have tried many substitutes couldn't there 1 give shoulder

ember.js with MySQL connection -

i trying work out small ember application. want list items table of mysql db. able retrive , display data localstorage of ember store not know how can implement same thing using mysql database. any kind of appriciated. there few ways it, need sort of server-side api handle querying mysql database , returning data. done these days rest api using interchange format json . whether use php, node, or server technology, there couple of ways can pull data ember. let's assume have server-side method called search, returns json array of blog posts, like: [ {"title": "blog post 1", "body": "this blog post"}, {"title": "blog post 2", "body": "this post"} ] the easiest way pull data ember simple ajax call: var indexroute = ember.route.extend({ model: function() { return $.getjson("http://apiurl.com/search"); } }); in above ember route definition, model set functi

sockets - Java Echo Server Not Working -

server code: import java.net.*; import java.io.*; import java.util.*; class ecserver{ public static void main(string args[])throws exception{ serversocket ss=new serversocket(4019); socket so=ss.accept(); printstream pw=new printstream(so.getoutputstream()); string str; bufferedreader br=new bufferedreader(new inputstreamreader(so.getinputstream())); while(true) { str=br.readline(); system.out.println("client input : "+str); pw.println(str); if(str.equals(".")) break; } } } client code: import java.net.*; import java.io.*; class ecclient{ public static void main(string args[])throws exception{ socket so=new socket("localhost",4019); printstream ps=new printstream(so.getoutputstream()); bufferedreader br=new bufferedreader(new inputstreamreader(system.in)); bufferedreader br1

c++ - boost thread while all thread not completed print something -

need know boost::thread_group tgroup; loop 10 times tgroup.create_thread( boost::bind( &c , 2, 2, ) ) <== tgroup.join_all() what can @ <== location above continuously print number of threads have completed there jobs you can use atomic counter: see live on coliru #include <boost/thread/thread.hpp> #include <boost/atomic.hpp> static boost::atomic_int running_count(20); static void worker(boost::chrono::milliseconds effort) { boost::this_thread::sleep_for(effort); --running_count; } int main() { boost::thread_group tg; (int = 0, count = running_count; < count; ++i) // count protects against data race! tg.create_thread(boost::bind(worker, boost::chrono::milliseconds(i*50))); while (running_count > 0) { std::cout << "monitoring threads: " << running_count << " running\n"; boost::this_thread::sleep_for(boost::chrono::milliseconds(100)); }

zend framework - Unable to load template file -

fatal error: uncaught exception 'smartyexception' message 'unable load template file '../index/index.tpl'' in /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php:174 stack trace: #0 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(551): smarty_internal_template->isexisting(true) #1 /var/www/docs/sw.com/public/application/tmp/smarty_compile/898ca70906754084b81f61d3ce7baee3b11bd8d3.file.layout.tpl.php(46): smarty_internal_template->getrenderedtemplate() #2 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(436): include('/var/www/docs/s...') #3 /var/www/docs/sw.com/public/library/smarty/sysplugins/smarty_internal_template.php(568): smarty_internal_template->rendertemplate() #4 /var/www/docs/sw.com/public/library/smarty/smarty.class.php(328): smarty_internal_template->getrenderedtemplate() #5 /var/www/docs/sw.com/public/library/smarty/sma

How to get stored procedure result set to other stored procedure. Or return table in function in MySQL -

my first stored procedure returns 3 values use in stored procedure. tried this: create definer=`db`@`%` procedure `sp_expense`( flightinstanceid int ) begin select f.basefare, call sp_orderdetail(f.fareid) fare; end$$ but i'm getting syntax error. is possible in functions? return table ? you cant call stored procedure in select statement. doing trying call function. create fucntion . if understand question sp_orderdetail(f.fareid) returns table? wonder if turn sp_orderdetail(f.fareid) view instead? this might well: create stored procedure , create function syntax

php - Mail not sending using tank_auth in localhost -

i using tank auth , sending mail not working me. checking forgot password. tried lot, referring various posts regarding same. nothing worked me. using zohomail. following code have tried far. i have added following config/email.php $config['protocol']='smtp'; $config['smtp_host']='ssl://smtp.zoho.com'; $config['smtp_port']='465'; $config['smtp_timeout']='30'; $config['smtp_user']='myemail'; $config['smtp_pass']='mypass'; $config['charset']='utf-8'; $config['newline']='\r\n'; no other changes file made. output getting following: 220 mx.zohomail.com smtp server ready march 10, 2014 12:35:17 pdt hello: 250-mx.zohomail.com hello localhost (61.3.161.53 (61.3.161.53)) 250-auth login plain 250 size 25000000 from: 250 sender ok to: 250 recipient ok data: 354 ok send data ending . following smtp error encountered: unable send email using php smtp.

Scroll Box Responsive issue, CSS-Wordpress -

wondering if can me out bit. have scrolling text box on page in wordpress. site responsive. box way need except doesn't re size down rest of content on page. does have fact fixed width? if how change shrinks down? thanks <div style="border: 4px solid #ffff00; overflow: auto; height: 150px; width: 640px; color: white; background-color: #32cd32;"> <div style="text-align: left;"> <h1>add text</h1> add text </div> </div> try giving dimensions of <div> in % instead of px . elements dimensions in px are of fixed size hence not responsive. read more here

php - add variable seconds to time foreach loop -

i'm building queue generate , want visible users see how long take till generation ready. so have estimated time takes generate something, variable because can anywhere between 5-120 seconds. , need add variable time time of day , make loop because queue has more values. so example need this: object 1 - estimated generation time: 15 sec - 09:00:15 object 2 - estimated generation time: 20 sec - 09:00:35 object 3 - estimated generation time: 10 sec - 09:00:45 and on.. i tried this: $my_time = date('h:i:s',time()); $seconds2add = $estimated_time; $new_time= strtotime($my_time); $new_time+=$seconds2add; echo date('h:i:s',$new_time); and: $time = date("m/d/y h:i:s a", time() + $estimated_time); it loops both gives me output: object 1 - estimated generation time: 15 sec - 09:00:15 object 2 - estimated generation time: 20 sec - 09:00:20 object 3 - estimated generation time: 10 sec - 09:00:10 so how can make loop works? edit:

ORACLE - insert records by multiple user on PK table -

in oracle have table employee(empid,empname) primary key on empid . two users having insert privileges table user1 , user2 . user1 insert record empid=1 , empname='xyz' , not committed. if user2 trying insert same record empid=1 , empname='xyz' screen hangs till user1 commits or rollback. is there option insert record both users out hang , user commits second should pk violation error. thanks, niju jose in single-user database, user can modify data in database without concern other users modifying same data @ same time. however, in multiuser database, statements within multiple simultaneous transactions can update same data. transactions executing @ same time need produce meaningful , consistent results. isolation level dirty read nonrepeatable read phantom read ---------------- ------------ ------------------ ------------- read uncommitted possible possible possible read committed not

Is it legal in XML to mix text and tags? -

is following acceptable xml structure? <root> <child id="1" name="test">some inner text <secondchild id="1" name="test1">some text</secondchild> <secondchild id="2" name="test2">some text 2</secondchild> </child> </root> i want insert innertext() child nodes <child/> node. legal within xml? normally, don't have insert raw text in addition of childs elements in tag ... what trying please ? anyway can verify here : http://www.w3schools.com/xml/xml_validator.asp there apparently no errors in document far.

spring - mvn package puts a billion jar files in my /target folder. Now what? -

i'm running mvn package command line leaves /target folder containing billion jar files. how take , run in vfabric tc server command line? basically, find ./ -iname "*jar*" shows: ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/log4j-1.2.15.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/antlr-2.7.7.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/aopalliance-1.0.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/aspectjrt-1.6.10.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/commons-dbcp-20030825.184428.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/commons-fileupload-1.3.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/commons-io-2.2.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/commons-lang3-3.1.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/dom4j-1.6.1.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/hibernate-commons-annotations-4.0.1.final.jar ./target/hp-dsat-1.0.0-build-snapshot/web-inf/lib/hibernate

java - Unable to pass array to a Stored Procedure in DB2 - SQL PL - Windows -

i unable call stored procedure has input parameter integer array. the stored procedure declaration follows create or replace procedure testschema.testarray (in checkstatus integer, in jobid intarray) the array declared this create type intarray integer array[]@ when try call procedure using call testschema.testarray( 1 , array[21,22,23] )@ i following error - an unexpected token "array[" found following "array[". expected tokens may include: "".. sqlcode=-104, sqlstate=42601, driver=3.63.123 sql code: -104, sql state: 42601' i cannot seem find other way this? can please this? also need find way pass array in java later. sql pl arrays can used in sql pl context. you'll need declare variable of intarray type , call procedure, using variable, compound sql statement: db2inst1@blusrv:~> db2 "create type intarray integer array[]" db20000i sql command completed successful

javascript - D3.js appending svg/dom element not working -

Image
so i'm trying append dom or svg element circle(the latter avoid foreign object thing). i'm doing this var tooltip = d3.select(this).append("text") .attr("class", "tooltip") .text("hello") .attr('x', 1000) .attr('y', 1000); where circle svg element. however, doesn't work - but can't see effect on webpage. why? in svg, can't append text element circle elements -- specification doesn't allow that. append them g elements or top-level svg, otherwise won't displayed.

c++ - Using string vector in map -

i have map string key , second atribute should vector. declaration: map <string, vector<string> > subjects; and when want use adding values. subjects[s] = new vector<string>; subjects[s].push_back(n); s , n strings. got error first line. says error: no match ‘operator=’ (operand types ‘std::map<std::basic_string<char>, std::vector<std::basic_string<char> > >::mapped_type {aka std::vector<std::basic_string<char> >}’ , ‘std::vector<std::basic_string<char> >*’) . tried give pointer of vector map, doesn't help. value of subjects type not pointer, can't allocate new it. if n string type, call: map <string, vector<string> > subjects; std::string n("hello"); subjects[s].push_back(n); edit: to print value map, need find element in map iterator vector. auto = subjects.find(s); if (it != subjects.end()) { auto& vit = it->second; (auto elem : vit)

Database Backup php vs mysql -

i trying backup of table in database php , codeigniter. have problem encoding of data in there. after reload backup, errors because serialized array in table gets corrupted somehow. there difference between sql backup on mysql directly , php: mysql: s:17:"register_template";s:1:"5";s:19:"invitation_template";s:1:"9";s:16:"tombola_template";s:2:"10";s:17:"reminder_template";i:1;s:20:"max_tickets_to_order";b:0;s:11:"tombola_max";s:0:"";s:18:"external_ticketing";s:0:"";s:10:"max_guests";s:1:"0";s:21:"event_soldout_message";s:0:"";s:18:"guest_list_comment";s:0:"";s:17:"ticketing_comment";s:0:"";s:13:"reminder_body";s:0:"";}', 1321470000, 1321466400, 1321477200, '3810ddef8eaca55b2d6b8cdb28a45e0e.jpg,44e33602cb1d615c9d1ad43f25bb5058.jpg', 1, 0, 1, &#

windows - Secure Socket Connections using c++ -

i trying ssl/tls connections work in windows. right using schannel, not sure correct way go it. here code. exception thrown @ initializesecuritycontexta() function #include "windows.h" #pragma comment(lib, "ws2_32.lib") #define security_win32 #include <schannel.h> #include <security.h> int callback winmain(hinstance currentinstance, hinstance previousinstance, lpstr bs1, int bs2) { // initialize winsock 2.0 wsadata versioninfo; wsastartup (0x0202, &versioninfo); // load security dll hmodule securitydllmodule = loadlibrary("secur32.dll"); // initialize schannel init_security_interface initsecurtyinterfacefunction = (init_security_interface)getprocaddress(securitydllmodule, "initsecurityinterfacea"); psecurityfunctiontable schannel = initsecurtyinterfacefunction(); if (!schannel) messagebox(0, "failed initialize schannel", "message"

android - Aquery https images not getting loaded -

i have image requests coming internet on https link. when set imageview using aquery, dont see images loading. no image shown. but image getting loaded, once u use http link. please let me know, if has info. thanks harisha code snippet public view getview(int position, view convertview, viewgroup parent) { if (convertview == null) { imageview imageview = new imageview(mcontext); imageview.setlayoutparams(new gallery.layoutparams(width,height)); aquery aq = new aquery(mcontext); applicationproperty prop = new applicationproperty(mcontext); aq.progress(-1).id(imageview).image(prop.getipaddress()+"/"+rowitems.get(position).getimageurl(), true, true, 0, 0, null, aquery.fade_in, aquery.ratio_preserve); convertview = imageview; } return convertview; }

cross browser - border radius with css triangles -

Image
i have a rectangle each side of diagonal has it's own color div { width: 0; height: 0; border-left: 150px solid green; border-top: 100px solid gray; } now wanted add border-radius div, noticed works fine sides except bottom left. so if add: border-radius: 10px 10px 10px 0; i this : .. add bottom left border-radius, this : 1) why happen? 2) there easy fix? edit: i'm using chrome, looked firefox , ie , results different! firefox: ie 11 what's going on? try add wrapping container: <div class="wrap"> <div class="triangle"></div> </div> with style: .wrap { display: inline-block; overflow: hidden; border-radius: 10px; } overflow: hidden; should trick. demo: http://jsfiddle.net/dfsq/9xdvj/8/