Wednesday, 15 September 2010

HTML5 official examples for e-commerce -



HTML5 official examples for e-commerce -

while building new onlineshop (based on magento) considered create utilize of new html5 tags <header><footer><section><article> etc.

we read lots of blogs / websites describing how utilize tags - unfortunately, of time authors utilize blogs or news sites examples not typical e-commerce shop landing-pages, category pages, product pages.

also, found shops using above-mentioned tags - differently.

therefore know if knows if there (maybe official) examples of how construction e.g. category- or product pages html5-tags.

many html5 tags have own semantic meaning , self-explanatory. there no hard-and-fast rules.

<figure> image or diagram.

<section> section or category, etc.

there aren't standards, other trying logical in selection of tag. while can find examples of how people using them, in bigger scheme of things, doesn't matter much. what matters drives customers create purchases , having decent construction back upwards seo.

if want semantic markup can used (such in google offers) may want consider micro-format schema alternative.

http://schema.org/product

html5 e-commerce online-store

c# - EXIF tag and hex code for 'Tags' and 'Authors' for jpg image -



c# - EXIF tag and hex code for 'Tags' and 'Authors' for jpg image -

i unable co-relate actual exif tag 'tags' , 'authors' can see in image properties. can help me see 1 of corresponds it?

ps. referring list of exif tags here on msdn -

here's guess @ properties:

authors = propertytagartist (0x013b)

(null-terminated character string specifies name of person created image.)

tags = propertytagexifusercomment (0x9286)

comment tag. tag used exif users write keywords or comments image besides in propertytagimagedescription , without character-code limitations of propertytagimagedescription tag.

i edited jpeg in windows explorer per op illustration screenshot , ran thru exiftool. output contained value added author artist, xp author, , creator. listed value added tags xp keywords, subject, , last keyword xmp.

c# exif

java - Eclipse debug breakpoint stopping only on virtual invocation of specific subclass -



java - Eclipse debug breakpoint stopping only on virtual invocation of specific subclass -

let's have abstract class method onpoke(..).

