Posts

Showing posts from February, 2010

php - javascript to change style display -

i have bunch of items setup <div id="first" class="source"> i'm in google chrome, , when page loads hides items when click onclick button un hide them, i'm not able click again , make hide. html <body onload="setup();"> <a href="#first" onclick="shoh('first');" > js: function setup() { foo = document.getelementbyid('first'); foo = document.getelementsbyclassname('source'); (c=0; c<foo.length; c++) { foo[c].style.display='none' } } function shoh(id) { if (document.getelementbyid(id).style.display = 'none'){ var divs = document.getelementbyid(id); for(var i=0; i<divs.length; i++) { divs[i].style.display='block' } } else { cow = document.getelementbyid(id); for(a=0; a<cow.length; a++) { cow[a].style.display='none' } } } you have couple of issue here: if compare 2 varia

Java mysql, Simple update with PreparedStatement has syntax error -

this code has sort of simple syntax error. i've fought hours , give up. can spot it? bet it's easy. thanks! when update firstname john, no problem. when try update commented out line lastname too, syntax error. import java.sql.*; public class updatetester { public static void main(string[] args) { try { connect connect = new connect(); connection connection = connect.getconnection(); try { string sql = "update student set firstname = ? " + " studentid = 456987"; //string sql = "update student set firstname = ? " // + " set lastname = ?, " // + " studentid = 456987"; preparedstatement pst = connection.preparestatement(sql); pst.setstring(1, "john"); //pst.setstring(2, "johnson"); pst.executeupdate(); sys

asp.net mvc - Google OpenID provider consistently fails on Azure -

i'm trying use google openid mvc 4 app hosted on azure & keeps failing. not straight away though. when deploy app, works time after time. leave amount of time, day, hour & try again & fails everytime. refresh, go homepage, sends login page & works again. the error : [invalidoperationexception: sequence contains no elements] system.linq.enumerable.first(ienumerable`1 source) +498 dotnetopenauth.openid.relyingparty.openidrelyingparty.createrequest(identifier usersuppliedidentifier, realm realm, uri returntourl) +106 [protocolexception: no openid endpoint found.] dotnetopenauth.openid.relyingparty.openidrelyingparty.createrequest(identifier usersuppliedidentifier, realm realm, uri returntourl) +303 tools.helpers.googleapps.login(uri returnurl) in c:\users\simon\documents\visual studio 2012\projects\internal utils\website\helpers\googleapps.cs:33 tools.helpers.externalloginresult.executeresult(controllercontext context) in c:\users\simon\document

meteor - Is there any way to disable var scoping? -

the file-level javascript variable scoping introduced in meteor 0.6.0 breaks projects , packages written in typescript (and coffeescript , other transpilers). there way disable it? for example, typescript code: declare var meteor: any; module model { export var players = new meteor.collection('players'); } generates javascript no longer works because model no longer considered global: var model; (function (model) { model.players = new meteor.collection('players'); })(model || (model = {})); prepending this.model = null; workaround it's redundant , have apply code used meteor (it's broken @ least 1 of meteorite packages). what reason introducing meteor specific javascript language semantics? its bit nice way because before having these files sharing variables bit odd. meteor treated every javascript file if one. having larger projects (>20 js files) made difficult modularize application i'm not sure typescript it's sug

How to deploy WAR with Maven to Tomcat? -

i use maven eclipse. possible build project , deploy built war file tomcat server? i use windows. can build war file, , deploy on server manually. want deploy war file automatically after build action , doesn't work. novice in maven. should set in run configuration? have set goals install value. pom.xml <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>helloworld</groupid> <artifactid>helloworld</artifactid> <version>0.0.1-snapshot</version> <packaging>war</packaging> <name>helloworld</name> <properties> <spring.version>3.2.2.release</spring.version> </properties> <dependencies> <!-- java server pages standard tag library

Ruby regex- does gsub store what it matches? -

if use .gsub(/matchthisregex/,"replace_with_this") does gsub store matches regex somewhere? i'd use matches in replacement string. example like "replace_with_" + matchedregexstring + "this" in above example matchedregexstring stored match gsub? sorry if confusing, don't know how else word that. from fine manual : if replacement string substituted matched text. may contain back-references pattern’s capture groups of form \d , d group number, or \k<n> , n group name. if double-quoted string, both back-references must preceded additional backslash. however, within replacement special match variables, such &$ , not refer current match. [...] in block form, current match string passed in parameter, , variables such $1 , $2 , $`, $& , , $' set appropriately. value returned block substituted match on each call. if don't care capture groups (i.e. things (expr) in regex) can use block form

Rails: get all assets belonging to a model -

i've got brand model has lot of assets: class brand < activerecord::base attr_accessible :name, :logo1, :logo2, :colour1, :colour2, :prices_attributes has_attached_file :logo1 has_attached_file :logo2 has_many :users has_many :welcome_messages has_many :silos has_many :articles, :through => :silos has_many :libraries has_many :covers, :through => :libraries has_many :products has_many :prices, :through => :products, :autosave => true, :dependent => :destroy accepts_nested_attributes_for :prices end is there quick way assets assigned each brand? or have brand.articles.each |article| ... each? cheers! if want eager load associations can following: def self.all_associations includes(:users, :articles, :prices, :products) #and other association end then can run brand.all_associations or brand.all_associations.find(1) as jvnill wrote result in n database queries, in above example 5 database queries.

Creating Table in database from Perl using SQLite3 -

i'm having trouble creating table in database created perl using dbi sqlite3. using code have below, want table contain port-probes, 1 line each source ip , port. don't know if im doing properly, code below not work reason, appreciated. code have follows. #!/usr/bin/perl use strict; use dbi; $dbh = dbi->connect( "dbi:sqlite:dbname=test.db", "", "", { raiseerror => 1} ) or die $dbi::errstr; $dbh->do(create table probes ( source char(15) not null, port char(5) not null, primary key (source,port)) ); $dbh->disconnect(); you forgot quote argument $dbh->do . there many ways this. $dbh->do( "create table probes ( ..." ); $dbh->do( 'create table probes ( ...' ); $dbh->do( qq[ create table probes ( ... ] ); $dbh->do( <<"end_sql" ); create table probes ( ... end_sql added: fix problem, need put quotes around stuff in $dbh->do funct

android - Search style EditText -

i use "search" style edittext, thin line underneath , microphone icon on right (although replace icon different function), used in apps youtube , google maps. is native element of in versions of android? can't seem find reference anywhere, although did find this: android edittext google search edittext which says create yourself, i've done, if there's more "native" search edittext i'm unaware of, i'd rather use that... thanks help. if want have search-edittext inside of app, here find information needed: http://developer.android.com/guide/topics/search/index.html google provides configuration examples both android 2.x without actionbar , later androids actionbar. under "creating search interface" find section "adding voice search" brings in microphone icon, though don't know how override functionality.

best practice for xml repeating elements -

is acceptable repeat xml elements shown in example? notice in first example how 'period_data' element repeated directly inside 'usage_history' element without first being wrapped inside 'periods' parent element. initially seems reduant me include 'periods' parent element thing inside 'usage_history' parent 'period_data' elements anyway. thank you. <usage_history num_periods="2"> <period_data billing_year="2013" billing_period="2"> content... </period_data> <period_data billing_year="2013" billing_period="1"> content... </period_data> </usage_history> as opposed this... <usage_history> <periods num_periods="2"> <period_data billing_year="2013" billing_period="2"> content... </period_data> <period_data billing_year=

for loop in R variable embedded in string name -

i new r , having trouble creating loop in can use variable in string name. example: lm1 <- lm(a~b+c) lm2 <- lm(a~b+d) lm3 <- lm(a~b+e) for(i in 1:3){ summary(lm${i}) } any appreciated! work in list. to models in list model_list <- mget(paste0('lm',1:3), envir = parent.frame()) # apply summary on each element of list lapply(model_list, summary)

context free grammar - Java Implementation of an algorithm for CFG in Chomsky form -

the goal convert pseudo code actual working code. thought had figured out there's not quite right. the rule i'm using is s -> rt|empty t -> tr|a r => tr|b here's pseudo code: d == "on input w == wi . ..wn : 1. if w == e , s -> e rule, accept. [handle w == empty case] 2. == 1 n: [examine each substring of length 1] 3. each variable a: 4. test whether -> b rule, b == wi. 5. if so,place in table(i,i). 6. l == 2 n: 7. == 1 n -l + 1: 8. let j == + l - 1, 9. k == j -1: 10. each rule \037 bc: 11. if table(i,k)contains b , table(k + 1,j)contains c,put in table(i,j). 12.if s in table(l,n), accept.otherwise, reject. here's actual code: public class algorithm { public static void main(string[] args){ string w = " abab"; string table[][] = new string[w.length()][w.length()]; if (w.isempty()){ system.out.println("accept\n");

c++ - Basic RValue method return -

assuming basic method: std::string stringtest() { std::string hello_world("testing..."); return std::move(hello_world); } how should use output: option a: auto& string_test_output=stringtest(); option b: auto string_test_output=stringtest(); is stringtest() temporary value? if so, option not safe. if it's not temporary value, have feeling option b cause copy. i still getting used rvalue references returning value still scary don't want copying occur or run unnecessary copying! the best way change method this: std::string stringtest() { std::string hello_world("testing..."); return hello_world; } there no need tell function returned object should rvalue, comes automatically value being temporary - is, not bound name @ call site. such, initialized value move-constructed (unless temporary inside function elided entirely), no need manually express such intention. also, since return type std::string , retur

css - Any fallback for hardware accelerating everything? -

are there reasons not hardware-accelerate transform: translate3d(0,0,0); using * selector? what things should hardware accelerated , things not? @imuxixd ask question , answer no shouldn't hardware accelerate may seem solve issue can causing several other issues. can cause weird display issues when you're trying z-index items hardware accelerating object tends remove them dom while animating. i wrote extensive article on understandings , tests hardware acceleration here http://blog.zindustriesonline.com/gpu-accelerated-animations-and-composite-layering/ has video on subject matt seeley engineer @ netflix. i hope helps understand little better benefits , downfalls of using hardware acceleration , best case scenarios use cases.

ruby - Rails Display post according to timestamp -

i noob in rails following rails official documentation creating blog, after creating blog post , comment controller want add way display post according time-stamp i.e. post created last or had commented on post displayed on top of list. please suggest way or gem achieve this. use order of activerecord. assuming blog model blog blog.order("updated_at desc") check tutorial you can create scope

ajax - Displaying JSON data in dropdown list in struts2 -

i doing code. struck @ 1 problem. want populate json data in select box in struts2. what doing is..i sending ajax request on click of button , displaying form. form has property display none. when click on button changes block. but there 1 error coming whenever opening jsp page browser. the requested list key 'categories' not resolved collection my struts.xml <?xml version="1.0" encoding="utf-8" ?> <!doctype struts public "-//apache software foundation//dtd struts configuration 2.0//en" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <constant name="struts.custom.i18n.resources" value="loginaction" /> <package name="default" extends="struts-default" namespace="/"> <action name="login" class="com.agents.cb.loginaction" > <result name="success" type="redire

python - How to create a datastore_query.Order object for ndb Query constructor? -

i noticed @ https://developers.google.com/appengine/docs/python/ndb/queryclass , there optional argument ndb.query constructor allows specify order in query. argument must of type datastore_query.order, can't seem find documentation on object or how create it. specify list of model properties order by: property_list = [item.property1, item.property2] items = item.query(orders=order(property_list)) instead of: items = item.query().order(item.property1, item.property2) any ideas? i think you're looking datastore_query.compositeorder composed of propertyorder s of properties in list. source order subclasses seems explained quite well, , can take @ ndb.query.order() construct them, , object pass constructor. (i can't think of situation using .order() wouldn't suitable though, , simpler.)

selection - Make html select option drop down menu open by default -

when select box clicked, drop down list of options displayed. drop down list stays open until user clicks outside or selects 1 of options in drop down list. is there simple way of making drop down list displayed when user enters page? autofocus better. similar how amazon displays it's menu automatically. i understand make ul dropdown list + javascript , etc, wondering whether there way of doing select using html or javascript. you can simulate click on element, click on <select> won’t open dropdown. using multiple selects can problematic. perhaps should consider radio buttons inside container element can expand , contract needed.

javascript - How to find time elapsed between two consecutive requests? -

i have 2 checkboxes on selection of each 1 raise ajax request in order response server. need call method when there atleast 2 seconds gap after last request made. idea? means not want call methods when checkboxes clicked continously less 2 seconds gap. set timeout activated in 2 seconds, , cancel , restart whenever clicks checkbox. var timeout; var checkboxclickhandler = function() { cleartimeout(timeout); var timeout = settimeout(function() { // logic. }, 2e3); };

css - double border coming in every row of table -

Image
there table have given border. after giving border there double border coming after googling found border-collapse savior. after trying use in every possible way not working. there double border @ bottom coming want remove. for better understanding attached screen shot: i want remove double border coming after each cell. markup. <table border="1" cellpadding="2" cellspacing="0" style="border-collapse: collapse;"> <thead> <tr> <th > login name </th> <th> sheetname </th> </tr> </thead> <tr> <td>aaa</td> <td>abc</td> </tr> <tr> <td>asdfasdf</td> <td>aasdfsadfbc</td> </tr> </table> css needed provide definite answer. others said, make sure there aren't global css files alte

javascript - HTML Code - Something is invalid - Cant Figure Out What -

i trying use on-completion function countdown plugin; however, whatever reason, dreamweaver telling me there syntax error tell change inner html of div contentcontainer. have been looking hours , cant find whats wrong it. hoping me out. appreciated. <script language="javascript" type="text/javascript"> jquery(document).ready(function() { $('#countdown_dashboard').countdown({ targetoffset: { 'day': 0, 'month': 0, 'year': 0, 'hour': 0, 'min': 5, 'sec': 0 }, oncomplete: function() { document.getelementbyid('contentcontainer').innerhtml = '<div id="content"> <div class="success_box"&g

jquery - Select end_time which is greater than start_time -

i'm using jquery in rails app show start time , end time, come helper (i'm not using datepicker). in form: .field = f.label :start_time = f.select :start_time, options_for_select( [""] + start_time, "#{f.object.start_time.strip}") .span#end_time .field = f.label :end_time = f.select :end_time, options_for_select( [""] + end_time, "#{f.object.end_time.strip}") the time list comes helper (i.e. start_time , end_time ). how can validate time can select end_time greater start_time ? you can disable options http://www.w3schools.com/tags/att_option_disabled.asp . i'd use javascript run through array of "end_time" select options , disable less "start_time". something (id's , stuff need modified): $("#start_time").change(function() { // start time var start_time = $("#start_time").find(":selected").text(); /

android ndk - $(build_executable) producing shared object -

i'm trying create native executable android , keeps crashing. testing file readelf , objdump revivals file considered shared object file. i'm using r8e , compiling ndk-build test.c: int main(){ return 0; } android.mk: local_path := $(call my-dir) include $(clear_vars) local_src files := test.c local_module := test include(build_executable) -- setting app_platform android-9 results in creation of executable file ( , no crashes). have tried specifying arguments int args , char *argv[] main() method? also, trying run it?

c++ - Include in header file vs. forward-declare and include in .cpp -

i have class b, , want call members form class a. so: 1. //a.h class b; class { private: b* m_p; }; //a.cpp #include "b.h" 2. // a.h #include "b.h" class { private: b * impl_; }; which way better , 2 similar when small project not dependence evolves? your first way of doing means in a.h , existence of class b known, not definition . limits can b inside a.h . example, can have variables of type b * , not variables of type b (because declaration of variable of type b compiler must able see full definition of b ). also, if have variables of type b * , can't dereference pointer (because that, too, definition of b must known). therefore, second choice – doesn't have these problems – preferred, , people use of time. it's special cases in first method may useful. example: if .h files include each other (but may number of further problems, regarding include-guards; difficult , avoided); if b.h extre

java - putfield order of arguments -

in java bytecode "putfield" instruction expects top of stack value, , top-1 of stack reference. why not other way round ? it asked in lecture notes , cannot find answer. the order doesn't matter, since vm , compiler implemented either way. sun chose have lower arguments appear lower on stack. you can see not putfield , many other instructions, such array loading , storing , method invocation. obey same convention. explanation can think of is more intuitive way. if read out stack bottom top left right, arguments on stack have same order arguments in method signatures or original source code. if wanted other way, programmers have mentally treat stack reversed, isn't big deal, possibly less intuitive.

java - wav file to flac not working -

we trying use javaflacencoder convert wav file flac. the call succeed , created file. file has no audio content @ all. code simple : val flacencoder = new flac_fileencoder() val path = paths.get(wavpath) val outputfile = file.createtempfile("talkingbirdtemp", ".flac") val status = flacencoder.encode(path.tofile, outputfile) if (status != status.full_encode) { outputfile.delete throw new runtimeexception("flac conversion failed with: " + status) } the wav file sample rate 22050. generated file has no valid audio signal @ all. anything we've done wrong? are sure you're writing code in java?

DDOS Attack in ASP.NET with State Server Session -

cant find issue anywhere... using asp.net 3.5, have 3 web servers, in web farm, using asp.net state server (on different server). all pages uses session (they read , update session) issue: pages prone ddos attack, easy attack, go page, , hold down 'f5' key 30-60 seconds, , request pile in web servers. i read, if make multiple call session each lock session, hence other request has wait same user's session, waiting, causes ddos. our solution has been pretty primitive, preventing (master page, custom control) call session , allow page call, adding javascript disable's f5 key. i realize asp.net session prone such ddos attacks!! anyone faced similar issue? global/elegant solution? please share thanks check this: dynamic ip restrictions : dynamic ip restrictions extension iis provides professionals , hosters configurable module helps mitigate or block denial of service attacks or cracking of passwords through brute-force temporarily blocking inte

spring mvc - View layer of child still showing previous value of parent table column departmentID ,but parent is deleted -

i stuck on problem have made normal project using spring mvc , spring-data in have dao layer,service layer ,controller , view layer. in project have department, employee,employeeproject table. when delete department corresponding employee table column departmentid set null.so reflected in database when in delete department ui ,but when again see employee through getallemployee button @ time previous value of department still showing in ui instead of value null in database. when restart server value not showing why ? this function getallemployee() in 3 layer in dao layer /** * employee detail database * * @return list of employees */ @override public list<employee> getallemployees() { list<employee> employeelist = employeerepository.findall(new sort( direction.asc, "employeenumber")); return employeelist; } in service layer @override public list<employeebo> getallem

Missing inverse property in asp.net webapi odata $metadata -

have simple relationship between 2 entities , trying expose them asp.net webapi odata controllers seems wrong $metadata. when run jaydatasvcutil.exe on $metadata warning: inverseproperty other side missing. when use breezejs loadnavigationproperty similar error. i have problem official example. http://www.asp.net/web-api/overview/odata-support-in-aspnet-web-api/working-with-entity-relations you can observe $metadata here http://sdrv.ms/z5klfw please help. when generating navigation properties don't reuse relationships. for example, lets have simple model, public class product { public int id { get; set; } public supplier supplier { get; set; } } public class supplier { public int id { get; set; } public product[] products { get; set; } } the $metadata navigation properties generate looks this, <navigationproperty name="supplier" relationship="productsservice.models.productsservice_models_product_supplier_productsservi

java - find out location of phone based on received sms -

i creating java application receive messages on pc using jsms api. whenever user sends particular message no, receives , adds database, phone number , area/ region belongs. the region can either area phone number registered, or can current location of device. either of these information me. i glad if 1 1 guide me on how proceed finding out region using java code. note: i'm not looking country. i'm looking state/ region. preferable indian states. you try out libphonenumber . defines region based on number. there javascript try page here perform tests.

python - Django: I want to recognize a hash url -

i have url http://localhost/user/?hash={hash value generated} i need configure urls.py url of form recognized , not give error. i wrote urls.py as url(r'^user/(?p<hash>\w+)/$', 'myapp.views.createnewpass'), and giving 404 error valid hash. how can correct error? thanks in advance! well, should clear regex not match url: it's looking urls in form /user/hash/, whereas have /user/?hash=hash. in case, query parameters (those after ?) not processed urls.py, passed in request.get. urlconf should r'^user/$ .

asp.net mvc 3 - how to add an existing folder with all its sub folders and contents to a solution? -

Image
is there way add existing folder sub folders , contents solution in visual studio 2012? ways zipping or this...? there's button in solution explorer called show files . click on , select folder include project: notice how folders not part of project shown in white. pick folder want include, right click on , select include in project in context menu. recursively include files project.

java - SmartGwt with hibernate for database connection -

i using eclipse indigo .i want use hibernate smartgwt smart gwt showcase i have grid want data database using hibernate datasource(ds) smartgwt showcase ee. don't understand how connect database using hibernate(ds) , data table. it old question since not answered here goes, the thing table on client side first have move data server end , hibernate stuff there. achieve suggest custom datasource using gwt-rpc. can code here. https://code.google.com/p/smartgwt-extensions/ once have working can regular hibernate stuff on server side.

strlen() php function giving the wrong length of unicode characters -

this question has answer here: php: strlen returns character length instead of byte length 4 answers i trying length of unicode characters string $text = 'نام سلطان م'; $length = strlen($text); echo $length; output 20 how determines length of unicode characters string? strlen() not handling multibyte characters correctly, assumes 1 char equals 1 byte, invalud unicode. behavior documented here: http://php.net/strlen strlen() returns number of bytes rather number of characters in string. solution use mb_strlen() function instead ( mb stands multi byte ) ( see mb_strlen() docs ). edit if reason chanage in code not possible/doable, 1 may want ensure string functions automatically overloaded multibyte counterparts. supported php , documented here . please note may want edit php.ini ensure mb_string works want to. available set

xamarin.ios - Not able to add UIbutton to UIscrollview in Monotouch Dynamically -

i facing strange problem. trying add uibuttons uiscrollview in monotouch. uibutton not getting displayed. here code: uiimage img = uiimage.fromfile("ecu.png"); uibutton btn = uibutton.fromtype(uibuttontype.custom); btn.setbackgroundimage(img,uicontrolstate.normal); btn.frame = new rectanglef(uiscreen.mainscreen.bounds.size.width - 185, 0, 185,uiscreen.mainscreen.bounds.size.height, 100, 150, 150); btn.touchupinside += (sender, e) => { uialertview alert = new uialertview("info","tapped",null,"ok",null); alert.show(); } ; scrollimages.addsubview (btn); the same code works if add button view. can on please. i tried following code after adding uiscrollview view in interface builder: uiimage img = uiimage.fromfile("ecu.png"); uibutton btn = uibutton.fromtype(uibuttontype.custom); btn.setbackgroundimage(img,uicontrolstate.normal); btn.frame = new rectanglef(0.0f, 0.0f,

arrays - Codeigniter pass post information to view along with database result of the post information -

i have form collects customername , period , unitofmeasure [buom]. i pass information controller puts post data array , passes view. this controller works 100% currently. function new_blank_order_lines() { if($this->input->post()){ $data = array( 'customer' =>$this->input->post('customer'), 'period' =>$this->input->post('period'), 'buom' =>$this->input->post('buom') ); $this->session->set_userdata($data); $this->sales_model->get_creditlimit($this->input->post('customer')); } $this->load->view('sales/new_blank_order_lines',$this->session->all_userdata()); } else { redirect('/sales/permerror'); } } what want query customers credit limit , credit balance using customer post value , pass view use in next form. so model is: function get_creditlimit($customer) { $this->

android - Update issue of an app widget using collection -

i have created app widget using collection app, widget shows date , list of item on particular date. works fine , widget updating required, happen while changing date in widget clicking next , previous button, list not refresh means items not updated on particular date. behaviour random , occur only. why happen, wrong in code. code have use is: widgetprovider.class public class widgetprovider extends appwidgetprovider { private thememanager m_thememanagerobject; private static string widget_next_button = "in.test.widgetapp.widget_next_button"; private static string widget_prev_button = "in.test.widgetapp.widget_prev_button"; @override public void onupdate(context context, appwidgetmanager appwidgetmanager, int[] appwidgetids) { super.onupdate(context, appwidgetmanager, appwidgetids); // set date current date notemanager.getsingletonobject().setwidgettocurrentdate();

c# - How to get values from textbox comments in pdf document -

Image
i have pdf document, inside comments lists of 2 types : 1. rectangle 2. text box i want values text boxes c# , itextsharp. the text boxes , rectangles you're referring called annotations. annotations defined dictionaries , listed per page. in other words: need create pdfreader instance , annots each page: pdfreader reader = new pdfreader("your.pdf"); (int = 1; <= reader.numberofpages; i++) { pdfarray array = reader.getpagen(i).getasarray(pdfname.annots); if (array == null) continue; (int j = 0; j < array.size; j++) { pdfdictionary annot = array.getasdict(j); pdfstring text = annot.getasstring(pdfname.contents); ... } } in above code sample, have pdfdictionary named annot , can extract contents. may interested in other entries (for instance name of annotation, if any). please inspect keys available in annot object in case contents entry isn't you're looking for. replace dots whatever want t

java - Unary operator within main and static method -

i have following 2 codes, , in process of knowing how unary operation works within sop, , main method. let me know how values of "i" calculated within main, , when gets within static method. any detail background operation of things appreciated, need build logic me understand other related codes well. thanks in advance help. class r { static int test( int i) { return i--; } public static void main (string[] args) { int i=0; system.out.println(test(i++)); system.out.println(i); = 0; system.out.println(test(i--)); system.out.println(test(i)); } } result: 0 1 0 -1 second 1 : class s { static int test( int i) { return ++i; } public static void main (string[] args) { int i=0; system.out.println(test(i++)); system.out.println(i); = 0; system.out.println(test(i--)); system.out.println(test(i)); } }

c# - Implicit connection of Action Methods with Views in ASP.NET MVC -

i working in brownfield asp.net mvc 3 project in vs2010 . in project, views , controllers in separate projects. not have seen before. in each action method there no explicit stating of view name below. return view("viewname",passingmodel);//projects controllers , views in same i have done implicitly in vs2012 right clicking on view , add view . not bothered connection between action method's return view , view stated. unlike in vs2012 , in vs2010 can not navigate view related 1 particular action method right clicking on view , doing go view . i tried understand doing small experiment. created controller , created action method call xxxx , created view implicitly mentioned above , searched word xxxx in entire solution word appeared in controller , in view. so, unsuccessful in finding answer. think visual studio creating own mapping achieve this. know these implicit connections created among action methods , views understand going on in project. edi

JQuery Mobile popup with history=false autocloses -

i'm trying show popup popup disappears automatically, without history=false popup stays visible on closing popup browser action triggered <div data-role="page" id="indexpage"> <div data-role="popup" data-history="false" id="apppopup">test popup</div> <script> $("#indexpage").on("pageshow", function () { $("#apppopup").popup("open"); }); </script> </div> check happens here: http://jsfiddle.net/francisdb/thtfz/ any idea on how fix this? working example: http://jsfiddle.net/gajotres/2el5r/ $("#indexpage").on("pageshow", function () { var popup = setinterval(function(){ $("#apppopup").popup("open"); clearinterval(popup); },1); }); webkit browsers hate popup open, setinterval needs used trigger it. same thing goes few other jquery mobile functionalit

.net - Device unique id from C++/CX -

can device unique id(udid) c++/cx code on wp8? or how can if doesnt? i've tried use deviceextendedproperties (it doesn't work, .net class). you can use hardwareidentification.getpackagespecifictoken method device-unique id specific app. there complications it, value of id depends on number of system factors such available memory, connected peripherals (think bluetooth headsets), network connectivity, etc - make sure read linked documentation! more in-depth discussion of components of hardware id can found here . the value unique combination of app , specific device, more enough app-development purposes. note api requires wp 8.1 "windows runtime" app, , not available wp8 silverlight apps. using namespace windows::system::profile; ... ibuffer^ nonce = ...; // optional, see documentation hardwaretoken^ hwid = hardwareidentification::getpackagespecifictoken(nonce); // hardwaretoken has few properties, 1 you're interested // in hardwaretoken.

Run Java 6 file on Java 7 (or 32 bit file...) -

i tryed run .jar file on lasted java 7. received error: could not load 'plugins/ucars.jar' in folder 'plugins' org.bukkit.plugin.invalidpluginexception: java.lang.unsupportedclassversionerror: com/useful/ucars/ucars : unsupported major.minor version 51.0 @ org.bukkit.plugin.java.javapluginloader.loadplugin(javapluginloader.java:184) @ org.bukkit.plugin.simplepluginmanager.loadplugin(simplepluginmanager.java:305) @ org.bukkit.plugin.simplepluginmanager.loadplugins(simplepluginmanager.java:230) @ org.bukkit.craftbukkit.v1_4_r1.craftserver.loadplugins(craftserver.java:239) @ org.bukkit.craftbukkit.v1_4_r1.craftserver.<init>(craftserver.java:217) @ net.minecraft.server.v1_4_r1.playerlist.<init>(playerlist.java:55) @ net.minecraft.server.v1_4_r1.dedicatedplayerlist.<init>(sourcefile:11) @ net.minecraft.server.v1_4_r1.dedicatedserver.init(dedicatedserver.java:104) @ net.minecraft.server.v1_4_r1.minecraftserver.run(minecraftserver.java:399) @ net.minecr

javascript - mootools .bind function not working -

here page: http://www.b-a.lt/c3150/seseliai-akims in page using mootools plugin lazypagination http://mootools.net/forge/p/lazypagination in ff chrome , ie9+ works fine, in ie7, ie8 bind function in lazy pagination class not working. any ideas? the bind function not supported in ie7 , ie8. the same question has been answered how handle lack of javascript object.bind() method in ie 8 in case using jquery ended using $.proxy() method, returns new function context of 'this' in function set object pass in. don't know if mootools has equivalent function.