Posts

Showing posts from February, 2015

ruby - Rails strong parameters with objects array -

when using rails 4.0 strong parameters, how permit json this? { "user": { "first_name":"jello" }, "users_to_employer":[ { "start_date":"2013-09-03t16:45:27+02:00", "end_date":"2013-09-10t16:45:27+02:00", "employer":{"company_name":"telenor"} }, { "start_date":"2013-09-17t16:45:27+02:00", "end_date":null, "employer":{"company_name":"erixon"} } ] } i tried following: params.require(:users_to_employers => []).permit( :start_date, :end_date => nil, :employer => [ :company_name

css - Unable to change Menu title in jQuery (MeanMenu) -

i'm using meanmenu jquery responsive menu plugin navigation on web page. seems work well, can't figure out how change title of menu when it's closed. want add word "menu" 3 bars or replace 3 bars word. line .js file: meanmenuopen: "<span /><span /><span />", // text/markup want when menu closed, styling in css provides 3 bars these spans i filled line this: meanmenuopen: "<span />menu<span /><span />", // text/markup want when menu closed, styling in css provides 3 bars these spans the css part looks this: .mean-container a.meanmenu-reveal span { display: block; background: #fff; height: 3px; margin-top: 3px; } but solution isn't showing. how can fix that? thank help! got it. king's answer. jquery.meanmenu.js meanmenuopen: "<span /><span /><span /><div class='menu_title'>menu</div>", // text/markup want when m

filtering - Matlab: How to apply low-pass filter on tf-system for faster evaluation in simulink -

Image
i have mechanical oscillation system defined n x n matrix transfer functions tf( ... ) . w = minreal( [ tf( ... ) ... tf(...) ; ... ; tf( ... ) ... tf(...) ]; in following picture can see selected frequency responses. shows various irregularites @ high frequencies. as combine system in simulink other high-order systems, required step-size has extremely low or system not stable. simulation time tremendously high, makes impossible validate general funcionality of model. for reason i'd apply low-pass filter on fransfer matrix, use bigger steps faster simulation time. there way implement either in matlab code or within simulink? finally adjust threshold frequency depending on how time have , accuracy required. i did research appropriate solvers, without success. advice regarding solvers me well. this meager list of toolboxes have available: control system toolbox version 9.3 (r2012a) simulink control design

feedit for non admin users is not working in TYPO3 4.5.26 -

i having site typo3 4.5.26 , have installed advancedfeedit extension. fe edit works fine admin users non admins wont show options though have set ts properly here ts setup : admpanel{ enable.edit=1 hide=1 } anything need ? idea why ? i think hide should 0 admpanel { enable.edit = 1 hide = 0 }

jquery - How do I call a JavaScript function from an erb template? -

if define javascript function , call erb template function not called. why? clicking link should show alert, not. = link_to "add sprout", new_sprout_path, remote: true controller: def new @sprout = sprout.new respond_to { |format| format.js } end then in template call function: # sprouts/new.js.erb dosomething(); the function defined in js files: # javascripts/sprouts.js.coffee dosomething = -> alert "yum ghum new sprout." the javascript comes back. can see in console. see no alert. why doesn't not work? i'm using rails 4. @dosomething = -> alert "yum ghum new sprout." or window.dosomething = -> alert "yum ghum new sprout." # prefer approach, it's more explicit.

Add Javascript to an usercontrol in c# -

i have usercontrol , tooltip . . ascx : <%@ control language="c#" autoeventwireup="true" codebehind="uctooltip.ascx.cs" inherits="portail.formulaires.uctooltip" debug="true"%> <div id="dhtmltooltip" style="z-index:9999999999; display:inline-block;"> <div id="dhtmltooltip_title"> </div> <div id="dhtmltooltip_content"> </div> </div> . cs : using system; using system.collections.generic; using system.linq; using system.web; using system.web.ui; using system.web.ui.webcontrols; namespace portail.formulaires { public partial class uctooltip : system.web.ui.usercontrol { protected void page_load(object sender, eventargs e) { page.clientscript.registerclientscriptinclude("hint", page.resolveurl("~/scripts/hint.js")); }

Django South migrations directory outside django project -

i'm trying setup south in way location of migrations directories outside django directory. can use sout_migration_modules change location of directories within django (to every place init file), that's not enough me. unfortunately, sout_migration_modules doesn't accept full paths input. can explain how can make south place migrations directories specified path outside django directory? update: current directory structure: data django project project name settings.py django app migrations idealy south puth migrations folder in data directory, outside entire django project. as takes any module, create module outside project , add python path, e.g.: south_migration_modules = { 'blog': '<my_foreign_module>.migrations.blog', } another way monkey patch south's migrations class, really, should avoid hackery. from south.migration.base import migrations def migrations_dir(self): return #my_ugly_hack migratio

jms - ActiveMQ servlet connect with java client -

i'm trying connect java running activemq servlet(on weblogic 12), i'm getting following exception on conn.start(); : javax.jms.jmsexception: not post command: connectioninfo {commandid = 1, responserequired = true, connectionid = id:lmdesetup-jab-38449-1378221016985-2:1, clientid = id:lmdesetup-jab-38449-1378221016985-1:1, clientip = null, username = null, password = *****, brokerpath = null, brokermasterconnector = false, manageable = true, clientmaster = true, faulttolerant = false, failoverreconnect = false} due to: java.io.ioexception: failed post command: connectioninfo {commandid = 1, responserequired = true, connectionid = id:lmdesetup-jab-38449-1378221016985-2:1, clientid = id:lmdesetup-jab-38449-1378221016985-1:1, clientip = null, username = null, password = *****, brokerpath = null, brokermasterconnector = false, manageable = true, clientmaster = true, faulttolerant = false, failoverreconnect = false} response was: http/1.1 500 internal server error [connection:

windows - How do i undo the effect of IntersectClipRect? -

given following code snippet: procedure tpicture.paintline(_canvas: tcanvas; _left, _top, _right, _bottom: integer); begin intersectcliprect(_canvas.handle, _left, _top, _right, _bottom); try _canvas.moveto(_left - 10, _top - 10); _canvas.lineto(_right + 10, _bottom + 10); // (this example only, actual drawing more complex.) selectcliprgn(_canvas.handle, 0); // end; end; i want undo clipping effected call intersectcliprect active clipping becomes active again. in above code, done selectcliprgn(...,0) turns off clipping altogether. works, kind of, afterwards there no clipping active some drawing executed after above paint areas should not painted to. so, correct way undo effect of intersectcliprect? edit: removed unnecessary createrectrgn , deleteobject code after understood comment sertac, make question more readable others might stumble upon later. iirc, first store current clip region using getcliprgn , , after you're done, selectclipr

Rewrite URL - Apache in front and jboss serving content -

i have been trying work last 2 days since relatively new apache server. trying in local machine. i have installed apache server , acts front gate requests , sends them jboss server. through ajp method. i have enabled mod_rewrite in http.conf , want simple redirect in localhost. below tried.. rewriteengine on rewriterule ^first.html$ second.html this not working log says looking files in document root c:\apacheserver\apache2\htdocs , dont have files in location file comes jboss(for ex: c:/jboss4.0/jboss-4.0.3sp1/server/myapp/deploy/unisysv2.ear/web-app.war). how make redirect work under condition. thanks you should configure "bridge" between apache jboss. use mod_jk module or mod_proxy purpose, implementation of ajp communication protocol between apache , jboss.

c# - Second path fragment must not be a drive or UNC name - Create Subdirectory Error -

i have exception in third line ofthis code "second path fragment must not drive or unc name" directoryinfo labdi = new directoryinfo(back.mainfolderpath + @"\news\l"); directoryinfo tld = new directoryinfo(labdi.fullname + @"\" + nora.sn.labl[i]); tld = labdi.createsubdirectory(labdi.fullname + @"\" + nora.sn.labl[i] + @"\"); there no useful way on web. thank you.:! i ran 1 today , tracked down. the exception trying tell when directoryinfo takes path argument (e.g., createsubdirectory or getfiles), object if path argument contains root , throw elusive exception. so path arguments contain "c:\" or "d:\" etc not work. armed context, exception message makes bit of sense. in code, using fullname property , string contains "c:\" or whatever root is. given age of question, should add c#, .net 4.5, vs2013.

linux - Difference between using "chmod a+x" and "chmod 755" -

this may sound silly, have file/ script need run , in order must change become executable. want use either chmod a+x or chmod 755 . there difference between using chmod a+x , chmod 755 ? chmod a+x modifies argument's mode while chmod 755 sets it. try both variants on has full or no permissions , notice difference.

javascript - Unable to dynamically ng-include angular template in ng-repeat -

i'm attempting include templates dynamically using following code. seems work until enter ng-repeat scope. i'm using angular1.2rc1. http://plnkr.co/edit/s2e2w5pmmjrmwrgzkjw4?p=preview angular.module('myapp', []). controller('myctrl', function($scope) { $scope.templatename = 'template1.html'; $scope.templateconfig = [ { templatename : 'template2.html' }, { templatename : 'template3.html' } ]; }); <body ng-controller="myctrl"> <div ng-include src="templatename"></div> <div ng-repeat="template in templateconfig"> <div ng-include src="template.templatename"></div> </div> </body> replace <script data-require="angular.js@1.2.0-rc1" data-semver="1.2.0-rc1" src="http://code.angularjs.org/1.2.0rc1/angular.js"></script> with <script src="http

c# - Dependency Injection - Clean way to handle multiple injections -

i'm pretty new di , have few questions hoped people clear me, i'm working on wpf-mvvm system uses caliburn micro, using mef container. this application used keep track of shipments , has several parts. hope can explain enough, please point out if is't clear. i have several entities returned database (via webservices) examples shipments , containers , packages . for each of these entities have model wraps webservice entity, , manager , manager responsible standard crud operations via webservices, storing observablecollection of model , these managers injected constructors of viewmodels require access these lists. so, have shipment > shipmentmanager > shipmentlistviewmodel , done allow multiple viewmodels work same list of shipments however, i've started run issues viewmodels have constructors 6+ managers included, , cases used pass onto newly constructed dialog viewmodels . i'm hoping suggest clean solution issue, i'm thinking of sin

java - Javamail, error when sending attachments. -

i trying send email. when send without attachment, sends email correctly. if try attach something, doesn't work. the class: import com.sun.mail.smtp.smtptransport; import java.io.file; import java.security.security; import java.util.date; import java.util.properties; import javax.activation.datahandler; import javax.activation.filedatasource; import javax.mail.bodypart; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.multipart; import javax.mail.part; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.addressexception; import javax.mail.internet.internetaddress; import javax.mail.internet.mimebodypart; import javax.mail.internet.mimemessage; import javax.mail.internet.mimemultipart; import javax.swing.joptionpane; /** * * @author doraemon */ public class googlemail { public static void send(string from, string pass, string[] to, string assunto, string mensagem, file[] anexos) { string hos

ember.js - Cannot load associated records from a router (ember 1.0.0 and ember-data 1.0.0-beta.1) -

i have router loads "place". app.placeroute = ember.route.extend({ model: function(params) { return this.store.find('place', params.place_id); }, setupcontroller: function(controller, model) { this._super(controller, model); //the promise way ? var placeid = model.get('id'); var myrecords = this.store.find('record', {place:placeid}).then(function(recs){ console.log("does happen ?"); //never logged this.controllerfor('records').set('content', recs); }); //or way below ? //this.controllerfor('records').set('content', myrecords); //the works (which not want displays like): //this.controllerfor('records').set('content', app.record.fixtures); this.controllerfor('places').set('content

python - Error calling Reports API v1 -

i'm getting error while calling reports api: <httperror 403 when requesting https://www.googleapis.com/admin/reports/v1/usage/users/all/dates/2013-08-01?alt=json&maxresults=1 returned "caller not have access customers reporting data."> have seen error before? missing? can't see why showing or should checking. regards. edit: auth: credentials = signedjwtassertioncredentials( service_account_name='5163xxxxx@developer.gserviceaccount.com', private_key=oauth2_private_key, scope='https://www.googleapis.com/auth/admin.reports.usage.readonly') # https://developers.google.com/api-client-library/python/guide/thread_safety http = credentials.authorize(httplib2.http()) service = apiclient.discovery.build('admin', 'reports_v1', http=http) the actual call: result = service.userusagereport().get( userkey='all', date='2013-08-01'

c# - File management for profile pictures -

i'm bulding asp.net website users can upload profile picture. store these images under app_data folder , file paths in users table. so, question how should update user's profile picture? mean, happens if overwrite previous file , @ same time request arrives picture. should have concurrency management? best solution generating file name new image(the user record in database updated new path well) , store old path somewhere else, in order delete later. idea? what in case. creates folder in project path ~/uploads/images. here images concerned folder under uploads , uploads in root. while saving image path db use simple var dbpath= string.format("~/uploads/images/{0}",guid.newguid().tostring().replace("-",string.empty)); and file upload control fu.saveas(server.mappath(dbpath)); if want display image on page database, either can use <asp:image runat="server" id="immm"></asp:image> , code behind imm

html - How to change the background upon click? -

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>untitled document</title> <script src="spryassets/sprycollapsiblepanel.js" type="text/javascript"></script> <script src="spryassets/spryeffects.js" type="text/javascript"></script> <link href="spryassets/sprycollapsiblepanel.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> <!-- function mm_effectappearfade(targetelement, duration, from, to, toggle) { spry.effect.dofade(targetelement, {duration: duration, from: from, to: to, toggle: toggle}); } //--> </script> </head> <body onload="

ruby - Why won't Rails' console start or make new apps? -

a few days ago updated gems because things weren't running fine, went 1.4.2. since i'm getting kind of weird errors. i'm using ruby 2.0.0p247, rails 4.0 , ubuntu. if try start new app using rails new eraseme , goes fine until it's time bundle install . output is: run bundle install /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `require': cannot load such file -- bundler (loaderror) /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:270:in `bundle_command' /usr/local/lib/ruby/gems/2.0.0/gems/railties-4.0.0/lib/rails/generators/app_base.rb:277:in `run_bundle' (eval):1:in `run_bundle' /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/command.rb:27:in `run' /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command' /usr/local/lib/ruby/gems/2.0.0/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all' /us

C++ How to use BlackBerrys MessageService filter API? -

how 1 use messagefilter api in blackberry 10? i have far; bb::pim::message::messagefilter filter; // filter.participants.qstring("xxxxx3"); filter.insert(bb::pim::message::messagefilter::participants, "xxxxxxx"); qlist<bb::pim::message::conversation> convos = messageservice.conversations(smsaccountid,filter); not sure if right though? thanks

ruby on rails - AXLSX formula for date shows only number signs -

i trying work on spreadsheet in-house application. far going pretty well. while, not worst thing can happen, since can fixed clicking on cell , pressing enter, annoying me. i using axlsx gem on ruby-on-rails 3.2.13. my format code is: date_cell = s.add_style :format_code=>"mm/dd/yy", :bg_color=>"ffffcc" my cell has, in array, formula: "=e#{row.to_s}+g#{row.to_s}*30" i've tried adding formula_values, no avail: :formula_values=>["05/01/12","05/01/12",...] # same i've done following: checked make sure format being applied specific cell made sure formula_values filled output log file i'm not sure if missing step or what. appreciated. without wrapping, when cell not wide enough content spills on (if text) or fills hash signs (if numeric) – or widens suit. seems if column width has been adjusted automatic widening not repeat. anyway, column width problem , understand solved sheet.co

actionscript 3 - How to connect SQL Server in Flex Desktop Application or Flash as3 Application? -

sqlconnector.swc => supports mysql there no sql server side library as3 applications. if 1 flex/flash desktop developers plzz me!! regards, rajeshkumar s the sqlconnection supports sqllite, local / file based database; not mysql or sql server client/server databases. to knowledge, there no built in way connect client server database. in theory write own database drivers using socket connections. not expect trivial. i recommend use application server (java, coldfusion, php, .net, etc.. ) can access database , flex based ui.

java - How to check existence of a JAR file and a specific file inside JAR? -

assume file name in url: url file = new url("jar:file:/path/to/foo.jar!/meta-inf/file.txt"); this operation leads ioexception if there no foo.jar or there no file.txt inside existing jar: import org.apache.commons.io.fileutils; fileutils.copyurltofile(file, /* other file */); is possible validate file existence without exception catching? you can use java.util.jar.jarfile class , , use getjarentry method see if file exists. jarfile jar = new jarfile("foo.jar"); jarentry entry = jar.getjarentry("meta-inf/file.txt"); if (entry != null) { // meta-inf/file.txt exists in foo.jar }

ios - Two Lines in UITableViewCell's textLabel with new line being determined ONLY by newline character in text -

i want format cell's textlabel display text on 2 lines, line break character determining second line begin. problem that, since not control text in first line, text on first line spills on second line , second line text not display @ all. specifying uilinebreakmodewordwrap breaks word in 2 wrap it, makes no sense (i use first line names). need 2 lines , 2 lines label, there room in particular cell. using detailtextlabel else. not want create custom cell this. possible asking? here's do: you take long string, split 2 componentsseparatedbystring, take each piece, use iterative sizewithfont:constrainedtosize:linebreakmode calculate longest string fits default textlabel width, take 2 newly crafted strings , append them '\n' character. use textlabel text. that should achieve you're trying do. highly recommend you favor , go custom. number of reasons: yes, custom cells typically take longer create. but, i'd argue in particular case, faster go cust

php - Google crawl error with HTTP_ACCEPT_LANGUAGE -

in codeigniter app use $_server['http_accept_language'] determine users browser language set app language based on that, that: public function __construct() { parent::__construct(); /* set session language if not set. "hu" if browser language "hu", else "en" */ if(!($this->session->userdata("lang"))) { $browserlang = substr($_server["http_accept_language"],0,2); if ($browserlang == "hu") { $this->config->set_item("language", "hu"); $this->session->set_userdata("lang", "hu"); $this->lang->load("bh_hu", "hungarian"); } else { $this->config->set_item("language", "en"); $this->session->set_userdata("lang", "en"); $this->lang->load("bh_e

java - Is magja compatible with Magento 1.7 -

is magja compatible magento 1.7 ? there library integrate magento java? yes compatible 1.7 me did not work magento api v2. works v1 api of magento. http://magentosite/index.php/api/?wsdl

javascript - Slider starts on second image -

Image
i'm using slider created myself of people of stackoverflow community. the problem have slider starts second image, not first. i'm starting 0, don't know problem, ideas? this script: function slider(sel, intr, i) { var _slider = this; this.ind = i; this.selector = sel; this.slide = []; this.slide_active = 0; this.amount; this.timer = null; this.selector.children('img').each(function (i) { _slider.slide[i] = $(this); $(this).hide(); }); //display buttons , register events $(this.selector).hover( function () { $(this).append('<div id="previous-slider-' + + '" class="previous-arrow arrow"></div>'); $(this).append('<div id="next-slider-' + + '" class="next-arrow arrow"></div>'); $('#next-slider-'

When running Python's pdb as a script, how do I autostart the script? -

if want run script , have pdb catch exceptions come up, invoke so: python -m pdb script.py or: pdb script.py the problem stops @ debugging prompt right away: > /home/coiax/junkyard/script.py(1)<module>() -> import sys (pdb) and have type c or continue go. there way of getting load , start script without asking if want set breakpoints or whatever? i swear i've read pdb module documentation, , tried making .pdbrc file containing c but doesn't start auto-magically. what want can trivially achieved using ipython : ipython yourmodule.py --pdb whenever exception raised not caught (i.e. program crashes), instantly land in ipython's debugger @ point exception raised. there on can move stack , down, inspect variables, etc. huge time saver when developing python; use time.

php - How do I get just the name of the image file in string from this code -

i have name of file string. using code: <?php $target = "upload/"; $name="chekcs"; $target = $target . basename( $_files['uploaded']['name'].$name); if(move_uploaded_file($_files['uploaded']['tmp_name'], $target)) { echo "yes"; } else { echo "no"; } ?> uploaded file im uploading. i need name. string. how can that? thanks assistance! returns original filename: $_files['uploaded']['name']

php - Attach images in mail without option "show images" in mail -

i send e-mail php html. can add images mail 2 ways: add html - <img src="http://www.mysite.com/image.png" /> use php mailer , use option $mail->addembeddedimage($src, 'test'); , <img src="cid:test"> but in both ways if receive mail must click "show images". possible add images mail images visible? can use php mailer. "show images" security feature of email client using. default, email messages have no features such this. instead, implemented email provider or application using. typically, untrusted senders have images , other attachments blocked default protect privacy , security. for instance, create page (aspx, php, etc.) stream image. include image in email. if view image, grab information such ip address allow them potentially attack or break system. my recommendation add safe senders list. however, keep in mind done on account basis, , else receives messages have same thing. since each email pr

Why is this git push not allowing me to do this? -

so tried following in git: username '##### - site': user password '##### - site': https://comtech.git.beanstalkapp.com/ong-sis.git ! [rejected] master -> master (non-fast-forward) error: failed push refs '##### - site' hint: updates rejected because pushed branch tip behind remote hint: counterpart. check out branch , merge remote changes hint: (e.g. 'git pull') before pushing again. hint: see 'note fast-forwards' in 'git push --help' details. so like, ok - lets try , force - bad know read on - reasoning because master of branch trying push has code no longer care - , 1 pushes repo. so tried this: $ git push --force sisong master username '##### - site': user password '##### - site': counting objects: 190, done. delta compression using 8 threads. compressing objects: 100% (110/110), done. writing objects: 100% (111/111), 599.75 kib | 0 bytes/s, done. total 111 (delta 60), reused 40 (delta 1) remote:

android - Recursive entry to executePendingTransaction -

in brief have such construction: class albumpickerfragment extends pagefragment { ... @override public void oncreateview(layoutinflater inflater, viewgroup container, bundle savedinstancestate) { super.oncreate(savedinstancestate); mcallback.onviewcreated(this); } } public class playlistpickeractivity extends baseactivity { @override protected void oncreate(bundle savedinstancestate) { ... fragmentcreatedcallback callback = new fragmentcreatedcallback(); if (savedinstancestate == null) { mfragments.add(pagefragment.newinstance(pagefragment.album_fragment_type, callback)); madapter = new pageradapter(getsupportfragmentmanager(), mfragments); mpager.setadapter(madapter); } else { restoring = true; } } callback extends icallback { public void onviewcreated(final fragment fragment) { m

arrays - java arrayoutofbounds exception error when program together -

i doing assignment , have several simple string manipulations. think have last 1 figured out, , works itself, not work when put other string manipulations, giving me arrayoutofbounds exception error. advice? here small code made public static void main (strings[] args) { scanner sc = new scanner(system.in); string thesentence = sc.nextline(); string [] thewords = thesentence.split(" "); arrays.sort(thewords); system.out.println(thewords[1]); system.out.println(arrays.tostring(thewords)); } this not work when put rest of code though works itself. reference, code supposed take in small sentence , give me smallest word lexicographically. ex: input: "4 wait this" output "is" the code assuming thewords have @ least 2 elements in it. if sentence provided user not have spaces, thewords never element in position 1 , program crash on system.out.println(thewords[1]);

c++ - Allocating vertex buffer object -

i'm trying create terrain heightmap in opengl(c++), , following this tutorial . i'm trying use vertex buffer object speed up. in example, create vertex object 3 floats x, y, z. pass pointer array of these vertex objects copied buffer object. don't understand why size of buffer parameter pass size of 3 floats (multiplied number of vertices). surely vertex objects being passed larger size of 3 floats? glbufferdataarb function somehow extract these variables? size of object equal size of variables in it? or missing something? vbos store bytes. later gl*pointer() and/or glvertexattrib() calls tell opengl how interpret bytes. to store 3 floats need sizeof(float) * 3 bytes. to store n three-float vertices need sizeof(float) * 3 * n bytes.

html - Images not appearing in Google Chrome -

i have image (with number in image name - it's called ad1.jpg). anyhow, loads fine on major browser tested, yet never seems load on google chrome reason. saw once today, aside that, it's old image title appears instead of image. i 150% sure problem google chrome not reading image name because of number. there actual problem using number in image names using html5 standards? if not, chrome have problem reading numbers in image names? i had similar problem, because of 'ad blocker' installed on browser. read word 'ad' , blocked it. possible problem?

html - Leave a body trail with jquery -

i've been trying create effect using jquery when run mouse on div, whole body moves, leaving trail along points passed. created function enabled whole body move, couldn't find way leave trail. tried use .clone() , i'm beginner jquery, wasn't able right. me issue. here's code i'm using move body: <script type="text/javascript"> $(document).ready(function() { $("div").mouseover(function() { $("body").animate({ margin: 50, }) }); $("div").mouseout(function() { $("body").animate({ margin: 0, }) }); }); </script> thanks lot! quite interesting problem. have coded following: http://jsfiddle.net/3pq8e/ here i'm adding border , removing - creating trail. $("div").mouseover(function() { $("div").animate({ margin: 25, borderleftwidth: "50px", bordertopwidth: "50px", }, 1500 );

Rendering partial in Rails using Javascript -

i developing social network in ruby on rails 3. in post index view, displaying posts in loop ( or render partial ). render proper html page user. <%= render @post %> now, want append new post in real time in page. 1 thing comes mind write javascript ( keep on appending html tags ) whenever want append new post in page , call function. i sorry if may sound obvious facing problem every , then. know preferable method accomplish this?

How to check the validation of Google maps android API v1 key -

i developed maps application using android google maps api v1 year ago. used debug key testing , worked. 1) question how long api key works? there way check that? 2) application crash due if key expires? 3) saw google maps api v1 depreciated , no longer keys generated. code developed in v1 work if key still valid? thanks how long api key works? until google discontinues support maps v1. there no published timetable this. however, i'd move maps v2 or other alternative soonish. does application crash due if key expires? the api key not "expire" until underlying signing key does. if reason happen before maps v1 shut down, have no idea happen. so code developed in v1 work if key still valid? yes, until google discontinues support maps v1.

wordpress - how can i make a specific page tempate load for specific posts or permalinks -

hi im trying figure out how make post load different page template when clicked on example have articles page on website test.smartphonesource.org , when click on permalink article titles in generated article posts leads me products single.php page , attempts load article in page format problem single.php page designed ecommerce products not article reading how can target article posts or there permalinks make them load different page template when clicked on? need advice wordpress jedi or half way decent patta-won lol =) cant finish website until find way resolve super appreciated thanks. page templates can set use on page creating template file used instead of main template. in theme directory, create php file , call whatever like. then, make sure document starts with: <?php /* template name: your_template_name */ once have saved file, able see template dropdown in page "attributes" section of wp editor. there default, , your_template_name

Canvas: trying to use a recycled bitmap android - onSaveInstanceState -

i'm using camera via intent snap image , save imageview. intent camera in landscape mode , activity returns in portrait mode. activity changes orientation , reloads new activty. i'm trying save image in imageview. while returning activity page disappears once activity in portrait mode. when added onsaveinstancestate method crashes error: canvas: trying use recycled bitmap android i have added code below: public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.main_page); imageview = (imageview) findviewbyid(r.id.result); if(savedinstancestate != null){ bitmap photo = savedinstancestate.getparcelable("savedimage"); imageview.setimagebitmap(photo); } } i have saved image follows protected void onsaveinstancestate(bundle icicle){ super.onsaveinstancestate(icicle); imageview.builddrawingcache(); parcelable bm = imageview.getdrawingcache();

xml - Figuring out dependencies for SOAP::Lite -

i maintain scripts read xml data our data provider's soap methods. earlier morning discovered scripts on production server weren't downloading data, although ones on test server had no issues @ all. errors being generated @ xml::parser on line 187. suspect code making call xml::parser mangling $arg somehow, made attempt find out code , see how xml::parser relates soap::lite. see no obvious relationship. i know test , prod systems have different versions of modules in use, want know what's being affected before propose prod updated through cpan (i'm not prod's system owner; we've been updating modules via apt). i'd appreciate ideas. try out module::printused list of used dependencies version numbers.

android - add picker in tableViewRow error -

i'm working on selector on tableviewrow, works perfect, when choosing pickerrow repeated in row 4. idea why happens? this latest version android titanium studio var tipo = ti.ui.createpicker({ width:'15%', right:30, top:0 }); caja.add(tipo); /* var columtipo = ti.ui.createpickercolumn({ }); tipo.add(columtipo); */ //var rowpromo = []; var data = []; var db = ti.database.open("elite.db","elite"); var selectpromo = db.execute('select * promotion_types'); var = 0; while(selectpromo.isvalidrow()) { i++; var rowpromo = ti.ui.createpickerrow({title:selectpromo.fieldbyname('name')}); //tipo[obj.numero].add(rowpromo[i]); data.push(rowpromo); selectpromo.next(); } tipo.add(data); tipo.selectionindicator = true; tipo.addeventlistener('change',function(e) { //e.setbackgroundcolor('#ccc'); alert('promo'+e.selectedvalue); })

c# - Web API hide field from consumer of service -

i have class - person . consumer of web api service must set id. don't want them able set or see internalid. public class person { [required(errormessage = "id required.")] public string id { get; set; } public string internalid { get; set; } } other parts of application need work internalid, setting private/internal won't work. why don't obfuscate id? have function crypting id value , de-crypting it. encrypted id public , decrypted id private.

audio - Capture Sound in C# using .Net Own libraries nothing else -

i'm trying capture microphone sound using c#, , have searched google thing , getting non .net libraries , open source ones naudio , other directx , directx.directsound managed languages c# not i'm looking for. , have tried them both , used open source project reference in naudio http://voicerecorder.codeplex.com/ , manged capture sound , output on speaker or headphone still having problems when saving wav file wondering there .net built in libraries can me objective ? in advance :) i wondering there .net built in libraries can me objective ? short answer: no, @ least not @ present time. the .net framework not provide direct support recording audio. reason libraries naudio exist. neeed use com interop , windows api acheive this, , no small task. coding4fun article on recording sounds @ microsoft's channel 19 website uses naudio. best bet follow example.

Grails XMPP Chat Website -

i'm trying create chat website using smack library , openfire. problem when log in second user, first user gets overwritten. don't understand why. when log in create new connection, save connection in map, key id local database(from user table). when log in second user, should create new connection, saving connection map, different key, first one. when create new connection, start new thread. why first user's connection gets overwritten? are using spring social facebook plugin? had same problem grails 2.1. resolved upgrading 2.2.3.

Can't find bootstrap-responsive.css -

i'd use bootstrap little website working on i'm using bower add each client library need (jquery, angular, bootstrap ...). i've installed bootstrap (with bower install), cannot find (among downloaded files) "bootstrap-responsive.css" file. my question : possible file using bower, or have other way (like explained here : where bootstrap-responsive.css? ) ? it's baked in automatically in v3. default when including main css file. contrast there guide making non-responsive in 'getting started' area of bootstrap website.

php - Why is print_r still printing out a Json object? -

i broke code many steps possible try figure out doing. $addsdata='http://football.myfantasyleague.com/2013/exporttype=topadds&l=&w=&json=1'; $addsdata = json_encode(file_get_contents($addsdata)); $addersdata = file_put_contents("addsdata.txt", $addsdata); $getadds = file_get_contents("addsdata.txt"); $topaddsdata = json_decode($getadds, true); echo "<pre>"; print_r($topaddsdata); echo "</pre>"; and here result getting... "version":"1.0","topadds":{"week":"1","player":[{"percent":"25.95","id":"9705"},{"percent":"23.92","id":"10372"},{"percent":"23.72","id":"11440"},{"percent":"23.43","id":"11259"},{

sql server 2008 - execute sql query string from vba - where/how to store huge query strings -

i have select statement in excel 2007 vba code 20 lines long. there way call sql server function returns query string or way store query string in sql, it's easier read in case changes required? way, tried sql variable of type nvarchar(max) not contain entire sql string. other recommended solutions appreciated.

objective c - What is proper format for header files? -

i'm new ios , object oriented programming. how should use format of header files me? have attached blank header file of class newclass sub class of uiview controller. #import <uikit/uikit.h> @interface newclass : uiviewcontroller @end what know do things? declare variables , types of variables? declare methods? there difference of put private or public variables? instance variables? importing other things? how format me , other readers? #import <uikit/uikit.h> @interface newclass(class name) : uiviewcontroller (type) { variables } methods @end private methods , variables should go in implementation file more info: https://developer.apple.com/library/ios/referencelibrary/gettingstarted/learning_objective-c_a_primer/

ajax - How to Trigger $.getJSON().fail()? -

how change ajax request forcing 404 error or in jquery call function .fail() responds can test it? $.getjson(urlthing, { maxresults: 5, pagetoken: token, key: "something" }) .done(function(data){ crazy stuff }) .fail(function(jqxhr, textstatus, error){console.log("request failed: "+ textstatus+ ', ' + error);}); }; just change url string invalid value give 404 $.getjson('urlthing' + 'testurl', { maxresults: 5, pagetoken: token, key: "something" }) .done(function(data){ crazy stuff }) .fail(function(jqxhr, textstatus, error){console.log("request failed: "+ textstatus+ ', ' + error);}); };

java - Reducing reading from excel file in applet -

my applet can read excel file stored in jar, read excel file, have use 5 other jars (dom4j-2.0.0-alpha-2, poi-3.9-20121203, poi-ooxml-3.9-20121203, poi-ooxml-schemas-3.9-20121203, xbean) total 10.1 mb excluding actual applet jar (1.36 mb). these take while download, wondering if there better excel reading library use smaller. if excel file stored in jar, not being modified after deployment. means can kinds of pre-processing , data extraction (to more accessible format) part of build process (and remove excel libraries distribution).

java - Do I have my raytracing right? - LWJGL -

so, i'm desperately trying understand ray tracing, , think have it...? think is: have camera location , rotation, , create simulated entity in move along velocity equal 0-1(float/double) vector per coordinate, in short amount of time, , in end lot of collision checking, find , return location depending on how collision data? theories of understand, question is, did right? depending on amount of time can invest in this, 1 idea working implementation, such pbrt , , try understand higher level, in, feed example scene, downloadable, , debug code see how goes parsing file, creating scene , geometry, sampling region , creating rays, , evaluating value rays. you skip details not feel overwhelmed.

objective c - Why use CFTimeInterval instead of just double? -

what reason of using cftimeinterval instead of double in objective c? the actual type used might change 1 platform another, int did when cpus transitioned 32 64bits. also, variables defined platform independent type considered more self descriptive - nobody wonder if cftimeinterval variable in hours, milliseconds, etc, because type documented mean seconds.

google chrome - Getting a JavaScript error on a virtually empty page -

this website. i'm getting following error in javascript console: uncaught typeerror: cannot read property 'onbeforerequest' of undefined background.js:65 i have no clue why be. don't have background.js file. why getting error? it’s extension; errors given page show in chrome console. should able click filename; it’ll open in resources panel , tell one.

android - Changing the action buttons on a notification -

i have notification i'm trying update reusing same notification builder, there's no way clear buttons, can call addaction . not using same builder results in notification flashing, undesirable. there solutions this? i'm using notificationcompat v4 support library. notificationbuilder.mactions.clear(); it's public arraylist<action> , can whataver want it.

sql server - Backup file size inflates while in HA group -

does know cause of inflating database backup sizes after adding database high availability group? i've noticed behavior not example below database i've added ha group. don't think can support ha option in environment if intended behavior. database file size 322560.00 mb; space available 23444.92 mb full backup size compression before ha group: 4188.3 mb full backup size compression after adding ha group: 48697.4 mb full backup size compression after removing ha group: 4925.1 mb full backup size compression after re-adding ha group: 48732.2 mb ha group in healthy state these settings: asynchronous, manual failover, allow connections in primary role, readable in secondary, standard port 5022 endpoint, primary backup preferences. syncing 1 server @ dr state in state. backup routine consists of full every weekend, diff every week night, log every hour , databases not in ha group still have our standard compression ratio same ma plan. command in our custom l

Google Analytics missing __utmz cookie -

i have universal analytics installed on website, , want parse __utmz cookie referral info. however, never see cookie set. has changed? reason isn't set? i see _ga cookie when browse site, , see __utmz cookie in browser cache if go other sites. i checked out docs, , don't see reference changing recently, bit stumped. universal analytics doesn't create __utm* cookies. however, can use universal analytics code (analytics.js) , traditional code (ga.js) simultaneously on site. allow populate ua profile , scrape values __utmz.

android - dynamic xml layout rotation -

i have 2 buttons on main activity , when pressed want call exact same activity exept on 1 layout rotated 180 degrees. there way (like rotate based on passed main activity) need create 2 different activities practically same code in respective java file? edit: when exact same activity don't mean same main. it's same 2 buttons... i think found solution you. use custom reverse view wraper reverse whole layout. try run sample code below. public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); int layoutid = r.layout.main; view content = getlayoutinflater().inflate(layoutid, null); reverseview wraper = new reverseview(this); wraper.addview(content); setcontentview(wraper); } public class reverseview extends framelayout { public reverseview(context context) { super(context); }

linux - Yum unable to resolve dependency of a existing file in the $PATH -

i trying install rpm , failing due unresolved dependance. file libc.so.6 the path of $path, don't know complaining about. # yum install libdb-5.3.21-3.fc18.x86_64.rpm loaded plugins: rhnplugin, security system not registered uln. uln support disabled. setting install process examining libdb-5.3.21-3.fc18.x86_64.rpm: libdb-5.3.21-3.fc18.x86_64 marking libdb-5.3.21-3.fc18.x86_64.rpm installed resolving dependencies --> running transaction check ---> package libdb.x86_64 0:5.3.21-3.fc18 set updated --> processing dependency: libc.so.6(glibc_2.14)(64bit) package: libdb --> processing dependency: libc.so.6(glibc_2.15)(64bit) package: libdb --> processing conflict: libdb conflicts filesystem < 3 --> finished dependency resolution libdb-5.3.21-3.fc18.x86_64 /libdb-5.3.21-3.fc18.x86_64 has depsolving problems --> libdb conflicts filesystem libdb-5.3.21-3.fc18.x86_64 /libdb-5.3.21-3.fc18.x86_64 has depsolving problems --> missing de