abstract class basevaluepanel{ void onpoke(int depth){ //blah, blah, ... } } classes numbervaluepanel, attributevaluepanel, categoryvaluepanel extend basevaluepanel. among others, class decimalvaluepanel extends numbervaluepanel. among others, class estimationvaluepanel extends decimalvaluepanel. none of extension classes overrides onpoke(..) method.

now, wish place breakpoint on onpoke(..) when invoked thro object of class estimationvaluepanel.

because right now, if placed breakpoint on onpoke(..), debugger stop thousands of instances (because of extensive descendant classes of basevaluepanel) , 1 of due invocation thro estimationvaluepanel.

what sequence of set-up or strategy of breakpoint set-up need employ, in order allow debugger stop when method invoked thro estimationvaluepanel.

what meant virtual breakpoint ...: is, in java opposed c#, non-private, non-static, (overridable) methods naturally virtual. hence, virtual invocation here.

of course of study can override method in class estimationvaluepanel , set breakpoint there.

but can utilize conditional breakpoints: go properties of breakpoint on method onpoke() (right-click or ctrl + double-click) , select "conditional". in text area below can come in next condition:

this instanceof estimationvaluepanel

this means status evaluated everytime method entered. if experience perfomance issues, should prefer override method in estimationvaluepanel.

java eclipse debugging virtual-method

php - Plupload set album name before upload -



php - Plupload set album name before upload -

i knew upload.php file run each uploaded file. when if there 5 files, upload.php run 5 times right?

i need insert record mysql 'album' table can albumid inserted 'photos' table.

my thought run script before upload starts.

how possible plupload? or different thought guys?

or root question, there way specify album uploaded photos?

thanks

i guess :

have client-side variable albumid, default empty bind beforeupload uploader event in beforeupload handler, see if albumid set. if not, perform synchronous ajax phone call create album , retrieve albumid, set in variable albumid still in beforeuplad handler, add together albumid in queryparameters : upldr.settings.url = upldr.settings.url + '&albumid=' + albumid

i guess should work, without having utilize kind of locking mechanism on albumid.

hope help.

php mysql plupload

hibernate - Get data from 3 tables using dynamic query -



hibernate - Get data from 3 tables using dynamic query -

i have 3 tables user_, usertracker, usertrackerpath

user_ has userid pk. fk in usertracker usertracker has usertrackerid pk fk in usertrackerpath , usertrackerpath has usertrackerpathid pk.

user_ tables has fields firstname, lastname, loginip, lastloginip usertracker has fields remoteaddr, remotehost usertrackerpath has fields path_, pathdate

all these fileds want.

i have written sql query , runs me, want result using dynamic query .

here sql query.

select concat(u.firstname," ",u.lastname) fullname,u.loginip,u.lastloginip,ut.remoteaddr,substring(ut.modifieddate,1,10) date,utp.path_ demo.user_ u, demo.usertracker ut, demo.usertrackerpath utp ((u.userid=ut.userid) , (ut.usertrackerid=utp.usertrackerid));

i wrote dynamic query projections confused how joining them.

//dynamic query user class dynamicquery dynamicquery_user = dynamicqueryfactoryutil.forclass(user.class,portalclassloaderutil.getclassloader()) .setprojection(projectionfactoryutil.property("userid")) .setprojection(projectionfactoryutil.property("firstname")) .setprojection(projectionfactoryutil.property("lastname")) .setprojection(projectionfactoryutil.property("loginip")) .setprojection(projectionfactoryutil.property("lastloginip")); //dynamic query user , usertracker class dynamicquery dynamicquery_usertracker = dynamicqueryfactoryutil.forclass(usertracker.class,portalclassloaderutil.getclassloader()) .setprojection(projectionfactoryutil.property("modifieddate")) .setprojection(projectionfactoryutil.property("remoteaddr")); //dynamic query usertracker , usertrackerpath dynamicquery dynamicquery_usertrackerpath = dynamicqueryfactoryutil.forclass(usertrackerpath.class,portalclassloaderutil.getclassloader()) .setprojection(projectionfactoryutil.property("path_")) .setprojection(projectionfactoryutil.property("pathdate"));

also tried..

dynamicquery_usertracker.add(propertyfactoryutil.forname("userid").in(dynamicquery_user)); dynamicquery_usertrackerpath.add(propertyfactoryutil.forname("usertrackerid").in(dynamicquery_usertracker));

i knows method incorrect. views or suggestions.

thanks.

jay think cannot joins dynamicquery api. can subqueries in , notin methods.

hibernate liferay liferay-6 dynamicquery

php - wkhtmltopdf loading multiple pages fails -



php - wkhtmltopdf loading multiple pages fails -

i using wkhtmltopdf , php library http://mikehaertl.github.com/phpwkhtmltopdf/ generate single pdf many pages. unusual thing when have 3 pages loads instantaneously. if load 4 pages acts though it's in infinite loop. loading random orders database it's not repeating orders avoid beingness order crashing it. loop through each order , phone call addpage phone call send()

foreach($orders $order_id) { $order = $this->orders_model->get_order($order_id); if(!empty($order)) { $this->wkhtmltopdf->addpage($this->template->build('invoice', array( 'order' => $order ), true)); } } $this->wkhtmltopdf->send();

i have tried removing memory limits, have tried setting timeout 0

set_time_limit(0); ini_set('memory_limit','-1');

that didn't alter anything, same result. looked in apache logs, php error logs , application's logs , cannot come conclusion why stop working 4 orders.

php wkhtmltopdf

hibernate - MySQL trigger somehow causes commit -



hibernate - MySQL trigger somehow causes commit -

we have simple auditing scheme on several tables. works fine, every 1 time in while, error on operation causes trigger fire:

java.sql.sqlexception: explicit or implicit commit not allowed in stored function or trigger.

unfortunately, cannot figure out how our triggers cause commit.

these triggers (sometimes) cause error:

create trigger `my_schema`.`filedescriptorinserttrigger` after insert on `my_schema`.`file_descriptor` each row insert `audit_event` (`applicationid`,`classifier`,`lastmodified`) values (new.application,'file_and_dir',now()) on duplicate key update lastmodified=now(); create trigger `my_schema`.`filedescriptorupdatetrigger` after update on `my_schema`.`file_descriptor` each row update `audit_event` set lastmodified=now() classifier='file_and_dir' , applicationid=new.application; create trigger `my_schema`.`filedescriptordeletetrigger` after delete on `my_schema`.`file_descriptor` each row update `audit_event` set lastmodified=now() classifier='file_and_dir' , applicationid=old.application;

edit: upon request, output of show variables '%commit%'

variable_name value innodb_commit_concurrency 0 innodb_flush_log_at_trx_commit 1

edit 2

the error tends happen after insert on my_schema.file_descriptor, narrow downwards insert trigger have no clue how cause commit.

we have hibernate on top of this, it's hibernate that's doing inserts, , have entity mapped on audit_event table, hibernate (should) never write audit_event table.

i uploaded full stacktrace if helps.

this happens because of deadlock that's why explicit commit/rollback happens. please seek handle activity. here links may help you.

http://bugs.mysql.com/bug.php?id=24989

http://lists.mysql.com/commits/27471

try utilize read-committed isolation level.

transaction-isolation = read-committed

this may resolve problem. here links reference

http://www.toofishes.net/blog/mysql-deadlocking-simple-inserts/

http://dev.mysql.com/doc/refman/5.5/en/innodb-deadlocks.html

hope help.

mysql hibernate triggers

android - Same xml but different dialog result in Gingerbrad and ICS -



android - Same xml but different dialog result in Gingerbrad and ICS -

this question: have xml file describes layout custom dialog in app. running on 2 avd gingerbread 2.3.3 , ics 4.0.3 dialog seems appear "normal" on gb , "too small" on ics.!! cant understand why happening. link image xml code is: `

<textview android:layout_height="wrap_content" android:layout_width="wrap_content" android:gravity="center" android:text="aggiungi una nuova spesa!" android:paddingbottom="5dip" android:textstyle="bold" /> <imageview android:src="@android:drawable/divider_horizontal_dim_dark" android:layout_width="wrap_content" android:layout_height="wrap_content" android:paddingbottom="10dip"/> <edittext android:id="@+id/edittoggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:hint="inserisci l'oggetto..." android:paddingtop="5dip"/> <edittext android:id="@+id/edittprezzo" android:layout_width="fill_parent" android:layout_height="wrap_content" android:inputtype="numberdecimal" android:hint="inserisci il prezzo..."/> <linearlayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:id="@+id/textvselezionacategoria" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16dip" android:paddingleft="5dip" android:paddingbottom="4.0dip" android:textstyle="bold" android:text="categoria"/> <spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/spinner_categoria"/> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:id="@+id/textvfontepagamento" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="16dip" android:paddingleft="5dip" android:paddingbottom="4.0dip" android:textstyle="bold" android:text="pagamento "/> <spinner android:layout_width="fill_parent" android:layout_height="wrap_content" android:id="@+id/spinner_aggsp"/> </linearlayout> </linearlayout> <textview android:id="@+id/textvdataoraaggiungispesa" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="20dip" android:paddingleft="5dip" android:paddingbottom="4dip" android:textstyle="bold" android:text="data: "/> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:paddingleft="5dip" android:paddingbottom="10dip"> <button android:id="@+id/calendariosmall" android:layout_width="20dip" android:layout_height="20dip" android:background="@drawable/calendario_small" android:clickable="false"/> <textview android:id="@+id/textvcambiadata" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="15dip" android:textstyle="bold" android:text="modifica\n data" android:layout_marginleft="2dip"/> <button android:id="@+id/timesmall" android:layout_width="20dip" android:layout_height="20dip" android:background="@drawable/time_small" android:clickable="false" android:layout_marginleft="10dip"/> <textview android:id="@+id/textvcambiaora" android:layout_width="wrap_content" android:layout_height="wrap_content" android:textsize="15dip" android:textstyle="bold" android:layout_marginleft="2dip" android:text="modifica\n ora"/> </linearlayout> <linearlayout android:orientation="vertical" android:background="@android:drawable/bottom_bar" android:padding="5dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightsum="1"> <button android:id="@+id/btnaggiungioggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="aggiungi" android:layout_weight="0.5"/> <button android:id="@+id/btnannullaoggetto" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="annulla" android:layout_weight="0.5"/> </linearlayout>

`

in activity phone call dialog in way:

final dialog dialog = new dialog(this); dialog.requestwindowfeature(window.feature_no_title); dialog.setcontentview(r.layout.dialogaggiungispesa); ... dialog.show();

how can resolve problem? have same dialog layout on every version of android. answers!

android android-layout android-dialog

javascript - jquery jquery-1.9.0 set div to display:none when I trying to use toggle -



javascript - jquery jquery-1.9.0 set div to display:none when I trying to use toggle -

i learning jquery reading book (very book way.)

when tutorial 5 exercise, notice jquery set display:none automatically using jquery-1.9.0. when alter lower version (eg 1.8.3 or 1.6.3), seem work well. wondering if experienced same issue? have worked out version 1.9.0?

below code. can download (http://sawmac.com/js2e/ chapter 5/complete_faq.html)

<html> <head> <meta charset="utf-8"> <title>a 1 page faq</title> <link href="../_css/site.css" rel="stylesheet"> <style type="text/css"> h2 { background: url(../_images/open.png) no-repeat 0 11px; padding: 10px 0 0 25px; cursor: pointer; } h2.close { background-image: url(../_images/close.png); } .answer { margin-left: 25px; } </style> <script src="jquery-1.9.0.js"></script> <script> $(document).ready(function () { $('.answer').hide(); $('.main h2').toggle( function () { $(this).next('.answer').slidedown(); $(this).addclass('close'); }, function () { $(this).next('.answer').fadeout(); $(this).removeclass('close'); } ); // end toggle }); // end ready </script> </head> <body> <div class="wrapper"> <div class="header"> <p class="logo">javascript <i>&</i> jquery <i class="mm">the<br> missing<br> manual</i></p> </div> <div class="content"> <div class="main"> <h1>a 1 page faq</h1> <h2>i've heard javascript long-lost fountain of youth. true?</h2> <div class="answer"> <p>why, yes is! studies prove learning javascript freshens mind , extends life span several hundred years. (note: scientists disagree these claims.)</p> </div> <h2>can javascript solve of problems?</h2> <div class="answer"> <p>why, yes can! it's versatile programming language ever created , trained provide financial management advice, life-saving cpr, , take care of household pets.</p> </div> <h2>is there nil javascript <em>can&#8217;t</em> do?</h2> <div class="answer"> <p>why, no there isn&#8217;t! it&#8217;s able write own public relations-oriented asked questions pages. that&#8217;s 1 smart programming language!</p> </div> </div> <div class="footer"> <p>javascript &amp; jquery: missing manual, <a href="http://sawmac.com/">david mcfarland</a>. published <a href="http://oreilly.com/">o'reilly media, inc</a>.</p> </div> </div> </div> </body> </html>

the .toggle() function has been deprecated in jquery 1.8 , removed in jquery 1.9.

.toggle(function, function, ... ) removed

this "click element run specified functions" signature of .toggle(). should not confused "change visibility of element" of .toggle() not deprecated. the former beingness removed cut down confusion , improve potential modularity in library. jquery migrate plugin can used restore functionality.

although, improve if stop using altogether.

javascript jquery css jquery-ui

python - Apache and Django -



python - Apache and Django -

im trying configure django site served apache.

folder layout

`-- django | `-- webtools |-- 1 |-- __init__.py |-- __init__.pyc |-- apache | `-- django.wsgi |-- macmonster | |-- __init__.py | |-- __init__.pyc | |-- models.py | |-- models.pyc | |-- tests.py | |-- views.py | `-- views.pyc |-- manage.py |-- modules | |-- __init__.py | |-- __init__.pyc | |-- macaddr.py | |-- macaddr.pyc | |-- validate.py | `-- validate.pyc |-- settings.py |-- settings.pyc |-- urls.py `-- urls.pyc

/etc/httpd/conf.d/django.conf

<virtualhost *:80 > servername direct.macmonster.co.uk wsgiscriptalias / /opt/django/webtools/apache/django.wsgi </virtualhost>

/opt/django/webtools/apache/django.wsgi

import os, sys sys.path.append('/opt/django/webtools') os.environ.setdefault("django_settings_module", "settings") import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler()

the main error im getting within logs :

templatesyntaxerror: caught importerror while rendering: no module named webtools.macmonster

thanks,

if webtools top-level package, should add together /opt/django sys.path, not /opt/django/webtools.

python django

c# - Add spacing between lowercase and uppercase? -



c# - Add spacing between lowercase and uppercase? -

i add together space when uppercase character or underscore in string.

how do this?

example 1

input

thisisaninputstring

output (result)

this input string

example 2

input

this_is_an_input_string

output (result)

this input string

you can utilize regular look matches lower case character followed upper case character, optional underscore between:

string output = regex.replace(input, "([a-z])_?([a-z])", "$1 $2");

you might want utilize handle single character words also:

string output = regex.replace(input, "(?<!^)_?([a-z])", " $1");

c# string

java - Construct a tree from edges -



java - Construct a tree from edges -

if i'm trying build tree given input 1 border per line, border represented 2 vertices connects. possible build tree using node struct/class or should represent adjacency list graph?

the main problem i'm having order of input. if i'm given 2 or more edges not @ connected @ first, have bunch of node objects no connection whereas you're given tree , inserting tree making new node kid (or parent?) of node.

if worry how store many nodes instead of 1 root node, 1 way have array of n pointers node. assume each node indexed 0 n - 1 n number of nodes in tree, can store i-th node pointer in i-th element of array.

this approach more beneficial if instead of using pointer, you'll allocate array of n nodes @ 1 time in stack (in c/c++). huge improvement in memory allocation time.

java algorithm graph tree

java - Cascade not working in hibernate properly -



java - Cascade not working in hibernate properly -

in below given code, cascade="save-update", used course of study class(bag) associated pupil class.

student class is-->

private int id; private string firstname; private string lastname; private address address; private list<course> courses;

course class is-->

private int id; private string name; private int unit;

hbm file pupil is-->

<?xml version="1.0"?> <!doctype hibernate-mapping public "-//hibernate/hibernate.mapping dtd 3.0//en" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <hibernate-mapping> <class name="pojos.student" table="student"> <id name="id" type="integer" column="id"> <generator class="increment" /> </id> <property name="firstname"> <column name="first_name" /> </property> <property name="lastname"> <column name="last_name" /> </property> <many-to-one name="address" class="pojos.address" column="address_id" cascade="save-update" /> <bag name="courses" inverse="true" cascade="save-update"> <key column="student_id" /> <one-to-many class="pojos.course" /> </bag> </class> </hibernate-mapping>

transaction i'm performing simply-->

pupil stud = new student("ketan", "dikshit"); address address = new address("dm-road", "uttar pradesh", "201301"); course of study course1 = new course("core java", 101); course of study course2 = new course("advanced java", 201); list<course> courses = new arraylist<course>(); courses.add(course1); courses.add(course2); stud.setaddress(address); stud.setcourses(courses); seek { tr = session.begintransaction(); system.out.println("\n transaction has begun..!!"); session.save(stud); tr.commit(); system.out.println("\n transaction commit..!!"); session.close(); system.out.println("\n session closed..!!"); } grab (exception e) { system.out.println("\n transaction in errror..!!"); tr.rollback(); system.out.println("\n transaction rollback..!!"); session.close(); system.out.println("\n session closed..!!"); }

now,as per code, courses table should holding column named "student_id" primary key of associated pupil nowadays each entry in course of study table.but column "student_id" not showing data( null values inserted).

the query sequence is-->

transaction has begun..!! hibernate: select max(id) pupil hibernate: select max(id) address hibernate: select max(id) course of study hibernate: insert address (street, city, zipcode, id) values (?, ?, ?, ?) hibernate: insert pupil (first_name, last_name, address_id, id) values (?, ?, ?, ?) hibernate: insert course of study (name, unit, id) values (?, ?, ?) hibernate: insert course of study (name, unit, id) values (?, ?, ?) transaction commit..!!

why column in course of study table showing null values, instead of holding id's student??

remove inverse="true" handbag mapping otherwise owner of relation course of study , not student.

java mysql hibernate hbm

arrays - How to search for HTML tags in multilpe strings with PHP? -



arrays - How to search for HTML tags in multilpe strings with PHP? -

can utilize strpos() searching html tags? seems produce invalid results. tried converting htmlentities() -- still no luck. how can search text decorations like: bold, italics, , underline?

example: (demo)

/* html tags search for. */ $html_tags = array( 'bold' => array( 'before' => '<strong>', 'after' => '</strong>' ), 'italics' => array( 'before' => '<em>', 'after' => '</em>' ), 'underline' => array( 'before' => '<span style="text-decoration: underline;">', 'after' => '</span>' ) ); /* sample strings... */ $html_test = array( 'bold_with_html' => '<strong>some string containing html tags.</strong>', 'italics_with_html' => '<em>some string containing html tags.</em>', 'underline_with_html' => '<span style="text-decoration: underline;">some string containing html tags.</span>', 'without_html' => 'some string containing no html tags.' ); /* check html tags. */ $results = array(); foreach($html_test $key => $value){ foreach($html_tags $decoration => $html_tag){ if(stripos($html_tag['before'], $value) !== false && strripos($html_tag['after'], $value) !== false){ $results[$key][$decoration] = 'located html: '.$decoration.'!'; } else{ $results[$key][$decoration] = 'no html located.'; } } } print_r($results);

you got order of parameters wrong stripos, should haystack, needle...

if(stripos($value,$html_tag['before']) !== false && strripos($value,$html_tag['after']) !== false){

php arrays loops string-search

sqlite - Non-Unique Index on sqllite database table in phonegap -



sqlite - Non-Unique Index on sqllite database table in phonegap -

i using phonegap default database. reading documentation, not mention indexes on database tables (aka primary key, unique index, or index). http://docs.phonegap.com/en/1.2.0/phonegap_storage_storage.md.html

but when @ illustration code: http://www.raymondcamden.com/index.cfm/2011/10/20/example-of-phonegaps-database-support

i can see ray uses "primary key".

my 3 questions are:

is there definitive guide sql syntax supported in phonegap? are non-primary key indexes supported in phonegap? assuming #2, appropriately placed indexes speed code (or keywords read , ignored)?

for practical purposes, phonegap implementations utilize sqlite, can utilize everything supported sqlite.

sqlite cordova

cordova - PhoneGap build webkit-appearance no drop down arrow for select tag -



cordova - PhoneGap build webkit-appearance no drop down arrow for select tag -

i'm using phonegap build , select tags have no dropdown arrow on phone. tried applying -webkit-appearance: menulist; doesn't help, tried other choices still shows alternative no drop downwards arrow.

it issue phonegap because same code shows dropdown arrow on native browser on android phone.

only 1 time utilize phonegap build arrow disappear. solutions?

the android browser's rendering of <select>s buggy , remove normal styling if background or border applied.

since <select>s not looking <select>s pretty big usability issue, best bet not style them browser only.

unfortunately, there's no pure css way of selecting/excluding android browser, recommend utilize layout engine (https://github.com/stowball/layout-engine), add together class of .browser-android <html> tag.

you style <select>s except on android browser, so:

html:not(.browser-android) select { background: #0f0; border: 1px solid #ff0; }

select cordova drop-down-menu build arrow

servlets - Is it possible to change the base url in angular? -



servlets - Is it possible to change the base url in angular? -

i writing web app java servlet end , checking out angular front end end. since address specific resource within servlet depends on servlet context placed in, wondering if possible alter base of operations url angular functions.

example: if create link in webapp <a href='/newaccount'>create new account</a> , configure route provider accordingly $routeprovider.when('/newaccount', ... want work no matter servlet context servlet placed in. if place servlet in context called "mycontext" actual url resource [hostname]/mycontext/newaccount.

can somehow setup angular , pass in context name prepended locations , configured routes? way servlet placed in different contexts , still work.

actually there 2 routing - 1 on backend , 1 on frontend. aren't missing them?

when you're configuring $routeprovider in angularjs, you're configuring client-side routing, urls kind of [hostname]/anypath/yourpage/#/newaccount (if you're using hashbang mode, default in angularjs).

but of course of study can alter base. plunker, illustration utilize way:

<script> document.write('<base href="' + document.location + '" />'); </script>

more information, including html5 , hashbang mode can find here: http://docs.angularjs.org/guide/dev_guide.services.$location (there note <base> , html link rewriting)

servlets angularjs

import - LESS strictImports -



import - LESS strictImports -

i have build compiles several less files (all imported 1 master.less file). 1 of options build strictimports suggests forces evaluation of imports. know if have operations in imported files, or missing point?

the strictimports controls whether compiler allow @import inside of either @media blocks or (a later addition) other selector blocks. see of comments this closed issue regards that.

so set true these not allowed:

@media screen { @import somefile.less; } .myselector { @import somefile.less; }

import less

css - JavaScript Isotope- How to manage dynamic data set (re-initialize Isotope) -



css - JavaScript Isotope- How to manage dynamic data set (re-initialize Isotope) -

i want design website shows simple search results isotope appearance. have text input , query user , retrieve search results server. so, changing query, info , filtering options change. don't know how manage dynamic info isotope.

after each query , info change, when set new isotope properties , filters in $container.isotope, info blocks become invisible , isotope functions, animation , filtering, didn't work anymore.

does know how manage dynamic info set isotope? , how re-set (re-initialize) isotope settings after changing of info set (data blocks)?

thanks in advance.

i found reply myself! can utilize insert , remove function of isotope. http://isotope.metafizzy.co/docs/adding-items.html

javascript css dynamic jquery-isotope

javascript - Flexslider 100% width creates horizontal scroll-bar -



javascript - Flexslider 100% width creates horizontal scroll-bar -

http://dl.dropbox.com/u/29703851/js/demo/index.html

this demonstration.

i want utilize flexslider 100% width, unusual additional width , horizontal scroll-bar when mouse cursor outside of flexslider.

when go on flexslider, horizontal scroll disappears. advices?

i utilize demo code, no css changes, no js changed. deleted divs around, , left 1 div class flexslider.

is there proper way 100% width?

problem fixed me overflow: hidden; in .flexslider

javascript jquery html css flexslider

ruby on rails - Routing Test Fails with Matched Route -



ruby on rails - Routing Test Fails with Matched Route -

i have line of code in routes

namespace :api, defaults: {format: 'json'} namespace :v1 match '/auth/:provider/callback', to: 'sign_in#authenticate' end end

and test as

require 'spec_helper' describe "routing" "should route sign_in#authenticate" expect(post: 'api/v1/auth/:provider/callback').to route_to({ controller: 'api/v1/sign_in', action: 'authenticate', format: 'json' }) end end

however, no matter maintain getting error

no route matches "/api/v1/auth/:provider/callback"

what missing here in order create test pass?

i believe error you're getting because match defaults request, testing post request in spec. should able prepare issue changing route to:

match '/auth/:provider/callback', to: 'sign_in#authenticate', via: :post

my personal preference utilize post method instead of match, reads improve me:

post '/auth/:provider/callback' => 'sign_in#authenticate'

ruby-on-rails ruby-on-rails-3 rspec routes omniauth

iphone - Error while trying to login using facebook Scrumptious -



iphone - Error while trying to login using facebook Scrumptious -

while trying login using facebook scrumptious, showing next error, should want facebook id?

2013-02-16 14:23:21.283 roulocalapp[2378:c07] application tried force nil view controller on target <uinavigationcontroller: 0x945b180>. 2013-02-16 14:23:21.288 roulocalapp[2378:c07] *** terminating app due uncaught exception 'com.facebook.sdk:invalidoperationexception', reason: 'fbsession: no appid provided; either pass appid init, or add together string valued key appropriate id named facebookappid bundle *.plist'

follow these steps prepare issue:

open project in xcode.

find yourprojectname.plist file in supported files.

add entry called 'facebookappid' , set value 'fb12786126112789' (use app id preceded 'fb')

add url types, create sure dictionary, @ item 0, add together 'url schemes' , add together string in should app id - similar 'fb12786126112789' (make sure should start fb').

iphone facebook ios6

f# - Missing targeting pack for ".NETFramework,Version=v4.0,Profile=Profile47" -



f# - Missing targeting pack for ".NETFramework,Version=v4.0,Profile=Profile47" -

i've been having problems when trying compile portable version of fsharp.core f# source code.

to help this, created project files able open within visual studio instead of having utilize next command:

msbuild fsharp-library-build.proj /p:targetframework=portable-net4+sl4+wp71+win8

when open fsharp.core.portable.sln here, weird error:

there no such targeting pack vs2012, it's supposed come out of box.

i had issue recently. turned out importing wrong targets file @ bottom of project.

to work, replaced this:

<import project="$(msbuildextensionspath32)\..\microsoft sdks\f#\3.0\framework\v4.0\microsoft.portable.fsharp.targets" />

f# visual-studio-2012 portable-class-library

c# - Error inserting date values into database -



c# - Error inserting date values into database -

i having weird problem inserting date value database. when debugging program, realized inserts first 5 rows database on 6th throws exception. verified if syntax error or if changed along way checking first 5 queries execute 6th , both same. if there problem type, should throw exception beginning. think?

this error get

the conversion of char info type datetime info type resulted in out-of-range datetime value.

the conversion of char info type datetime info type resulted in out-of-range datetime value.

that suggests you're specifying value string, , performing conversion. don't that. avoid string conversions wherever perchance can. (i suspect there's quite perchance disconnect between string format you're providing , 1 that's beingness used parsing. removing string conversion best prepare this.)

instead, provide value sqlparameter datetime value.

c# sql sql-server visual-studio-2010

php - simplexml-load-file : failed to open stream: Redirection limit reached -



php - simplexml-load-file : failed to open stream: Redirection limit reached -

i trying open xml file these errors :

warning: simplexml_load_file(http://www.bva.fr/fr/rss/sondages.xml) [function.simplexml-load-file]: failed open stream: redirection limit reached, aborting in /xxx/import.php on line 93 warning: simplexml_load_file() [function.simplexml-load-file]: i/o warning : failed load external entity "http://www.bva.fr/fr/rss/sondages.xml" in /xxx/import.php on line 93 notice: trying property of non-object in /xxx/import.php on line 99 warning: invalid argument supplied foreach() in /xxx/import.php on line 99

line 99 :

foreach($xml->channel->item $item)

i tried :

$xml = simplexml_load_file($url);

and :

$curl = curl_init(); curl_setopt($curl, curlopt_url, $url); curl_setopt($curl, curlopt_returntransfer, true); curl_setopt($curl, curlopt_followlocation, true); $content = curl_exec($curl); curl_close($curl); $xml = simplexml_load_string($content);

but still doesn't work...

here xml file : http://www.bva.fr/fr/rss/sondages.xml

could please help me ?

you maybe seek add together complementary curl options : here finish illustration ok rss site.

$options = array( curlopt_returntransfer => true, // homecoming web page curlopt_header => false, // don't homecoming headers curlopt_followlocation => true, // follow redirects curlopt_encoding => "", // handle encodings curlopt_useragent => "mozilla/5.0 (windows nt 6.1; wow64; rv:18.0) gecko/20100101 firefox/18.0", // firefox curlopt_autoreferer => true, // set referer on redirect curlopt_connecttimeout => 120, // timeout on connect curlopt_timeout => 120, // timeout on response curlopt_maxredirs => 10, // stop after 10 redirects );

replace curl_setopt($curl, curlopt_url, $url); curl_setopt_array( $curl, $options ); in example.

php curl simplexml

oracle11g - Cannot update Oracle view from JDBC -



oracle11g - Cannot update Oracle view from JDBC -

overview: need read row oracle view , create notes document, save document, write document unique id oracle.

i able read connect , read info no problem. using type 4 connection connecting oracle 11 database. oracle view setup allow updating. view has nil in outline here: in oracle, possible insert or update record through view?

*with same username , password, able update view typing in sql statement.

*tried using conn.setautocommit(false); had no effect.

*verified result set updatable (1008)

*user has been given total dba access (temporarily)

*i have tried every possible combination of first parameter in createstatement method

... statement statement = conn.createstatement(resultset.type_forward_only, resultset.concur_updatable); resultset rs = statement.executequery(fetch); ... string unid = doc.getuniversalid(); //gets unique id saved notes document system.out.println("this write oracle:" + unid); system.out.println("is updatable=1008, not updatable=1007 value is:" + rs.getconcurrency()); system.out.println("is result set closed:" + rs.isclosed()); rs.updatestring("notes_doc_id", unid); system.out.println("got past updating notes_doc_id column"); rs.updaterow(); //fails here

here error console:

this write oracle:bf8091259610c61b87257b16005c14fb

is updatable=1008, not updatable=1007 value is:1008

is result set closed:false

got past updating notes_doc_id column

java.security.accesscontrolexception: access denied (java.lang.runtimepermission exitvm.0)

prior asking user have dba access

java.sql.sqlsyntaxerrorexception: ora-01031: insufficient privileges

i think big clue. dba doesn't know farther access give me.

the dba wanting me start using ref cursors, fine, suspect there kind of security setting jdbc access tripping me up, , want explore first. if there security issue, don't think changing way read rows going create difference. of documentation on how obtained oracle's website, site.

i going reply question , explain how got past roadblock. in end, did 'a_horse_with_no_name' suggested.

instead of using resultset cursor or ref cursor perform update, able utilize plain update statement. possible, because able convince dba create column unique identifier. never around exceptions caused updaterow() method of resultset. prior him adding unique identifier, there not key in reliably utilize update statement.

here code updatesql string holding update sql statement:

updateresultint = updatestatement.executeupdate(updatesql);

it returns 1 if successful.

one word of caution, if using tools tora or sql plus check update statements, have remember manually commit them. if don't java agent hang when trying run it. here reference helped me issue: sql update hangs java program

thanks commented!

jdbc oracle11g lotus-domino

ruby - How i can dry this code rather than put many conditions -



ruby - How i can dry this code rather than put many conditions -

i'm using ror , in controller function recived params , base of operations of these params need perform action according condition. see these 18 conditions.

how can dry code.

if params[:topic] == "topic (title)" , params[:sort] == "date (asc)" # custom code elsif params[:topic] == "topic (title)" , params[:sort] == "date (desc)" # custom code elsif params[:topic] == "topic (title)" , params[:sort] == "topic (asc)" # custom code elsif params[:topic] == "topic (title)" , params[:sort] == "topic (desc)" # custom code elsif params[:topic] == "topic (title)" , params[:sort] == "author (asc)" # custom code elsif params[:topic] == "topic (title)" , params[:sort] == "author (desc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "date (asc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "date (desc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "topic (asc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "topic (desc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "author (asc)" # custom code elsif params[:topic] == "post (body)" , params[:sort] == "author (desc)" # custom code elsif params[:topic] == "author" , params[:sort] == "date (asc)" # custom code elsif params[:topic] == "author" , params[:sort] == "date (desc)" # custom code elsif params[:topic] == "author" , params[:sort] == "topic (asc)" # custom code elsif params[:topic] == "author" , params[:sort] == "topic (desc)" # custom code elsif params[:topic] == "author" , params[:sort] == "author (asc)" # custom code elsif params[:topic] == "author" , params[:sort] == "author (desc)" # custom code end

many many thanks

if code legitimately different, consider case statement:

case [params[:topic], params[:sort]] when ["topic (title)", "date (asc)"] # custom code when ["topic (title)", "date (desc)"] # custom code when ["topic (title)", "topic (asc)"] # custom code when ["topic (title)", "topic (desc)"] # custom code when ["topic (title)", "author (asc)"] # custom code when ["topic (title)", "author (desc)"] # custom code when ["post (body)", "date (asc)"] # custom code when ["post (body)", "date (desc)"] # custom code when ["post (body)", "topic (asc)"] # custom code when ["post (body)", "topic (desc)"] # custom code when ["post (body)", "author (asc)"] # custom code when ["post (body)", "author (desc)"] # custom code when ["author", "date (asc)"] # custom code when ["author", "date (desc)"] # custom code when ["author", "topic (asc)"] # custom code when ["author", "topic (desc)"] # custom code when ["author", "author (asc)"] # custom code when ["author", "author (desc)"] # custom code end

if there repetition in code, or wind using case statement in multiple locations, there improve ways this.

ruby

algorithm : what's the relationship between k and n? -



algorithm : what's the relationship between k and n? -

to calculate value of a^n:

method1:

result = 1; for(int = 1; <=n; i++) result *= a;

if improved using method2:

result = a; for(int = 1; <=k; i++) result = result * result;

how can deduce relationship between k , n? , why? thanks!

in first case result = a^n, in sec case result = a^(2^k), 2^k = n , k = logn. of course of study right n powers of 2.

algorithm

jQuery ajax cross-domain request -



jQuery ajax cross-domain request -

i trying create ajax request using jquery local environment.

$.ajax({ url: requesturl, datatype: "json", timeout: 120000, success: function(data){ // }, error: function(xmlhttprequest, textstatus, errorthrown){ console.log("instants.loadgame: error loading games: error text: " + textstatus + "; error thrown: " + errorthrown); } });

i have tried using datatype json , jsonp (as else seems fixes problem) errors either way. datatype json error response has textstatus = "error" , errorthrown empty. datatype jsonp error response has textstatus = "parsererror" , errorthrown = "jquery19002007321439859855_1361446807440 not called".

i know code works when running on same domain request url can assume because doing on local environment. have set cross-domain.xml allow everything. using jquery 1.9.0.

does have ideas? have been looking @ lot online none of solutions helped other people seem work me...

thanks, heather

when error "jquery19002007321439859855_1361446807440 not called" it's because it's not right jsonp response. when using jsonp server need javascript (an actual script) , script needs phone call function provided part of url (in case funciton named jquery19002007321439859855_1361446807440 jquery maps success handler provided.

most cause server returned plain json info won't work. info need passed script. request server should homecoming like

var info = {"foo":1}; //your info here jquery19002007321439859855_1361446807440(data);

jquery ajax json cross-domain jsonp

utf 8 - Scala - Converting from ISO-8859-1 to UTF-8 gives foreign character strangeness -



utf 8 - Scala - Converting from ISO-8859-1 to UTF-8 gives foreign character strangeness -

here's problem; have inputstream i've converted byte array, don't know character set of inputstream @ runtime. original thought in utf-8, see unusual issues streams encoded iso-8859-1 , have foreign characters. (those crazy swedes)

here's code in question:

ioutils.tostring(inputstream, "utf-8") // fails on iso8859-1 foreign characters

to simulate this, have:

new string("\u00f6") // returns ö expected, since default encoding utf-8 new string("\u00f6".getbytes("utf-8"), "utf-8") // returns ö expected. new string("\u00f6".getbytes("iso-8859-1"), "utf-8") // returns \uffff, unknown character

what missing?

you should have source of info telling encoding, if cannot happen either need reject or guess encoding if it's not utf-8.

for western languages, guessing iso-8859-1 if it's not utf-8 going work of time:

bytebuffer bytes = bytebuffer.wrap(ioutils.tobytearray(inputstream)); charbuffer chars; seek { seek { chars = charset.forname("utf-8").newdecoder().decode(bytes); } grab (malformedinputexception e) { throw new runtimeexception(e); } grab (unmappablecharacterexception e) { throw new runtimeexception(e); } grab (charactercodingexception e) { throw new runtimeexception(e); } } grab (runtimeexception e) { chars = charset.forname("iso-8859-1").newdecoder().decode(bytes); } system.out.println(chars.tostring());

all boilerplate getting encoding exceptions , beingness able read same info multiple times.

you can utilize mozilla chardet uses more sophisticated heuristics determine encoding if it's not utf-8. it's not perfect, instance recall detecting finnish text in windows-1252 hebrew windows-1255.

also note arbitrary binary info valid in iso-8859-1 why observe utf-8 first (it extremely if passes utf-8 without exceptions, utf-8) , why cannot seek observe else after iso-8859-1.

scala utf-8 character-encoding iso-8859-1

python flask before_request exclude /static directory -



python flask before_request exclude /static directory -

thanks reply below, have before_request function redirects user /login if have not yet logged in:

flask before request - add together exception specific route

here re-create of before_request:

@app.before_request def before_request(): if 'logged_in' not in session , request.endpoint != 'login': homecoming redirect(url_for('login'))

files in static directory not beingness served unless user logged in.

on /login page sourcing css file /static directory can not loaded because of before_request.

i have deployed application using apache mod_wsgi , in apache configuration file have included /static directory site's documentroot.

how can add together exception serve application's /static files without user logging in, still utilize before_request routes defined flask application?

you'll need add together alias or aliasmatch directive apache config file (or .htaccess file, should not have access .conf files) ensure apache serves static files, rather flask. create sure have provided directory allow apache web server access static path. (also, don't forget restart apache if editing .conf files changes picked up).

as temporary stop-gap measure (or create easy work in development) check create sure string /static/ not in request.path:

if 'logged_in' not in session \ , request.endpoint != 'login' \ , '/static/' not in request.path:

python flask mod-wsgi

xml - PHP working with XMLReader with HUGE data source -



xml - PHP working with XMLReader with HUGE data source -

i need parse ginormous info source (14.9m lines of xml, 1.7gb).

i having problems working xmlreader this. haven't before needed simplexml, given can't load whopper memory need via stream.

i have written code:

<?php $xml = new xmlreader(); $xml->open('public.xml'); while($xml->read()) { echo '.'; } $xml->close(); ?>

but having issues execution. namely, "fatal error: maximum execution time of 30 seconds exceeded..."

when set_time_limit(600) browser crashes.

it crashing because can't handle number of "." created?

what recommend here? ultimately, need xml file relational database. testing feasibility before detail of schema.

it crashing because can't handle number of "." created?

to test seek without echo '.';. need lot of ram increment maximal memory script can use. split xml file in smaller parts , process them sequentially.

eventually at:

parsing huge xml files in php best way process big xml in php how utilize php parse big xml file sequentially

php xml xmlreader

python - Pymongo MongoClient: if you put a database in via URI, how do you get it back out? -



python - Pymongo MongoClient: if you put a database in via URI, how do you get it back out? -

the documentation mongoclient says 1 may 'host=' , give total mongodb uri. include database name. 1 time that, there way extract db name mongoclient object? i'm failing spot in source code.

i believe looking can found in pymongo.uri_parser. in particular, @ parse_uri function. parse_uri takes mongodb uri argument , returns dictionary containing values such username, password and, importantly, database.

example:

from pymongo.uri_parser import parse_uri mongo_uri = 'mongodb://james:brewer@localhost/test' k, v in parse_uri(mongo_uri).items(): print k, ':', v

will print

username : james nodelist : [('localhost', 27017)] database : test connection : none password : brewer options : {}

hope helps!

python mongodb

java - Why can't my maven find the stripe library? -



java - Why can't my maven find the stripe library? -

using intellij can see bundle in external libraries, when build using maven below issue:

when running:

mvn clean bundle

i error:

failure find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced

where version is:

<stripe-version>1.1.16</stripe-version>

i tried 1.1.13 , 1.1.14 , same error.

when running -e switch get:

failure find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced @ org.apache.maven.project.defaultprojectdependenciesresolver.resolve(defaultprojectdependenciesresolver.java:170) @ org.apache.maven.lifecycle.internal.lifecycledependencyresolver.getdependencies(lifecycledependencyresolver.java:171) ... 22 more caused by: org.sonatype.aether.resolution.dependencyresolutionexception: failure find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced @ org.sonatype.aether.impl.internal.defaultrepositorysystem.resolvedependencies(defaultrepositorysystem.java:412) @ org.apache.maven.project.defaultprojectdependenciesresolver.resolve(defaultprojectdependenciesresolver.java:164) ... 23 more caused by: org.sonatype.aether.resolution.artifactresolutionexception: failure find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced @ org.sonatype.aether.impl.internal.defaultartifactresolver.resolve(defaultartifactresolver.java:541) @ org.sonatype.aether.impl.internal.defaultartifactresolver.resolveartifacts(defaultartifactresolver.java:220) @ org.sonatype.aether.impl.internal.defaultrepositorysystem.resolvedependencies(defaultrepositorysystem.java:395) ... 24 more caused by: org.sonatype.aether.transfer.artifactnotfoundexception: failure find com.stripe:stripe-java:jar:${stripe-version} in http://repo1.maven.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or updates forced @ org.sonatype.aether.impl.internal.defaultupdatecheckmanager.checkartifact(defaultupdatecheckmanager.java:190) @ org.sonatype.aether.impl.internal.defaultartifactresolver.resolve(defaultartifactresolver.java:430) ... 26 more

i can see versions here: http://search.maven.org/#browse%7c788949441

the dependency downloads fine:

<dependency> <groupid>com.stripe</groupid> <artifactid>stripe-java</artifactid> <version>1.1.16</version> </dependency>

seems have problem defining / using stripe version property:

<properties> <stripe.version>1.1.16</stripe.version> </properties> <!--- ... --> <version>${stripe.version}</version>

java maven intellij-idea

javascript - JQuery Mobile Full Site Redirect -



javascript - JQuery Mobile Full Site Redirect -

i'm trying quite simple mobile site: adding total site redirection button. mobile site stored in m directory, root /m, while redirect link goes directory root/index.php.

the actual button is:

<a data-role="button" data-theme="a" href="http://www.mysite.com?m=desktop" data-icon="home" data-iconpos="left"> total site </a>

however, problem when link pressed, jquery mobile reformats on index.php page , adds things

<html class="ui-mobile">.

i can't seem find else having issues reason. know how disable links , enable others?

thanks.

add rel="external" attribute button this:

<a data-role="button" data-theme="a" href="http://www.mysite.com?m=desktop" data-icon="home" data-iconpos="left" rel="external"> total site </a>

this forcefulness open new url without loading current dom structure.

javascript jquery-mobile redirect mobile

sql - How to copy in field if query returns it blank? -



sql - How to copy in field if query returns it blank? -

i writing query 2 different tables.

table , table b

here query.

select a.out_num, a.timestamp, a.last_name, a.event_type, a.comments, b.name tablea left outer bring together tableb b on a.feed_id = b.id a.out_num = '12345' , a.event_type in ('cause','status')

b.name not null when event_type = xyz else null

i want see when event_type in ('cause','status') want see name field not empty.

second table trying achieve.

thanks

making assumptions info in comments, particularly how match , pick substitute name value; , dummy info think matches yours:

create table tablea(out_num number, equip_name varchar2(5), event_type varchar2(10), comments varchar2(10), timestamp date, feed_id number); create table tableb(id number, name varchar2(10)); alter session set nls_date_format = 'mm/dd/yyyy hh24:mi'; insert tablea values (12345, null, 'abcd', null, to_date('02/11/2013 11:12'), 1); insert tablea values (12345, null, 'abcd', null, to_date('02/11/2013 11:11'), 1); insert tablea values (12345, null, 'abcd', null, to_date('02/11/2013 11:06'), 1); insert tablea values (12345, null, 'abcd', null, to_date('02/11/2013 11:06'), 1); insert tablea values (12345, null, 'sub', null, to_date('02/11/2013 11:11'), 2); insert tablea values (12345, null, 'sub', null, to_date('02/11/2013 11:12'), 2); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:13'), 3); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:13'), 3); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:13'), 3); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:13'), 3); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:13'), 3); insert tablea values (12345, null, 'xyz', null, to_date('02/11/2013 11:03'), 3); insert tablea values (12345, null, 'cause', 'apple', to_date('02/11/2013 11:13'), 4); insert tablea values (12345, null, 'cause', 'apple', to_date('02/11/2013 11:13'), 4); insert tablea values (12345, null, 'cause', 'apple', to_date('02/11/2013 11:13'), 4); insert tablea values (12345, null, 'status', 'books', to_date('02/11/2013 11:13'), 5); insert tablea values (12345, null, 'status', 'books', to_date('02/11/2013 11:13'), 5); insert tablea values (12345, null, 'status', 'books', to_date('02/11/2013 11:03'), 5); insert tableb values(3, 'lion');

this gets result:

select * ( select a.out_num, a.timestamp, a.equip_name, a.event_type, a.comments, coalesce(b.name, first_value(b.name) on (partition a.out_num order b.name nulls last)) name tablea left outer bring together tableb b on a.feed_id = b.id a.out_num = '12345' , a.event_type in ('cause', 'status', 'xyz') ) event_type in ('cause', 'status'); out_num timestamp equip_name event_type comments name ---------- ------------------ ---------- ---------- ---------- ---------- 12345 02/11/2013 11:03 status books lion 12345 02/11/2013 11:13 status books lion 12345 02/11/2013 11:13 status books lion 12345 02/11/2013 11:13 cause apple lion 12345 02/11/2013 11:13 cause apple lion 12345 02/11/2013 11:13 cause apple lion

the inner query includes xyz , uses analytic first_value() function pick name if straight matched value null - coalesce may not necessary if there never direct match. (you might need adjust partition by or order by clauses if assumptions wrong). outer query strips out xyz records since don't want those.

if want name value matching record remove filter in inner query.

but you're perhaps more have more 1 non-null record; give 1 matches a.feed_id if exists, or 'first' 1 (alphabetically, ish) out_num if doesn't. order b.id instead, or other column in tableb; ordering in tablea need different solution. if you'll have 1 possible match anyway doesn't matter , can leave out order by, though it's improve have anyway.

if add together more info different out_num:

insert tablea values (12346, null, 'abcd', null, to_date('02/11/2013 11:11'), 1); insert tablea values (12346, null, 'sub', null, to_date('02/11/2013 11:12'), 2); insert tablea values (12346, null, 'xyz', null, to_date('02/11/2013 11:13'), 6); insert tablea values (12346, null, 'cause', 'apple', to_date('02/11/2013 11:14'), 4); insert tablea values (12346, null, 'status', 'books', to_date('02/11/2013 11:15'), 5); insert tableb values(1, 'tiger');

...then - has filter dropped, , i've left out coalesce time - gives same reply 12345, , 12346:

select * ( select a.out_num, a.timestamp, a.equip_name, a.event_type, a.comments, first_value(b.name) on (partition a.out_num order b.name nulls last) name tablea left outer bring together tableb b on a.feed_id = b.id ) out_num = '12346' , event_type in ('cause', 'status'); out_num timestamp equip_name event_type comments name ---------- ------------------ ---------- ---------- ---------- ---------- 12346 02/11/2013 11:14 cause apple tiger 12346 02/11/2013 11:15 status books tiger

... tiger linked abcd, not xyz.

sql oracle oracle11g

tfs sdk - Get the Installed TFS Server version from TFS API (Is it 2010 or 2012?) -



tfs sdk - Get the Installed TFS Server version from TFS API (Is it 2010 or 2012?) -

i have wcf service calls both tfs 2010 , 2012 instances. i'm looking way distinguish between 2010 , 2012 in api, there doesn't seem getserverversion() or similar api.

the reason there slight changes in way 2010 , 2012 handle work item links:

work item links in 2010: http://tfsuri/web/wi.aspx?id=workitemid

work item links in 2012: http://tfsuri/tfsproject/_workitems/edit/workitemid

worst case can create people select version, i'd prefer automatically distinguish 2010 vs. 2012 if possible.

you can utilize ibuildserver interface build.client version of server.

teamfoundationserver tfs = new teamfoundationserver(@"http://yourtfs:8080/tfs"); ibuildserver tfsb = tfs.getservice<ibuildserver>(); console.writeline(tfsb.buildserverversion); //v3 2010 , v4 2012

tfs tfs-sdk

jquery - processing performance - fadeTo() vs css opacity -



jquery - processing performance - fadeTo() vs css opacity -

i have experimented repetitive event animated these functions:

jquery animation effect: fadeto(1000,1); $('#foo').on('click', function(){ $('#bar').css({"opacity":1});

when repeat toggling event 1 time again , again, seems event getting gradually slower.

i took in task manager in chrome well, however, quite hard see gpu comsumption different.

do have thought 1 perform faster?

after running jsperf, seems, suspected, fadeto significantly slower.

in fact, me, 56% slower:

here's test created, can run yourself: http://jsperf.com/fadeto-vs-css-opacity

jquery html css

inheritance - How to create an empty superclass with unknown subclasses for Doctrine in Symfony? -



inheritance - How to create an empty superclass with unknown subclasses for Doctrine in Symfony? -

as far understand if want utilize inheritance doctrine requires list subclasses in supperclass mapping information.

the manual states:

/** * @entity * @inheritancetype("single_table") * @discriminatorcolumn(name="discr", type="string") * @discriminatormap({"person" = "person", "employee" = "employee"}) */ class person { // ... }

the @inheritancetype, @discriminatorcolumn , @discriminatormap must specified on topmost class part of mapped entity hierarchy.

as i'm developing symfony bundle reused multiple applications, major problem. i'd provide super classes can extended applications. means subclasses not known @ time implement superclass.

question creating portable bundles extendable entities in symfony2 addressing same problem.

the question here is: what options have come around limitation?

on of areas i'm having need order. application should have possibility implement it's own order item subtypes. came solution, requires lot of classes inheritance.

i'd happy see better/shorter solutions.

inheritance symfony2 doctrine2

build - makefile, multiple inputs, one output. keeping fresh state. possible? -



build - makefile, multiple inputs, one output. keeping fresh state. possible? -

i have 1 target takes several input files , generate one.

right i'm ignoring freshness state of input files , running .phony

file.out: $(cmd) input/* file.out

i'd have like:

file.out: $(wildcard input/*) $(cmd) $^ $@

...so create not run cmd every time input haven't changed.

remove .phony target.

cmd := cat file.out: $(wildcard input/*) $(cmd) $^ > $@

build makefile make wildcard gnu-make

sql server 2008 r2 - Sqlcmd Error: Sqlcmd: The -E and the -U/-P options are mutually exclusive -



sql server 2008 r2 - Sqlcmd Error: Sqlcmd: The -E and the -U/-P options are mutually exclusive -

i trying execute several sql files located in folder executing [main.bat] contains below mentioned command-

for %%g in (*.sql) sqlcmd /s [server] /d [database name] -u [username] -p [password] -e -i"%%g" pause

but facing issue-

sqlcmd: -e , -u/-p options mutually exclusive.

any suggestion?

sql-server-2008-r2 sqlcmd

Subtypes in java -



Subtypes in java -

if have 4 distinct java types (call them a b c d), , a subtype of b , a subtype of c , b subtype of d , c subtype of d, legal? there examples out there?

drawing diagram:

d | | | | b c | | | |

so d supertype. thanks!

this not legal inheritance, java language not back upwards multiple inheritance.

however can implementing multiple interfaces, different thing multiple inheritance.

so yes it's possible , far can check if instance of interface not same class type, , diagram tad different 1 have drawn.

java subtype

facebook - How to Update status in Social Auth share Android -



facebook - How to Update status in Social Auth share Android -

i using social auth social network integration integrating facebook, twitter , linkedin. update status post in social network sites programicaly hardcoded.

as new android programming, help me........

i need code update status feature....for ex. when click on facebook , should inquire me status update, , post message in respective social network

my code follows

bundle org.brickred.socialbar; import org.brickred.socialauth.android.dialoglistener; import org.brickred.socialauth.android.socialautherror; import org.brickred.socialauth.android.socialauthadapter; import org.brickred.socialauth.android.socialauthadapter.provider; import android.app.activity; import android.os.bundle; import android.util.log; import android.widget.linearlayout; import android.widget.textview; import android.widget.toast; public class sharebaractivity extends activity { // socialauth component socialauthadapter adapter; boolean status; @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); linearlayout bar = (linearlayout)findviewbyid(r.id.linearbar); // add together bar library adapter = new socialauthadapter(new responselistener()); // add together providers adapter.addprovider(provider.facebook, r.drawable.facebook); adapter.addprovider(provider.twitter, r.drawable.twitter); adapter.addprovider(provider.linkedin, r.drawable.linkedin); adapter.enable(bar); // set size of dialog adapter.setdialogsize(30,60); } /** * listens response library * */ private final class responselistener implements dialoglistener { public void oncomplete(bundle values) { // variable receive message status log.d("sharebar" , "authentication successful"); // name of provider after authentication string providername = values.getstring(socialauthadapter.provider); log.d("sharebar", "provider name = " + providername); // please avoid sending duplicate message. social media providers block duplicate messages. adapter.updatestatus("test api"); toast.maketext(sharebaractivity.this, "message posted on " + providername, toast.length_short).show(); } public void onerror(socialautherror error) { error.printstacktrace(); log.d("sharebar" , error.getmessage()); } public void oncancel() { log.d("sharebar" , "authentication cancelled"); } }

}

android facebook twitter share linkedin

Remove duplicate values from PHP array preferring text keys -



Remove duplicate values from PHP array preferring text keys -

when retrieve results database query in php, receive duplicated values, ones integer, , 1 has column name. array_unique(), in sorting array, in cases end numeric key before string, meaning key kept. right now, utilize function removes array numeric key, don't care approach. have improve way this?

change command utilize retrieve values database (eg. mysql_fetch_assoc instead of mysql_fetch_array). no matter api utilize now, there alternative want.

update:

in pdo write:

$nonumindexes = $res->fetch(pdo::fetch_assoc);

php

android - Not able to get input from the custom fragment dialog -



android - Not able to get input from the custom fragment dialog -

i displaying custom dialog user input on top of list view activity layout. when seek refer edit text in oncreatedialog() method, coming blank. below code, appreciate if can point out doing wrong -

public class questiondialog extends dialogfragment { public dialog oncreatedialog(bundle savedinstancestate) { alertdialog.builder builder = new alertdialog.builder(getactivity()); // layout inflater layoutinflater inflater = getactivity().getlayoutinflater(); // inflate , set layout dialog final view v =inflater.inflate(r.layout.ques_dialog,null); builder.setview(inflater.inflate(r.layout.ques_dialog, null)) .settitle("title message!") .setcancelable(true) .setpositivebutton("go", new dialoginterface.onclicklistener(){ public void onclick(dialoginterface dialog, int whichbutton) { edittext et1 = (edittext)v.findviewbyid(r.id.et1); // here not able info edit text string s1 = et1.gettext().tostring().trim(); log.d("debug","data -"+s1+" , length"+s1.length()); .... rest code goes here }) .setnegativebutton("cancel", new dialoginterface.onclicklistener(){ public void onclick(dialoginterface dialog, int whichbutton) { ..rest code goes here } }); homecoming builder.create(); } }

that happening because of lines:

final view v =inflater.inflate(r.layout.ques_dialog,null); builder.setview(inflater.inflate(r.layout.ques_dialog, null))

you first inflate v view , set content of dialog newly inflated view(so in end end looking view isn't actual content of dialog). utilize this:

final view v =inflater.inflate(r.layout.ques_dialog,null); builder.setview(v);

android

java - method to insert/append elements in array list -



java - method to insert/append elements in array list -

i not sure if implementing insert or append correctly error:

exception in thread "main" java.lang.arrayindexoutofboundsexception: -1 @ alistint.insert(alistint.java:81) // listarray[i+1] = listarray[i]; @ listtest.main(listtest.java:52) // list.insert(i);

also cannot utilize java.util.arraylist here code , classes it:

class:

public class alistint { int [] listarray; int listsize; int curr; // current position alistint() { listsize = 0; // note curr = -1 when listsize = 0 curr = -1; listarray = new int [2]; } public int getvalue () throws dsexception { homecoming listarray[curr]; //returns value of current position //throw exception when there no elements in list } public int length() { homecoming listsize; //return # of elements in list } public int currpos() { homecoming curr; //return current position. } public void movetopos ( int pos ) throws dsexception { curr = pos; //move current position pos //throw exception if pos not valid position } public void movetostart () throws dsexception { curr = 0; //move current position start of list //throw exception if no elements in list } public void movetoend () throws dsexception { curr = listsize; //move current position end of list //throw exception if no elements in list } public void prev () throws dsexception { if(curr != 0) { curr--; } //move current position previous element //throws exception if previous position not legal or // if there no elements in list } public void next () throws dsexception { if(curr < listsize) { curr++; } //move current position next element //throws exception if next position not legal or // if there no elements in list } public void insert ( int item ) { for(int = listsize-1; >= curr; i++) { listarray[i+1] = listarray[i]; } listarray[curr] = item; listsize ++; int[]temp = new int[listarray.length*2]; for(int = 0; i< listsize; i++) { temp[i] = listarray[i]; } listarray = temp; // inserts item current position // if not plenty memory, double size of listarray } public void append ( int item ) { listarray[listsize++] = item; int[]temp = new int[listarray.length*2]; for(int = 0; i< listsize; i++) { temp[i] = listarray[i]; listarray = temp; } // inserts item end of list // if not plenty memory, double size of listarray } public int remove () throws dsexception { if((curr < 0)||(curr > listsize)) { homecoming -1; } int item; item = listarray[curr]; for(int = curr; < listsize - 1; i++) { listarray[i] = listarray[i+1]; } listsize --; homecoming item; //removes element @ current position //returns removed element } public void clear() { listsize = 0; curr = -1; //reset size. set current position -1 } public boolean find ( int val ) { for(int = 0; > listsize; ++) { if(listarray[i] == val) { homecoming true; } } homecoming false; //searches val in list //returns true if found , false if not found } public void print () { system.out.print("<"); for(int = 0; < listsize; i++) { system.out.print(listarray[i]); if(listsize == -1) { system.out.print("-1"); } } system.out.print(">"); //outprint list }

}

exception:

public class dsexception extends exception { public dsexception() { } public dsexception(string msg) { super(msg); } }

main:

public class listtest { public static void main ( string[] args ) { seek { alistint list = new alistint(); list.print(); // test length() system.out.println ( list.length() ); // test currpos() system.out.println ( list.currpos() ); // insert numbers ( int = 0; < 4; i++ ) { list.append(i); list.print(); } list.movetopos(0); list.print(); list.movetoend(); list.print(); // test getvalue() system.out.println ( list.getvalue() ); system.out.println ( "remove: " + list.remove() ); list.print(); list.movetostart(); list.print(); system.out.println ( "remove: " + list.remove() ); list.print(); list.clear(); list.print(); list.clear(); list.print(); system.out.println ( "find 0 : " + list.find ( 0 ) ); ( int = 0; < 4; i++ ) { list.insert(i); list.print(); } ( int = 0; < 5; i++ ) { system.out.println ( "find " + + " : " + list.find ( ) ); list.print(); } list.next(); list.print(); list.insert ( -9 ); list.print(); list.append ( -2 ); list.print(); list.movetoend(); list.insert ( -1 ); list.print(); system.out.println ( "remove: " + list.remove() ); list.print(); } grab ( dsexception e ) { e.printstacktrace(); } }

}

you reading outside array. in

for(int = listsize-1; >= curr; i++) { listarray[i+1] = listarray[i]; }

if i = listsize -1, listarray[i+1] listarray[listsize], out of bounds, since arrays go 0 length -1

edit:

but since listarray has initial size of 2, , double size @ each insert away that. however, @ first insert curr -1, , since termination i >= curr, loop entered , read listarray[-1] (out of bounds)

java insert arraylist append

r - Creating Function Utilizing Conditional Counting -



r - Creating Function Utilizing Conditional Counting -

i want develop function automate process of grade analyzing.

in 1 column, there number of tutoring hours pupil had , in next column or grade.

for 3 groups, have count number of (a+s , a-s), bs (b+s , a-s), cs, ds, fs, ws , calculate gpa of each. groups had 6 or more hours, had no hours, , total number of had tutoring.

is possible create simple function in r, such grades(hours,mark), similar summary() function, print 3 categories next info each:

number of students type(as include a-s, as, , a+s,etc.) of a, b, c, d, f, w calculate gpa: (4*a+3*b+2*c+1*d+0*f+0*w)/(a + b+ c + d+ f - w)

is possible in r? start?

thanks.

> hours=c(0,5,6,10,0);grades=c("f","a-","a","a+","c-") > grphrs <- hours >= 6 > table( substr(grades, 1,1), grphrs) grphrs false true 1 2 c 1 0 f 1 0

hard know sort of gpa calculation needed since clear these different students. if these same pupil then:

grdabcdfw <- substr(grades,1,1) sum( 4* (grdabcdfw=="a")+ 3*(grdabcdfw=="b")+ 2*(grdabcdfw=="c")+ 1*(grdabcdfw=="d")+ 0*(grdabcdfw=="f")+ 0*(grdabcdfw=="w") )/ length(grades[ !is.na(grades)] ) #[1] 2.8

to comment. perhaps:

hours.time=function(hours, grades, cutpt){ grphrs <- hours >= cutpt tbl <- table( substr(grades,1,1), grphrs) colnames(tbl) <- c( paste("fewer ", cutpt), paste( cutpt, "or more") ) tbl } hours.time(hours, grades,6) #------- grphrs fewer 6 6 or more 1 2 c 1 0 f 1 0

r conditional

permissions - How to display a file from a remote server or host machine from a Java Applet? -



permissions - How to display a file from a remote server or host machine from a Java Applet? -

i'm trying utilize next code display image in java applet:

icon = new imageicon("<url here>", "hello");

unfortunately, doesn't seem work. understanding, because applet served local machine, internal path specify go user's machine, rather server, right?

what best way image that's hosted on server machine display in applet?

that is, if applet found on example.com, so image found on example.com/pictures.

thank you!

not sure whether duplicate, these help you.

stackoverflow question

what applets can , cannot

java permissions applet

Is it possible to make the -init method private in Objective-C? -



Is it possible to make the -init method private in Objective-C? -

i need hide (make private) -init method of class in objective-c.

how can that?

objective-c, smalltalk, has no concept of "private" versus "public" methods. message can sent object @ time.

what can throw nsinternalinconsistencyexception if -init method invoked:

- (id)init { [self release]; @throw [nsexception exceptionwithname:nsinternalinconsistencyexception reason:@"-init not valid initializer class foo" userinfo:nil]; homecoming nil; }

the other alternative — far improve in practice — create -init sensible class if @ possible.

if you're trying because you're trying "ensure" singleton object used, don't bother. specifically, don't bother "override +allocwithzone:, -init, -retain, -release" method of creating singletons. it's virtually unnecessary , adding complication no real important advantage.

instead, write code such +sharedwhatever method how access singleton, , document way singleton instance in header. should need in vast bulk of cases.

objective-c

.net - Object.Equals clarification in C#? -



.net - Object.Equals clarification in C#? -

i've made simple test :

object t = 3; object aa = 3; #1 console.writeline(t.equals(aa)); #2 console.writeline(t.equals(3)); #3 console.writeline(3.equals(aa));

all of them true.(that's problem actually).

looking @ object , used function:

public virtual bool equals(object obj);

the equals virtual. can overridden.

but don't see polymorphic behavior. pure boxed value.

regarding line #1 t.equals(aa)

the reference type static type - object.

so thought should phone call object.equals : means reference different , meaning first reply should false.(and wrong here). why that?

regarding line #2 t.equals(3)

again, t's static type object. object.equals running. how come true ?

regarding line #3 3.equals(aa)

i believe public override bool equals(object obj); running because static type int. , param type object. why true ? un-box value ?

it seems , somehow unboxes object without notice :-(

objects equals method polymorphic, can overriden subtypes int. int32.equals overrides method value comparing between current object , argument, , since arguments equal 1 time unboxed, returns true.

there 2 overload of int32.equals - bool equals(object) , bool equals(int). bool equals(object) overload 1 overriden object. since t , aa object references, method called in examples 1 , 2.

in illustration 3, still overload called since aa object , hence valid overload.

the == operator static , resolved statically based on types of arguments, both object in example. == operator object compares references, , in case homecoming false 2 separate boxed ints.

c# .net equals

AutoIt - Return value always 0 -



AutoIt - Return value always 0 -

i wrote method can recursive, homecoming value 0, when has value string on console:

func hasitthething($s) $result = stringinstr(...,...) local $newstring $newstring = $s if not $result > 0 consolewrite("newstring = " & $newstring & @crlf) homecoming $newstring else $newstring = ;fix string hasitthething($newstring) endif endfunc

ah, nevermind, http://www.autoitscript.com/wiki/recursion answered this.

i solved replacing keyword homecoming local variable declared outside function, , set value variable.

return-value autoit

html5 - how big should site CSS files be? -



html5 - how big should site CSS files be? -

i aware of css , html5 , little bit of jquery.

i testing around sass , compass. alongside tools such sublime text 2 , codekit.

however css files (minified) totaling 106kb. have included foundation 3 framework, , own typekit fonts. pre-compiled size around 35kb..

any ideas?

your css depends on site requirements. long lean , efficient in doing correctly, there can not perchance set size css/html or js files!

there this site speed tool google help improve speed guessing aim?

css html5 sass compass-sass codekit

python - Accessing USB data -



python - Accessing USB data -

i wanted read usb data. using pyusb library. , had written script

import usb.core import usb.util device = usb.core.find(bdeviceclass=9) # 9 hub type usb device if device none: sys.exit("could not find id scheme barcode reader.") if device.is_kernel_driver_active(0): print "kernal driver active!"

while running giving me error.

usb.core.usberror: [errno 13] access denied (insufficient permissions)

try run file using root user alter user root

sudo su root

it inquire root password

after can run file access rights.

or utilize sudo, give access right of root user.

python pyusb

string - C : strchr pointer value doesn't change -



string - C : strchr pointer value doesn't change -

i'm trying recursively search substring in string using c program. wrote next piece of code. issue i'm facing that, ptr value, though prints right value(using puts in origin of while), while usage value not changed! uses previous ptr value. found out using gdb. couldn't figure out cause of this. kindly guide me solve issue. in advance.

void main() { char buf[10]="hello",*ptr; char findc[10]="lo"; int len,i,lenf,k,l,flag=0; lenf=strlen(findc); l=0,k=1; ptr=strchr(buf,findc[l]); while(ptr!=null) { puts(ptr); l++; for(i=l;i<(lenf);i++,k++) { if(ptr[k] != findc[i]) { flag=1; break; } } if(flag==1) { l=0;k=1; ptr=strchr((ptr+1),findc[l]); if(ptr==null) { puts("string not found"); break; } } else { puts("string found"); break; } } }

it simple mistake!

we'll have reset flag variable in origin of while loop. solve issue.

thanks!

c string substring strchr

php - How do I the max limit (3200 tweets) using Twitter's API (1.1) -



php - How do I the max limit (3200 tweets) using Twitter's API (1.1) -

i have been able it's in rather 'ugly' way.

one problem i'm facing refactoring need phone call 'max_id' need utilize placeholder until create first call. i've tried using 'null' , '' $max_id neither work. also, have feeling written without using manual 'for' loop.

so far code:

$i = 1; $content = $connection->get('statuses/user_timeline', array('screen_name' => 'username', 'count' => '200')); foreach ($content $item) { echo $i . " : " . $item->text; echo("<hr>"); $i++; } $lasttweet = end($content); $max_id = $lasttweet->id_str; ($l = 0; $l<15; $l++) { $content = $connection->get('statuses/user_timeline', array('screen_name' => 'username', 'count' => '200', 'max_id' => $max_id)); foreach ($content $item) { echo $i . " : " . $item->text; echo("<hr>"); $i++; } $lasttweet = end($content); $max_id = $lasttweet->id_str; }

any help appreciated.

i know it's not beautiful, within loop couldn't set test variable. sort of first time through instance or ruin point of refactoring?

$maxid = false; if(!$maxid) $content = $connection->get('statuses/user_timeline', array('screen_name' => 'username', 'count' => '200')); else { $content = $connection->get('statuses/user_timeline', array('screen_name' => 'username', 'count' => '200', 'max_id' => $max_id)); $maxid = true; }

instead of loop if you're careful away while loop() goes off count of items returned increment variable number of tweets returned on each pass. never accidentally allow while loop run forever, or can goodbye twitter api requests awhile.

$counttweets = 0; while($counttweets < 3200) { //code calls, gotta $counttweets += count($content); }

i utilize similar have, except merge next set of tweets total array work off big list of tweets. test count of total merged array instead of adding count variable.

php refactoring twitter

Is it equivalent oracle cursor parameter feature in mysql? -



Is it equivalent oracle cursor parameter feature in mysql? -

is equivalent oracle cursor parameter feature in mysql ?

for illustration :-

cursor cursorname(paramter_name datatype) select * table_name;

you can seek following:

cursor select_curs select * tbl id = @id; set @id = 1; open .. fetch .. close ..

mysql cursor

javascript - Google Analytics Event Tracking using Jquery not working -



javascript - Google Analytics Event Tracking using Jquery not working -

i trying track click events faq's. when user clicks question expands changing icon form plus minus. want expand event tracked see questions user has clicked most. not working, kindly review , give suggestions how prepare it. give thanks you.

$(document).ready(function() { $('.question').toggle( function() { $(this).next().show('slow'); $(this).css('background- image','url(/telenorsharedservices/en/tools/ithelp/tss%20support/publishingimages/icon-minus.gif)'); var question = $(this).text(); gatracking(question); }, function() { $(this).next().hide('slow'); $(this).css('background-image','url(/telenorsharedservices/en/tools/ithelp/tss%20support/publishingimages/icon-plus.gif)'); } ); }); function gatracking(question) { seek { _gaq.push(['_trackevent','faq','expand',question]); } catch(err){ alert(err); } }

javascript jquery

php - How to print tables on pdf with Javascript? -



php - How to print tables on pdf with Javascript? -

what's best way print tables in pdf javascript?

for example, have next code, , if click on "show pdf", table appears in pdf in new window. possible implement jspdf library?

<body> <table> <tr> <th>example</th> <th>example2</th> </tr> <tr> <td>value1</td> <td>value2</td> </tr> </table> <br> <input type="button" value="show pdf"> </body>

you should utilize dompdf, : dompdf html pdf converter. @ heart, dompdf (mostly) css 2.1 compliant html layout , rendering engine written in php. style-driven renderer: download , read external stylesheets, inline style tags, , style attributes of individual html elements. supports presentational html attributes.

download dompdf

http://code.google.com/p/dompdf/

<? require "dompdf_config.inc.php"; $html = <<<sty <table> <tr> <th>example</th> <th>example2</th> </tr> <tr> <td>value1</td> <td>value2</td> </tr> </table> </body> sty; $dompdf = new dompdf(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("mypdf.pdf", array("attachment" => 0)); ?>

php javascript table pdf