Posts

Showing posts from February, 2013

android - ChildFragmentManager + ViewPager + Animation = not good -

Image
my app build on many fagments , change fragments horizontal slide animation. fragments contain viewpager fragmentstatepageradapter. in process of restoring fragments backstack see black page of adapter. looks childfragmentmanager in fragmentstatepageradapter destroed soon. how fix that? it 's simple done setoffscreenpagelimit(numberoffragment want retain).

python - Pandas groupby: compute (relative) sizes and save in original dataframe -

Image
my database structure such have units, belong several groups , have different variables (i focus on one, x, question). have year-based records. database looks like unitid, groupid, year, x 0 1 1, 1990, 5 1 2 1, 1990, 2 2 2 1, 1991, 3 3 3 2, 1990, 10 etc. measure "intensity" variable, going number of units per group , year, , put database. so far, doing asd = df.drop_duplicates(cols=['unitid', 'year']) groups = asd.groupby(['year', 'groupid']) intensity = groups.size() and intensity looks like year groupid 1961 2000 4 2030 3 2040 1 2221 1 2300 2 however, don't know how put them old dataframe. can access them through intensity[0] , intensity.loc() gives locindexer not callable error. secondly, nice if scale intensity. instead of "units per group-year", "units per group-year, scaled average/max units

javascript - include socket.io server into my html -

i have run nodeserver , client sucessfully. want connect server proxy. here node client: <html> <head> <script src="http://localhost:8000/socket.io/socket.io.js"></script> <script src="http://code.jquery.com/jquery-1.6.2.min.js"></script> <script> var name = ''; var socket = io.connect('http://localhost:8000'); // @ document read (runs ones). $(document).ready(function(){ // on click of button (jquery thing) // things inside clause happen when // button clicked. $("button").click(function(){ // simple logging $("p#log").html('sent message: ' + $("input#msg").val()); // send message on inputbox server socket.emit('chat', $("input#msg").val() ); // server recieve message, // maybe processing, // broadcast again

ios - Read and Write the MetaData contents as a File in Documents Directory -

