Posts

Showing posts from August, 2013

JMeter NonGUI Error : java.lang.NullPointerException -

i trying run jmeter thru java code (using runtime.exe) getting following error: creating new process thru java using jmeter.bat here arguments: c:\apache-jmeter-2.8\bin\jmeter.bat -n -t c:\test\test.jmx -l c:\test\test.log please help! 2014/09/10 18:05:25 error - jmeter.save.saveservice: conversion error com.thoughtworks.xstream.converters.conversionexception: : no more data available - expected end tags </elementprop></collectionprop></elementprop></httpsamplerproxy></hashtree></hashtree></hashtree></hashtree></jmetertestplan> close start tag <elementprop> line 1 , start tag <collectionprop> line 1 , start tag <elementprop> line 1 , start tag <httpsamplerproxy> line 1 , start tag <hashtree> line 1 , start tag <hashtree> line 1 , start tag <hashtree> line 1 , start tag <hashtree> line 1 , start tag <jmetertestplan> line 1, parser stopped on end_tag seen ...</string...

Magento Select Categories inseide a categorie -

i have severall products belong multiple categories. need kind of layered navigation have kind of category tree: cat a *cat a1 *cat a2 cat b *cat b1 *cat b2 cat brands, , cat b type of product. in catalog when go cat b1, want add filter shows brands of products. filter cat a1 , cat a2, , if filter cat a1 show products cat b1 belong cat a1. what mean, intersection of both categories, , allways display in layered navigation. every time enter category, must display categories products inside of belongs to. design/frontend///catalog/layer/view.phtml <?php if($this->canshowblock()): ?> <div class="block block-layered-nav"> <div class="block-title"> <strong><span><?php echo $this->__('shop by') ?></span></strong> </div> <div class="block-content"> <?php echo $this->getstatehtml() ?> <?php if($this->canshowoptio...

c# - problems with getting data for dropdownlist -

i have dropdownlist getting data data base it contains 4 data : my controller : public actionresult index() { viewbag.postes = _db.postes.tolist(); return view(); } [httppost] public actionresult index( poste poste,string num_cin="r346399") { if (modelstate.isvalid) { if (poste.id == 3) { return redirecttoaction("inscription", "candidat"); } return view(poste); } } my view @html.dropdownlistfor(model => model.id, new selectlist(viewbag.postes, "id", "intitule_poste"),"choisir le poste") the problem if choose value dropdownlist !=3 it's give me error "that items must not null " you view includes @html.dropdownlistfor() generated based on value of viewbag.postes . when return view (i.e. when poste...

odata - Error w/ context initialized from JaySvcUtil-generated model -

