Posts

Showing posts from July, 2010

css - How to set iframe style from inner html -

i have following line of code <iframe src="http://www.google.com" name="google" style="z-index: 0; margin-top: -1px; width: 100%; height: 1070px"> <html> <head></head> <body> <div>some image here</div> </body> </html> </iframe> the problem iframe not visible in ie7. iframe visible if add style display: block; i dont have access modify style top iframe can modify inner html. how set style of top iframe html page ? the iframe content subject same-domain policy. if it's domain, can control it, if not, you're locked out. prevents kinds of iframe-based page hijacking. considering have direct access, following : you need javascript. same doing in parent page, except must prefix javascript command name of iframe. remember, same origin policy applies, can iframe coming own server. i use prototype framework make easier:...

exception - Get MenuItem in lower Android versions -

i menuitem in lower android versions. code works fine in android 4.0.3: _menu.finditem(r.id.menu_item).setvisible(true); but app crashes in android 2.3.6. throws nullpointerexception. how can work in lower android versions? my code working minsdkversion of 8, , have no problems for fragments: @override public void oncreateoptionsmenu(menu menu, menuinflater inflater) { super.oncreateoptionsmenu(menu, inflater); inflater.inflate(r.menu.menu_result_search, menu); menuitem saveitem = menu.finditem(r.id.save_item); saveitem.setvisible(false); } for activities: @override public boolean oncreateoptionsmenu(menu menu) { super.oncreateoptionsmenu(menu); menuinflater inflater = getsupportmenuinflater(); inflater.inflate(r.menu.menu_detail, menu); menuitem upiconactionbar = menu.finditem(r.id.menu_up); upiconactionbar.setvisible(false); }

How to alter multiple nodes in a DTSX xml file with powershell -

i want following: select configuration nodes and, depending on objectname value, change configurationstring node value. the xml following: <dts:executable xmlns:dts="www.microsoft.com/.." dts:executabletype="ssis.package"> <dts:configuration> <dts:property dts:name="configurationtype">1</dts:property> <dts:property dts:name="configurationstring">change me</dts:property> <dts:property dts:name="objectname">configuration_1</dts:property> <dts:property dts:name="dtsid">{..}</dts:property> </dts:configuration> <dts:configuration> <dts:property dts:name="configurationtype">1</dts:property> <dts:property dts:name="configurationstring">me please</dts:property> <dts:property dts:name="objectname">configuration_2</dts:property> <dts:property dts:n...

How to call C/C++ binaries (ported on linux server) from Android application -

i have developed c/c++ binaries , have android app. have ported binaries on linux base server , use binaries in android app. can call binaries app? possible, please excuse me don't have idea this. here find nice tutorial implement c code android project: jni tutorial

android 2.2 froyo - Pass a List of Objects from a support.v4 FragmentActivity to a fragment -

i working in android application , want pass list of objects fragment activity fragment. , using android support library implement fragments since minsdkversion 8. i have passed these list of objects 1 activity activity implementing model classes parcelable. so please suggest me solution pass list of objects fragment activity fragment. .

