Posts

Showing posts from August, 2014

html - jQuery click on button will show the div and again click on any area of the page will hide the div? -

i have markup this. button click. <div class="logout-wrap"> <div class="account-info"> <a href="../profile.php">admin admin</a> </div><!--.account-info--> <div class="account-info-icon"> <ul> <li><a href="" class="account-sprited notice"><span>5</span></a></li> <li><a href="" class="account-sprited profile profiletest"></a></li> </ul> </div> </div> it area default hide , when click on button show div contents. <div class="account-info-box" style="display: block;"> <div class="top-info"> <div class="profile-img"> <img alt="" src="../images/profile.png"> </div><!--.profile-img--> <div class="profile-text"> <span class="

Adding options in JavaScript functions that could use later -

i developing small javascript framework, need know how add options function, user can set own settings particular method. this sample function method have created $.prototype = { setcenter: function() { this.e.style.position = 'absolute'; this.e.style.top = '50%'; this.e.style.left = '50%'; this.e.style.marginleft = '-50px'; this.e.style.margintop = '-50px'; return this; } }; i expecting developed handle below options sets. *i not using jquery, need pure javascript solution this. example code, maybe not real thing , idea. $('samplediv').setcenter({ animate:true, fade:true }); help me solve problem, appreciate tries answer this. thank ! you implement main function way : this.dosomething = function() { var getdefault = function(args, property, otherwise) { return args[property] !== undefined ? args[property] : o

android - How to highlight a button when is pressed? -

i'm making andorid quiz , want highlight button when it's clicked when user lets go of button turns in original colour. see i've set background of button buttons can rounded. i've set in drawable. <button android:id="@+id/btn1" android:background="@drawable/roundedbutton" android:textcolor="#ffffff" android:textstyle="italic" android:layout_width="225sp" android:layout_margintop="23sp" android:layout_height="38sp" android:layout_alignleft="@+id/btn2" android:layout_below="@+id/textview1" android:text="button" /> roundedbutton.xml <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:padding="10dp"> <solid android:color="#848482"/> <!-- 1 ths color o

android - Updating Marker in google map -

i using google map in app. storing lat-long , test type in database. retrieving value database , showing marker on google map. using 2 different image test type. if test type manual using red image if test type auto using blue image. here code retrieve value , showing on google map public void setpinonmap(){ try{ cursor pinrecordcursor = mtestpinrecordhandler.getpinfromdatabase(); mpinmarkerlist = new arraylist<testpinmarker>(); if(pinrecordcursor != null && pinrecordcursor.movetofirst()) { {//string testname, string testtype, string latitude, string longitude testpinmarker markers = new testpinmarker(pinrecordcursor.getstring(1),pinrecordcursor.getstring(2), pinrecordcursor.getstring(3),pinrecordcursor.getstring(4)); mpinmarkerlist.add(markers); }while(pinrecordcursor.movetonext());

javascript - Show data after query - Google Charts -

i have data-table (in google chart) , want send url connecting data-table , sending query , after show data in page web, javascript. how can it? here code. <!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8"/> <title> google visualization api sample </title> <script type="text/javascript" src="http://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.0', {packages: ['corechart']}); </script> <script type="text/javascript"> function sendquery(yyy) { var query = new google.visualization.query('http://localhost:8080/xxx-da

sql - How to convert yyyymmdd to dd-mm-yyyy in Oracle? -

i have column contains dates in varchar2 varying formats such 19.02.2013, 29-03-2013, 30/12/2013 , on. annoying of 20130713 (which july 13, 2013) , want convert dd-mm-yyyy or dd-mon-yyyy. if column contains various formats, you'll need deal each one. assuming question includes all known formats, have couple of options. you can use to_char/to_date. dangerous because you'll sql error if source data not valid date (of course, getting error might preferable presenting bad data). or can rearrange characters in string based on format. little simpler implement, , doesn't care delimiters are. method 1: case when substr(tempdt,3,1)='.' to_char(to_date(tempdt,'dd.mm.yyyy'),'dd-mm-yyyy') when substr(tempdt,3,1)='-' tempdt when length(tempdt)=8 to_char(to_date(tempdt,'yyyymmdd'),'dd-mm-yyyy') when substr(tempdt,3,1)='/' to_char(to_date(tempdt,'

unwanted navigation bar resizing issue (CSS and HTML) -

i have built navigation bar using html , css , functions perfectly. issue when either of 2 gallery pages selected, positioning of navigation bar moves upward. im not sure issue lies (it seems quite specific since cant find similar issue here nor on google). note: gallery html page has css content written in because if content included using php's include statment (as on other pages), gallery slideshow images distorted/streched reason. either way though, navigation bar issue present. html services page (a non-gallery pager): <?php //if browser ie, displays ie specific navbar if(strpos($_server['http_user_agent'], 'msie') !== false) {include('navbarie.php');} //if browser else, include original navbar file else include('navbar.php'); ?> <!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang=&

api - Return status from webpurify javascript check method to main program -

i stuck in code. i'm using webpurify( http://webpurify.com/ ) javascript api profanity checking. javascript api link here : http://webpurify.com/documentation/samples/javascript.php i've made function.. function check() { $.webpurify.check( $("#check").val(), function(isprofane){ return isprofane; }); } what function do.. whatever profanity checking status(isprofane value) generate, function should return value. but, here returning 'undefined'. i don't know what's wrong going on this. two guesses, 1 experience other jquery functions , other basic knowledge. i think happens inside of function function(isprofane) stays inside of function function(isprofane), when return function(isprofane) nothing happens. the other thing is, if isprofane never given value? isprofane? suppose value of #check ? @ least can't since you're not assigning it. variable undefined if it's value never given. you should

linux - When does memcached remove items? -

i'm relatively new memcached , know basics of getting set , working. i've run issue on our magento-based website cache growing large , causing slowness when editing product details. telnetted memcached server , ran stats , noticed there 900 megs , on 65500 items in there. typed flush_all command , re-ran stats , it's still same. after research have found flushing invalidates entries doesn't free space. on time new items added. have seen, never frees 900 megs of space , never deletes 65000+ items seem stuck in there. haven't tried restarting memcached yet live site , don't want cause problems. if restarting server frees space, that's still not solution because don't want have every time. can please me understand what's going on , how can fix this? you'll want tweak maximum amount of memory memcached allowed use in instance. @ command line, -m flag used set maximum number of megabytes cache can hold. flushing cache merely

jquery - How to inherit Class in javascript? -

the function not working, not putting values in "input". function example(id){ this.code= function(){$('.'+id).val(id)} this.validate= function (){ $('.'+id).keyup(function (e){ if(e.keycode==13) this.code(); }) } } body <input type="text" class="test"/> <input type="text" class="test1"/> <script type="text/javascript"> var test= new example('test') var test1= new example('test1') test.validate() test1.validate() </script> your keyup event handler have different "this". can use bind correct problem keyup(function (e){ if(e.keycode==13) this.code(); }.bind(this)) when bind event, handler called "this" keyword set object fired event, not object created event.

javascript - Launch a google search using an input box -

the problem have is: have inputbox , submit button launch google search query. there 2 ways want search query launched: 1. pressing submit button 2. pressing enter in inputbox now can in form, thing can't use form because screws webpage in internet explorer. so far i've managed 1. (pressing submit button) work. can't figure out 2. (pressing enter) work. need google search open in new window. <input id="textbox" type="text" placeholder="search on google..."> <a id="googlelink" href="notrequired" onclick="this.href='http://www.google.com/search?q=' + encodeuricomponent(document.getelementbyid('textbox').value);"> <span>search</span> </a> thanks in advance! the following should work, add keypress handler on input , check event 13 (enter), , write re-direction logic in there. <input id="textbox" type="text" placeholder=&

onclick - Android setOnClick not working/Dialogbox not appearing -

app launches fine when click on select_players button, dialog box doesn't appear on device. here's code: public class mainactivity extends activity { private button selectplayers; @override protected void oncreate(final bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_demo); super.onstart(); //customize super.onresume(); //customize selectplayers = (button) findviewbyid(r.id.add_players); selectplayers.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { // launch dialogbox on click oncreatedialog(savedinstancestate); } }); } public dialog oncreatedialog(bundle savedinstancestate) { @suppresswarnings("rawtypes") final arraylist

Yii dynamic menu creation jquery mobile -

i have set-up jquery mobile site , creating cms using yii framework. i have database table set-up menu creation linked table page content. the menu table has: id, title, parent, collapsible (collapsible checkbox used determine whether create page given menu item don't want collapsible items click-able can see jsfiddle below) jsfiddle.net/gn7q6/ from jsfiddle above can see how want menu function. i'm unsure of how create dynamic menu way. i assume have setup model menu menutable , there has defined relation public function relations() { return array( 'childmenuitems' => array(self::has_many, 'menu', 'parent_id'), ); } getting top parent menus // parent menu not have parent menu id (0, empty or null, case using comapare 0 default fk column value) $topmenus = menu::model()->findallbyattributes(array('parent_id' => '0')); to render menu <ul data-role="listview" data-inset=

javascript - How to convert curly quotes to &#8220; -

this question has answer here: html-encoding lost when attribute read input field 20 answers how convert characters html entities using plain javascript 11 answers how convert multibyte characters curly quotes equivalent entity &#8220; using jquery or javascript? var usertxt = '“testing”'; after converting usertxt should => &#8220;testing&#8221; here's how it: $('<div/>').text('this fun & stuff').html(); // evaluates "this fun &amp; stuff" source or can this way .

php - Compress on the fly generated PDF files having embeded fonts -

Image
we have apllication generates dynamic pdf files embeded nmsys fonts. but it's size large in comparision original file having larger data dynamically generated having same fonts. is possible reduce size of such pdf php script, api or extention ? , why source pdf (not generated script) of larger contents , same fonts have less size ? edit example - file 1 file 2 file -1 generated our script it's bacically showing piece of information file 2. there 5 pages in file -1 , it's of 1.2 mb , file 2 having 158 pages of similar information of approx 4mb. why size difference there? i looked @ both files , difference indeed font related. saved both files optimised adobe acrobat xi - (can do) whole lot of optimisations important difference (for file 1) comes font subsetting: file 1: 1.2 mb before / 253 kb after file 2: 4.7 mb before / 3.7 mb after your file 2 created using framemaker produces pretty clean pdf (even if old version of adobe acrobat distille

winforms - How do I call openGL from C#? -

i programming application in c# using winforms gui. want create control displays 3d graphics using opengl. i experimented bit opentk , found simple use glcontrol display opengl graphics; had implement method handled paint event of glcontrol , within method call opentk wrapper methods, e.g instead of glvertex2d(0.0, 0.0); i call: gl.vertex2(0.0, 0.0); i found possible mix opentk calls directly opengl using p/invoke: using system; using system.runtime.interopservices; public class gl { [dllimport("opengl32")] public static extern void glvertex2d(double x, double y); }; ... gl.vertex2(0.0, 0.0); // opentk gl.glvertex2d(1.0, 1.0); // opengl directly using pinvoke however, wish remove dependence on opentk alltogether. not want use external library instead call opengl directly. how opengl "paint" on winform? in other words; how implement glcontrol myself? how implement glcontrol myself? more or less how opentk do; sin

events - How to change the functionality of button as well as text of it -

i have createuser page in have field , submit button. when click on submit button save details database aspx.cs code createuser page: protected void btnsubmit_click(object sender, eventargs e) { using (sqlconnection con = new sqlconnection(configurationmanager.connectionstrings["webgallery"].tostring())) { con.open(); sqldataadapter da = new sqldataadapter(); datatable dt = new datatable(); string strsql = "select * newuser username = '" + tbname.text + "'"; da.selectcommand = new sqlcommand(strsql); da.selectcommand.connection = con; da.fill(dt); if (dt.rows.count > 0) // means first name present { lblmsg.text = "this user added!"; } else if (dt.rows.count == 0) { lblmsg.visible = false; string username = tbname.text; string pwd=tbpassword.text; string confirm

python - How to execute raw SQL in SQLAlchemy-flask app -

how execute raw sql in sqlalchemy? i have python web app runs on flask , interfaces database through sqlalchemy. i need way run raw sql. query involves multiple table joins along inline views. i've tried: connection = db.session.connection() connection.execute( <sql here> ) but keep getting gateway errors. have tried: result = db.engine.execute("<sql here>") or: from sqlalchemy import text sql = text('select name penguins') result = db.engine.execute(sql) names = [] row in result: names.append(row[0]) print names

vb.net - Program's old processes stay when ftp is offline -

i have program restarts once in while. program uses timer starts thread uploads files folder ftp server. when ftp server goes down, program still restarts needed, old process doesn't close , stays in task manager. when ftp comes up, starts end processes. this problem doesn't occur when ftp server online. what causing processes stay when ftp server offline? to restart program use application.restart() current code: public sub uploadtoftp() dim request = directcast(webrequest.create(ftpadress), ftpwebrequest) request.credentials = new networkcredential(_username, _password) request.method = webrequestmethods.ftp.listdirectory try using response ftpwebresponse = directcast(request.getresponse(), ftpwebresponse) try dim _frompath string dim _topath string dim dt new datatable dim flag boolean = false 'create link ftpserver dim ftp ne

asp.net ajax - calling UpdatePanel.Update multiple times in same postback? -

can explain me happens if call updatepanel.update() multiple times in same postback event? client updated each time, or updated once? thanks calling updatepanel.update update updatepanel once - remember panel/controls go through full postback lifecycle ensures updatepanels content (and applicable viewstate/controlstate) sent client further processing. this can verified looking @ server response. each update panel updated content, either manually through update or automatically as described here , has associated |updatepanel|<panel_id>|<new_content>| section in response - each panel can have @ 1 |updatepanel| entry. if outer update panel updated, every contained update panel (immediate children , distant grandchildren) updated part of outer update panel instead of having own |updatepanel| entry.

sql - Use analytic function result in where clouse -

i got statement: select ar.*, lag(dest_time, 1) on (order fep_id) hit dsyy.archiv ar; it works pretty fine. want that: select ar.*, lag(dest_time, 1) on (order fep_id) hit dsyy.archiv ar arr_time < hit; unfortunality not allowed... tell me how can deal column hit inside where-clouse ? thx lot simply use subquery: select ar.* (select ar.*, lag(dest_time, 1) on (order fep_id) hit dsyy.archiv ar ) ar arr_time < hit;

javascript - ExtJS 4.2.1 , Tree, adding children to a node -

i working extjs 4.2.1 i trying append children leaf when click on it. leaf, click transform folder , append leaves children node. it worked in ext 3.4 seems there problem appendchild() method in 4.2.1. uncaught typeerror: object [object object] has no method 'updateinfo' method due node.updateinfo(commit); can find in appendchild() . this pretty simple instruction: in ext3 node.leaf = false; // add nodes in trees ( =0 ; < timesheetdata.length ; i++ ) { // create new node , state it's timesheet var newnode = new ext.tree.treenode({ id : timesheetdata[i].id, text : timesheetdata[i].text, ts : true }) ; node.appendchild(newnode); } node.expand(); in ext4 node.set('leaf', false); // add nodes in trees ( =0 ; < timesheetdata.length ; i++ ) { node.appendchild({

silverlight - Getting dynamically generated textbox values MVVM -

i generate couple of textboxes added stackpanel listbox item source now e.g. 8 boxes generate unique names, how retrieve values these objects? this follow mvvm pattern can't directly call xaml need values of text boxes save them you can create binding in code-behind: for (int = 0; < 8; i++) { // create , initialize textbox textbox textbox = new textbox(); // bind text "someproperty" in view model textbox.setbinding(textbox.textproperty, new binding("someproperty") { mode = bindingmode.twoway }) ; } you alternatively use itemscontrol itemtemplate displaying textbox , bound collection in view model. way control number of text boxes number of elements in collection.

Where to store temporary files in a java web application? -

i'm developing java/spring-mvc web app using scheduling system generate csv files send via e mail. my first idea generate these files locally in server , send them recipients, have doubt. store temp files? i deploy application war, know there problems. is bad idea create temporary directory in web-inf directory? alternative serialize these files , store them in database table. what's suggestion? best practice? i left on jvm, i.e. use java.io.tmpdir system property. create directory in tmp dir ( new file(system.getproperty("java.io.tmpdir")).mkdir() ) or file in tmp directory ( file.createtempfile("name", ".csv") ). application running on tomcat, tmp dir <catalina_home_directory>/temp .

Replace apache envvars with sed command -

hi guys newbie sed editor , need replace follow line on envvars file: current line export apache_run_user=www-data i need replace export apache_run_user=admin i tried sed -i "s/export apache_run_user=www-data/export apache_run_user=nbadmin/"envvars this not work. there space between word export , apache. can please sed? in advance. you missing space before filename.

jQuery animate function not animating properly -

i'm new jquery (and programming in general.) trying to create filter function mobile site , having trouble. hidden div comes view when clicking 'filter by..' button. working fine except. button needs animate rest of div. can go down, not again. here's code. css: #filter_button{ display:none; z-index:499; width:75px; left:60%; height:75px; border:solid 2px green; border-radius:250px; background-color:#fff; top:-25px; position:fixed; } @media screen , (max-width:730px){ #filter_button{ display:block; } } jquery: $('#filter_button').on('click', function(){ $('#mobile_filter').slidetoggle(); var div1height = $('#filters').height()+$('#vehicle').height(); var div2height = div1height+$('#categories').height(); if ($('#mobile_filter').css('display')== 'none'){ $('#filter_butt

google maps - how to get the complete address(es) using a business name? -

i know google maps's json return includes "formatted_address" gives full readable address i've tested on couple of places no success, lat , lng coordinates aren't correct either. if manually search using maps.google.com correct know input specific enough. how can use api this? if input vague? can json return includes possible locations? (i.e. mcdonalds in nyc surely return many coordinates) example: http://maps.googleapis.com/maps/api/geocode/json?address=time+square+nyc&sensor=false returns correct coodrinates , full address can use. http://maps.googleapis.com/maps/api/geocode/json?address=amc+loews+boston&sensor=false not. of course if search "amc lowes boston" manually returns correct address on google maps. i think you're looking google maps' places library .

json - Javascript: each function value dynamic title -

i trying use following code: var list_id = "cust"; var page_id = "subpagecust"; var show = "company"; $.ajax({ url: "sap.php", datatype: "json", type: "post", success: function(data) { var output = ''; $('#' + list_id).empty(); var value1 = "value." + show; $.each(data, function(index, value){ output += '<li><a href="#' + value.show +'" data-transition="slide">' + value.show + '</a></li>'; }); $('#' + list_id).append(output).listview('refresh'); the json title company:company. has idea how use value.title dynamically? regards

javascript - Wordpress loading posts with AJAX - java loaded but not triggered -

the website here - http://sebastiangraz.com/ as 1 can see portfolio items being loaded djax ( http://beezee.github.io/djax.html ) following code: $('body').djax('.djaxable', ['wp-admin', 'wp-login', '?s=']); all works fine until click 1 portfolio item whatever javascript have on page doesn't triggered, javascript file gets loaded. instance if hard refresh 1 of single pages ( http://sebastiangraz.com/portfolio/konsthallen ) can hover big title @ top , change "< return " if access same page via frontpage javascript hover effect doesn't work anymore. i wish take quick @ whats going on here. appreciated! :)

sms - Kannel bearer box rejecting message from fakesmsc -

i message 2013-07-31 17:30:59 [16256] [6] warning: smsc_fake: invalid message syntax client, ignored @ bearebox when try send message fakesmsc. how fix this? i discovered problem caused when using fakesmsc in interactive mode. sending messages in incorrect format . i.e typing message instead of typing "from text message+to+send" , instance. user guide gives examples of correct formatting.

java - Method does not work properly before executing System.exit(0) -

i new in java, have swing application menu file/exit, application editor, when select option exit menu application ask me if want save changes before exit, see exit code below class actionexit extends abstractaction { public actionexit() { super("exit",icons.iconexit); setenabled(true); putvalue("menu", "file"); putvalue("menuindex", "99"); } public void actionperformed(actionevent evt) { saveandclose(); <----does not execute instructions savesettings(); system.exit(0); } } the problem have in method saveandclose(), here check if document has changed , display dialog question/options (save? yes,no), execute other methods connect database , apply changes made document etc. method executes first instructions , seems being interrupted (i put lot of "system.out.println" find method stops), application returns , continues next method , ends. if debug application works perfectly, not work when runs norm

css - progid filter isn't running -

i'm using filter older ie on sprite , used filters . code below isn't working. know made mistake don't know wich 1 / where:-/ on chrome it's ok, properties disabled in ie , background-size isn't working. if disable " background-size " in chrome , see same bad screen in .icones { background: transparent url('../contents/homepage/60/icones.png') no-repeat; display: inline-block; width: 50px; height: 48px; background-size: 60px; filter: progid:dximagetransform.microsoft.alphaimageloader(src='../contents/homepage/60/icones.png',sizingmethod='scale'); -ms-filter: "progid:dximagetransform.microsoft.alphaimageloader(src='../contents/homepage/60/icones.png',sizingmethod='scale')"; } #contact{ background-position: 0px -350px; } thanks :-) background-size: 60px; wasn't applied on ie, deletes line , made picture of 60px. solved question.

asp.net mvc 4 - Simple MVC4 unobtrusive ajax not working -

i writing simple mvc4 test page , unobtrusive ajax not seem working. when click submit button page not submitted. i have breakpoint vs , can tell there no request. i using firefox , when click submit button web console shows javascript error: --- empty string passed getelementbyid() which occurs @ line 16 in. --- jquery.unobtrusive-ajax.js i setup ajax options follows: ajaxoptions ajaxopts = new ajaxoptions { updatetargetid = "officelist", confirm = "are sure?", url = url.action("getofficedata") }; here ajaxform: @using (ajax.beginform("getofficedata", ajaxopts)) { <div> @html.dropdownlist("orglist", new selectlist(model.organizations, "orgid", "orgname")); <button type="submit" id="btnsubmit">submit</button> </div> } i 'are sure prompt' when click submit button (as defined in ajax options). if change ajax.begin

java - How to Have Spring Pass Subclasses to Creation of JAXBContext? -

my problem solved @xmlseealso, can't in case because child , super class in 2 different projects. parent project - abstractparent ( property = commonproperty ) - wrapperobject ( property = abstractparent, other properties ) child project - includes parent project - conceretechild extends abstractparent ( property = extraproperty ) service project - includes parent project , child project service project spring-based project uses httpmessageconverter defined in applicationcontext.xml - in org.springframework.oxm.jaxb.jaxb2marshaller bean instantiation, used "packagestoscan" property , include both abstractparent package , concretechild package. service project instantiate concretechild , put wrapperobject returned controller class , let spring message converter convert xml. my problem: when spring object conversion on wrapperobject, sees abstractparent properties, not see concretechild properties @ all. this solved @xmlseealso on abstractparent, because pa

python - How to safely store sensitive data? -

i'm writing program sending data server using private apikey. don't want keep key in plaintext, need contact server. what kind of reversible encryption work ? it seems if give program , needs use api key, there no way avoid giving out api key. best can hope obscure enough think easier api key elsewhere. supposing api key difficult elsewhere persists in attempting decode program, will it . consider end user able snoop on communications server, going man in middle on ssl connection, sending key plain-text anyways. apply nuisance crypto, rot13, , forget it.

I would like to set arrays indirectly in Perl -

i have file every 4 lines there block of information. have set 4 arrays named @linearray1, @linearray2, @linearray3, @linearray4. i have counter gets incremented every 4 lines called $lineno. i set 4 arrays , parse them out appropriately. but rather set them directly 4 times in 1 line , check $lineno @ 5 rest. so rather writing out : @linearray1=split(",",$_) i want like: @linearray.$lineno=split(",",$_); don't generate variable names. instead, use @{ $lines[$lineno] } = split /,/; or more directly: $lines[$lineno] = [ split /,/ ]; or even push @lines, [ split /,/ ]; you can access elements using for $lineno (0..$#lines) { join ', ', @{ $lines[$lineno] }; } or for $line (@lines) { join ', ', @$line; } remember use use strict; use warnings; !

ruby on rails - my application's gem has dependency with different-2 version of i18n -

my rails application's gems dependent on 2 different versions of i18n: 0.6.1 , 0.6.4. have gemfile locked version 0.6.4. when run rails app via bundle exec , app ask version 0.6.1 , app server won't start. should remove 1 of versions of i18n , it's dependencies, or there other alternative don't have remove of i18n versions? note: not using rvm. thanks in advance.

ios - How to use HTTP POST on Xcode -

sorry, beginner question here.i trying use http post retrieve xml document url, , there parameters need include in post request.i have got code this website in objective c section , starting understand it. need try , use class in app. here parameters need include: url: https://admin.poslavu.com/cp/reqserv/ dataname=tangere_techno&key=dbkey&token=dbt0ken&table=menu_groups  try: nsmutableurlrequest *request = [nsmutableurlrequest requestwithurl:[nsurl urlwithstring:@"https://admin.poslavu.com/cp/reqserv/"]]; [request setvalue:@"gzip" forhttpheaderfield:@"accept-encoding"]; [request sethttpbody:[[nsstring stringwithformat:@"dataname=tangere_techno&key=dbkey&token=dbt0ken&table=menu_groups"] datausingencoding:nsutf8stringencoding]]; [request sethttpmethod:@"post"]; nserror *error = nil; nsurlresponse *response = nil; nsdata *data = [nsurlconnection sendsynchronousreques

Django Slug Not Working In get_absolute_url -

whats wrong code? get_absolute_url blank when rendered in template, means it's failing somewhere. i suspect it's slug first time have tried use within django: thanks model: class entry(models.model): title = models.charfield(max_length=200) slug = models.slugfield(max_length=255, unique=true) def get_absolute_url(self): return reverse("entrydetail", kwargs={"slug": self.slug}) url: url(r'^entry/(?p<slug>[^\.]+).html', blog_views.entrydetail.as_view(), name='blog_entry'), view: class entrydetail(detailview): context_object_name = 'entry' template_name = "blog.entry.html" slug_field = 'slug' def get_object(self): return get_object_or_404(entry, url=self.slug_field) based on @peter deglopper stated in comments: looks trying absolute url using class based view . don't use reverse h

asp.net mvc 4 - AppHarbor not deploying web site -

i have app on appharbor started single background worker. have updated include mvc4 web site , have updated subscription 2 workers. after have deployed application, if go host name (myapp.apphb.com, not real hostname) "welcome nginx!" page. the build logs shows deploying worker.1. 7/31/13 11:12 received notification, queuing build 7/31/13 11:12 downloading source 7/31/13 11:12 downloaded source in 2.77 seconds 7/31/13 11:12 starting build 7/31/13 11:12 0 warnings 7/31/13 11:12 build completed in 19.87 seconds 7/31/13 11:12 starting website precompilation 7/31/13 11:12 precompilation completed in 10.73 seconds 7/31/13 11:12 starting tests 7/31/13 11:12 tests completed in 2.59 seconds 7/31/13 11:12 deploying worker.1 7/31/13 11:12 pre-warming worker 7/31/13 11:12 build deployed by looking on log session worker.1 looks background worker , there no mention of web application. the subscription shows 1 web worker , 1

analytics - Proper way to track emails -

i use thunderbird send out email campaigns. since not have resources pay email application tracking built in, wondering if there recommended ways track opens in emails code myself? a tracking pixel used this. it's image 1px 1px include in email. through server log see how many times image downloaded. issue solution many people have emails set not download images automatically , have accept them first (which not does) may not 100% accurate.

asp.net mvc 4 - user isn't authenticated in custom authorize attribute -

i've made own authorize attribute, , looks like public class redirectauthorize : authorizeattribute { protected override void handleunauthorizedrequest(authorizationcontext filtercontext) { if (!filtercontext.httpcontext.user.identity.isauthenticated) { filtercontext.result = new redirecttorouteresult(new routevaluedictionary(new { controller = "notexist" })); } } } so if user isn't authenticated, want them redirected notexist controller. i've debugged , seems unauthorized users in if clause, correct. i've tried doing logged in users, , in if clause wrong. i dont understand why happening. makes me hesitate whether log-in didnt work. right way of logging user in? formsauthentication.setauthcookie(acc.username, false); i've never made log-in system in asp.net mvc before, please tell me i'm doing wrong. edit: it seems default [authorized] attribute isn't workin

php - Html form select blank to search all of the table where the other fields match -

i have form searches database , returns rows match fields specified. want give option user if field left blank, won't matter is column long other fields match. right now, if leave field 'blank' return every entry in database. hair color: <select name="hair"> <option value="hairall" selected="selected">--</option> <option value="black" >black</option> <option value="brown">brown</option> <option value="blonde">blonde</option> <option value="white">white</option> <option value="red">red</option> <option value="other">other</option> </select> height: <select name="height"> <option