Posts

Showing posts from August, 2014

security - Protect API from being shared -

our company provides data through paid api our customers. we issuing them api key allowing ips whitelisted call api. this has been working great far can't think customers end sharing our data other customers without paying it. we've been trying fix issue , think outside box without results. anyone has idea how remedy problem? thank you any appreciated! if mean sharing content have downloaded via api, might out of luck; non-trivially difficult distinguish between legitimate (viewing only) vs. illegitimate (downloading/stealing) api access. once they've downloaded it, there's not can keep them sharing it. watermarks or metadata tagging might find if re-hosted somewhere online, there no way tell if user sharing data offline short of installing spyware on computer. this might problem legal team, rather development team.

android - Can we click images with camera preview overlay? -

i have overlay in camera preview. want clicked images saved overlay. possible? below code use overlay image on top of camera preview surface holder. hope helps someone. ok got solution. code: package com.sailabs.photo; import android.annotation.targetapi; import android.app.activity; import android.content.context; import android.content.res.configuration; import android.graphics.bitmap; import android.graphics.bitmapfactory; import android.graphics.canvas; import android.graphics.pixelformat; import android.graphics.drawable.drawable; import android.hardware.camera; import android.hardware.camera.picturecallback; import android.hardware.camera.shuttercallback; import android.os.build; import android.os.bundle; import android.os.environment; import android.util.log; import android.view.surfaceholder; import android.view.surfaceview; import android.view.view; import android.view.view.onclicklistener; import android.view.window; import android.view.windowmanager; impor

c++ - initializer list and conversion to everything, construction order -

situation like: #include <utility> #include <typeinfo> #include <iostream> struct c1 { char const* str; template <typename t> operator t() const { std::cout << "convert " << typeid(t).name() << "\n"; return {}; } }; struct c2 { c2(c1 const&) { std::cout << "c2(c1)\n"; } c2(std::initializer_list<std::pair<char const*, int>>) { std::cout << "c2(list)\n"; } }; int main() { c1 c1{}; c2 c2{c1}; } output indicates c2(list) being called. i c2(c1) called c1 argument, need parameters of std::initializer list remain deducible , convertible, , can not replace variadic-templated version. want control construction order, here //2 not template. suppose type std::pair can deserialized in normal conditions. c++14 may used the following selects c2(c1) style both style, {...} , ({...}) (in strict c++11 standards, ({...}) style, select second

unix - Extract key value pairs from a tuple in Pig -

i have file data below: {"password_match_rate":"0.00","password_match_count":0,"password_invalidate_success_count":0,"notes":"dfh"} in pig script want dump data below: password_match_rate,0.00 password_match_count,0 password_invalidate_success_count,0 notes,dfh can provide on this? this split input. can try this? a = load 'file' using textloader() (line:chararray); f = foreach generate replace(line,'"','') (line1:chararray); f1 = foreach f generate flatten(tokenize(line1)) (line2:chararray); f2 = foreach f1 generate replace(line2,':',',');

javascript - Parsing JSON object -

how can parse 2 json objects? e.g ajax return just one object appear's correctly. object {32 : "joseph"} but, when return more 2 objects, i've got this: responsetext: "{"users":{"32":"jospeh"}}{"users":{"48":"jospeh k."}}" i tried parse json.parse returns error: "uncaught syntaxerror: unexpected token {" so, how can parse return this:? object {32 : "joseph"} object {48 : "joseph k"} instead of "responsetext" considerations: if returns 1 object, appears correctly in console(example); if returns more 2 objects, appears responsetext; ajax datatype: json i'll grateful if can this. =d php: public function get_error_message() { $message = ""; foreach ($this->errors $value) { if ($value instanceof userserror) { $message.= json_encode(array('errors' => array($value->

javascript - Parse.View.extend - "cannot read property 'extend' of undefined" -

