Posts

Showing posts from January, 2012

javascript - Darkened map around light area circle where marker resides in Google Map -

Image
i'm trying darken of map except region inside circle, have marker. inside want map light. i'm trying play around setting lightness of map, not sure if that's correct approach? in code below , in fiddle can create dark map, can't figure out how make area inside circle light. see picture @ bottom example of i'm trying do. <!doctype html> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> <script type="text/javascript"> var $styles = [{ stylers: [{ lightness: -60 }] }]; var mapoptions = { zoom: "", zoomcontrol: "", center: "", disabledefaultui: "", draggable: &quo

How to loop through the json onject returned by $.getJSON() method in JavaScript -

i new javascript , jquery. trying weather data using openweathermap api. trying loop through object returned $.getjson() method using openweathermap api. html code : <!doctype html> <html> <head lang="en"> <meta charset="utf-8"> <title>weather application</title> <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script> <link href="http://code.jquery.com/ui/1.10.4/themes/ui-lightness/jquery-ui.css" rel="stylesheet"> <script src="assets/js/script.js"></script> </head> <body> <header> <h1>weather forecast</h1> </header> <p id="location"></p> <p id="json"></p> <!--<form id="search-form">--> <!--<fieldset>--> <!--<input type="textbox" id="search" name="sea

sql - Alter statement Conflict with foreign key, but ID exisits in both table -