nsarray *paths = nssearchpathfordirectoriesindomains(nsdocumentdirectory, nsuserdomainmask, yes); nsstring *documentsdirectory = [paths objectatindex:0]; nsstring* arraytext = [metadataarray componentsjoinedbystring: @"\n"]; nsstring *path = [documentsdirectory stringbyappendingpathcomponent:@"employeedata.txt"]; [arraytext writetofile:path atomically:yes]; metadata array first object : {filesize:"9385033" labels:{viewed,starred,restricted,trashed,hidden} originalfilename:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" mimetype:"audio/mpeg" title:"chamak challo - ra.one (2011) [mp3-320kbps-cbr].mp3" parents:[1] md5checksum:"51d598c750102dd4bca09addf4d8212d" quotabytesused:"9385033" lastmodifyingusername:"shadow.hibrise" copyable?:1 headrevisionid?:"0b7v4x9xjauwjr3dzm1fqwlpheefozgyyyzr2nudtlzhmb2fnpq" kind:"drive#file" writerscanshar

How to run Multiple Process in C# -

seniors, beginner , new in c# after php. my question how execute multiple function same time in c# e.g class void main() { call functiona(argument) call functionb(argument) call functionc(argument) // these function should start @ same time } my first function public void functiona(argument) { richtextbox1.appendtext(starttime); } my second function public void functionb(argument) { richtextbox1.appendtext(starttime); } my third function public void functionc(argument) { richtextbox1.appendtext(starttime); } your / guideline save time. the easiest option use task class. msdn nails it, copying (with minor edits) relevant bit here action action1 = () => { // code here }; action action2 = () => { // code here }; task t1 = new task(action1); task t2 = new task(action2); t1.start(); t2.start();

javascript - Is it possible to get all elements which have a specific value into any type of attribute? -

i want elements in html dom, have attribute specific value. for example - <ul style="width:150px;" id="radiobutton1"> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 1</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 2</label></li> <li style="width:150px;"><input type="radio" name="radiobutton1"><label>option 3</label> </li> </ul> i want elements contains "radiobutton1" in attribute. means want select ul , 3 radiobuttons . note: above html used ul-li structure, real scenario it's different. please don't give answer in favor of ul-li . want global solution. there selector exist select type of attribute? is possible select elements in approach? bunch of i

android - MultiAutoCompleteTextView custom adapter with custom object instead of String Object -

this code working fine want when pass arraylist<string> adapter. when add object adapter, in multiautocompletetextview set object full name instead of object full name. want first_name jgetdata object. public class myautocomplete extends multiautocompletetextview implements onitemclicklistener { private final string tag = "chipsmultiautocompletetextview"; private handler mhandler = new handler() { public void handlemessage(message paramanonymousmessage) { if (paramanonymousmessage.what == 0) { mhandler.removemessages(0); string str = gettext().tostring().trim(); log.e("handler", "yes"); if (str.length() >= 2) { if(gettext().tostring().contains(",")) // check comman in string { string chips[] = gettext().tostring().trim().split(",");

arrays - Adding Values of Field in C? -

i want ask how can add values of array in c. example: array[5] -------- array[1]=0.2 array[2]=0.2 ----> want add first 0.2 second 0.2 (=0.4) array[3]=0.3 array[4]=0.15 i want following output: 0.2 0.4 0.7 0.85 how can that? special operators? ps: want in simple loop. not libaries etc. much fail. many error. tag question [c] or [c++] , not both. not same thing. if declare array[5] , valid indicies 0 through 4 . array[5] out of bounds . you describe wanting output, program has no output! show printf , or cout , or similar output statement. if want add value array member, simple: array[2] = array[2] + 0.2; if want add 2 array members together: array[2] = array[1] + array[2]; although did not specify clearly, looks want make each member of array sum of earlier members (including itself). here's code: int main(void) { double array[] = { 0.2, 0.2, 0.3, 0.15

Plot 3D Shape in Maple -

i'm trying plot 3d shape in maple using following 4 points: [3, -5,-4], [4, -1, 3], [-4,-5, 4], [2, -5, 4] have no idea code use or begin. appreciated thank you not entirely sure want, here how draw tetrahedron: with(plots); # display with(plottools); # polygon v := [[3, -5,-4], [4, -1, 3], [-4,-5, 4], [2, -5, 4]]; combos:= combinat:-choose(v,3); display(map(polygon,combos));

linux - Grep specific part of text -

i have text this: ora.sas.aa.svc 1 online online sas1 ora.sas.bb.svc 1 online online sas2 ora.sas.cc.svc 1 online online sas2 ora.sas.dd.svc 1 online online sas1 ora.sas.ee.svc 1 online online sas1 2 online online sas2 what want grep specific part of .svc , online status like: example.txt |grep aa ora.sas.aa.svc 1 online online sas1 or example.txt |grep ee ora.sas.ee.svc 1 online online sas1 2 online online sas2 row number of "online" may change, can't grep grep -a2 or grep -a3 . you can use awk instead:

java - Unable to Parse Time String to specified format -

i need compare 2 time string have entered.. able date time unable it. please find below code tried : my issue is.. -- able time format according format enter in string unable parse it. because if parse able compare , find out whether varible time field difference. please find below code have done : try{ dateformat df = new simpledateformat(format); //assume format entered hh:mm:ss df.setlenient(false); t1 = new date(); //here current time temp_time = df.format(t1); // change format have requested (example format – hh:mm:ss. temp_time = 18:20:45). t1 = df.parse(temp_time); // when try parse thu jan 01 13:24:40 ist 1970. able parse date, time format it’s not working. in order see how parse-result looks (an object of type java.util.date ) have format again: dateformat df = new simpledateformat("hh:mm:ss"); date time = df.parse("18:20:45"); // visualizing result system.out.println(df

html - Japanese unicode character is reversing CSS float left -

please check out following js fiddle in ie (i'm using 10) http://jsfiddle.net/bf65u/1/ .inlinecol2 { width: 50%; } .option { float: left; } <div id="div_a799f1fc-ccbb-4c85-b367-a20300fe5a64" class="div_ " > <div class="errormsg"></div> <div class="surveyelementcontent" title=""> why 'ç®±' japanese character mess floats? </div> <div class="surveyelementoptions"> <div class="surveyelementoption option inlinecol2 "> <input type="radio" value="1" /> <label>1</label> </div> <div class="surveyelementoption option inlinecol2"> <input type="radio" value="2" /> <label>2</label> </div> <div class="surveyelementoption option

regex - remove number and special character using owa_pattern -

using owa_pattern.change in oracle 9i. is possible remove number , trailing special character (pls note trailing) special character in string? i refer special character characters neither word nor number. e.g _ , # , @ ,$ etc ... for example. string = test_string_10 desired output test_string (notice trailing special character _ removed). i have figured out how remove number stuck in special character part. i have code far. owa_pattern.change (string, '\d', '', 'g'); appreciate inputs. thanks! try following. owa_pattern.change (string, '[^a-za-z]+$', ''); regular expression [^a-za-z]+ character except: 'a' 'z', 'a' 'z' (1 or more times (matching amount possible)) $ before optional \n, , end of string

rails 4 scopes with NOT equal and associations -

i have instance variable in controller i'm trying convert scope model. instance variable: products @products_with_user_differences = product.where{|p| p.last_user != p.user.username && p.asset_type.name == "computer" unless p.user.nil? or p.allow_multi_users == true} explanation: this shows products have last_user value different user.username type of "computer" . excludes product user_id: nil or have allow_multi_users attribute set true . i've tried following 0 luck: products.rb scope :with_user_differences, -> { where(last_user != user.username && asset_type.name == "computer" unless user.nil? or allow_multi_users == true)} it doesn't seem recognize associations or allow "!=" in scope. any ideas or pointers? the following code return products associated user , asset_type product.joins(:user, :asset_type) to exclude products allow_multi_users set true product.where(allow_mu

eprocessing network ios sdk integration -

as of requirement, need integrate eprocessing network payment gateway application credit card payment transactions. didn't find sdk or sample codes implement. integrated eprocessing network, please me here. thanks in advance!!! eprocessing network allows developers use existing mobile framework (including integrated, encrypted audio jack card reader) implement own payment application. provide developers business logic, , presentation layer left imagination. here documentation mobile sdk (pdf format): ios :- http://www.eprocessingnetwork.com/docs/sdk/ios_sdk_developers_guide_v2.1.pdf android :- http://www.eprocessingnetwork.com/docs/sdk/android_sdk_developers_guide_v2.1.pdf some code reference :- icharge.gateway = ichargegateways.gweprocessing; //this eprocessingnetwork account number. //for testing may use value 05971 icharge.merchantlogin = "05971"; //merchantpassword not used icharge.merchantpassword = ""; icharge.card.cvvdata = &qu

c# - Visual Studio 2013 Update 2 RC isn't installing ( Error: Update 2 RC does not apply, or is blocked by another condition on your computer.) -

this error image , next image shows have vs2013 installed update 1 visual studio 2013 update 2 rc error: http://1.bp.blogspot.com/-tlighioohhg/u1dwwhmg7qi/aaaaaaaaaek/ca_vculggd0/s1600/error.png proof of visual studio 2013 update 1: http://2.bp.blogspot.com/-gs3zpkss8k8/u1dwxhhmg7i/aaaaaaaaaes/8hp-7ftabnw/s1600/visual+studio+update+1.png i had same problem when installing update 2 visual studio express 2013 web . the reason in case because before installation doing housekeeping , deleted content of folder c:\users\all users\package cache\ when restored back, there no error message , installation successful. that means, might have missing bundles , installer not happy that. in case had backup if haven't had need reinstall visual studio express 2013 web , in place , installation of update should hassle free. more less same mentioned in article link above. keval.

Visual Studio 2012 Installation Issues -

i finished installing visual studio 2012 .iso image , when finished installing got these 2 errors: microsoft web deploy 3.0 a required certificate not within validity period when verifying against current system clock or timestamp in signed file. microsoft visual studio 2010 tools office runtime (x64) package failed should worried? made sure uninstalled 2010 before installed 2012 , did registry cleanup not sure if helped or made worse. i don't think !! way , can solve issues updates microsoft , these links might : http://support.microsoft.com/kb/2872457 http://msdn.microsoft.com/en-us/library/ms178739.aspx

javascript - Validate the string which needs to match particular condition(Regular Expression)? -

i want validate string, should not contain special characters except underscore(_). have written below code not able through. var string = 'pro$12'; var result = /[a-za-z0-9_]*/.test(string); in above given string not valid got result true. can body tell doing wrong here? it returns true because, able match pro . can see actual matched string, match function, this. console.log(string.match(/[a-za-z0-9_]*/)); # [ 'pro', index: 0, input: 'pro$12' ] even when doesn't match anything, example, input '$12', return true . because, * matches 0 or more characters. so, matches 0 characters before $ in $12 . (thanks @jack pointing out ) so, need is console.log(/^[a-za-z0-9_]*$/.test(string)); # false ^ means beginning of string , $ means ending of string. telling regex engine that, match string has characters character class, beginning , ending of string. note: instead of using explicit character class, [a-za-z0-9_] , can u

javascript - Making a smooth, dynamic website -

Image
i seeking create website smooth layout, dynamic , not blam, heres website. let me elaborate: got setup now, can figure trying working. what mean dynamic is, want when page have been loaded image come sliding in (maybe banner too, haven't decided design yet, throwing suggestions.). when image have slided in expanding , despanding slowly, it's in movement. when hovered on should expand more , stop it's movements while hovered. this main needs searching for, , little clueless on how done. thinking javascript obvious, i've failed guides i've found , therefore belive need direct help. highly appreciated, thanks! i've tried making image fade in , out jquery, doesn't seem work, heres code: <!doctype html> <html class="no-js"> <head> <meta charset="utf-8"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <title></title> <meta

javascript - Change Datatables jquery Header & Footer Width -

i building database table using following code: <script> var j$ = jquery.noconflict(); j$(document).ready(function() { j$('.reporstdt').datatable( { 'bjqueryui': true, 'bfilter': false, "blengthchange": false }); } ); </script> and calling above script using tag & adding class="reporstdt" html5 table. problem width of generated table doesn't match html table, result of following result: http://www.imagebam.com/image/0e8fdb322413745 can configure datatables header width , footer width without change css styling? you can set column widths in creation of datatable, indexed left right. should override setting in css header , footer , pull them line column width set here: j$('.reporstdt').datatable( {"bautowidth": false , aocolumns : [ { "swidth": &qu

javascript - Unit testing ext js with Jasmine 2.0 and PhantomJS -

i'm trying setup unit testing ext js application. i'm using jasmine 2.0 , phantomjs run tests console. can init store in init method of controller. but, if try declare in stores config, i'm getting following error : typeerror: 'null' not constructor (evaluating 'new c()') (line 1) (1) , cause error, , how can resolved? thank in advance. my code below: testapplication.js ext.loader.setconfig({ enabled: true }); ext.ns('myapp'); // loading different components controller, model, view.. ext.application({ name: 'myapp', appfolder: '../app', controllers: [], autocreateviewport: false, init : function() { myapp.app = this; }, // launch jasmine test environment launch: function () { var jasmineenv = jasmine.getenv(); jasmineenv.updateinterval = 1000; var htmlreporter = new jasmine.htmlreporter(); jasmineenv.addreporter(htmlreporter); jasmine

python - Understanding factorial recursion -

i'm looking on factorial example of recursion , make sure i'm understanding correctly! def factorial(n): if(n == 0): return 1 else: return n * factorial(n-1) would right in saying: factorial(4) = factorial(4-1) * 4 = factorial(3-1) *3 *4 = factorial(2-1) *2 *3 *4 = factorial(1-1) *1 *2 *3 *4 = 24 because factorial(1-1) = factorial(0) base case shows = 1 , multiply 2, 3 4. is correct way of looking @ it? thanks in advance! yes is. since it's recursion, works opposite way. once had interviewer explain me : say, fact(5) : - fact(5) = 5 * fact(4) - fact(4) = 4 * fact(3) - fact(3) = 3 * fact(2) - fact(2) = 2 * fact(1) - fact(1) = 1 * fact(0) - fact(0) = 1 // condition returns 1. now, imagine - sign above stands retu

regex - Regular Expression replacing keyword that occurred multiple times -

i tried match "text" word can replace , highlight "text" word, using.. strtext = "this triple text text texting word" keyword = " text " regex.replace(strtext, keyword, m=> string.format(" <span class='keywordhighlight'>{0}</span> "); the result : triple text text texting word but first word highlighted, need space @ begin , end of "text" keyword avoid matching "texting", anyone have idea how solve it? use word boundaries: regex.replace(@"\b"+strtext+"\b" ...); \b word boundary in regex. match text , not texting

javascript - Using Validation on Jquery pop up login menu -

i have jquery pop menu using bootstrap . has validation issues when password field empty or password wrong ,i tried couple of ways . works when type in password or username field , still stays there here codes <div class="container"> <h4>demo page</h4> <!-- twitter content --> <div id="form-content" class="modal hide fade in"> <a class="close" data-dismiss="modal">×</a> <div> <form class="contact" action=""> <div class="modal-body"> <ul class="nav nav-list"> <li class="nav-header">username</li> <li> <input class="input-xlarge" type="text" id="txtusername" name="username"> </li&

How to get a list of tables with composite primary key in SQL Server? -

how create query gives me list of tables composite primary key in sql server? maybe using sys.tables or information_schema.tables or else? you can dig info in information_schema.table_constraints , information_schema.constraint_column_usage , checking multiple rows of primary key constraints on table, like; select col.table_name information_schema.table_constraints tc join information_schema.constraint_column_usage col on col.constraint_name = tc.constraint_name , col.table_name = tc.table_name , tc.constraint_type = 'primary key ' group col.table_name having count(*) > 1 an sqlfiddle test with .

java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/tun_recrut -

i'm new in java , i'm trying make simple authentication interface. i trying execute simple query using drivermanager . can please me understand issue here ? 1/ mydbconnection.java package com.esprit.tunrecrut.util; import java.sql.connection; import java.sql.drivermanager; import java.sql.sqlexception; import java.util.logging.level; import java.util.logging.logger; public class mydbconnection { /** * déclaration des variables pour la connexion */ private string url = "jdbc:mysql://localhost:3306/tun_recrut"; private string login = "root"; private string pwd = ""; private static mydbconnection instance; public static connection connection; private mydbconnection() { try { connection = drivermanager.getconnection(url,login,pwd); } catch (sqlexcep

javascript - CAPH API widgets in Samsung TV SDK -

i have made simple caph project consists of page has 3x3 containing images. want able when focus on image. far have read documentation unable understand. what want reduce opacity of image when focused. this code needs edited: page1_page.prototype.image_3fzrc_onfocus = function() { //should reduce image opacity don't know how reference image } thank you. ps: used visual editor edit: did nothing happens. page1_page.prototype.image_3fzrc_onfocus = function() { imgspring= caph.wui.widget._component.getwidgetbyid("image_3fzrc"); imgspring.setopacity(0.5); };

c++ - Why does not see the array in the same class? -

i want write polynomial class,each polynomial consist of multi poly have implemented array, code: class polynomial { private: int count; public: polynomial() { count = 0; term terms[10]; } void create(int c) { terms[count].coef = c; } }; class term { public: double coef; int expo; }; i have problem in create method,it not know terms array , not access term object properties. why happen? // first declare class referenced class term { public: double coef; int expo; }; class polynomial { private: int count; // terms should class member not local of constructor term terms[10]; public: polynomial() { count = 0; // if declare terms array here // destroy after returns constructor // term terms[10]; } void create(int c) { terms[count].coef = c; } }; if polynomial declaration before term declaration requirement forward declaration can

Ruby SSL with Twitter failed on cert OpenSSL issue on Windows 7 -

i've searched high , low answer this. many people have own answers. none of them have worked me. i'll provide situation. so want access twitter , upon using net:http's post function error. ssl_connect returned=1 errno=0 state=sslv3 read server certificate b: certificate verify failed yes know get's message. here viable solutions found. first; manually set cert file: #! /usr/bin/env ruby require 'net/https' require 'uri' uri = uri.parse(argv[0] || 'https://localhost/') http = net::http.new(uri.host, uri.port) if uri.scheme == "https" http.use_ssl = true http.verify_mode = openssl::ssl::verify_peer http.ca_file = file.join(file.dirname(__file__), "cacert.pem") end http.start { http.request_get(uri.path) {|res| print res.body } } this provided ariejan de vroom @ link http://blog.kabisa.nl/2009/12/04/ruby-and-ssl-certificate-validation/ many people have given similar answer this. did not work

arrays - Grouping a php object -

i've php object outputs : array ( [0] => stdclass object ( [id] => 25 [itemid] => 13 [studentid] => 9 [score] => 22 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst9 [lastname] => studentlast9 ) [1] => stdclass object ( [id] => 26 [itemid] => 13 [studentid] => 10 [score] => 23 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst10 [lastname] => studentlast10 ) [2] => stdclass object ( [id] => 1 [itemid] => 1 [studentid] => 1 [score] => 2 [imagealt] => [timemodified] => 0 [data] => [firstname] => studentfirst1 [lastname] => studentlast1 ) [3] => stdclass object (

Unix checking current pathname a directory -

i using korn shell , trying write scrip tell if current pathname directory, , if going run more commands. have tried doing if statement have been told better suited using while statement. have no luck. so... trying like: if [[ -d 'path' ]]; <commands> fi didn't work? maybe post example code.

css - Using Bootstrap Dropdown on a centered image -

i trying use bootstrap dropdown on centered image, can't dropdown centered well. fiddle current code <div class="row"> <div class="col-md-12 profile-picture text-center"> <div class="dropdown col-md-3"> <img src="http://i.imgur.com/9qfjgrz.jpg" alt="" class="profile-photo img-thumbnail" data-toggle="dropdown" /> <ul class="dropdown-menu" role="menu" aria-labelledby="change settings"> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">upload new picture</a></li> <li role="presentation"><a role="menuitem" tabindex="-1" href="#">remove</a></li> </ul> </div> </div> </div> as can see dropdown ge

javascript - how to stop pop up to appear when the page loads for the second time? -

html page: <!doctype html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <title>simple jquery modal window queness</title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script> <script type="text/javascript"> $(document).ready(function() { var id = '#dialog'; //get screen height , width var maskheight = $(document).height(); var maskwidth = $(window).width(); //set heigth , width mask fill whole screen $('#mask').css({'width':maskwidth,'height':maskheight}); //transition effect $('#mask').fadein(1000); $('#mask').fadeto("slow",0.8); //get window height , width var winh = $(window).height(); var winw = $(window).width(

java - Emoji Detection while filling apn Payload -

i trying send push notification payload ios, payload has limited size 256 byte when push notification message has emoji or different text can not detect actual message size result payload size excedd 256 byte, how can detect actual size of message using java ? thanks as far know, emoji 4 bytes in size. (feel free correct me if i'm wrong) so long can detect how many emoji there in message can account them each being 4 bytes in size. as how detect how many emoji there are, depends on data receive parse. technically unicode characters should able see , identify them in raw output, provided output can acknowledge unicode 6.0 characters.

node.js - How do I check Content-Type using ExpressJS? -

i have pretty basic restful api far, , express app configured so: app.configure(function () { app.use(express.static(__dirname + '/public')); app.use(express.logger('dev')); app.use(express.bodyparser()); }); app.post('/api/vehicles', vehicles.addvehicle); how/where can add middleware stops request reaching app.post , app.get if content type not application/json ? the middleware should stop request improper content-type url begins /api/ . this mounts middleware @ /api/ (as prefix) , checks content type: app.use('/api/', function(req, res, next) { var contype = req.headers['content-type']; if (!contype || contype.indexof('application/json') !== 0) return res.send(400); next(); });

c# - Using CDN in ASP.NET MVC bundles -

i read article bundling , monification , specially using cdn, there things unclear me. having example : public static void registerbundles(bundlecollection bundles) { //bundles.add(new scriptbundle("~/bundles/jquery").include( // "~/scripts/jquery-{version}.js")); bundles.usecdn = true; //enable cdn support //add link jquery on cdn var jquerycdnpath = "http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.1.min.js"; bundles.add(new scriptbundle("~/bundles/jquery", jquerycdnpath).include( "~/scripts/jquery-{version}.js")); // code removed clarity. } is there possibility use {version} format of cdn references, "local" ones? what point of including in bundles minified version of script, jquery-1.7.1.min.js ? if not exist? should not search if .min file exist and/or generate respectively? using system.web; using system.web.opti

css - How to make Sass mixin more robust -

description i have following mixin: @mixin insideborder ($thickness:2px, $color:black, $alpha:.05) { box-shadow:inset 0 0 0 $thickness rgba($color, $alpha); } a. 1 way use this: @include insideborder(); which output: box-shadow: inset 0 0 0 2px rgba(0, 0, 0, 0.05); b. can use this: @include insideborder(5px, red); which output: box-shadow: inset 0 0 0 2px rgba(255, 0, 0, 0.05); problems however, if want change color, 1 of these 2 ways: @include insideborder(#369); @include insideborder(red); but compile to: box-shadow: inset 0 0 0 #336699 rgba(0, 0, 0, 0.05); box-shadow: inset 0 0 0 red rgba(0, 0, 0, 0.05); or if this: @include insideborder(red, .5); it shoots error: syntax error: $color: 0.5 not color 'rgba'... question how can improve mixin can take amount of arguments depending on type of argument mixin "knows" belongs? use sass script made & improved @eric m suzanne demo $insideborder

Mass PHP variables form sanitation -

i want able sanitize of form elements in 1 statement. problem being, i'm not sure how possible. these php variables want sanitized. php variables $datemonth = $_post["datemonth"]; $dateday = $_post["dateday"]; $game = $_post["bbsb"]; $gametype = $_post["type"]; $visitorteamname = $_post["visitorteamname"]; $visitorinning1 = $_post["visitorinning1"]; $visitorinning2 = $_post["visitorinning2"]; $visitorinning3 = $_post["visitorinning3"]; $visitorinning4 = $_post["visitorinning4"]; $visitorinning5 = $_post["visitorinning5"]; $visitorinning6 = $_post["visitorinning6"]; $visitorinning7 = $_post["visitorinning7"]; $visitorinning8 = $_post["visitorinning8"]; $visitorinning9 = $_post["visitorinning9"]; $visitorinning10 = $_post["visitorinning10"]; $visitorinning11 = $_post["visitorinning11"]; $visitorinning12 = $_post["

javascript - average function not returning correct output after editing values -

i new angularjs, , have slight problem. have list of cities compute average temperature, , reason, after editing temperature values in list of cities, function compute average temperature returning incorrect values. returns correct value after loading page, after editing temperature values incorrect results. here code: <html ng-app> <head> <title>weather comparison</title> </head> <body ng-controller='weathercontroller'> <h1>weather comparison</h1> <div ng-repeat='item in items'> <span>{{item.city}}</span> <input ng-model='item.temp'> <input ng-model='item.humidity'> <input ng-model='item.wind'> <input ng-model='item.cloudiness'> </div> <div>the average temperature {{avgtemp}}</div> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.8/angular.min.js"></script> <

Gradle - how to specify different Android *.apk build location for each flavor? -

is there way specify android *.apk files build location other ../build/apk/ ? possible specify different location each flavour? i using android studio. thats work me: android.applicationvariants.all { variant -> def outputname = // filename variant.outputfile = file(path_to_filename) } but "clean" task not drop apk, should extend clean task below: task cleanextra(type: delete) { delete outputpathname } clean.dependson(cleanextra) full sample: apply plugin: 'android' def outputpathname = "d:\\some.apk" android { compilesdkversion 19 buildtoolsversion "19.0.3" defaultconfig { minsdkversion 8 targetsdkversion 19 versioncode 1 versionname "1.0" } buildtypes { release { runproguard false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } applicationv