currently using parse javascript sdk web app, i'm new backbone, , since particular problem in functionality parse copied on backbone, i'm not sure i'm making mistake. i have index.html , basic structure & script template tag (to used _underscore): <div id="my-app"> </div> <script type="text/template" id="album-header-template"> <div id="some-id"> content </div> </script> at end of <body> , following script tags, take care of parse dependencies, load parse, & use own js file: <script src="libraries/node_modules/jquery/dist/jquery.min.js"></script> <script src="libraries/node_modules/underscore/underscore-min.js"></script> <script src="libraries/node_modules/parse/dist/parse-latest.min.js"></script> <script src="app/parseapp.js"></script> then in parseapp.js ,

c - In the below program I was expected Infinite loop as a output. But output is 0, please help me with explain the concept behind it -

void main() { int i; int s=0; while(i<30) s+=i; i++; printf("sum %d",s); } / output 0,how? expecting infinite loop. / i uninitialized. can have value. if has value greater/equal 30, loop not execute , s remains 0.

php - Netbeans: Auto Format - Prevent Netbean return multiline variable to 1 line -

i have problem auto format in netbean. i want code these: class( var1, var2, var3, var4 ); but after formating code become: class( var1, var2, var3, var4 ); anyone tell me how stop in netbeans. thanks try formatting->...->wrapping->method call arguments->"always" (or "if long"). but option not perfect, unfortunately -- has quite ugly side effects...

json + jquery ajax populate option -

i must populate option data inside html tag using json, i'm not sure how pass data. the json [{"citta_provincia":"agrigento - aragona","comune":"aragona"},{"citta_provincia":"alessandria - san michele","comune":"san michele"},{"citta_provincia":"ancona","comune":"ancona"}] the html <select class="field-s mandatory" id="dedaler_city" name="dealer_city"> <option selected>scegli...</option> </select> the javascript $cittasel = $('#dedaler_city'); $.ajax({ url: "http://path-to-json.json", datatype: 'html', success: function(data) { var parsa = $.parsejson(data); $.each(parsa, function(key, value) { $cittasel.html("<option value='" + value

php - Correct regex for param after an optional forward slash -

what correct way on php, phalcon framework on how optionally escape forward slash " / " has optional parameter @ end. i want achieve: http://example.com/transactions http://example.com/transactions/ http://example.com/transactions/1 http://example.com/transactions/2 my regex: working, without params :( transactions[/]{0,1} not working, on server logs, it's adding "transactions/2" if url not have it. transactions[/]{0,1}{param} working, explicitly instruct have param @ end. how can have optional " / " forward slash. transactions/{param} appreciate advise. thanks assuming have transactionscontroller indexaction(), try defining 2 routes explained : <?php $router->add( "/transactions/{param}", array( "controller" => "transactions", "action" => "index", ) ); $router->add( "/transactions", array( &q

Change the value after expiration date PHP MYSQL -

i'm beginner in php mysql, have system after register/add customer information change status after 30 days. scenario in add customer page, have forms date start, date expiration , status. date start - automatically set date today expiration - automatically set date start + 30 days expiration2 - automatically set expiration date + 90 days status - status of customer (if newly registered status value fresh if after 30days status change inactive if after 90days change dormant . this code datestart , dateexpired , dateexpired2 don't know how code status process. $datestart= date('y-m-d'); $dateexpired = date('y-m-d', strtotime($datestart. ' + 30 days')); $dateexpired2 = date('y-m-d', strtotime($dateexpired2. ' + 90days')); echo '<input type="text" name= "datestart" value="'. $datestart.'"/>'; echo '<input type="text" name= "dateexpired&quo

Spring + bootstrap + bootstrap tags + typeahead + multiple datasets -

i trying build spring app using bootstrap search input field using bootstrap tags , typeahead multiple datasets. right able single datasets , looks : single dataset input field tags but want have multpile datasets: multiple datasets input field (multiple datasets example typeahead.js/examples/ ) of course want work tags showed single dataset. if use code above example multiple datasets doesn't work. @ moment have working code single dataset tags, code below: hello.jsp <!doctype html> <html> <head> <!-- bootstrap css--> <link rel="stylesheet" href="resources/new/bootstrap-3.3.2/dist/css/bootstrap.min.css"> <!--tags input css--> <link rel="stylesheet" href="resources/new/bootstrap-tagsinput/dist/bootstrap-tagsinput.css"> </head> <body> <div> <input type="text" name="city" id="city" placeholder="c

