Posts

Showing posts from April, 2011

ios - UIButton connected to viewcontroller, navigationbar isn't appearing -

issue : connected uibutton go viewcontroller. when pressed button go viewcontroller, navigation bar doesn't appear. app opens same viewcontroller , navigation bar visible. (the non-adaptive action segue set modal) question: how fix this? (sorry lack of info, don't know how explain better. if need better info, please comment below)

javascript - How can I grab script tag calling jquery's cdn in the body and remove it before jQuery loads? -

i have uncommon problem. i don't have access head or database company's drupal website, however, i'm building "plugin" site using provided "js injector". i hack away locally , copy/paste javascript right injector (i can't think of worse development environment think of it, product development takes forever). in haste, accidentally put in call jquery need locally. killed page, mostly, because calling jquery twice bad. page paint/css renders can't access of management modules edit node updated can fix issue. since "customize page" make ajax call initialize of drupal backend ui stuff. idea access js injector internal page i've setup , run script somehow "reach in" , remove call jquery before gets rendered. i possible grab script it's source? can't use jquery remove second jquery script on page...can i? hurts asking. here exact script i'm trying remove, there no type attribute. src: <sc

javascript - angular and mvc 4 post File to server -

i have code : javascript $scope.savechanges = function (bl) { console.log(bl) $http.post('@url.action("savechangesbudgetline", "financialplanning")', { amount: bl.amount, month: bl.month.id_bulan, year: bl.year, newfile : bl.newfile }) .then(function (resp) { console.log(resp) }) } c# : [httppost] public actionresult savechangesbudgetline(string amount, int month, int year, httppostedfilebase newfile) { return json(new { is_success = true, amount = amount, month = month, year = year, newfile = newfile }); } newfile in javascript has value (console.log on client) : newfile: file lastmodified: 1440754532970 lastmodifieddate: fri aug 28 2015 16:35:32 gmt+0700 (se asia standard time) name: "external.xlsx" size: 964223 type: "application/vnd.openxmlfo

javascript - Is it possible to make double click dynamic ads from HTML5 canvas / flash export -

