Posts

Showing posts from August, 2013

apache2 forward proxy to restrict specific external ips to specific client ip's? -

suppose want following clients access specific internet servers behind apache2 forward proxy: client-1-ip: www.google.com client-2-ip: www.gmail.com client-3-ip: www.cnn.com client-4-ip: www.chess.com is possible? running apache 2.4.10 on debian 8. currently, allowing specific clients access entire internet via configuration values, want able specify specific client can access specific internet server: <virtualhost *:8080> proxyrequests on proxyvia on <proxy "*"> order deny,allow deny allow <ip-1> allow <ip-2> allow <ip-3> </proxy> serveradmin webmaster@localhost documentroot /var/www/html errorlog ${apache_log_dir}/error.log customlog ${apache_log_dir}/access.log combined </virtualhost> thanks.

java - Find a Number of ways to Generate a Number -

i have given fibonacci digits only , have find out numbers of ways generate number using k fibonacci numbers only. constraints: 1<=k<=10 1<=n<=10^9 for example: n=14 , k=3 there 2 ways: (8,5,1) , (8,3,3) here recursive solution: public static void num_gen(int ,long val ,int used){ if(used==0){ if(val==n) ans++; return ; } if(i==fib.length) return ; for(int j=0;j<=used;j++){ long x = j*fib[i]; if(x+val<=n){ num_gen(i+1,x+val, used-j); } } } this solution timeout large value of n , k=10. can provide me algorithm better complexity. this can expressed multiplying polynomials exponents fibonacci numbers. number of factors k. the result coefficient of member of result polynomial exponent equals n. example: number of ways compose number 7 3 numbers each of these 3 numbers can 1,2 or 3. (x + x² + x³)³ = x⁹ + 3x⁸ +6x⁷ + 7x⁶ + 6x⁵ + 3x

postgresql - How do you query a table with a schema in Sequelize.js? -