upon closer examination file generated .js file built jaysvcutil -- in case called bo_data.d.ts cannot resolve 2 references $data.ipromise . started happening after added new table in database, regenerated .edmx model in visual studio , regenerated entity model jaysvcutil.exe. declare module wcfservice1 { export class boloentities extends $data.entitycontext { onready(): $data.ipromise; onready(handler: (context: boloentities) => void): $data.ipromise; in console see error: typeorname requires value other undefined or null @ line in code: window['bolo'] = new wcfservice1.boloentities(oproviderconfig); thanks in advance! p.s. did this, didn't help: typescript compile errors jaydata library , jaysvcutil generated code so seems doing 1 of 2 things described in typescript compile errors jaydata library , jaysvcutil generated code you must: 1) change jaydata.d.ts declare module $data { interface ipromise<t> extends object { the...

asp.net - 502 : Web server received an invalid response while acting as a gateway or proxy server -

message error: web server received invalid response while acting gateway or proxy server details: there problem page looking for, , cannot displayed. when web server (while acting gateway or proxy) contacted upstream content server, received invalid response content server. when return string encrypted in web services, other methods work correctly.

c# - How to avoid switch-case in a factory method of child classes -

lets have family of classes (cards, sake of it), , need instantiate them based on identifier. factory method this: public card getcard(int cardnumber) { switch(cardnumber) { case 13: return new king(); case 12: return new queen(); case 11: return new jack(); } //... } what want avoid switch . why? maybe want reuse comparison in feature. what came this: private dictionary<int, type> cardtypes = { {13, typeof(king)}, {12, typeof(queen)}, {11, typeof(jack)} }; public card getcard(int cardnumber) { var cardtype = cardtypes[cardnumber]; var instance = activator.createinstance(cardtype); return (card)instance; } however, solution uses reflection expensive, , problematic when have more 1 "identifier" (for example 1 , 14 both give ace - should add 2 keys dictionary?). what's best practice in scenario? instead of storing type in dictionary, store func<card> : priv...

java - @Named annotation can't load a bean in a Servlet - javax.naming.NameNotFoundException: Name student is not bound in this Context -

i used @component bean(student.java) being called in servlet. changed @component @named. used use following code student bean in servlet. student student = (student)applicationcontext.getbean("student") after changed @named, bean no longer being detected. getting following error messages. tell me problem? placed javax.inject-1.jar file under webapps\student-enrollment\web-inf\lib\ context init... logger name context: student-enrollment context logger config file: logback-student-enrollment.xml adding logger context: student-enrollment map context: student-enrollment 2014-09-10 20:46:19.361 servlet /student-enrollment threw load() exception javax.naming.namenotfoundexception: name student not bound in context @ org.apache.naming.namingcontext.lookup(namingcontext.java:770) ~[catalina-6.0.36.jar:6.0.36] @ org.apache.naming.namingcontext.lookup(namingcontext.java:153) ~[catalina-6.0.36.jar:6.0.36] @ org.apache.catalina.util.defaultannotationproc...

How to use Google Cloud Endpoints from within a Chrome App? -

i'm building chrome app, , i'd communicate server on cloud endpoints, there 2 problems i'm not sure how overcome: the google apis javascript library external script, can't use in page in chrome app. can copy source of library, , place in file in app's source? the client checks javascript origin, extension's origin of form chrome-extension://extension_id , developer console doesn't accept javascript origin. how around these issues? 1. loading gapi client indeed way have found load gapi client use webview, as explained here . have tested itand works weirdly authentication not work @ all, , cloud endpoints believes you're anonymous. in addition communication webview rest of world pretty tricky (window.postmessage not allow send response in callback). i think better off calling directly rest methods using ajax requests, helper such jquery or other. have set authorization header using access token, in jquery : $.ajax({ ...

android - Can't make transitions work -

i've been trying make transitions work , had no luck, took example http://www.w3schools.com/jquerymobile/tryit.asp?filename=tryjqmob_trans_reverse , change url make work locally, nothing happened. <!doctype html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.css"> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="http://code.jquery.com/mobile/1.4.2/jquery.mobile-1.4.2.min.js"></script> </head> <body> <div data-role="page" id="pageone"> <div data-role="header"> <h1>welcome homepage</h1> </div> <div data-role="main" class="ui-content"> <p>click on link see slide effect (slides next page right ...

python - Django - Cannot create migrations for ImageField with dynamic upload_to value -

i upgraded app 1.7 (actually still trying). this had in models.py: def path_and_rename(path): def wrapper(instance, filename): ext = filename.split('.')[-1] # set filename random string filename = '{}.{}'.format(uuid4().hex, ext) # return whole path file return os.path.join(path, filename) return wrapper class userprofile(abstractuser): #... avatar = models.imagefield(upload_to=path_and_rename("avatars/"), null=true, blank=true, default="avatars/none/default.png", height_field="image_height", width_field="image_width") when try makemigrations , throws: valueerror: not find function wrapper in webapp.models. please note due python 2 limitations, cannot serialize unbound method functions (e.g. method declared , used in same class body). please...

python - Referencing Data From a 2D Histogram -

i have following code reads data csv file , creates 2d histogram: import numpy np import pandas pd import matplotlib mpl import matplotlib.pyplot plt #read in csv data filename = 'complete_storms_all_us_only.csv' df = pd.read_csv(filename) min_85 = df.min85 min_37 = df.min37 verification = df.one_min_15 #numbers x = min_85 y = min_37 h = verification #estimate 2d histogram nbins = 33 h, xedges, yedges = np.histogram2d(x,y,bins=nbins) #rotate , flip h h = np.rot90(h) h = np.flipud(h) #mask zeros hmasked = np.ma.masked_where(h==0,h) #calculate averages avgarr = np.zeros((nbins, nbins)) xbins = np.digitize(x, xedges[1:-1]) ybins = np.digitize(y, yedges[1:-1]) xb, yb, v in zip(xbins, ybins, verification): avgarr[yb, xb] += v divisor = h.copy() divisor[divisor==0.0] = np.nan avgarr /= divisor binavg = np.around((avgarr * 100), decimals=1) binper = np.ma.array(binavg, mask=np.isnan(binavg)) #plot 2d histogram using pcolor fig1 = plt.figure() plt.pcolormesh(xedges,yedg...

c# - Create LINQ statement with variable column names -

this question has answer here: linq : dynamic select 5 answers i creating tree view flat table. have linq query returns distinct values column public actionresult index() { var result = (from in db.items select i.geoname) .distinct() .orderby(n => n); return view(result); } this of course returns view beginning nodes (lets hypothetically 'node1', 'node2', , 'node3'). i have user click on node, , return contents of column well. how do dynamically? i hoping simple (and may be, don't know - linq newb!) as: public actionresult index() { var result = (from in db.items select i.passedincolumnname) .distinct() .orderby(n => n); return view(resu...

sass - phpstorm - @import "compass" cannot resolve -

Image
i'm on windows7, i've installed compass , configured correctly in project folder. i'm new scss , compass when launch compass watch cmd style.scss gets automatically compiled , seems fine. [ver. compass 1.0.1 // sass 3.4.3]. but when open style.scss phpstorm @import "compass" comes error cannot resolve import sass/scss ; opening phpstorm's compass support looks default options correct: compass executable file: c:\ruby200-64\bin\compass config path: pointing local server , correct this watcher setting: i've tried changing can't compass support work.... eventually way found working creating symlink between sass folder , compass executable; i found old answer on helped me... in detail: 1.open cmd (as admin) , change dir sass folder in project . 2.from sass-folder create symlink mklink /d compass c:\ruby200-64\lib\ruby\gems\2.0.0\gems\compass-1.0.1\bin\compass . now phpstorm works fine (with default filewatch...

annotations - sonarqueue plugin for java ee -

we using sonarqube quite alot our code analysis, false errors sonar not recognize ejb annotations methods: @postconstruct protected void initialize() { service = getservice(); } this gives unused protected method, have been private too, protected testing purpose. question how avoid getting java ee annotations or other annotations give errors in sonar? and no not want use //nosonar we sonar know method called container, though there no code calling it. you're right, feel free vote https://jira.codehaus.org/browse/sonarjava-117 should fixed in version 2.5 of sonarqube java plugin.

javascript - Jquery print area print css colors -

i'm using printarea jquery: https://github.com/ritsc/printarea but i'm having little trouble print colors when printing i want print when print https://imagizer.imageshack.us/v2/815x185q90/673/imzbhd.jpg that's have: https://imagizer.imageshack.us/v2/437x549q90/674/ddksru.jpg this js: $('#imprimir').on('click', function(){// busca os dados ao clicar no botão $(".area_impressao").printarea({ mode : "iframe", standard : "html5", poptitle : 'relatorio', popclose : false, extracss : '../css/impressao_retrato.css', extrahead : '', retainattr : ["id","class","style"], printdelay : 500, // tempo de atraso na impressao printalert : true, printmsg : 'aguarde impressão' }); }); i tried change line didnt work: extracss : '../css/impressao_retrat...

logging - How to log failed Asset detail in BCC during data import -

Image
i importing csv files atg bcc manuallly.while import assets failed due data issue.for example category not import due missing child products.in bcc import popup showing message 1 out of 44 item missing.but not provide id of missing item.for larger data imports difficult find out failed repository ids in source data. i tried enabled logs of /atg/web/assetmanager/transfer/importasset no help. there component in bcc can enable logs , see failed assets detail (in above example missing product ids failed category)?? thanks in advance which version of atg having problem with? i've created sample import file folders not exist , imported it. reported 2 items not imported , when scrolled column in question highlighted missing folders. case in atg 9.x hopefully helps.

wkhtmltoimage make sharpen screenshots -

it works. make screenshots. make sharpen artefacts. why? maybe because wkhtmltoimage running without x? try information? how smooth screenshot via wkhtmltoimage? this firefox , chromium 800x420: http://s18.postimg.org/xff896gsp/screenshot_10.png and wkhtmltoimage 800x420: http://s9.postimg.org/auikf44st/screenshot_11.png problem solved. im used: wkhtmltoimage 0.10. trying use newest version: wkhtmltoimage 0.12 - works, images not sharpen, failed stretch background images (-webkit-background-size: cover). and perfect works: wkhtmltoimage 0.11 (static library amd64)

hadoop - How do I transform a parameter in Pig? -

i need process dataset in pig, available once per day @ midnight. therefor have oozie coordinator takes care of scheduling , spawns workflow every day @ 00:00. file names follow uri scheme hdfs://${dataroot}/input/raw${year}${month}${day}${hour}.avro where ${hour} '00'. each entry in dataset contains unix timestamp , want filter out entries have timestamp before 11:45pm (23:45). need run on datasets past, value of timestamp defining threshold needs set dynamically according day processed. example, proessing dataset december, 12th 2013 needs threshold 1418337900. reason, setting threshold must done coordinator. to best of knowledge, there no possibility transfrom formatted date unix timestamp in el. came quite hacky solution: coordinator passes date , time of threshold respective workflow starts parameterized instance of pig script. excerpt of coordinator.xml: <property> <name>threshold</name> <value>${coord:formattime(coord:dateof...

Android fetching images from url & storing on devices and then again using it -

hi guys started developing android application , bit confused on best way accomplish it application flow when activity starts fetches data database(sqlite), database returns list of data ,this list of data contains text , url image. so want activity start listview populated text data , images. the images first searched locally if not present images fetched url after fetching completed image added respective view , stored on device these images once downloaded should remain on device until app uninstalled issues as start activity list view gets populated data local database images takes time download so tried asynchronous image loader problem if activity started , device isn't connect net image wont show after if connect internet these images wont show is easier way handle images if need delete these images in future can. if 1 can provide refrence project or available libraries handle these task .thnx in advance i don't way loading ima...

html - Double markup for image -

my current base theme website producing strange double markup article image , don't know if ok, or isn't good, when inspected firebug shows: <figure class=" field-item even" resource="http://localhost/adapt2/sites/default/files/styles/330/public/field/image/73d7edd1405081e5433c41d9ad2ee18c_l.jpg?itok=eitse7sp" rel="og:image rdfs:seealso"> <img class="image-style-330" width="333" height="333" alt="my image alt" src="http://localhost/adapt2/sites/default/files/styles/330/public/field/image/73d7edd1405081e5433c41d9ad2ee18c_l.jpg?itok=eitse7sp" typeof="foaf:image"> it seems there hardcoded <figure> tag image, , website produces usual img src tag ; still - can see 1 image i'm not sure if double markup may produce double image printing? or better remove hardcoded <figure> markup? this not double, <figure> container element in html5. ...

web applications - JavaScript file is not loading fully in all browsers -

i see strange behavior (or may missing something). have websphere 8.5. deployed ear. working fine. instead of repacking , deploying every time small change, copy js , css files directly websphere exploded folder , overwrite existing files. see changes getting reflected. i updated js file , added couple jquery functions , copied file above. when refresh page, see updated code (which somewhere in middle of file). js file not loading in 3 browsers (ie8, chrome , ff latest). it's getting cut off in last 10 lines so. the file has 1784 lines. not sure if there size limit on browser side or websphere tinkering or else going on. idea? i did check js file copied exploded websphere folder. has complete code. note page has few more js files (jquery , other files) in addition one. edit: i think websphere keeping size of file somewhere (maybe?) , sending size every time, unless there clean deploy or restart (?). i removed few lines of updated code. browser loads, many number...

css - How to proper load custom fonts on website -

i'm declaring custom font inside css file, using @import , assigning them elements: i not have access head tag of site, i'm doing in body... this not work.., question custom font must declared in head of page in order load? using jvascript (function loadcss(url) { var link = document.createelement("link"), url = "app/components/core-jasmine/jasmine.css"; link.type = "text/css"; link.rel = "stylesheet"; link.href = url; document.getelementsbytagname("head")[0].appendchild(link); })();

Downloading a deployed app packaged from a Windows Phone device -

i've had data loss. able download compiled app package have deployed on phone. haven't been able download app package have uploaded in store (as identical), if there way that, amenable well. is there way download app package device or store page? edit: should note "store page" mean "app submission page". you can download xap file manually application's store page. example, have game haven't updated in forever (forgive me) :) number munchers xl scroll down bottom on left side of page, , see download , install manually learn more click on , should greeted xap file download.

c# - convert username to guid for asp.net validation using 'asp:login'/'SqlMembershipProvider'(membership) -

using 'asp:login' tag 'membership' in web.config file authenticate users. need query users without using 'asp:login' tag. need able convert string username (e.g., 'username') 'guid'/'userid' in database(e.g., '00000000-0000-0000...') in order this. there 'guid.parse/tryparse' method expects in '00000000-0000-0000...' format. appears in kind of hex format. there issue of password encrypted separate issue. thanks. try this: membershipuser user = membership.getuser(theusername); guid userid = (user == null) ? guid.empty : (guid)user.provideruserkey; the guid id of user stored in the provideruserkey property of the membershipuser class . to retrieve instance of membershipuser class user specific username, need use the static membersip.getuser(username, userisonline) method . assuming you're querying user other current user, passing false userisonline parameter ensures don't affec...

javascript - How to disable form (user cannot checked, fill text , select dropdown etc.) in this form when process requests post ajax? -

how disable form (user cannot checked, fill text , select drop down etc.) in form when process requests post ajax ? i want disable form id="f1" when process send post ajax , how can ? <script> function send_requests_data(){ $('#demoajax').hide(); $('#loading').show(); $.ajax({ url: 'test.php', type: 'post', data: $('#f1').serialize(), success: function(data){ $("#loading").fadeout("slow"); $('#demoajax').show(); $('#demoajax').html(data); } }); return false; } // on load page call function code // $(document).ready(send_requests_data()); </script> a possible answer may found here: disable form elements inside div tl;dr try adding this: $("#parent-selector :input").attr("disabled", true); to ajax call parent-selector either div or form id. ...

Create hive database and table from Java -

are java libraries let me create hive database , tables java? i've googled lot not find any. any appreciated. you can jdbc connections. check these link: 1.) hive server1 hive 0.10 , below. 2.) hive server2 hive 0.11 , above. hope helps...!!!

android - How to display four images using coverflow as shown in the attach image link? -

Image
i new android , trying develop app should display images located in drawable folder, shown in image: please provide suggestion on how achieve effect. providing of appropriate link , explaining code highly appreciated... here coverflow lib android just download project , import in eclipse , run and code example : java code /**** * class coverflowtestingactivity. */ public class coverflowtestingactivity extends activity { private textview textview; /* * (non-javadoc) * * @see android.app.activity#oncreate(android.os.bundle) */ @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main); textview = (textview) findviewbyid(this.getresources() .getidentifier("statustext", "id", "pl.polidea.coverflow")); // note resources below taken using getidentifier allow importing // library library....

python - pandas groupby to nested json -- dont want calculated fields -

i'm working on d3.js graphic. data in huge multitab .xls. have grab data each tab, decided dump in pandas , export .json. original data, spread across many tabs: demography, area, state, month, rate on 65, region2, ga, may, 23 on 65, region2, al, may, 25 nan, random_odd_data, mistake, error 18-65, region2, ga, 77 18-65, region2, al, 75 now, put in pandas, merged , cleaned up: demography area state month rate 0 on 65 region2 ga may 23 1 on 65 region2 al may 25 2 18-65 region2 ga may 50 3 18-65 region2 al may 55 now, group it group = df.groupby(['state', 'demography']) yields <pandas.core.groupby.dataframegroupby object @ 0x106939610> trying this: group = df.groupby(['state', 'demography']).count() yields correct, except don't want count anything, want "rate" state demography area month rate al on 65 1 1 1 ...

html - Button not absolutely positioned in section -

these buttons supposed absolutely positioned within .gallery , reason, when expand viewport, stretch outside of gallery , positioned viewport. missing here? html: <section class="gallery"> <div> <a href="http://www.cnn.com"> <img src="/img/gallery-img-1.jpg" alt="cover of lookbook"> </a> </div> <ul> <li><a href="http://www.cnn.com"><img src="/img/gallery-img-1.jpg" alt="cover of lookbook"></a></li> <li><a href="http://www.cnn.com"><img src="/img/gallery-img-2.jpg" alt="some beautiful necklaces"></a></li> <li><a href="http://www.cnn.com"><img src="/img/gallery-img-3.jpg" alt="more beautiful necklaces"></a></li> </ul> <button class="arrow leftarrow">&lt;</bu...

php - How can I go back to the previous page (using the browsers back button), without throwing any error "Confirm Form Resubmission" -

how can go previous page without throwing error confirm form resubmission, i've searched, followed patters such storing posted data in session variable in page main page , redirect session variable navigating page. doesn't work :( this code: index.php <form method="post" action="value.php"> <div id="bar"> <div id="banner"> <img id="img1" src='1.png' height='40' width='200'> &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp &nbsp <div id ="login"> log-in &nbsp &nbsp &nbsp username: &nbsp <input type = "text" name = "username" size = "20" maxlength = "40"> &nbsp &nbsp password: &nbsp <input type = ...

ios - Build error with Xcode 6 and (possibly) cocoapods -

Image
i'm getting following static analyzer error when building ios project using cocoapods latest xcode 6 gm release. error: error reading 'pic' error: no analyzer checkers associated '-mrelocation-model' 2 errors generated. command /applications/xcode6-beta6.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang failed exit code 1 i can disable static analyzer, don't want that. know how fix ( or workaround ) , causing error? it appears known issue fix in queue next version of cocoapods. check out bug report more info. supposedly can work around in meantime re-enabling warnings (e.g remove inhibit_all_warnings podspec). alternatively, , turned out real problem me, had deprecated flag set on couple of files. removed these flags , build succeeded.

html - CSS centered border -

Image
hy everyone, i want have border around login form in html code, current code, isn't quite want. want border encapsulate centered elements. idea how that? the result looks this: my code: index.php: <?php include "base.php"; ?> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script> <!doctype> <html> <title>shopping list</title> <link rel="stylesheet" href="style.css" type="text/css" /> </html> <head> </head> <body bgcolor=#878787> <div class="form"> <center><h1>please enter login details</h1></center> <form> <label for="username">username:</label><input type="text" name="username" id="username" > </br> <lab...

How to add Google's Guava to eclipse so I can read the source code -

i can add guava-18.0.jar project, yet binary code. i want read source code ctrl+click. thanks! you can sources , javadoc jars here you may want create user library 3 jars go [window] → [preferences] → [java] → [build path] → [user libraries] click [new] , type name of library, guava18 → click ok click [add external jar] locate jar. then can edit [source attachment] , [javadoc location] after that, project, in build configuration dialog, [add library] → [user library]. select guava library.

regex - No such file or directory at - Perl dead file closes program -

they want me create feed catalog, table of jobs autosys , infiles , outfiles jobs depend upon. the idea that, instead of calling boss @ 3:00am when job fails, level 1 can match failed job file, or vice versa, , fix issue. the script takes in autosys config file, takes out executable line, substrings it, opens file, , regexes out path line. works fine except gasses out when can't open file. i getting error. dead file handle no such file or directory @ ./slurp_autosys_config.justexec2 line 10, <$autosys_fh> line 352. #!/usr/bin/perl use strict; use warnings; open $autosys_fh, '<', "/data/autosys-us.cfg" or die "can't open file $!"; while ( $cfg_line = <$autosys_fh> ) { if ($cfg_line =~ /executable/) { $cut_cfg_line = substr "$cfg_line", 13; if ( $cut_cfg_line =~ /(\/\s*\.[sh,pl,ksh])/ ) { chomp($cut_cfg_line); open $fh_cut_cfg, '<', $cut_cfg_line or die ...

slider - Wordpress - How to display original featured Image Size in Post -

i have created custom post type "slider". problem having is not displaying original picture size in slider. here's code <?php $options = array( 'post_type' => "slideshow", ); $my_query = new wp_query($options); while ($my_query->have_posts()) : $my_query->the_post(); if ( has_post_thumbnail() ) { $image = wp_get_attachment_image_src( get_post_thumbnail_id( the_id())); }?> <div data-thumb="<?php echo $image[0];?>" data-src="<?php echo $image[0];?>"> </div> <?php endwhile; ?> according docs , pass parameter large wp_get_attachment_image_src function: wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' ); the problem checking source code function seem limitation in size of image.

linux - Log4cxx SocketAppender leads to application crash -

i using log4cxx , started working socketappender here 1 . use following: java org.apache.log4j.net.simplesocketserver 4712 log4j-server.properties and able write logs on server. have local sizerollover policy setup. works fine, until stop running simplesockerserver. @ point c++ application crashes, think after reconnectiondelaytime specified in properties file. 0 0x0000003c5fa0e6fd in write () /lib64/libpthread.so.0 1 0x00007ffff79eade7 in apr_socket_send () /usr/lib64/libapr-1.so.0 2 0x00007ffff7d52bb1 in log4cxx::helpers::socket::write(log4cxx::helpers::bytebuffer&) () /usr/lib64/liblog4cxx.so.10 3 0x00007ffff7d595ed in log4cxx::helpers::socketoutputstream::flush(log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10 4 0x00007ffff7d5468c in log4cxx::net::socketappender::append(log4cxx::helpers::objectptrt const&, log4cxx::helpers::pool&) () /usr/lib64/liblog4cxx.so.10 5 0x00007ffff7cd7d9d in log4cxx::appenderskeleton::doappend(log4cxx...

angularjs - Unit test of a function containing promises is not working as expected -

i'm trying unit test controller handles signing user in. i'm getting error , think may have code using promises i'm not sure @ point. here's controller. angular.module('app').controller('signin', signin); function signin ($scope, $state, auth) { $scope.credentials = {}; // signin $scope.signin = function () { auth.signin($scope.credentials) .then(function () { $state.go('user.welcome'); }, function (res) { $scope.signinerror = res.statustext; }); }; } here's auth services. angular.module('app').factory('auth', auth); function auth (session, api) { return { signin : function (credentials) { return api.signin(credentials) .then(function (res) { session.create(res.data.sessionid, res.data.username); }); }, signout: function () { ...

sql - Mysql: is it better to split tables if possible? -

to make understand question i'll give example: have chat web app many rooms, let's 5 rooms. people can choose stay in 1 room , choose @ login. when choose room have retrieve people in room, can structure db in 2 ways: each room 1 table people being records; rooms in 1 table, people records , column indicating room in; in first case query be: select * 'room_2' 1 in second case query be: select * 'rooms' room = 'room_2' which best? think parameter consider performance, right? in example, no, because people 'like' objects , should therefore in same table. people , rooms in 1 table primary key on people, in simple example. table rooms(pk_person, personname, table_id) but want talk structure want consider website grows. you’ll want 3 tables, 1 each object (chat rooms, people) , 1 relationships. chat_rooms(pk_chatid, chatname, maxoccupants, other unique attributes of chat room) people(pk_personid, firstname, lastname, othe...

mysql - fail to install mysql2 gem -

i'm trying setup not old (but still few years) of rails project on new mavericks machine. when try bundle , keep getting error (sorry long code): gem::installer::extensionbuilderror: error: failed build gem native extension. /users/royzinn/.rbenv/versions/1.8.7-p352/bin/ruby extconf.rb --with-mysql-config=/usr/local/cellar/mysql/5.5.20/bin/mysql_config checking rb_thread_blocking_region()... no checking rb_wait_for_single_fd()... no checking mysql.h... no checking mysql/mysql.h... no ----- mysql.h missing. please check installation of mysql , try again. ----- *** extconf.rb failed *** not create makefile due reason, lack of necessary libraries and/or headers. check mkmf.log file more details. may need configuration options. provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcd...

pin it sdk - Pinterest button - Parameter 'source_url' -is not a valid URL format -

i using pinterest button in website sharing image. have used third part widget addthis.com attaining functionality. code in html looks below.. <div class="social-media-icons1"> <a class="addthis_button_pinterest_share" title="pinterest" > <img class="social-media1" th:src="@{/img/common/btn/btn_pinterest.gif}" /> </a> <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-5368b8795f957cb6"></script> </div> but when share image below error parameter 'source_url' (value https://10.52.165.234/frenchplace/b43130519/12081907?category=bonobo) not valid url format. can me solution problem.:( i came know issue is. using self-signed https.but pinit work need authenticated ssl certificate. tested using http works.:)

c - libtool version mismatch error persists after running `autoreconf -fvi` -

i'm trying add new binary old project written in c/c++ on machine ubuntu 14.04. first need run ./setup_configure runs following script: #!/bin/tcsh -f 2 3 # new dev/ environment, before running configure, 4 # , anytime after makefile.am file has changed, 5 # following commands must executed within 6 # dev/ directory: 7 8 set cmd1=(rm -rf autom4te.cache) 9 if ( "`uname -s`" == "darwin" ) 10 set cmd2=(glibtoolize --force) 11 else 12 #set cmd2=(libtoolize --force) 13 set cmd2=(libtoolize -f -v) 14 endif 15 set cmd3=(aclocal) 16 #automake --add-missing necessary because config.sub 17 # , config.guess links, , make not present, 18 # if missing, --add-missing add them 19 # platform 20 #set cmd4=(automake --add-missing -wno-portability) 21 set cmd4=(automake ...

java - JOptionPane.showMessageDialog keeps reappearing -

my code supposed ensure users enter binary string. goes right , in order if enter correct binary number (1, 0). when enter wrong number (alphabet or number other 0 , 1) joptionpane.showmessagedialog appears showing error message, , when click "ok" or "cross" button reappears again. close app have use process manager kill "java.exe". here complete code app: import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.util.*; class bn extends jframe { private jlabel l1; private jlabel l2; private jlabel l3; private jtextfield tf; private jbutton oc; private jbutton hd; private jbutton dc; public bn() { settitle("binary conversion"); setsize(350 , 190); setresizable(false); setlocation(720 , 200); //setdefaultcloseoperation(jframe.exit_on_close); setlayout(new flowlayout(flowlayout.center, 25, 10)); l1 = new jlabel(">>>>>>>>binary conve...

entity framework - Unity singleton multiple request access ASP.Net MVC 5 -

i using mvc5 , unity. little confused reading thread safe singletons. multiple users share same singleton object? understanding singleton object created every request , 2 users each have own singleton. correct? [update] let have singleton class property instance instance. 2 users accessing website @ same time accessing same singleton object when calling instance ? scope of object? scope shared among multiple users or every user have own scope? instance return same object both users? it depends on exact lifetime manager use. if "singleton" mean container controlled lifetime manager, instance shared users , not created lifetime of request. on other hand, per http context lifetime managers expect. neither has "singleton" in name, though. http://msdn.microsoft.com/en-us/library/ff647854.aspx http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.perrequestlifetimemanager(v=pandp.30).aspx

sql - Could this be done more efficiently -

i have table 2 columns (p_id, id_type) p_id can have multiple types. need find p_ids not have specific type. p_id id_type ----------- ------------- 12456 6 12456 7 56897 10 25686 9 25686 22 25686 7 56897 22 this query used wondering if there more efficient way this. select p_id #temp1 table2 id_type = 6 select distinct table2.p_id ,table1.name ,table1.type table2 left join table1 on table2.p_id = table1.p_id table2.p_id not in (select p_id #temp1) , type = 'xyz' expected outcome should p_ids not have id_type = 6. p_id name type 56897 smith physician 25686 jones physician assuming i'm understanding question correctly, you're trying select p_id rows don't have corresponding p_id rows specific type. if so, there c...