Posts

Showing posts from January, 2014

logging - What is the syntax of the FTP log file -

i'm trying go through of ftp logs examine issue i've experienced. log files have shorthand flags, don't know mean, , unable find sort of documentation on it. an example of line ftp log is: tue jan 05 17:18:22 2016 0 1.2.3.4 3581 /path/to/file/file.php _ o r username ftp 1 * c date , time obvious, 1.2.3.4 ip address, 3581 i'm assuming linux pid, username ftp account username. the ending of line, a _ o r username ftp 1 * c (except username , ftp ) i'm confused about. , 0 between date , ip address. is there documentation somewhere flags represent? based on https://svn.apache.org/repos/asf/httpd/mod_ftp/trunk/modules/ftp/ftp_log.c have following ftp-specific variables: these callbacks extend mod_log_config adding additional % directives follows: %..m mode used transfer file. single character printed, (ascii) or b (binary) %..f action taken on file (concationated needed) c - file compressed. u - file uncompressed. ...

javascript - ajax - sending data as json to php server and receiving response -

i'm trying grasp more should @ once. let's have 2 inputs , button, , on button click want create json containing data inputs , send server. i think should it, might wrong i've seen lot of different (poorly explained) methods of doing similar. var item = function(first, second) { return { firstpart : first.val(), secondpart : second.val(), }; }; $(document).ready(function(){ $("#send_item").click(function() { var form = $("#add_item"); if (form) { item = item($("#first"), $("#second")); $.ajax ({ type: "post", url: "post.php", data: { 'test' : item }, success: function(result) { console.log(result); } }); } }); }); ...

php - How to retrieve the data from a URL with an exclamation mark inside it? -

i retrieve content of website website build exclamation mark in url , doesn't seem work. things tried: <?php echo file_get_contents('https://domain.com/path/!weird.formatted?url=1'); echo file_get_contents('https://domain.com/path/%21weird.formatted?url=1'); echo file_get_contents(urlencode('https://domain.com/path/!weird.formatted?url=1')); echo file_get_contents(rawurlencode('https://domain.com/path/!weird.formatted?url=1')); i tried retrieve content php curl here seems exclamation mark problem. so how retrieve webpage? suggestions highly appreciate. update the url try retrieve content from: https://loket.bunnik.nl/mozard/!suite86.scherm0325?mpag=1070 so problem web page checking valid user agent/cookie. code used fix issue: <?php echo getpage("https://loket.bunnik.nl/mozard/!suite86.scherm0325?mpag=1070"); function getpage ($url) { $useragent = 'mozilla/5.0 (macintosh; intel mac os x 10...

ruby on rails - Assets Precompile When Explicitly Invoked, Breaks During Capistrano Deployment -