i have table called 'wallets' in 'dbo' schema of postgresql database. when try query error: executing (default): select "wallets_id", "confirmed_balance", "unconfirmed_balance", "created_at", "updated_at" "dbo.wallets" "dbo.wallets"; unhandled rejection sequelizedatabaseerror: relation "dbo.wallets" not exist this code: get_dbo__wallets() : { const options = this.getdatabasedefaultoptions('dbo.wallets'); const entity : types.iobjectwithstringkey = {}; entity['wallets_id'] = {type: sequelize.uuid, primarykey: true, allownull : false}; entity['confirmed_balance'] = sequelize.bigint; entity['unconfirmed_balance'] = sequelize.bigint; return this._db.define('dbo.wallets', entity, options); } getdatabasedefaultoptions(tablename : string) : types.iobjectwithstringkey { const options : types.iobjectwithstringkey = {};

c# - Hijri calendar is 1 day too early. -

how fix hijri calendar being 1 day early? today, my-time = 23 july, 2013 tuesday , islamic calendar time = 14 ramadan, 1434 (according this my calendar showing 15 ramadan instead of 14. i'm not sure whether fault or site's fault. can confirm today's ramadan date? lblgreg.text = datetime.today.tostring("dd/mm/yyyy"); today's date: datetime today = datetime.today; conversion of gregorian calendar hibri: cultureinfo hijri = cultureinfo.createspecificculture("ar-sa"); string datetoday_day = today.tostring("dd", hijri); string datetoday_month = today.tostring("mm", hijri); string datetoday_year = today.tostring("yyyy", hijri); int month_check = int.parse(datetoday_month); switch statement value of months switch text-month: switch (month_check) { case 01: { lbldate.text = datetoday_day + " muharram " + datetoday_

How to write ajax function in c# -

the below function how write in c# backend. post method via list. $(function () { $.ajax({ type: "post", url: "default.aspx/getcustomers", data: '{}', contenttype: "application/json; charset=utf-8", datatype: "json", success: onsuccess, failure: function (response) { alert(response.d); }, error: function (response) { alert(response.d); } }); }); you should have customer model in backend, can try this: [httppost] public string getcustomers() { list<customers> listcustomers = new list<customers>(); /* list of customers returned database or picking data*/ customersviewmodel model = new customersviewmodel(){ customers = listcustomers; } return json(model, jsonrequestbehavior.allowget); }

xml - Calling element from imported XSD -

my first xsd: <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="my.com/v1.0.xsd" xmlns:abc="my.com/v1.0.xsd" elementformdefault="qualified"> my new xsd: <xs:schema xmlns:xs="http://www.w3.org/2001/xmlschema" targetnamespace="my.com/v2.0.xsd" xmlns:abc="my.com/v2.0.xsd" elementformdefault="qualified"> <xs:import namespace="my.com/v1.0.xsd" schemalocation="v1.0.xsd"/> i'm new xsd question may sound silly, great if can me. now in v2.0.xsd, want call elements, complextypes in v1.0.xsd, how can likes ? though elements in gathered under abc namespace, unfortunately, things didn't work hope. thank you. to import v1 elements in v2 schema have qualify reference v1 element or complextype in v2 schema. e.g.: given v1 schema that: <xs:schema xmlns:xs="http://www.w3.o

android - Re Ask for remaining permissions on authenticate Facebook user -

Image
i integrate facebook app on android , request login "public_profile,email,user_friends,user_photos" permissions first time. when login restrict email permission. when i'm going authenticate second time saying "you have authorized app". whereas should ask remaining permissions again. if in future need email permission how can permit it.is there way it. here screen thanks, once user has declined permission, app can not ask again same way – need explicitly re-ask it, passing parameter auth_type=rerequest in login dialog call. https://developers.facebook.com/docs/facebook-login/permissions/requesting-and-revoking#handling

sql - How to join a query as a tabel in laravel form? -

like this: select * `teachers` t1 join (select round(rand() * ((select max(id) `teachers`)-(select min(id) `teachers`))+(select min(id) `teachers`)) id) t2 t1.id >= t2.id order t1.id limit 20; you can try raw in join. teacher::select( '*', )->join( db::raw(select round(rand() * ((select max(id) `teachers`)-(select min(id) `teachers`))+(select min(id) `teachers`)) id) ) t2, t1.id >= t2.id ) ->orderby('t1.id') ->get();

How to fix null pointer exception when using two Volley requests in same activity in Android? -

i have added "featured" pager view header listview. pager view receives data separate url listview making 2 separate volley requests. i've tested pager view in separate project , works flawlessly. listview works flawlessly without additional volley request well. main activity. public class mainactivity extends appcompatactivity { private progressdialog dialog=null ; private customadapter adapter; private listview list; arraylist<rowdata> rowdata; private searchview searchview; private menuitem myactionmenuitem; private viewpager pageview; private arraylist<featuremodel> fdata; private featureadapter featadapt; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(toolbar); layoutinflater inflater = getlayout

c# - How to convert `Dictionary<string, Dictionary<string, List<MyCustomClass>>>` to `Dictionary<string, List<MyCustomClass>> ` -

i tried: endresult = tempresult.where(x => x.key.equals(nameofmylist)) .selectmany(wert => wert list<mycustomclass>) .cast<dictionary<string, list<mycustomclass>>>().todictionary(); //error "can not convert type" endresult dictionary<string, list<mycustomclass>> . tempresult dictionary<string, dictionary<string, list<mycustomclass>>> . what's wrong here? updated: sorry, wrote endresult dictionary<string, list<mycustomclass>> and not dictionary<string, dictionary<string, list<mycustomclass>>> (updated it) actually want extract dictionary<string, list<mycustomclass>> from dictionary<string, dictionary<string, list<mycustomclass>>> , kind of conversion, cast i think don't understand dictionaries. check example: var foo = new dictionary<string, dictionary<string, list<

visual studio 2015 - Build action 'EmbeddedResource' is not supported by one or more of the project's targets -

i new xamarin platform, , facing error build action 'embeddedresource' not supported 1 or more of project's targets. debugging in emulator 8.1 windows phone , , project xamarin.form(portable) . follow these steps: update xamarin.forms nuget package manager close solution , open in run administrator mode clean , rebuild solution.now try deploy project

elixir - Follow back functionality -

i have twitter application users can follow each other through connection model. in table lists people follow @user i'd implement link follow back . can link or have forms , display buttons? how setup changesets these forms? web/models/user.ex defmodule myapp.user use myapp.web, :model use arc.ecto.model schema "users" field :last_name, :string has_many :follower_connections, myapp.connection, foreign_key: :followee_id has_many :followers, through: [:follower_connections, :follower] [...] web/models/connection.ex defmodule myapp.connection use myapp.web, :model schema "connections" belongs_to :follower, myapp.user belongs_to :followee, myapp.user [...] web/controllers/user_controller.ex [...] def show(conn, %{"id" => id}) user = repo.get!(user, id) |> repo.preload([:followers, :follower_connections]) conn |> assign(:user, user) |> render("show.html") end [...]

opendj - Getting error "loading openam suffix " -

getting error (error loading openam suffix 1) while creating default configuration in openam 12.0.0 in ubuntu , tomcat 7.0.5. error occurs @ opendj setup step. i'm following exact same steps given in getting started guide https://backstage.forgerock.com/#!/docs/openam/12.0.0/getting-started ) any idea i'm missing? i think adding host name (the 1 shows result of hostname command on terminal) /etc/hosts file resolved issue. followed following link- https://bugster.forgerock.org/jira/browse/openam-3876

c# - Cookie expiry date not set -

Image
here get : protected string identifier { { httpcookie cookie = request.cookies[identifier_cookie]; if (cookie != null) { return cookie.value; } else { cookie = new httpcookie(identifier_cookie); cookie.value = guid.newguid().tostring(); cookie.expires = datetime.now.addyears(1); response.cookies.add(cookie); return cookie.value; } } } when running project locally, cookie's expiry date set expected but when run live, cookie's expiry date when browsing session ends . what doing wrong? before doing else, suggest clear cache , cookies. protected string identifier { { httpcookie cookie = request.cookies[identifier_cookie]; if (!cookie) { cookie = new httpcookie(identifier_cookie); cookie.value = guid.newguid().tostring(); }cookie.expires = datetime.now.

selenium webdriver - even two string are same but when compare result are coming false -

i comparing 2 string.i reading string 1 i.e expectedresult excelsheet , string 2 i.e actualresult getting web page using " getelementbyxpath("errormsg_userpass").gettext(); but when equate 2 string though same result of comparison coming false i.e not same. enter image description here i don't know why happening .please help use trim() remove leading , trailing spaces!!

google cloud messaging - GCM Success then NotRegistered -

i'm trying send push app , testing using website : http://www.pushwatch.com/gcm/ first try receive success message , error message : notregistered. same result code : <html> <form method="post" action="test.php"> id : <input type="text" name="id"/><br/> message : <input type="text" name="message"/><br/> <input type="submit" value="envoyer"/> </form> if (isset($_post["message"])) { $message = $_post["message"]; $registrationids = $_post["id"]; echo "call<br/>"; echo "message = ".$message." / ids = ".$registrationids."<br/><br/>"; // api access key google api's console define( 'api_access_key', 'aiza....' ); // prep bundle $msg = array ( 'message' => $me

java - Custom Json Deserializer in Jackson for Hashmap only -

i'm writing json serialization (using jackson) hierarchy of java classes, i.e. classes composed of other classes. since, i'm not serializing properties, i've used jsonviews , have annotated properties want serialize. class @ top of hierarchy contains map needs serialized/deserialized. possible write serializer/deserializer map ? want default serializer take care of serializing rest of objects why requirement ? if define serializer topmost class, need serialization objects. jsongenerator object seems ignore jsonview annotations , serializes properties. sure possible. define custom serializer map class generic type, bind using jackson module subsystem. here example: (it produces silly custom serialization, principal valid) public class test { // "topmost" class public static class dto { public string name = "name"; public boolean b = false; public int = 100; @jsonview(myview.class) publi

java - Visualization of graph -

i have simple program simulates distributed environment. want visualize processor behaviour using graphstream library. each processor thread, computations, not time, when set switch variable while(running){ if(switch) computate(); } i have written class take processorlist , prepare graph visualization. there function task public void adjustbfsgraph2(){ for(edge e: this.g.getedgeset()) { e.clearattributes(); } try { thread.sleep(2000); } catch (interruptedexception e) { e.printstacktrace(); } for(processor p : processorlist) { p.getnode().setattribute("ui.label", "pid" +" " + p.getpid() +" "+"dist: " + p.getfieldvalue("bfs") + " " + "parent" + " " + p.getfieldvalue("parent")); if(!p.getfieldvalue("parent").equals("-1")) { edge e = p.getnode().getedgebetween(p

asp.net - Size of the request headers is too long -

i'm working on asp.net mvc website , works fine. but have problem don't understand @ all... when launch website on visual studio chrome example no problem, when stop , try launch other test firefox example, url growing , error : http 400. size of request headers long. can explain me why happening ? code or come iis express or else ? thanks in advance check msdn : cause this issue may occur when user member of many active directory user groups. when user member of large number of active directory groups kerberos authentication token user increases in size. http request user sends iis server contains kerberos token in www-authenticate header, , header size increases number of groups goes up. if http header or packet size increases past limits configured in iis, iis may reject request , send error response. resolution to work around problem, choose 1 of following options: a) decrease number of active directory gr

SqlConnection error index 0 in c# -

in code below see error when try connect connection string thiss error appears format of initialization string not conform specification starting @ index 0. how can fix it? in code below see error when try connect connection string thiss error appears format of initialization string not conform specification starting @ index 0. how can fix it? namespace insertuserapp { public partial class home : form { class comboitemexample { public string displaystring { get; set; } public string connectionstring { get; set; } public override string tostring() { return displaystring; } } private string connstring = "<default connection>"; public home() { initializecomponent(); var srv1 = new comboitemexample { displaystring = "srv1", connectionstring = "data source=tcp:10.0.0.110;initial catalog=database1;user id=user;password=pass;"

c++ - A program to print numbers from 1 to n in triangular wave form without using extra space -

i want print numbers 1 n(say 10) in triangular wave form.here code - #include <iostream> using namespace std; int main() { //code int n; cin>>n; int arr[3][10]; int r=1,c=0,dir=-1; int i,j; for(i=0;i<3;i++){ for(int j=0;j<n;j++){ arr[i][j]=0; } } for(i=1;i<=n;i++){ arr[r][c]=i; if(r==2 || r==0)dir = -dir; if(dir==1)r++; else r--; c++; } for(i=0;i<3;i++){ for(j=0;j<n;j++){ if(arr[i][j]==0) cout<<" "; else cout<<arr[i][j]<<" "; } cout<<endl; } return 0; } the output of code is 2 6 10 1 3 5 7 9 4 8 is possible solve problem using array? replace body of third cycle with if (arr[i][j] == 0) cout << ' '; else cout << arr[i][j]; cout << '

How to detect a function and then fulfill conditional to remove html element by using javascript -

one more time need help. i've used star wars intro , display created buttons. played in popup div, footer makes height of container big in me want remove element when code of star wars displayed. //start music function play(){ var audio = document.getelementbyid("audio"); audio.play(); } //stop music function stop(){ var audio = document.getelementbyid("audio"); audio.pause(); audio.currenttime = 0; } //sekwenscja star wars var swidth; //screen width var sheight; //screen height var canvas; var context; var numofstars; var stardensity = 1800; //lower == more stars var starcolors = ["#111", "#333", "#555", "#7872a8", "#483f26"]; var audio = $('audio').get(0); $(document).ready(function() { //play theme song settimeout(function() { audio.play(); }, 7600);

Refresh extjs form's submit data -

i have extjs form (get method) fields can dynamically added or removed. have added logic changes names of fields example .... items: [ { xtype: 'textfield', fieldlabel: 'username', name: 'data[param1][0]' },{ .... becomes .... items: [ { xtype: 'textfield', fieldlabel: 'username', name: 'data[param1][1]' },{ .... after submit form old data submitted without effect on added/removed fields or field name changes how update or refresh form send correct. edit else working correctly in form example form.load() loads data server side json , can edit/save them db. when use form.add(fields) method new fields included in submit request not delete. read exjs form submit url data calculated 1 time , other time when possibly events triggered. main trouble renaming fields not reflect submit data, have checked manually looking source

javac - Gradle - set specific JAVA_HOME for a specific project -

due different servers running different jvm version. set specific project specific jdk version. i'm thinking may setting java_home task compilation depends on it, i'm not sure how code yet. there may simple setting can in build.gradle that!? i think after sourcecompatibility and targetcompatibility . settings on project has - far compilation concerned - same effect -source , -target parameters javac . if need different settings different compile tasks in 1 project, possible.

javascript - Uploading Static Resources to salesforce.com -

i going through salesforce.com development article , found task painful, uploading static files. had found below solutions of eclipse plugin convert resource files, , doing operations on it. i can use either sublime text mavensmate plugin i have gone through articles of eclipse plugin , adding more files existing collection again big pain me. have gone through mavensmate plugin still did not understand easiness in it. he question what web api provided salesforce.com can make ajax request user name , password , upload zip files own interface. if want upload static resources during development, can use eclipse that. described in this article . if want communicate salesforce through web api, should use soap api or rest api . documentation static resources says: encoded data the api sends , receives binary file data encoded base64 data type. prior creating record, clients must encode binary file data base64. upon receiving api response, clients must de

ios - Grid layout inside UITableViewCell -

Image
i trying make uitableview image below unable insert time label. tried using uicollectionview inside uitableview not , tried uistackview failed.

c# - Deserializing JSON into an object -

i have json: { "foo" : [ { "bar" : "baz" }, { "bar" : "qux" } ] } and want deserialize collection. have defined class: public class foo { public string bar { get; set; } } however, following code not work: jsonconvert.deserializeobject<list<foo>>(jsonstring); how can deserialize json? that json not foo json array. code jsonconvert.deserializeobject<t>(jsonstring) parse json string from root on up , , type t must match json structure exactly. parser not going guess which json member supposed represent list<foo> you're looking for. you need root object, represents json root element. you can let classes generated sample json. this, copy json , click edit -> paste special -> paste json classes in visual studio. alternatively, same on http://json2csharp.com , generates more or less same classes. you'll see collection 1 element deeper ex

python - re.findall not returning full match? -

i have file includes bunch of strings "size=xxx;". trying python's re module first time , bit mystified following behavior: if use pipe 'or' in regular expression, see bit of match returned. e.g.: >>> myfile = open('testfile.txt','r').read() >>> print re.findall('size=50;',myfile) ['size=50;', 'size=50;', 'size=50;', 'size=50;'] >>> print re.findall('size=51;',myfile) ['size=51;', 'size=51;', 'size=51;'] >>> print re.findall('size=(50|51);',myfile) ['51', '51', '51', '50', '50', '50', '50'] >>> print re.findall(r'size=(50|51);',myfile) ['51', '51', '51', '50', '50', '50', '50'] the "size=" part of match gone. (yet used in search, otherwise there more results). doing wrong? the prob

join - MySql Get records only from child table where the parent key has multiple values -

i have 2 tables parent , child. parent has field called unique_id , child has field called parent_unique_id , foreign key in child table. parent table has 4 records same unique_id , child table has 5 records same unique_id. when join them records, getting total of 20 records each 5 records of child table repeating 4 times. the query using select c.* child c join parent p on c.parent_unique_id = p.unique_id i tried left join still getting 20 records repeated. one method use in or exists : select c.* child c c.parent_unique_id in (select p.unique_id parent p); of course, slap select distinct on query. however, requires , unnecessary processing.

.net - Is it safer to place a exe.config file outside IIS root path -

in web application , need use .exe.config file contains sensitive passwords. is better place outside iis root path in order reduce threats ? i know iis not serve config file keep hearing it's dangerous writing plain text passwords in config files... in advance advices. we use registry storing passwords safely. can encrypt passwords machine key , store in windows registry.

C: ether_aton return type -

i wondering return type of ether_aton() function is? from linux man page: ether_aton() converts 48-bit ethernet host address asc standard hex-digits-and-colons notation binary data in network byte order , returns pointer in statically allocated buffer, subsequent calls overwrite. ether_aton() returns null if address invalid." it mentioned in man page itself struct ether_addr *ether_aton(const char *asc);

Android: Read a file without external storage permission -

i don't want app require permissions, want user able select file reading. app doesn't need arbitrary access filesystem. however, openfiledialog implementations have researched far seem assume permission access external storage. one workaround can think of configure app among list of apps open type of file. haven't tried this, hope work without permission access external storage. however, user guidance less ideal in case. prefer solution dialog , have user pick file. i think requirement not undermine security, because user has full control on file app can read. possible somehow? however, openfiledialog implementations have researched far seem assume permission access external storage. set minsdkversion 19, use action_open_document , part of the storage access framework . or, if need minsdkversion below 19, use action_get_content on older devices. you uri via onactivityresult() . use contentresolver , methods openinputstream() consume content

PHP referrer domain and subfile -

i have code: $allowed_host = 'domain.com'; $host = parse_url($_server['http_referer'], php_url_host); if(substr($host, 0 - strlen($allowed_host)) == $allowed_host) { echo "ok"; } else { echo "not ok"; exit(); } this code based on domain how can check domain , php file? if referrer page: domain.com/fromok.php {echo "ok";} else {echo "not ok";} your code give 'ok' if request host name ends 'domian.com' , example if 'adomian.com' . assume don't want it. you can use $allowed_host = 'domain.com'; $allowed_path = '/fromok.php'; $url_components = parse_url($_server['http_referer']); if((($url_components['host'] === $allowed_host) || (substr($url_components['host'], - (strlen($allowed_host) + 1) === '.' . $allowed_host)) && ($url_components['path'] === $allowed_path)) { echo "ok"; } else { echo "not

c# - How to generate custom keys in EF7? -

ef7 usual stuff auto-generating auto-incrementing ids, adding [key] attribute integral key. found video describes alternative strategy generating integer keys natively supported ef. the keys in project, however, guids. , part want them generated comb guids, don't cause trouble on insertion clustered index. set default value of newsequentialid() on sql table, want generate ids in code (which why we're using guids in first place). question 1 is: how generate comb guids on key field in ef7? then there's particular table id field needs generated hash of 1 of fields. (this can rely on identical records in different environments having same id.) question 2 is: how implement custom guid generation on inserting records in table? i tinkered in dbcontext 's onmodelcreating() method, valuegeneratedonadd() method, can't find parameters or overloads allow me set kind of custom guid generation.

osx - Is it possible to restore Nuget packages with a Xamarin.iOS build using TFS online? -

i trying automate build process xamarin.ios application. have managed xamarin.android , uwp build working find on over site windows build agent. i trying build xamarin.ios application using on site mac build agent. i have added restore nuget packages first step in build definition keep getting error: msbuild auto-detection: using msbuild version '4.0' '/library/frameworks/mono.framework/versions/4.2.3/lib/mono/4.5'. msbuild.exe not exist @ '/library/frameworks/mono.framework/versions/4.2.3/lib/mono/4.5/msbuild.exe'. error: /usr/local/bin/nuget failed return code: 1 return code: 1 but i'm not sure it's trying here @ nuget installer stage. so possible do? there known issue nuget restore command on non-windows operating systems: restore - restore works packages.config , project.json files not yet work *.sln solution files so can try update "restore nuget packages" step restore packages.config file i

node.js - How to configure reverse proxy rules for gitlab on nodejs express -

i'm developing nodejs application serve private gitlab server. got working apache, wan't replace apache nodejs application. got working. website working properly, can see projects etc. when try clone repository this git clone http://example.com:3000/apps/test.git it clone empty repository, , gives this cloning 'test'... warning: appear have cloned empty repository. checking connectivity... done. repository not empty. work's when clone using apache app.js let express = require('express'), app = express(), port = process.env.port||3000 httpproxy = require('http-proxy'), path = require('path'), httpproxyrules = require('http-proxy-rules'), proxy = httpproxy.createproxyserver() app.use((req, res, next) => { let targeturi= `http://localhost:8181${req.url}` let targeturi2= `http://localhost:8080${req.url}` let proxyrules = new httpproxyrules({ rules: { '

android - how to dismiss a popupwindow when click button? -

what want do want write button when click show popupwindow,and when click outside or click button again popupwindow dismiss. what do i use code this mpopupwindow=new popupwindow(); mpopupwindow.settouchable(true); mpopupwindow.setoutsidetouchable(true); mpopupwindow.setwidth(windowmanager.layoutparams.wrap_content); mpopupwindow.setheight(windowmanager.layoutparams.wrap_content); brush.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { mpopupwindow.setcontentview(brushview); mpopupwindow.showasdropdown(v); } }); what problem when click button again show attempted finish input event input event receiver has been disposed. it think because tirgger outside , clicklistener please try below answer: mpopupwindow.setbackgrounddrawable(new bitmapdrawable()); mpopupwindow.setoutsidetouchable(true);

javascript - How to set volume of audio object? -

i know can create audio object this: var audio = new audio("test.wav"); and know how can play audio: audio.play(); i used following for loop output functions audio : var myaudioobject = new audio(); (var key in myaudioobject) { if (typeof myaudioobject[key] === "function") { console.log(key); } } but there no setting volume. possible change volume in audio object? hint it fault. if replace function in loop number find volume. var myaudioobject = new audio(); (var key in myaudioobject) { if (typeof myaudioobject[key] === "number") { console.log(key); } } it's not function, it's property called volume . audio.volume = 0.2; http://www.w3schools.com/tags/av_prop_volume.asp

node.js - Mongoose select: false not working on location nested object -

i want location field of schema hidden default. added select: false property it, returned when selecting documents... var userschema = new mongoose.schema({ cellphone: { type: string, required: true, unique: true, }, location: { 'type': { type: string, required: true, enum: ['point', 'linestring', 'polygon'], default: 'point' }, coordinates: [number], select: false, <-- here }, }); userschema.index({location: '2dsphere'}); when calling : user.find({ }, function(err, result){ console.log(result[0]); }); the output : { cellphone: '+33656565656', location: { type: 'point', coordinates: [object] } <-- shouldn't } edit : explanation (thanks @alexmac) schematype select option must applied field options not type. in example you've defined complex type location , added select option type. you should firstly create locationschema , af

Android + PHP + mySQL - Http post don't work -

i'm trying upload form data android java app (using android studio). i've created php file handle server side of upload, file using post method, receiving app form info, , upload data sql database. so i'm trying enter data, async process work end connect, there no error @ nothing getting in sql table! i'm not getting tuple mysql server (to users table).i searched problem cant find. please me find bug or how can detect problem. register.java code: package com.example.user.social; import android.content.intent; import android.os.asynctask; import android.os.bundle; import android.support.v7.app.appcompatactivity; import android.util.log; import android.view.view; import android.view.window; import android.view.windowmanager; import android.widget.button; import android.widget.edittext; import org.apache.http.httpresponse; import org.apache.http.namevaluepair; import org.apache.http.client.httpclient; import org.apache.http.client.entity.urlencodedformentity; im

testing - Jenkins build web application and tests -

i'm trying setup jenkins testing web application. setup have gradle build file. apply plugin: 'java' apply plugin: 'maven' defaulttasks 'clean','compilejava','test' group = 'automationtest' version = '1.1-snapshot' description = "" repositories { maven { url "http://repo.maven.apache.org/maven2" } } dependencies { compile group: 'org.seleniumhq.selenium', name: 'selenium-java', version:'2.52.0' compile group: 'org.uncommons', name: 'reportng', version:'1.1.4' compile group: 'org.apache.velocity', name: 'velocity', version:'1.7' compile group: 'com.google.inject', name: 'guice', version:'4.0' testcompile group: 'junit', name: 'junit', version:'3.8.1' testcompile group: 'org.testng', name: 'testng', version:'6.9.4' } test{ u