ios - how to assign 3 different colour to rows in an order and reverse that order -

i designing app using table view. here have assign 3 different colours cell of tableview simultaneously... here comes problem after assigning these colours next row have again assign same colours in reverse order. example have 3 colours sequence in need assign these colours : red - green - blue - blue - green - red - red - green - blue - blue - green - red... , on. here lets don't know how many rows there sequence should go on only... please help!!! declare below array global array : nsmutablearray *colorarray; viewdidload function : colorarray = [[nsmutablearray alloc] initwithobjects:[uicolor redcolor],[uicolor greencolor],[uicolor bluecolor],[uicolor bluecolor], [uicolor greencolor], [uicolor redcolor], nil]; cellforrowatindexpath method : cell.backgroundcolor = [colorarray objectatindex:indexpath.row % 5]; and done :).

php - Deleting symfony2 doctrine memcache on create/update/delete -

i'm using doctrine2 memcache (not memcache d ) in symfony 2.7 application. here configuration: doctrine: orm: metadata_cache_driver: memcache result_cache_driver: memcache query_cache_driver: memcache i'm trying delete respective cache items on entity create/update/delete. memcache doesn't support deletion using prefix, not find easy solution delete cache items of entity on cud operations. let's have property entity, want delete caches related property on property create/update/delete. (i believe deleteall() not idea in case) deleting using namespace workaround , think namespace can set on cache driver , not on particular entity or repository. how possible distinguish namespaces each entity? so, i'm invalidating result cache using onflush event (this way found , article old in 2012. there better recent solution?). 1 drawback of solution define each cache id each query , define of them in service class cacheinvalidator s

linux - adding a device to another device in a raid config -

if have device mounted in rhel, how add device , make raid0 config? i know how mount 2 new devices in raid0 config, how do 1 device in use , has data on it? depends on details; lvm volume? add new device volume group , extend logical volume. file system zfs? add device pool. otherwise, need backup mounted drive, unmount , create raid0 volume.

java - Stepping over from Concurrency to Parallel processing -

i have quad core cpu, , i've been trying experiment multithreading performance reasons. i've written code below see how fast go, , noticed it's slower 2nd code block uses main thread int numcrunchers = runtime.getruntime().availableprocessors(); public void crunch() { int numpairs = 1000; for(int i=0; < numpairs; i++) pairs.add(...); int share = pairs.size()/numcrunchers; for(int i=0; < numcrunchers; i++) { cruncher cruncher = crunchers.get(i); for(int j=0; j < share; j++) cruncher.nodes.add(pairs.poll()); } for(cruncher cruncher : crunchers) threadpool.execute(cruncher); threadpool.shutdown(); try { threadpool.awaittermination(long.max_value, timeunit.nanoseconds); } catch (interruptedexception e) { e.printstacktrace(); } } private class cruncher implements runnable { public blockingqueue<pair<pathnode>> nodes = new linkedblockingqueue&

ios - Touch events responding is delayed when 3D touch is ON -

recently test app on iphone 6s , iphone 6sp 3d touch on. notice 3 strange things: when finger touches on left edge of screen, app responds touch events after 1s delay. when touch on left edge of screen , push force, 3d touch task switcher shows. but if tap left edge of screen, app can respond touch events immediately. i test many other 3rd apps , system apps (notes, contacts) phenomenon exists 3d touch on. when turn 3d touch off, app responds touch events usual. on other hand, system keyboard responds touch events whether 3d touch on or off. i guess it’s because touch events responding conflicts 3d touch task switcher. have tried many 3d touch apis have no effects. does have idea? thanks!

android - SnackBar - Exponential Backoff with Retry functionality -

i trying use snackbar notify users, if not connected internet. how implement "exponential back-off algorithm" snackbar "retry" action check internet connectivity? here doing now.. i using asynctask check internet connectivity. if there no connectivity, showing snackbar retry action. when user clicks on retry, increment back-off value(will set value twice previous value - temporarily), dismissing old snackbar , showing new snackbar. when timer runs out, check connectivity again, , if still not there, re-show snackbar back-off value increased. what best way of implementing snackbar in situation? there simple solution situation, other approach?