Passing SQL Server connection around (node to c#) -

i working on node.js server. server uses edge.js execute c# workflow code (it dll). we using custom written logging dll logs sql server table. node.js , workflow dll use logging dll log steps sql databse. ideally need open connection sql database once , reuse node , edge/c# code. is there way of opening connection in node.js code , passing connection handle around edge/c#. or there better way this? at moment opening connection when call c# workflow dll , closing @ end. doing in node causes problems (assuming because of async code) "system.invalidoperationexception: executenonquery requires open , available connection. connection's current state open.". it bad idea pass sqlconnections around. partly because relatively expensive resource , may have limited number of them available. underlying database drivers automatically cache sqlconnections (afaik uses connection string key cache, use same connection string same data source). you should use using s...

mysql - Select all records that where added less than a month ago and more than a month ago with a score of X -

from table below, i'm trying select records that: have been added within last month (regardless of score) records added more month ago , have score of >= 10 my efforts below, i'm going wrong somewhere select id candidates dateenrolled >= date_sub(now(), interval 1 month) , dateenrolled <= now() , score >=10; i keep getting on 7 , 8 . right answer should include following ids 1 2 5 6 7 8 9 10 can please help? "id" "dateenrolled" "score" "1" "2013-01-01" "12" "2" "2013-02-01" "15" "3" "2013-03-01" "9" "4" "2013-04-01" "8" "5" "2013-05-01" "20" "6" "2013-08-01" "0" "7" "2013-08-12" "10" "8" "2013-08-13" "12" "9" ...

c# 4.0 - How to collect errors during run time given by a parser in Antlr4 -

i have upgraded antlr 3 antlr 4. using code catch exceptions using code. not working antlr 4. partial class xparser { public override void reporterror(recognitionexception e) { base.reporterror(e); console.writeline("error in parser @ line " + ":" + e.offendingtoken.column + e.offendingtoken.line + e.message); } } this error appears 'parser.reporterror(antlr4.runtime.recognitionexception)': no suitable method found override in antlr 4 expected way of accumulating errors occurs in input stream. unable find way achieve on net. please provide me guidelines. edit: i have implemented xparser below partial class xparser : iantlrerrorlistener<itoken> { public void syntaxerror(irecognizer recognizer, itoken offendingsymbol, int line, int charpositioninline, string msg, recognitionexception e) { console.writeline("error in parser @ line " + ":" + e.offendingtoken.column + e.offend...

c# - Dynamic generation of ViewModel from Model -

i have model class contains array of command operations can performed on it. idea ui editing model instance can dynamically generated @ runtime; intend using dynamic xaml creation. far, good. however viewmodel quite thing. question dynamic ui elements bind - need property in viewmodel bind to, appear need dynamically add properties vm instance , looking awfully messy. alternatively, if binding send additional parameter allowed me bind single property used parameter decide value, cleaner , simpler solution. or: don't know or haven't considered. i've had success dynamic viewmodel objects using icustomtypeprovider - allows dynamically create binding points can built @ runtime. http://blogs.msdn.com/b/silverlight_sdk/archive/2011/04/26/binding-to-dynamic-properties-with-icustomtypeprovider-silverlight-5-beta.aspx bear in mind though if planning more complicated standard crud screens, trying build dynamic mvvm system non-trivial. lose out on attached prop...

ydn db - Human Readable ydn-db Sources -

where can found last sources human readable format javascript code? i'm trying solve 1 problem can't understand code. download code here don't know file me. have @ source in project repo?

LanguageApp.translate doesn't work for script sharing user? -

Image
i need format date in gas, month/year, month word, in italian. i used language.app.translate, utilities.formatdate formats month in english language. code fragment following: var dteng = utilities.formatdate(dt, "cet", "mmmm/yyyy"); dttran = languageapp.translate(dteng, 'en', 'it'); when execute script user, works fine, , translation done. when execute different user (the 1 using script), translation doesn't happen. the execution transcript reports: languageapp.translate([january/2007, en, it]) but result same, untranslated string. all remaining part of script executes without problems. any hint? should open issue? tks massimo in case behavior of: function gettranslate() { var dteng = utilities.formatdate(new date(2007, 0, 1), 'cet', 'mmmm/yyyy'); var dttran = languageapp.translate(dteng, 'en', 'it'); /*var dttran = languageapp.translate(dteng, 'en', 'es...

cordova - cordova_plugins.js is missing -

i keep getting following error when try launch inappbrowser: failed load resource: server responded status of 404 (not found) http://localhost:8000/cordova_plugins.js when "cordova/platforms/android/assets/www/cordova_plugins.js" file indeed missing. the strange thing see: writing out cordova_plugins.js... my build process looks this: cordova create cordova com.myapp.mobile myapp cd cordova cordova platform add android cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-inappbrowser.git cordova build cordova serve android i think might bug in cordova (i'm running 3.0.6). experiencing same problem. file gets generated fine (check after cordova build line) gets deleted when run cordova serve android line. update : as workaround, running server in background , building seems make file available again. it seems problem www folder gets replaced 'serve' action. had quick flick through source code nothing jumped out ...

Magento importing images -

i getting stuck images not displaying products. when create product , insert image product manually through (manage products) image shows great. have on 1000 product images need uploaded, (all product information need add images) have exported products csv file , working image address /n/g/image1.jpg have copied change image image2.jpg, image3.jpg etc. uploaded new images folder directory on our server thinking that's enough. upload csv file blow cache , reindex data no new images show , worse working image doesn't display. have filled in image, small_image , thumbnail details in csv. images correctly sized etc. further more can allow tell me can have 1 image folder in directory images stored? thanks i'm using magento version 1.7.0.2 first of image should store in media>import directory then in csv file write in image column /imagename.jpg it find same imagename in import directory, if image exist upload image edit if don't have import di...

python - Regex for hashtags prints out each letter -

i want find hashtags in tweets. code below finds hashtags, when printing them out each letter written out instead of actual hashtag. the thing want create links found hashtags isn't possible because should create links each letter in hashtags. what doing wrong? tag_regex = re.compile(r""" [/^#\s+$/] """, re.verbose) tag in tag_regex.findall(tweet): print tag outcome: # h s h t g 1 # h s h t g 2 the brackets construct character class don't want. also, don't want use regex delimiters /.../ in language doesn't use them (a simple string sufficient, preferably raw string don't need escape backslashes). finally, shouldn't use anchors if want find substrings of input string: tag_regex = re.compile(r"#\s+")

html - Different margins of the elements -

Image
i can not understand why mobile version of elements , input select different spacing , length, looks crooked. and yet, mobile version align red button in middle? you can see live code of site - here switch of container's classes bootstrap's text-center class , it'll work (tested). this: <div class="col-md-offset-5 col-md-6 col-sm-offset-5 col-sm-6" id="d-btn-order"> <input type="button" value="Оформить заказ" class="btn btn-danger paddbtn" name="btn-pillow-order" id="btn-pillow-order"> </div> is this: <div class="text-center" id="d-btn-order"> <input type="button" value="Оформить заказ" class="btn btn-danger paddbtn" name="btn-pillow-order" id="btn-pillow-order"> </div>

sql server 2008 - Database is not connected to my website build on ASP.Net -

i got stuck in deployement of website built using asp.net, c# , using sql server 2008 database. problem website working fine on localhost not connecting database when hosted on web, know problem in sql server database in giving permission or don't know because connection , user have created same used while development , deployed on web part not using database working fine login page when enter username , password in interface , hit login not go database , pull data, mean not connect database @ all. my question matters in accessing database localhost , web, though still using local computer coding , using company"s database through vpn. first time deploying website on web , need help, know way of asking question might ambiguous please try understand , if have question please ask don't ignore. many in advance. most frequent solutions: enable tcp/ip protocol sql server instance. enable sql server browser service. open firewall ports. more information...

c++ - How can I use functions in another .cpp file? -

i making project in visual studio 2013 preview includes code tutorials learning c++ from. main file in project contains program able launch functions defined in .cpp file in same project. code below: #include "stdafx.h" #include <iostream> #include "comments.cpp" #include "structure of program.cpp" int structure(void); void comment(void); int main() { using namespace std; cout << "this project contains files related chapter 1 of learn cpp tutorials\n" << endl; cout << "please type in tutorial number view output:\n" << "1 - structure of program\n" << "2 - comments\n" << "3 - first @ variables (and cin)\n" << "4 - first @ functions\n" << "5 - first @ operators\n" << "6 - whitespace & basic formatting\n" << "7 - forward de...

date - How can I Generate a time series with Hadoop? -

what's easiest way generate time series hadoop (or pig or hive)?, or can information on proper functions? for example want generate 1sec sequence 00:00:00 01/01/2000 23:59:59 31/12/2010. with other programs, such r, quite simple because have many functions work dates , times. regards you can write mapper empty map() method. in cleanup() method use of several java packages (e.g. joda) iterate on , format timestamps before writing them context.

java - Arraylist not working with android -

i got problem , can't find anywhere. i'am making quiz app. , got mainactivity here: public class mainactivity extends activity { list<vragen> queslist; int score=0; int qid=0; vragen currentq; textview txtvragen; radiobutton rda, rdb, rdc; button butvolgende; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); dbhelper db=new dbhelper(this); queslist=db.getallvragen(); currentq=queslist.get(qid); txtvragen=(textview)findviewbyid(r.id.txtvraag); rda=(radiobutton)findviewbyid(r.id.antwoord1); rdb=(radiobutton)findviewbyid(r.id.antwoord2); rdc=(radiobutton)findviewbyid(r.id.antwoord3); butvolgende=(button)findviewbyid(r.id.btnvolgende); setvragenview(); butvolgende.setonclicklistener(new view.onclicklistener() { public void onclick(view...

c - Flatten a Tree into an Array -

i looking best way place tree array the idea follow principle : array implementation of trees i'am stuck on how know nodes children , nodes @ same level, because i'am not using binary tree. i might have store ascii can't allow arrays of 256 pointers ! any idea welcome. the purpose of this, send array (tree) gpu, instead of using structures. well, here idea of converting tree array . take array of size max_val , total number of nodes in tree. type of array should same of node 1 field. index value parent. store each node in way. store root node @ first position. 1 . child nodes of node stored subsequently field storing 1 (since root stored). apply procedure on nodes , done. can tree, simple recursive call on each node. hope helps. :) :)

url rewriting - Wordpress Page rewrite URL not working -

i seek solution problem. setup page sub pages serve holding custom post_type each subpages. news event article press release on pages add custom rewrite url can add custom url archive page, here code did sample in events add_rewrite_rule('news/events/archive/([0-9]{4})/?$', 'index.php?pagename=events&yyyy=$matches[1]','top'); add_rewrite_rule('news/events/archive/([0-9]{4})/([0-9]{1,2})/?$', 'index.php?pagename=events&mm=$matches[2]&yyyy=$matches[1]','top'); but problem if visited url example, www.site.com/news/events/archive/2013/ redirect me page url www.site.com/news/events/ is there solution or fix solve problem? tia, thanks

php - UTF-8 Turkish Character on osCommerce -

i installed oscommerce v2.2 rc2 on http://www.cwcenerji.com . problem left column (categories.php) in database category name "türkçe kategori" on front side see t�rk�e kategori i tried few things, database charset utf-8 couldn't handle. here categories.php; <div class="title"> <img src="theme/images/icons/category.png" alt="kategoriler"/> <p>kategorİler</p> </div> <div class="detail"> <ul class="categorytype"> <?php $query = mysql_query("select * categories parent_id = 0"); $i = 0; while($row = mysql_fetch_array($query)) { $cat[$i] = $row; $cat[$i]['categories_name'] = mysql_result(mysql_query("select categories_name categories_description language_id = 1 , categories_id = '".$row['categories_id...

php - How to get Base URL along with href -

presently i'm in location : localhost/magento/dresses/adidas-t-shirt.html i wrote in file this <a href="my/hello/">click here</a> when click on click here i getting like localhost/magento/dresses/my/hello/ but i'm tryng localhost/magento/my/hello/ how can one? you can try below per magento standard <?php $_getbase = mage::app()->getstore()->getbaseurl(); ?> <a href="<?php echo $_getbase; ?>my/hello/">link</a>

jmx - How to get percentage of CPU usage of OS from java -

i want calculate percentage of cpu usage of os java code. there several ways find unix command [e.g. using mpstat , /proc/stat etc...] , use runtime.getruntime().exec but don't want use system calls. i tried managementfactory.getoperatingsystemmxbean() operatingsystemmxbean osbean = (operatingsystemmxbean) managementfactory.getoperatingsystemmxbean(); system.out.println(osbean.getsystemloadaverage()); but gives cpu load not cpu usage. there anyway find usage percentage? in java 7 can so: public static double getprocesscpuload() throws exception { mbeanserver mbs = managementfactory.getplatformmbeanserver(); objectname name = objectname.getinstance("java.lang:type=operatingsystem"); attributelist list = mbs.getattributes(name, new string[]{ "processcpuload" }); if (list.isempty()) return double.nan; attribute att = (attribute)list.get(0); double value = (double)att.getvalue(); // tak...

javascript - How to search an array in Jquery like SQL LIKE value% statement -

this question has answer here: how check if string “startswith” string? 17 answers i have array values. how can search array using jquery value matched or close it? var = ["foo","fool","cool","god","acl"]; if want search c , should return cool not acl . how can achieve that? use substring check if each string in array begins string searching for: var strings = [ "foo", "cool", "acl" ]; var needle = "c"; (var = 0; < strings.length; ++i) { if (strings[i].substring(0, needle.length) === needle) { alert("found: " + strings[i]); } }

jQuery animate width on button text change -

if have button default css, how can make when click button, text changes , it's width animated fit in new text? html <button>click me</button> jquery $(document).on("click", "button", function(){ $(this).text("you have clicked me!", function(){ $(this).animate({width:"auto"}, 1000); }); }) jsfiddle http://jsfiddle.net/hyzba/41/ you cannot animate width/height auto, instead give invisible similar element width/height auto , saves calculated value, animate own element calculated value. here link explain how it.

mapreduce - FileNotFoundException while running Hadoop MR Job -

i writing 1 mapper class should read files hdfs location , create record (using custom class) each file. code mapper class :- package com.nayan.bigdata.hadoop; import java.io.ioexception; import java.util.arraylist; import java.util.list; import org.apache.hadoop.fs.fsdatainputstream; import org.apache.hadoop.fs.filestatus; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.longwritable; import org.apache.hadoop.io.text; import org.apache.hadoop.mapreduce.mapper; import org.apache.log4j.logger; /** * @file : filetorecordmapper.java * @author : nayan * @version : 1.0.0 * @date : 27-aug-2013 12:13:44 pm * @desc : mapper class read files , convert records. */ public class filetorecordmapper extends mapper<longwritable, text, text, recordwritable> { private static logger logger = logger.getlogger(filetorecordmapper.class); list<path> allpaths; filesystem fs; @override prote...

How do I know where is a function was executed in Python? -

let's imagine, i've got module foo.py declared function foofunc : def foofunc(): # smart things return and 2 different modules — bar.py , spam.py , exists code directly executes function foo module. # `bar` module. rights reserved. foo import foofunc def run_foofunc(): return foofunc() the same thing in module: # `spam` module. rights reserved. foo import foofunc def run_foofunc(): return foofunc() i need know executed function without knowledge of possible places. like: def foofunc(): print inspect.executedfrom() will in standard output <pack.bar.run_foofunc> does similar in real world? running risk of not answering actual question, wrote need research , debugging. i think traceback module great that. import traceback traceback.print_stack() also take @ pdb , allows interactively step through code during runtime.

excel - Sort rows by a specific column containing numbers -

how sort rows column containing numbers in ascending or descending order? know how sort using filters , using sort function in vba. sorts in alphabetical order not numbers. this far have done.but still sorting coming alphabetically. sub sortdata() dim lastrow integer noofrows = sheets("rawdata").range("a" & rows.count).end(xlup).row sheets("rawdata").rows("2:" & noofrows).numberformat = "0" sheets("rawdata").sort.sortfields.add key:=range("a1"), _ sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal activeworkbook.sheets("rawdata").sort .setrange range("a1:b" & noofrows) .header = xlyes .matchcase = false .orientation = xltoptobottom .sortmethod = xlpinyin .apply end end sub i prefer range.sort method: [edit 2]: have added .texttocolumns line programmatically address numbers stored ...

css - displacement of a single HTML element at the opening of another -

Image
look @ problem: how make when open popup window footer shifted down? some css here: #advanced_search_div_body { height: 100%; width: 817; margin: 0 auto; padding: 0; display: table; background-color: white; } #foot { padding: 30px 0px; background-color: black; clear: both; position: relative; bottom: 0; width: 100%; overflow: hidden; z-index: 2; } probably need tell footer down of page. so, change #foot position: relative absolute. try this: position:absolute; width:100%; bottom:0px; or like: position:fixed; bottom:0; width:100%;

c# - Signalr Winform Callback -

i experimenting signalr hubs , created small app push messages external hub. create proxy , connect hub , can invoke method want. initializecomponent(); connection = new hubconnection("http://externalsite.net"); myhub = connection.createproxy("webhub"); if (connection.state.tostring() != "connected") { connection.connectionid = "adminconsole"; console.writeline("attempting connect..."); connection.start().continuewith(task => { console.writeline("attempting connect"); if (task.isfaulted) { console.writeline("error opening connection:{0}" task.exception.getbaseexception()); } else { console.writeline("client connected"); } }).wait...

VS 2012 on windows 8 and click once publish -

i've got fresh build of windows 8 running visual studio 2012 version 11.0.60610.01 update 3. have winform app have been using (when machine running windows 7). file structure i'm trying same on windows 7. i'm local admin. i'm trying publish location of c:\inetput\wwwroot\deploy\scc (again.. doing on windows 7, on windows 7 using visual studio 2010). receive error on each file application files. errors follow line error 1 failed copy file 'c:\bob\scc\scc\mailprocessor\bin\release\app.publish\application files\mailprocessor_1_0_0_32\dbconfig.dll.deploy' 'c:/inetpub/wwwroot/deploy/scc/application files/mailprocessor_1_0_0_32/dbconfig.dll.deploy'. unable add 'application files/mailprocessor_1_0_0_32/dbconfig.dll.deploy' web site. unable add file 'application files\mailprocessor_1_0_0_32\dbconfig.dll.deploy'. system cannot find path specified. 1 1 mailprocessor the solution builds without errors, these errors whe...

asp.net - Proper way to authenticate with a web service from Android -

so have asp.net mvc 4 web app behaves pretty web service. client sends request, web service returns json object. i'm point in have authenticate users android app. proper way on client side since no longer have web browser store cookies me authenticate server. ssl taken care of. have been thinking of several straight forward ways authenticate i'm concerned having security vulnerability might not aware of. ok me store user credentials (username , password) in sqlite database on android phone app installed, , send credentials along every request server authenticate? (i'm thinking of hashing password before storing in database, of course). approach not safe? how other apps authenticate services: ebay, facebook , such? data saved in private storage relatively secure (on non rooted device @ least). include : sqlite databases (if not made worldreadable) sharedpreferences if want better integration account manager (e.g. have account listed in device's ...

jQuery global ajax error handler fires before "local" one -

i want handle 401 errors globally , deal other errors locally. locally means inside fail handler ajax call. to that, implemented ajaxerror handler on document . however, problem local fail handler triggered before global one. event.stopimmediatepropagation() inside global handler useless. how can make global 1 fired first , prevent local 1 firing @ all. thank you. var statuscodeerror = function(error) { throw new error('--> error code ' + error.status + ' on xmlhttprequest'); }; var settings = { type : 'post', url : '/ajax-script.php', datatype : 'json', context : document.body, statuscode : { 404: statuscodeerror, 301: statuscodeerror, 302: statuscodeerror, 401: statuscodeerror, 500: statuscodeerror }, failure : statuscodeerror }; $.ajaxsetup(settings);

c++ - What is the absolute lowest level of "drawing" abstraction in GNU/Linux? -

motivation - write program in c (and assembly, if required) color rectangular area in screen red. strict requirements - gnu/linux running bare minimum utilities , interfaces in text/console mode. no x (or equivalent wayland/mir), no non-default (outside posix, lsb, etc. provided kernel) library or interface , no assumptions except presence of device driver monitor. effectively, looking information on how write program send signal through vga port , cable monitor color particular portion of screen red. apologies if sounds rude, no "why want this?" or "why don't use abc library?" answer. trying understand how write implementation of x server or kernel framebuffer (/dev/fb0) library example. ok provide link source of c library. no assumptions except presence of device driver monitor. that means can use x or wayland, because graphics driver infrastructure on linux. linux (the kernel) doesn't contain graphics primitives. provides inter...

java - What does "Throws" do and how is it helpful? -

this question has answer here: the throws keyword exceptions in java 4 answers i new java , have came across tutorial uses the"throws" keyword in method. have done little research still not understand it. from have seen far, telling compiler exception may thrown in particular method. why need tell compiler this? have made many programs using merely try-catch statement in methods , has worked fine - surely these try-catch statements manage exceptions, right? you can manage exception within method using try , catch say. in case, not need use throws . example: public void mymethod() { try { /* code might throw exception */ } catch (spaceinvadersexception exception) { /* complicated error handling code */ } } but suppose had thousand methods, of might throw spaceinvadersexception . end having write complicated error handling...

javascript - JsQRCode reader not working properly -

i using jsqrcode js library decode qr codes. found works fine if take pictures of qr code close. if take picture bit farther not able decode code. note: code-decoding library used within sencha touch 2 app. picture taken using ext.device.camera api gives access phone camera. has had similar problems? possible solution or alternative way reach goal (taking picture + qr decoding)? any suggestion/comment appreciated! thank much! here code i'm running: ext.device.camera.capture({ success: function(fileuri) { // reassigning test purposes //fileuri = './resources/images/qrtemp.png'; console.log('camera success'); var imageview = ext.getcmp('cameraimg'); imageview.setsrc(fileuri); qrcode.decode(fileuri); }, failure: function() { console.log('camera failure'); }, quality: 100, source: 'camera' }, /*scope*/ this, /*destination*/ 'file', /*encoding*/ 'png'); ... qrcode.ca...

javascript - Will an ajax request ever reach readyState 4 if a local firewall is blocking the URL requested? -

it's understanding local (or local network) firewall blocking url prevent ajax request url reaching readystate 4. correct? yes will. example, @ code. function readystatecallback () { jsprint(this.readystate); }; var oreq = new xmlhttprequest(); oreq.onreadystatechange = readystatecallback; oreq.open("get", "http://foobarbaz.nnn", true); oreq.send(); you can try on this fiddle . every request triggers ready state of 1 , 4, not ready states 2 or 3. see xmlhttprequest mdn docs. 0 unsent open() has not been called yet. 1 opened send() has not been called yet. 2 headers_received send() has been called, , headers , status available. 3 loading downloading; responsetext holds partial data. 4 done operation complete. to determine if request failed (such being blocked firewall), check this.status. request 200. request didn't receive response, 0. the status at...

php - Uploading new version of a core file on running website without maintenance mode -

let's have website running on php using kernel pattern. let's have 1000 requests per second accessing kernel.php file. want upload new version of file without turning on maintenance mode. safe it? can upload new file , @ point requests handled new one? kernel.php error free sure the file included require_once() in index.php forget maintenance mode in case, please i told add information why thought approach. we trying develop system providing possibility of updating, part of webpage, driven our engine. kernel example - if file can modified without maintenance mode, in opinion, other less important might well. sometimes update simple turning on maintenance mode stopping military invasion on country because 1 of privates (soldier) sneezed. since talking blowing things , inter-process communications: none of risk uploading core files on running website without freezing request few seconds, how template files? it's of course rhetorical question, think u...

extjs - How to set a default value for combo box -

i have combo box has few static(hard coded) values displayed inside grid. by default should show first value in combo box. tried few things not work. create staticcombobox first , var staticcombobox = ext.extend(ext.form.combobox, { mode: 'local', triggeraction: 'all', editable: false, valuefield: 'value', displayfield: 'label', data: [], initcomponent: function() { this.store = new ext.data.arraystore({ fields: ['value', 'label'], data: this.data }); staticcombobox.superclass.initcomponent.call(this); } }); var cm = new ext.grid.columnmodel([ { id:'language', header: "language", dataindex: 'language', width: 235, menudisabled: true, editor: new staticcombobox({ name: 'reasons', data: [ [0, 'reason 1'], [1, 'second reason'], ...

javascript - How to implement a cross browser console.log functionality -

this question has answer here: how can use console logging in internet explorer? 9 answers is there cross browser way of implementing console.log functionality, official supported browser @ 1 of client still ie7/ie8. as development tested firefox debugging capabilities, come across issues on release obscure flow still left un commented console.log statements doesn't fly ie looking kind of, if use elegant way, love learn. function log(msg){ if(ie) alert(msg) else console.log(msg) } here option: if (typeof console === "undefined" || typeof console.log === "undefined") { console = {}; console.log = function(msg) { alert(msg); }; } edit: noted others, should make sure console.log doesn't end in production code.

html - z-index of absolute element inside a relative element -

i trying position 2 divs on left , right ends of parent div negative margin. see fiddle: http://jsfiddle.net/z9unk/239/ but absolute divs (part negative margins) stacked behind paren div. instead want them on top of parent div. what wrong code below? even though set z-index:100 absolute elements. html <div class="item1"> <div class="item3 prev "> item3 </div> <div class="item4 next"> item4 </div> <div class="item2"> item2 </div> <div class="item2"> item2 </div> </div> css: .item1 { position:relative; white-space: nowrap; width:auto; overflow: hidden; border:2px solid red; display:inline-block; } .item2 { position:relative; float:left; background-color: green; width : 255px; height : 205px; margin-right:6px; border:1px solid blue; } .item3, .item4 { top:65px; display:block; position: absol...

html - Why aren't my fonts working? -

my fonts work on chrome, opera , safari not ie or firefox. i'm having trouble understanding @font-face, after reading other questions it. @font-face { font-family: "tikalsansblack"; src: url("./fonts/tikalsansblack.eot?"); src: url("./fonts/tikalsansblack.woff") format("woff"), url("./fonts/tikalsansblack.ttf") format("truetype"), url("./fonts/tikalsansblack.svg") format("svg") url("./fonts/tikalsansblack.otf") format("opentype"); } @font-face { font-family: 'tikalsansmedium'; src: url('./fonts/tikalsansmedium.eot?'); src: url('./fonts/tikalsansmedium.woff') format('woff'), url('./fonts/tikalsansmedium.ttf') format('truetype'), url('./fonts/tikalsansmedium.svg') format('svg') url('./fonts/tikalsansmedium.otf') format('opentype'); } @font-face { ...

css - @font-face doesn't work in play-framework -

in css, have: @font-face { font-family: 'myfont'; src: url("fonts/bluepss.ttf"); font-weight: normal; font-style: normal; } button { font-family: myfont; font-size: 40px; color: #ffffff; width: 400px; height: 100px; background-color: #bdaec6; } the bluepss.ttf file stored in public/fonts/ folder. ideas why font's not showing up? thanks in advance. thanks @cyn, found answer. realized in route file had get /public/*file controllers.assets.at(path="/public", file) so instead of assets, put public, , worked: /assets/fonts/bluepss.ttf

Drupal Views based on filtering taxonomies based on available content -

this seems should relatively basic, can't seem wrap brain around it. have client in need of advanced filtering thousands of different content items. each content item filed using different taxonomy types. filter through system, should eliminate content not correspond selected taxonomy. so far, good. the issue filters should update based on taxonomy of selected content. in particular case, there's select box location, hunting/fishing, , species. if select illinois > fishing > freshwater, last filter (species) should show tags species list correspond selected filters. the system works fabulously displays every species of fish, not ones selected filter. any guidance tremendously appreciated. i recommend views_hacks module ( views selective exposed filters submodule) ajax enabled , autosubmit views.

meteor - Path variables not working on 0.6.5 e.g. METEOR_SETTINGS -

i cannot working after updated 0.6.5. i created new meteor project. i have start.sh script looks this. export meteor_settings=$(cat ./settings.json) meteor settings.json: { "public":{ "bla":"blup" } } meteor.settings on client undefined. works if add settings json file via "--settings", unfortunately not need. the port environment variable or node_env not work me. adding random stuff "export my_env_var=foo" works. am missing s.th.? worked before. appreciate help. thx! (also created issue: https://github.com/meteor/meteor/issues/1381 ) if trying test meteor app locally (dev mode) or want deploy app meteor hosting, pass file path settings param: meteor --settings settings.json in case of running bundle on own server, need environment variable. docs .