Posts

Showing posts from February, 2010

Basemap projection -

i have latitude , longitude data in following format 11.422, 47.3156 i want plot these points on basemap, don't know projection use them plotted right. trid out view didn't worked out, please me. you can following documentation at: http://matplotlib.org/basemap/api/basemap_api.html , trying out http://matplotlib.org/basemap/users/examples.html

linux - How to do some task after Asterisk ReceiveFax function calling? -

i have asterisk server installed: , have created dial-plan receive fax: want task after received fax. but, line written after recevefax function called when transmission failed . if transmission success never called line after. my dial-plan: ;######################### fax dialplan implementation start ########################## exten => _15555551212,1,noop(fax receiving ${exten}) exten => _15555551212,n,answer exten => _15555551212,n,ringing exten => _15555551212,n,macro(inboundfax) exten => _15555551212,n,noop(done) exten => h,1, noop(completed...) [macro-inboundfax] exten => s,1,noop(**** fax received ${callerid(num)} ${strftime(${epoch},,%c)} ****) exten => s,n,set(faxopt(ecm)=yes) exten => s,n,set(filename=fax-${strftime(${epoch},,%y%m%d-%h%m%s)}) exten => s,n,set(faxfile=${filename}.tif) exten => s,n,set(faxopt(ecm)=yes) exten => s,n,set(faxopt(headerinfo)=received mycompany ${strftime(${epoch},,%y-%m-%d %h:%m)}) exten => s,n

c# - Prevent application from changing desktop resolution -

so have old game client annoyingly takes upon change desktop resolution cater 1600x900 resolution achieve full screen, i'm trying figure out how stop happening. i imagine it's calling changedisplaysettings() in user32.dll, if possible block specific dll calls, or perhaps easier way? thanks in advance. edit: should add game client not own have no direct control on it's doing. i have managed breakpoint before changedisplaysettingsa() call , modify lpdevmode parameters achieve want, need figure out how programmatically.

c++ - Compile-time pure virtual functions -

i've tried implementing list container, , decided move general functions sum() base class, can reuse them later in other containers. all base support class needs 3 methods empty() , head() , tail . can't make pure virtual because support class never instantiated. still has use methods implement own methods sum() . i tried this: #include <iostream> using namespace std; template<typename t> class statssupport { public: t sum(void) const { if (empty()) { return t(0); } else { return head() + tail()->sum; } } // other methods }; template<typename t> class list : public statssupport<t> { public: // constructors etc. bool empty(void) const {return head_ != null;} const t& head(void) const {return *head_;} const list<t>& tail(void) const {return *tail_;} // other methods private: t* head_; list<t> *tail_; }; but trying use sum() get

java - How to perferm different action depending on user input -

i'm trying make simple game (even without interface). supposed type action attack, heavy , light or block). "enemy" responds "light" action. problem? import java.util.scanner; public class game { public static void main(string[] args) { int hp = 10, enemy_hp = 10; string attack = "attack"; string block = "block"; string heavy = "heavy"; string light = "light"; scanner userinput = new scanner(system.in); while (enemy_hp > 0 && hp > 0) { system.out.println("it turn, attack (heavy or light) or try block"); int your_block_chance1 = (int)(math.random() * 4); //chance block attack int enemy_block_chance1 = (int)(math.random() * 4); string action = userinput.next(); if (action.equals(attack)) { //attack system.out.print("you attacked enemy , ");

pause in javascript doesn't work in a loop -