hadoop - Hive, Bucketing for the partitioned table -

this script: --table without partition drop table if exists ufodata; create table ufodata ( sighted string, reported string, city string, shape string, duration string, description string ) row format delimited fields terminated '\t' location '/mapreduce/hive/ufo'; --load data in ufodata load data local inpath '/home/training/downloads/ufo_awesome.tsv' table ufodata; --create partition table drop table if exists partufo; create table partufo ( sighted string, reported string, city string, shape string, duration string, description string ) partitioned ( year string ) clustered (year) 6 buckets row format delimited fields terminated '/t'; --by default dynamic partition not set set hive.exec.dynamic.partition=true; set hive.exec.dynamic.partition.mode=nonstrict; --by default bucketing false set hive.enforcebucketing=true; --loading mydata insert overwrite table partufo partition (year) select sighted, reported, city, shape, min, description, su

multithreading - Requesting integer multiple of "M" cores per node on SGE -

i want submit multi-threaded mpi job sge, , cluster running in has different nodes each has different number of cores. let's number of threads per process m (m == omp_num_threads openmp) how can request job submitted sge queue run in such way in every node, integer multiple of m allocated job? let's m=8, , number of mpi tasks 5 (so total of 40 cores requested). , in cluster, there nodes 4, 8, 12, , 16 cores. combination ok: 2*(8-core nodes) + 1*(16-core nodes) + 0.5*(16-core nodes) but of course not of these ones: 2*(4-core nodes) + 2*(8-core nodes) + 1*(16-core node) 2*(12-core nodes) + 1*(16-core node) (3/8)*(8-core nodes) + (5/8)*(8-core nodes) + 2*(16-core node) ps: there similar question, one: ( mpi & pthreads: nodes different numbers of cores ), mine different since have run m threads per mpi process (think hybrid mpi+openmp). the best scenario run job exclusively on same kind of nodes. speed start time, want allow job run on different kind of nodes,

mobile - Android Studio as source code editor? -

so have been programming year now. of experience has come school work/projects , have interest in android mobile development/application start using android studio comfortable before starting on side project winter break. use sublime text, lot, know if it's possible , worth using android studio source code editor (only can comfortable using it). an ide android studio (intellij idea) provides many tools make programming, testing, managing & deploying easier. built-in terminals, todo list, logcat of these. when programming project gets bigger, it's helpful use proper ide in order manage code text editor. however, fact, android studio consumes lots of resources in computer compared sublime text.

osx - Bad substitution on raspi does not occur on mac -