i create dynamic html5 doubleclick banners using html5 canvas export (as im familiar flash can't code html5). create main animation, plan partner js/html5 developer assign variables , make elements dynamic within html5 canvas doc afterward. please advise if method work / if it's possible? i'm new html5 thoughts great. many thanks!!

javascript - Remove DOM elements using Angular filter but without jQuery -

i'm starting learn angular , have been getting grips basics of it. i've come unstuck, wider knowledge of js pretty limited. i'm creating feed brings in data json file. 1 of items wish bring in string html inside: "description": " <p><a href=\"https://www.flickr.com/people/71256895@n00/\">tomylees<\/a> posted photo:<\/p> <p><a href=\"https://www.flickr.com/photos/71256895@n00/20384585533/\" title=\"american sweet potatos img_6026\"><img src=\"https://farm1.staticflickr.com/608/20384585533_4141b76f92_m.jpg\" width=\"240\" height=\"180\" alt=\"american sweet potatos img_6026\" /><\/a><\/p> <p>going farm shop.<br /> rose farm shop, rose farm cottages, haine rd, ramsgate ct12 5ag.<br /> saturday, 29th august 2015, ramsgate, kent.<\/p>", i'm parsing html view using ngsanitize , ng-bind-html without i

jsoup - Java - Get every webpage associated with domain name programmatically -

i want make program user enters url, , program responds every web page associated under domain name. right now, i'm using jsoup every <a href> link, not cover every web page on site if site changes pages through angularjs or else. advice on how best this? you don't need jsoup this. navigate host's robots.txt https://stackoverflow.com/robots.txt and find sitemap.xml . sitemap: /sitemap.xml in case of so, theirs cached on google: cache:https://stackoverflow.com/sitemap.xml this have of links website wants publicly available. or in case of so, list of additional site maps scan through. https://stackoverflow.com/sitemap-questions-0.xml https://stackoverflow.com/sitemap-questions-1.xml https://stackoverflow.com/sitemap-questions-2.xml https://stackoverflow.com/sitemap-questions-3.xml https://stackoverflow.com/sitemap-questions-4.xml https://stackoverflow.com/sitemap-questions-5.xml https://stackoverflow.com/sitemap-questions-6.xml

architecture - c++ loose coupling function dependency -

as title might suggest having hard time describing architectural problem , same reason searching has been without result. writing command line application aims take in two-dimensional data physics model can fitted means of least squares fitting. have implemented nelder-mead , levenberg-marquardt routine work properly, i.e. given set of data, model , cost function, optimize array of fitting parameters. for purpose want write class facilitates abstract functionality of optimization, independent of actual model , cost function used. class fit { public: fit(); ~fit(); run(); private: std::vector<std::vector<double>> m_data; std::vector<double> m_parameters; std::vector<double> m_evaluated; } the actual optimization method run() following: void run() { // set initial guess parameters m_parameters = {...}; while(condition) { double cost_value; // evaluate model function current parameters (*mo

python 3.x - How to rotate and print all the characters of a string in python3 starting from every character of the string? -

for example have string "mission", want program print below starting first letter. mission issoinm ssionmi sionmis ionmiss onmissi nmissio this code give exact output you're expecting. def rotate(lst, n): return lst[-n:] + lst[:-n] s = 'mission' in range(len(s)): print(rotate(s,-i), end=' ') output: mission issionm ssionmi sionmis ionmiss onmissi nmissio the function rotation borrowed this post .

Spring Data Neo4j Repository.save works incorrectly if it performs update -

i tried perform following actions via repository (sdn 4.0.0.rc2): i save entity property null value i save entity again (i.e update it), property has value in case updating not performed. value still null. bug?

php driver mongodb , never loaded -

i have installed mongodb, wamp server , have added collection in mongodb i downloaded php_mongo-1.6.8.zip s3 -> ok there many files in zip file, 1 one need? (window 10 64 bit) i found php.ini location phpinfo() in c:\wamp\bin\apache\apache2.4.9\bin\php.ini , inserted string in extension=php_mongo.dll . in c:/wamp/bin/php/php5.5.12/ext/ copy (for test) php_mongo-1.6.8-5.6-vc11.dll (renamed in php_mongo.dll). i can restart apache without errors , call mongo.php in host echo extension_loaded("mongo") ? "mongo loaded\n" : "mongo not loaded\n"; echo "<br>"; echo extension_loaded("mysql") ? " mysql loaded\n" : " mysql not loaded\n"; this print: mongo not loaded mysql loaded why isn't mongo driver loading? the problem api compile version. version 1.4.5 mongodb driver work fine. the correct driver window 10 64 bit , wamp64bit php_mongo-1.4.5-5.5-vc11-x86_64.dll

javascript - Angular cannot render carousel with template -

i using angular ui bootstrap components. goal create carousel using templateurl argument slide render, met problems. first of nothing appears when run page, tho errors: https://docs.angularjs.org/error/$compile/ctreq?p0=carousel&p1=slide multiple directives [carousel, slide (module: ui.bootstrap.carousel)] asking transclusion on: here code: home.html <section id="slider"> <!--slider--> <div class="container"> <div class="row" ng-controller="homecarouselctrl"> <div class="col-sm-12"> <carousel interval="myinterval" no-wrap="nowrapslides" template-url="pages/templates/offer-product-tplt.html"/> </div> </div> </div> controler mainapp.controller('homecarouselctrl', ['$scope', function ($scope) { $scope.myinterval = 5000; $scope.nowrapslides = false; $scope.slides = [

Google Form to Create an Event in Calendar -

i have created google form our local scout district, notify taking section out , about. working fine notification email. trying automatically create calendar event, later shared through out website management team can view , see of scouts are. anyway on track, fields have far are: function calendarsubmit(e){ var group = e.values[1]; var activitydatestart = e.values[2]; var activitytimestart = e.values[3]; var activitydateend = e.values[4]; var activitytimeend = e.values[5]; var activity = e.values[6]; var location = e.values[7]; var description = e.values[8]; var authleader = e.values[9]; var authleaderno = e.values[10]; var authleaderpermit = e.values[11]; var leadercharge = e.values[12]; var leaderchargeno = e.values[13]; var leaderemail = e.values[14] var adults = e.values[15]; var beavers = e.values[16]; var cubs = e.values[17]; var scouts = e.values[18]; var explorers = e.values[19]; var other = e.values[20]; var intouchname = e.

android - Nearby Messages repeated on reconnecting -

i've written small test application works simple chat room using nearby.messages_api. when subscribe find receive number of older messages in messagelistener (in onfound). if disconnect , reconnect (eg. switch application) find messages come through again. meant happen? i have changed application include uuids in messages , keep stash of them check whether have received message, may not idea memory point of view (although put them in database). i don't understand how "session" side of nearby messages works. in google play services 7.8 "sessions" internally divided ten minute buckets. you're not first person confused this, we're looking @ options differently in future. no promises, recognize it's issue. (i work on nearby api)

jquery - Divs keep on displaying as block and not inline block -

i'm trying <div class="project-list"> inline-block keeps reverting block . .project-list { width:20%; display:inline-block; } $(document).ready(function () { $('#one').delay(1300).fadein(1000); $('#two').delay(1500).fadein(1000); $('#three').delay(1700).fadein(1000); $('#four').delay(1900).fadein(1000); $('#five').delay(2100).fadein(1000); $('#six').delay(2300).fadein(1000); $('#seven').delay(2500).fadein(1000); }); http://jsfiddle.net/w58l2dn0/ this because use fadein show div, can use 2 solutions: $('#one').delay(1300).css({ opacity: 0, display: 'inline-block' }).animate({opacity:1},600); http://jsfiddle.net/ltasty/w58l2dn0/5/ or $('#one').delay(1300).fadein(1000).css("display","inline-block"); http://jsfiddle.net/ltasty/w58l2dn0/2/

issues while porting clocks in linux kernel (4.9) -

i trying port system clocks custom soc linux kernel (4.9). had setup minimal lookup table crystal osc, pll & spi below: static struct clk_lookup clocks[] = { clkdev_init(null, "ref", &ref_clk), clkdev_init(null, "pll1", &pll1_clk), clkdev_init(null, "apb_pclk", &apb_clk), clkdev_init("spi0", null, &spi_clk), }; and im trying add clocks using func: int __init clocks_init(void) { clkdev_add_table(clocks, array_size(clocks)); }; but booting fails while trying setup clocks. below error: unable handle kernel null pointer dereference @ virtual address 00000008 [ 0.000000]` pgd = c0004000 [ 0.000000] [00000008] *pgd=00000000 [ 0.000000] internal error: oops: 5 [#1] arm [ 0.000000] modules linked in: [ 0.000000] cpu: 0 pid: 1 comm: swapper not tainted 4.9.22+ #22 [ 0.000000] hardware

php - How to display Original image from folder codeignihter -

i trying display image original folder. want display original image in 1366x768 window. when change <?php $width = 1366;$height = 768; ?> height in line, automaticaly display crop image in height , width. <div class="white_box"> <div class="box-body"> <span class="hide wallhashid"><?php echo $wallpaper->wallpaper_hash; ?></span> <?php $width = 1366; $height = 768; ?> <div class="row"> <div class="col-sm-12"> <div class="wallpaper_image"> <img class="thumbnail img-responsive" style="width:100%; height:auto; display:block; max-width:<?php echo $width; ?>px;max-height: <?php echo $height; ?>px;" src="<?php echo $this->image_workshop->crop_image(originals_folder_wf . '/' . $wallpaper->wallpaper_image_path, $width, $height, $wallpaper->wallpaper

encryption - Shell script encoder -

please'd take simple doubt know how can encode .sh script shell script against third-party modifications? i can watch cpanel installation script found in url layer1.cpanel.net/latest at end of script has part unreadable i wonder how can leave protected script so? thank you. that bit @ bottom of script embedded binary. script see @ top extracts binary content script , extracts (using gzip looks like). the "protection modification" in script crc , md5 bits , since neither of reliable @ point , both data , sum in script doesn't offer protection against wants modify script or binary. not mention delete sum checking bits of code before running it.

javascript - Threejs create optimized mesh from 2d array -

Image
what want achieve creating voxel environment, 2d array holds positions blocks. currently i'm doing using basic cube geometry, it's slow, , has unnecessary faces on sides of of cubes, , bottoms. how can generate optimized mesh? i'm assuming detect neighbors , decide faces generate there. my data irregular shape, looks this: the white areas there should mesh, , black areas there shouldn't anything. (i have converted 2d array of points) i'm bit lost on how go doing this. looked @ http://threejs.org/examples/#webgl_geometry_minecraft thats generating square world, not 1 holes , stuff in it. so how go doing this? there code guys possibly post me out? any appreciated :)

javascript - Detect which file uses console.log? -

i running wordpress ownchild theme includes redux framework admin option. when have in javascript console in chrome, seem getting phantom console.log. every option change in option panel, it's being output in console. went through several files thought cause that, can't find console.log() seems responsible that. is there anyway find out file , line responsible phantom log? open dev tools in chrome , open sources. search console ctrl+shift+f (cmd+option+f on mac)

Understanding a complex docker command -

i going through tutorial online , author , uses following command along way: sudo docker run --name my_sql -e mysql_root_password=mysecretpassword --volumes-from my_datastore -d mysql so understanding of above command follows there specific name given image , after there environment variable being passed , after there --volumens-from command being executed , -d indicates container should run in background . i not sure mysql @ end. my question following: docker uses following syntax: docker [options] command [arg...] in command have highlighted [options] command , [arg...] ? mysql doing in end of command ? thank you. alex-z. great question, , you're correct on statements. the naming convention follows: the name of container --name my_sql environment variable(s) - can add many want, each additional '-e' directive -e mysql_root_password=mysecretpassword directive use volume different container --volumes-from my_datastore

Xcode doesn't let me initialize values in C++ -

i'm using stroustrup's book programming -- principles , practice using c++ pick c++. 1 of topics regards initializing variables. consider following example in book: #include <iostream> #include "std_lib_facilities.h" int main() { cout << "please enter first_name , age\n"; string first_name = "???"; // string variable // ("???" means "don't know name") int age = -1; // integer variable (-1 means "don't know age") cin >> first_name >> age; // read string followed integer cout << "hello, " << first_name << " (age " << age << ")\n"; } in code, variable age supposed initialized -1. however, in xcode, when tried build , run it, age set 0 when typed in that's not integer age. example, if type in "22 carlos", script returns 0 age. according book, i'm supposed see -1. i&#

java - Relative layout android loopable -

i writing app loads row of buttons (2 buttons black line underneath) each file found (so loop count not static). while building have static loop count 15. when running code creates bigger button on left , black line underneath fine... but... smaller button on right appears once. idea why? protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); scrollview scrollpictures = new scrollview(this); relativelayout applayout = new relativelayout(this); // applayout.setclipbounds(null); resources r = getresources(); imageview blackline; relativelayout.layoutparams p; int id = 1; for(int x = 1; x <= 15; x++){ p = new relativelayout.layoutparams(viewgroup.layoutparams.wrap_content, viewgroup.layoutparams.wrap_content); button studentsbutton = new button(this); studentsbutton.setclipbounds(null); studentsbutton.setid(id); studentsbutton.setheight((int) typedvalu

python - To much logic inside list comprehension? -

i have list comprehension in code looks : datapointlist = [ map(str, [ elem elem in dataframe[column] if not pd.isnull(elem) , '=' in elem ] ) column in list(dataframe) ] i wondering, there general rule of thumb when break list comprehension? can have logic inside list comprehension? you don't want mix map , list comprehensions, when map isn't needed @ all: >>> list(map(str, [x x in [1, 2, 3]])) ['1', '2', '3'] >>> [str(x) x in [1, 2, 3]] ['1', '2', '3'] it means can apply str[elem] directly in list comprehension: datapointlist = [ [ str(elem) elem in dataframe[column] if not pd.isnull(elem) , '=' in elem ] column in list(dataframe) ] then, dataframe iterable. there's no need convert list: >>> [x x in list(pd.dataframe(d))] ['one', 'two'] >>> [x x in pd.dataframe(d)] ['one&

typescript - How to declare a property as a subclass -

i have 3rd party lib returns baseclass. i want add properties baseclass , use it. compile error. var mysubclass : subclass = methodthatreturnsbaseclass(); compile error: type baseclass not assignable type subclass interface subclass extends baseclass { title: string; } how should written? how should written? one possibility: interface subclass extends baseclass { title?: string; } another: var mysubclass : subclass = <subclass>methodthatreturnsbaseclass(); i prefer method 1 more semantically correct

javascript - meteor autoform custom validation not reactive -

i'm trying use custom validation function field defined in simpleschema, error message not render on field. num: { type: number, label: "number", min: 1, decimal: false, // unnecessary default number, future reference autoform: { group: "info", defaultvalue: function() { //@todo - default next number logged in user return 5; } }, custom: function () { collection.simpleschema().namedcontext("addnumberform").addinvalidkeys([{name: "num", type: "numnotunique"}]); } }, i've defined custom error message it simpleschema.messages({numnotunique: "this number has been entered"}); when submit form can confirm custom function executes, nothing changes in ui field indicating error. context name "addnumberform" got simpleschema.debug = true; setting , seeing thrown other fields default validation. what missing here?

Creating CommandBar VBA Word -

Image
i created macro allow me pop new toolbar buttons inside specific action while i'm trying run error pops up: so google , tried many solution file=> option=... microsoft but keep showing me error , can't test macros in way thank in advance

hadoop - Mapreduce Custom TextOutputFormat - Strange characters NUL, SOH, etc -

i have implemented custom output format converting key value pairs json format. public class jsonoutputformat extends textoutputformat<text, intwritable> { @override public recordwriter<text, intwritable> getrecordwriter(taskattemptcontext context) throws ioexception, interruptedexception { configuration conf = context.getconfiguration(); path path = getoutputpath(context); filesystem fs = path.getfilesystem(conf); fsdataoutputstream out = fs.create(new path(path,context.getjobname())); return new jsonrecordwriter(out); } } private static class jsonrecordwriter extends linerecordwriter<text,intwritable>{ boolean firstrecord = true; @override public synchronized void close(taskattemptcontext context) throws ioexception { out.writebytes("}"); super.close(context); } @override public synchronized void write(text key, intwritable value) throws ioexception { if (!firstrecor

angularjs - Focus a new ng-repeat element -

using angular, want user able input main angular (if entry not exist) push new 'action' 'actions[module.id].actions' array, creating new input ng-repeat, want focus on new input. i using 'addactionaction()' add new value array , focus on newly created input, seems input not created until after 'addactionaction()' has finished running input not exist @ time want focus it. there way around this? <div ng-repeat="(key, action) in actions[module.id].actions" > <span class="action-profile">{a{action}a}</span> <input id="action-input-{a{module.id}a}-{a{key}a}"type="text" ng-model="action"> </div> <!-- main input--> <input type="text" ng-model="$parent.newactiontext" ng-change="addactionaction()"> function: $scope.addactionaction= function() { if($scope.actions[$scope.selectedid].actions.in

javascript - Meteor mrgalaxy:stripe package not loading content security policy -

i'm trying use stripe meteor create customer , charge customer, , added mrgalaxy:stripe. i'm following tutorial: http://themeteorchef.com/recipes/building-a-saas-with-meteor-stripe-part-1/ . after starting meteor, following errors: refused load script 'https://js.stripe.com/v2/' because violates following content security policy directive: "script-src 'self' 'unsafe-inline'". refused load script 'https://checkout.stripe.com/checkout.js' because violates following content security policy directive: "script-src 'self' 'unsafe-inline'". uncaught referenceerror: stripe not defined is there workaround manifest.json? if so, should located, should like, , how read in? i able fix changing app/server/startup.js from: meteor.startup( () => modules.server.startup() ); to: meteor.startup( () => { browserpolicy.content.alloworiginforall("https://js.stripe.com/") browserpolicy.con

json - Jersey 2 InjectLink is ignored -

i'm creating new jersey 2.21, jackson 2.6.1 rest server (i tried jersey 2.19 , jackson 2.5.3 well) , want use @injectlink provide hateoas links (like 'self') callers. basic app (taken jersey doc , jersey sample apps) isn't working, , can't figure out why. i started taking basic widgets class from jersey doc , json or xml returned empty structure. xml: <widgets/> json: {} widgets.java package org.glassfish.jersey.examples.linking; import java.net.uri; import java.util.list; import javax.ws.rs.core.link; import javax.xml.bind.annotation.xmlrootelement; import org.glassfish.jersey.linking.injectlink; import org.glassfish.jersey.linking.injectlinks; @xmlrootelement() public class widgets { @injectlink(resource=widgetsresource.class) uri u; @injectlinks({@injectlink(resource=widgetsresource.class, rel = "self")}) list<link> links; public widgets() {} } i put breakpoint in resource code , examined objec

node.js - image upload with security related issue -

i have service users can upload images (in form of base64-encoded string) server , server convert string image file , upload aws. what if base64-encoded string malware or virus in disguise? that valid concern. 1 way deal run up-to-date malware detection on decoded file before making public. if fails, don't allow seen anyone. check out clamav 1 such option.

unity3d - Unity (iOS) device angle on one axis -

i'm creating game in unity takes input physical rotation of device , turns force applied main character (a ball). using input.acceleration works fine, , added z-axis offset can choose default "up" it, 45 degrees table in front of you. problem is, input.acceleration gives values repeat themselves, sine curve between 0 (flat on table) , 1 (90 degrees table), y , z axis both @ different intervals (like cos/sin sorta pattern). i'm not quite sure how explain better.. i'll list values y , z each 90 degrees, somehow need convert them 0-4 value, or angle in 360 degrees - sort of linear increasing value z rotation. 0 degrees (flat on table) : y = 0, z = -1 90 degrees (facing towards you) : y = -1, z = 0 180 degrees (flat on table face down) : y = 0, z = 1 270 degrees (facing away you) : y = 1, z = 0 update: using equation {((input.acceleration.y * 2) + input.acceleration.z + 1) * 90f} gives angle between 0, , 360 @ full rotation of device, in between 0 , 90 e

android - Parse and Twilio -

i want use twilio 's sms , recorded voice services, allow users send ussd code update object fields on entry in parse.com 's database. other users should able send different ussd code retrieve basic information using cloud code. implement in 2 ways: - send ussd code , receive info (written) directly - recorded sound system helps user he/she needs, similar voice service provided communication companies. the problem don't know technical names of specific services/ rest apis need done. after research came across ivr , ussd , these need explore more? twilio developer evangelist here. to started twilio on parse should check out parse documentation , these getting started blog posts: sending sms parse making , receiving calls on parse if want further responding sms messages, take at: this explanation of how twilio inbound message requests work this introduction of twilio node.js helper if you're looking building ivr, take at: this ivr

c - I was trying to solve this maze with the following code. But the answers aren't accurate for all inputs like n=4 -

maze problem you provided matrix of size n*n source position @ (0,0) , destination @ (n-1,n-1) in 2d array. of positions in array marked 0 blocked cells, rest being marked 1. a path connected sequence of elements (0,0) (n-1,n-1) consists of 1. sequence of 1s in 2d array connected if every 1 in sequence adjacent (the above or left neighbour) next 1 in sequence. for example, in following matrix, 1 1 0 0 1 1 1 0 1 the 1s marked in blue connected path (0,0) (2,2) note cells @ (0,0) , (n-1,n-1) 1. can either make movement towards right or down, i.e., position (x,y), can go either position (x,y+1) or (x+1,y). input first line consists of size of input array n (<=50), following state of nxn maze consist of 0s , 1s. output you have print "possible" if there exists path between source , destination otherwise print "not possible". problematic cases for following input, 4 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 the console displays not possible whe

javascript - extjs dataview not show images -

i want show pictures using dataview. have 1 model , 1 store url. problem simple, configured xtype: 'dataview' not works , dont show error. im doing wrong? store: ext.define('proyecto.store.st_pjdatos', { extend: 'ext.data.store', model: 'proyecto.model.md_pjdatos', data: [ { idpersonaje: 1, nombre: 'aerie', retrato: 'http://img.picshare.at/1440990535_female_godlike_moon_jasonseow01_lg.png', arquetipo: 'neutral', profesion: 'mago', pv: 16, pa: 9, ps: 12, idatributos: 1 }, { idpersonaje: 2, nombre: 'tybalt', retrato: 'http://img.picshare.at/1440990535_male_human_jasonseow03_lg.png', arquetipo: 'neutral', profesion: 'picaro', pv: 21, pa: 18, ps: 19, idatributos: 2 }, { idpersonaje: 3, nombre: 'zojja', retrato: 'http://img.picshare.at/1440990535_n7bmtqw.png', arquetipo: 'maligno', profesion: 'clerigo', pv: 26, pa: 14, ps: 29, idatribut

java - Issue in Parcelable not found in 4.2 version device android -

i want integrate parcelable class in application. below code getsecratekey.java import android.os.parcel; import android.os.parcelable; public class getsecratekey implements parcelable { public string success = ""; public string message = ""; public string hasval=""; public string accsesskey=""; public string tenants_id=""; public string is_active=""; public string getis_active() { return is_active; } public void setis_active(string is_active) { this.is_active = is_active; } public string gettenants_id() { return tenants_id; } public void settenants_id(string tenants_id) { this.tenants_id = tenants_id; } public getsecratekey() { } public string gethasval() { return hasval; } public void sethasval(string hasval) { this.hasval = hasval; } public string getaccsesskey() { return accsesskey; } public void setaccsesskey(string accsesskey) { this.accsesskey = accsesskey; }

java - Creating a directory and folder in the internal storage using android studio -

i have read online make directory in internal storage use following line of code file dir = getdir("mydir", context.mode_private); however, when execute code along entire source code, can't seem find directory created in phone. isn't supposed saved android/data directory other apps data stored? confused. private file stored in /data/data/<packagename>/files

associations - cakephp3: How to call functions of related models in both directions -

i have 3 models, a , b , , c , where a has 1 b and a has many c . if method a.update() called calls methods b.task() , c.task() , , contain, b , c are available within a . however if in b.sometask() method need call c.anothertask() ? if debug($this) in a , see entities b , c , if debug($this) in b or c see properties of entity. should there not property in b (or c ) references entity a well? i know can adjust contain , add in a should contain b,c => [a] , creates second sql query when should have a ? is there trickery missing here?

What's the difference between Key store password and Key password in Android Sign Certification? -

Image
i'm working on android stuido generate signed certification, new key store option, need create 2 passwords certification. know difference between them is? keystore binary file contains set of private keys. private key represents entity identified app, such person or company. so keystore password used open keystore , simple password password of private entity stored in keystore file..!!

python - PyMC2 and PyMC3 give different results...? -

Image
i'm trying simple pymc2 model working in pymc3. i've gotten model run models give different map estimates variables. here pymc2 model: import pymc theta = pymc.normal('theta', 0, .88) x1 = pymc.bernoulli('x2', p=pymc.lambda('a', lambda theta=theta:1./(1+np.exp(-(theta-(-0.75))))), value=[1],observed=true) x2 = pymc.bernoulli('x3', p=pymc.lambda('b', lambda theta=theta:1./(1+np.exp(-(theta-0)))), value=[1],observed=true) model = pymc.model([theta, x1, x2]) mcmc = pymc.mcmc(model) mcmc.sample(iter=25000, burn=5000) trace = (mcmc.trace('theta')[:]) print "\nthe map value theta is", trace.sum()/len(trace) that seems work expected. had sorts of trouble figuring out how use equivalent of pymc.lambda object in pymc3. came across deterministic object. following code: import pymc3 pymc3.model() model: theta = pymc3.normal('theta', 0, 0.88) x1 = pymc3.bernoulli('x1', p=pymc3.deterministic(

scroll - Android: How to Prevent Down Press animation of a button when scrolling a list? -

so have imageview want use button. when press button scales little bit down , when release it, button scales original size. to attach ontouchlistener image: @override public boolean ontouch(view v, motionevent event) { animation anim; int action = event.getaction(); switch (action){ case motionevent.action_down: // scale down imageview when finger down anim = animationutils.loadanimation(getcontext(), r.anim.poster_scale_down); v.startanimation(anim); return true; case motionevent.action_up: // scale imageview when finger anim = animationutils.loadanimation(getcontext(), r.anim.poster_scale_normal); v.startanimation(anim); break; case motionevent.action_cancel: // scale imageview when action canceled anim = animationutils.loadanimation(getcontext(), r.anim.poster_scale_normal); v.startanimation(anim);

hadoop - Issue accessing Hive JDBC via Knox and configuring Hive in Ranger -

we have hdp-2.2 cluster freeipa configured.but when trying access hive jdbc via knox facing issue.following jdbc uri using: jdbc:hive2://xxxxxxxxxxx:8443/;ssl=true;ssltruststore=/var/lib/knox/data/security/keystores/gateway.jks;truststorepassword=xxxxxxxxxxxx?hive.server2.transport.mode=http;hive.server2.thrift.http.path=gateway/default/hive below error getting: _ keystore tampered with, or password incorrect (state=08s01,code=0) it seems password of truststore not match of mentioned in jdbc uri.we tried changing knox master password ambari not allow change it.is way wherein can change truststore password , create new knox master? affect other services if master secret password changed? in addition if use same uri creating hive repository in ranger _"connection failed" _error.is same jdbc uri used in ranger create repository hive? note: if set hive transport mode "binary" instead of "http" able create repository in ranger in case

simulink - Control algorithm stops working after 5 min 30 sec on F28335 -

Image
i want generate sin(wt) , w external signals. shown in figure have done that. sample time blocks 50e-6. using block in inverter control algorithm. after downloading code on f28335 controller, stops controlling after 5 min 30 sec. p.s. if use inbuilt sine source block, works fine. but, want , w configurable external signals.

codeigniter - Images doesnt loaded -

my code <?php foreach ($berita $data) { ?> <li><a href="<?php echo site_url('/home/berita/'.$data->id); ?>"><img src="<?php echo base_url ('upload/berita/'.$data->gambar); ?>" title="<?php echo $data->judul ;?>"></a> <div class="slide-caption n hidden-phone"> <h3><?php echo $data->judul ;?></h3> <?php } ?> when in localhost work when hosting it wont work coz image size big? you need set value of upload_max_filesize , post_max_size in php.ini : ; maximum allowed size uploaded files. upload_max_filesize = 40m ; must greater or equal upload_max_filesize post_max_size = 40m after modifying php.ini file(s), need restart server use new configuration. if can't access php.ini file can handle using .htaccess below : <ifmodule mod_php5.c> php_value upload_max_filesize 40m php_value post_max_size 40m </

ios - Not calling dealloc on UIViewController in Xamarin -

i have uiviewcontroller written in native library bound xamarin app. controller has method follows: + (instancetype)newinstance { return [shareddata.sharedinstance.mainstoryboard instantiateviewcontrollerwithidentifier:@"worksheetcontroller"]; } this method bound xamarin app follows: // @interface worksheettableviewcontroller : uiviewcontroller [basetype(typeof(uiviewcontroller))] interface worksheettableviewcontroller { // +(instancetype)newinstance; [static] [export("newinstance")] worksheettableviewcontroller newinstance(); } now in xamarin app in uiviewcontroller subclass in viewdidload call method follows: this.worksheetcontroller = worksheettableviewcontroller.newinstance(); the worksheetcontroller not used anywhere else in uiviewcontroller . when uiviewcontroller disposed (by popping off navigation stack), dealloc method of worksheettableviewcontroller not called. however if change code in viewdidload follows: thi

reactjs - How to load async react components without Webpack imports with SSR and RR4 -

i have been looking solution load async react components on demand @ matched route without webpack import, system.import, require.ensure, ... i want avoid webpack footprints in client-side code . on server fetch routes , render matched locations static html/js. classic ssr. my solution is: pack async components webpack static bundles ( c1.js , c2.js, ...) store map routes => async components json ("/path" => c1.js ) request react-rroute(rr4) matched path param wrap=true on ajax if route exists, , param wrap=true render c1.js on server fetch data (universal ajax) db wrap data , raw c1.js script response append response script child @ body or parent react component dom script unwraps data , code, stores them (e.g. redux) , append/render async component ( c1.js ) react dom this way have small entry file , could: request route https://host , load component (/path) on demand request route https://host/path on entry , render compleate component

mysql - PHP - Allowing string number and few symbols -

how allow preg_replace string, number , few symbols? preg_replace("/[^0-9]/","",$data[0]); //only works fine numbers columns values are: technische achtergrond,0,1 maritieme bediende,1,1 transport rijbewijs c en ce,0,4 commercieel bediende,1,5 heftruck/reachtruck(technisch operator),0,5 boukhouding/financieel,1,3 preg_replace("#[^0-9a-z\(\),/\-\.'\" ]#i", "", $data[0]);

php - Read .xlsx and .xls data in codeigniter -

Image
i want read data of .xlsx or .xls file in codeigniter. have read other questions related nothing works. have used phpexcel, reader no luck. in project give option upload excel file want read data , insert in database. now using phpexcel library have wrote: $this->load->library('excel'); $reader= phpexcel_iofactory::createreader('excel2007'); $reader->setreaddataonly(true); $path=(fcpath.'uploads/productfile/'.$_files['upload_file']['name']); $excel=$reader->load($path); $sheet=$excel->setactivesheetindex(0); for($i=0;$i<=1000;$i++) { $col1= $sheet->getcellbycolumnandrow(0,$i)->getvalue(); $col2= $sheet->getcellbycolumnandrow(1,$i)->getvalue(); $col3= $sheet->getcellbycolumnandrow(2,$i)->getvalue(); var_dump($col1); } but display : uncaught exception 'phpexcel_exception' message 'you tried set sheet active out of bounds inde

php - Wordpress: for 100 pages site, use 100 page templates or 1 with include functions? -

i'm using different page templates pages create in wordpress. i'm using wordpress intranet portal company. pages, build, need different php code. what correct way 100 pages site? create pages own page template, , put themes/.../page-templates or create 1 page with: <?php switch($current_page_name) { case "about-us"; include(site_url('/pages/about-us.php')); break; case "contact-form"; include(site_url('/pages/contact-form.php')); break; } ?> but how can $current_page_name variable? example have page: http://192.168.210.140/sales-funnel/todolist/ think, there need be: case "sales-funnel/todolist/"; is correct, create themes\twentyten\page-templates\one-column.php : <?php /** * template name: main template one-column */ add_action('template_redirect','my_redirect'); function my_redirect(){ get_header(); echo ' <div id="c

ElasticSearch 2 bucket level sorting -

the mapping of database this: { "users": { "mappings": { "user": { "properties": { credentials": { "type": "nested", "properties": { "achievement_id": { "type": "string" }, "percentage_completion": { "type": "integer" } } }, "current_location": { "type": "geo_point" }, "locations": { "type": "geo_point" } } } } } now in mapping, can see there 2 geo-distance fields 1 current_location , other locations. want sort user based on credenti