Posts

Showing posts from May, 2013

iis - How to avoid asking the clients to clear browser cache for the latest Javascript changes? -

a client report bug in our js-heavy app, fixed it, client's browser still using cached copy. happens lot, , asking our clients flush browser cache seems low-tech , troublesome. we aware of ?ver=xxx workaround, use requirejs it's not easy apply such hack. would http cache control work? however, noticed iis not pick js file changes right away , http header (last modified) not reflect latest changes. would etag work better? better or worse last modified on iis? any other solutions? thanks requirejs has cache busting property can use -: require.config({ urlargs: "bust=" + (new date()).gettime() }); edit -: however, ian pointed out below, in documents recommended not use way production code. everytime push new commit production maybe can instead add specific version number. require.config({ urlargs: "ver=1.1.1" });

jquery - Why doesn't click work on appended elements? -

i move html elements 1 container endlessly using jquery append function but, click event won't fire no more when click on element/s have been appended. based on threads similar mine found out appended elements stripped off of event listeners. how can avoid that, can show solution ? here the: fiddle $('section.container-a div.elem').click(function() { $('section.container-b').append(this) ; }) ; $('section.container-b div.elem').click(function() { $('section.container-a').append(this) ; }) ; it work. use following method appended. $(document).on('click', 'section.container-a div.elem', function() { $('section.container-b').append(this) ; }) ; explanation of problem, doing following, $("span").click(function(){ an event handler attached span elements currently on page, while loading page. create new elements every click. have no handler attache

tfs2010 - TFS Build 2010 and Third party references -

in project collection, made separate project containing third - party dlls. these dlls referenced other project solutions. local build of project solutions works fine referencing these dlls in local folder third-party project maps to. but, creating problems on tfs build server creates folder(s) before making build. hence reference path of third party dlls inside project breaks. way handle issue builds on build server? to support team editing , build servers need make codebase relocatable . is, references need use relative paths (....\somefolder\somefile.txt) rather absolute paths (c:\mycode\somefolder\somefile.txt). this allow programmer (or build server) map code different hard drive or folder path , still able correctly compile code. so need store pre-built 3rd-party dlls in folder alwas tored in same place relative solution, , make sure references files (references, build event scripts, etc) use solution-relative paths.

asp.net - Selected a row in a grid view, now want to update that record with update button click -

i have been stuck on , tried few different things use update button update record selected grid view. have 2 columns in table id , name. select record , populates text box name.... works fine. need take same record , update name same text box after pulled text box using update button click event. have 2 other buttons work fine "add" , "delete" , add code here code: this how have populated grid view on page load or when call method: private void populatecompanylistgrid() //this populate grid table data on page load { ilist<company> companies; using (var context = new imsdbcontext()) { companies = context.companies.tolist(); } grdvwcompanylist.datasource = companies; grdvwcompanylist.databind(); } this how grid view set up: <asp:gridview runat="server" id="grdvwcompanylist" onselectedindexchanged="selectgridrow" datakeynames="id, name" all

C# SQL Query Producing Different Results than Management Studio -

Image
select wl.watchlistid, wl.code, wl.[description], wl.datecreated, wl.createdby, wl.datemodified, wl.modifiedby, wpi.parameterexpression individualexpression, wpb.parameterexpression businessexpression, wpd.parameterexpression defaultexpression, case when exists(select 1 sourcewatchlist sourceid = @sourceid , watchlistid = wl.watchlistid) 1 else 0 end isactive [watchlist] wl left join sourcewatchlist swl on wl.watchlistid = swl.watchlistid , swl.sourceid = @sourceid left join (select parameterexpression, sourceid, watchlistid watchlistparameter entitytype = 'individual') wpi on wpi.sourceid = @sourceid , wpi.watchlistid = wl.watchlistid left join (select parameterexpression, sourceid, watchlistid watchlistparameter entitytype = 'business') wpb on wpb.sourceid = @sourceid

jquery - scrollspy active class flickers with AJAX -

scrollspy causing li flicker between first , second li when scroll down page, once last section correct li becomes active. i'm pretty sure has ajax, can't figure out why. when refresh page scrollspy works perfectly. ideas why happening? i've tried no success. body tag <body data-spy="scroll" data-target=".stickysteps"> how scrollspy called <% if manual.present? && manual.steps.present? %> <div class="stickysteps"> <ul class="nav nav-pills"> <% n = 0 %> <% @manual.steps.order(:priority).each |step| %> <li><a href="#step<%= n+1 %>"><h4>step <%= n + 1 %></h4></a></li> <% n += 1 %> <% end %> </ul> </div> <h1 style="margin-left: 20px;">your instructions:</h1> </br> <% steps = manual.steps.order(:priority) %> <%= render(steps.order(:priorit

Translation of nested for loops into Haskell -

