Posts

Showing posts from February, 2014

ical made with php won't show up in google calendar -

i'm trying create ical calendar created, both using php. cal url: https://www.gamingonlinux.com/index.php?module=calendar&view=ical i've used validator, , claims it's valid, no events show in google calendar when added in test. any thoughts on error is? this code make ical: // ical date format. note z on end indicates utc timestamp. define('date_ical', 'ymd\this\z'); // max line length 75 chars. new line \\n $output = "begin:vcalendar\r\nmethod:publish\r\nversion:2.0\r\nprodid:-//gaming on linux//release calendar//en\r\n"; $db->pquery("select `id`, `date`, `name`, `comment`, `link`, `best_guess` `calendar` year(date) = $year , `approved` = 1 order `date` asc"); // loop on events while ($item = $db->fetch()) { if (empty($item['edit_date'])) { $item['edit_date'] = date("y-m-d"); } $output .= "begin:vevent\r\nsummary:{$item['name']}\r\nuid:{$item[...

c++ - Understanding how the default values of template parameters are declared -

in std::basic_string documentation found @ http://en.cppreference.com/w/cpp/string/basic_string , basic_string class declared follows. template< class chart, class traits = std::char_traits<chart>, class allocator = std::allocator<chart> > class basic_string; however, in both gcc , visual studio default values traits , allocator template parameters not specified in class declaration. the following basic_string.h gcc 4.9.2. template< typename _chart, typename _traits, typename _alloc > class basic_string note lack of default values _traits , _alloc template parameters. what missing? these classes declared in million places 1 . 1 of declarations carry default arguments, because it's error otherwise. for basic_string , in libstdc++, default arguments found in forward declaration in bits/stringfwd.h (which included <string> , among other things): template<typename _chart, typename _traits = char_tr...

How pass parameters between controller and view Codeigniter -

