Posts

Showing posts from January, 2014

maven - Displaying version and date of build in the xhtml page from manifest in run time -

enumeration<url> resources = getclass().getclassloader() .getresources("meta-inf/manifest.mf"); //can't find resource name meta-inf/manifest.mf ? the correct resource name /applications/projectname/meta inf/manifest.mf . replace projectname project name. updated code according below: . . enumeration resources = getclass().getclassloader() .getresources("/applications/projectname/meta inf/manifest.mf"); . .

html - Php Login Error - unsuccessful login -

i need site login part. 1-i enter right login info on index.php. 2-then redirect me "giris.php" , "your login succesfull". 3-then site directed me panel.php , "your login not successfull" where mistake? couldnt find. thanks this index login box; index.php <?php include('connect.php'); session_start(); if(isset($_session["kullanici"]) && isset($_session["sifre"])){ /*if created username , password sessions*/ echo "hoÅŸgeldiniz, ".$_session["kullanici"]; /*we wrote welcome username*/ ?> <a href="panel.php" class="mybutton">profile</a><a href="p...

c# - Unable to extract values from object array, to which javascript array was deserialized -

var serializedarray = new javascriptserializer().deserialize<object[]>(filter); the content of variable filter [["title","contains","foo"],"and",["name","contains","foo"]] . content of serializedarray "object[3]","and","object[3]" . content of serializedarray[0] object[3] "title", "contains", "foo" . serializedarray can used index operator, , foreach applicable. not serializedarray[0] . funny enough, both serializedarray , serializedarray[0] have type of object[]. what's way grab value "title" or "name"? var serializedarray = new javascriptserializer().deserialize<object[]>(filter); foreach (var item in serializedarray) { if (item string) { var element = item; } else ...

python 2.7 - error: <destination> color.cpp:3650: error: (-215) scn == 3 || scn == 4 in function cvtColor -

i'm trying record video using cv2.videowriter frames 2 channels rather 3 or 4, error describes. how can fix frames able part of video? here's guts of function: video = cv2.videocapture('video.mp4') fourcc = cv2.cv.cv_fourcc('d', 'i', 'v', 'x') out = cv2.videowriter("video.mov", int(fourcc), int(get_framerate(video)), (int(get_width(video)), int(get_height(video))), 0) while(video.isopened()): ret, frame = video.read() if (ret == true): grayframe = cv2.cvtcolor(frame, cv2.color_rgb2gray) ret, final_frame = cv2.threshold(grayframe, 65, 255, cv2.thresh_binary) cv2.imshow("frame", final_frame) out.write(final_frame) else: break if cv2.waitkey(10) == 27: cv2.destroyallwindows() break video.release() out.release() return the image showing, when reaches out.write, spits out error: error: /tmp/opencv...

html - Stacking Font-Awesome Star Icons (fa-star & fa-star-half) -

Image
i want stack 2 font awesome icons fa-star , fa-star-half , having alignment issues. see image below: here html: <span class="fa-stack"> <i class="fa fa-fw fa-lg fa-star-half fa-stack-1x"></i> <i class="fa fa-fw fa-lg fa-star fa-stack-1x"></i> </span> ...and css: a-stack i.fa-star { color:transparent; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color: orange; } .fa-stack i.fa-star-half { color:yellow; -webkit-text-stroke-width: 1px; -webkit-text-stroke-color: orange; } note not want use fa-star-half-o has unappealing design when used outline. i have tried use "float," without success. if use "margin-left," spacing off. see image below: any appreciated. thanks! jesse use following margin-left line image. check out here: https://jsfiddle.net/f63h157x/1/ .fa-stack i.fa-star-half { color:yellow; -webkit-text-str...

xcode - Swift - How to make one action if 2 buttons are pressed? -

in main.storyboard , have gun button , shield button. both buttons clicked @ same time (not same time know mean). how make 1 action after both buttons clicked? in case if gun , shield clicked want make label defended. pretty asking how in view controller... something should trick. connect both buttons each ibaction , , make sure onbuttondown: trigger control event .touchdowninside , , onbuttonup: trigger both .touchupinside , .touchdragexit . class viewcontroller : uiviewcontroller { var buttonspressed: [uibutton] = [] // triggered .touchdowninside @ibaction func onbuttondown( sender: uibutton ) { self.buttonspressed.append( sender ) if self.buttonspressed.count == 2 { // both buttons pressed } } // triggered .touchupinside , .touchdragexit @ibaction func onbuttonup( sender: uibutton ) { in 0..<self.buttonspressed.count { if self.buttonspressed[i] == sender { self...

python - defining functions with optional arguments -

hi i'm trying understand how implement optional arguments in python function. example, in basic function below def ham(p,*q): if q: print p+q else: print p ham(2) ham(2,3) i expect ham(2) return '2' does, ham(2,3) gives error. edit: many thanks. many of answers useful. in particular example, think mean do: def ham(p,q=none): if q: print p+q else: print p that is, give q default value of none , calculate p+q if q provided. simpler be: def ham(p,q=0): print p+q

html - Text page over footer -

Image
i need put text page on footer illustrated in picture attached. important length of page set auto according text in page. add negative margin top of footer , set z-index of 2 text. .footer{ margin-top: -100px;} .text-page {position: relative; z-index: 2;}

iOS Share Extension Grabbing URL in Swift -

i'm trying create ios share extension in swift. when user in safari , opens share extension, want able grab url , use in app. know can put code below in didselectpost() function in shareviewcontroller text user enters in share extension, how url of web page user on when click share extension? i'm new ios extensions, appreciated. let sharedefaults = nsuserdefaults(suitename: "groupname") sharedefaults?.setobject(self.contenttext, forkey: "stringkey") sharedefaults?.synchronize() this how url: - (void)didselectpost { nsextensionitem *item = self.extensioncontext.inputitems.firstobject; nsitemprovider *itemprovider = item.attachments.firstobject; if ([itemprovider hasitemconformingtotypeidentifier:@"public.url"]) { [itemprovider loaditemfortypeidentifier:@"public.url" options:nil completionhandler:^(nsurl *url, nserror *error) { ...

javascript - how to insert php into jquery append via ajax? -

i have checked few posts "how insert php jquery?" don't seem find want. not sure if work have todo list in php , trying implement ajax it. in ajax upon success want appened <a href="done.php?as=done&item=<?php echo $item['id']; ?>" class="done-button">done</a> but somehow stuck @ php part. have inside script <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script> <script> $(document).ready(function() { $(".submit").click(function(e){ var todotext = $("input[name='todotext']").val(); e.preventdefault(); $.ajax({ method: "post", url: "add-ajax.php", data: {todotext : todotext}, success: function(){ $('p.empty').empty(); $('input.input').val(''); $('ul.items').append('...

Can someone help me figure out what's wrong with this program? (C) -

i doing easy challenge on /r/dailyprogrammer in c. managed write on hundred lines of code, , spend couple hours total on (usually end chickening out), , figure out compiler errors. now, when run it, segfault. i'm doing wrong? yes, it's sort of homework help, @ least tried before coming here. #include <ctype.h> #include <stdio.h> #include <string.h> #define maxlen 50 #define limit 20 #define true 1 #define false 0 char* reverse(char *a); char* ltoa(long i); long atol(char *a); /* note: handle leading zeros. */ long palindromize(long p); int ispalindrome(long p); /* meat. */ int main(int argc, char *argv[]) { long p; int count, limr; p = (long) argv[1]; count = 0; limr = false; while (true) { p = palindromize(p); count++; if (ispalindrome(p)) { break; } else if (count == limit) { limr = true; break; } } if (limr) { ...

Dynamic pattern for vim highlight -

in vim help, there suggestion use highlight groups highlighting text greater textwidth : another example, highlights characters in virtual column 72 , more: :highlight rightmargin term=bold ctermfg=blue guifg=blue :match rightmargin /.\%>72v/ i reflect value of texwidth setup. like: match rightmargin /%\=&textwidthv.*/ but doesn't give me expected. can me parameterize overlength actual value of textwitdh . nb: plan put in filetype autocommand block , inside which, there set textwidth option , redefinition of rightmargin highlight group. i realize parameterization not save me lines of code, want know if possible @ in vim. one way it: call matchadd('rightmargin', '\%'. &tw .'v') you should put in ftplugin (see :help ftplugin ) rather autocmd .

web - Polymer paper-button not rendering -

Image
i downloaded polymer starter kit (polymer 1.0) , have been trying add simple paper button webpage, not rendering correctly. here relevant code: <section data-route="home"> <paper-material elevation="1"> <paper-button raisedbutton id='rendered' label='patient' on-click='{{clickhandler}}'></paper-button> <button>try me</button> <paper-icon-button icon="refresh" label="label"></paper-icon-button> <paper-button raisedbutton>search!</paper-button> </paper-material> </section> the first button doesn't show @ all, second normal button does, third button works, label doesn't show up, , final button renders text , isn't clickable had same problem, doesn't seem load paper-button element default. fixed adding /app/index.html page before paper-bu...

javascript - Browserify and Vue: uncaught reference error: Vue is not defined -

this first foray front-end development beyond basic jquery stuff, , i'm using vue.js along other packages browserify. main 'app.js' looks this: window.$ = window.jquery = require('jquery'); require('bootstrap'); var moment = require('moment'); var fullcalendar = require('./vendor/fullcalendar.min.js'); var datetimepicker = require('./vendor/bootstrap-datetimepicker.min.js'); var select2 = require('./vendor/select2.min.js'); var vueresource = require('vue-resource'); var vue = require('vue'); require('./videos/show.js'); require('./home.js'); require('./search.js'); vue.use(vueresource); new vue({ el: '#search', data: { message: 'hello world!' }, }); ... it works expected way, when try create new vue instance in file (in search.js, instance) can't it. 'uncaught reference error: vue not defined' in console. no problem using othe...

html - Uncaught SyntaxError: Unexpected string in my Javascript code -

i keep getting error in code , don't understand why. see line 29 of javascript. html <link href="styles12.css"; type="text/css" rel="stylesheet"> <link rel="stylesheet" href="styles12.css"/> <script src="registration.js"></script> <body onload="studentattendance()"> <head> <style> table, td, th { border: 1px solid black; } th { background-color: beige; color:black; } </style> </head> <h3 style= "font-size:25px; font-family:impact"> add student</h3> firstname: lastname: student number: <button onclick = "save()"><p>+add attendance</a></p> </button> <h2 style="font-size: 25px;font-family: im...

Is there a dictionary module in Python with ordering built-in? -

i know there ordereddict class want sort of mix between dict , priorityqueue. so if iterate on dict, i'd items ordered value. you can sort dictionary based on value so... my_dict = {...} key in sorted(my_dict, key=lambda x: my_dict[x]): print (key + " " + my_dict[key]) keep in mind dictionary not sorted in place, sorted representation of dictionary. also note can define basis on sort values via lambda function.

Find middle element of a double linked list in constant time complexity -

i trying find middle element of double linked list in constant time complexity . came across following http://www.geeksforgeeks.org/design-a-stack-with-find-middle-operation/ solution. don't understand how use middle pointer. can please me understand or give me better solution . i've re-written code in c++ explanation purposes: #include <iostream> typedef class node* pnode; class node{ public: pnode next; pnode prev; int data; node(){ next = nullptr; prev = nullptr; data = 0; } }; class list{ private: //attributes pnode head; pnode mid; int count; //methods void updatemiddle( bool _add ); public: //constructors list(){ head = nullptr; mid = nullptr; count = 0; } ~list(){ while( head != nullptr ){ this->delmiddle(); std::cout << count << std::endl; } } //methods void push( int _...

xml - Xpath for Find & Replace? -

fellow forum members, i'm new xpath , have following question. let's example have 300 separate xml files , need make global text change may impact 40 of xml files. possible using xpath perform find & replace operation among 300 xml files? let's example words need globally change these words, "lbrt assembly" change "lbrs assembly". xpath offer ability perform such operation? know xpath @ querying xml elements. however, can perform find , replace operation? best application available 1 can use assist 1 in coding complex xpath query commands? opinion welcomed. in advance. xpath cannot modify xml file. need xslt or xquery. if global change (that is, if want change text regardless of context appears) inclined myself using text editor: goes against advice invariably give says when processing xml data should use xml tools. if finding text change depend on xml context, write little xslt 2.0 program it: it's dozen lines. core be: (a) ...

php - How to include the image from byte array with other content in codeigniter? -

i trying make profile view of user using image byte array. have rendered image, have problem including image other profile content, because of header('content-type: image/png') takes whole file image. how resolve problem? $myarray = implode('', array_map(function($e) { return pack("c*", $e); }, $image)); if (substr($myarray, 0, 4) == "\x89png") header('content-type: image/png'); else if (substr($myarray, 0, 2) == "\xff\xd8") header('content-type: image/jpeg'); else if (substr($myarray, 0, 4) == "gif8") header('content-type: image/gif'); echo $myarray; you can't serve raw image data part of html document. there couple of ways can go serving image: base64 encode , embed in img src. see thread example . save image file , serve other image. #2 had advantage of allowing image cached browser. if images large try work out way save file.

How to transform a tabular data into transactions in spark(scala)? -

i have order transaction dataset, looks following table 1,john,iphone cover,9.99 2,jack,iphone cover,9.99 4,jill,samsung galaxy cover,9.95 3,john,headphones,5.49 5,bob,ipad cover,5.45 i considering grouping data within differences different transactions. example, group product 1,2,4 transaction list list(1,2,4) absolute differences in price less 1. , on other hand, put product 3, 5 same transactions list(3,5). i know can in python following code: f = open('test.csv', 'r') current_price = 0 res = [] ary = [] id, line in enumerate(f.readlines()): dt = line.strip().split(',') if id ==0: current_price = float(dt[3]) if abs(float(dt[3]) - current_price) < 1: ary.append(dt[0]) else: res.append(ary) current_price = float(dt[3]) ary = [dt[0]] res.append(ary) print res but scala functional programming language, how achieve same goal functional programming style? something this: val xs =...

html - how to populate a nevigation bar from a data base -

i tried populate dynamic navigation bar using data base.there maintab , subtab tables. i tried code did not work : <nav id="bb" class="navbar navbar-default"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="#">home</a> </div> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav ...

android - Minimum installation for showing CURRENT / TOTAL INSTALLS on Google play -

i have published 2 apps on google play store , curious know if there constraints show current / total installs because it's more 24 hours , still blank while ratings showing both apps . is there 50 100 or installation google show data? there no minimum value of installs show them. so can see 1 installation of app in list. if press on app , choose statistics tab see stats collecting 2 days before current day. so should wait 2-3 days see previous days statistics.

parsing - Parse "div" which have no name or id , only class atrribute , with htmlClener in android -

i trying parse html webpage have div elements class attribute. need extract information it. multiple div element need traverse through dom. can't identify div element. switch jsoup , it's awesome! in opinion should use jsoup . java html parser. feature listed below. ability fetch web pages network very simple , straightforward api css selector tagert html element(s). for example want div elements class foo document doc = jsoup.connect("http://website.com/").get(); elements divs = doc.select("div.foo");

django - How to pass attrs to forms.DateField? -

in forms.py have this: date_of_birth = forms.datefield(widget=extras.selectdatewidget( years=range(datetime.date.today().year - 15, 1920, -1))) to create select. want pass it, attrs={'class': 'form-control'} tried in different ways no results. that kind of information gets passed widgets: date_of_birth = forms.datefield( widget=extras.selectdatewidget( years=range(datetime.date.today().year - 15, 1920, -1), attrs={'class': 'form-control',} ) )

Rails - PSQL command line query -

i'm trying make app in rails 4 using psql database. i've created 3 models project, scope , background. the relationships between them are: project has 1 scope scope has 1 background, , belongs project background belongs scope i can't figure out how read psql documentation. have connected database , want search background based on project id. my problems are: i know how run 1 search in psql - select * "backgrounds"; want know how search specific record in background table i don't have project_id foreign key in background table. have scope_id foreign key. however, want search project's background. how search in psql, in command line, background, project id = 5? thank you

sql - How to find top usage of IP pairs in PostgreSQL? -

i have table source_ip , destination_ip , usage. want find top usage ip pairs. table this: source_ip | destination_ip | usage 192.168.1.1 | 192.168.1.2 | 20 192.168.1.2 | 192.168.1.1 | 30 192.168.1.3 | 192.168.1.2 | 20 192.168.1.2 | 192.168.1.3 | 20 for example 2 records 1 pair. source_ip | destination_ip | usage 192.168.1.1 | 192.168.1.2 | 20 192.168.1.2 | 192.168.1.1 | 30 finally want this 192.168.1.1 , 192.168.1.2 used 50 b 192.168.1.2 , 192.168.1.3 used 40 b this query, with t1 as( select source_ip, distination_ip, sum(usage) receiver group source_ip, distination_ip ) select distinct * t1 join t1 t2 on t1.source_ip = t2.distination_ip , t1.distination_ip = t2.source_ip and query return this: source_ip | destination_ip | usage | source_ip | destination_ip | usage 192.168.1.1 | 192.168.1.2 | 20 | 192.168.1.2 | 192.168.1.1 | 30 192.168.1.2 | 192.168.1.1 | 30 | 192.168.1.1 | 192.168.1.2 ...

css - Put two checkboxes horizontally, one beside the other, in bootstrap -

i have form code, 2 checkboxes @ end of it. want checkboxex align horizontally 1 beside other: <div class="form-horizontal"> @html.hiddenfor(x => x.categoriaid) @html.hiddenfor(x => x.nombrecategoria) <hr /> @html.validationsummary(true, "", new { @class = "text-danger" }) <div class="form-group"> @html.labelfor(model => model.nombrecategoria, "tipo de producto", htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> <label class="form-control-static" style="color:#ff6a00">@model.nombrecategoria</label> </div> </div> <div class="form-group"> @html.labelfor(model => model.titulo, htmlattributes: new { @class = "control-label col-md-2" }) <div class="col-md-10"> @html.editorf...

R: Multible line in a plot using curveid -

Image
i'm researcher , not programmer. i have used drc package, analyze data. there can define curveid , plot multiple lines in 1 plot. i need same thing normal plot, knowledge little :( my data looks this: time type material value1 value2 1 1 x 34 123 1 3 x 44 164 1 1 b x 56 234 1 2 b x 23 145 1 3 b x 45 343 1 1 y 45 243 ... now want e.g first plot value1 ~ time, , every material own line. maybe value2 ~ time , every type own line. may intention scrip @ beginning declare column contain x, y , curveid. , plot drc package. i try use split() , subset , cbind , matplot , had problems because there time values missing. i wanted try reshape2 , couldn't install package. is there simpler solution (similar drc ) package? th...

python - flask-security login via username and not email -

i wanted have field in user model through user logs in username instead of email i defined: app.config['security_user_identity_attributes'] = 'username' but i'm still getting: user_datastore.add_role_to_user(name, 'mgmt') file "/users/boazin/sentinal/sentinel-cloud/.env/lib/python2.7/site-packages/flask_security/datastore.py", line 105, in add_role_to_user user, role = self._prepare_role_modify_args(user, role) file "/users/boazin/sentinal/sentinel-cloud/.env/lib/python2.7/site-packages/flask_security/datastore.py", line 72, in _prepare_role_modify_args user = self.find_user(email=user) file "/users/boazin/sentinal/sentinel-cloud/.env/lib/python2.7/site-packages/flask_security/datastore.py", line 203, in find_user return self.user_model.query.filter_by(**kwargs).first() file "/users/boazin/sentinal/sentinel-cloud/.env/lib/python2.7/site-packages/sqlalchemy/orm/que...

c++ - Object's container field is empty after move and erase -

i have 2 vectors , want move object 1 other, before move make pointer object. when erase index in first vector container within object empty if access through pointer. it's difficult describe, code explain better: word.h class word { public: word(string text); ~word(); string text; }; card.h class card { public: card(vector<word>& words); ~card(); vector<word> words; }; main() vector<word> words { word("dog"), word("cat"), word("horse") }; card card(words); vector<card> deck1; vector<card> deck2; deck1.push_back(move(card)); card* p = &deck1[0]; deck2.push_back(move(deck1[0])); cout << p->words.size() << endl; // 3 deck1.erase(deck1.begin()); cout << p->words.size() << endl; // 0 <-- why size() 0 here? p = &deck2[0]; cout << deck2[0].words.size() << endl; // 3 <-- , 3 here cout << p->words.size...

Anaconda: How to completely delete Python 3.4? -

i installed both python 2.7 , 3.4 on mac (using graphical installers http://continuum.io/downloads ). need use 2.7. how can delete 3.4? thanks. according anaconda faq : how uninstall anaconda? version 1.3.1 , later anaconda can uninstalled removing root directory (~/anaconda default; use conda info command confirm location of root directory). version 1.4 , newer osx , unix uninstalls remain same in previous versions. on windows, click start button, , navigate control panel , select uninstall program, find anaconda in list of programs so you'll have in $home/anaconda , delete appropriate python installation there.

c# - Decimal out of range exception -

in c# application, trying save decimal price sql server table. columns type decimal no total digits defined. without discount calculations, works fine. but when run calculations, final value of 21800 , , following error when trying save it. "parameter value '218000/00000000000000' out of range." i don't understand zeros come from! thing know myvalue.tostring() 218000/00000000000000 , too! i understand digits after floating point caused calculations. whatever do, value 21800 when watching it. why trying save 218000/00000000000000 ? why care @ zeros? any ideas why happens , how fix it? there 2 ways store decimal numbers: fixed-point: have defined in sql server project. defined decimal (19,4) , means 19 digits total , 4 digits after decimal point. if define such type, every number always has 4 digits after decimal point; , also, cannot store number more 4 digits after decimal point. and note, there no equivalent fixed point in c#! ...

excel - VBA to sum values from cells between two times -

Image
i'm not enough familiar vba unfortunately have make done. i got extract warehouse management system looks that: i need count productivity of staff according extract huge. so prepared xls with 2 additional tabs. first tab contains extract frm above. second tab contains count looks that there 97 rows start , end times (24 hrs divided 15 minute parts) third tab contains result looks that: i have create vba macro count productivity. macro have to: sum how many products picked (scanned rf gun) , store in particular 15 minute part in tab count. sum how many 15 minute parts user scanning product rf guns (4 * 15 minute parts = 1h. example: user extract scanning product 03:21 03:43 in tab count should have sum of cases stored in 03:15 03:30 , 03:30 03:45. hope makes sense) according comodity (there 3 comodities: ambient, chill, frozen) , result have stored in third tab result. if scanning products in 3 different areas should have in result tab 3 different sums 3 como...

scala - Travis-CI - add another task to the sbt command -

i read this : by default, travis ci use sbt ++$travis_scala_version test to run test suite. can overridden described in general build configuration guide. but link gives kilobytes , kilobytes of text don't grok. in 2 sentences; how make travis ci use following instead: sbt ++$travis_scala_version test assembly ? one has add script section .travis.yml , e.g. language: scala scala: - 2.11.5 - 2.10.0 script: - sbt ++$travis_scala_version test assembly

javascript - Angular in 60ish minutes - What's wrong with this code? -

i have started learn angular , following angular in 60 minutes first step. on page-48, there example code shown below, simple controller display contents of customers property in page. <!doctype html> <html ng-app=""> <head> <title></title> </head> <body> <div class="container" ng-controller="simplecontroller"> <h3>adding simple controller</h3> <ul> <li ng-repeat="cust in customers"> {{cust.name}} - {{cust.city}} </li> </ul> </div> <script> function simplecontroller($scope) { $scope.customers = [ {name: 'john doe', city: 'new york'}, {name: 'jane doe', city: 'miami'}, {name: 'moan doe', city: 'montreal'} ]; } </script> <script src="/usr/local/angular-1.3.16/angular.js"></script> </body> ...

html - Not scrolling to bottom of the page on adding new element -

on adding new element on last child of `container' on time scroll appears. i'd scroll-down put new element on browser view. i tried using '$anchorscroll` doesn't work. html <div class="gallerymenu"> <!-- <a class="live" ng-click="gallerymenu('live')" href="#">live</a> <a class="visual" ng-click="gallerymenu('visual')" href="#">visuals</a> --> <a class="projects" ng-click="gallerymenu('projects')" href="#">projects</a> //clicking , calling gallerymenu function </div> <!-- focus needs applied here, height of element 180px --> <div class="appgallery" ng-show="galleryshow" id="anchor3"> <a ng-click="gallerychanger('prev')" class="prev" href="#">prev</a> <a ...

api - Dismiss Windows Phone alarm -

is there api regular alarm/reminder can used dismiss programatically? have tried looking in msdn library code sample, didn't have luck. until today there no api dismiss alarm/reminder programatically.

sql - Manipulate Data to retrieve specific digit -

i have table column this: location 19.15 19.14 19.13 18.01 18.02 i searched function retrieve 2 digit beginning this: location 19 19 19 18 18 unfortunately can't find solution yet . select cast(location int) location your_table

How to access a textfile entering its name in console? JAVA -

what should 1 change in code instead of entering string in console, 1 enters text name (exmple.txt) text (where frequences counted)? import java.io.*; class frequencycount { public static void main(string args[]) throws ioexception { bufferedreader br = new bufferedreader(new inputstreamreader(system.in)); system.out.println ("enter text: "); string s = br.readline(); system.out.println ("enter suffix: "); string sub = br.readline(); int ind,count = 0; for(int = 0; + sub.length() <= s.length(); i++) { ind = s.indexof(sub, i); if (ind >= 0) { count++; = ind; ind = -1; } } system.out.println("occurence of '"+sub+"' in string "+count); } } first of refactor code in order reuse calculateocurrences method. read text file line line , ...

Visual Studio 2015 RC + RequireJS + jQuery -

Image
i'm using visual studio 2015rc + cordova cli 5.1.1 + typescript + requirejs + jquery . i'd change location of jquery.js file scripts folder scripts/lib . added requirejs.config , changed jquery location. requirejs.config({ baseurl: 'scripts/lib', paths: { jquery: 'jquery' } }); unfortunately, when debug using ripple following error. exception occurred message: exception: script error for: jquery http://requirejs.org/docs/errors.html#scripterror i'm not sure if problem requirejs , jquery or vs2015rc + cordova. i'm not sure if problem requirejs , jquery or vs2015rc + cordova. the error jquery isn't resolving jquery.js file (an http 404 error). check http request made browser. http://yourapp/scripts/lib/jquery.js . make call (open link in browser. , based on fix config correct path jquery.js file.

Perforce - switch to workspace from command line -

i asking how switch client1 client2 client1 belongs stream1 , client2 belongs stream2. what looking same being in p4v , right click on workspace , selecting 'switch workspace' note, if current workspace client1 , use: p4 client -s -s //depot/stream2 or p4 client -s s //depot/stream2 client2 it won't change workspace in p4v gui. any idea? thanks! there several different concepts here. you can have single workspace, or can have multiple workspaces. each workspace has own root directory on workstation, , own copy of whatever files have sync'd. if have single workspace, can switch workspace , forth 1 stream another, using 'client -s' command switch stream workspace bound. way, can alternate between working on 1 stream, , working on another, using single workspace. in recent versions of perforce server (2015.1+), there 'p4 switch' command makes process simpler still. switching single workspace 1 stream on command line usin...

java - Convert method with loop for, without parameters, into a recursive method -

i have working method mostfrequent() loop 'for', need convert same recursive method mostfrequent() without parameters: public char mostfrequent() { int maxnum = 0; int num = 97; for(int = 0; < 26; i++) { maxnum = howmany(num) //do something; num++; } return ...something; } a method howmany(num) recursive , don't want change it. need same method mostfrequent() , recursive, without loops. thanks. int = 26; int num = 97; public char mostfrequent() { if(i == 0) return .. something; int maxnum = 0; maxnum = howmany(num) //do something; num++; i--; mostfrequent(); } i did information have, recursive.

file - Python: Why are there extra blank lines in the output when using write()? -

please consider following python 3.x code: class fancywriter: def write(self, string): print('<'+string+'>') return len(string)+2 def testfancywriter(): fw = fancywriter() print("hello world!", file=fw) print("how many new lines see here?", file=fw) print("and here?", file=fw) return testfancywriter() the output looks following: <hello world!> < > <how many new lines see here?> < > <and here?> < > why these blank lines in between? ok - real intention creating fancywriter class create writer class excel: need write out tabbed text lines excel cells, each line in excel row, , each tab-separated substring cells of row. strange thing in excelwriter class (which has write() function above, call print() replaced setting cells value), similar phenomenon occurs - there blank rows in fancywriter classes' output above! (i have target cell movin...

writing a iiop client in order to dynamically configure a cisco appliance -

my firm purchase cisco appliance named dcm. it's api limited snmp or iiop. want create simple gui users configure fields on dcm ease. i have done before snmp have 0 expirience iiop. i preffer implement either java or python. i appreciate if can point me in right direction (java/python, recommended libraries etc.) btw saw lot of mentions rmi-iiop i'm pretty sure it's irrelevant. ( right?) thanks.

ios - Creating a User record based on currently logged in Apple ID -

using objective-c there way can create new user app based on apple id automatically. using in conjunction cloudkit in order create , auth users without creating whole 'login' , 'sign up' view cloudkit gives out of box. ckcontainer can return user record of signed in user on device, , have stable identifier (recordid) can use authenticate , identify same user across devices. since user recordid scoped container, , default developer won't user details apple id (unless discoverability has been opted in to), there no explicit login or ui necessary in client. it's seamless user experience perspective. you'll find more documentation on how fetch user record at: https://developer.apple.com/library/ios/documentation/cloudkit/reference/ckcontainer_class/index.html#//apple_ref/occ/instm/ckcontainer/fetchuserrecordidwithcompletionhandler :

android - How to specify google play services dependency in maven -

i build project maven, want add dependency google play services wear. gradle build file has compile 'com.google.android.gms:play-services-wearable:+' and in pom.xml under "dependencies" put <dependency> <groupid>com.google.android.gms</groupid> <artifactid>google-play-services</artifactid> <version>5</version> <type>aar</type> </dependency> but maven keeps complaining "could not find artifact". how specify dependency of google play services wear? from google-developers: in versions of google play services prior 6.5, had compile entire package of apis app. in cases, doing made more difficult keep number of methods in app (including framework apis, library methods, , own code) under 65,536 limit. from version 6.5, can instead selectively compile google play service apis app. so, try replace "version" in pom.xml 6.5 or above

google analytics - Need to find out a drop offs from purchasing per type of user -

my client need find out drop offs in purchasing process per type of user , per type of industry. fyi- these both user type , industry type need select user while registring website. , user can see products once loggedin. so, needs done achieving track in google dashboard thanks on login set user type , industry session scoped custom dimensions . go analytics account, property settings, custom definitions, create custom dimension, set scope session (that way need set once per session, hit based dimension you'd need send every pageview). on login confirmation page add custom dimension: ga('send', 'pageview', { 'dimension1': 'usertype', 'dimension2': 'industry', }); custom dimensions specified key/value pairs; key string "dimensions" plus numeric index of dimension, values you'd have extract backend each user when logs in. takes @ least 24 hours until values custom dimensions show (well, @ le...

javascript - using new keyword in callback causes "TypeError: object is not a function" -

i have call: var serve = function(teacher, callback) { re.createfakememberdata(function(err, avgmember) { //omitted }); }; inside createfakememberdata , if try instantiate mongoose model: var statistic = new statistic(); i error stack trace: d:\orkun\workspace\teb\tebesir-repo\scripts\engines\resetengine.js:61 var statistic = new statistic(); ^ typeerror: object not function @ object.createfakememberdata (d:\orkun\workspace\teb\tebesir-repo\scripts\engines\resetengine.js:61:21) @ promise.<anonymous> (d:\orkun\workspace\teb\tebesir-repo\scripts\servlets\graph\servespider-teacher.js:29:20) @ promise.<anonymous> (d:\orkun\workspace\teb\tebesir-repo\node_modules\mongoose\node_modules\mpromise\lib\promise.js:177:8) @ promise.emit (events.js:95:17) i think 'this' going out of scope or sth. have tried using bind .. re.createfakememberdata(function(err, avgmember) { //omitted ...