Image
i using rails 4.2, , capistrano 3. when run bundle exec rake assets:precompile , works out nice , dandy, when use capistrano deploy site, error during asset:precompile step. tasks: top => deploy:assets:precompile (see full trace running task --trace) deploy has failed error: exception while executing xxx@123.45.67.89: rake exit status: 1 rake stdout: rake aborted! sass::syntaxerror: invalid css after " */": expected "}", "" (sass):6831 /home/xxx/sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1161:in `expected' /home/xxx/sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1097:in `expected' /home/xxx/sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:1092:in `tok!' /home/xxx/sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/parser.rb:639:in `block' /home/xxx/sites/my-app/shared/bundle/ruby/2.2.0/gems/sass-3.4.19/lib/sass/scss/pa...

spring - In JSP, Field Path Uses HashMap<String,ArrayList<String>> (SpringMVC Form) -

suppose model field hashmap of strings arraylist's of strings. hashmap<string,arraylist<string>> map = new hashmap<string,arraylist<string>>(); for field binding, need point i-th item of arraylist of specific key in jsp. how do it? double-bracket notation work? assume 'key' , 'index' known jstl variables in jsp. <form:checkbox path="map[${key}][${index}]" /> what i'm doing is, field value, store path e.g. map['testkey'][4] which point to map.get("testkey").get(4); that doesn't work: org.springframework.beans.nullvalueinnestedpathexception: invalid property 'map[testkey][0]' note according ( binding map of lists in spring mvc ), problem because sub-objects not auto-growable, , need implement lazylist or growable list? arraylist growable spring mvc's forms, when used sub-collection, it's not? tricky. i solved problem following lazylist/lazyset implemen...

laravel - How I can ignore feature in behat? -

i using behat laravel . have features want ignore in tests. have inside features folder: - a.feature - b.feature - c.feature i want exclude feature c testing. @ moment if want exclude feature c tests have rename - example "c.feature.tmp". there more intelligent way ... in java or .net have @ignore annotation. you can give features don't want test tag @notesting , run behat this. behat --tags '~@notesting' the ~ sign not operator. or @grzegorz-zadja mentioned can use test suites . in feature file right above feature: can put tags. add @notesting there. see documentation .

App name with superscript text android -

i want name android application super script (uno ™ ). see tm smaller , of line. i used html.fromhtml(x +"<sup><font style=\"font-size:1;\">tm</font ></sup>")); also in strings.xml used <string name="app_name"> x<sup><font style="font-size:1;">tm</font></sup> </string> also doesn't work. how can this? you need use unicode symbol trademark instead. <string name="app_name"> name &#8482;</string> where &#8482; ™

javascript - Using onSubmit with form in Featherlight? -

i using featherlight display html form , not able following: load page form hidden initially. have form's "onsubmit" fire when form submitted using standard html submit button. i call inital lightbox manually global variable can use "persist" option: lightboxform = $.featherlight('#attendeeaddeditform', { 'persist' : true }); ...but can't seem "beforeopen" syntax correct prevent displaying: beforeopen: function(event){return false} ...doesn't work inside above call. here simplified version of trying do: http://jsfiddle.net/djwljr/jnsu6/142/ any appreciated. thanks! first, can set persist option using data-featherlight-persist="true" if prefer (same featherlight options). second, either call $.featherlight(...) open window immediately, or bind button $('.my-button').featherlight(...) (or data-featherlight ). second form not open dialog immediately, desire. don't think y...

ios - Cannot assign value of type NSMutableArray to type UIBarButtonItem -

i developing ios audio app learning project. i'm having problem in 1 of functions, checks if player playing or paused/stopped. if it's playing should change button in button bar "pause" button, or if it's paused or stopped, change button "play" button. assigning button bar items variable "items" nsmutablearray, make necessary change button, assign "items" button bar items update display. in code getting error on line: self.toolbar.items = items the error message cannot assign value of type nsmutablearray type uibarbuttonitem i assume need cast nsmutablearray, i've tried using array, , when error goes away buttons break. the related parts of code are: @iboutlet weak var toolbar: uitoolbar! @iboutlet var playbutton: uibarbuttonitem! @ibaction func playpausepressed(sender: anyobject) { let playbackstate = self.player.playbackstate mpmusicplaybackstate let items = nsmutablearray(array: self.toolbar.ite...

c# - Using Namespaces in Other Projects -

Image
as screenshot demonstrates, have project "sampleapp" uses namespaces of "edam" , "thrift." want replicate functionality of "sampleapp" project. do have include 2 other projects ("edam" , "thrift") in other project? can copy folders instead of including actual project files? can convert them sort of dll or something? don't copy folders, add references projects. if projects class libraries don't want copy dlls, instead should add references, in case dlls updated: how to: add or remove references in visual studio

python - Nginx not returning html templates correctly when connecting via dns -

this question has answer here: flask-login raises typeerror: 'bool' object not callable when trying override is_active property 2 answers hi i've made web application organisation i'm deploying onto ubuntu server. web application built in python flask , other extentions , works great in dev, when deploy weird error can't see purpose for. application made flask "front-end" nginx uwsgi handling python nginx the server running newest ubuntu server on wm i can reach application computer in lan ip-adress in browser, works fine , assigned port 80 in nginx don't have type port myself. (flask congfigured localhost:8080 testing pursuses). i can not server reply else 502 , 404 errors when trying connect through dns pointed @ outgoing ip, nor can connect directly outgoing ip. can see in 1 of error logs seems server handles request get...

linux - Apache httpd terminates on interrupt/breakpoint -

i try use "valgrind --vgdb=yes httpd -x" debug service running via httpd, , monitor memory leaks using "monitor leak_check full reachable increased" after each request. problem cannot interrupt httpd reliably in order run "monitor" command in gdb - when press ctrl-c in valgrind/httpd terminal, terminates, same when send kill -int. tried different "handle sigint/sigterm nopass/pass" no luck. also often, when add breakpoints , pause httpd in eclipse cdt/gdb debugger, httpd terminates, too. so possible interrupt httpd without making exit in 90% cases?

scala - MLlib: Calculating Precision and Recall for multiple threshold values -

i set setting threshold value of logistic regression 0.5 before use scoring. want precision, recall, f1 score value. unfortunately, when try doing threshold values see 1.0 , 0.0. how metrics threshold values other 0 , 1. for example here o/p: threshold is: 1.0, precision is: 0.85 threshold is: 0.0, precision is: 0.312641 i don't precision threshold 0.5. here relevant code. // setting threshold value of logistic regression model here. model.setthreshold(0.5) // compute score , generate rdd prediction , label values. val predictionandlabels = data.map { case labeledpoint(label, features) => (model.predict(features), label) } // want compute precision , recall , other metrics. since have set model threshold 0.5, want pr @ value. val metrics = new binaryclassificationmetrics(predictionandlabels) val precision = metrics.precisionbythreshold() precision.foreach { case (t, p) => { println(s"threshold is: $t, precision is: $p") if (t =...

java - Restart Tomcat Service on AWS EC2 instance, on a schedule -

i have instance on tomcat running on ec2. based on resourcing reasons don't want into, i'd restart each evening @ 11:00pm. i'm not interested in reloading or stopping applications context permgen space gets crowded until box tips on , dies. so on aws linux instance specify service tomcat7 restart , give cron expression? to add cronab entry root user: sudo crontab -e which open editor. insert following line restart tomcat7 @ 11pm daily 0 23 * * * /sbin/service tomcat7 restart

javascript - Filling data in form using angular -

i true beginner @ angular (but not js), started yesterday, hope forgive me if question sound stupid. consider following small application: html: <!doctype html> <html ng-app="todoapp"> <head> <script src="http://code.jquery.com/jquery-1.10.2.js"></script> <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script> <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script src="/js/testcontroller.js"></script> </head> <body ng-controller="testcontroller mycontrol"> <div id="overlaybox"> <button ng-click="mycontrol.showupd(4)">test</button><br/><br/><br/> ...

javascript - Trying to Create a Delayed Pop-up with Lightbox -

i'm trying create lightbox jquery open email collection pop-up sign newsletter. think understand how make work if clicks on link don't want visitor have click link, want pop automatically after 5 second delay when visitor lands on page seems common on many pages. non cms page. can tell me simplest way go this? you can use settimout() : settimeout(function(){ //this code run in 5 seconds }, 5000); here's fiddle alert demonstrate.

wcf - IISExpress: Unable to automatically step into the server. the remote procedure cannot be debugged -

i'm hosing webservice in iisexpress , can browse endpoint using browser know alive. i'm writing test application in winforms , want call method on service. when try , step call, error. iisexpress: unable automatically step server. remote procedure cannot debugged. the webservice set in debug mode, i'm wondering there setting preventing iisexpress allowing debugging? update: i'm wondering if because test app doesn't have .pdb files loaded memory these stored elsewhere within webservice folder, not test app bin folder. i've tried specify folder of bin folder app_code.pdb located webservices, still not luck. so how done? i'm stumped. update 2: still haven't been able work after week of looking it. so here basic requirements: need 1) winforms app 2) able make calls different webservices , 3) able step each service call. services hosted sub-applications of root website using iisexpress. winform test app making web service calls, iisexpress...

python 3.x - Why do I get "ImportError: cannot import name find_spec" when I start a new Django project? -

i'm learning python in tandem django. installed python 3 on machine (debian wheezy), read possible conflicts , removed difficulty. now i'm using virtualenv , installed python3 within env , django using pip. django , python seem have installed correctly: # python -c "import django; print(django.get_version())" 1.9.1 # python -v python 3.2.3` but when try start new django project, following: # django-admin.py startproject mysite traceback (most recent call last): file "/home/rialaado/projects/webenv/bin/django-admin.py", line 2, in <module> django.core import management file "/home/rialaado/projects/webenv/lib/python3.2/site-packages/django/core/management/__init__.py", line 10, in <module> django.apps import apps file "/home/rialaado/projects/webenv/lib/python3.2/site-packages/django/apps/__init__.py", line 1, in <module> .config import appconfig file "/home/rialaado/projects/webenv/l...