this sleep function: function sleep(milliseconds) { var start = new date().gettime(); (var = 0; < 1e7; i++) { if ((new date().gettime() - start) > milliseconds){ break; } } } this function actualize textarea content: luminosidad.prototype.prueba = function(num) { document.getelementbyid("pruebas").value = num; } when want in loop, can see last value. code: for (var = 1; < 8; i++) { sleep(this.opcion.velocidad); this.prueba(i); } on textarea, can see "7", last number. don't actualize correcly. why can happens? (sleep works correctly) why can happens? because never give browser chance show updates you're making, because you're keeping ui thread busy looping pointlessly. busy-waits never right answer situation. in case, you're looking either setinterval of series of settimeout s: function luminosidad() {} luminosidad.prototype.prueba = function(n

ruby on rails - keen-io Multi-Analyse with difference timeframe -

i need help. i'm using keenio , sdk ruby can run in single query multiple types of analyses different time frame? multi-analysis, in each analyse set time frame. for example: keen.multi_analysis(:users, analyses: { week: { analysis_type: 'count', timeframe: 'this_7_days' }, { month: { analysis_type: 'count', timeframe: 'this_30_days' } }) same in 1 difference tables. p.s. maybe can via javascript? thx! per keen io api documentation , "multi-analysis lets run multiple types of analyses on same data." in other words single multi-analysis query must on same collection/timeframe/filters. if want query different timeframes or collections, need execute multiple queries. as additional technical background: multi-analysis query can executed more efficiently running component parts independently, because on end events read database once , of computations performed in single pass. if component parts o

jquery - Can't access json object with javascript -

this question has answer here: access / process (nested) objects, arrays or json 15 answers accessing json data 4 answers i know noob question i'm new json... cant access object data: { "kind": "youtube#channellistresponse", "etag": "\"y3xtlff3rlthxx85jbgzzgp2enw/7zzjjc0n0xtk8orpczfx2o9vpg8\"", "pageinfo": { "totalresults": 1, "resultsperpage": 1 }, "items": [ { "kind": "youtube#channel", "etag": "\"y3xtlff3rlthxx85jbgzzgp2enw/_ucwu9q9vcvkwgxg_6vl636qcvu\"", "id": "ucswgmafwouyvwr8z30n5qlq", "snippet": { "title": "chriscodex", "description":

c# - Unable to modify variables from separate thread -

so i'm making c# app has continuously read , display contents of text file, while allowing user enter text box , append end of file. i'm doing running read method on separate thread, changing variable stores display text-files contents what's causing problem. tried having method did this, that's not working , gave 'cross-thread-operation-not-valid' error. tried applying code found on msdn, after updating variable once thread ended! please help. partial class mainform { delegate void settextcallback(string text); public static string msg; public static string name; public void initclient() { name = "public.txt"; console.writeline(name); if(!file.exists(name)) { file.create(name); file.appendalltext(name, "welcome " + name); } thread read = new thread(new threadstart(this.client)); read.start(); while(!read.isalive); }

Reading a grayscale image in java -

as read rgb image , shifting operations r, g , b matrices separately ...is possible read gray scale image(jpeg) , directly manipulate pixel values.and rewrite image ? ultimately have dct operation on gray scale image. the code below read grayscale image simple 2 dimensional array: file file = new file("path/to/file"); bufferedimage img = imageio.read(file); int width = img.getwidth(); int height = img.getheight(); int[][] imgarr = new int[width][height]; raster raster = img.getdata(); (int = 0; < width; i++) { (int j = 0; j < height; j++) { imgarr[i][j] = raster.getsample(i, j, 0); } } note: raster.getsample(...) method takes 3 arguments: x - x coordinate of pixel location, y - y coordinate of pixel location, b - band return. in case of grayscale images should/may 0 band.

function - What does the ## operator mean/do in this C macro? -

this question has answer here: how concatenate twice c preprocessor , expand macro in “arg ## _ ## macro”? 2 answers #define swap(t, x, y) \ { \ t safe ## x ## y; \ safe ## x ## y = x; \ x = y; \ y = safe ## x ## y; \ } while (0) the code swaps arguments x , y of type t. the ## (double number sign) operator concatenates 2 tokens in macro invocation (text and/or arguments) given in macro definition. read more

javascript - PHP: How can I read from a folder filenames and load this file names in a Java script array? -

i have in sub folder image files. file names before , after copy operation know new file names. this new file names (not files, names , extension) need saved in data field of mysql database. in data field file names of pictures saved, belong current record. i thinking 4 ways: 1) read file names via jquery, if possible. save data via ajax mysql. 2) read file names via php , result should sent javascript array can save data in mysql field. same option 1). 3) if possible, read file names in php , save them direct in php in field of table. 4) read in multifileuploader function file names in additional javascript array, can start ajax action fill mysql data field it. i still dont understand why php lose data if add before main operation code. strange. because easier. in upload.php after success, mysql action save upload file names (they anyway in php array) mysql database. i use file operation public code else. here code how save files: file body_editarticles

