Posts

Showing posts from April, 2015

php - JQuery adds unwanted div after an ajax call -

i have jquery ajax call add new comment database. saves fine when want reaload div comments shown, additional div not want. when reaload page fine , displayed wanted! the script: <script> $("#addcmt").click(function() { var userid = $("#userid").val(); var classid = $("#classid").val(); var text = $("#appendedinputbutton").val(); var option; if($("#option").is(':checked')) { option = 3; } else { option = 1; } $.ajax({ type: "get", url: "/comment/functions/add_class_comment.php", data: "text=" + text + "&userid=" + userid + "&classid=" + classid + "&option=" + option, success: function(msg) { $("#commentlist").load(loc

php - Autoload Error: No such file or directory -

i have included autoload.php in header of site include 'vendor/autoload.php'; from receiving following errors on site: warning: require_once( dir /composer/autoload_real.php) [function.require-once]: failed open stream: no such file or directory in /homepages/6/d416629391/htdocs/leftovercheese/vendor/autoload.php on line 5 fatal error: require_once() [function.require]: failed opening required ' dir /composer/autoload_real.php' (include_path='.:/usr/lib/php5') in /homepages/6/d416629391/htdocs/leftovercheese/vendor/autoload.php on line 5 my code is: // autoload.php generated composer require_once __dir__ . '/composer' . '/autoload_real.php'; return composerautoloaderinit8be239f5caef32db03f87bb271ed6012::getloader(); php version: 5.2.17 any ideas? you have load vendor/autoload.php , autoload file you: require_once __dir__ . '/vendor/autoload.php'; this assuming file located @ same

sharepoint - Creating a ribbon custom button when inserting content to Sharepoing 2010 -

i want create button popup window , display list it's being requested external source. user click on 1 of items insert , iframe on body of post. for think best way create ribbon custom button right? how can make appear when inserting content such posts? you need create custom action in project. it's small xml file gets installed in farm , dislays ever want. check how add ribbon item using customaction in sharepoint 2010? sample , here extended information on possibilities have http://msdn.microsoft.com/en-us/library/bb802730.aspx

wordpress downloading php file instead of viewing the webpage -

i installed wordpress on local machine (backtrack) experimenting. after got setup moved ubuntu server can access pages @ work. followed same instructions, moved wordpress folder /var/www created new database same username, password , hostname. the problem whenever access webpage @ubuntu tries download file, if access page @backtrack goes dashboard , fine. i did not have .htaccess file on either machine sop created 1 see if fix problem did not. apache works fine because can folders have setup going "http://ubuntuserver/folder name" and logs shows no errors because delivering webpage client fine client downloading instead. any ideas why happening?? sounds haven't installed php module apache or enabled use php using addtype in apache config file.

c# - How to embed an html tag within asp.net label text? -

i trying create hyper link on condition of specific value of database field, news page, , news has content long , in case want create hyper link in case length small no need link, code used: <asp:label id="lblcontent" runat="server" text='<%# string.format("{0}",eval("new_content").tostring().length>150? <a href> eval("new_content").tostring().padright(150).substring(0,150).trimend() + " ..." </a>:eval("new_content")) %>' > </asp:label> but there error, can have help? i trying create hyper link well why not use <asp:hyperlink /> control then? also don't string use substring() reduce length of text , add ... @ end, use css. e.g. <asp:hyperlink id="hlcontent" runat="server" cssclass="trimme" text='<%# eval("new_content").tostri

Converting Java to objective C -

i'm trying convert java code objective-c. class below extension of testcoderequest. wondering how convert objective c equivalent. i'm finding bit confusing because java statically typed, , configuration on convention. whereas objective-c dynamically typed, , convention on configuration. have sample code below. small hint should great. package com.testcode.api; import java.io.ioexception; import oauth.signpost.exception.oauthcommunicationexception; import oauth.signpost.exception.oauthexpectationfailedexception; import oauth.signpost.exception.oauthmessagesignerexception; import org.json.jsonobject; public class categories extends testcoderequest { public categories(string apikey, string apisecret) { super(apikey, apisecret, "categories"); } public categories field(object... fields) { super.field(fields); return this; } public jsonobject getcategories() throws oauthmessagesignerexception, oauthexpectationfai

Synchronizing SQL table via WCF service -

i have 1 table on ms sql db. (2008 r2) table name: messages fields: message_id, message, is_synced on mobile smart phone need develop application sync table records , update table when application synced each record. need support min numbers of calls wcf must not generate call each record. if there n records in table, dont call wcf n times, want call 1 time, records, sync , return using wcf synced results. right way go? can suggest better implementation? you can duplex communication send data smart phones out service when things changed. http://www.codeproject.com/articles/491844/a-beginners-guide-to-duplex-wcf http://msdn.microsoft.com/en-us/library/ms731064.aspx however answer current question given current implementation poll service list of messages @ start or on timer on server can have in simple collection: [servicecontract(namespace = "contracts.idatabaseresponder")] public interface idatabaseresponder { //you use object rather string hav

ios - UITableView inside a UIViewController? -

i need this i've found out how control uitableview having tableview in on uitableviewcontroller. how can control uitableview without having it's on uitableviewcontroller? you can put uitableview inside view controller, make sure set delegate , data source , implements appropriate protocols. as told, example split view controller.

php - How do I pass data from the controller to the template view in ZF2 using Twig? -

i have problem passing data controller template view. no matter how try put data in view file, cannot access data i'm passing template. i've uploaded test module here https://github.com/svenanders/twiglytest controller: <?php namespace twigly\controller; use zend\mvc\controller\abstractactioncontroller; use zend\view\model\viewmodel; class twiglycontroller extends abstractactioncontroller { public function twiglyaction() { echo "go..."; // return array('version'=> \zend\version\version::version); return new viewmodel(array( 'data' => array("test"=>"test2"), )); } } view: {% in data %} <h2>{{ }}1</h2> {% endfor %} ...done result: go... ...done whereas expected receive data between go... , ...done a bit of shot in dark but, can try 1 of following in view? {% key,a in data %} <h2>{{ }}1&l

Altering file name with php -

i'm getting info out of rss feed. how can change file name php? say have filename: http://anyurl.com/any_file_name_200.jpg i need change last part of "200.jp" number, "800.jpg". need dynamically, because "any_file_name" different, file names have same structure in end "123.jpg" any ideas? you can use preg_replace : $filename = 'any_file_name_200.jpg'; $newfilename = preg_replace('/\d{3}\.jpg/','800.jpg',$filename);

javascript - Save current generated PHP page as HTML to server database -

what approach should used save current generated php page html file in server database? my php page liquidation report want save , uses javascript generated, buffering didn't work (ob_start , ob_get_contents). edit: i use simple css styles , javascript give effect of expand-collapse objects listed. function showhide(hid,img) { if (document.getelementbyid(img).src.indexof('expand') != -1) { document.getelementbyid(img).src='../../images/collapse.gif'; document.getelementbyid(hid).classname='visiblerow'; } else { document.getelementbyid(img).src='../../images/expand.gif'; document.getelementbyid(hid).classname='hiddenrow'; } } something post $(body).html() via ajax trick.

Checking if a list is already in the dictionary in python -

i trying check if list s in dictionary in python. code supposed generate 2 random numbers(r1 , r2) , append them list in dictionary if same 2 numbers aren't in there. here code: main_dict = {0:[], 1:[], 2:[], 3:[], 4:[]} x in range(0,5): r1 = randint(1,5) r2 = randint(1,5) temp = [r1,r2] if temp not in main_dict: main_dict[x].append(r1) main_dict[x].append(r2) so main_dict should this: {0:[2,3],1:[4,1],2:[3,3],3:[3,2],4:[5,1]}, , code above should take care no combination repeated. the error "typeerror:unhashable type: 'list'", , guess because can't put list next if, have no idea else put, have tried came mind. thanks in advance :) the problem getting because looking in dictionary if list exists. that, comparing list keys of dictionary. want is: if temp not in manin_dict.values():

Twitter4j Google App Engine - java.lang.NoClassDefFoundError -

i'm trying create java application on google app engine using twitter4j library. when create normal ( not google ) app can use twitter4j , works fine. include library in project -> properties -> java build path -> libraries -> add external jars. code: twitter twitter = new twitterfactory().getinstance(); twitter.setoauthconsumer(consumer_key, consumer_secret); twitter.setoauthaccesstoken(new accesstoken(oauth_token,oauth_token_secret)); try{ responselist<status> = twitter.getusertimeline("medium"); for(status b:a) { system.out.println(b.gettext()); } } catch(exception e) { system.out.println(e.tostring()); } when create google java project , try initialize twitter error : java.lang.noclassdeffounderror: twitter4j/twitterfactory @ com.paperbox.helloworldservlet.doget(helloworldservlet.java:26) @ javax.servlet.http.httpservlet.service(httpservlet.java:

Set Font globally in JavaFX -

how can set font type globally in javafx application? is there solution can use? in javafx 8 default font has changed, , use same font used in javafx 2.2. you can skin application css described on oracle website . using following syntax may set general theme application: .root{ -fx-font-size: 16pt; -fx-font-family: "courier new"; -fx-base: rgb(132, 145, 47); -fx-background: rgb(225, 228, 203); } you include css followed: scene.getstylesheets().add(getclass().getresource("application.css").toexternalform());

css - Animating Flexbox with Media Queries? -

i'm trying create website using flexbox, , 1 of main features of site hide navigation bar, in case left panel in jsfiddle , when viewport between 480px , 1023px. works, animation jumpy , not clear happening. right trying use transition in css3, doesn't seem animate @ all... going this: aside { -webkit-transition: 1s ease; width: 270px; } to this: aside { display: none; } no transition happens between 2 states. how can animate navigation disappearing , main growing fit screen? you can not animate display in css of today. you can chain animation on properties can animated. instance width , height of flexboxes.

In Scala, how can I get the max date from an array of maps where one of the keys in the map is "date"? -

i have array of maps , maps , find maximum date in array of maps , think i'm heading down non-scala path because i'm not sure how wire pieces of question together. is there better way of doing this? i'm concerned need assume things casting value date comparison, what's in map , map includes other data types (so map[string, object] have) val df = new simpledateformat("yyyy-mm-dd") def omap = list(map("date" -> df.parse("2013-08-01")), map("date" -> df.parse("2013-02-01"), "otherkey" -> "nothing special"), map("date" -> df.parse("2013-01-01"))) omap.max(new ordering[map[string, object]] { def compare(x: map[string, object], y: map[string, object]) = x.get("date").get.asinstanceof[date] compareto y.get("date").get.asinstanceof[date] }) the code seems work, feel i'm missing more scala way of doing this. this little 1 liner

node.js - Cannot find view in node/express -

as username implies, i'm new node.js. i'm trying learn it. part of process, i'm working setup basic web site. web site show couple of basic web pages , expose single rest endpoint. structure of project is: config.js home.html start.js routes.js server.js resources css style.css images up.png down.png javascript home.html.js start.js has main server code. file gets executed via command line using 'node start.js'. once started, server begins listening on port 3000. code in start.js looks this: var express = require('express'); var app = express(); var userprofilehandler = require('./app/handlers/userprofilehandler'); app.configure(function () { app.engine('html', require('ejs').renderfile); app.set('views', __dirname + '/'); app.use(express.logger({ stream: expresslogfile })); app.use(express.bodyparser()); app.use(express.methodoverride()); app.use(app.router); app.use(e

Can't mass-assign protected attributes in Rails 4 -

i can't understand what's wrong code (rails 4): parameters post: {:name => "name"} new action: m=menu.new(params.permit(:name)) last line of code generates "can't mass-assign protected attributes menu: name" the standard way use strong_parameters in rails 4 create private method in controller defines permitted params. so: def new @m = menu.new(menu_params) end private def menu_params params.require(:menu).permit(:name, :etc, :etc) end then, can remove attr_accessible line model. see: http://edgeapi.rubyonrails.org/classes/actioncontroller/strongparameters.html http://railscasts.com/episodes/371-strong-parameters

exporting to csv with powershell -edited -

i'm reading in csv file (list of students, school, birthdays, etc) creating login names , exporting data csv imported system. working great except can 1 line of data in csv file (the last user name). assume overwriting same line each time. doing in powershell. help. here's code: add-pssnapin quest.activeroles.admanagement #import list of students hourly ic extract $users = import-csv c:\users\edge.brandon\desktop\enrollment\mbcextract.csv | {$_.'grade' -ne 'pk' -and $_.'name' -ne 'ombudsman' -and $_.'name' -ne 'ombudsman ms' -and $_.'name' -ne 'z transition services' -and $_.'name' -ne 'z home services'} if ($users) { foreach ($u in $users) { # sets middle name , initial null variable not cary on next student if have no middle name $middle= $null $mi= $null $first= ($u.'firstname') $last= ($u.'lastname') $middle= ($u.'middlename') $

jaxb - Issues with JSON processing using JAXBElement under Jersey 2.2 with MOXy -

i extended jersey-examples-moxy code use xml schema definition instead of jaxb annotated beans. xjc compiled xml schema produces xml , json encodings identical original example. i followed jersey instructions , used objectfactory generate jaxbelement customer object representation within customerresource.java. modified client described. incorporated fix described in put issues json processing using jaxb under jersey 2.2 moxy the mediatype.application_xml functions perfectly, , mediatype.application_json works gets, client failing marshall json on put "messagebodywriter not found". following exception thrown: testjsoncustomer(org.glassfish.jersey.examples.jaxbmoxy.moxyapptest) time elapsed: 0.113 sec <<< error! org.glassfish.jersey.message.internal.messagebodyprovidernotfoundexception: messagebodywriter not found media type=application/json, type=class javax.xml.bind.jaxbelement, generictype=class javax.xml.bind.jaxbelement. @ org.glassfish.jersey

internet explorer - How does IE encoding auto-select works? -

if use ie open webpage content-type charset not set explicitly. , assume web server doesn't add charset value in http response header. so, in situation, criteria ie takes determine encoding when rendering webpage? interent explorer relies upon component called "mlang" windows globalization team attempt "sniff" bytes returned server determine character set in use. this code not documented, uses frequency analysis , information current user's locale attempt "guess" codepage server used. pages should always set proper charset in order avoid sniffing, can result in unpredictable results (e.g. instance, heuristic can return different results when run on japanese machine vs. on us-english machine).

php - No events being shown when retrieving events using google calendar -

i encountering problem code when trying retrieve events on google calendar. below code: <?php require_once 'google-api-php-client/src/google_client.php'; require_once 'google-api-php-client/src/contrib/google_calendarservice.php'; session_start(); $client = new google_client(); $client->setapplicationname("google calendar php starter application"); // visit https://code.google.com/apis/console?api=calendar generate // client id, client secret, , register redirect uri. $client->setclientid('client id'); $client->setclientsecret('client secret'); $client->setredirecturi('redirect uri'); $client->setdeveloperkey('developer key'); $cal = new google_calendarservice($client); $events = $cal->events->listevents('email address google calendar'); echo $events; ?> when print out events of google calendar, empty array. sure have several events in google calendar. in fact, event tr

php - Query result data is displaying after page reload -

this code. index.php file: $viewer_id = $_session['viewer_id']; $db = new database('144.76.6.45','5432','3331','asd','31sd23'); $db->queryselect("select * users vk_id = $viewer_id"); $row = $db->sth->fetch(); if(empty($row)){ require 'template/default/not_logged.php'; } else { require 'template/default/logged.php'; } this part understandable. connecting database, doing query. if viewer's id in db - logged.php if not - not_logged.php lets viewers id in db. logged.php file: <div id="text-right"> <p>Игровой ник: <?php $user->geteuname(); ?></p> <p>cоциум: <?php $user->getsociety(); ?></p> <p>Основная профессия: <?php $user->getmainprofession(); ?></p> <p

if statement - Woocommerce Tabs Conditional -

i running woocommerce plugin ( version 2.013) woocommerce tab manager extension (version 1.08). canvas child theme (version 0.1.0) i'm trying show tabs products using conditional statement. the tab manager doesn't allow conditional statements each tab. allows default global tabs or product specific tabs assigned in product edit page. i found decent way show tabs in product page based on product attribute. first thought share code because seems work. i'm still wondering if there better way this? what create tab in tab manager , apply conditional statement it. // video tabs product page - activate new video tab if attribute matches add_filter( 'woocommerce_product_tabs', 'video_tab' ); function video_tab( $tabs ) { $type = array_shift(woocommerce_get_product_terms($_product->id, 'pa_type', 'names')); if ( $type == "typea" ) { $video_tab = array( 'video_tab' => array( 'title' => $

How to give authorization to a user in SAP? -

i learning sap - abap.... , have downloaded sap website, , version have downloaded , installed is: sap netweaver application server abap 7.02 sp6 32-bit trial version i logged in ddic account , wanted create program, couldn't that. , have read can't ddic account. so created , dialog account, put in user group: developers , when try go se80, says: you not authorized use transaction se80 how can authorize new created account?? can me telling me step step, because new in sap. go transaction su01 , add profile sap_all user.

android - PreferenceActivity onHeaderClick() doesn't work -

i have been using holoeverywhere 's preferenceactivity while. importing slidingmenu library , has been going far until extended slidingmenu 's slidingpreferenceactivity : import com.jeremyfeinstein.slidingmenu.lib.slidingmenu; import com.jeremyfeinstein.slidingmenu.lib.app.slidingpreferenceactivity; public class settingsactivity extends slidingpreferenceactivity{ ... and import com.jeremyfeinstein.slidingmenu.lib.slidingmenu; import org.holoeverywhere.preference.preferenceactivity; public class slidingpreferenceactivity extends preferenceactivity implements slidingactivitybase { ... in settingsactivity load header 's show top level categories. my problem onheaderclick() no longer working. trace way through , cannot find error. following stack trace see holoeverywhere ends making intent passes android activity , don't see wrong. what slidingmenu library cause fragments stop working in preferenceactivity ? turns out problem had not

javascript - Two side by side divs, fluid with max width -

i have 2 side-by-side divs, in left div have text, , right div may or may not have text (if doesn't have text, have no content @ all). if right div has text ... width of left div should expand equal width of text, 50% of width of parent div. if right div not have text ... width of left div should expand equal width of text, 100% of width of parent div. in either case if there text fit on 1 line of div, should wrap next line. is possible using straight css? or have javascript solution? thanks! you can implement both css , whatever scripting language using populate page. here's sudo if right-div-content-exists create left div style="width:50%"; create right div style="width:x%"; else create left div style="width:100%";

c++ - Pointer vs Return -

which faster when assigning variable via method, return variable, or point variable? case 1 : function declaration void foo(int* number) { *number = 5; } usage int main() { int number; function(&number); cout << "number: " << number; } case 2 : function declaration int foo() { int number = 5; return number; } usage int main() { int number; number = function(); cout << "number: " << number; } ps: in case 2, created variable , returned instantly. know doesn't make sense, closest example can find situation i'm dealing with, since i'm initializing actual object, requires creating object first, editing it, returning it it depends on cost of copying variable. primitive types, return value. more complex types consider passing in reference, or take @ c++11 move semantics.

php - disagreeing md5 hashes of same string, with example -

this getting me crazy, md5's don't agree. have string: the combinations generator tool allows create series of combinations selecting related attributes. example, if you're selling t-shirts in 3 different sizes , 2 different colors, generator create 6 combinations you. when hash on computer using md5 function (with php 5.5.0) produces following hash: 422f3f656e1a5f95e8b5cf7565d815b5 http://www.miraclesalad.com/webtools/md5.php agrees computer's result. http://www.md5.cz/ disagrees both computer , miraclesalad. this string/md5 pair computed computer gives same result md5.cz. i read encoding issues (although string doesn't contain non ascii characters), tried following code on computer: <?php $str = "the combinations generator tool allows create series of combinations selecting related attributes. example, if you're selling t-shirts in 3 different sizes , 2 different colors, generator create 6 combinations you."; echo &

tsql - Parameterized SQL with dynamic WHERE column -

i trying write simple filtering, user can input column filter , value. tricky part dynamically choosing column filter. i've found couple solutions on web , not sure implement. preference lean toward performance instead of maintainability. opinions appreciated. let's assume have table "t", has 5 varchar columns: "c1", "c2", "c3", "c4", , "c5". solution 1 - easy way i use dynamic sql. on lines of: declare @sql varchar(max) = 'select * t ' + @columnname + ' = ''' + @columnvalue + ''';' exec (@sql); which come out like: select * t c1 = 'asdf' ; i don't want use solution following 2 reasons. i'm including simple point of reference before going down rabbit hole. it not guard against sql injection. even if parameterize columnvalue, have 5 different execution plans cached each of 5 columns since cannot parameterize @columnname. solution 2 -

javascript - Trigger nested tab pane on Bootstrap 3 -

i'm developing site using latest bootstrap release, , need figure out how solve this: i've nested 2 tab panes, able manage lot of information in little space (it´s long law , need show articles clearly) the first tabs divides main sections, nested shows in little pieces articles. it works fine in main container. but i´ll need navigation tree in sidebar, , can´t trigger nested pane tab if parent 1 isn´t enabled. i think posible add jquery trigger parent tab when clicking direct link nested one, don´t it... :( this code (my apoligies, see long): <!-- sidebar --> <div class="bs-sidebar" role="complementary"> <ul id="test"> <li><a href="#test_1" data-toggle="tab">title i</a> <ul> <li><a href="#test_11" data-toggle="tab">sub_title i</a></li> <li><a href="#test_12" data-toggle="tab">

sparql - Unexpected result using LIMIT with CONSTRUCT -

something strange going on in construct query using limit . expect receive 1 or 2 solutions limit 1 , limit 2 , respectively, i.e., 1 or 2 graphs, instead 2 graphs, either 11 or 12 triples. construct { ex:sceneresource skos:related ?newscenesubject. ?newscenesubject lcx:scene ; dcterms:subject ?type ; lcx:hastitle ?title ; lcx:describedby ?thumbnail ; lcx:motto ?motto ; lcx:freebaseid ?freebaseid } { { ?newscenesubject ex:interesttype1 } union { ?newscenesubject ex:interesttype2 } ?newscenesubject lcx:hastitle ?title ; ?type . lcx:freebaseid ?freebaseid . optional { ?newscenesubject lcx:motto ?motto } optional { ?newscenesubject lcx:describedby ?thumbnail } } limit 2 have misunderstood limit construct , or there bug in jena api? your question little unclear expecting , got attempt answer anyway. the limit applie

javascript - Function pipeline in Node JS web server -

i'm working on function pipeline similar connect/express request pipeline use().. a request handler runs through stack of functions added using .use() function. async, n() function must called continue. the functions called using familiar (req, res, next). works, last added first executed, i'm finding confusing , i'd make first added first executed. works last in , continues r, s references across pipeline.. (i use r, s instead of req, res in these examples..) var s = { chain: function(r, s, n){ // runs last, first added s.end(); }, use: function (f){ this.chain = (function(nxt){ return function(r, s, n){ f(r, s, nxt.bind(this, r, s)); } })(this.chain); }, listen: function (){ this.use(function (r, s, n){ // runs first, last added n(); }) var svr = require('http').createserver(this.chain); svr.listen

android - setOnItemClickListener in ListView affecting multiple rows -

i have custom listview , custom adapter. when clicking row of listview, text of textview set white , background of row set black. all when clicking row, other rows having background color set black , when scrolling , down mess up. getview() in custom adapter public view getview(final int position, view convertview, viewgroup parent) { final listitem holder; view vi=convertview; if(vi==null){ vi = inflater.inflate(r.layout.list, null); holder = new listitem(); holder.nametext= (textview) vi.findviewbyid(r.id.name); vi.settag(holder); }else{ holder = (listitem) vi.gettag(); } holder.nametext.settext(""+item.name); return vi; } in mainactivity: customadapter listadapter = new customadapter(context, r.layout.list, items); list.setadapter(listadapter); list.setonitemclicklistener(new onitemclicklistener() { @override public void onitemclick(adapterview<?> adapter, vie

java - Jtable duplicate Rows -

Image
when add new rows in jtable duplicate rows many times this method update jtable public final void tableaucomande(){ ((defaulttablemodel)tabcommande.getmodel()).getdatavector().clear(); session s=hibernateutil.getsessionfactory().opensession(); criteria cr1= s.createcriteria(commande.class); list <commande> lcs=cr1.list() ; criteria cr2= s.createcriteria(lignecommande.class); list <lignecommande> lck=cr2.list() ; if(lcs.size()!=0 && lck.size()!=0) { (commande lc:lcs) { for(lignecommande lig:lck){ ((defaulttablemodel)tabcommande.getmodel()).addrow(new object[]{ lc.getid_cmd(),lc.getnumcmd(),lc.getdate_cmd(),lc.getclient().getnomprenom(), lig.getproduit().getlib_prd(),lig.getquantite(),lig.getproduit().getid_prd() }); } } // tabcommande.setrowselectioninterval(tabcommande.getrowcount()-1,tabcommande.getrowcount()-1); } } this code add add data rows displaye

excel - Is there a way to prevent autoresolve in outlook? -

i sending email automating outlook excel , have managed bypass pesky warning message viruses using sendkeys (with inspector activate prior call sendkeys). now message allowing access contacts. have email addresses recipients , don't need access contacts, outlook autoresolve kicks in , pop allowing access contacts appears. doesn't have 5 second delay, still prevents system being automated. i'm trying avoid using 3rd party tools redemption , wondering if has found way turn autoresolve off. i've read posts on other sites suggesting turning off autocomplete , automatic name checking, outlook still attempts resolve address when mail sent. any pointers gladly received. edit 24/08/13 i have heard if outlook 2007 , above , correctly installed system microsoft approved virus scanner not see message, don't have control on installation of programs on users machines. the code have tried includes function mailit(byval smessageto string, byval ssamplercenter str

How does argument passing work in Clojure? -

i know in java, if pass object method argument, method let argument variable point same object rather making duplicate. how in clojure? example: (defn print-from-reader [rdr] (print (.read rdr))) (...inside code... (with-open [rdr (reader file)] (print-from-rader rdr))) does print-from-reader make copy of rdr in memory when rdr passed in, or it's pointing same rdr that's created with-open binding? and there way check if 2 clojure instances pointing same memory? sorry bad terms such "pointing to" , "instances", newbie in clojure , still learning it. :-) clojure pass-by-value java. think of as, references passed value. isn't stretch clojure work this, scheme , common lisp behave same way. you can test whether 2 references point same memory identical? : (identical? x y) tests if 2 arguments same object

json - Spring Security REST error response -

i've been trying figure 1 out last couple of days now. using spring security oauth module. i'm trying find can override spring security responding exception this: { "error":"unauthorized", "error_description":"you must logged in access resource" } and format returned json more in line our other responses this. { "error":"unauthorized", "error_user_message":"you must logged in access resource", "error_developer_message": "some descriptive message", "error_internal_code": 10044 }

google apps script - How code completion in GAS works? -

is there detailed description on "rules" of code completion (cc) in gas..? cc works when move cursor in code line , won't work @ when there 3 lines of code , defined unambiguously. ss.getactivesheet(); // if go "ss" , type period, open // cc. (most times.) ss.getactivesheet(); // sometimes, after "getactivesheet()," // when put period, nothing happens. i know when copy , paste code, messes up. in cases, stops working on script i've been working on long time. so can explain "rules" of cc? way behavior can understood and, in turn, stops people me doing stops cc long scripts. getting irritating having methods, when chaining. thank you.

forms - Custom Decorator Label in Zend Framework 2 -

according post: zend framework 2 - form element decorators , i've tried solution iroybot (thanks him) , worked. new problem occurs. here details: in render method in formcollection.php (view helper) throw object this: <?php namespace cust\view\helper; use zend\form\elementinterface; use zend\form\view\helper\formcollection baseformcollection; class formcollection extends baseformcollection { public function render(elementinterface $element) { return sprintf('<table class="table table-condensed">%s</table>',parent::render($element)); } } and in render method in formelement.php (view helper), throw : <?php namespace cust\view\helper; use zend\form\elementinterface; use zend\form\view\helper\formelement baseformelement; class formelement extends baseformelement { public function render(elementinterface $element) { $req = ''; if($element->getoption('required')){ $req = 'required'

ruby on rails - Nested Resources Post Issue -

i have rails 4 application has 2 scaffolds (that same default generate). have routes.rb looks this: resources :companies resources :peoples end until added nested routes, 2 scaffolds worked alone. when added nested routes, when visit route like: http://localhost:3000/companies/bobs-pizza/peoples/new and fill out peoples form , submit, error like: routing error no route matches [post] "/companies/bobs-pizza/peoples/new" my _form.html.erb peoples scaffold ( child in relationship between peoples , companies) changed this: <%= form_for companies_path(@company,@people) |f| %> thanks help. run rake routes , ensure companies_path correct route need.

winforms - c# text box "between" validation -

Image
i trying have text box validate if entry number between 1 , 100. example: if (textbox.text equal numbers between 1 , 100) { this; } else { this; } this form validation trackbar used jpeg compression , can have numeric values between 1 , 100. how do this? string text = textbox.text; try{ long value = long.parse(text.trim()); if(value > 0 && value < 101){ //do here } else{ //do else } } catch(exception e){ messagebox.show("please check input , try again"); }

json - Python dict deserialization works in python2.7, fails in 3.3 -

i'm using sqlite3 table store python dicts (utf8 content) , serialization done json. works fine in python2.7 fails in 3.3. schema: create table mytable (id integer, book text not null, d json not null, priority integer not null default(3), primary key (id, book)) when inserting values, dict serialized json.dumps(d) . faulty part retrieving saved values. import sys import sqlite3 import json filename = 'mydb.db' sqlite3.register_converter('json', json.loads) conn = sqlite3.connect(filename, detect_types=sqlite3.parse_decltypes|sqlite3.parse_colnames) c = conn.cursor() c.execute('''select book, id, d, priority mytable''') print(c.fetchall()) the above script works fine when executed python2.7. however, using 3.3 typeerror occures: traceback (most recent call last): file "tests/py3error_debug.py", line 15, in <module> c.execute('''select book, id, d, priority mytable''') file

wcf - Windows Communication Foundation Callbacks -

i have wcf callback server.the server invokes callbacks on registered clients every 2 seconds. after few hours, communication channel on client gets aborted , client stops receiving callbacks. no exception thrown on server side. if restart client without restarting server; , client starts receive callbacks again. not sure causing callback channel on client side abort. note no exception thrown on server side. restarting client solves problem , client starts receiving callbacks again, not sure why callback channel on client side getting aborted in first place after few hours. suggestions helpful. thanks.

Java: how do I point at an array item through a variable? -

how point @ array item through variable? example: string[] names; int test = 10; string myname = names[test]; the purpose same number item 2 different arrays, username/password program. in example: string[] names; int test = 10; string myname = names[test]; the variable myname reference string in array, giving new value: myname = "fred"; will nothing array - you'd doing assigning new reference variable. to give array element bew value, this: names[test] = "fred";

java - How to make database change cause updates to web clients' views -

environment: java ee 7, glassfish 4, mysql 5.7 on linux on arm7 server 512mb ram (app must memory frugal!) application: database-driven java web app served multiple android tablet clients running android 4.0 default browser. the clients have 2 basic user types: producers , consumers. producers generate tasks displayed on consumers' browsers. when producer creates new task, should show on logged-in consumers' browsers if have tasklist (viewtasklist.jsp) displayed "pending" status. consumers select tasks tasklist , process them (dotask.jsp). when task selected consumer, should flagged "working" on other tasklist displays , not selectable. if consumer has task open clicks cancel button, task status should changed "pending" on tasklists. when task completed, flagged such, , should disappear consumers' browsers displaying tasklist view. sample tasklist view task entity class: (fragment) public class task { private int taskid; priva

object - Why is there a need to override hashcode if I override the 'equals' method in Java? -

i know there need override hashcode whenever equals method overridden in java. merely contract. trying understand logic behind this. reading *effective java joshua bloch , , came across code (item 9, page 45): import java.util.hashmap; import java.util.map; public final class phonenumber { private final short areacode; private final short prefix; private final short linenumber; public phonenumber(int areacode, int prefix, int linenumber) { rangecheck(areacode, 999, "area code"); rangecheck(prefix, 999, "prefix"); rangecheck(linenumber, 9999, "line number"); this.areacode = (short) areacode; this.prefix = (short) prefix; this.linenumber = (short) linenumber; } private static void rangecheck(int arg, int max, string name) { if (arg < 0 || arg > max) throw new illegalargumentexception(name + ": " + arg); } @override public boolean

Java: can't see my variable -

i have small little code don't know why cannot read value of aa.width aa class in ab class. i trying create basic game. file ab.java has print statement. know not calling function in aa , that's how java works. thought aa.width , value public variable...thanks help aa.java : package com.game; import javax.swing.jframe; public class aa { public static ab f= new ab(); public static int width = 600; public static int height = 400; public static void main(string args[]){ f.setsize(width,height); f.setresizable(false); f.setvisible(true); f.setdefaultcloseoperation(jframe.exit_on_close); f.settitle("game first"); f.setlocationrelativeto(null); system.out.println("main window running!"); } } ab.java package com.game; import java.awt.gridlayout; import javax.swing.*; public class ab extends jframe { /** * */ private static final long serialver

javascript - Terrible dropdown behavior using a toggleClass -

i having bit of issue, creating dropdown menu system dynamically pass ajax content dropdown. but, issue isn't ajax, rather stupid menu behavior coded. every time user clicks 1 of buttons, execute toggleclass closing menu , requiring user click again re-appear. (not intuitive) want dropdown remain open, unless user clicks button opened it. $(document).ready(function(){ $('#reviews').click(function(){ $('.reviews_closed').toggleclass('reviews_open'); $('.reviews_closed').empty(); $('.reviews_closed').append("<div class='dropdown_wrapper'> </div>"); $('.dropdown_wrapper').html("<em style='color:maroon;text-align:center;margin:auto;'> loading... </em>"); $('.dropdown_wrapper').load("/ajax/", {section: 'articles', category: 'review', limit: '5', form: 'dropdown_reviews', action: 'article'}, f

python - Scrapy exports invalid json -

my parse looks this: def parse(self, response): hxs = htmlxpathselector(response) titles = hxs.select("//tr/td") items = [] titles in titles: item = myitem() item['title'] = titles.select('h3/a/text()').extract() items.append(item) return items why output json this: [{"title": ["random title #1"]}, {"title": ["random title #2"]}] titles.select('h3/a/text()').extract() returns list, list. scrapy doesn't make assumptions item's structure. the quick fix first result: item['title'] = titles.select('h3/a/text()').extract()[0] a better solution use item loader , use takefirst() output processor: from scrapy.contrib.loader import xpathitemloader scrapy.contrib.loader.processor import takefirst, mapcompose class youritemloader(xpathitemloader): default_item_class = youritemclass default_input_processor = mapcompose(

get datetime with AM or PM in java -

i have date in string format(yyyy-mm-dd hh:mm:ss). same date am/pm alongwith datetime. e.g: input string --> 2013-03-12 13:23:30, ouput-->2013-03-12 01:23:30 am/pm. do have util class get. use string format yyyy-mm-dd hh:mm:ss a a marker am/pm marker: http://docs.oracle.com/javase/6/docs/api/java/text/simpledateformat.html date date = new date(); simpledateformat sdf = new simpledateformat("yyyy-mm-dd h:mm:ss a"); string formattedtime = sdf.format(date); system.out.println(formattedtime); or public static string convertdate(date date) { simpledateformat df = new simpledateformat("yyyy-mm-dd hh:mm:ss a", locale.english); return df.format(date); }