JavaScript eval() on client-side for running untrusted code -

i have been reviewing threads can find on security implications of using eval() on client-side of javascript webpage. i implementing site should allow user run own code (written on page) , see visual results on div on same page. essentially, want user able write valid javascript code, , have manipulate canvas on same page. there no need server-side evaluation of code. i have had @ both jailed , caja, think may adding additional complexity not required. i understand right way of doing type of thing in "sandbox" has no access rest of codebase, however, needs such cannot define simple api provide safe entry/exit points...i want user able use javascript code , dont want have write interpreter provide api. given there no server-side evaluation required, , there should ever single user executing own code in web session, safe use eval()? if have no path in logic allows 1 person publish code used others can use eval() is. your situation not anyhow dif...

Applescript Syntax Error "Expected “else”, etc. but found end of script." -

i having trouble in applescript: display dialog "open application" buttons {"chrome", "applescript", "textedit"} set button_pressed button returned of result if button_pressed "chrome" open application "google chrome"-- action 1st button goes here if button_pressed "applescript" open application "applescript editor"-- action 2nd button goes here if button_pressed "textedit" open application "textedit"-- action 3rd button goes here end it keeps saying syntax error: expected “else”, etc. found end of script. what should do you have 3 if statements, end 1 of them. what want here else if : display dialog "open application" buttons {"chrome", "applescript", "textedit"} set button_pressed button returned of result if button_pressed "chrome" open application "google chrome" -- action 1st button goes here e...