i've 2 tables, here i'm trying insert fk relationship. but, i'm getting errors when try alter table create fk relationship please help... have club id in both tables, commented below, not sure why i'm still getting constraint error. what causing constraint error? create table [dbo].[clubs]( [clubid] [int] identity(1,1) not null, // clubid here [name] [nvarchar](128) not null, [description] [nvarchar](2047) null, [created] [datetime] not null, [modified] [datetime] null, constraint [pk_clubs] primary key clustered ( [clubid] asc )with (pad_index = off, statistics_norecompute = off, ignore_dup_key = off, allow_row_locks = on, allow_page_locks = on) on [primary] ) on [primary] go create table [dbo].[memberclubs]( [memberclubid] [int] identity(1,1) not null, [memberid] [bigint] not null, [clubid] [int] not null, //club id here constraint [pk_memberclubs] primary key clustered ( [memberclubid] asc )with (pad_index = off, statistics_n

CakePHP 3.0 how to contain a left outer join -

suppose candidates has 1 field named ratings . association optional. i want candidates having rating other 0 or no rating @ , contain ratings in result. i managed right query first part coding left outer join this: $this->candidates ->find('all') ->leftjoin( ['ratings' => 'ratings'], [ 'ratings.candidate_id = candidates.id', 'ratings.rating = 0', ], ['ratings.rating' => 'integer']) ->where('ratings.id null'); however failed rating contained within result. how can done? did add contain() query? $this->candidates ->find('all') ->contain('ratings') ->leftjoin( ['ratings' => 'ratings'], [ 'ratings.candidate_id = candidates.id', 'ratings.rating = 0', ], ['ratings.rating' => 'integer']) ->where('ratings.id null');

shell - Exclude Library folder from being searched with find command in Terminal–OS X Mavericks -

i'm trying make applescript searches specific folder called keypro inside user's home folder. i'm using following code in applescript this: do shell script "find ~/ -name 'keypro'" (the "~/" means search inside current user's home folder.) what's annoying every time run it, terminal searches inside library folder causes "permission denied" error, other random stuff showing up. is there way exclude user's library folder being searched? originally tagging question shell or, more specficially, find-util have gotten more attention ( terminal doesn't come play here - applescript's do shell script doesn't open terminal window, merely creates shell child process.). do shell script "find ~ -path ~/library -prune -o -name 'keypro' -print" will exclude ~/library find command. from shell, run man find more information on find command. however, note wouldn't ordinar

javascript - Google API get refrest token: Uncaught ReferenceError: offline is not defined -

i trying refresh token once user authorize google. user don't have authorize again. studied documentation google, , come know have put access type offline. now , trying following javascript code : var cid = 'xxxxx'; var apik = 'xxxx'; var scopes = 'https://www.google.com/m8/feeds'; function authorizewithgoogle() { gapi.client.setapikey(apik); gapi.auth.authorize({ client_id: cid, scope: scopes, immediate: false, accesstype: offline }, handleauthresult);} function handleauthresult(authresult) { if (authresult && !authresult.error) { console.log(json.stringify(authresult)); $.get("https://www.google.com/m8/feeds/contacts/default/full?alt=json&access_token=" + authresult.access_token + "&max-results=11700&v=3.0", handlegooglecontacts); } } html code : <input type="submit" class="btn btn-info" value="google" onclick="aut

Date parse error in Python pandas while reading file -

follow on question to: python pandas reading in file date i not able parse date on dataframe below. code follows: df = pandas.read_csv(file_name, skiprows = 2, index_col='datetime', parse_dates={'datetime': [0,1,2]}, delim_whitespace=true, date_parser=lambda x: pandas.datetime.strptime(x, '%y %m %d')) oth-000.opc xkn1= 0.500000e-01 y m d prcp vwc1 2006 1 1 0.0 0.17608e+00 2006 1 2 6.0 0.21377e+00 2006 1 3 0.1 0.22291e+00 2006 1 4 3.0 0.23460e+00 2006 1 5 6.7 0.26076e+00 i error saying: lambda () takes 1 argument (3 given) based on @edchum's comment below, if use code: df = pandas.read_csv(file_name, skiprows = 2, index_col='datetime', parse_dates={'datetime': [0,1,2]}, delim_whitespace=true)) df.index results in object , not datetime series df.index index([u'2006 1 1',u'2006

jquery - Dynamic drop down menus using CSS and PHP/MySQL -

Image
i want create dynamic drop down menu using php , mysql. menus ok not way wanted. i want menu below (sorted vertically , limiting number of items vertically , horizontally) i tried achieving per below code: <?php foreach ($result $riw) { ?> <div class="four columns"> <li><a href="<?php echo $riw['fmprmlink']; ?>"><?php echo $riw['remedy_name']; ?></a> </li> </div> <?php } ?> by above approach getting result not rquired and without using <div class="four columns"> result below again not required i want items arranged , shown alphabetically vertically. a simple possibility of sorting first, second, etc. column. can improved. shows 1 of many possibilities. <!doctype html> <html> <head> <meta charset="utf-8"> <title>4 columns</title> <link rel="stylesheet&qu

c# - Display brings up only one object of the list and list isn't adding properly -

so trying project in windows form determine number of vertices , assigns each vertex co-ordinate , outputs on form. reason isn't working take look? mainform using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.threading.tasks; using system.windows.forms; namespace assignment { public partial class mainform : form { public mainform() { initializecomponent(); } public list<vertex> vertexlist = new list<vertex>(); private void exit_click(object sender, eventargs e) { application.exit(); } private void create_click(object sender, eventargs e) { int vertices = 0, edges = 0; try { vertices = (int)convert.toint32(txtvertices.text); edges = (int)convert.toint32(txtedges.text);

android - ImageButton not 'getting' bitmap -

i have following function to download image : private class downloadimagetask extends asynctask<string, void, bitmap> { private imagebutton bmimage; public downloadimagetask(imagebutton bmimage) { this.bmimage = bmimage; } protected void onpreexecute() { log.wtf("imagetask","onpreexecute"); //mdialog = progressdialog.show(chartactivity.this,"please wait...", "retrieving data ...", true); } protected bitmap doinbackground(string... urls) { bitmap bitmap = null; string error_message = null; for(string url:urls){ httpurirequest request = new httpget(url.tostring()); httpclient httpclient = new defaulthttpclient(); try { httpresponse response = httpclient.execute(request); statusline statusline = response.getstatusline(); int statuscode = statusline.getstatuscode();

jquery - Change inner text after ajax call back doesn't work? -

i have ten buttons on page, create foreach loop on page. i have problem in changing inner text jquery. let me explain elements <a class="pr-endorse" id="<%=product.confectionaryproductid %>"> <i class="pr-add"></i> <span>+</span> <span class="pr-likes"><%=product.endorsementcount %></span> </a> this 1 of button elements. and ajax function submit user $(document).ready(function () { $(".pr-endorse").click(function () { debugger; var productid = $(this).attr("id"); var confid = $("#confectioneryid").val(); var countnumber = $(this).find(".pr-likes").html(); $.ajax({ url: '<%: url.action("endorsement","confectionery")%>', data: { productid: productid, itemid: confid

spring-data-jpa & org.springframework compatibility -

i updated parent pom file our (child) projects declare. in said pom file, updated "org.springframework" dependencies (spring-webmvc, spring-web ...) version 4.0.7.release 4.1.6.release. in child project/pom, i'm using org.springframework.data spring-data-jpa. before update parent pom file, tests passing. after update, i'm seeing error: caused by: java.lang.nosuchmethoderror: org.springframework.beans.factory.xml.xmlreadercontext.getenvironment()lorg/springframework/core/env/environment; @ org.springframework.context.annotation.componentscanbeandefinitionparser.parse(componentscanbeandefinitionparser.java:81) @ org.springframework.beans.factory.xml.namespacehandlersupport.parse(namespacehandlersupport.java:74) @ org.springframework.beans.factory.xml.beandefinitionparserdelegate.parsecustomelement(beandefinitionparserdelegate.java:1426) @ org.springframework.beans.factory.xml.beandefinitionparserdelegate.parsecustomelement(beandefinitionparserdelegate.java:1416)

refresh - How can I disable someone refreshing a page? -

i made php code add name,email,etc added table , when click refresh, same rows of information appear , don't want happen if user refresh page... ok, have page1.php can enter info , redirect page2.php when click f5 enters same info again (i idiot-proofing - if wants refresh page or accidentally refreshes it, right?) page1.php: <html> <body> <form action="page2.php" method="post"> firstname: <input type="text" name="firstname" /> lastname: <input type="text" name="lastname" /> email: <input type="text" name="email" /> <input type="submit" /> </form> </body> </html> page2.php: $sqlinsert="insert sampletable (firstname, lastname, email) values ('$_post[firstname]','$_post[lastname]','$_post[email]')"; if ($conn-> multi_query($sqlinsert) === true) { echo "new record created succe

ruby - Rails engine doesn't load mailer -

i'm working on engine inside app , creating mailer engine inside engines/my_engine/app/mailers i'm getting uninitialized constant my_engine::ticketmailer . checking loaded paths doing puts $: see rails loads assets, controllers, models , helpers inside app folder not mailers. is there way fix , add path loaded? i found solution problem. apparently mailers folder not loaded automatically can add folders load path manually adding line 1 engine.rb : paths['app/mailers'] << 'my_engine/app/mailers' like this: module my_engine class engine < ::rails::engine isolate_namespace my_engine paths['app/mailers'] << 'my_engine/app/mailers' end end that fixed problem.

php - Why does msyqli_real_escape_string() not escape multiple backslashes properly? -

given sql update `mytable` set `mycolumn`='karla bailey-pearapppppppp\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' `id`=5619 why mysqli_real_escape_string() not escape string properly? trying use sql query after escaping column's value produces mysqli error: "you have error in sql syntax; check manual corresponds mysql server version right syntax use near ''karla bailey-pearapppppppp\\\\\\\\\\\\\\\\\\\\\\\\\\\' @ line 3" is there limit number of backslashes can escaped? are escaping entire string? e.g. $sql = "update .... \\\\\\\'"; $escaped = mysqli_real_escape_string($link, $sql); if so, that's incorrect. trashing string doing that. you'll escaping ' delimit clause value. escaping should performed values you

jvm - Cant launch IntelliJ on OSX-yesomite -

Image
i upgraded machine few days back. trying launch intellij message i changed jvm version in info.plist 1.8* <key>jvmversion</key> <string>1.8*</string> still not able launch intellij any workaround?

Not able to download files with php in android browsers -

when using computer files downloaded normally. problem start on android browsers. when download file android default browser, file downloaded of 0.00 bytes, not technically present there(corrupt file). when download file third party application or opera gives error "file not downloaded." not header error. , files downloaded via uc browser , chrome , firefox. still gives error in default browser. here code using: <?php require 'php/db.php'; if(isset($_post['file_id'])&&!empty($_post['file_id'])){ download_file($_post['file_id']); } function download_file($id){ global $con; $id = mysqli_real_escape_string($con,htmlentities($id)); $file="select file_name,file_title,file_size,down files file_id= $id"; $result = mysqli_query($con,$file); $row = mysqli_fetch_assoc($result); $name = $row['file_name']; $title = $row['file_title']; $size = $row['file_size'];

python - Django initial data serialization error -

i trying provide initial data model in django. when try run python manage.py loaddata <fixture path> following error: django.core.serializers.base.deserializationerror: problem installing fixture '/home/location/fixtures/initial_data.json': expecting property name enclosed in double quotes: line 7 column 10 (char 119) my fixtures or initial data this: [ { "model": "location.zipcode", "pk": 1, "fields": { "zipcode": 79936, } }, { "model": "location.zipcode", "pk": 2, "fields": { "zipcode": 90011, } } ] i have zipcode integerfield in zipcode model. appreciated. trailing commas not valid in json remove them. give: [ { "model": "location.zipcode", "pk": 1, "fields": { "zipcode": 79936 } }, { "model": "location.z

Moqui - Issue retaining/passing the URL parameter -

i have referred similar issue on github (issue#18), nothing there worked me. i trying use following transition/service: <transition name="storecontactinfo"> <service-call name="mantle.party.contactservices.store#partycontactinfo" in-map="context" out-map="context" /> <default-response url="." /> </transition> the url parameter screen workeffortid, gets stripped url once transition run. i tried, no avail: <transition name="storecontactinfo"> <path-parameter name="workeffortid"/> <service-call name="mantle.party.contactservices.store#partycontactinfo" in-map="context" out-map="context" /> <default-response url="." > <parameter name="workeffortid" from="workeffortid" /> </default-response> </transition> and tried adding in action tag, saw resolved issue previou

Average multiple csv files into 1 averaged file in r -

i have approximately 300 csv files of wind speed, temp, pressure, etc, columns , each row different time 2007 2012. each file different location. want combine files 1 average of 300 files. new file have same number of rows , columns of each individual file each cell corresponding average of 300 files. there easy way this? following this post , read files list (here i've assumed they're named weather*.csv): csvs <- lapply(list.files(pattern="weather*.csv"), read.csv) all remains take average of data frames. might try like: reduce("+", csvs) / length(csvs) if wanted add subset of columns, pass reduce list of data frames appropriate subset of columns. instance, if wanted remove first column each, like: reduce("+", lapply(csvs, "[", -1)) / length(csvs)

security - How to customize RSA Web Authentication Agent? -

currently in company there's internal web application custom login page. in order authenticate user make use of rsa authentication windows agent 7.2. call methods exposed acecln.dll library in internal library. now want move rsa authentication web agent 7.1. i've seen how works, i've been able install web agent , protect whole web site. doing this, web agent's pages (login, succesful login) displayed. problem still want use our custom login web page haven't been able it. i've checked dlls come web agent (rsahandler.dll , rsamodule.dll) seems they're not meant used acecln.dll library in windows agent. i've been able bypass rsa web agent's login page making post request handler defined in web.config webid web application set web agent. below details: this how handler defined in c:\program files\rsa security\rsawebagent\webid\web.config <handlers> <add name="rsasecuridhandlermapping" path="iiswebagentif.d

ios - numberOfSectionsInTableView not called -

in viewcontroller, have uitableview , these methods : func tableview(tableview: uitableview, numberofrowsinsection section: int) -> int { if(self.mquoteobjects.count > 0){ return 1 } return 0 } func tableview(tableview: uitableview, numberofsectionsintableview section: int) -> int { let nbitem = self.mquoteobjects.count return nbitem } method "numberofrowsinsection" correctly called, "numberofsectionsintableview" never called. what have missed? you can respond in obj-c the name of method not correct. should numberofsectionsintableview(_:) . see uitableviewdatasource protocol reference . func numberofsectionsintableview(tableview: uitableview) -> int { return self.mquoteobjects.count }

javascript - How to hide an element by Id with mutation observer -

i've read https://hacks.mozilla.org/2012/05/dom-mutationobserver-reacting-to-dom-changes-without-killing-browser-performance/ still not sure how configure achieve objective. there's element on page being generated code generator (so cannot prevent bevahiour). element has id "myid" , need hide once displays in browser. challenge how configure observer such code fires when element displayed. i've inserted questions comments think need here kindly guide me if i've got wrong: var target = document.queryselector('#myid'); var observer = new mutationobserver(function(mutations) { mutations.foreach(function(mutation) { // how detect when element on page next statement makes sense? document.getelementbyid("myid").style.visibility = "hidden"; }); }); // change need make here? var config = { attributes: true, childlist: true, characterdata: true }; observer.observe(target, config); ob

python - TypeError: 'int object has no attribute '__getitem__' ... but where? -

for markov chain project writing, generating error @ top of page. know means trying call list method on integer object, must means either a) not initializing list correctly or b) overwriting list integer value @ point in program. however, have been trying debug hours , cannot find issue in small program. error trace follows: traceback (most recent call last): file "/users/adamlind/pycharmprojects/capstone/song.py", line 9, in <module> musicmarkov.add(["c", 4]) #row file "/users/adamlind/pycharmprojects/capstone/music.py", line 19, in add self._markov.add(inote[0], fnote[0]) file "/users/adamlind/pycharmprojects/capstone/markov.py", line 22, in add self._adjmatrix[val[ival]][val[fval]] += 1 typeerror: 'int' object has no attribute '__getitem__' and here link github repo containing project (this first stackoverflow question, not sure if frowned upon or not): https://github.com/adamlind323/csc493 i c

javascript - Directive syntax error on enter/return -

noob alert this weird - trying create custom directive in angularjs, when write code: mymodule.directive('mytab', function(){ console.log('--inside tab directive--'); return { template: '<div>hello world</div>' }; }); it throws exception: typeerror: cannot read property 'compile' of undefined however, code runs fine: mymodule.directive('mytab', function(){ console.log('--inside tab directive--'); return { template: '<div>hello world</div>' }; }); the difference opening curly brace on next line in first code. behaviour normal? because returning function , next line ignored. literally see return, , return undefined

java - jpa stopped working on Glassfish 4.0 - org.postgresql.util.PSQLException : ERROR : There is no "family" relationship -

i have glassfish 4.0 mounted on centos 6.5 . - ejb jsf - jpa - java7 applications work correctly, started throwing same error when trying access database. database server postgresql 9.3 . bases in scheme "public". this persistence.xml file <?xml version="1.0" encoding="utf-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence"xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="ar.gob.ambiente.servicios_especiesforestales_war_1.0-snapshotpu" transaction-type="jta"> <jta-data-source>especiesforestalessrvndi</jta-data-source> <exclude-unlisted-classes>false</exclude-unlisted-classes> <properties> </properties> </persistence-unit> </persiste

Cannot connect to Google Compute instance through SSH with cloud console or terminal. Filesystem failure? -

my problem is: i can't connect through google developers console i can't connect gcloud tool i can't connect cloned instance all http , ftp services running usual can't upload through ftp ( error while writing: failure ) the serial console output has lot of entries similar to: [4103217.738612] ext4-fs error (device dm-6): htree_dirblock_to_tree:913: inode #393993: block 1587320: comm updatedb.mlocat: bad entry in directory: rec_len smaller minimal - offset=0(24694784), inode=0, rec_len=0, name_len=0 and [4133580.655572] loop: write error @ byte offset 979968000, length 4096. what might have happened? the disk (thankfully) full , not corrupt. came conclusion creating snapshot of 10gb disk, , new 50% larger disk snapshot. attached disk new instance , tried ssh login worked. there inspect file system , saw disk filled 10gb of docker log files. solution: created snapshot of disk, created new larger disk, new instance , attached new disk , ol

asp.net mvc - Could not handle http error on azure -

the solve of problem: added: <httperrors errormode="custom"> <remove statuscode="403" substatuscode="-1" /> <remove statuscode="404" substatuscode="-1" /> <remove statuscode="500" substatuscode="-1" /> <error statuscode="404" path="/404.html" responsemode="redirect"/> <error statuscode="403" path="/403.html" responsemode="redirect"/> <error statuscode="500" path="/500.html" responsemode="redirect"/> </httperrors> removed: <customerrors mode="on"> <error statuscode="403" redirect="~/403.html" /> <error statuscode="404" redirect="~/404.html" /> <error statuscode="500" redirect="~/500.html" /> </customerrors> i applied httperrors in web.co

python - Base64 encode HTTP_AUTHORIZATION headers DRF -

i'm trying create test using django rest framework: self.api = apiclient() self.api.credentials(http_authorization='client_id ' + str(self.client_id) + ' client_secret ' + str(self.client_secret)) response = self.api.post(url, payload) but error above: invalid basic header. credentials not correctly base64 encoded. do need base64 encode header? assumed done you? testing same thing curl works no issues i.e. curl -x post -d "stuff=stuff" http://rqepzpawyyvqal9d:18288ghfrb@127.0.0.1:8000/api/test/ you do, in fact, need base64 encode auth strings yourself. in case, believe should like: import base64 auth = 'client_id %s client_secret %s' % (base64.b64encode(self.client_id), base64.b64encode(self.client_secret)) self.api.credentials(http_authorization=auth)

How to load large amount of images in iOS? -

i developing app displays large number of images. when i'm loading images there's no problem on loading of 1000 images when image crosses 1000 app crashes , memory issues raised. how solve it? there way. kindly me? thanks in advance your app crashing due consuming memory. need strategy manage memory app uses. you need set pooling-type system load images might displayed "soon". for example, if user looking @ image 500, have 498, 499, 501, , 502 loaded memory. if move image 501, deallocate 498, , load 503. what constitutes "soon" dependent upon how app's flow works, should able come workable.

Import MySQL data failed with error 1839 -

i have master slave setup of mysql gtid configured. took data backup of master , importing individual test server. failing import error 1839 (hy000) @ line 24: @@global.gtid_purged can set when @@global.gtid_mode = on i tried --set-gtid-purged=off , auto , no luck.

c++ - Why does it compile in Android source? -

i'm trying compile adb (core/adb) on windows using vs2008 manually. in function static __inline__ char* adb_dirstart( const char* path ) { char* p = strchr(path, '/'); ... i error: sysdeps.h(247) : error c2440: 'initializing' : cannot convert 'const char *' 'char *' the return type of strchr displayed vs2008 , described here is const char * strchr ( const char * str, int character ); char * strchr ( char * str, int character ); as argument path const char*, first variant returning constant should used. so why compile in android sdk? there compiler switch used in build scripts?

Can't disable/stop GbpSv Windows Service -

Image
i'm trying set windows process called "gbpsv" disabled , although user administrator, commands disabled. ex: c:\users\andre>sc config "gbpsv" start=disabled [sc] openservice failed 5: access denied. c:\users\andre>net stop "gbpsv" requested pause, continue, or stop not valid service i'm using windows 8.1. trying kill process: c:\program files (x86)\gbplugin>tasklist | findstr gbp gbpsv.exe 104 services 0 16.520 k gbpsv.exe 5324 console 1 13.448 k c:\program files (x86)\gbplugin>taskkill /pid 104 error: process pid 104 not terminated. reason: process can terminated forcefully (with /f option). c:\program files (x86)\gbplugin>taskkill /f /pid 104 error: process pid 104 not terminated. reason: access denied. you can't merely stop that. you'll have purge machine because it's security plugin banks provide in order

string - Testing for a Palindrome in Python -

i know there better solutions this, i'm confused why i'm getting result am. import sys def ispalindrome(test): if len(test) == 1: return("is palindrome") else: if test[0] == test[-1]: ispalindrome(test[1:-1]) else: return("not palindrome") print(ispalindrome(sys.argv[1])) on true palindrome, 'none'. when result not palindrome, expected value of 'not palindrome'. change following line: return ispalindrome(test[1:-1]) you have return value or value returned none .

data extraction - How can I extract a table from a badly formatted PDF? -

my client needs have csv name,surname,dob accounting database. the problem is, accounting software "in cloud" (hence, in else's computer , freely accessible in world) , webapp can generate badly formatted "welcome card pdf", this hi <newline> <lots of spaces>my name %name% <lots of spaces> %surname% <lots of newlines , spaces simulate text alignment right>i born in %dob <newpage> so, can 500 pages pdf unusable content. is there way extract data such file? it important know if have multiple times or once 1 500 page file. assume once. in case, pdf converted xml (if @ possible) or text file (many converters available - google). then important know if 'records' formatted same way - format: .... firstname...lastname...dob...addressline1.... (where ... stuff don't want) are there 'labels' or 'tags' tell next thing 'address line 1' or if value missed can tell? if structure s

Java Mail: won't sent an email -

i have code worked fine earlier on, won't sent emails. there wrong in code? there error says program couldn't connect smtp server of google. here's code: import java.util.*; import javax.mail.*; import javax.mail.internet.*; public class mailing { public mailing() { } public void getmail(string warning,string subject) { final string username = "wim81.vangeyt@gmail.com"; final string password = "minidisc"; properties props = new properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.startssl.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "465"); session session = session.getinstance(props, new javax.mail.authenticator() { protected passwordauthentication getpasswordauthentication() {

Error on import statements while integrating Test Link through WebDriver Java -

i trying integrate testlink webdriver using java. so after executing tests in webdriver , results go testlink . i got code online error import br can not resolved. i have imported following libraries - testlink-api-client-2.0, commons-logging-1.1, ws-commons-util-1.0.2, xmlrpc-client-3.1, xmlrpc-common-3.1-sources. can please me resolve issue? import statements on error: import br.eti.kinoshita.testlinkjavaapi.testlinkapi; import br.eti.kinoshita.testlinkjavaapi.constants.executionstatus; import br.eti.kinoshita.testlinkjavaapi.constants.executiontype; import br.eti.kinoshita.testlinkjavaapi.constants.testcasedetails; import br.eti.kinoshita.testlinkjavaapi.model.testcase; import br.eti.kinoshita.testlinkjavaapi.util.testlinkapiexception; download below "testlink-api-client-2.0" jar file , use it. should solve problem. https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/dbfacade-testlink-rpc-api/testlink-api-client-2

How do i remove a specific collection from my model in C# -

this model: public class obsmodel : bindablebase { private string _obsname = string.empty; public string obsname { { return this._obsname; } set { this.setproperty(ref this._obsname, value); } } private string _obscolor = string.empty; public string obscolor { { return this._obscolor; } set { this.setproperty(ref this._obscolor, value); } } private string _obsvalue = string.empty; public string obsvalue { { return this._obsvalue; } set { this.setproperty(ref this._obsvalue, value); } } } i can populate model using object. observablecollection<obsmodel> lastobsresults = new observablecollection<obsmodel>(); but how can remove particular collection if have example observation name string variable using code below? latsobsresults.remove( put here); you remove object collection

javascript - Display selected answers at the end of a multiple choice quiz -

i trying create multiple choice quiz. questions , choices displaying nicely in application. at end of quiz, can count how many answers correct, incorrect , unanswered successfully, can't show selected answers , mark them correct, incorrect or unanswered. i have been trying code part of application 1 month, , can't seem figure out. how can display selected answers , mark them correct, incorrect or unanswered @ end of multiple choice quiz ? this questions.php code , below result.php code. <?php session_start(); ?> <?php require 'config.php'; $category=''; if(!empty($_post['name'])){ $name=$_post['name']; $category=$_post['category']; mysql_query("insert users (id, user_name,score,category_id)values ('0','$name',0,'$category')") or die(mysql_error()); $_session['name']= $name; $_session['id'] = mysql_insert_id(); } $category=$_post['cate