Posts

Showing posts from June, 2015

php - NGINX select a subfolder under the root dynamically -

i need nginx select subfolder under root folder dynamically every request based on first segment of path in url, returning 404 if subfolder doesn't exist. should made without using multiple locations. for example, directory structure on server: /services/a /services/b the url http://server/ a /app.php call app.php under /services/a directory. the url http://server/ b /app.php call app.php under /services/b directory. here standard nginx config symfony need modify: server { server_name _; root /services; location / { try_files $uri /${nginx_entry_point}$is_args$args; } location ~ ^/(app_dev|config)\.php(/|$) { fastcgi_pass app:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param script_filename $realpath_root$fastcgi_script_name; fastcgi_param document_root $realpath_root; } location ~ ^/app\.php(/|$) { fastcgi_pass app:9000; fastcgi_spli...

Unable to import Dynamics CRM 2013 Custom Code Validation Tool -

i tried updating crm 2011 ru17 , tried re-import managed solution no luck. progress bar doesn't show anything. ran following query in sql verify further, no luck. please help! select solutionname, progress, startedon, completedon importjob(nolock) order startedon desc

java - Add item on RecycleView Android -

i'm trying add item on recycleview this: i have object called image public class image{ public string name; public string url; } when click on button add new item, code this: @override public void additemonlist(string url) { adapter.additem(new imageobject("aaaaaa", r.drawable.close_button)); } that method inserts on list. public void additem(imageobject imageobject) { itemlist.add(imageobject); notifydatasetchanged(); } my problem when click first time in additem onbindviewholder doesn't iterate list when check in debug mod getitemcount correct! if try add item after first time work well. mainactivity public class mainactivity extends appcompatactivity implements recyclerviewclicklistener, onstartdraglistener { private recyclerviewadapter adapter; private arraylist<imageobject> listviewitems; private recyclerview recyclerview; private itemtouchhelper itemtouchhelper; @overr...

ios - Cannot show image converted in base64 -

i'm trying put base64 string image view i've tried in many ways not working, i'm doing first encode string base64, after i'm trying assign base64 in image when block of code finish line of code qrcodeimageview.image = image returns me nil, have idea of i'm doing wrong. in advance class qrcodeviewcontroller: uiviewcontroller { @iboutlet weak var qrcodeimageview: uiimageview! var qrcodeconverted: string? override func viewdidload() { super.viewdidload() print("qrcode", apimanager.sharedinstance.bas64 ?? "") let longstring = apimanager.sharedinstance.qrcodee let data = (longstring)?.data(using: string.encoding.utf8) let base64 = data!.base64encodedstring(options: nsdata.base64encodingoptions(rawvalue: 0)) print("base64 ", base64) if let decodeddata = data(base64encoded: base64, options: .ignoreunknowncharacters) { let image = uiimage(data: decodeddata) qrcodeimageview.image = ...

r - Showing actual units on a logarithmic scale -

Image
i have data on high resolution time scale plotting using logarithmic (log 10) scale, show actual time units on along x axis, rather "log 10 (time)". here's data time ft 0.01 229 0.02 231 0.03 232 0.04 234 0.05 236 0.06 238 0.07 239 0.08 239 0.09 239 0.1 239 0.11 240 0.12 241 0.13 243 0.14 245 0.15 247 0.16 249 0.17 251 0.18 253 0.19 254 0.2 256 0.21 258 0.22 260 0.23 261 0.24 262 0.25 263 0.26 263 0.27 263 0.28 263 0.29 265 0.3 265 0.4 274 0.5 280 0.6 286 0.7 292 0.8 298 0.9 305 1 312 1.1 316 1.2 320 1.3 323 1.4 327 1.5 331 1.6 336 1.7 341 1.8 344 1.9 347 2 350 2.1 353 2.2 356 2.3 360 2.4 363 2.5 366 2.6 368 2.7 371 2.8 374 2.9 378 3 381 4 400 5 415 6 429 7 442 8 455 9 467 10 479 11 491 12 504 13 516 14...

java - AbstractTableModel with ArrayList and CheckBoxes has setValueAt error -

i receive java.lang.indexoutofboundsexception: invalid range error abstracttablemodel setting display contents of arraylist. think has auto sorting table. how fix setautorowsorter()? i have class 'account' holds arraylist of class 'client'. the client class contains information displayed on table: the table created drag-and-drop. create quick account , client here , make short list table: package presentation; import domain.account; import domain.client; public class clienttable extends javax.swing.jframe { private account account = null; private clientabstracttablemodel model = new clientabstracttablemodel(); private int selectedrow = -1; public void setaccount(account account) { this.account = account; model.setclients(account.getclientlist()); } public clienttable() { initcomponents(); mytable.setmodel(model); mytable.setautocreaterowsorter(true); } /** * method calle...

windows - How to add char directly after (cin) in c++ -

i trying add percent sign directly after users input (so user doesn't have type percent symbol). when try this, either goes next line or doesn't work @ all. what want: _% // blank user's input. sorry if messy, i'm not sure how add c++ here. here things have attempted: // used percent variable: const char percent = '%'; cout << "enter tax rate: " << percent; // here percent symbol goes before number. double taxrate = 0.0; cin >> taxrate >> percent; // here tried adding cin after cin. cin >> taxrate >> '%'; // here tried adding char itself, yet failed attempt... so, possible wanting? it possible, iostream not provide proper interface perform it. typically achieving greater control on console io requires use of platform-specific functions. on windows vs done _getch this: #include <iostream> #include <string> #include <conio.h> #include <iso646.h> int ma...

c++ - create a native android library using maven build -

i tried create shared library using maven-cmake plugin example . i'm able library based on architecture of device built(mac- dylib /linux- so ) how can generate library compatible android devices(specifically armeabi-v7a). library build packed jar how can unpack , include shared library in apk during application build.

jgraph - Tooltip position in mxGraph is way off when graph is contained in a div -

i'm using base example of mxgraph can found here: grapheditor start. in example above, tooltips open right of icons left sidebar. example, shapes, lines, etc. i have graph contained in div, smaller area on page... tooltips floating way off left if thing full screen still. i'm not sure of how share additional details hoping tagging mxgraph of have experience working may have run same issue.

sql - using parameters with max len and check for null vall -

i'm trying count column see max characters. i'm getting warning, know doesn't effect, it's more of annoyance , eliminate warning. example follows: declare @countthis varchar (255) select @counthis = max(len(col1)) #temp print '------- largest count column-----' + @countthis the warning receive is: warning: null value eliminated aggregate or other set operation. i tried using case statement couldn't figure out. if value null ignore value. is possible? you can use declare @countthis varchar (255) select @counthis = max(len(isnull(col1,''))) #temp

autocad - Why can't I undefine naviswheel? -

i tried undefined naviswheel code below, doesn't work (command ".undefine" "naviswheel") you have typo in command. should be: (command ".undefine" "navswheel")

python - Django - access class attributes of a class-based view in middleware -

i have couple of views , each of them must accesed no more 1 user @ time. therefore use locking service this. idea follows: - declare each view this class dummyview(view): lock = lock() def dispatch(self, request, *args, **kwargs): ... - in middleware, this class middleware: ... def __call__(self, request): # lock = view.get_lock_if_it_has_one (this need with) lock.acquire() response = self.get_response(request) lock.release() return response how can access lock attribute of view described? unsure if can access view inside middleware, suggesting more simple , easy implement / understand. simply create model lock have fields view_name (char field), user (foreign key) & is_acquired (bool). then, when want lock view given request.user (check anonymous users), instantiate lock model user & view_name , .acquire() changes is_acquired true (and saves). and when want check if lock has ...

How to merge powershell scripts to get disk used space, disk free space, cpu utilization and memory utilization in one csv file? -

i have separate code disk space details, how can merge these 2 program disk usage, disk free space , cpu utilization output in 1 csv file. get-wmiobject -class win32_logicaldisk -computername "phatuggikadabba" | where-object {$_.drivetype -eq 3} | select-object deviceid, description,` @{"label"="disksize(gb)";"expression"={"{0:n}" -f ($_.size/1gb) -as [float]}}, ` @{"label"="freespace(gb)";"expression"={"{0:n}" -f ($_.freespace/1gb) -as [float]}} | export-csv 'd:\code\diskspaceusage .csv' -notype i have 1 more file written in powershell gives cpu utilization, memory usage , users gc d:\serverlist.txt | % { $comp = $_ if (test-connection $comp -quiet){ $luser = (get-wmiobject -class win32_process -filter "name='explorer.exe'" -computername $comp | % {$_.getowner().user} | sort-object -unique) -join "," $mem = gwmi -class win32_opera...

ibm midrange - Boolean order of operation in RPGLE -

why below code result in true if type = 7 , seq = 224? rpgle free form: if (type = 6 or type = 7 or type = 9) , not (seq = 224 or seq=249); i had rewrite to: if (type = 6 or type = 7 or type = 9) , seq <> 224 , seq <> 249; but why? guessing has not operator. well, not has higher precedence and or or rpg iv reference manual operator precedence () built-in functions, user-defined functions unary +, unary -, not ** *, / binary +, binary - =, <>, >, >=, <, <= and or however, expression show should evaluate false... **free dcl-s flag ind; dcl-s seq int(5) inz(224); dcl-s type int(5) inz(7); flag = (type = 6 or type = 7 or type = 9) , not (seq = 224 or seq=249); dsply ('flag=' + flag); *inlr = *on; return; joblog shows: dsply fl...

javascript - How to flatten file structure of published NPM module -

i have typescript project publishing npm module. output of compiling project in directory {mymodule}/dist/src/... means when publish, npm module takes above file structure. the drawback when individual modules needs required, this: var individualmodule = require('/dist/src'); i flatten output of published module, files in published module {mymodule}/... instead of {mymodule}/dist/src/... in opinion correct way of doing intentionally expose modules package via module.exports (or import/export ) in root file. const exposableone = require('/dist/src/ex-1.js'); const exposabletwo = require('/dist/src/ex-2.js'); // ... module.exports = { mymodule, exposableone, exposabletwo }; you can take @ main express framework file - doing same thing using exports. directive. not typescript stuff idea quite common. update: if need without binding via require/exports , use symlinks approach. i'm not sure option works on platforms, example ca...

validation - Symfony Validator modify form fields -

i have validator looks this: class validuspsaddressvalidator extends constraintvalidator { public function validate($protocol, constraint $constraint) { $verify = new uspsaddressverify('*******'); $uspsaddress = new uspsaddress(); $apartment = $protocol->getapartment(); $address = $protocol->getaddress(); $city = $protocol->getcity(); $state = $protocol->getstate(); $zip = $protocol->getzip(); $uspsaddress->setapt($apartment); $uspsaddress->setaddress($address); $uspsaddress->setcity($city); $uspsaddress->setstate($state); $uspsaddress->setzip5($zip); $uspsaddress->setzip4(''); $verify->addaddress($uspsaddress); $verify->verify(); $response = $verify->getarrayresponse(); $responseaddress = $respo...

How to properly use user registration in ServiceStack -

i new servicestack , having problems understanding user registration stuff. our goal to: allow user create new account verify if user name and/or email in use automatically log user in after registering return jwt token response i using registerservice located here of our user registration logic. the problem seems after user registers other user can register same user name and/or email , updates previous users data. have noticed when restart api line: registrationvalidator?.validateandthrow(request, registernewuser ? applyto.post : applyto.put); will throw error if user name or email exists. however, explained once new user registers, user right after them can use exact same info , updates user before it. not desired result. why validation seem work if restart api, not while running? as step through code have noticed this.getsession() seems return new session set null when api first started, once user logs in or registers getsessions() returns recent user sessio...

documentation - Sandcastle: Any way to show inherited members without showing base class? -

given derived class (using c#): public class baseclass { public void amethod() {} } public class derivedclass : baseclass { } and running sandcastle documentation project in baseclass hidden (sandcastle visibility's api filters), is there way document derivedclass members inherited baseclass if declared explicitly? i not want make wrappers: public class baseclass { public void amethod() {} } public class derivedclass : baseclass { new public void amethod() { base.amethod(); } } ^^^ don't want this. these stack overflow entries similar not seek: hide methods inherited object sandcastle-generated documentation? i want show rather hide. how should document inherited members? the application eschews, explicitly, interfaces or contracts because of legacy issue microsoft visual studio 2012. thanks!

gdi - c# Drawing with gdi32.dll vs System.Drawing.Graphics -

Image
so have code creates highlight effect on top of picture box gdi32.dll , wondering if there simpler way system.drawing.graphics ? gdi32.dll, have capture screen shot after drawing, post picturebox , able draw more stuff , change color of pen use. if try change pen thickness , color , draw on screen again, if changes drew. now have version of uses system.drawing.graphics , lots of math fillpolygon if draw on area drew on, makes area drew on darker. not gdi32.dll justr shades long have not shaded area mouse. suggestions? public partial class form9 : form { private bool is_mouse_down { get; set; } // check if mouse down or not. private color pen_color = new color(); private int pen_type { get; set; } private int thickness { get; set; } private bool start { get; set; } list<point> points = new list<point>(); public form9() { initializecomponent(); picturebox1.dock = dockstyle.fill; pen_color = color.blue; ...

doctrine2 - Doctrine 2: Cannot select entity through identification variables without choosing at least one root entity alias -

rather actual question, sticky note myself, may others. there many other similar questions: 1 , 2 , 3 , 4 , 5 , 6 , none of them seems offer solution. i have following entities: class order { // ... /** * @manytoone(targetentity="customer") * @var customer */ private $customer; /** * @column(type="integer") * @var int */ private $amount; } class customer { // ... } order has unidirectional, many-to-one relationship customer . want every customer, along total amount of orders, run following dql query: select c, sum(o.amount) model\order o join o.customer c group c but following error: [doctrine\orm\query\queryexception] [semantical error] line 0, col -1 near 'select c, sum(o.amount)': error: cannot select entity through identification variables without choosing @ least 1 root entity alias. how can fix it? this known doctrine limitation. the solution explicitly sele...

python - Getting polygon shapes for only specific zipcodes -

i have .csv file zip codes, latitude , longitude. specific areas of interest few metropolitan statistical areas (msas). have obtained shapefile zipcodes in usa census bureau website ( https://www.census.gov/geo/maps-data/data/cbf/cbf_zcta.html ). i want shapes list of zipcodes have , want group them msa. there way pull out shapes master zipcode file census zips in .csv file? tried using unionspatialpolygons in r not so. want .shp or .geojson or .topojson file output , plot polygons msas in country map. r or python preferred. not familiar arcgis. thanks in advance!

docker - Huge performance difference with Iperf between - with and without VPN Tunnel -

i running performance measures between different network settings using iperf . see drastic differences between 2 basic setups. two containers (docker) connected each other via default docker0 bridge interface in host. two containers connected via vpntunnel interface internally connected via above docker0 bridge. iperf calculation both scenarios 10sec **scenario 1 (1)** client connecting 172.17.0.4, tcp port 5001 tcp window size: 1.12 mbyte (default) ------------------------------------------------------------ [ 3] local 172.17.0.2 port 50728 connected 172.17.0.4 port 5001 [ id] interval transfer bandwidth [ 3] 0.0- 1.0 sec 3.26 gbytes 28.0 gbits/sec [ 3] 1.0- 2.0 sec 3.67 gbytes 31.5 gbits/sec [ 3] 2.0- 3.0 sec 3.70 gbytes 31.8 gbits/sec [ 3] 3.0- 4.0 sec 3.93 gbytes 33.7 gbits/sec [ 3] 4.0- 5.0 sec 3.34 gbytes 28.7 gbits/sec [ 3] 5.0- 6.0 sec 3.44 gbytes 29.6 gbits/sec [ 3] 6.0- 7.0 sec 3.55 gbytes 30.5 gbits/sec [ 3] 7.0-...

ubuntu - how to solve Connection time out in postfix? -

when test- email test on redmine using postfix email sent after time means take time. mail.log file looks this- sep 13 21:45:40 ip-172-31-4-245 postfix/cleanup[14595]: af5c427246a: message-id=<59b9a704ab28b_374a74115c11494@ip-172-31-4-245.mail> sep 13 21:45:40 ip-172-31-4-245 postfix/qmgr[13997]: af5c427246a: from=<redmine@example.net>, size=2103, nrcpt=1 (queue active) sep 13 21:46:10 ip-172-31-4-245 postfix/smtp[14549]: connect gmail-smtp-in.l.google.com[74.125.200.26]:25: connection timed out and try many different way solve problem error still not solve. and redmine configuration file likes this- default: email_delivery: delivery_method: :sendmail and etc/postfix/main.cf file this- myhostname = ip-172-31-4-245.ap-south-1.compute.internal alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = $myhostname, localhost.ap-south-1.compute.internal, localhost relayhost = mynetworks = 127.0.0.0/8 [::ffff...

javascript - window.close() not working when button is pressed but works when added to console(developer tools) -

i have simple script activated when button on window opened script clicked (meaning, page in current code exists opened window.open in page): var botoncerrar = document.getelementbyid('cerrar'); botoncerrar.addeventlistener('click', function(){ open(location, '_self').close(); }, false); the thing is, not work, "refreshes" window. but when add command in console inside developer tools: open(location, '_self').close(); it works. idea why?

html - Rails: Form_for: No route matches {:action=>"show", :controller=>"posts"} missing required keys: [:id] -

i new ror , trying build simple blog, got stuck @ "adding post" function. the following error message pops when load .../posts/new : no route matches {:action=>"show", :controller=>"posts"} missing required keys: [:id] here posts controller looks this: class postscontroller < applicationcontroller def index end def new end def create render plain: params[:post].inspect end end here new.html.erb looks this: <h1>add post</h1> <%= form_for :post, url: posts_path |f| %> <p> <%= f.label :title %><br> <%= f.text_field :title %> </p> <p> <%= f.label :body %><br> <%= f.text_area :body %> </p> <p> <%= f.submit %> </p> <% end %> i had set posts resource in routes. surprising thing is, on friend's laptop, code works. i happy advice, , apologize silly question. the form_for helper looking res...

angularjs - ngSanitize does not seem to be removing harmful tags -

i have written code below clean html before sending server, /** * takes html input */ function _cleanhtml(html) { var newhtml = html; try { newhtml = $sanitize(html); } catch (error) { // exceptions } return newhtml; } the returned string still has script tags , tags <img src=x onerror=alert()> . why not removing these tags?

php - How to automatically fill a template webpage with information? -

i looking initial direction on 1 because cannot seem find way it. let me explain... user enters title of song in the search bar search results filtered instant search. form, in index page: <script type = "text/javascript "src = "jquery.js"> <form class="navbar-form navbar-left" > <div class="form-group"> <input type="text" class="form-control" id="search" placeholder="search songs, artists" autocomplete="off"> <div id = "searchresults"> </div> <script type="text/javascript" src = "search.js"></script> </div> </form> search.js file has 2 tasks; check if result has been clicked , if user has pressed key. this: $('#search').keyup(function() { var searchterm = $ ('#search').val(); if (searchterm != ''){ $.post(...

ssh - How to use git remote add to push to an other computer? -

i'm trying push code remote server created new remote: git remote add server ssh://nic@somehost.com/home/nic/workplace/project i confirmed way supposed using: git remote -v i proceed try push error: [nic:15:48@project/]%git push -u server --all nic@somehost.com's password: zsh:1: command not found: git-receive-pack fatal: not read remote repository. please make sure have correct access rights , repository exists. zsh: exit 128 git push -u server --all i can ssh fine host using ssh nic@somehost.com , can navigate folder , create file there permissions correct. i've googled few hours , can't find what's wrong. maybe git hacker see stupid mistake in second :) i've tried various format remote address doesn't make difference. thank help. nicolas.

c - Issues with an example of memory leak -

this question has answer here: return address of local variable in c 5 answers this line of code below example of potential memory leak have been going on in class. i cannot follow code logically output. when go through line line think output should "sucess!! val1 -> 10, val2 -> 10" actual output when run code "abort system - error!! val1 -> 10, val2 -> 108" . it appears when foo2 gets called second time overwrites first element in array value of 100. i guess not understanding how int x in foo1 linked array int x[10] in foo2 . shouldn't these not linked each other since both locally declared? #include <stdio.h> #include <stdlib.h> int* foo1(int a, int b) { int *ptr, x; ptr = &x; x = * b; return ptr; } int foo2(int a, int b) { int i, c, x[10]; (i=0; < 10; i++) x[i] = 100; ...

javascript - Event binding on dynamically created elements? -

i have bit of code looping through select boxes on page , binding .hover event them bit of twiddling width on mouse on/off . this happens on page ready , works fine. the problem have select boxes add via ajax or dom after initial loop won't have event bound. i have found plugin ( jquery live query plugin ), before add 5k pages plugin, want see if knows way this, either jquery directly or option. as of jquery 1.7 should use jquery.fn.on : $(staticancestors).on(eventname, dynamicchild, function() {}); prior this , recommended approach use live() : $(selector).live( eventname, function(){} ); however, live() deprecated in 1.7 in favour of on() , , removed in 1.9. live() signature: $(selector).live( eventname, function(){} ); ... can replaced following on() signature: $(document).on( eventname, selector, function(){} ); for example, if page dynamically creating elements class name dosomething bind event parent exists, document . $(document...

java - Can someone explain what the output will be? -

int oc = 0; int num = stdin.readint(); (int = 1; < num; i++) { int val = stdin.readint(); if ( val % 2 != 0) oc++; else stdout.println(val); } stdout.println( " tally " + oc); which 1 of input sets below result in 4 lines of output? 5 3 6 8 9 7 8 9 4 2 4 5 6 7 8 9 4 5 6 4 2 3 9 8 7 5 1 6 9 8 5 3 4 13 12 option a: 5 3 6 8 9 7 8 9 because code checking if number print otherwise increase counter oc . code printing 1 line @ end every time, need check 3 numbers in option, because need output in 4 lines. hence option satisfies condition.

Xcode and Swift: change order of suggestion when coding -

i'm new swift language , using xcode too. how change order of code suggestion when programming? for example, when type int , xcode giving me these suggestions: intmax_t int internal ... i think advantage have int first suggestion. there way have issue fixed? i tried typing bunch of time int , select "int" option, see if xcode orders suggestion used, keeps giving me same.

python - Matplotlib: Labels on projection plot grid lines similar to clabel() -

Image
i'm doing bunch of work various spherical projection plots using astropy wcs package, , have run frustrations concerning grid lines. grid lines not intersect image bounding box or multiple intersect @ same place, can go unlabeled or have labels rendered illegible. able insert grid line labels in each line, akin matplotlib.pyplot.clabel() function applied contour plots, in matplotlib example . can't embed image new user; apologies. i know can place labels using text(), figtext(), or annotate(), since clabel() works figure functionality exists, if hasn't been applied grid lines. projection plotting aside, know way in-line grid line labels akin clabel() can applied grid lines on plain rectangular plot? to annotate gridlines, may use positions of major ticks (as positions @ gridlines created). import matplotlib.pyplot plt import numpy np x = np.linspace(0,10) y = np.sin(x)*10 fig, ax = plt.subplots() ax.plot(x,y) ax.grid() xi in ax.xaxis.get_majorticklocs()...

java - Jackson optional field empty() vs null -

i'm trying use optional in pojo indicate when json field can null, absent, or present. issue cannot figure out how configure jackson not treat optional.empty() , null same. empty() , want field ignored. none of jsoninclude values seem this. jdk8module#configureabsentsasnulls() looked promising, doesn't change results of tests. there way this? tl;dr null values should serialized, optional.empty() should not serialized. here tests exhibiting behavior i'm trying achieve. class pojo { public optional<string> content; } private objectmapper getmapper() { return new objectmapper().registermodule(new jdk8module()); } @org.junit.test public void testabsent() throws jsonprocessingexception { objectmapper mapper = getmapper(); pojo pojo = new pojo(); pojo.content = optional.empty(); string result = mapper.writevalueasstring(pojo); assertequals("{}", result); } @org.junit.test public void testnull() throws jsonprocessi...

machine learning - Training on MNIST, detecting sequences of numbers? -

after you've trained model on mnist set, how can classify image having 2 digits? more generally, how train model detect number of digits on image? there hot field called "object detection" tries want. in general, can detect (digits, people, cars, etc) images , videos. the state-of-the-art techniques fall 2 categories: faster-rcnn , first proposes lot of candidate windows objects of interest , detects inside these windows. ssd , scans images once , detect objects, faster not reliable compared faster-rcnn. a well-known real-time object detection method yolo (you once), falls in ssd category, , has impressive real-time demo here , give sense of object detection. search these methods' names , find lot of example code satisfies needs. if looking digit detection, check out work surrounding stanford's house number dataset . however, note these works 5 , more years ago , not beat general methods faster-rcnn , ssd.

php - Setting file permissions on a web server -

need bit of clarification on this. i have folder in web server contain sensitive information no 1 should able read. script this: makes folder 0777 permission , places image in folder i have second script this: pulls image specific folder, , shows user however, right if user knew exact name of parent folder, can type in browser , see images contained in folder, like: www.testsite/test/images what file permission can use instead of 0777, allow these 2 scripst write in , read in folder, without allowing view contents of folder when typing in browser? if understand problem correctly, you're worried user typing in /test/images/ url bar, , seeing directory listing containing secret file. setting chmod of 000 mean neither of scripts (nor you) able access folder. in opinion, you'd far better off using .htaccess deny all . make cannot 'open' file in folder, though can still include them in php. alternatively, may opt creating index.php in /i...

r - Categories, tags, and search? -

i created first blogdown site using blogdown::new_site() . can explain me how use categories , tags options? can filter articles categories or tags using default template? can add search function default template? if not, s simple template includes functionality?

javascript - ng-table Run Function When Paging Button Is Clicked -

Image
i have responsive ng-table in mobile view gets horizontal scrollbar on of data. looks this: right now, when have scrolled part of table , press next page button, scroll bar doesn't reset. there way run scrolleft(0) function when paging button clicked, or css?

Maven https errors with RAD/Eclipse -

rad 9.6.1 (java 8) on windows maven current culprit, i'm betting eclipse-wide/java-wide. rad errors showing this, on project , pom.xml: failed read artifact descriptor com.itextpdf:itext-licensekey:jar:2.0.3 org.eclipse.aether.resolution.artifactdescriptorexception: failed read artifact descriptor com.itextpdf:itext-licensekey:jar:2.0.3 @ org.apache.maven.repository.internal.defaultartifactdescriptorreader.loadpom(defaultartifactdescriptorreader.java:302) @ org.apache.maven.repository.internal.defaultartifactdescriptorreader.readartifactdescriptor(defaultartifactdescriptorreader.java:218) @ org.eclipse.aether.internal.impl.defaultdependencycollector.resolvecachedartifactdescriptor(defaultdependencycollector.java:535) @ org.eclipse.aether.internal.impl.defaultdependencycollector.getartifactdescriptorresult(defaultdependencycollector.java:519) @ org.eclipse.aether.internal.impl.defaultdependencycollector.processdependency(defaultdepende...

ios - How to update a slider on a bunch of table cells continuously? -

the first method tried caused error due disrupting layout, here issue: in have tableview cells have sliders/progress views. value on these sliders needs equal attached item (i assign rss items each cell, music)'s percent has downloaded, if user tapped download it. i calling func in observer download progress here: //download progress func urlsession(_ session: urlsession, downloadtask: urlsessiondownloadtask, didwritedata byteswritten: int64, totalbyteswritten: int64, totalbytesexpectedtowrite: int64) { let progress = double(totalbyteswritten) / double(totalbytesexpectedtowrite) print("\(downloadtask.originalrequest!.url!.absolutestring) \(progress)") updatelistcells() } here how try update cells user see progress bar gradually growing - have subclassed cells: func updatelistcells() { if let table = listvc.mytableview { if(!table.visiblecells.isempty) { v in table.visiblecells { l...

seq - Creating a repeating vector sequence in R -

this question has answer here: r: generate repeating sequence based on vector 1 answer i need help. how create following vector sequence: 1 1 1 1 2 2 2 3 3 4 i tried use (rep) , (seq) still unsucessfull. try this: rep(1:4,4:1) output: [1] 1 1 1 1 2 2 2 3 3 4

algorithm - Why Master theorem cannot be applied -

doing assignment , stuck on few questions. t(n) = t(2n/5)+n t(n) = t(2n/3)+t(n/3)+n t(n) = t(n−2)+n something tells me on of them master theorem cannot applied. why? , upper bounds (big-oh)? the master theorem can applied recurrence of form t(n) = at(n / b) + o(n d ) where a, b, , d constants. (there other formulations, above 1 handles more common cases). specifically, means that the problem size must shrink constant factor, the subproblems must have same size, there must constant number of subproblems, and the additive term must polynomial. these criteria rule out second recurrence (the subproblems don't have same sizes) , third (the problem size must shrink constant factor). however, first recurrence satisfies 4 of these criteria. might rewrite recurrence as t(n) = t(n / (5/2)) + n. based on that, case of master theorem in, , recurrence solve to?