i struggling translate piece of matrix multiplication in f# haskell (pls forget parallel component): parallel.for(0, rowsa, (fun i-> j = 0 colsb - 1 k = 0 colsa - 1 result.[i,j] <- result.[i,j] + a.[i,k] * b.[k,j])) |> ignore all managed put sum (map (\(i, j, k) -> (my.read (a,i,k)) * (my.read (b, k, j))) [ (i, j, k) | <- [0..rowsa], j <- [0..colsb], k <- [0..colsa] ]) --my.read reads values of respective cells 'my' database the intention read cells of matrix , matrix b database , matrix multiplication can carried out in portions different agents. controlled setting boundaries , j , k not relevant here. i have tried translate above f# sample haskell. issue struggling result not sum on there should list of results @ position i, j(f# result.[i,j] - cell result matrix). not see how emit right result (i,j). maybe must further take apart? what original code doing? also, type signature of my.read

internet explorer - php get data on IE (Greek char) does not work -

i have 2 pages , use ajax in order tasks without refreshing page. problem when use internet explorer, got value '?'. try have catalog , when user clicks on character, other page performing sql tasks , first page presents results. first page: <html> <head> <meta http-equiv="x-ua-compatible" content="ie=9"/> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <script> function loadxmldoc(mylink) { alert ("ok"); var xmlhttp; alert (mylink); if (window.xmlhttprequest) { xmlhttp=new xmlhttprequest(); } xmlhttp.onreadystatechange=function() { if (xmlhttp.readystate==4) { document.getelementbyid("information").innerhtml=xmlhttp.responsetext; } } xmlhttp.open("get","select.php?data=" + mylink,true); xmlhttp.send(); } </script> </head> <body> <center> <font size = "4"> &

c - Number of rows of a file is not known a priori -