iOS UTF7 encoding/decoding -

i have issue utf7 decoding. able isolate problem, creating following sample code: nsstringencoding stringencoding = myfunctionfortranslatecodepagetoencoding(codepage); // see end of string, it's important const char * testbuffer ="aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa+adw-"; nsstring * teststring = [[nsstring alloc] initwithbytes:testbuffer length:strlen(testbuffer) encoding:stringencoding]; where: strlen(testbuffer) 508, 'codepage' 65000, 'stringencoding' 2214592768 (probably utf-7,...

c++ - Are there any benefits of using constexpr over #define? -

this question has answer here: why preprocessor macros evil , alternatives? 7 answers is constexpr needed? 6 answers you definetely know macros evil. relatively new keyword constexpr can few stuff couldn't const . e.g: constexpr int getval() { return 40; } int arr[getval()]; and yeah...there many other usages constexpr , in constructors..etc. now question is, there benefit of using on #define macros? edit i know can , cannot done constexpr on macros of question , answers about. here i'm explicitly asking benefits of using constexpr on #define when both can used.

android - Using Keyboard View as an app -

it possible program "inside keyboard"? my idea put clickable circle in middle of keyboard... possible?? i'm new on android programming, thanks! do mean writing own keyboard? sure, can whatever want. won't use keyboardview though- limiting, add custom stuff middle of you'd want implement own view. if mean adding programmatically either default or 3rd party keyboard- nope. part of screen owned keyboard app , can't override it.

c# - Timer runs in different thread than the one that created it -