Use ASP.Net insert command to apply on an ORACLE database table -

good day! i'm trying insert entity single field in oracle database table i'm having error in stack trace: **stack trace**: [oracleexception (0x80131938): ora-12154: tns:could not resolve connect identifier specified ] system.data.oracleclient.oracleexception.check(ocierrorhandle errorhandle, int32 rc) +338968 system.data.oracleclient.oracleinternalconnection.openonlocaltransaction(string username, string password, string servername, boolean integratedsecurity, boolean unicode, boolean omitoracleconnectionname) +879 system.data.oracleclient.oracleinternalconnection..ctor(oracleconnectionstring connectionoptions) +129 system.data.oracleclient.oracleconnectionfactory.createconnection(dbconnectionoptions options, object poolgroupproviderinfo, dbconnectionpool pool, dbconnection owningobject) +40 system.data.providerbase.dbconnectionfactory.createpooledconnection(dbconnection owningconnection, dbconnectionpool pool, dbconnectionoptions options)

c# - Symbol not found on Comparer<T> -

i using .net framework 4.0 for reason visual studio highlighting method red , tool tip has: 'cannot resolve symbol 'create'' i can't see why compiler complain. static method on generic .net framework class: system.collections.generic.comparer<string>.create((x,y)=>x.compareto(y)); the method create exists on comparer class. visual studio drop down options static methods/properties shows me static property 'default' on class comparer , don't see why doesn't show static create method. here microsoft code class: public abstract class comparer<t> : icomparer, icomparer<t> { public static comparer<t> create(comparison<t> comparison) { contract.ensures(contract.result<comparer<t>>() != null); if (comparison == null) throw new argumentnullexception("comparison"); return new comparisoncomparer<t>(comparison); } ok - john s

linux - kernel timer function error -

i try modify tizen kernel. testing each line. so, find mod_timer kernel error what's problem??? code void timer_add(void){ struct timer_list timer; setup_timer(&timer, kill_callback, 0); mod_timer(&timer, jiffies + msecs_to_jiffies(3000)); } void kill_callback(unsigned long data) { sys_kill(current->pid, sigkill); return ; } [ 19.029281] unable handle kernel null pointer dereference @ virtual addre your function timer_add declares local variable timer, goes out of scope when function returns. pass argument function setup_timer, used set call function. when call function executed @ later time, references variable timer, not exist more. you either have declare variable timer static variable or use global variable.

php - How to remove the top two empty rows in the excel sheet? -

below sample codes. it's may you.. when i'm change row number(1) 5 7 rows empty in excel sheet. (location : setcellvaluebycolumnandrow($col, 1, $field);) $objphpexcel = new phpexcel(); $objphpexcel->getproperties()->settitle("export")->setdescription("none"); $objphpexcel->setactivesheetindex(0); $fields = array('ram','one','two'); $col = 0; foreach ($fields $field) { $objphpexcel->getactivesheet()->setcellvaluebycolumnandrow($col, 1, $field); $col++; } header('content-type: text/csv'); header('content-disposition: attachment;filename="export.csv"'); header('cache-control: max-age=0'); $objwriter->save('php://output'); $objphpexcel = new phpexcel(); $objphpexcel->getproperties()->settitle("export")->setdescription("none"); $objphpexcel->setac

html5 nav or menu? -

i know asked , discussed before, hybrid scenario (not @ uncommon, though). there's (fixed) toolbar above page, contains mix of navigation , actions - such as: link home-page, dropdown of pages, dropdown of categories, search box, subscribe form, rss link, contact-form launcher, facebook button, scroll-to-top arrow (javascript). better wrapper toolbar, <nav> or <menu> ?