an exercise in c tell me read infos file txt in the number of rows not known priori . example have file this: name surname tel name1 surname2 tel2 i tought use function fscanf() in way file *fp ... while(fscanf(fp, "%s%s%s\n", name, surname, tel) != eof) { //function } is right way? h2co3 right fscanf returns number of fields matched. the real problem don't know how many rows in file , not know how large structure or array allocate data. 1 solution use std:vector can grow. it surprising how code reads file twice. once count lines, allocate storage , again read data. can sane solution.

Creating the right SOAP call in PHP -

i'm having trouble creating right soap call in php. i've tested following call in soap ui , works, i've tried creating objects, arrays , soapheaders , can't seem right call. here request works in soap ui: <?xml version="1.0" encoding="utf-8"?> <soapenv:envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:com="com.dtn.aghost.api.subscriptions"> <soapenv:header> <com:servicecredentials> <usernamepasswordcombo> <username>[username]</username> <password>[password]</password> </usernamepasswordcombo> </com:servicecredentials> </soapenv:header> <soapenv:body> <com:subscriptionserviceidlist> <visible>1</visible> </com:subscriptionserviceidlist> </soapenv:body> </soapenv:envelope> than

How do I accept user input on command line for python script instead of prompt -

i have python code asks user input. (e.g. src = input('enter path src: '). when run code through command prompt (e.g. python test.py) prompt appears 'enter path src:'. want type in 1 line (e.g. python test.py c:\users\desktop\test.py). changes should make? in advance replace src = input('enter path src: ') with: import sys src = sys.argv[1] ref: http://docs.python.org/2/library/sys.html if needs more complex admit, use argument-parsing library optparse (deprecated since 2.7), argparse (new in 2.7 , 3.2) or getopt . ref: command line arguments in python here example of using argparse required source , destination parameters: #! /usr/bin/python import argparse import shutil parser = argparse.argumentparser(description="copy file") parser.add_argument('src', metavar="source", help="source filename") parser.add_argument('dst', metavar="destination", help="destin

iphone - Titanium: How to use Google Maps on iOS devices? -

i'm working on app titanium map module. building app android , ios. currently, on android devices map module uses google maps, on ios devices (iphone,ipad..etc) map module uses imaps. there way can use google maps in ios devices (instead of using imaps) ? i'm using standard titanium map view. var mapview = titanium.map.createview({ maptype: titanium.map.standard_type, region: myregion, regionfit:true, userlocation:true, annotations:[annotation] }); see following official url: https://developers.google.com/maps/documentation/ios/intro?hl=es

c# - How to find out if the caret exists [in opera]? -

i'm trying solve following task: have opera browser , want find out, whether caret (text cursor) exist @ time. example, click on address bar, , want know caret blinking now. click on empty place on page , know there no caret exists. in other words want define text element in focus now. i know how solve task in many applications, of them uses standard windows controls such edit, can obtain focused window , check it's class winapi. in other applications, controls rendering without native windows, can obtain automation ui. but regret opera has 1 main window , doesn't provide access ui automation technology. so, know how approach goal?) edit: thanks eric brown, solution of problem: // consoleformsaa.cpp: определяет точку входа для консольного приложения. // #include "stdafx.h" #include <oleacc.h> #include <iostream> #pragma comment (lib, "oleacc.lib") void processcaretpos(hwnd hwnd); int _tmain(int argc, _tchar* argv[])

google apps script - How do I move a spreadsheet from the root to my active folder? -

i use following code create new spreadsheet. function addnewspreadsheetwithfoldershift() { var source = spreadsheetapp.getactive(); var ssid=source.getid(); var fileindocs = docslist.getfilebyid(ssid); var folder=fileindocs.getparents()[0]; var foldername = folder.getname(); var folderid = folder.getid(); var timezone=session.gettimezone(); var dtstamp= utilities.formatdate(new date(), timezone, 'yyyy:mm:dd hh:mm:ss zzz'); var user=session.geteffectiveuser().getemail(); var output_name=dtstamp+"linechecks" var ssout = spreadsheetapp.create(output_name); // create new spreadsheet, output_name. ssout.addtofolder(folder); } it winds in root directory. wind in directory started from. tried using addtofolder seems files can moved using it. there way move newly created spreadsheet? you can use docslist service move file after creation, try : ... var ssout = spreadsheetapp.create(output_name); // create new spreadsheet, output_name. var root

c# - Proper way to create a radiobuttonlist without having any of the radiobuttons checked by default -

the nullable identifier makes radiobuttonlist not check of radiobuttons default on first page load. proper way handle scenario? or best practice? model: [required] public someenum? choices { get; set; } public enum someenum { optionone, optiontwo } view: <div> @html.validationmessagefor(x => x.choices) @html.radiobuttonfor(x => x.choices, someenum.optionone) @html.radiobuttonfor(x => x.choices, someenum.optiontwo) </div> rendered html: <div> <input name="choices" id="choices" type="radio" data-val-required="the choices field required." data-val="true" value="optionone"></input> <input name="choices" id="choices" type="radio" value="optiontwo"></input> </div> yes, using best model represent radio list no default value. right purpose null . an advantage of approach [required] a

html - Use round corners without gif and add background color on top and underneath instead of gif -

i trying create email template. bottom , top headers wish use round corners way have managed using gif files...how can without on code below ? (right table border incomplete , down, not closed). have tried adding gif image in center <td valign="top" align="center"><img src="file:///c|/users/the/desktop/my gif.gif" width="288" height="146"></td> and have background color around edges or behind image considering transparent - , on bottom. any other edits on template more welcome. <html><head> <meta http-equiv="content-type" content="text/html; charset=utf-8"> <base target="_blank"> <title>==</title> </head><body> <table width="614" border="0" align="center" cellpadding="0" cellspacing="0" style="font-family:arial, helvetica, sans-serif; font-size:12px; color:#656565;&qu

ios - Need of Receipt Validation with Hosted Content -

simply put, if supporting ios 6, there need receipt validation separate server if product must download hosted content apple's servers? this question of how risk willing take. while receipt validation optional, vulnerable potential exploits , bugs may found in later ios versions (apart 1 known , stated apple ios 5.1 , earlier) if choose not implement it. personally i'd suggest implement receipt validation, can reuse server side apps little no hassle. if question related cost of server you'd otherwise not need, have weight versus potential exploit or bug (which may minimal). stated before, @ end, boils down risk willing take.

Paypal Internal Server Error when capturing payment with rest api -

i have issue in c#-based project, can reproduce curl well. code working few days ago isn't , i'm pretty sure haven't changed it. i have payment has been authorized , have id, correct (when close transaction online tool authorization_already_completed instead of server 500 error). here's curl repro it, sensitive info redacted: // check if authidhere code correct: curl -v -x https://api.paypal.com/v1/payments/authorization/authidhere -h "content-type:application/json" -h "authorization:bearer bearer123" the above call works , returns: { "id": "authidhere", "create_time": "2013-07-17t21:17:58z", "update_time": "2013-07-17t21:18:00z", "state": "authorized", "amount": { "total": "1.35", "currency": "usd", "details": {

css - How can I work around the need for Bootstrap 3's form-control class? -

i decided try out bootstrap 3 tonight first time. noticed that, in order default, pretty form field styling, need add form-control class each input, textarea, select, etc. pain dynamically generate forms (e.g., using django). django allows set attributes of form fields, globally require nasty monkey patch or else non-dry code. is there way avoid requirement of class, still retaining basic form field styles? is there quick way (preferably non-js) address otherwise? you realy should check django app render django forms nice boostrap forms, using tag in template. its name django-bootstrap3 . here's how use it: install django-bootstrap3 add bootstrap3 installed_apps : installed_apps = ( ... 'bootstrap3', ... ) update template: load bootstrap3 replace {{form.as_p}} {% bootstrap3_form form %} before: <form method="post" class="form-horizontal" action="" > <div class="hidden-desktop

mysql - How do I merge messages using either OR or JOIN? -

i want show conversation between person , person b only. type in facebook messages ... the problem query returning messages , not ones between selected people. how fix or or join? select * msgs usr_to = 'myself' , author_msg = 'he' or author_msg = 'myself' , usr_to = 'he' order id desc limit 12 use brackets group conditions: $mysql = mysql_query( "select * msgs (usr_to = 'myself' , author_msg = 'he') or (author_msg = 'myself' , usr_to = 'he') order id desc limit 12", $mysql );

floating point - Odd behavior of int(x) in python -

when running program, cost = 12 money = 12.51 change = money - cost dollars = int(change) change -= dollars quarters = int(change / 0.25) change -= quarters * 0.25 dimes = int(change / 0.1) change -= dimes * 0.1 nickels = int(change / 0.05) change -= nickels * 0.05 pennies = int(change / 0.01) print("""your change is: %i dollars %i quarters %i dimes %i nickels %i pennies """ % (dollars, quarters, dimes, nickels, pennies)) the output is your change is: 0 dollars 2 quarters 0 dimes 0 nickels 0 pennies why pennies 0? i've tried printing pennies separately, same thing happens. know change / 0.01 equal 1.0 . reason, seems int(1.0) equal 0 . obviously, it's not. maybe 1.0 floating point number isn't 1 , gets floored 0 ? sidenote: removing int function on pennies , replacing %.0f pennies works. i guess people talk when not use floating point numbers when working money. :) i

json - Need a few extra lines of code in a Chrome Extension? -

Image
i saw question come once before on site ( https://stackoverflow.com/questions/18006943/nike-updated-website-and-my-script-isnt-working ), closed cause guy wasn't asking specific questions; let me break down y'all. so there's been chrome extension that's been floating around automatically added specified sizes , quantities of whatever nike shoe link opened cart visited site. coding follows: var size_i_want = "9.5"; var how_many = 1; function addtocart() { var sizeslist=document.getelementsbyname("skuandsize")[0]; function setquantity() { document.getelementsbyname("qty")[0].selectedindex = how_many-1; } function setsizevalue() { (var i=0; i<sizeslist.length; i++){ if(sizeslist.options[i].text == size_i_want) { document.getelementsbyname("skuandsize")[0].selectedindex = i; setquantity(); } } } if(sizeslist != undefined) { setsizevalue(); document.getelem

hadoop 1.1.2 - streaming jar not found -

i getting below error: when try execute mapreduce job written in python.. not able locate streaming*.jar... please suggest how issue can solved.. can please guide me in writing bash file below commands.. hduser@hadoop-pc:~/hadoop/contrib$ hadoop jar contrib/streaming/hadoop-*streaming*.jar -file /home/hduser/mapper.py -mapper /home/hduser/mapper.py -file /home/hduser/reducer.py -reducer /home/hduser/reducer.py -input /user/hduser/gutenberg/* -output /user/hduser/gutenberg-output warning: $hadoop_home deprecated. exception in thread "main" java.io.ioexception: error opening job jar: contrib/streaming/hadoop-*streaming*.jar @ org.apache.hadoop.util.runjar.main(runjar.java:90) caused by: java.io.filenotfoundexception: contrib/streaming/hadoop-*streaming*.jar (no such file or directory) @ java.util.zip.zipfile.open(native method) @ java.util.zip.zipfile.<init>(zipfile.java:215) @ java.util.zip.zipfile.<init>(zipfile.java:145) @ java.uti

Asynchronous JavaScript using Callbacks -

i new javascript , various resources have read javascript functions asynchronous if coupled callbacks. after searching rigorously 10+ days on web not find explanation on how callbacks in javascript run asynchronously. examples ajax given not provide clear answer, can explain how callbacks in javascript run asynchronously below code? function myfunc(a,b,callback){ var callbackvalue = callback(); var add= a+b; var subt= a-b; var mult= a*b; var div= a/b; ... ... ... ... ... var totalvalue= add+callbackvalue; } function myfunc(a,b,function(){//complex scientific operation takes 10 secs }); as using callback in "myfunc" in above code, mean when callback() invoked in "myfunc", runs asynchronously , program flow continues var add= a+b; var subt= a-b; ......... ....... without waiting result of callback();? yes , no. if don't use settimeout/setinterval, runs synchronously. /

actionscript 3 - ByteArray.clear() not working for shared ByteArrays? -

it appears bytearray.clear() doesn't when share bytearray worker. take code example: package { import flash.display.sprite; import flash.system.worker; import flash.system.workerdomain; import flash.utils.bytearray; public class main extends sprite { private var _worker:worker; public function main():void { if (worker.current.isprimordial) { initmain(); } else { initworker(); } } private function initmain():void { _worker = workerdomain.current.createworker(loaderinfo.bytes, true); var bytes:bytearray = new bytearray(); bytes.writeunsignedint(12836439); bytes.shareable = true; _worker.setsharedproperty("bytes", bytes); bytes.clear(); trace(bytes.length); } private function initworker(

php - Jquery Ajax Insert Extremely Slow -

i having tough time trying figure out why onblur, triggers ajax call taking long time finish. takes dozens of seconds @ times. seems more of "description" fields have, longer takes. can review code, , tell me if think i'm missing something? var description; var id; $(".description").live('blur',function() { var success; var datatype; $(".dynamic_row,<?php echo $services; ?>").each(function() { var row = $(this); var id = row.find(".id").val() || 0; var description = row.find(".description").val() || ""; var q = <?php echo $q; ?>; $.ajax({ type: "post", url: 'setdescname.php', data: {ider:id, descriptionr:description, qr:q}, success: function(result) { if(result.isok == false) alert(result.message); }, datatype: datatype }); }); }); <?php e

java - IllegalAccess Error JPA -

hey take illegalaccess error, entitymanager caused by: java.lang.illegalaccesserror: sessionbean/accounts the client starts methode on public static void main(string args[]) { sessionbean.connect(); sessionbean.create(); } the sessionbean @override public void create() { em.persist(new accounts("test", "test")); } thrown if application attempts access or modify field, or call method not have access to. normally, error caught compiler; error can occur @ run time if definition of class has incompatibly changed. you have old copy of accounts.class floating around, or it's defined differently in more 1 jar on runtime classpath.

Fetch data from website table using vba -

i need update excel file information, obtained following link (warning, ukrainian language): link ministry of finance web-site of ukraine useful data wrapped html tags <tbody></tbody> . i need similar code retrieves information table set htm = createobject("htmlfile")' #it doesn't work on mac os machine, performs on windows createobject("msxml2.xmlhttp") .open "get", <site_url_goes_here>, false .send htm.body.innerhtml = .responsetext end htm.getelementbyid("item")' <<<<<---what should write here in order parse data web-site table? sheet2.cells(row, 4).value = p x = 1 .rows.length - 1 y = 0 .rows(x).cells.length - 1 sheet2.cells(row, y + 1).value = .rows(x).cells(y).innertext next y row = row + 1 next x end with` below code updated data http://www.minfin.gov.ua in eve

php - CodeIgniter: Limit cookies only on maindomain.tld and www.maindomain.tld -

i'm working on project on codeigniter , limit cookies on maindomain.tld , www.maindomain.tld, because have another, third, domain another.maindomain.tld has installed same application little different features. config maindomain.tld that: $config['cookie_prefix'] = ""; $config['cookie_domain'] = "maindomain.tld"; $config['cookie_path'] = "/"; $config['cookie_secure'] = false; and another.maindomain.tld: $config['cookie_prefix'] = ""; $config['cookie_domain'] = "another.maindomain.tld"; $config['cookie_path'] = "/"; $config['cookie_secure'] = false; cookies maindomain.tld working on another.maindomain.tld shouldn't be, because databases different , there might not same user same id. i suggest use prefix. http://codeigniter.fr/user_guide/helpers/cookie_helper.html the prefix needed if need avoid name c

linux - How to copy files from dir and append date to filename? -

i'm trying copy files 1 directory , append current date filename. script this #!/bin/bash echo 'move homedir' cd $home echo 'copy .txt files' now=$(date +"%d%m%y") filename in *.txt cp "${filename}" "/newdir/${filename}${now}" done this generates error because date appended after file extension, this file1.txt10082013 how avoid that? how extracting extension , renaming file: name="${filename%.*}" ext="${filename##*.} cp "${filename}" "/newdir/${name}${now}.${ext}"

objective c - elapsed time lower than higher score game center -

i wondering how make sure how lower elapsed time is, how higher score in apple's game center is. when have time '12 secs' , time '15 secs' later, '15 secs' recognized highest score now. how can solve this? this code use submitting: self.gamecentermanager = [[gamecenterfiles alloc] init]; [self.gamecentermanager setdelegate:self]; int my_time = 12; nslog(@"%i", my_time); [self.gamecentermanager reportscore:my_time forcategory: self.currentleaderboard]; this setting make in itunesconnect, not in code, characteristics of leaderboard configured.

php - File upload not working for all files -

i'm using code below upload files allowed extension under 5mb. using code, doc or pdf etc not uploading! example: 4.78mb docx file or windows phone 1.64 mb jpg not uploading! $allowedexts = array("gif", "jpeg", "jpg","png","pdf","doc","docx","txt","rtf","bmp","psd","zip","rar","ppt","pptx"); $extension = end(explode(".", $_files["file"]["name"])); if (in_array($extension, $allowedexts) && $_files["file"]["size"]<5242880 && $_files["file"]["error"]<=0) { $rand = rand(000,999); $tempfile = $_files["file"]["name"]; $file = $time . "=" . $rand . "=" . $tempfile; if(file_exists("upload/".$file)) { header("location:home.php?error=error"); } else {

validation - jquery.validate suppresses click/touch events, stopping iscroll4 from working -

i'm building jqm app, it's running inside cordova/phonegap on android @ moment. i have simple page form, inside iscroll wrapper scrolling. works fine, until use jquery.validate plugin on form. it seems jquery.validate plugin taking on click/touch events , not letting them iscroll. if click/touch in area outside of form, can scroll normally, if click anywhere inside form, nada. i'm using jqm 1.3.2, jquery 1.9.1 , jquery.validate 1.11.1 any ideas? frustrating... success... after screwing around, have discovered jquery.touchtoclick, jquery plugin remove 200ms delay waiting double tap. including plugin seems have had effect of working everywhere else, except iscroll , jquery.validate reason!

magento Get Base Url , Skin Url , Media Url , Js Url , Store Url and Current Url for secure -

i newbie magento . developing module. have css and js files want display links. have links <link rel="stylesheet" type="text/css" href="<?php echo $this->getskinurl('module_tryouts/css/jquery.fancybox-1.3.1.css');?>" media="all" /> <link rel="stylesheet" type="text/css" href="<?php echo $this->getskinurl('module_tryouts/css/jquery-ui-1.8.custom.css');?>" media="all" /> but after going through of links came know link should secure module can integrated mazebridge. http://jagdeepbanga.com/blog/magento-get-base-url-skin-url-media-url-js-url-store-url-and-current-url.html http://www.webdosh.net/2011/04/magento-get-skin-url-get-media-url-get.html http://www.magentocommerce.com/boards/viewthread/7894/ http://www.yireo.com/tutorials/magebridge/integrations/1213-integrating-magebridge-with-other-magento-extensions so can kindly tell me how solve iss

c# - How to align paragraph verticaly and horizontaly like MS word using Openxml? -

Image
i align paragraph passing table word document using open xml vertically , horizonaly ms word does. how can this? i have solved own use of paragraphproperties , tablecellproperties of openxml wordprocessing class. align vertically, have used tablecellproperties vertically align , paragraphproperties horizonal align , textrotation.

java - Use Google Data Store and Google App Engine in same application -

i have application storing data in google cloud sql . think tables can moved google datastore . question how can use both data store , cloud sql using same application . tried checking both option datastore , cloud sql persisting in cloud sql . this persistence.xml file . <?xml version="1.0" encoding="utf-8" ?> <persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0"> <persistence-unit name="transactions-optional1"> <provider>org.datanucleus.api.jpa.persistenceproviderimpl</provider> <class>com.sample.poc.component</class> <properties> <property name="datanucleus.nontransactionalread" value="true&q

about gen_udp for erlang multibrodcast -

i have erlang code, don't understand code { add_membership, { addr, { 0, 0, 0, 0 } } }, what's meaning of 0.0.0.0 . addr = {226,0,0,1}, opts = [ { active, true }, { ip, addr }, { add_membership, { addr, { 0, 0, 0, 0 } } }, { multicast_loop, true }, { reuseaddr, true }, list ], { ok, recvsocket } = gen_udp:open (port, opts), anyone can tell me meaning of 0.0.0.0 ? 0.0.0.0 wildcard ip address. machine might have several ip addresses, e.g. if has several network interface cards. with add_membership option register multicast address ( addr ) , incoming packets network interface ( 0.0.0.0 ) forwarded application. can add specific ip address instead of 0.0.0.0 if want allow multicast packets particular interface.

javascript - headScript()->appendFile has the same behaviour as headScript()->prependFile from view -

i ran problem. appendfile not seem work view. has same behaviour if change prependfile. layout.phtml <!doctype html> <html lang="en" dir="ltr"> <head> <?php $this->headscript()->appendfile('http://code.jquery.com/ui/1.10.3/jquery-ui.js'); $this->headscript()->appendfile('/theme/javascripts/application.js'); $this->headscript()->appendfile('/js/own.js'); ?> </head> <body> <?php echo $this->layout()->content; ?> <?php echo $this->headscript() ?> </body> </html> index.phtml <?php $this->headscript()->appendfile('/js/another.js') ?> output <!doctype html> <html lang="en" dir="ltr"> <head> </head> <body> <script type="text/javascript" src="/js/another.js"></script

libgdx change Image Sprite on runtime -

creating image actor works if sprite passed in image constructor sprite sprite ... image image = new image(sprite); i need change sprite on runtime. not work: image.setdrawable(new textureregiondrawable(newsprite)); any idea how fire change? i believe want use textureregion , decide frame draw: https://github.com/libgdx/libgdx/wiki/2d-animation

java - Allow only integers and decimal values in JFormattedTextField or JTextField in Swing -

how allow integers , decimal values in jformattedtextfield or jtextfield in java swing. i'm using intellij idea gui form designer - grid layout manager. as automatically creates variable in class not able set mask formatter or numberformat . how allow int , float numbers? read swing tutorial on how use formatted textfields working examples.

python - filling text file with dates -

i file file dates, , have 02 problems: from datetime import date, datetime, timedelta def perdelta(start, end, delta): curr = start while curr < end: yield curr curr += delta fo = open("dattes.txt","wb") result in perdelta(date(2011, 10, 10), date(2011, 12, 12), timedelta(days=4)): fo.write(result) fo.close() 1- getting error: traceback (most recent call last): file "c:\test\date.txt", line 12, in fo.write(result) typeerror: must string or buffer, not datetime.date 2-i output date contiguous (without '-' between day,month , year) use datetime.date.strftime format date. you may want write newline( '\n' ) inbetween if don't want 201110102011101420111018.... . so, ... result in perdelta(date(2011, 10, 10), date(2011, 12, 12), timedelta(days=4)): fo.write(result.strftime('%y%m%d\n')) .... alternative ... result in perdelta(date(2011,

vb.net - Visual basic text fields data to MS Word document -

i need create form data have transferred ms word document text fields private sub button1_click(sender object, e eventargs) handles button1.click dim myapp1 object dim mydoc1 object myapp1 = createobject("word.application") mydoc1 = myapp1.documents.open(c:\dsu.docx") mydoc1.field("w_vardaspavarde").range = vardaspavarde.text mydoc1.fields.update() mydoc1.fields.unlink() myapp1.visible = true end sub code above opening word document, fields lefts empty. looking advice. to code work you need index fields collection to index fields collection have use number (a long), not text value but that, have know number use. but type of field trying replace? ref field? if choice , need use fields, may better off using { docvariable } fields , setting values of corresponding variables. or, if need support windows word 2007 , later, might better use content controls linked custom xml.

c++ - OpenGL functions are undefined in VS2012 express -

i'm attempting use opengl functions in visual studio 2012 express, code looks this: #include <windows.h> #include <iostream> #include <gl/gl.h> #include <fstream> void savescreen() { //code define variables, nwidth, nheight , buffer. glreadbuffer ( gl_back ); //which buffer reading from. glreadpixels ( 0, 0, nwidth, nheight, gl_rgb, gl_unsigned_byte, (glvoid *buffer); //do buffer data return; } according internet research, code correct, apart glreadpixels apparently expects more expressions , )'s, think can work out myself. when try compile , run errors saying both glreadbuffer , glreadpixels undefined. cant find tells me apart #including windows.h , gl/gl.h , opengl should work. thanks in advance :) edit: thanks replying, added these lines additional dependancys of linker: opengl32.lib glu32.lib and capitalised function calls seems have solved problem. the functions glreadbuffer() , glreadpixels not exist in opengl. a

c# - DataVisualization set transparency of area -

i have series: system.windows.forms.datavisualization.charting.seriescharttype.area how make area transparent can see other plotted series? hav tried chartarea.backcolor property you can set property valid argb (alpha, red, green, blue) value. the backcolor value first color used if have specified gradient colors background. the alpha value controls opacity of color. if set color "transparent"—that is, if use alpha value of 0—no color assigned background of chart area. result, background transparent.

java - Don't understand \n -

could me understand how same result usint \n? system.out.println("balance: " + balance); system.out.println(); i have tried system.out.println("balance: " + balance +\n); not working. don't know whether possible or not. system.out.println("balance: " + balance +"\n");

facebook fql - SQL Select help needed -

i apologize in advance lack of knowledge in trying rssbus excel add-in facebook uses sql communicate facebook. i admin on personal account , company account. i have set developer in facebook , have appid, etc. the rssbus addin generates select statement select * 'events' pull data excel spreadsheet pull personal account. i need pull data company account. i suspect need modify select pull company account, have no idea how. any appreciated. you need modify connection string connect proper server.

azure - azcopy - remote server returned 403 forbidden -

i have several azure accounts. want copy big blog (250gb vhd) 1 account account, without downloading , uploading to/from local machine. i tried using microsoft utility azcopy (keys replaced x's): azcopy https://accountfrom.blob.core.windows.net/neo4j/neo4j-250gb.db.vhd https://accountto.blob.core.windows.net/neo4j/neo4j-250gb.db.vhd /destkey: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx /sourcekey:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx but gives me error message: error parsing destination location remote server returned error: (403) forbidden. i tested keys , accounts opening accounts in cloudberry. got urls cloudberry well, think got right well. what cause of 403? azcopy command line pattern "azcopy [source] [dest] [file pattern] [options]", the [source] treated folder (if copy local folder) or virtual directory (if copied blob), is, azcopy copy files under source folder/virtual directory. so in command line, azcopy try find virual directory equal 'xx

android - How to check is device camera enabled? -

is there way check is(/are) device camera(s) enabled ? if yes, should ? if enabled, mean open or in use, yes, there way. camera.open() give exception if camera in use. so can make use of check if camera enabled, in use or if there camera. /** how camera object savely */ public static camera getcamerainstance(){ camera c = null; try { c = camera.open(); // try camera } catch (exception e){ // camera not available (in use) or not exist } return c; // null returned if unavailable, or non existent } if camera in use want use it, call camera.release(); and use yourself.

haskell - How to handle all possible errors cleanly when using HTTP conduit? -

i have code looks this: retryontimeout :: io -> io retryontimeout action = catch action $ \responsetimeout -> putstrln "timed out. trying again." threaddelay 5000000 action the problem there lot of other constructors of httpexception, , keep trying again, regardless of error is. if replace responsetimeout _ compile error because cannot deduce type of exception. i don't want provide type signature exception handler either. i know it's not much duplication, adding case _ feels wrong because it's saying: if exception responsetimeout x, if exception else do same thing . there concise way use wildcard still let compiler know type is? if don't care exception value it's totally fine use _ you'll need use scopedtypevariables or let clause specify type want. {-# language scopedtypevariables #-} retryontimeout :: io -> io retryontime

Google cloud messaging registration giving null error message in android app -

these 2 methods called within main activity, in onstart() , onstop() respectively. private void registerformessages() { intent registrationintent = new intent("com.google.android.c2dm.intent.register"); registrationintent.putextra("app", pendingintent.getbroadcast(this, 0, new intent(), 0)); registrationintent.putextra("sender", "my project id"); startservice(registrationintent); } private void unregisterformessages() { intent unregintent = new intent("com.google.android.c2dm.intent.unregister"); unregintent.putextra("app", pendingintent.getbroadcast(this, 0, new intent(), 0)); startservice(unregintent); } where "my project id" 12 digit project number google cloud messaging android enabled in google api console. both times these called, following log: 08-10 15:07:19.370: d/gcm(791): [c2dmregistrar.143] send register result null 0 0 i have manifest file set way have seen set

javascript - How to turn camera smoothly on Google maps api? -

i following road directions street view. when make turning on road need somehow turn camera smoothly in street view heading road direction. i use this: panorama.setpov({pitch: 0, heading: newcomputedheading}); where panorama google.maps.streetviewpanorama object. the problem jumps 20 or 10 or etc degrees in 1 go. want smooth camera turn old heading value new heading value. any ideas?

CSS / JQuery: Align floated element to bottom of parent div -

is possible align floated element bottom of parent div , retain text-wrapping, using css preferably jquery if necessary? here's jsfiddle example of issue <div class="content"> <div class="floated-top"></div> <p>bacon ipsum dolor sit amet andouille jerky leberkas salami turkey, meatball prosciutto biltong shank chicken jowl frankfurter boudin. beef pork chop fatback, shank ball tip hamburger meatball strip steak t-bone ground round meatloaf flank pork ribeye. beef spare ribs pig flank. kielbasa beef ribs turkey strip steak tail pastrami prosciutto jowl ham hock shoulder hamburger venison brisket flank.</p> <p>biltong pork loin short ribs salami. pork flank beef filet mignon biltong meatball. frankfurter andouille bresaola, shank sausage shoulder tri-tip bacon pork salami meatball fatback capicola strip steak. chicken ground round strip steak bacon pancetta pork loin leberkas boudin pork chop shank fatback.

Handling Memory in .NET -

i beginner .net. .net says memory deallocation automatically handled , have read in many blogs block used dbconnections dispose.if automatically handled,why there need this. or, .net automatically handling resources excludes dbconnections ?. please clarify.. finally block executed cleaning of resources. control passed block rid of resources. garbage collector you. there many times when explicitly want piece of code executed before gc comes picture. sometimes there scenarios when want piece of code executed when there exception comes picture.

file io - Java 1.4.2 - Class Variables -

i have simple program in progress needs declaration lines read = new bufferedreader(new filereader("marks.txt")); and line = read.readline(); to class variables. how this? here code wrote far. import java.io.*; import java.math.*; public class writekong { public static string line; public static bufferedreader read; public static printwriter write; public static void main(string[] args) throws ioexception { read = new bufferedreader(new filereader("marks.txt")); line = read.readline(); while(line != null) { system.out.println(line); read.readline(); } } public static void sort() { // function does: // > check fourth digit in line // > if there no fourth digit store mark // > if mark less 50 write "fail.txt" // > if mark 50 or greater write "pass.txt" } } edit: want thes