using visual studio 2015, visual c# windows application. i need timer empties queue in main thread because ui components modified. coded this: public form1() { initializecomponent(); q = new concurrentqueue<amsg>(); timer = new system.timers.timer(100); timer.elapsed += timer_elapsed; timer.enabled = true; } void timer_elapsed(object sender, system.timers.elapsedeventargs e) { clsudpmsg msg; while (q.trydequeue(out msg)) handlerx(msg); } but elapsed event executes in worker thread...? if put timer on main form @ design time generated prototype different: private void timer1_tick(object sender, eventargs e) { amsg msg; while (q.trydequeue(out msg)) handlerx(msg); } but 1 execute in main thread context. the question extends thread creates timer way; thought timer created in thread executes elapsed event in same thread context. missing something? quick e...

c# - IF Boolean statement order of input validation -

i have validate inputs user makes, , send error message this got far // probes methods check validity. private void btncalculate_click(object sender, eventargs e) { if (!(validwidth(float.parse(txtwidth.text)))) { return; } if (!(validlength(float.parse(txtlength.text)))) { return; } if (!(validdepth(float.parse(txtavgdepth.text)))) { return; } } my problem when enter values length, width, , depth. in order..what mean if don't enter width , leave blank , put in length , depth gives me unhandled expection. here methods /** created boolean method test if written width valid or not valid **/ private bool validwidth(float width1) { float width = float.parse(txtwidth.text); { if (width >= 2 & width <= 20) { return true; } else { string title = "data invalid"; string msg = "width measurement invalid \n place ...

c++ - How do I implement matrix.Transpose() for my non-static Transpose function? -