my parameter array: controller: $data=......; $this->load->view('a/p/l',$data); the data vector has parameter: 0 => array (size=4) 'email' => string '' (length=21) ... 1 => array (size=4) 'email' => string '' (length=21) ... 2 => array (size=4) 'email' => string '' (length=21) anyone can show mem view can read elements in array? here simple example here controller named welcome.php <?php defined('basepath') or exit('no direct script access allowed'); class welcome extends ci_controller { public function index() { $data['default'] = array( array( 'email' => 'sample@gmail.com', 'username' => 'username1' ), array( 'email' => 'sample@yahoo.com', ...

How to login facebook using sdk 4.1.0 in android? -

[i"m writing codes login page application.i have made login successful given email , password i"m facing problem while writing codes login facebook.i have checked https://developers.facebook.com/docs/facebook-login/android/v2.3 but still i"m getting errors while running code per instructions.i"m new android developing...so proper praiseworthy.thankx in advance.] 1 here i"m providing working solution facebook login sdk4. first of add dependency on build.gradle(module app) under dependencies {...... compile 'com.facebook.android:facebook-android-sdk:4.1.0' } sync gradle.... thereafter,in android manifest following changes:- <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.get_accounts" /> <uses-permission android:name="android.permission.use...

sql server - How to implement paging mechanism in generic way for SQL standards? -

in project, have implemented paging mechanism sql server, per our requirement, trying implement paging mechanism in generic way oracle, sql server, db2 & db400 databases. possible implement paging in such way? can simplest generic way implement such query? as far know there no generic functionality implement pagining mechanism database. the syntax implement pagination may change database, hard there genric functionality implement across database. you can refer there method paging using ansi sql only? accepted answer refers link says use like select * ( select row_number() on (order key asc) rownum, columns tablename ) foo rownum > skip , rownum <= (n+skip)

macros - C pre-processor defining for generated function names -

i have situation have quite few generated functions, , point them @ generic functions have created (to allow me reuse base code when generated function names change). essentially, have list of function names follows: void callback_signalname1(void); void callback_signalname2(void); ...etc once these generated, define macro allow them called generically. idea this, haven't had luck implementing it...as c pre-processor takes name of macro instead of macro defined as: #define signal1 signalname1 #define signal2 signalname2 #define function_name(signal) (void callback_ ## signal ## (void)) ... ... function_name(signal1) { .. return; } the issue receive void callback_signal1(void) instead of void callback_signalname1(void) is there way around this? you need provide level of "function-like macro" ensure proper expansion: e.g. #define signal1 signalname1 #define signal2 signalname2 #define make_fn_name(x) void callback_ ## x (void) #d...

mysql - php select query unknown column in field list? -

i'm having error in mysql query (error code : 1054 unknown column 'p.post_id' in 'field list') post_id present in post table can 1 me in issue select u.iname , p.post_id,p.file_path users u inner join likes l on u.user_id=l.user_id inner join notify n on p.post_id=n.post_id inner join post p on p.user_id=u.user_id u.user_id=3 , n.notify=1 tables not joined in correct order, cant reference post_id in second join posts table isn't joined yet. select u.iname, p.post_id, p.file_path users u inner join likes l on u.user_id = l.user_id inner join post p on u.user_id p.user_id inner join notify n on p.post_id = n.post_id u.user_id = 3 , n.notify = 1

c# - error - Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml' -

i have web service method call saveitem function following: public static bool saveitem(string connection, dataset dset) { bool rtnval = false; sqlconnection conn = new sqlconnection(connection); conn.open(); sqltransaction tran = conn.begintransaction(); sqlcommand command = conn.createcommand(); command.connection = conn; command.transaction = tran; command.commandtimeout = 320; command.commandtext = "sp_update_item"; command.commandtype = system.data.commandtype.storedprocedure; try { foreach(system.data.datarow drow in dset.tables["items"].rows) { command.parameters.add("@itemid", sqldbtype.int).value = drow["itemid"]; command.parameters.add("@itemname ", sqldbtype.varchar).value = drow["itemname"]; command.executenonquery(); comman...

java - Yarn MapReduce job dies with strange message -

i have hadoop-yarn cluster, when try run hadoop examples strange error message in container log: error: not find or load main class 1638 my java version is: java version "1.7.0_51" java(tm) se runtime environment (build 1.7.0_51-b13) java hotspot(tm) 64-bit server vm (build 24.51-b03, mixed mode) running services on master: 593 nodemanager 373 secondarynamenode 745 jobhistoryserver 507 resourcemanager 129 namenode 240 datanode running services on slave: 51 datanode 136 nodemanager 351 jps i execute following command: bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-2.6.0.jar grep input/hadoop output 'dfs[a-z.]+' and exception: 15/05/13 13:35:31 info mapreduce.job: running job: job_1431538391289_0005 15/05/13 13:35:37 info mapreduce.job: job job_1431538391289_0005 running in uber mode : false 15/05/13 13:35:37 info mapreduce.job: map 0% reduce 0% 15/05/13 13:35:37 info mapreduce.job: job job_1431538391289_0005 failed state faile...

javascript - How to use the change function for input types efficiently -

i tracking input changes this: $(document).ready(function() { $('input').change(function () { alert("key pressed"); }); $('textarea').change(function () { alert("key pressed"); }); $('input:radio').change(function() { alert("key pressed"); }); $('input:checkbox').change(function() { alert("key pressed"); }); }); is possible re-factor above code don't need call each element separately? use multiselectors refactor code :input select input elements $(':input').on('change', function () { alert("key pressed"); });

python - Throttling requests with multiple proxies -

i'm assigning random proxies requests via custom middleware. i'd key download throttling specific proxy request using, far can tell, out of box, possible when tied domains or ips. i'm worried implementing pooling logic in proxy middleware cause thread safety issues. has done before? pointers appreciated. as recommended on scrapy mailing list , there special request meta variable autothrottle middleware obeys , called download_slot - allows programmatic grouping/throttling of requests. in custom proxy middleware: self.proxies = get_proxies() #list of proxies proxy_address = random.choice(self.proxies) request.meta['proxy'] = proxy_address request.meta['download_slot'] = hash(proxy_address) % max_concurrent_requests i use hash function cheap way bucket requests externally defined limit on requests.

How to show count of any jstree in google analytics -

i using google tag manager fire tags website, created custom javascript variable returns count of jstree selection (i.e how many users selected how many items) , placed trigger on count, wanna know if there way can see count on google analytics page analyse how many users selecting how many items? found answer myself, hope others too. to show count of custom variable created on google tag manager on google analytics page possible creating custom dimensions on google analytics. steps doing below :- go google analytics account, open admin section. -then go under property-->custom definations , select custom dimensions click on new custom dimension add name , select scope "session" , click on create (note :- please note dimension index). go google tag manager, create new tag, click on more settings under "configure tag" , add custom dimension, place index number , dimension value(custom variable created) here. set firing rule , save it. now,...

ios - imageWithContentsOfFile memory issue -

my project having image sharing functionality. in functionality app asks user library want share. i wrote below code assign image, retrieved default library/custom library. device default library imgvwmediafile.image = [uiimage imagewithcgimage:[asset thumbnail]; //(alasset *)asset custom library (images @ documents/image/user) imgvwmediafile.image = [uiimage imagewithcontentsoffile:path]; //(nsstring*)path app displyas images in collection view having custom cell. when select app custom library images retrieves documents directory ,but imagewithcontentoffile cosuming around 90 100 mb memory. in other case when select app default libray, not cosuming more 8 or 10 mb memory. i tried diffrent code stack q/a custom library, still memory issue there. -1- cgimageref iref = [[uiimage imagenamed:asset] cgimage] ; imgvwmediafile.image=[uiimage imagewithcgimage:iref]; iref=nil -2- nsdata *imagedata = [[nsdata alloc] initwithcontentsoffile:path]; imgvwmediafil...

What is the right way to do "loose coupling" in python? -

hello wrote code data using pyserial below. class depend on serial class doesn't meet "loose coupling" rule. should use interface decouple class? lot instruction. import serial class arduinoconnect: def __init__(self): pass def serial_connect(self, serial_port, serial_baudrate): self._serial_port = serial_port try: self.ser = serial.serial( port=self._serial_port, baudrate=serial_baudrate, parity=serial.parity_none, stopbits=serial.stopbits_one, bytesize=serial.eightbits, ) except serial.serialutil.serialexception, e: print str(e) def serial_disconnect(self): self.ser.close() def get_quaternion(self, number_of_data=50): buff = [] self.ser.write('q') self.ser.write(chr(number_of_data)) j in range(number_of_data): in_string = self.ser.re...

msbuild - How to make only one target BuildInParallel? -

i having target build checkin assemblies. <target name="corebuildcheckinsubsystem" dependsontargets="builddotnetsolutions;checkinsubsystemdos"> </target> in builddotnetsolution build list of solution in order. not want buildinparallel checkinsubsystemdos checkin dlls. if checkin process being done in parallel save time me. how make checkinsubsystemdos alone in buildinparallel? an important thing note msbuild, parallelization done on level of project. targets within same project executed sequentially, while 2 different project might (or might not) executed in parallel. rephrase way, if want msbuild execute concurrently, have create multiple projects , invoke them within same <msbuild> task. in case, code this. have list of projects or solutions build: <itemgroup> <myprojects include="one.proj"/> <myprojects include="two.proj"/> <myprojects include="three.proj"/> ...

Architecture Design - REST API to support Facebook Login done by Mobile app -

Image
i trying design rest apis support various mobile clients (ios , android apps). these apps let user login using facebook login along our own email authentication. can refer diagram below understand design there 2 levels of authorization take place: first 1 "client (or app) authorization" uses oauth2. when user install our app on mobile device, , starts app, first thing, app makes "client (app) authorization" shown in above diagram (1st image). , server sends long-lived access_token client use subsequent calls. here question are: q1) can see client sending client_key , client_secret , storing them in client_info table. should secret in plain text or should in decryt-able format? if encrypt it, still need keep encryption key somewhere in system. how make secure? in every call, decryption overhead. q2) ok cache access_token client in plain text format in redis , use cache first? q3) in order safe, asking clients send appsecret_proof make sure acces...

javascript - chrome.runtime.getManifest() is not defined -

Image
i'm trying work javascript accesses chrome.runtime in google chrome. script calls chrome.runtime.getmanifest() function, console says function not defined. i've read through google's documentation on subject, , should there. i've done research, , else, using function seems non-issue, feel i'm missing something. however, when run console.log(chrome.runtime); see this: it appears 2 functions defined in object, connect , sendmessage. what missing? i found answer. these functions available when javascript running chrome app.

node.js - Node MongoDB Native - filter by date/time -

in native mongodb, following limits full text search articles published in past 6 hours: db.getcollection('articles').find({ $and: [{ $text: { $search: 'stackoverflow' } }, { $where: function() { return date.now() - this.published.gettime() < (6 * 60 * 60 * 1000) } }] })... the above not work on node.js node-mongodb-native - whole $where object ignored, doesn't throw error. there other way can limit query results based on time? try creating datetime object prior using in query constructing new date value of current timestamp minus 6 hours follows: var sixhours = 6 * 60 * 60 * 1000; /* ms */ sixhoursago = new date(new date().gettime() - sixhours); db.getcollection('articles').find({ $text: { $search: 'stackoverflow'}, published: { $gte: sixhoursago } }) or use momentjs library pretty handy when dealing dates, in particular subtract() method v...

How to apply filter number to input value | Angularjs -

i need apply angular's filter number input value directly. i thought code below must work, doesn't.. <input type="text" ng-model="product.price" value="{{product.price | number}}" required> is possible implement default angular resources? without writting directives? this can achived using regex or ng-pattern. <input type="text" ng-model="product.price" ng-pattern="/^(\d)+$/" required> 2.if want format data value, can this. $scope.product.price= parseint($scope.product.price)

android - Application Installer abnormal process termination -

[error] application installer abnormal process termination. process exit value 1 thu may 14 2015 10:23:15 gmt+0530 operating system name = microsoft windows 8.1 enterprise version = 6.3.9600 architecture = 32bit # cpus = 4 memory = 8468078592 node.js node.js version = 0.10.13 npm version = 1.3.2 titanium cli cli version = 3.4.2 titanium sdk sdk version = 3.5.1.ga sdk path = d:\programes\titanium\titaniumsdk\mobilesdk\win32\3.5.1.ga target platform = android command node c:\users\sameera\appdata\roaming\npm\node_modules\titanium\bin\titanium --no-colors --no-progress-bars --no-prompt build --platform android --log-level trace --sdk 3.5.1.ga --project-dir e:\navotarlatest --target emulator --android-sdk d:\programes\titanium\androidsdk --device-id titanium_1_wvga800 --skip...

html - CSS for image like in facebook and other social media -

i want make "profile picture" thing on website. don't how generate without making picture stretch or pixelated here sample code way i'm using bootstrap css framework. <div class="center-block" style="background-image:url(img/1.jpg); width: 200px; height: 200px; background-size: cover; display: block; border-radius: 100px; -webkit-border-radius: 100px; -moz-border-radius: 100px;"> try can make style play around css... div { float: left; margin: 5px; } .profile_1 { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; } .profile_1 img { max-width: 120px; max-height: 120px; } .profile_2 img { width: 120px; height: 120px; border-radius: 50%; border: solid 3px #000; } .profile_3 img { width: 120px; height: 120px; border-radius: 10px; bor...

ruby - Rails add quantity to cart -

i have question: @order_item = @order.order_items.find_or_initialize_by(product_id: params[:product_id]) i want add 1 order item’s quantity before .save called. the default value of quantity 0 . here complete code: def create @order_item = @order.order_items.find_or_initialize_by(product_id: params[:product_id]) respond_to |format| if @order_item.save format.html { redirect_to @order, notice: 'successfully added product cart.' } format.json { render :show, status: :created, location: @order_item } else format.html { render :new } format.json { render json: @order_item.errors, status: :unprocessable_entity } end end end im new ruby , rails. how that? thank you update <tr> <th>items:</th> <td><%= @order.order_items.count %></td> </tr> <tr> <th>items</th> <th>title</th> <th>quantity</th> ...

animation - How to animate whole LinearLayout and its inside views Android? -

i have linearlayout, contains imagebuttons. want fadeout linearlayout , children. tried use alphaanimation. if start animation imagebutton inside linearlayout, works fine. when start animation linearlayout instead of imagebuttons, nothing happens. can me? you can try following animation xml <?xml version="1.0" encoding="utf-8"?> <set xmlns:android="http://schemas.android.com/apk/res/android" android:interpolator="@android:anim/linear_interpolator"> <alpha android:fromalpha="0.0" android:toalpha="1.0" android:duration="5000"/> </set> and can try following code snippet linearlayout layout = (linearlayout)findviewbyid(r.id.mainlayout); animation anim = animationutils.loadanimation(this, r.anim.fade_in); layout.startanimation(anim); its worked fine me.

c# - Combining consecutive date period -

i have date period list , period doesn't overlap |startdate| enddate| | null | 1/12 | | 2/12 | null | | null | 4/12 | | 6/12 | 8/12 | | 9/12 | null | | null | 10/12 | | 11/12 | null | i have combine period list shown following: |startdate| enddate| | null | 1/12 | | 2/12 | 4/12 | | 6/12 | 8/12 | | 9/12 | 10/12 | | 11/12 | null | here solution think not smart way var datelist = periodlist.selectmany(x => new[] { new {date = x.item1, type = "s"}, new {date = x.item2, type = "e"} }).where(x => x.date != null).orderby(x => x.date).toarray(); var result = new list<tuple<datetime?, datetime?>>(); int = 0; { if (i == 0 && datelist[i].type == "e") { result.add(new tuple<datetime?, datetime?>(null, datelist[i].date)); } ...

c# - Update table using linq -

i want update table not working here code: public boolean setsectionticksign(decimal trans_id, decimal job_id, string sectioname) { string sectionames = ""; transcription_master trans_mastr = new transcription_master(); try { var trans_master = (from trans_mast in r2ge.transcription_master trans_mast.transcription_id == trans_id && trans_mast.entity_id == job_id select new { trans_mast.completed_trans_sections }).distinct().tolist(); var complt_trans = trans_master.asenumerable().where(dr = > dr.completed_trans_sections != null).tolist(); if (complt_trans.count == 0) { if (sectionames == "") { trans_mastr.completed_trans_sections = sectioname; } } else { trans_mastr.completed_trans_sections = "," + sectioname; } int sc = r2ge.savechanges(); } } it not...

java - How do I add a score counter to this snake game? -

i want able display score players, , have score go 10 every time apple. though, need add space on window allow room score counter, can't find in code. import java.awt.color; import java.awt.dimension; import java.awt.graphics; import java.awt.event.keyevent; import java.awt.event.keylistener; import java.util.arraylist; import java.util.random; import javax.swing.jpanel; public class screen extends jpanel implements runnable { private static final long serialversionuid = 1l; public static final int width = 800, height = 900; private thread thread; private boolean running = false; private bodypart b; private arraylist<bodypart> snake; private apple apple; private arraylist<apple> apples; private random r; private int xcoor = 20, ycoor = 20; private int size = 10; private boolean right = true, left = false, = false, down = false; private int ticks = 0; private key key; public screen() { s...

c++ - How to create polygons to display running number in cocos2dx -

i'm trying create node rectangle number in it. , how i'm doing now: int size = 100, fontsize = 64; auto node = drawnode::create(); vec2 vertices[] = { vec2(0,size), vec2(size,size), vec2(size,0), vec2(0,0) }; node->drawpolygon(vertices, 4, color4f(1.0f,0.3f,0.3f,1), 0, color4f(1.0f,1.0f,1.0f,1)); auto texture = new texture2d(); int numbertodisplay = 2000; std::string s = std::to_string(numbertodisplay); texture -> initwithstring(s.c_str(), "fonts/marker felt.ttf", fontsize, size(size, size), texthalignment::center, textvalignment::center); auto textsprite = sprite::createwithtexture(texture); node -> addchild(textsprite); textsprite -> setposition(size/2, size/2); every time want change number have re-create texturesprite, remove current child , add new one. there better way it? i wonder whether want special features, why not use layercolor , labelttf? layercolor* node = layercolor::create(color4b(255, 85, 85, 255), 100, ...

swift - Subclassing SLKTextViewController -

i have viewcontroller tableview runs correctly. now trying subclass slktextviewcontroller app crashes. have subclassed incorrectly (following this example )? slktextviewcontroller subclass: import uikit class commentstextviewcontroller: slktextviewcontroller { var foodphotoobject: pfobject? var usernametext = "" var distancelabeltext = "" var userphotouiimage: uiimage? var mainrestaurantuiimage: uiimage? // comment arrays var photocommentobjects: [anyobject] = [] var commentusers: [pfuser] = [] var commenttext: [string] = [] @iboutlet var mainrestaurantimageview: pfimageview! @iboutlet var userphoto: uiimageview! @iboutlet var username: uibutton! @iboutlet weak var distancelabel: uilabel! override func viewdidload() { super.viewdidload() setuptableviewcells() // load comments fetchcomments() self.tableview.registerclass(commentscell.self, forcellreuseide...

continuous integration - Poll multiple perforce streams with jenkins -

i have jenkins server monitoring perforce server. perforce using streams mainline model. using jenkins monitor changes in perforce , setting off scripts depending on checked in where. works great on main stream monitor streams below well. when set job who's sole purpose monitor other streams polls main stream in spite setting specifications of job other stream. suspect because local perforce instance on machine using run master jenkins instance connected main stream. if case use additional machine slave connected additional stream strictly polling. there lot of streams seems enormous waste of resources. tried creating different workspace mapped stream want didn't work either. does know way can around this? try p4 plugin, implementation using p4java , supports streams. either select 'manual' workspace behaviour , provide stream path, or use 'stream' workspace , jenkins create workspace you.

javascript - jQuery Slider Min Value -

i know there min value in jquery's slider. however, there way can make slider handle stop moving under value? there variable can change make happen? note: slider vertical basically, if minimum 20, don't want slider handle going under 20. well can check in slide functionality below: demo here $(function() { $( "#slider-range" ).slider({ orientation: "vertical", range: false, value:20, slide: function( event, ui ) { if (ui.value < 20) // corrected return false; else $( "#amount" ).val( ui.value ); } }); $( "#amount" ).val( $( "#slider-range" ).slider( "value" ) ); });

c++ - Mapping a texture with OpenGL using SOIL -

trying complete basic texture map surface using opengl , soil not generating anything. gluint textureid[5]; glutinitwindowposition(0, 50); windowid[0] = glutcreatewindow("orthogonal projection, cubes"); glmatrixmode(gl_projection); glloadidentity(); glortho(-400, 400, -400, 400, -500, 500); glmatrixmode(gl_modelview); glloadidentity(); glutkeyboardfunc(keyboard); glutdisplayfunc(drawwindowone); textureid[0] = soil_load_ogl_texture("assets/facea.png", soil_load_auto, soil_create_new_id, soil_flag_invert_y); void drawwindowone() { glclearcolor(0.0, 0.0, 0.0, 0.0); glclear(gl_color_buffer_bit); glviewport(0, 0, 250, 250); glmatrixmode(gl_modelview); gltexenvf(gl_texture_env, gl_texture_env_mode, gl_replace); gltexparameteri(gl_texture_2d, gl_texture_wrap_s, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_wrap_t, gl_repeat); gltexparameteri(gl_texture_2d, gl_texture_min_filter, gl_nearest); ...

How to create Modal Dialog with MVVM Light -

what correct way open modal dialog in wpf using latest version of mvvm light framework. want able pass values viewmodel of window used modal dialog. i cannot find samples on mvvm light site. you should use dialogservice abstracts visual representation of view can "show" within view model (and later possibly/hopefully) mock testing. more info on dialogservice here . -edit- wrong, alan rutter (op) points out idialogservice simple message boxes. don't think mvvm light here can build similar service (e.g. icustomdialogservice?). custom dialogs can register available service, , interface provides calls allow invoke specific dialog name (string or enum perhaps) , pass parameters want. dialogs can register service in few different ways - can happen type in static constructors (that somehow have force) or more explicitly through attributes in assemblies. possibly using class attributes. depends on startup sequence , general infrastructure.

iOS In-App Purchase: Managing auto-renewing subscriptions -

i'm working on incorporating in-app purchases ios application. primary offering auto-renewing-subscription based. question concerns subscription management. it not possible (afaik) manage ar subscriptions in sandbox environment. apple's documentation here on expiration , renewal , here on managing subscriptions indicate user may disable auto-renewal , renew @ later date. in event of disable action taken device appstore, auto-renew option remain available in perpetuity -- e.g., in iap programming guide example there lapse of 2 months before user renews. year? assume since record of ar transaction persists indefinitely, app store capability manage subscription? assume caveat here product offering still available in store. anyone have experience this? from experience user, subscribed auto-renewal app , turned off renewals. subscription expired jan. 27, 2015 (5 months ago) , deleted app phone after. after deleting app, renewal settings disappeared itunes st...

github - Can't Clone Git Repository -

i trying clone repository @ https://github.com/aporter/coursera-android-labs/tree/master/theactivityclass/lab2_activitylab command git clone https://github.com/aporter/coursera-android-labs/tree/master/theactivityclass/lab2_activitylab but says can't find repository. should simple , can clone other repositories. thanks. the path gave not repo, sub directory of repo. try instead: git clone https://github.com/aporter/coursera-android-labs

javascript - Delay directive/div until scope value available -

i have custom directive soundcloud requires soundcloud url. soundcloud url fetched database through $http service, however, div soundcloud custom directive loaded , requires value of soundcloud url before defined. the plangular directive code got here: https://github.com/jxnblk/plangular/blob/master/src/plangular.js *i did not develop this this html code: <div plangular="{{soundcloud}}"> <button ng-click="playpause()">play/pause</button> <progress ng-value="currenttime / duration || 0"> {{ currenttime / duration || 0 }} </progress> </div> and angular code: displaysong.controller('song', ['$scope', '$http', 'fetchsong', function($scope, $http, fetchsong) { $scope.songid $scope.songname; //controller properties $scope.songpromise; //the song promise fetching $scope.init = function(songid, userid) { $scope.songid = songid; $scope.userid = u...

python - Pygame - Moving Sprites at Different Speeds -

i working on mechanics of several sprites using. working on game involves collecting coins. have sprite image of spinning coin. created class coin sprite , wrote update function switches 1 image sprite next. coin spinning problem i'm having is spinning fast. how can slow dow spinning of coin? appreciated. thanks! here coin class: class coins (pygame.sprite.sprite): coin_spin_frames = [] def __init__(self, x, y): pygame.sprite.sprite.__init__(self) sprite_sheet = spritesheet('stuff/coins_1.png') image = sprite_sheet.get_image(0, 0, 40, 42) self.coin_spin_frames.append(image) image = sprite_sheet.get_image(0, 42, 40, 42) self.coin_spin_frames.append(image) image = sprite_sheet.get_image(0, 84, 40, 42) self.coin_spin_frames.append(image) image = sprite_sheet.get_image(0, 130, 40, 42) self.coin_spin_frames.append(image) self.image = self.coin_spin_frames[0] self.rect = self.image.get_rect() self.rect.x = x self...

java - Android Admob not showing in emulator it is blank -

i have been following android quick start tutorial https://developers.google.com/mobile-ads-sdk/docs/admob/android/quick-start put admob on emulator , not working missing.i have copied tutorial word word , not work.also have checked logcat , got error could not find class 'android.app.appopsmanager',referenced method com.google.android.gms.common.googleplayservicesutil.zza . seems internal error them.i have upgraded new android studio 1.2.1.1 worth .here basic code main.java protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); adview madview = (adview) findviewbyid(r.id.adview); adrequest adrequest = new adrequest.builder().build(); madview.loadad(adrequest); } acitivity_main.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_wid...

python - Django multiple model inheritance, django-push-notifications -

i writing end mobile app using django 1.8. django-push-notifications lib provides gcmdevice model. problem have device model mandatory field , logic don't want lose. what wanted inherit whole gcmdevice functionality , adjust them device model(which btw inherits mixin providing spatial data fields, custom object manager set want keep). read 3 different django model inheritance ideas none of them seem solve problem (keeping managers, provide django-push-notifications functionality, keeping device model fields). maybe onetoone association work? idea: class device(mymixin): gcm_device = models.onetoonefield(gcmdevice) my_other_field = models.textfield() def send_message(self, payload): self.gcm_device.send_message(payload) any reason why necessary inherit? composition substitute trying inheritance? ----------------- edited answer ----------------- class device(models.model): ... gcm_device = models.onetoonefield(gcmdevice) i h...

php - Check a multidimensional array input in javascript -

i have input type hidden in loop, it's multidimensional array , has 1 input name. how can check if there value in it? value or element? code: (the array generated in php in loop) echo "<td class='$border'> <div class='dropzonepers'></div> <input type='hidden' value='' name='pers[$dag][$j]'/> </td>"; what have tried in js: if($(".pers").length !> 0) { alert("no!"); return false; } how can that? grab input elements have name starts "pers" , see if not empty function persisempty() { var empty = true; $('input[type="hidden"][name^="pers"]').each(function () { if ($(this).val().length > 0 && $(this).val() != '') { empty = false; } }); return empty; } //...so like if (persisempty()) { alert("no!"); return false; } see: https:...

Apache Vhost 301 Redirect with variable -

in apache vhost i'm trying following 301 redirect redirect 301 /?name=true http://example.com/directory/?fubar&name=true it compiles correctly , runs, when visit that, apache seems ignore , doesn't work expected. edit: here config sanitized. <virtualhost *:80> serveradmin email@email.com documentroot /var/www/html/old-example servername old-example.com errorlog /var/log/httpd/old-example/error.log <directory /var/www/html/old-example> redirect 301 /?name=true http://example.com/directory/?fubar&name=true redirectmatch 301 /(.*) http://example.com/directory/$1?fubar </directory> </virtualhost>

css - Is the following Bootstrap html structure acceptable -

i want know if there problem if following using bootstrap 3 html structure? after reading documentation , examples of them recommend doing following structure <div class="row"> <div class="col-lg-4" ></div> <div class="col-lg-4" ></div> <div class="col-lg-4" ></div> </div> but using angular in our application , sizes of each panel change , each panel have it's own controller knows when expand or not. thought controller or state manager don't know @ moment final ui definitions. so question is problem following structure? <div class="row"> <div> <div class="col-lg-4" ></div> </div> <div> <div class="col-lg-4" ></div> </div> <div> <div class="col-lg-4" ></div> </div> </div...

r - h2o randomForest variable importance -

i using h2o package create randomforest regression model. have problems variables importance. model creating here. works fine. some of variables numeric, categorical. randomforest <- h2o.randomforest(x = c("year", "month", "day", "time", "show", "gen", "d", "lead"), y = "ratio", data = data.hex, importance=t, stat.type = "gini", ntree = 50, depth = 50, nodesize = 5, oobee = t, classification = false, type = "bigdata") however, when want see variable importance, output looks this. classification: false number of trees: 50 tree statistics: min. max. mean. depth 30 40 33.26 leaves 20627 21450 21130.24 variable importance: year month day time show gen d lead relative importance 20536.64 77821.76 26742.55 67476.75 283447.3 60651.2...

Escaping special characters when using OKTA REST API -

Image
i'm using okta's rest api http://developer.okta.com/docs/api/getting_started/design_principles.html . seems api not allow angle brackets if escaped \ (field: value must not contain html tags) though okta's api allow if entered directly in ui (e.g. last name when editing profile). i'm wondering how can same achieved via api? angle brackets disallowed both ui , api. example, in ui, if attempted place angle brackets in lastname field, error message stating "the field must not contain html tags". in api, 400 message following errorcause: { "errorsummary": "lastname: field must not contain html tags" } if absolutely have include angle brackets in username fields, may want consider representing them &lt; , &gt;

Can a SSH key created by one User ID be used by other ID for SFTP? -

i new to unix scipt , sftp process. need write ksh script can transfer files sftp server. have created ssh key pairs. have developed ksh code well. every time ksh script being executed other id , prompting password when executing same not asking password though group id these 2 user ids same. below section sending files ################################################### # sftp mft ---> sftp mft ---> sftp mft # ################################################### # execute sftp command put file on mft # # $1 - ssh private key file # # $2 - sftp user id @ mft server # # $3 - source directory (to take files from) # # $4 - mft directory (to place files into) # # $5 - file mput # # $6 - mft pwd # ################################################### function sftpputtomft { sftp -o identityfile=${1} ${2} >> $sftp_log << endsftp lcd ${3} cd...