Posts

Showing posts from June, 2014

bash - Troubling figuring out one part of this script -

i'm new this, think easy question. i have following script given me go through our logs , pull out information: awk ' match($0, /"username":"[^"]*"/) { split($3, d, "@") user = substr($0, rstart + 12, rlength - 17) split(user, e, "@") c[e[2] "," d[1] "," e[1]]++ } end { for(i in c) printf("%d,%s\n", c[i], i) }' mycompany.log | sort -t, -k2,2 -k3,3 -k4,4 what script goes through log entries, , entry corresponds username grabs date, username, organization , number of unique entries user on date. pretty understand how works of these values except number of entries per user (can't figure out in script this). basically right output sorted in columns: number of entries, organization, date, username like this: 609,organization,05-22,someuserfromthatorganization and want this: organization,05-22,someuserfromthatorganization,609...

Is there an SVG to VML conversion tool? Offline or Online. (Not on the fly) -

i have been hunting high , low tool convert svg file vml readable internet explorer. i have found several 'on fly' solutions these unnecessary wish use vector graphics on few simple, non changing, scaleable drawings. is there tool out there, offline or online accept svg file , output vml code? kind regards. i've never used it, understanding can take svg file , output vml (or vice versa). http://vectorconverter.sourceforge.net/ looking @ documentation, seems need install on server , upload svg file. there command-line tool can use specify output file. can download newly-created vml file (and tweak little hand if it's not survived conversion process perfectly).

r - Working with multiple if else statements -

i cannot figure out need. here simplification need. i process each function if number appears in vector, here example: v <- c(111,88,222,99,555,1,9,6) if(111 %in% v){ x <- 111+0.1 } else if(222 %in% v){ y <- 222+0.1 } else if(555 %in% v){ z <- 555+0.1 } i process each function if given number found in vector v . in above example if else example give out number 111.1 , 222.1 , 333.1 , i'm doing wrong here? basicaly, calculate each function if number appears in vector. you want if check evaluated once first 1 true , following can never checked because preceded èlse . drop else clauses: v <- c(111,88,222,99,555,1,9,6) if(111 %in% v){ x <- 111+0.1 } if(222 %in% v){ y <- 222+0.1 } if(555 %in% v){ z <- 555+0.1 }

c# - Destroy a deactivated object -