i'm trying write script replaces spaces underscores in every file in given directory. have shell script works on mac, when move pi throws error: remove-spaces.sh: 3: remove-spaces.sh: bad substitution. i'm wondering how can rid of error , causing it. script below. for f in $1/*.*; mv "$f" "${f// /_}"; done

javascript - Debugging server side with node.js -

i have burning question in head regarding debugging, see when writing javascript client side can go chrome's console , track variables , objects etc see happening code better.. not able head around how can same on server side (node js)? let's front end submitted form express server, how go checking if instance req object received or not? go checking variables , objects (debugging) server side code? can't on console of browser code exists , executes on server side can't access server side objects etc through browser's console. you can still console.log(). it'll print screen run server. however, it's not walking through code debugger can set breakpoints , lots of other things debuggers can do. i've used both webstorm's debugger , node-inspector. you might want node-inspector . debugger chrome's dev-tool , might familiar with. link below provides installation tutorials. https://github.com/node-inspector/node-inspector

Adding a where clause to a SQL Server trigger -

i'm looking add where clause trigger shown below , looking bit of advice if possible. trigger works on basis of particular items being added order , not specific ones (ideally prefix). create trigger italianemail on soporderreturn insert, update declare @soporderreturnid int; update soporderreturn set analysiscode19 = 'mario@aol.com' soporderreturn inner join inserted on soporderreturn.soporderreturnid = i.soporderreturnid) go the layout of tables in sql server following: soporderreturn [header table] -- holds order information (has primary key soporderreturnid ) soporderreturnline [order line table] -- stores item data order (has primary key soporderreurnlineid , foreign key soporderreturnid ) i need where clause pick stockitem on soporderreturnline table if like 'xxx_%' i hope have explained enough of structure of tables idea of achieve? any offered gratefully appreciated , thank time. try following. notice a

c++ - Array size declarator, can they be calculated? VC++ -

ubernoob question: possible in ms visual c++ declare array size based upon user input? int usernum; cin >> usernum; const int size = usernum; int myarray[size]; it seems if use variable in way initialize constant size, vc++ no longer sees constant purposes of setting array size. is there way around this? this can done usign std::vector #include <iostream> #include <vector> int main() { int usernum; std::cin >> usernum; std::vector<int> myarray(usernum); myarray[1]=42; return 0; } note example has no checks size user has entered.

How can I determine if Java generic implements a particular interface? -

how can determine if java generic implements particular interface? i have tried few different approaches, results in "cannot find symbol ... variable t" error. first attempt public abstract class abstractclass<t> { public void dofoo() { if (t instanceof someinterface){ // stuff } } } second attempt public abstract class abstractclass<t> { public void dofoo() { if (someinterface.class.isassignablefrom(t)) { // stuff } } } you can't. workaround 1 add constructor taking class of object. public abstract class abstractclass<t> { private class<t> clazz; public abstractclass(class<t> clazz) { this.clazz = clazz; } public void dofoo() { if (clazz instanceof someinterface){ // stuff } } } workaround 2 add constraint type t t extends someinterface , thereby restricting type t subtype of s

html - Python Scrapy, parsing multiple child objects into the same item? -

for non-profit college assignment trying scrape website www.rateyourmusic.com, able scrape things have encountered problem when trying scrape multiple children of html element. specifically i'm trying scrape genre of artist many artists multiple genres , can't scrape of them, here parsing method: def parse_dir_contents(self, response): item = rateyourmusicartist() #get genres of artist sel in response.xpath('//a[@class="genre"]'): item['genre'] = sel.xpath('text()').extract() yield item there multiple //a[@class="genre"] xpaths representing genre, put them in 1 string separated ', '. is there easy way this? here sample url site i'm scraping http://rateyourmusic.com/artist/kanye_west . a simple str.join() trick: ", ".join(response.xpath('//a[@class="genre"]/text()').extract()) demo (from scrapy shell ): $ scrapy shell http://rateyourm

Python batch-rename script sending files to root folder -

ok, weird , maybe awkward. made script change end of subtitles files keep consistency. replaces a.x.str a.y.str. worked flawlessly @ single folder. i decided make recursive version of on folder had, regardless if episodes together, separated season or each on individual path. i don't know how or why, sent files reached root folder using until halted raising fileexistserror. the code bit i'm using is: def rewrite(folder, old, new): f in next(os.walk(folder))[2]: os.rename(os.path.join(folder, f), os.path.join(path, f.replace(old, new))) f in next(os.walk(folder))[1]: x = os.path.join(folder, f) rewrite(x, old, new) where 'old' "a.x.str", 'new' "a.y.str" , folder full path of root folder "c:\series\serie name". why doesn't work recursive? first bit of code (first loop) works fine on it's own in single folder. problem "next" use names of files , folders

c# - Entity Framework code-first, error: "EntityType 'OfferSequence' has no key defined" -

i using entity framework code-first. trying create new entity called offersequence, table automatically created in database. the problem when try update database new entity, following error one or more validation errors detected during model generation: erp.enterprisedataaccesslayer.enterprisedata.offersequence: : entitytype 'offersequence' has no key defined. define key entitytype. offersequences: entitytype: entityset 'offersequences' based on type 'offersequence' has no keys defined. however, can see below, key clearily defined on property sequencestart public class offersequence : ientity<offersequence> { public offersequence(uint sequencestart, uint incrementalcounter, uint annualincrementalcounter) { validate.ensureistrue(incrementalcounter >= sequencestart && annualincrementalcounter >= sequencestart, "counters can not lower sequence start"); sequencestart = sequencestart;

unix - Failed to configure device ttyUSB0 (Arduino) on Ubuntu, C++ -

i can open serial port, can't correctly configure port write (/dev/ttyusb0). piece of code c++: int platform::initconnection( const char* devicepath, int baudrate ) { int fd = 0; int ret = 0; struct termios terminaloptions; // posix structure configurating terminal devices fd = open( devicepath, o_wronly | o_creat | o_trunc, s_irusr | s_iwusr | s_irgrp | s_iroth ); //fd = open( devicepath, o_rdwr | o_noctty ); if (fd == -1) { this->setfail(); this->seterrorstr( "failed open: " + (std::string)devicepath + ". " + (std::string)strerror(errno) ); return -1; } memset( &terminaloptions, 0, sizeof( struct termios ) ); // cleaning structure cfmakeraw(&terminaloptions); // cfsetspeed(&terminaloptions, baudrate); /*terminaloptions.c_cflag = clocal;

php - Rewrite url by htaccess -

redirect every url parameter index.php have persian language parameter in url url friendly have issue words. for example : not work : www.example.com/بیمه 100% work : www.example.com/تهران it's not have issue , it's work correcly , open index.php rewritecond %{script_filename} !-d rewritecond %{script_filename} !-f rewriterule ^(.*)$ index.php this rewriterule work english lang url parameter see error 404 in persian language . maybe star (*) not meaning in code . page error : object not found! the requested url not found on server. if entered url manually please check spelling , try again. error 404

Building Oculus Mobile VR SDK with Eclipse: VrApi module already defined -

i building blank project in eclipse oculus mobile vr sdk. getting following error: android ndk: trying define local module 'vrapi' in jni/../../../../../../vrapi/projects/androidprebuilt/jni/android.mk. android ndk: module defined jni/../../../../../../vrapi/projects/androidprebuilt/jni/android.mk. looks android.mk somehow included twice. i'm using oculus mobile vr sdk 0.6.2.0. following projects included in eclipse workspace: libovrkernel_prebuilt mediasurface vrapi_prebuilt vrappframework_prebuilt vrgui vrlocale vrsound tried re-creating workspace twice, still same error. how can vrapi module included twice? android.mk says local_module := vrapi is in vrapi_prebuilt , else. thanks i fixed modifying android.mk inside vrapi_prebuilt in following way. i added include $(build_shared_library) right before following block: ifneq (,$(wildcard $(local_path)/$(local_src_files))) include $(prebuilt_shared_library) endif i removed .so exte

c# - Preload or Live Frequent Registry Read and Write -

i using registry store (20+) data values window location & size start with. curious if should preload of keys registry instead of live query them when or set called on variable. there risks querying or writing data registry frequently? code example: internal int mainwindowheight { { try { using (registrykey mykey = registry.currentuser.opensubkey("xxxxx")) { return convert.toint32(mykey.getvalue("xxxx")); } } catch { return 0; } } set { try { using (registrykey mykey = registry.currentuser.opensubkey("xxxxx", true)) { mykey.setvalue("xxxx", value, registryvaluekind.dword); } } catch {} } }

r - Run Power.t.test for a data frame -

i'm trying run power.t.test on dataframe , trying return samplesize(n) each employee,but it's giving me error. error in power.t.test(delta = d.f$delta, sd = d.f$sd, sig.level = 0.05, : 1 of 'n', 'delta', 'sd', 'power', , 'sig.level' must null this i've done far. dput(d.f) structure(list(power = c(0.95, 0.95, 0.95, 0.95), sig.level = c(0.05, 0.05, 0.05, 0.05), sd = c(4.93255160738102, 20.3907509926899, 23.1325373816684, 6.0463892968789), delta = c(97, 97, 90, 96), workedby = structure(1:4, .label = c("emp1", "emp2", "emp3", "emp4"), class = "factor"), newcolumn = c(0, 0, 0, 0)), .names = c("power", "sig.level", "sd", "delta", "workedby", "newcolumn"), row.names = c(na, -4l), class = "data.frame") first approach d.f$newcolumn <- 0 (i in 1:nrow(d.f)) { n <- power.t.test(

loops - Processing link() returning multiple links -

i have pretty basic scatter plot shows largest impact craters on earth. y-axis diameter, x age. i trying create interaction when click data point on graph link displaying craters wiki page opens. i have working, when click data point page opens every entry in loop. dozen+ of same page. is there way make return 1 entry. tried noloop(); works, returns relevant entry, stops program, making can longer click on other data points. i included relevant code below. int rownumber; //set rownumber integer int datawh = 10; //data width/height int row = 0; table craterwiki = loadtable("craterwiki.tsv"); //loads , parses tsv data rows , columns string craterlink = craterwiki.getstring(row, 5); pfont font; pfont fonttitle; void setup() { size(1120, 920); rownumber = craterwiki.getrowcount(); //number of rows font = loadfont("couriernewpsmt-14.vlw"); fonttitle = loadfont("couriernewpsmt-18.vlw"); } void draw() { background(#111727); textfon

osx - Do third-party CA code signing certificates work on OS X? -

i have read apple documentation: https://developer.apple.com/library/mac/documentation/ides/conceptual/appdistributionguide/maintainingcertificates/maintainingcertificates.html i have read thread: non-apple issued code signing certificate: can work mac os 10.8 gatekeeper? both state third-party ca code signing certificates won't work apple os x. however, various cas offer apple code signing certificates sale. couple examples here: https://www.digicert.com/code-signing/apple-certificates.htm https://www.thawte.com/code-signing/content-signing-certificates/apple/index.html there other companies too. creates impression indeed possible use variety of certificaes os x. these cannot both right. there explanation situation? i did buy digicert certificate code signing. website says can used codesigning osx applications. technically speaking true: can sign app it. not acceptable gatekeeper. have gatekeeper accept it must signed apple certificate. i contacted

javascript - How to Add custom authorization in swagger UI? -

in 1 of rest api call need add header "authorization: partner_id : timestamp signature" where company name static string can hardcoded partner_id part of query parameter user inputs , signature calculated sha256(secret,password).digest.encode('base64') how , can implement authorization right see there api_key, , basic authorization allowed in swagger-ui. yes, can create own signing techniques. swagger-js readme: var customrequestsigner = function(name) { this.name = name; }; customrequestsigner.prototype.apply = function(obj, authorizations) { // real instead of this... var hashfunction = this._btoa; var hash = hashfunction(obj.url); obj.headers["signature"] = hash; return true; }; and add swagger such: client.clientauthorizations .add("custom", new customrequestsigner("custom","special-key","query")); then operation tagged security requirement custom have applied.

php - Number of days in next month not working -

i'm using below code number of days in next month. displays 31 when there 30 days in november. how solve? echo date('t',mktime(0,0,0,date("m",strtotime("+1 month")),1,date("y"))); date("m",strtotime("+1 month")) returns string ( nov ), mktime expects arguments integers. means you're getting 0 value injected instead of next month, give number of days in january date("n",strtotime("+1 month")) will return month number

ios - linker command faild with exit code 1 -

i have project 2 target . project contain 2 .a file. 1 of them zbar , other 1 named liblizaruskit.a . added libraries linked frameworks , libraries of target trying build when trying build project see 2 errors. one of is: searching 1 file "myprojectname" <untitled 23>: 1: ld /users/rad/library/developer/xcode/deriveddata/myprojectname-hkppcarpbiarhyaklpydovlxcodl/build/products/debug-iphoneos/myprojectname.app/myprojectname normal armv7 2 cd "/users/rad/documents/git repo/ios-ap/ios main project" 3 export iphoneos_deployment_target=7.0 4 export path="/applications/xcode.app/contents/developer/platforms/iphoneos.platform/developer/usr/bin:/applications/xcode.app/contents/developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin" 5: /applications/xcode.app/contents/developer/toolchains/xcodedefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /applications/xcode.app/contents/developer/platfo