i have been given following code in test.cpp file implement: cout << "case 2: non-static transpose function" << endl; { double column[4] = {2, 1, 0, -1}; double row[3] = {2, 0, -1}; matrix matrix = matrix::toeplitz(column, 4, row, 3); cout << "the original matrix = " << endl; cout << matrix << endl; //this part of code works matrix.transpose(); //how implement this? cout << "the transposed version = " << endl; cout << matrix << endl; cout << "press key continue ..." << flush; system("read"); cout << endl; } the way matrix::toeplitz(column, 4, row, 3) works follows: matrix matrix::toeplitz(const double* column, const int noofrows, const double* row, const int noofcolumns){ matrix outt(column, noofrows, row, noofcolumns); return outt; } so how implement matrix.transpose()? code far follows: m...

excel - How can I write a loop in vba for this code -

59.30 15 16 17 1 1,162,912,036.90 1,248,737,016.99 1,306,573,912.08 2 245,665,383.94 261,416,880.69 276,613,283.05 3 393,313,441.29 379,169,039.15 418,680,492.19 4 13,920,572.74 14,464,854.92 15,120,474.58 5 54,501,581.55 56,319,351.21 58,832,588.24 6 15,165,376.28 11,694,942.56 10,809,661.03 7 194,397,643.30 170,427,013.85 182,567,862.46 8 15,165,376.28 11,694,942.56 10,809,661.03 9 2,079,876,036.00 2,142,229,099.38 2,269,198,273.62 3% 6% there 7 tables above data in 1 excel tab in different area.i want create stacked column chart each table. wrote code create. want know possiable use loop solve problem? code attached. sub formatchartnix() 'purpose: create chart (chart dimensions not required) dim rng range dim cht object dim ser series dim tmpchr chartobject 'chart1 'you...

mongodb - Mongo "E11000 duplicate key error" does not indicate which index caused the error when using WiredTiger -

i have mongo collection contains documents {_id : "thing1", version : 123 } i have created secondary index on version column value must unique across documents in collection { v: 1, unique: true, key: { version: -1 } } when use mmapv1, if attempt insert duplicate document (that conflicts against version key) error says e11000 duplicate key error index: local.sample.$version_-1 dup key: { : 1 } but if i'm using wiredtiger, don't index anymore: e11000 duplicate key error dup key: { : 1 } i use index determine column failure can retry differently depending on failure. there in configuration that's causing value missing error? note: using mongo 3.0 it looks bug in mongo 3.0.0. servers running app weren't having issue, local machine , couldn't figure out different between 2 when realized server running mongo 3.0.3. upgrading local machine 3.0.3 or newer resolved issue.

sql server - Incrementing revision numbers in table's composite key -

i'm running sql server 2014 locally database deployed azure sql v12 database. i have table stores values of extensible properties business-entity object, in case 3 tables this: create table widgets ( widgetid bigint identity(1,1), ... ) create table widgetproperties ( propertyid int identity(1,1), name nvarchar(50) type int -- 0 = int, 1 = string, 2 = date, etc ) create table widgetpropertyvalues ( widgetid bigint, propertyid int, revision int, datetime datetimeoffset(7), value varbinary(255) constraint [pk_widgetpropertyvalues] primary key clustered ( [widgetid] asc, [propertyidid] asc, [revision] asc ) ) alter table dbo.widgetpropertyvalues check add constraint fk_widgetpropertyvalues_widgetproperties foreign key( propertyid ) references dbo.widgetproperties ( propertyid ) alter table dbo.widgetpropertyvalues check add constraint fk_widgetpropertyvalues_widgets foreign key...

php - Magento Global Messages not displaying site wide -

i've discovered global messages on magento site no longer displaying. messages such login failure, item has been added cart, etc no longer display i haven't made changes templates , i've checked both template .phtml , page.xml files make sure inline code call global message there, , is. oddly enough, newsletter submission message still works i've been trying troubleshoot days , still @ loss :( does have suggestion can do? so not flood post code, here page.xml page.xml: http://www.diegocordero.com.au/magento/page.xml and 3columns.phtml: <?php echo $this->getchildhtml('after_body_start') ?> <div class="wrapper"> <?php echo $this->getchildhtml('global_notices') ?> <div class="page"> <?php echo $this->getchildhtml('header') ?> <div class="main-container col3-layout"> <div class="main"> ...

How to target specific div from another page using jquery? -

so common question guess , got same answers other thread(s) when tried apply answer it's not working in case. want target specific div page using jquery. here code: $('a[href^="#"]').on('click', function (e) { e.preventdefault(); var target = this.hash; var t = $(this.hash).offset().top; $('html, body').stop().animate({ scrolltop: t, }, 1000, function () { window.location.hash = target; }); }); so example have menu like: <ul class="nav navbar-nav"> <li class="active dropdown"> <a class="border menu_link_3" href="jewellery">jewellery </a> <ul class="dropdown-menu"> <li><a href="#kalis-pearls">kalis pearls</a></li> <li><a href="#mariana">mariana</a></li...

android - Google App Engine Module Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > java.io.IOException: Failed to delete -

trying compile android app google app engine module darn thing won't work. working before reason after cleared android studio cache , restarted, stopped compiling. here error get: error:execution failed task ':app:transformclasseswithdexfordebug'. > java.io.ioexception: failed delete /users/me/androidstudioprojects/mycoolapp/app/build/intermediates/pre-dexed/debug/appengine-api-1.0-sdk-1.9.18_0179742441e08a2aeb8477eb85038e2130d180e7.jar i checked folder , above file not exist - why try delete it? i tried putting in dummy file above name hoping might work did not. here gradle files like: app apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion "23.0.2" defaultconfig { applicationid "com.me.mycoolapp" minsdkversion 13 targetsdkversion 23 versioncode 1 versionname "1.0" } buildtypes { release { minifyenab...

android - Change font typeface of ProgressDialog within DialogFragment -

may know possible change font typeface of progressdialog 's message display, within dialogfragment ? public class loadfromcloudtaskfragment extends dialogfragment { @override public dialog oncreatedialog(bundle savedinstancestate) { this.progressdialog = new progressdialog(this.getactivity()); this.progressdialog.setmessage(progressmessage); this.progressdialog.setcanceledontouchoutside(false); return progressdialog; } create custom class inheriting progressdialog might 1 of ways. however, wish know there better alternative? sadly, not have progressdialog.builder . one of alternative had tried is @override public dialog oncreatedialog(bundle savedinstancestate) { this.progressdialog = new progressdialog(this.getactivity()); this.progressdialog.setmessage(progressmessage); this.progressdialog.setcanceledontouchoutside(false); utils.setcustomfont(this.progressdialog.findviewbyid(android.r.id.message), utils.r...

localhost - Adding external source in /etc/hosts linux -

as know add external source file our ~/.bashrc file. example have list of custom aliases included inside it. add inside file: source /path/to/my/external/file or replace 'source' dot (.) so: . /path/to/my/external/file then can access custom aliases without manually typing inside ~/.bashrc file. my question is: i wondering there similar way include external source file inside /etc/hosts file? i've tried same method above, doesn't seem work. thanks , cmiiw. there no way include external source file/s inside /etc/hosts unlike how it's done ~/.bashrc or other systems on linux.

javascript - Why is Restangular sending 2 requests for each resource? -

i restangular send 1 request keeps making two. in addition if i'm sending request params send undefined first request define second. im doing seen below, causing this? .service('somestuffservice', function ( $q, _,restangular,$localstorage){ return { getsomestuffs: function() { var dfd = $q.defer(); settimeout(function() { restangular.one('stuff').get().then(function(stuffobj) { $localstorage.stuff =stuffobj.stuff; dfd.resolve(stuffobj.stuff); },2000) }); return dfd.promise; } } }) resolve before state loads .state('app.stuff-state', { url: '/stuff', ..... resolve: { regions: function($stateparams,somestuffservice) { return somestuffservice.getsomestuffs(); } } in controller $scope.stuff = $localstorage.stuff||somestuffservice.getsomestuffs()

I got an android project written in scala - How can i open and work with this project in eclipse? -

this question has answer here: scala, android , eclipse 4 answers i got android project written in scala. how can open , work project in eclipse? plugins need? scala compiler need? want build signed apk of project. check these guys. powerpoint , video links provided in website. http://www.swiftkey.net/en/blog/test-driven-development-on-android-using-native-scala-mocking-and-dependency-injection/ use ant or sbt compile:- (sbt plugin link) https://github.com/jberkel/android-plugin more links:- http://days2011.scala-lang.org/node/138/291 also read issues scala v-2.9:- https://groups.google.com/forum/?fromgroups#!topic/scala-debate/el3qzebiwhg misc:- can try methodology - install ubuntu on device (as described here:- http://androlinux.com/android-ubuntu-development/how-to-install-ubuntu-on-android/ ). not affect android installation. boot ubuntu, in...

jquery - How to align icons and labels in an accordion using Twitter Bootstrap -

Image
i using twitter bootstrap , having hard time aligning icons labels when inside accordion. what have achieved far supplied below, wanted 3 icons on left equal spacing , label on right. also, want change first icon (icon-chevron-down) (icon-chevron-up) when collapseone shown. here demo html: <div class="accordion" id="accordion2"> <div class="accordion-group"> <div class="accordion-heading"> <table> <tr> <td> <div class="clearfix"></div> </td> <td> <label title="link ![enter image description here][2]1">link1</label> </td> <td> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapseone">...

jquery - How to append dynamic dropdownlist as raw html? -

i have make 2 dropdownlist dynamically , appened them table table consists of 17 columns , first 2 tds dropdownlist this code atm: $(document).on('click', 'input[type="button"].addrowreceiving', function () { //get current row count $size = $('table#receivingdetail > tbody > tr').size(); $visible = $('table#receivingdetail > tbody > tr:visible').size(); if ($visible <= 4) { $contacttable = $('table#receivingdetail tbody'); var item = $('<select name="itemsassoc['+ $size +'].f_itemno/>'); var location = $('<select name="itemsassoc[' + $size + '].f_locationid/>'); $.getjson('@url.action("getitemsandwarehouse")', {}, function (e) { $.each(e.warehouses, function (index, val) { $('<option />', { value: val.f...