i want destroy deactivated instance of quad prefab (hp bar) , able destroy activated ones : private gameobject correspondinghpbar; private string correspondinghpbarname; void start() { correspondinghpbarname = "hpbar1" } void update() { correspondinghpbar = gameobject.find (correspondinghpbarname); if (shiphp <= 0) { destroy (correspondinghpbar); destroy (gameobject); } } this doesn't work deactivated objects, googled hard failed find answer. deactivated object don't have start or update method called (nor coroutine matter). in fact when object deactivated own time frozen. what create method destruction , find way call script (for example kind of controller keeps reference hp bars in scene). the following pseudo-code (didn't check if compiles, should adapt anyway): // in script hp bar public boolean trydestroy() { if (shiphp <= 0) { destroy (correspondinghpbar); de...

sql server - merge replication processing order of UPDATEs, INSERTs and DELETEs -

i can set order of merge replication? i've read order delete -> update -> delete. can change it? if so, how can impact in replication? no, cannot change order in changes applied. can change order of articles being processed - see sp_addmergearticle , parameter @processing_order.

php cronjob auto reminder email -

i have built webapplication user pays 1/3/6 months , joins site , need send user reminder mail before 15 days of account expiration , how can achieve ? not understanding correct logic ... storing registered date , expiring date in database ,will below logic work fine ? <?php $expiringdate = "2015-07-21"; $todaydate = date("y-m-d"); $date = date("y-m-d",strtotime("-15 days", strtotime($expiringdate))); if($todaydate == $date){ //send mail }else{ //quit }?> and want change value in database if today expiring day ... better in other cronjob or can in above code this.. <?php $expiringdate = "2015-07-21"; $todaydate = date("y-m-d"); $date = date("y-m-d",strtotime("-15 days", strtotime($expiringdate))); if($todaydate == $date){ //send mail }else{ //check , change value if today expiring }?> am going in right path , secure or there other better way job i suggest running cron j...

javascript - buttonset() not working with dynamic inputs -

i'm trying use jquery buttonset() dymanic inputs it's not working: $(document).ready(function () { var n = 30; (var = 1; <= n; i++) { $('<label/>', { id: "label-" + i, }).append($('<input/>', { type: "checkbox", id: "checkbox-" + })).append(i).prependto("#showchck"); } $("#showchck").buttonset('refresh'); }); only label shown, not input. edit: add html code: <div data-role="fieldcontain" id="channels" style="display:none;"> <fieldset id="showchck" data-role="controlgroup" data-type="horizontal"> </fieldset> </div> label needs for attribute buttonset work , labels , checkboxes should not nested. in demo, changed way inputs , labels rendered as per documentation here documentation says for assoc...

C lang basic issue - why did I get the same addresses to two struct? -

while (1) { struct entry n = { ele[i], null, 1 }; printf("%d", &n); // todo same address } this program keeps printing same address, isn't struct entry n = xxx operation "new" in c++ , java? much. no, it's not @ same. here creating struct allocated space compile-time , have same address time. there no need create new 1 ever. setting values inside struct. the value allocated in stack , since in same stack frame, stay same. if change code calling function, value change. example void test1() { struct entry n = { ele[i], null, 1 }; printf("%d", &n); } void test2() { test1(); } void main() { test1(); test1(); test2(); test1(); test2(); } from first 2 (most likely) same address, since there same stack modifications in calls. when call test2() , calls test1() address different, since stack frame different. but in case address of struct must not st...

c# - How do I create a truly multi-purpose endpoint using WebAPI 2 with optional parameters? -

thanks looking. i attempting make following code work: [routeprefix("api/user")] public class usercontroller : apicontroller { [allowanonymous] [route("{email}")] public ihttpactionresult get(string email = null) { if (!string.isnullorempty(email)) { return json(someuserprofileobject); } return json(somelistofuserprofiles); } } whenever try , access /api/user/some@email.com, 405 . solved! please see solution in answer below. i finish composing question when stumbled on answer. basically, special characters don't work in url request paths . used query string instead , revised code this: [routeprefix("api/user")] public class usercontroller : apicontroller { [allowanonymous] [route("")] public ihttpactionresult get(string email = null) { if (!string.isnullorempty(email)) { ...

oop - Can an instance variable belong to multiple classes? -

i have been looking @ classes in oop , curious how works. for example, lets have product. product bike. there class product stock , class products details e.g. colour etc. i use classes within each other such class called product , within it contains both stock , details product(bike) or have instance called bike made both e.g. stock bike = new stock(); details bike = new details(); or instance bike have renamed them e.g. stock stockbike = new stock(); details detailsbike = new details(); hopefully makes sense. wondered whether 1 instance keyword can belong 2 classes or instance name in case bike have changed can belong more classes. thanks stock bike = new stock(); details bike = new details(); not quite sure you're asking... think you're asking if can have 2 variables same name , in same scope. generally, no. didn't mention language let's assume java. public void test() { string test = "123"; string test = "1...

java - IndexOutOfBoundException when trying trying to get a .ods cell with jOpenDocument -

i facing little challenge coding. file file = new file("template.ods"); sheet sheet; try { // load file sheet = spreadsheet.createfromfile(file).getsheet("certificate"); system.out.println(file); system.out.println(sheet.getcellat("a1").isempty()); sheet.setvalueat("a1", 1, 1);; system.out.println(sheet.getcellat(1, 1).gettextvalue()); sheet.getcellat(2, 2).setvalue("b2"); sheet.getcellat(3, 3).setvalue("c3"); sheet.getcellat(4, 4).setvalue("d4"); // save file , open it. file outputfile = new file("fillingtest.ods"); ooutils.open(sheet.getspreadsheet().saveas(outputfile)); } catch (exception e) { e.printstacktrace(); } i getting know jopendocument-library. want fill existing openoffice-spreadsheet-template (template.ods) sample values. when running above code, console shows this: template.ods true java.lang.indexoutofboundsexception: ind...

java - Application Error when i run my heroku app -

i'm working java app have deployed in heroku. when run heroku app, app should go host , read csv files. every row in file should saved in table row. my problem that: if csv files big, when run app resulted in app error. doing test sow if number of row around 600 app run success,if there more 600 there app error. can explain why happens?

Facebook iOS invite -

Image
i have app allows users invite friends download app. works fine, friend gets notification via fb app , bobs uncle. issue when click 'install now' facebook doesn't load app in app store, it's blank. have appid has old version of app without fb integration in it. any ideas why facebook app isn't loading app store? don't worry it, found issue. using wrong app link url.

reactjs - React FixedDataTable Webpack bundle - Uncaught TypeError: Cannot read property 'requestAnimationFrame' of undefined -

i've created simple component called mydatatable , wrapper on react fixeddatatable component , bundled webpack. file resulted bundle called my-components.js . nothing complicated until here. can try source code see how works: https://github.com/cosminnicula/fdtwebpack now, second step consume my-components.js library in separate project. here https://github.com/cosminnicula/fdtwebpackclient can see how imported library , tried use <mydatatable /> component: 'use strict'; //fdtwebpackclient/src/main.jsx import react 'react'; import mydatatable './../lib/my-components.js'; react.render( <div> hello mydatatable! <mydatatable></mydatatable> </div> , document.body ) however, if try browse index.html, nasty error, don't find logical explanation for: "uncaught typeerror: cannot read property 'requestanimationframe' of undefined". btw, wrapper component copy-pasted here...

r - Doing a matrix with absolute frequencies -

i have 2 matrices: matrix 1, vector : matrix(c(0.16, 0.24, 0.16, 0.08, 0.09, 0.12, 0.06, 0.04, 0.04, 0.01)) actually, created using function "for", utilizing punnett square frequencies 0.4, 0.3, 0.2, 0.1. and second, have matrix 2: [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [1,] "a 1 1" "b 1 b 1" "c 1 c 1" "d 1 d 1" "e 1 e 1" "f 1 f 1" "g 1 g 1" "h 1 h 1" "i 1 1" "j 1 j 1" [2,] "a 1 2" "b 1 b 2" "c 1 c 2" "d 1 d 2" "e 1 e 2" "f 1 f 2" "g 1 g 2" "h 1 h 2" "i 1 2" "j 1 j 2" [3,] "a 1 3" "b 1 b 3" "c 1 c 3" "d 1 d 3" "e 1 e 3" "f 1 f 3" "g 1 g 3" "h 1 h 3" "i 1 3" "j 1 j 3" [4,...

javascript - Constructive bubble sort not working as expected -

i'm trying create simple bubble sort in javascript , cannot understand why code not working, problem seems coming second if statement, not know exact problem browser i'm testing in refuses load page when using code. var arr = [4, 6, 0, 3, -2, 1]; var arr2 = [arr[0]]; arr.foreach(function(elem){ for(var j=0; j<arr2.length; j++){ if(elem < arr2[j]){ arr2.splice(j, 0, elem); break; } //if number largest on last iteration add end of array if(j == arr2.length-1){ console.log(elem); //problem seems here arr2[arr2.length] = elem; } } }); console.log(arr); console.log(arr2); you're adding elem array .splice if lower arr[j] never removing old instance of elem . conesquently, you're adding items array , getting larger. need take out old instance of elem array array length remains constant iteration iteration. so, somewhere, should pass...

ios - click on UIImageView to change ViewController -

Image
i have custom image (profile picture) want click , go profile view. registering click, , have segue set in storyboard, when click, nothing happens. profile picture part of pftableviewcell(using parse), part of pfquerytableviewcontroller. trying navigate pfquerytableviewcontroller. here how connected on storyboard: and here i'm trying in code transition: func onprofiletap(send:anyobject){ nslog("profile clicked") let storyboard = uistoryboard(name: "main", bundle: nil) var vc:wrapperprofileviewcontroller = storyboard.instantiateviewcontrollerwithidentifier("profileviewcontroller") as! wrapperprofileviewcontroller vc.parseuser = parseuser! holder?.navigationcontroller!.pushviewcontroller(vc, animated: true) //holder pfquerytableviewcontroller. "self" pftableviewcell } i have done similar before , worked. checked make sure segue identifier correct, nothing happens other nslog printing console. just l...

javascript - gulp-sass and gulp-watch, cant find file when saving scss -

i setting gulpfile , im having problem gulp-sass when watch task running scss task. this how gulpfile.js looks: var gulp = require('gulp'), plumber = require('gulp-plumber'), sass = require('gulp-sass'), sourcemaps = require('gulp-sourcemaps'); var onerror = function(err) { console.log(err); }; var bases = { dist: './dist/', src: './src/' }; var paths = { sass: [bases.src + 'scss/base.scss'], sourcemaps: '/' }; gulp.task('scss', function(){ return gulp.src(paths.sass) .pipe(plumber({ errorhandler: onerror })) .pipe(sourcemaps.init()) .pipe(sass({ sourcemap: true, style: 'expanded', sourcecomments: 'normal', onerror: onerror })) .pipe(sourcemaps.write(paths.sourcemaps)) .pipe(gulp.dest(bases.dist + 'css/')) }); gulp.task('watch', function(){ gulp.watch(bases.src + 'sc...

git - Jenkins unable to fetch repo - code 255 permission denied -

i'm trying set jenkins work git webhooks. far have jenkins running created ssh key pair under jenkins user added key git deploy keys added git plugin configured project use git repo set branch */develop watch dev branch set custom workspace directory /data/www/<site> added ubunutu group jenkins user (see below) and when trying build project, error: started user anonymous building in workspace /data/www/<site> > git rev-parse --is-inside-work-tree # timeout=10 fetching changes remote git repository > git config remote.jenkins.url git@github.com:<repo_url> # timeout=10 error: error fetching remote repo 'jenkins' hudson.plugins.git.gitexception: failed fetch git@github.com:<repo_url> @ hudson.plugins.git.gitscm.fetchfrom(gitscm.java:735) @ hudson.plugins.git.gitscm.retrievechanges(gitscm.java:983) @ hudson.plugins.git.gitscm.checkout(gitscm.java:1016) @ hudson.scm.scm.checkout(scm.java:485) @ hudson.mod...

javascript - Load different pages while leaving certains divs behind -

i want know how web pages move between different php pages without reloading entire page. here divs stays same. if use ajax cannot share link of page, need this. thank you. you have use ajax in order that. if want able share link or handle reload ou need build navigation system using # , javascript around it. there lot of example doing on web. https://www.google.nl/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=utf-8#q=tutorial%20build%20ajax%20navigation

node.js - Nested fields "Cannot read property 'zip' of undefined" -

having error. any idea how solve it? object mongodb: ... "name" : true, "address" : { "zip" : "bh9axx", ... request db: exports.getlist = function (req, res, next) { user.find({ user: req.user.id }, function (err, users) { if (err) return next(err); return res.render('list', { users: users }); }); }; list.jade: each user in users tr td #{user.name} td #{user.address.zip} everything works correctly, when #{user.address.zip} not used. user.address undefined (at least in cases) , attempt access user.address.zip in jade file results in error. possible solutions include: perhaps address not required field in db schema or allowed undefined. if so, perhaps can make required. you can add code before calling res.render() checks see if user.address undefined. if so, set default value (such object zip set empty string). ...

c# - Are parameter entity references in sgml/xml parsible using .NET? -

when try , parse data below xdocument getting following error: "xmlexception: parameter entity reference not allowed in internal markup" here example data trying parse: <!doctype sgml [ <!element sgml any> <!entity % std "standard sgml"> <!entity % signature " &#x2014; &author;."> <!entity % question "why couldn&#x2019;t publish books directly in %std;?"> <!entity % author "william shakespeare"> ]> <sgml>&question;&signature;</sgml> here code trying parse file above: string cafile = @"pathtofile"; using (var castream = file.open(cafile, filemode.open, fileaccess.read)) { var cadoc = xdocument.load(castream); // exception thrown here! } is there way built-in .net xml parsing libraries handle entity references, or @ least ignore embedded !doctype , parse root element? note: working under assumption parameter entity refer...

eclipse - Configure when new lines are wrapped when formatting code using Scala IDE -

Image
is possible edit scala formatter when formatting text not wrap until x amount of characters. it possible java files create new profile looking @ scala editor options not seem possible :

Ruby - Running rb files from script (2) -

i'd write ruby script calls ruby script. example, i'd run "test1.rb" script. test1.rb has been simplified this: print "1" then result (-> 1). i ask others fix problem, , suggested popen3 command: require 'open3' cmd = 'ruby "test1.rb"' puts dir.pwd open3.popen3(cmd) |stdin, stdout| var = stdout.read puts var end however, script send error message: x:/ruby22-x64/lib/ruby/2.2.0/open3.rb:193:in `spawn': no such file or directory - ruby "test1.rb" (errno::enoent) please me.

Suppress MsgBoxes on launching Access OR Prevent form opening on launch? -

to preface this, messed up. i have function runs each item in database, compare against given value. added msgbox code in order check values debugging. function runs when default form project (the 1 loads when launch access) loads-- on every record in database . currently, that's on 13000 items. is there way suppress messages, launch project without loading form, or edit vba project without launching project? edit: i've realized can press escape during msgbox display abort query. problem solved.

java - NetBeans Swing GUI builder keeps loading -

Image
i'm trying learn use swing gui , i'm using netbeans arrange controls. however, when come "design" tab, keeps saying "loading ..." forever, can't use builder. this default netbeans template, here's code: /* * change template, choose tools | templates * , open template in editor. */ /* * newjdialog.java * * created on may 29, 2015, 5:29:06 pm */ package gui; /** * * @author nacho */ public class newjdialog extends javax.swing.jdialog { /** creates new form newjdialog */ public newjdialog(java.awt.frame parent, boolean modal) { super(parent, modal); initcomponents(); } /** method called within constructor * initialize form. * warning: not modify code. content of method * regenerated form editor. */ @suppresswarnings("unchecked") // <editor-fold defaultstate="collapsed" desc=" generated code "> private voi...

css3 - Colour overlay for SVG using CSS? -

is there way apply colour overlay svg using css? i have svgs (icons, shapes etc) need able "tint" - adding solid colour overlay keep transparency. i read css filters, none of them cater adding colour on top, stuff blur or desaturate. please check code snippet. hope you. <svg width="0" height="0" class="svg-visiblity"> <defs> <path id="hex" d="m11.5,20.9l44.3,2c3.7-2.2,8.3-2.2,12.1,0l32.8,18.9c3.7,2.2,6,6.1,6,10.4v37.8c0,4.3-2.3,8.3-6,10.4 l56.3,98.4c-3.7,2.2-8.3,2.2-12.1,0l11.5,79.5c-3.7-2.2-6-6.1-6-10.4v31.3c5.4,27,7.7,23,11.5,20.9z"/> <clippath id="hex-clip-200"> <use xlink:href="#hex" transform="scale(2 2)" /> </clippath> </defs> </svg> <svg class="image-200-2"> <rect class="border" width=...

Run an Ansible task only when the hostname contains a string -

i have multiple tasks in role follows. not want create yml file handle task. have include web servers, couple of our perl servers require web packages installed. - name: install perl modules command: <command> with_dict: perl_modules - name: install php modules command: <command> with_dict: php_modules when: <install php modules if hostname contains word "batch"> host inventory file [webs] web01 web02 web03 [perl] perl01 perl02 perl03 perl-batch01 perl-batch02 below should trick: - name: install php modules command: <command> with_dict: php_modules when: "'batch' in inventory_hostname" note you'll have couple of skipped hosts during playbook run. inventory_hostname 1 of ansible's "magic" variables: additionally, inventory_hostname name of hostname configured in ansible’s inventory host file. can useful when don’t want rely on discovered hostname ansible_hostname...

ruby - Strange behavior of array and hash in nested blocks -

i used inner array (or hash) in nested blocks save data: p "#1 both inner_arr , outer_arr set empty outside of both loops" outer_arr = [] inner_arr = [] = 0 2.times{ j = 0 2.times{ inner_arr[j] = j+100+i j += 1 } p inner_arr outer_arr[i] = inner_arr += 1 p outer_arr } p "======================================================" p "#2 outer_arr set empty before both loops while inner_arr set empty inside of outer loop , outside of inner loop" outer_arr_2 = [] = 0 2.times{ j = 0 inner_arr_2 = [] 2.times{ inner_arr_2 << j+100+i j += 1 } p inner_arr_2 outer_arr_2[i] = inner_arr_2 += 1 p outer_arr_2 } p "======================================================" p "#3 both outer , inner hash set empty outside of both loops" outer_hash_3 = {} inner_hash_3 = {} = 0 2.times{ j = 0 2.times{ inner_hash_3 [j] = j+100+i j += 1 } p inner_hash_3 outer_hash_3[i] = inner_hash_3 ...

java - PhantomJS page not found on tomcat -

i writing automated tests applications located on tomcat on glassfish in spring mvc . when i'm testing app works , when want connect application beside gets 404 example: glassfish it's app 127.0.0.1:8080/webpage tomcat: 127.0.0.1:9206/site logs: info: executable: */bin/phantomjs info: port: 5223 info: arguments: [--ignore-ssl-errors=true, --webdriver=5223, --webdriver-logfile=*/phantomjsdriver.log] info: environment: {} severe: [info - 2015-05-29t14:57:15.628z] ghostdriver - main - running on port 5223 severe: [info - 2015-05-29t14:57:15.721z] session [feb4d4f0-0612-11e5-a39c-15224a5e9e7b] - page.settings - {"xssauditingenabled":false,"javascriptcanclosewindows":true,"javascriptcanopenwindows":true,"javascriptenabled":true,"loadimages":true,"localtoremoteurlaccessenabled":false,"useragent":"mozilla/5.0 (unknown; linux i686) applewebkit/538.1 (khtml, gecko) phantomjs/2.0.0 sa...

c# - Copy some files to projectDir when someone compile their project using my DLL -

i'm not sure if question has been asked or not. have created dll in c#. dll depends on other dlls. when compile project using dll, other dlls copy projectdir. however, other dlls depend on text files , other executable files. problem text files , executable files don't copy projectdir. unfortunate, cause project crash when running. my question is, how can load text files , executable files projectdir whenever dlls compiled? thanks. depending on how sharing @ using nuget publish out dll. nuget able specify , bring across dependent files , libraries added project including them content in dll project.

reporting services - SSRS Multiple page for each DataSet's row -

ciao, scenario. i'm building report sql server reporting services. i have 2 dataset: continent countries and build report that: +----+-----------+ | id | continent | +----+-----------+ | 01 | europa | +----+-----------+ +----+-------------+ | id | countries | +----+-------------+ | 01 | italia | +----+-------------+ | 02 | switzerland | +----+-------------+ | 03 | germany | +----+-------------+ | 04 | etc. | +----+-------------+ my report work 1 page. generate multiple pages that: page 1 +----+-----------+ | id | continent | +----+-----------+ | 01 | europa | +----+-----------+ +----+-------------+ | id | countries | +----+-------------+ | 01 | italia | +----+-------------+ | 02 | switzerland | +----+-------------+ | 03 | germany | +----+-------------+ page 2 +----+-----------+ | id | continent | +----+-----------+ | 01 | america | +----+-----------+ +----+-------------+ | id | countries | +----+-------------+ | 01 | u...

sql server - T-SQL count of unique records by each month -

i trying count our customer base grew each month. eg. "josh","tim" , "dustin" has used service in january, january number of new unique customers 3. in february "josh","tim" , "eve" use service. "josh" , "tim" has used service before, number of new unique customers 1. and on.... i wanted use except statement, not getting right results. select count(distinct name) newuniquecustomers, convert(varchar(7), regdate, 126) t group convert(varchar(7), regdate, 126) except --this should excludie customers included select count(distinct name)as newuniquecustomers, convert(varchar(7), regdate, 126) t convert(varchar(7), dateadd(month,-1,regdate) , 126) group convert(varchar(7), regdate, 126) http://sqlfiddle.com/#!3/73621 using sqlfiddle should it. with sorteddata ( select * , row_number() over(partition name order regdate) rownum t ) select dateadd(month, datediff(month...

android - How to Change Listview Button name After sending a server request inside a custom adapter class? -

Image
recently i'm working on online based student teacher communication application. in app there part student have send teacher request add in class. here custom adapter getview code i'm sending request using listview custiom button. want place asynctask code inside adapter class.but can't able that. inside listview onclick button method can't recognizing asynctask method. placed asynctask method in class. want place asyntask method in adapter class because want change button name "request" "sent" after sending request in onpostexecute method . manually changed button name want ensure user request 100% sent. please tell me have place asynctask method in adapter class can change button name. million in advance. package project.cc.student; import java.util.arraylist; import org.apache.http.namevaluepair; import org.apache.http.message.basicnamevaluepair; import com.example.connectifyclassroom.r; import android.content.context; import android....

android - Salesforce SDK is not opening login screen -

i new salesforce have interface salesforce android app. following tutorial interfacing salesforce android i have created connected app on salesforce creating android have followed above tutorial , official salesforce documentation. i have tried following i have added cordova , salesforce sdk android project created bootconfig.xml in values folder connected app details <?xml version="1.0" encoding="utf-8"?> <resources> <string name="remoteaccessconsumerkey">3mvg9zl0ppgp5urbxqwpiktqclw3vqaoigde9xortmwj.vomdc_53ujleqfrth.fyd_jsbh8tzhao3ywrbxsj </string> <string name="oauthredirecturi">sfdc://helloworld</string> <string-array name="oauthscopes"> <item>chatter_api</item> </string-array> <string name="androidpushnotificationclientid"></string> </resources> my application class implementat...

javascript - AngularJS dynamic custom directive issue -

my custom directive runs fine onload page load when added using append not run properly. not show content when @ in runtime. html: <!doctype html> <html lang="en" ng-app="module1"> <head> <meta charset="utf-8"> <title>angular demo</title> <link rel="stylesheet" href="css/bootstrap.css"> <script src="js/angular.js"></script> <script src="js/ui-bootstrap-tpls-0.13.0.js"></script> <script src="js/app.js"></script> </head> <body> <div id="divcontainer" style="border-style: solid;border-color:red;" ng-controller = "controller1 cnt1" > <button ng-click="clicked();">click me!!</button> <wlaccordion></wlaccordion> </div> </body> </html> app.js: var app = angular.module('module1',[...

git commit - Undo all files within a folder in git -

i searched , found many link talks un-doing uncommited changes respect specific file: git reset git reset --hard git checkout -- file git checkout branchname^ filename but want undo changes files have modifies under specific folder. assume have folder clients/libs/slickgrid & slickgrid internally contains multiple folder contains multiple files. i want undo modified files under slickgrid folder. options have on here? git reset head clients/lib/slickgrid if part of git's history have do git checkout clients/lib/slickgrid

c# - Why can i change an implementation of property defined in interface in the class -

i trying understand if create interface itest defines 1 property version getter in it. when implement interface in test class can change definition of property getter , setter. how can change implementation of interface shown below? internal interface itest { int myproperty { get;} void changevalue(); } public class test : itest { public int myproperty { get; set; } public void changevalue() { } } suppose have interface itest2 { int myproperty_get(); } it's not surprise can implement interface class class test2 : itest2 { private int myproperty; public int myproperty_get() { return myproperty; } //not in interface.. public void myproperty_set(int value) { myproperty = value; } } you can add set function class implementation, though no set function defined in interface. compiler doesn't...

cordova - Hybrid app send link to be open by system in android -

let's there youtube link in app, want when user presses it, link gets opened youtube app(if user has youtube, if doesn't other app can handle request). thus, want android system handle link, not app. thank you. in config.xml added: <access origin="http://img.youtube.com/*" launch-external="no"/> <access origin="http://*" launch-external="yes"/> <access origin="https://*" launch-external="yes" /> and removed <access origin="*"/> so when call window.open(link, '_system'); opens link in youtube app. more information here

assembly - How come `0F 1A /r` and `0F 1B /r` have been NOP before Intel MPX? -

on processors don't support intel mpx documentation says mpx instructions nop. namely, i've looked through these instructions, appear 0f 1a /r or 0f 1b /r unprefixed or prefixed f3 , f2 or 66 bytes, depending on instruction. also, there statements bndmk : the reg-reg form of instruction retains legacy behavior (nop). i've tried search these opcodes in pdf (namely search string 0f 1 ), found there description of mpx instructions. looking in instruction set reference february 2014, i've found lots of instructions of form, not nops, e.g. f2 0f 12 /r movddup . , looking 0f 1a , 0f 1b failed find there. looking nop found multibyte nop 0f 1f /0 , doesn't coincide mpx instructions form. so question is, documented legacy behavior of 0f 1a /r , 0f 1b /r nop? general rule form of instructions, or maybe represent non-nop instruction in nop form (like 90 standing xchg eax,eax )? the intel pdfs have lying around indeed don't list nop eith...

python - strange values when get the variable from the host -

i have kernel below: # compile device.cu mod = sourcemodule(''' #include<stdio.h> __global__ void test(unsigned int* tab, unsigned int compteurinit) { unsigned int gid = threadidx.x + blockdim.x * (threadidx.y + blockdim.y * (blockidx.x + blockidx.y * griddim.x)); tab[gid] = compteurinit; printf("%d ",tab[gid]); }''', nvcc='/opt/cuda65/bin/nvcc', ) and here host program kern = mod.get_function("test") xgrid = 256 ygrid = 1 xblock = 256 yblock = 1 etat=np.zeros(xblock * yblock * xgrid * ygrid,dtype=np.uint) etat_gpu= gpuarray.to_gpu(etat) kern(etat_gpu,np.uint(10),block=(xblock,yblock,1),grid=(xgrid,ygrid,1)) print etat_gpu.get() when print result have got strange values whereas like this: [42949672970 42949672970 42949672970 ..., 0 0 0] but when check printed value in kernel seems good

c# - Windows Mobile Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host -

i on team mobile application solid years of support , development behind it. every , 1 or more of our devices unable connect webservice. the device can hit webservice through web browser, of our other devices connect no problem. the solution have run application through visual studio in debug mode, , work, , continue work perfectly. we use simple helloworld webservice call check connectivity before being synchronization, , failing. this has absolutely baffled me , colleagues while, rare haven't worried it. does have idea might causing issue? i more happy provide more information may require.

jquery - Javascript pick random txt in dir and populate div -

i want create allows me have txt documents or single web page (i can pre-populate mysql) has following data in it: question answer1 answer2 answer3 answer4 each answer needs have set amount of points associated it. want place specific div tags in script, script goes following: <script> // psuedo: // if answer irc found, run element change // element change pulls question - answer db // else, play sound. var div = document.getelementbyid('answerone'); div.innerhtml = 'extra stuff'; var div = document.getelementbyid('answertwo'); div.innerhtml = 'extra stuff'; var div = document.getelementbyid('answerthree'); div.innerhtml = 'extra stuff'; var div = document.getelementbyid('answerfour'); div.innerhtml = 'extra stuff'; // add "points" class together $( document ).ready(function() { var sum = 0; $('.points').each(function () { sum += parsefloat($(this).t...

HSQLDB Resultset - how to get HSQLDB return space without quotes as space and not null? -

i using hsqldb link existing text files, fire sql upon retrieve data in resultset. problem if text file has data space, hsql db resultset returns null those. ex: text file row: data1|data2|| |data3 i expecting resultset data1,data2,null, ,data3 the hsqldb doc guid/chpt5 states that: "empty fields treated null. these fields there nothing or spaces between separators." there way change default behaviour? treat no space between seperators null , space between seperators space? according hsqldb documentation , "quoted empty strings treated empty strings.". in case, able modify existing text files? if so, replace instances of 1 or more spaces between 2 seperators using regular expression (ex: \|\s+\| ) quoted equivalent: data1|data2|| |data3 would become data1|data2||" "|data3 this should allow hsqldb pick field values instead of setting them null.

vba - Data Manipulation In Excel -

fairly easy 1 hope. if have column of values in sheet, how can set values equal variable can work in vba. for instance column has 100 weight values , column b has 100 height values. in vba script want set "weight" values in column , height b. , bmi = weight * height , write bmi column c. i know can example formulas actual task i'll looping few hundred times , not know column index value. thanks! edit: specify further, columns randomly arranged. won't able use relative cell references. i'll finding column, naming working data in reference column , finding next column , doing same. edit 2: think answers focusing on achieving result specified in example rather implementing process trying describe. this should enough see how simple task can done : sub user3033634() dim lastrow integer sheets("sheet1") lastrow = .cells(rows.count).end(xlup).row = 1 lastrow .cells(i, "c") = .cells(i, "a") * .cells...

c# - Return one column values as list from stored procedure -

is possible return data structure directly mssql ? public class myclass { public int id {get; set;} public int list<int> anotherids {get; set;} } i need retrieve data list if id duplicate example: select * mytable -------------------- | id | anthid | | 1 | 1 | | 1 | 2 | | 1 | 3 | | 2 | 1 | | 2 | 2 | | 2 | 3 | | 2 | 4 | -------------------- result list of 2 entities: myclass[0]{1, [1,2,3]} myclass[1]{2, [1,2,3,4]} yes, possible. i'm including example can copy/paste query window , using example build sql return desired data: declare @tbl table(id int, anotherid int) declare @aa varchar (200) declare @result table(id int, anotherids varchar(200)) set @aa = '' insert @tbl (id, anotherid) values(1,1) insert @tbl (id, anotherid) values(1,2) insert @tbl (id, anotherid)values(1,3) insert @tbl (id, anotherid) values(1,4) insert @tbl (id, anotherid) values(2...

ADFS 2.0 Not handling 'Extension' tag in SAML AuthnRequest - Throwing Exception MSIS7015 -

we have adfs 2.0 hotfix 2 rollup installed , working identity provider several external relying parties using saml authentication. week attempted add new relying party, however, when client presents authentication request new party, adfs returns error page reference number , not prompt client credentials. i checked server adfs 2.0 event log reference number, not present (searching correlation id column). enabled adfs trace log, re-executed authentication attempt , message presented: failed process web request because request not valid. cannot protocol message http query. following errors occurred when trying parse incoming http request: microsoft.identityserver.protocols.saml.httpsamlmessageexception: msis7015: request not contain expected protocol message or incorrect protocol parameters found according http saml protocol bindings. @ microsoft.identityserver.web.httpsamlmessagefactory.createmessage(httpcontext httpcontext) @ microsoft.identityserver.web.federationpassiveconte...

cancel an sql server query from SSMS -

this question has answer here: if stop long running query, rollback? 12 answers i running update sql server query.unfortunately realized miss condition canceled manually query red (stop) button in sql server management studio. want know if rollback done on updated data or not. simple sql server query without begin transaction , commit or rollback clause. yes should rolled back. afaik, update / insert runs on implicit transaction block; i.e, either complete or not (atomic operation). with in mind, moment have clicked red stop button; must have rolled update operation transaction. you can verify that, issuing select query against same table , see if data have been updated or not.

python - Can re.findall() return only the part of the regex in parens? -

looping through data, want capture string of numbers appear page ids (with more 1 per line.) however, want match number strings part of particular url, don't want record url, number. urls relative, digits strings of variable length, of form /view/123456.htm data returned here '123456' i using re.findall identify right urls, , re.sub extract number strings. views = re.findall(r"/view/\d*?.htm", line) view in views: view = re.sub(r"/view/(\d+).htm", r"\1", view) pagelist.append(view) is there way views = re.findall(r"/view/(\d*?).htm", r"\1", line) #i know doesn't work where original findall() returns part of match in parens? can re.findall() return part of regex in parens? it not can , does : >>> import re >>> re.findall(r"/view/(\d*?).htm", "/view/123.htm /view/456.htm") ['123', '456'] did not try it? the documentation...

jquery - django ajax form onchange select -

i have models, forms , views. need ajax form request, when room selected change room information. tried ajax doesn't work. use jquery. <script type="text/javascript"> $(document).ready(function(){ $('#roomform').change(function() { request_url = '/hotel/rooms-view/' + pk + '/'; $.ajax({ url: request_url, success: function(data){ $('#id_room').html('<option selected="' + "selected" + '">' + '' +'</option>'); for(var = 1; i<=data[1]; i++) $('#id_room').append('<option value="' + + '">' + +'</option>'); }, errors: function(e) { alert(e); } }) }) </script> template <form class="form-inline reservation-horizontal clearfix" role="form" method="post" action="...