ruby on rails - acts_as_votable using ip address -

i want allow users vote on posts without signing up, , have vote instead tied ip address. tried following this post need more clarification. error im getting posts_controller undefined method `find_or_create_by_ip' # this code far: posts_controller: def upvote @post = post.find (params[:id]) session[:voting_id] = request.remote_ip upvote = session.find_or_create_by_ip(session[:voting_id]) @post.upvote redirect_to :back end def downvote @post = post.find (params[:id]) session[:voting_id] = request.remote_ip downvote = session.find_or_create_by_ip(session[:voting_id]) @post.downvote redirect_to :back end session model: class session < activerecord::base acts_as_voter request.remote_ip end routes.rb: rails.application.routes.draw 'static_pages/home' 'static_pages/about' resources :posts member put "like" , to: "posts#upvote" put "disli

asp.net - Prevent SQL Injection when the table name and where clause are variables -

i have situation need help. @ moment, i've build asp.net app using ado.net. i'm using commandtext build dynamic query have sql injection vulnerability. commandtext this string.format("select count(*) {0} {1}", tablename, whereclause) tablename , whereclause passed in developer. see cannot use sqlparameters here because need pass entire tablename , whereclause not parameter values. my solution prevent sql injection using blacklist check tablename , whereclause find out malicious string don't know best way in situation, isn't it. , if can me find blacklist references or library. without knowing further details, there several options have in order avoid sql injections attacks or @ least minimize damage can done: whitelisting more secure blacklisting: think whether need access tables except blacklisted ones. if adds tables @ later point in time, or might forget add them backlist. maybe can restrict access specific subset of tables. ideally,

java - Why is the button.setText() shows error -

i made function called every 1 second , within function wrote mybutton.settext("stop"); now works great without code,but whenever write code,the mobile make test on shows message "app has stopped working" i've been looking solution 3 days now,help appreciated! this code check_time = new timertask() { @override public void run() { mybutton.settext("stop"); calendar lo_calender = calendar.getinstance(); int current_h = lo_calender.get(calendar.hour); int current_m = lo_calender.get(calendar.minute); if (h_towake == current_h && m_towake == current_m) { out.println("ring"); alarm(); //return; } else { ou

How to remove vertical scroll bar in ebay html description -

i testing templates ebay html , noticed mine put fixed area. caused vertical scrollbar within descrption instead of extending ebay's page. any idea how force no overflow on ebay? if float each section in template, , nothing loaded after page loads, iframe encloses template should fit correct height. you encounter errors when template loads slowly. ebay fit iframe content, if loads , few seconds later loads , makes larger, end scrollbar. can happen if have long template there seems maximum height allow. for templates though should ok if float , clear templates properly.. inspect each element see if heights showing when highlight sections, may heights overlapping. if have live example can have you...

postgresql - Rotate Polygon to be Parallel with the X Axis -

Image
by default, postgis calculates envelope or extent of polygon based on bounding box of polygon ((minx, miny), (minx, maxy), (maxx, maxy), (maxx, miny), (minx, miny)) . this gives result so: however, i'm looking result more this: as far know, best algorithm can come is: determine angle a rotate polygon x parallel x-axis rotate x a degrees, calculate envelope y of rotated polygon x rotate y -a degrees how calculate step #1 in postgis? here's implementation. doesn't handle degenerate cases , may not rectangle chose if areas tie. i'm working on submission postgis, should enough work until patch postgis. create or replace function st_minimumrectangle(g geometry) returns geometry language 'plpgsql' $$ declare hull geometry; begin hull = st_exteriorring(st_convexhull(g)); -- 1 side must lie along rectangle. -- so, each side, rotate, bbox, counter-rotate bbox sides ( select

node.js - NodeJS - Mongoose document embedding -

i trying practice mongoose , node js, want use comment schema in article schema , when run server, throws error this: invalid value schema array path comments here comment model module.exports = function( mongoose ) { var schema = mongoose.schema; var commentschema = new schema({ text: string, author: string, createdate: { type: date, default: date.now } }); console.log("********"); console.log(commentschema); console.log("********"); mongoose.model( 'comment', commentschema); }; and article model: module.exports = function(mongoose){ var schema = mongoose.schema; var comment = require("./comment"); console.log("--------"); console.log(mongoose); console.log("--------"); var articleschema = new schema({ title: string, content: string, author: string, comments: [co

jquery - Change Div Style by using JavaScript without page reloading -

i tried change background color div using javascript, changes didn't applied because when press on button browser make reload page , restore default setting without change. how can change background color div without page reload or changes applied? here's code using jquery changes background without reloading: <!doctype html> <html> <head> <meta charset="utf-8"> <title>changing div background color</title> <script src="https://code.jquery.com/jquery-2.1.4.min.js"></script> <style> #changing_background { background-color: red; min-height: 200px; } </style> </head> <body> <div id="changing_background"></div> <button id="change_background">click me</button> <script> $("#change_background").click(function(e){ $("#changing_background").css("background-color", "b

node.js - Node app management complaining about missing start script -

i have node.js app pushing bluemix. i'm trying use app management feature. but when push following warning. warning: avoid semver ranges starting '>' in engines.node warning: app management cannot installed because start script cannot found. my start script located in procfile @ project root , contains starting project ok. web: gulp serve:prod i tried putting start command in package.json still had same warning. how can app management installed? app management in ibm node.js buildpack supports applications started using node executable js file. example, node [opts] server.js [args] this because many utilities in app management dependent on being able manipulate start command. example, start application inspector enabled, need able set debug port ( --debug $port ). due limitation, app management not supported if application uses gulp or similar build automation systems start application.

html5 - CSS before and float on different elements work together -

i want :hover picture , showing :before on other element (h2) how can this? if have both elements laid out siblings, can show them using sibling selector + : img:hover + h2:before {display: block; width: 100%; height: 2px; background: #f00; content: ' ';} <img src="http://lorempixel.com/400/200/" /> <h2>image</h2> the above solution works if elements adjacent or somehow related, css cannot use parent selector (which possible in css 4 specification). can achieved using jquery: $("img").mouseover(function () { $("h2:before").css("display", "block"); });

c++ - Is this the way the dynamic programming version of maximum subarray sum algorithm works? -

at dynamic programming chapter in algorithms textbook have example of how solve maximum sub array sum problem using technique. not sure if got idea behind algorithm describe here how think works (after reading several times , doing several examples). basically, have array a of size n , , want find maximum sub array sum of array. sub array maximum sum can somewhere in right half of array, left half, or somewhere in middle. recursively call function compute maximum sub array sum left and, then, right side of array. then, compute maximum sub array sum middle of array end, compute maximum sub array sum middle beginning of array (it's length not n/2 ). then, if sum of maximum sub array sum form left plus maximum sub array sum right bigger maximum sub array sum left half (the 1 computed recursively ) , maximum sub array sum right half (also computed recursively), maximum sub array sum in 1 in middle. otherwise maximum of 1 left half , 1 right half (those computed recursively).

How can I modify the function keydown in javascript to not allow a decimal point? -

with can write numbers: validahoranumero: function(iconttabla,icontfila){ var self = this; $("#hora_"+iconttabla+"_"+icontfila+"_id").keydown(function (e) { if ($.inarray(e.keycode, [46, 8, 9, 27, 13, 110, 190]) !== -1 || $(this).val().indexof('.') != -1 || (e.keycode == 65 && ( e.ctrlkey === true || e.metakey === true ) ) || (e.keycode >= 35 && e.keycode <= 40)) { return; } if ((e.shiftkey || (e.keycode < 48 || e.keycode > 57)) && (e.keycode < 96 || e.keycode > 105)) { e.preventdefault(); } }); }, i need modify method not allow write decimal point "." how can this? thanks. just remove 190, '.' $("#field").keydown(function (e) { if ($.inarray(e.keycode, [46, 8, 9, 27, 13, 110]) !== -1 || $(this).val().indexof('.') != -1 || (e.keycode == 65 && ( e.ctrlkey === true

ruby on rails - Rails4 -> Change param name for select helper -

i have form being build product model. 1 of form elements select list has qty/price information, form being posted cart model: <%= form_for @product, url: add_cart_path, method: :post |f| %> ... <%= f.select :prices, price_list %> the price_list helper builds option list quantity option value eg: <option value="25">25 $75.00</option> on post receive param values "product"=>{"prices"=>"25"} expected. prefer receive "product"=>{"qty"=>"25"} since it's qty i'm passing , not price. there way rename parameter? thanks, leo for that, need use select_tag : select_tag "product['qty']", ...

sorting - Custom sort durations using jQuery DataTables -

i need sort column in jquery datatables. tried using moment plugin without success. the column contains call duration it's not there use n/a those. column data looks like: 2m 45s 1m 32s n/a 45s 1m i need able sort these n/a valuing less 0 , rest in logical order i use jquery datatables 1.10.6, moment 2.9.0 , have datatables plugins. use data-stype th in header of table. use no config datatable init looks that // create datatables user table = $('#summary-table').datatable({ 'language' : { "url": paths.lang_{{laravellocalization::getcurrentlocale()}} }, 'responsive': { 'details': { 'type': 'inline' } }, 'order': [[(nbcat + 5), 'desc']], 'dom': '<"row"<"col-sm-12 before-table "<"table_controls">>r><"row"

python - REPL - recover callable after redefining it -

i doing work inside python repl , redefined 1 of primitive callable's. i.e list = [] prevent tuple = list((1,2,3)) working anymore. aside restarting repl there way 'recover' or reassign list default value? maybe there import or super class? or forever lost , stuck assigned until restart repl? you can delete name del list in [9]: list = [] in [10]: list() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-10-8b11f83c3293> in <module>() ----> 1 list() typeerror: 'list' object not callable in [11]: del list in [12]: list() out[12]: [] or list = builtins.list python3: in [10]: import builtins in [11]: list = [] in [12]: list() --------------------------------------------------------------------------- typeerror traceback (most recent call last) <ipython-input-12-

asp.net - Would visual studio 2010 work in windows server 2008? -

i have alot of files in visual studio 2010. know if use windows server 2008 ? files(classes, sln)still work?. i assume you're asking if install visual studio 2010 on server 2008 box, work , still able open files/solutions? the answer yes vs2010 premium or ultimate on server 2008 sp2. also, 64-bit version (only) of vs2010 install on server 2008 r2. complete os requirements, see https://msdn.microsoft.com/en-us/library/gg265786%28v=vs.100%29.aspx

populate bootstrap dropdawn, php,mysql -

i need populate dropdown data mysql database, code maker: <br> <select name="maker" > <?php $sql="select name makers"; $query=mysql_query($sql); while($row=mysql_fetch_array($query)){ ?> <option value="<?php echo $row["name"] ?>"><?php echo $row["name"] ?></option> <?php } ?> </select> <br> and need change design , make little nicer using bootstrap dropdown, don't know how connect code bootstrap code dropdown to use bootstrap-styled selects, add form-control class <select> : <select name="maker" class="form-control" >

angularjs - Angular JS RouteProvider does not call -

i'm working on e-commerce webapp learn angular. have menu on home page (common , visible on pages), provides available products e.g. books, clothes etc. on menu have list items follows: <li><a href="#/searchproducts" ng-click="searchproduct('computers')">computers</a></li> <li><a href="#/searchproducts" ng-click="searchproduct('academics professional')">academics & professional</a></li> searchproduct function in first controller sets selected product in scope , sets location.path. $scope.searchproduct =function(producttbsearched){ $scope.tbfproduct=producttbsearched; $location.path("/searchproducts"); } i have route provider in first controller refers html , 2nd controller. $routeprovider.when("/searchproducts", { templateurl: "./views/homesearchproducts.html" , control

javascript - How to manage dependencies with browserify when not using components? -

i using gulp browserify pull js dependencies 1 file, minify file production. problem order in requiring modules not order in output. as simplified example, have script.js file goes: var $ = require('jquery'); var gsap = require('gsap'); var hi = require('hoverintent'); $('#someid').hoverintent(function(){ //do },function(){ //do } but error "hoverintent not function". i @ output file , see browserify writing hoverintent plugin before jquery dependency though require jquery first. is normal behavior"? if best practice dependency management sort of case? limited experience browserify in past has been reactjs, , in case required dependencies each component worked fine. best practice site / app not use components? your problem relying on side effect of hoverintent plugin adding it's function jquery. why jquery plugins/extensions smell let's ignore that. you should have 1 module r

android - How to execute ADB commands within an app -

i've got partially rooted android device. partial root, mean can run root commands through adb. i've figured out how run these commands locally within terminal emulator on device itself. question is, how go writing code android application executes adb command (or multiple commands) button press? can't find explains how run direct adb commands through app interface. clarify, involves "su" not work on device. only accepts adb input root access. not sure if works on android, have tried this: runtime rt = runtime.getruntime(); process pr = rt.exec("adb root"); if provide more info need use adb in manner, there may better workaround. unlikely need behavior in app, , believe frowned upon. sounds want app have root, seems unportable , unnecessary approach.

c# - HierarchyId: mapping in native entity framework code first -

i'm trying define schema using code-first fluent configuration, , i'm running problem while configuring column type hierarquyid. i´m try define microsoft.sqlserver.types.sqlhierarchyid. not success. suggestions? how use hierarquyid natively in entity framework code first ? sorry, english not good

sitecore8 - Correct Place To Specify A Site's Caching Parameters In Sitecore? -

an "out-of-the-box" installation of sitecore creates following lines in web.config file: <sites> <site name="shell" virtualfolder="/sitecore/shell" physicalfolder="/sitecore/shell" rootpath="/sitecore/content" startitem="/home" language="en" database="core" domain="sitecore" loginpage="/sitecore/login" content="master" contentstartitem="/home" enableworkflow="true" enableanalytics="false" analyticsdefinitions="content" xmlcontrolpage="/sitecore/shell/default.aspx" browsertitle="sitecore" htmlcachesize="10mb" registrycachesize="15mb" viewstatecachesize="1mb" xslcachesize="25mb" disablebrowsercaching="true" /> <site name="login" virtualfolder="/sitecore/login" physicalfolder="/sitecore/login" enableanalytics="fal

javascript - AngularJS ng-repeat certain filter expressions -

here's have: <div data-ng-if="hasselectedcompany"> <tbody data-ng-repeat="driver in result.applications | filter: { name: selectedapplication } track $index"> </div> <div data-ng-if="hasselectedsupportedcompany"> <tbody data-ng-repeat="driver in result.applications | filter: { name: selectedsupportedapplication } track $index"> </div> and know can improved, i'm not sure how. it's not working right now. first expression not working when have both of these in there. when remove second expression completely, first 1 starts work. second 1 works both of them in. what's alternative way accomplish this? thanks! both filters not work because both referring same result.applications . you need separate filtered array of both assigning different variable applicationsforcompany hasselectedcompany div & applicationsforsupportedcompany hasselectedsupportedcompany div

html - Handsontable fixed column and row option shifting other rows and columns out of position -

i working on project handsontable , whenever enable fixed row , fixed column options rest of grid not aligned properly. problem occurs in visual studio have static html document works fine on. have looked conflicting css formatting in visual studio have not found anything. not it's not there must have missed if is. i have tried changing number of rows , columns fixed , have tried changing size of cells no avail. upon further inspection noticed grid cells shifted under fixed rows. know how go fixing problem or experienced problem before , solved it? (i have tried add image new stack exchange , not have reputation yet. have described enough.) edit : have discovered fixedrowstop option messing formatting if narrows search @ all. i figured out problem after leaving alone week. still think conflicting css styling, still did not find specific conflictions. team decided wanted different basis layout of page. added line .cshtml document layout = null erase automat

actionscript - Getting the source code of a function? -

is there anyway can code inside function in actionscript (preferably as1)? for example, let's have function: function foo(){ trace("bar"); } is there anyway can text 'trace("bar");' function without modifying actual function? like (psuedo code): trace(foo.source); would trace text 'trace("bar");'

java - GridBagLayout aligning labels -

i have been messing around gridbaglayout , having little bit of trouble. first trying labels start in upper left accomplished with: jpanel right = new jpanel(new gridbaglayout()); right.setpreferredsize(new dimension(333,600)); gridbagconstraints gbc = new gridbagconstraints(); gbc.anchor = gridbagconstraints.northwest; jlabel testlabel = new jlabel(); testlabel.settext("test"); gbc.gridx = 0; gbc.gridy = 0; gbc.weighty = 1; gbc.weightx = 1; right.add(testlabel, gbc); now want add label directly under one: jlabel test2label = new jlabel(); test2label.settext("test2"); gbc.gridx = 0; gbc.gridy = 1; gbc.weighty = 1; gbc.weightx = 1; right.add(test2label, gbc); instead of putting directly under first 1 places halfway down panel. because of weighty , weightx think, if change these not place labels in upper left. how can make work? sorry if unclear english not best language let m

windows - Looping a batch file that calls another batch file -

my embedded c compiler generates batch file run various build outputs in processor simulator command line. i'd create batch file call auto generated batch file somewhere convenient, , i'd able rerun clicking key want day long. here's i've tried cd "c:\foo\project name\settings\" :repeat cls "project name.unit test ouput.cspy.bat" & pause goto repeat i see output expect batch file, followed a: press key continue . . . when press enter script ends , never executes goto. if remove pause statement script ends immediately. if type & goto repeat script still ends immediately. cding batch file command line, running it, , click arrow , enter want... trying automate tiny bit more. to run batch file batch file, have use call statement. if don't, outer batch file end when inner 1 does. call "project name.unit test ouput.cspy.bat" & pause

Equivalent PROCV in PHP -

i have table: class | name | --------+-------+ mage | merlim| warrior | gatz | rogue | zoro | how can name of given class? it's procv function of excel. in php code: //$table result returned call db shown above $classes_required = array("mage","warrior","rogue"); foreach($classes_required $class){ $$class = procv_equivalent($table, $class); } result of var_export($table); array ( 0 => array ( 0 => 'class', 1 => 'name'), 1 => array ( 0 => 'mage', 1 => 'merlim'), 2 => array ( 0 => 'warrior', 1 => 'gatz'), 3 => array ( 0 => 'rogue', 1 => 'zoro'), ) you can build associative array maps class name: $classname = array(); ($i = 1; $i < count($table); $i++) { $row = $table[$i]; $classname[$row[0]] = $row[1]; } foreach ($classes_required $class) { $name = $classname[$class]; }

Defining the name of a text/html file like the name of a data.frame in R -

i have data.frame cli_cap_x_prod_ag: familia_prd num_cli capital_sol part_cap_per atrasada atr_per 536 2616925 33.62 467830 17.88 b 151 1613035 20.72 268223 16.63 when try save file using name of data.frame error: print(temp,type = "html", include.rownames = false, file = paste(cli_cap_x_prod_ag,"_tab.html", sep="")) because r read elements of cli_cap_x_prod_ag. any appreciated! you should store xtables in named list , iterate on list. demo: library('xtable'); li <- list(t1=xtable(data.frame(a=letters[1:3],b=1:3)),t2=xtable(data.frame(a=letters[4:6],b=4:6))); names(li); ## [1] "t1" "t2" li; ## $t1 ## % latex table generated in r 3.1.3 xtable 1.7-4 package ## % fri jun 19 13:48:30 2015 ## \begin{table}[ht] ## \centering ## \begin{tabular}{rlr} ## \hline ## & & b \\ ## \hline ## 1 & & 1 \\ ## 2 & b