Posts

Showing posts from July, 2012

apache - Wordpress .htaccess doesn't remove www from website's URL -

looking @ code, should working (its working other websites/subdomains i'm working on) # begin wordpress <ifmodule mod_rewrite.c> rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /index.php [l] rewritecond %{http_host} ^www\.(.*)$ [nc] rewriterule ^(.*)$ http://%1/ [r] </ifmodule> # end wordpress edit: website on redirect loop now. fixed going wordpress settings > general > website url , adding "www." domain :)

tkinter - Basic Python Messagebox size change -

how change size of window message-box appears in? built box myself allow me change option "thanks". here code far: def messagewindow(): win = toplevel() win.title('warning') message = "this delete stuff" label(win, text=message).pack() button(win, text='thanks!', command=win.destroy).pack() you use geometry method set dimensions of window. example: win.geometry("500x500")

bash - Asterisk: How to convert time to seconds -

i want print result when $9 greather 1 hour how can convert seconds? can use 3600sec check. $9 = duration of call 00:00:00 asterisk -rx "core show channels verbose" | awk '$9 > "01:00:00"' | awk '$6 == "dial"' | wc -l > test.txt as mentioned, easiest thing check if first 2 digits of time not "00". this: asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $6 == "dial"' | wc -l that means match , record "01:00:00" may not want :-( . matches "$9 greater or equal 1 hour". this match "greater than" condition: asterisk -rx "core show channels verbose" | awk '$9 !~ /00:..:../ && $9 != "01:00:00" && $6 == "dial"' | wc -l

java - null pointer exception in getstrings method hadoop -

getting null pointer exception in driver class conf.getstrings() method. driver class invoked custom website. below driver class details @suppresswarnings("unchecked") public void doget(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { configuration conf = new configuration(); //conf.set("fs.default.name", "hdfs://localhost:54310"); //conf.set("mapred.job.tracker", "localhost:54311"); //conf.set("mapred.jar","/home/htcuser/desktop/resumelatest.jar"); job job = new job(conf, "resumesearchclass"); job.setjarbyclass(helloform.class); job.setjobname("resumeparse"); job.setinputformatclass(fileinputformat.class); fileinputformat.addinputpath(job, new path("hdfs://localhost:54310/usr/resumedirectory")); job.setmapperclass(r...

robotframework - What does "--dryrun" do in Robot Framework pybot command? -

i have used --dryrun along pybot command; want know validates in testcase or in library. it parses of test suites , executes tests. not execute keywords, parse them correctness. main benefits listed user guide are: using keywords not found. using keywords wrong number of arguments. using user keywords have invalid syntax. in addition these failures, normal execution errors shown, example, when test library or resource file imports cannot resolved. for more information see http://robotframework.org/robotframework/latest/robotframeworkuserguide.html#dry-run

sql server - check if first and last character of each word in a string is same -

i need set of names 1st & last letter of each part of name(first name, middle name, last name) matches. name can have 5 parts. if names are: croc lil brob tart cron lee bro tasr it should result: croc lil brob tart declare @name varchar(70) = 'cron lee bro tasr test' select @name, substring(@name,1,1) "first letter of first name", substring(@name,charindex(' ',@name) +1 -2,1) "last letter of first name", substring(@name,charindex(' ',@name) +1 ,1) "first letter of second name", substring(@name,charindex(' ',@name, charindex(' ',@name) + 1) +1 -2 ,1) "last letter of second name", substring(@name,charindex(' ',@name, charindex(' ',@name) + 1) +1 ,1) "first letter of third name", substring(@name,charindex(' ',@name, charindex(' ',@name,charindex(' ',@name) + 1) + 1 +1)+1 -2 ,1) "last letter of 3rd name", subs...

java - Serializing an object which contains a list of other objects -

Image
background : implementing game needs serialize model objects (events) able send them on network clients playing game. problem : 1 of model classes eventshowcards , subclasses event (declared serializable). public class eventshowcards extends event { private final player player; private final list<itemcard> cards; public eventshowcards(player player, list<itemcard> cards) { super(); this.player = player; this.cards = cards; } public player getplayer() { return player; } public list<itemcard> getcards() { return cards; } @override public void accept(visitor visitor) { visitor.visit(this); } } however, when serialize object , send client, client receives object , list of itemcard s empty. no exceptions thrown . event shown server (before serialization): event shown client (after serialization): in order serialize/deserialize using standard objectoutputstre...

javascript - How to show/Hide ALL column in grid? -

i have grid have header "show all" shows columns , "hide all" hides except default first column. here's code hide 1 of column header name, how go hiding @ same time? var grid = ext.componentquery.query('grid[itemid=gridid]')[0]; var column = grid.getcolumnmanager(); column.getheaderbydataindex("columndataindexname").setvisible("true/false"); ext.array.each(grid.getcolumns(), function(column, index) { if (index > 0) { column.setvisible(false); } }, this);

c# - CefSharp BrowserControl - Image Hyperlinks open in new Form -

hope give me advice or point me direction. im using cefsharp browser control in application, 1 if things im struggling when click on image hyperlinks (or hyperlinks matter) shows windows form image displayed, fiddled around in requesthandler on onbeforebrowse method , added following: if (validateurl(request.url)) { system.diagnostics.process.start(request.url); return true; } return false; where validateurl regex checks. what have noticed windows form (blank windows form) still opens , image on browser (expected). where can double check not show blank windows form, or hide it? version: chromium 39.0.2171.95 cef: r2069, cefsharp: 39.0.2.0 regards jean

javascript - Check if radio button value is, then echo some HTML -

i want check if value of select field value , if is, needs echo text. i use code input box in form: <li> <div class="input-box"> <strong><?php echo $this->__('would recommend product friend?') ?></strong> <?php foreach ( $this->getoptions() $option ): ?> <label class="recommend"> <input type="radio" name="recommend" id="recommend_field <?php echo $option['value'] ?>" class="radio-gender" value=" <?php echo $option['value'] ?>" <?php if ($option['value'] == $value) echo ' checked="checked"' ?> > <?php echo $this->__($option['label']) ?></input> </label> <?php endforeach ?> </div> </li> and echo e...

vagrant - Install apache module with puppet on Debian 7 -

my problem during provisionning of vagrant vm using puppet. error : ==> default: err: /stage[main]//service[apache2]: not evaluate: not find init script 'apache2' my puppetfile following default.pp : exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] } exec { 'apt-get update': command => 'apt-get update', timeout => 60, tries => 3 } class { 'apt': } $syspackages = ['python-software-properties', 'build-essential', 'apache2', 'apache2.2-common'] package { $syspackages: ensure => "installed", require => exec['apt-get update'], } service { apache2: ensure => running, enable => true, require => package['apache2', 'apache2.2-common'], } when not writting apache2 service, there no error thrown, there no /etc/init.d/apache2 . guess that's why error th...

r - How to add a label to a transformed scale axis on the right hand side of a ggplot2? -

the linked question below worked me, except label transformed axis on rhs of plot. how can put transformed scale on right side of ggplot2? the source code provided in linked question follows: library(ggplot2) library(gtable) library(grid) lakelevels<-data.frame(day=c(1:365),elevation=sin(seq(0,2*pi,2*pi/364))*10+100) p1 <- ggplot(data=lakelevels) + geom_line(aes(x=day,y=elevation)) + scale_y_continuous(name="elevation (m)",limits=c(75,125)) p2<-ggplot(data=lakelevels)+geom_line(aes(x=day, y=elevation))+ scale_y_continuous(name="elevation (ft)", limits=c(75,125), breaks=c(80,90,100,110,120), labels=c("262", "295", "328", "361", "394")) #extract gtable g1<-ggplot_gtable(ggplot_build(p1)) g2<-ggplot_gtable(ggplot_build(p2)) #overlap panel of 2nd plot on of 1st plot pp<-c(subset(g1$layout, name=="panel", se=t:r)) g<-gtable_add_grob(g1, g...

c++ - How to store a complete sentence with white spaces in a string in cpp? -

this question has answer here: tell cin stop reading @ newline 3 answers equivalent of console.readline() in c++ 2 answers i want store "what wrong you?" in string str in cpp when run code stores "what" in ·str·. how can store complete sentence in string. #include<iostream> #include<string.h> using namespace std; int main() { string str; cin>>str; cout<<str; } input: what wrong you? output: what was answered. here solution: std::string str; std::getline( std::cin, str);

javascript - Pass value of checkbox and dropdown into same array -

i working on creating form allow user add new capability collection based on capabilities select. form structured table consists of checkboxs , dropdowns. checkbox allows users select capability wish add , drop down allows them select level of expertise capability. here html form: <form class="listofcaps"> <table> <tbody> <tr ng-repeat-start="cap in capsarr"></tr> <tr ng-repeat-start="capname in filteredcaps track capname.cid"></tr> <td> <input type="checkbox" name="selectedcaps[]" value="{{capname}}" ng-model="capname.selected" /> <span>{{capname.capname}}</span> </td> <td> <span class="custom-dropdown custom-dropdown--white"> <select ...

javascript - Unrecognized expression jquery in id value -

this question has answer here: jquery syntax error, unrecognized expression: 3 answers $("#1_0xr__abcdef@gmail.net__ikhhh@gmail.net__054gg") giving me error: syntax error, unrecognized expression 1_0xr__abcdef@gmail.net__ikhhh@gmail.net__054gg while accessible through document.getelementbyid("1_0xr__abcdef@gmail.net__ikhhh@gmail.net__054gg") why happening , id dynamically generated through app. please provide me reason problem from the doc : use of meta-characters ( such !"#$%&'()*+,./:;<=>?@[]^`{|}~ ) literal part of name, must escaped with 2 backslashes: \. example, element id="foo.bar", can use selector $("#foo\.bar"). below how you'd write selector. $("#1_0xr__abcdef\\@gmail\\.net__ikhhh\\@gmail\\.net__054gg") demo

vba - Runtime error 91: object variable or with block variable not set -

i'm running macro in word which, among other things, adds line bottom of table existing in document , fills cells. odd thing majority of documents works, there couple of documents receive run time error 91. 'update document properties, updates header, updates table of contents, ' , adds file version history table. sub zzaddversionhistory(strusuario string, strdescripcion string) dim newdate string dim rownumber integer dim rownew row dim strissue string dim ascissue integer 'updates date property newdate = format(date, "dd/mm/yyyy") activedocument.customdocumentproperties("date").value = newdate 'finds version issue property , updates version if docpropertyexists("issue") = true strissue = activedocument.customdocumentproperties("issue").value ascissue = (asc(strissue)) + 1 'convierte el issue en ascii y le suma uno strissue = chr(ascissue) '...

javascript - Comparing Values from a text file with value entered ,Using Java For Login purpose -

i trying make gui works login screen. code should compare value entered values in txt file. (two fields needed compared) values in text file given 2 columns separated space. code not comparing data properly. login.txt file: abcd xdfg kfhk ertf ffsf jfkf setg kgfb code part: import java.awt.container; import java.awt.eventqueue; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.bufferedreader; import java.io.file; import java.io.filenotfoundexception; import java.io.filereader; import java.util.arraylist; import java.util.list; import java.util.scanner; import javax.swing.abstractbutton; import javax.swing.jbutton; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.joptionpane; import javax.swing.jtextfield; @suppresswarnings({ "serial", "unused" }) public class guilook extends jframe{ public jtextfield exmem; publi...

javascript - jquery tabbed selector with dropdown selectors, dropdowns don't match on tab switch -

thanks members oka , mike robinson, have managed build 2 tables users view , play using tabs , dropdowns. my 2 tables have identical structures, each has identical drop-down menu show/hide columns. idea user select "choice" drop down, tab on other table , compare choices. everything works, except -- when tab on other table, correct column -- '.target' -- shown (and correct columns -- '.choice' -- hidden) drop down resets default. drop down displays 1 choice; shown columns display another, confuse viewers. the code "remembers" choices hidden , target shown, drop down doesn't. i'm bit stumped. ideas what's going on? here jquery, css, html, , snippet: function keepselect() { var val = $(this).val(); var target = '.' + val; $('.choice').hide(); $(target).show(); } $(document).ready(function() { $('.sel')....

Struct, linked list, head,null-pointer, C++ -

how can define,that pointer head shows first linked list element?the compiler shows mistake in place : head=domino->info; struct dominopart { int number1; int number2; }; struct dominoone { dominopart info; struct dominoone *next; }; first defined null-pointer,because linked list empty @ first. struct dominoone* next= null; struct dominoone* head=null; then information file read line line. int readdomino (){ file *datei; if((datei=fopen("datei.dat", "r") )==null) { std::cout<<"file can't opened"<<std::endl; return 0; }else { int beginning; int temp; fscanf(datei, "%d", &beginning); for(int i=0; i<beginning; i++) { dominoone *domino= new dominoone; fscanf(datei, "%i", &temp); domino->info.number1=temp; fscan...

Yammer OpenGraph commenting widget loading all feed, but not specific page messages -

on our site integrated opengraph commenting widget https://developer.yammer.com/v1.0/docs/commenting and worked fine. (maybe several days ago) stop working was. , loading messages not current page, messages user have in yammer feed. is there changes in api?

IBM MobileFirst Platform ClassPath error during installation -

running mfpf7.0.0.0-if201506081356 on websphere liberty 8.5.5.5 (that's 8.5.5 fp 5 applied), ibm java 7.0.8.10. after deploying first runtime server following error occurs: 6/10/15 15:25:05:600 cest] 0000002c com.ibm.ws.webcontainer.webapp e srve0293e: [servlet error]-[failed load listener: com.worklight.server.bundle.project.jeeprojectactivator]: java.lang.noclassdeffounderror: com.worklight.server.bundle.api.worklightbundles @ com.ibm.ws.classloading.internal.appclassloader.definepackageandclass(appclassloader.java:308) @ com.ibm.ws.classloading.internal.appclassloader.findclass(appclassloader.java:252) @ com.ibm.ws.classloading.internal.parentlastclassloader.findordelegateloadclass(parentlastclassloader.java:81) @ com.ibm.ws.classloading.internal.appclassloader.loadclass(appclassloader.java:373) @ java.lang.classloader.loadclasshelper(classloader.java:764) @ java.lang.classloader.loadclass(clas...

javascript - Using ajax to read text data from an outside source -

so working on allow me read json data outside server, , print out in more human-readable format. far have this: var address = "example.com"; //not actual site $.ajax({ url: address, datatype: "jsonp", success: function(data) { var obj = json.parse(data); //misc printing code goes here }, error: alert("error") }); however, consistently receiving error alert. console tells me "unexpected token &". looking @ few other sources, issue seems actual data present on site nothing more raw text. changed datatype field "text" try , fix this, console error instead changed tell me wasn't allowed access. tried retrieving data , treating text "jsonp text", returned previous "unexpected token &" error. there way can receive text data outside server? if not, there workaround use, such saving data document , importing code there?

javascript - Difference in referring this variable in jquery -

i confused between variable in below code. jquery.fn.extend({ check: function() { return this.each(function() { this.checked = true; }); }, uncheck: function() { return this.each(function() { this.checked = false; }); } }); // use newly created .check() method $( "input[type='checkbox']" ).check(); please tell me this refers object. in this.each , this refers collection of elements in provided jquery object. in example, all of input[type="checkbox"] elements. in this.checked , this single domelement within iteration of each loop.

c# - Xamarin App crashes on Reopen NullReference -

i have app on xamarin, works fine, if press button, move main menu hides in app stack, when open app stack crashes nullreference 06-10 15:59:57.363 i/monodroid(14891): unhandled exception: 06-10 15:59:57.363 i/monodroid(14891): system.nullreferenceexception: object reference not set instance of object 06-10 15:59:57.363 i/monodroid(14891): @ xamarin.forms.platform.android.formsapplicationactivity.onprepareoptionsmenu (android.views.imenu) <il 0x00007, 0x00050> 06-10 15:59:57.363 i/monodroid(14891): @ android.app.activity.n_onprepareoptionsmenu_landroid_view_menu_ (intptr,intptr,intptr) [0x00011] in /users/builder/data/lanes/monodroid-mavericks-monodroid-5.1-series/d419c934/source/monodroid/src/mono.android/platforms/android-21/src/generated/android.app.activity.cs:4151 06-10 15:59:57.363 i/monodroid(14891): @ (wrapper dynamic-method) object.87f976f0-8c0f-4463-92f4-c8ed92b6336d (intptr,intptr,intptr) <il 0x00017, 0x0004b> 06-10 15:59:57.383 d/androidruntime(14891): shu...

backbone.js - backbone required to create rich grails Interface? -

i'm learning grails , i'm looking build rich uis ajax. question whether or not third party js library backbone required achieve such goal? i'm under understanding grails has built in tags such formremote etc, i'm not sure why need backbone. grails capable of rich ui's out of box, or third party library backbone required?

symfony - ServiceCircularReferenceException in CheckCircularReferencesPass.php -

i working on wsse authentication in symfony2. t followed steps perfectly, trying on helloworld function: public function helloworldaction() { return new response("hello world"); } it's route: http://localhost/symfony/web/app_dev.php/api/helloworld but getting error: servicecircularreferenceexception in checkcircularreferencespass.php line 69: circular reference detected service "security.authentication.manager", path: "security.authentication.manager -> security.authentication.provider.wsse.wsse_secured -> security.authentication.manager". i have double checked services.yml file mistakes , have been searching web 4h answer still stuck. this services.yml of bundle: services: wsse.security.authentication.provider: class: obcarstest2bundle\security\authentication\provider\wsseprovider arguments: ["", "%kernel.cache_dir%/security/nonces"] parent: security.authentication.listener.ab...

asp.net mvc - ASP MVC Bootstrap Navigation Dropdowns: Hover on Large Screen, Click on Small -

i using standard bootstrap class="nav navbar-nav" navigation dropdown menus: <ul class="nav navbar-nav"> <li role="presentation" class="@html.isselected("appointments", "selected")"> <a data-toggle="dropdown" href="#"><img src="/content/images/nav_appts.png" style="padding: 0px 5px 3px 0px;">appointments<span class="caret"></span></a> <ul class="dropdown-menu" role="menu"> <li>@html.actionlink("appointments page 1", "index", "appointments")</li> <li>@html.actionlink("appointments page 2", "page2", "appointments")</li> </ul> </li> // more menu items </ul> out of box, dropdowns appear if click on them. found way make them appear if hover. in cs...

css - Using backface-visibility on * elements -

i doing work on website fixed sidenav scrolls page. now noticed there problems position: fixed elements in webkit rendering engine ( see this ) , solve - seen in post, used -webkit-backface-visibility: hidden; . what post describes webkit when using fixed elements tries check damaged regions see if within same composite layer , unifies them 1 paint rectangle while scrolling. now i'm not having bugs or issues either components wondering if, box-sizing: border-box; add following css: * { backface-visibility: hidden; } prefixes stripped would have big performance hits on webpage? would fix bugs? (webkit pretty weird stuff sometimes) what other advantages / disadvantages potentially have? thanks in advance, if question vague i'll hear guys in notime ;) performance hits aren't registered common user, if you're chasing indexing score, that's ping that's hurting you. for listed scenario, if you're using precompiler less or sas...

ruby - Unexpected tASSOC, in a chef recipe. What's wrong? -

i keep getting error when try use environment attribute in chef recipe: git name repository repo_url revision "master" environment { 'var' => 'whatever' } action :sync end the error : error: /tmp/vagrant-chef-3/chef-solo-3/cookbooks/jandj/recipes/git_repo.rb:11: syntax error, unexpected tassoc, expecting '}' ==> default: environment { 'var' => 'whatever' } i copied example chef docs here the correct syntax either environment({ 'var' => 'whatever' }) or environment 'var' => 'whatever'

xslt - value of select ignore one type of child -

i've below xml <p> <b>chapter 3: industrial drawings</b> <fn> <fnn>11</fnn> <fnt> <p>fnt 1</p> </fnt> </fn> <b>and designs</b> </p> and i'm using below line, i'm getting data in p <xsl:template match ="p"> <xsl:value-of select="descendant-or-self::*/text() except descendant::fn"/> </xsl:template> here i'm trying content of p , ignore fn node(). output chapter 3: industrial drawings11fnt 1and designs but expected chapter 3: industrial drawings , designs here i'm using descendant-or-self::*/text() because there might many cases below. p/b/text() p/b/c/text() p/i/c/text() etc... i want ignore fn , print text(). please let me know how can this. the except operator set difference, x except y gives nodes in set x , not in set y. in ca...

Cannot install Visual Studio Professional and Community on Windows 8.1 Enterprise -

i have problem installing vs professional 2012 , vs community 2013 on windows 8.1. installation app crashes right after open it. following installation tips disabled anti-virus , firewall software , installed available windows updates, nothing has changed. furthermore, disabled .net 3.5 , enabled features .net 4.5 following these tips . also, downloaded , installed .net 4.5.2 , directx, didn't either. do have advice of next? ok, according dump, setup crashes because of intel hd graphic driver: exception_record: (.exr -1) exceptionaddress: 00000000 exceptioncode: c0000005 (access violation) exceptionflags: 00000000 numberparameters: 2 parameter[0]: 00000008 parameter[1]: 00000000 attempt execute non-executable address 00000000 process_name: vs_professional.exe error_code: (ntstatus) 0xc0000005 - die anweisung in 0x%08lx verweist auf speicher 0x%08lx. der vorgang %s konnte nicht im speicher durchgef hrt werden. exception_code: (ntstatus) 0xc00000...

ruby on rails - Updating params in URL after forced/manual input -

i using devise user system set model tutor associated model profile whereby tutor has_one :profile , profile belongs_to :tutor . therefore tutor_id foreign key associates each profile entry tutor entry. in profile model, have usual rails rest methods new , edit , show , create , update . when accessing profile#edit via uri /profiles/:id/edit , edits made correctly corresponding tutor model of profile regardless of what's entered in place of :id in url, seems kind of awkward url not reflect this. so if tutor tutor_id: 2 , profile id: 2 signed in, accessing edit action via /profiles/4/edit or /profiles/afjsdjfdsj/edit somehow produces same result accessing proper url /profiles/2/edit , still update correct profile of tutor. what want update url in address bar reflect profile id: 2 . i've tried using redirect_to in edit method in profilescontroller no avail: #app/assets/controllers/profiles_controller.rb def edit ... @profile = current_tutor....

image - Creating a java swing album -

i'd create java swing photo album can't manage find right way it. think should create 2 arraylist, 1 stock photo objects , 1 stock buttons. after should find way assign each images buttons , add them panel. my question : think right way , if so, give me hint? (for last class @ bottom) here's code @ moment : main : import javax.swing.jframe; public class main extends jframe { public static void main(string[] args) { javax.swing.swingutilities.invokelater(new runnable() { public void run() { new albumframe(); } }); } } albumframe : import java.awt.borderlayout; import javax.swing.imageicon; import javax.swing.jframe; import javax.swing.jlabel; import javax.swing.jpanel; public class albumframe extends jframe { private jpanel menupanel; private jpanel photopanel; public albumframe(){ super("jphone"); setlayout(new borderlayout()); photopanel = new photopanel(); a...

ios - determining user's preferred AVSpeechSynthesisVoice for a given language -

my ios app provides avspeechsynthesizer support in multiple languages (not device's current language). in settings->general->accessibility->speech->voices->spanish , user can set preferred voice either "spanish (spain)" or "spanish (mexico)" (which correspond es-es , es-mx , respectively). portuguese (pt-pt, pt-br), french (fr-fr, fr-ca), etc. if 1 of users wants have app speak spanish phrase, how can determine of available spanish voices user has selected in settings? i tested [avspeechsynthesisvoice speechvoices] see whether ordering of voices changes when user preferences changes, answer appeared no. [avspeechsynthesisvoice voicewithlanguage:] requires full language-locale string, passing in "es" gets nil though 2 spanish voices available default. i scanned through keys in [nsuserdefaults standarduserdefaults] , there's nothing relevant there. , i've looked through uiaccessibility documentation without finding...

Update JavaScript variable in jQuery -

please can on how value jquery javascript? var mytitle = "abctitle"; function showtitle(myvar) { mytitle = myvar; alert(mytitle); } $(document).ready(function() { alert(mytitle); //i alert "abctitle" mytitle = "changed"; }); how can value set in query outside call in jscript? your code right, , supposed to var mytitle = "abctitle"; var e = document.getelementbyid('show'); e.onclick = showtitle; function showtitle(){ alert(mytitle); } $(document).ready(function() { alert(mytitle); //i alert "abctitle" mytitle = "changed"; }); <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <button id="show">click me</button> this alert mytitle new title, showing 'jquery' can access javascript variables , change them.

php - Parsing multiple PDFs from text input with PDF Parser library -

i'm attempting use pdf parser php library parse text multiple pdfs submitted through form textarea (one pdf url per line). the code i'm using is: <?php include 'vendor/autoload.php'; $ids = $_post["textarea"]; foreach(explode("\n", $ids) $line) { $parser = new \smalot\pdfparser\parser(); $pdf = $parser->parsefile($line); $text = $pdf->gettext(); echo $text . '<br />'; ?> note: 'vendor/autoload.php' composer file. this works expected when put 1 url textarea, if put more 1 returns nothing. i'm not sure if there's wrong foreach loop or if library not support parsing multiple pdfs in loop... advice appreciated!

PHP/MySQL search... show all data by default, or show matched data -

i've built page shows whole mysql table want add search it. what i've done set when user searches displays matching results, if there's no search displays whole table. it's showing table, when search it's returning no data (everything else working though) this i've got search... <?php if(isset($_post['submit'])){ if(isset($_get['query'])){ if(preg_match("/^[ a-za-z]+/", $_post['query'])){ $query=$_get['query']; $q=mysql_query("select * employees name '%$query%'" ) or die("could not search"); $result = mysql_query($q) or die(mysql_error()); while ($row = mysql_fetch_array($result)){ i can't work out how needs formatted. search box 'query'. appreciated! ----- edit ----- can't work still... pointers? <?php if(!empty($_session['loggedin']) && !empty($_session['username']){?><br /><form method="post" action="s...

jquery - Adding text (footer) below Fancybox gallery thumbnails -

i attempting add additional text space fancybox (v2.0.6) gallery under thumbnails footer. ideally lime green space in visual example linked below. a visual example of i'm attempting accomplish ... http://i.stack.imgur.com/zp7fj.gif i belive accomplish additional div within .fancybox-thumbs div class under ul list thumbnails , need add additional js query.fancybox-thumbs.js expertiese in javascript isn't enough accomplish on own. thanks! my current html: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> <link rel="stylesheet" href="/css/jquery.fancybox.css" type="text/css" media="screen" /> <script type="text/javascript" src="/js/jquery.fancybox.pack.js"></script> <link rel="stylesheet" type="text/css" href="/css/jquery.fancybox-thumbs.css" /> <script typ...

javascript - how to deal with dates 6 months ahead if year increments -

here function, trying date 6 months ahea, or 6 months before. var newenddate = formatdateaddmonths(startdate,+6); function formatdateaddmonths(datemod, monthsaddeddeducted) { //startdate //split date var datesplit = datemod; var datesplitted = datesplit.split("/"); var day = datesplitted[0]; var month = datesplitted[1]; var year = datesplitted[2]; console.log("day" + day); console.log("month" + month); console.log("year" + year); newdatemodification = day + '/' + month + '/' + year; var newdate = date.parse(newdatemodification).add(monthsaddeddeducted).months(); //convert string var newdatestring = newdate.tostring('dd/mm/yyyy'); return newdatestring; } this works fine long function not called before end of year. it breaks example...

css - Center image and text at large width, allow both to shrink at small width? -

Image
i have image , text. when layout wider image need image , text centered, , text wide image. when layout smaller need image , text shrink. my layout responsive , content dynamic dimensions of image change. the first part can achieved this: http://codepen.io/anon/pen/zgyomb <div class="cont"> <div class="cont2"> <img src="http://www.vector-finder.com/site-images/too_big/fantasy_banner_vector.jpg" /> <p>some text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. text here. </p> </div> </div> .cont { text-align: center; } .cont2 { display: table; width: 1px; margin: auto; } p { display: inline-block; } img { //max-width: 100%; } however when set image have max width of 100% can shrink @ smaller displays, shrinks regardless. know happening because of styles appl...

jquery - JavaScript: Display positive numbers with the plus sign but not string -

using timepiker want set timezone +840: var sign = '+'; var totalmin = 840; $('#timestart').timepicker({ showtimezone: true, timeformat: "hh:mm tt", timezonelist: [ { value: -720, 'label': '(gmt-12:00) international date line west' }, .... { value: +840, 'label': '(gmt+14:00) time in samoa' } ], timezone:sign + totalmin }); if set timezone:totalmin => timezone not set timezone:sign + totalmin returned string "+840" , timezone not set, how can set positive number + sing not string i don't know if solution in case when plus set this var sign = '+'; var totalmin = 840; if(sign=='+'){ $('#timestart').timepicker({ showtimezone: true, timeformat: "hh:mm tt", ...