Posts

Showing posts from May, 2014

MySQL to MSSQL via linked server: blob to varbinary -

i have mysql database need imported sql server via linked server. 2 of mysql columns blob , mediumblob. columns in mssql varbinary(max). when execute query @ linked server, error: ole db provider "stream" linked server "(null)" returned message "multiple-step ole db operation generated errors. check each ole db status value, if available. no work done.". msg 0, level 11, state 0, line 19 severe error occurred on current command. results, if any, should discarded. the error goes away when exclude blob , medium blob columns select statement. there conversion or workaround this?

angularjs - Define and Watch a variable according to windowidth -

i'm struggling creating directive assign , update variable, compares window width, , updates resize. i need variable compared using css because work ng-if. bare me, i'm new this. doing wrong? here code: var app = angular.module('miniapp', []); function appcontroller($scope) {} app.directive('widthcheck', function ($window) { return function (scope, element, attr) { var w = angular.element($window); scope.$watch(function () { return { 'w': window.innerwidth }; }, function (newvalue, oldvalue, desktopplus, ismobile) { scope.windowwidth = newvalue.w; scope.desktopplus = false; scope.ismobile = false; scope.widthcheck = function (windowwidth, desktopplus) { if (windowwidth > 1399) { scope.desktopplus = true; } else if (windowwidth < 769) { scope.ismobi...

Notifications swipable but not removing onclick android -

i want create notifications can swipe or remove notifications menu, if press on it stays there (and opens app). i've looked questions, didn't resolve problem: android notification swipe delete disabling , not deleting on click remove notification after clicking , has swipe-delete feature. so in between of that. groetjes, arend-jan

javascript - HTML Page Displays Incorrectly When Loaded by Chrome Extension -

as first time posting, hope provide right details question relatively easy answer. i building flashcard system google chrome extension. main page contains flashcard system single page loaded extension clicking browser action button (the icon on top right of browser). my problem, html file loaded extension looks funny. funny in text magically "shrunk." appears css file loading, javascript not. javascript not affect of text, page load javascript well. i not super familiar building chrome extensions may missing important details. so if has idea how magical "changing of text" , "javascript not loading" happening, i'd love assistance. here's got far code goes: html (popup.html) <!doctype html> <html> <head> <title>drill</title> <link rel="stylesheet" type="text/css" href="drillstyle.css"> </head> <body> <!-- main canvas --> <div id=...

python - extract each sequencing data as individual file -

there ecoli.ffn file rows indicating name of sequencing genes: $head ecoli.ffn >ecoli16:g027092:gcf_000460315:gi|545267691|ref|nz_ke701669.1|:551259-572036 atgagcctgattattgatgttatttcgcgt aaaacatccgtcaaacaaacgctgattaat >ecoli16:g000011:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat >ecoli16:g000012:55989:gi|218693476|ref|nc_011748.1|:1128430-1131042 gtgtacgctatggcgggtaattttgccgat ctgacagctgttcttacactggattcaacc ctgacagctgttcttacactggattcaacc as shown above, gene name between 1st , 2nd colon: g027092 g000011 g000012 i use ecoli.ffn generate 3 files: g027092.txt , g000011.txt , g000012.txt , containing each sequencing data. for example, g027092.txt contains raw data without header : $cat g027092.txt atgagcctgattattgatgttatttcgcgt aaaacatccgtcaaacaaacgctgattaat how make it? awk rescue! $ awk -f: -v rs=">" 'nr==fnr{n=split($0,t,"\n"); for(i=1;i<n;i++) a[t[i...

ios - Xcode: No Matching Provisoining Profiles Found -

i on xcode 7.3, osx el capitan 10.11.4. my work decided move dev team 1 shared apple developer account shared team account under have individual developer profiles. since migration, have had unholy hell of time getting xcode's provisioning profiles correct. have tried deleting of them, resetting them, reinstalling xcode, transferring old certificate/key pair, etc. have been through gamut of answers here on little success. don't have expired apple certificate in keychain, , don't appear missing private keys. in local keychain, can see of certificate/private key pairs requires. however, when try build tells me "no code signing identities found" match team id "your company inc abc123123". however, when navigate build settings can see provisioning/distribution profiles matching same id (abc123123), old name of account. if use profile, or rename match current team name xcode expects, still unable find code signing identities. if click cruelly ...

bash - Linux Script error with comparing strings -

i'm trying take 2 string input , check if equal or not, if not equal tell character length. i'm getting not found error after type 2 strings, can tell doing wrong? tried using: #!/bin/bash while true; echo "please enter 2 name compare" read name_1 name_2 1=${#name_1} 2=${#name_2} if [ "$name_1" -eq "$name_2" ] echo "$name_1 , $name_2 equal" else echo "$name_1 , $name_2 not equal" fi echo "string 1 length $(1)" echo "string 2 length $(2)" done points: a user defined variable in bash can not start digit , can not digit -eq arithmetic comparison; comparing strings use = (posix) or ==

JIRA JQL: How to search for issue with particular component alone? -

i'd search issues have component alone not + b, + c, + n , on... taking account may not know combinations + n list them in "not in" black list , avoid updating searches every time new combination used. what believe saying known components thru n, not of combinations of components used. if case, can exclude of components not want , include 1 do, so: components = , components not in (b, c, d, e, f, g, h, i, j, k, l, n) this show jiras have component. reference: https://confluence.atlassian.com/jira/advanced-searching-179442050.html#advancedsearching-component

class - How to -separately- add functions to classes in Javascript -

this question has answer here: is possible import class methods in es2015 1 answer i have single file looks this: cars.js: class cars { saab(){ return 'saab'; } volvo(){ return 'volvo'; } } var cars = new cars(); now want separate them in files organise code: saab.js class cars { saab(){ return 'saab'; } } volvo.js class cars { volvo(){ return 'volvo'; } } cars.js /** * magic */ var cars = new cars(); // contains function volvo() , saab() how can this? ps: problem extends ( class saab extends cars ) need call new saab() or new volvo() , that's not want, want call new cars() . kind of odd approach way pull off pre-es6 techniques. namely, extending prototype. // volvo.js cars.prototype.volvo = function() { return 'volvo...

xml - How can I filter images out of HTML Scrapy with XPath? -

i'm trying html of various articles using scrapy. these articles include images want process separately. if have article html looks this: <div class="article> <p>this sentence.</p> <p>this sentence.</p> <img src="/path/to/image.jpg"/> <p>this sentence.</p> <p>this sentence.</p> </div> how can scrape non-image html, or this: <div class="article> <p>this sentence.</p> <p>this sentence.</p> <p>this sentence.</p> <p>this sentence.</p> </div> i've tried: article = response.xpath("//div[@class='article'][not(img)]").extract() ...but still includes images. xpath selection, not transformation or rearrangement. you can select div elements have no img children: //div[@class='article' , not(img)] or have no img descendents: //div[@class='article' , not(.//i...

java - Index the ID number in an ArrayList -

so, have arraylist taken .txt file. displays following details: id car manufacturer car type colour *blank line* for example: 21 vauxhall corsa red 19 vauxhall corsa blue 18 vauxhall corsa white i curious how make id "index" of arraylist, if car deleted or added arraylist, automatically adjust id number. you'll need set id primary key arraylist. can creating arraylist contains hashmap objects arraylist<hashmap<int, carobject>> = new arraylist() sorting becomes question of iterating through integer ids in arraylist objects

algorithm - haskell quick sort complexity? -

i run below quick sort haskell function (using merge , sort algorithm): qsort []=[] qsort (x:xs) = qsort smaller ++ [x] ++ qsort larger smaller = [a | <- xs , a<x ] -- edit larger = [b | b <- xs , b>=x ] in order test runtime bit big amount of data, run below code: qsort [100000,99999..0] it takes till 40 min , still running! list of 100,000 not big, so: how handle data billion of data? is sort algorithm(merge , sort) takes less time in other language c#, python...is problem in haskell language how predict runtime of algorithm using complexity? the worst case time of quicksort n 2 . implementation uses first element pivot, results in worst-case performance when input sorted (or sorted in reverse). to quicksort perform @ expected complexity of n log n , need either randomized pivot selection, or randomly shuffle input before sorting.

ruby on rails - How to safely pass parameters to ActiveRecord#select() when using PostgreSQL -

i have method takes column name , defines scope on model. scope makes use of postgresql window functions (like rank() , row_number()), adding additional column resulting dataset. example, user.ranked_on_score should add rank() column aliased score_ranking . currently, achieved simple string interpolation (pseudocode): window_alias = "#{attr}_rankings" result_alias = "#{attr}_ranking" select("users.*, #{window_alias}.#{result_alias}") .join("join (select id, rank() on (order #{attr} asc) #{result_alias} ...") considering, scope should defined macro beforehand , doesn't take input users, approach should safe; nevertheless, don't it. i know sanitize_sql method, doesn't work in case. wraps parameters in single quotes fine in where clause, raises syntax errors if used in select clause (pg requires identifiers wrapped in double quotes). is there built-in method identifier sanitization? or should leave that? have...

How can I update an element of an existing XML file in c# Windows 8 App? -

i have xml file located in assets folder. face no problem when tried read file using linq. however, when wanted write file see no error , target element never gets updated. my codes below: private static readonly string mealsxmlpath = path.combine(package.current.installedlocation.path, "assets/meals.xml"); private xdocument loadeddata; in constructor have initialisation code: loadeddata = xdocument.load(mealsxmlpath); the actual code using update existing element value here public async void updatequantity(dictionary<int, int> orderdetails) { xdocument xmlfile = xdocument.load(mealsxmlpath); foreach(var key in orderdetails.keys) { xelement upd = (from order in xmlfile.descendants("meal") order.element("id").value == key.tostring() select order).single(); upd.element("avaibility").va...

javascript - Showing identical elements of two arrays in a separate array -

i quite new javascript. trying achieve here put identical elements of 2 array array.i delete elements in original 2 arrays. however, separate array not show identical ones.also, 2 arrays still show identical elements. not sure went wrong. the following code may have syntax errors. had modify make easier ask. var finalselective = ["cs348", "cs353", "cs381", "cs422", "cs448", "cs490-es0", "cs490-dso"]; var finalseelective = ["cs348", "cs352", "cs353", "cs354", "cs381", "cs422", "cs448", "cs456", "cs473", "cs490-dso", "cs490-es0"]; var seelecselec = []; //fulfills se elective , s elective. (var = 0; < finalselective.length; i++) { //there wrong one. (var j = 0; j < finalseelective.length;j++){ //it not show correct repeats. if (finalselective[i] == finalseelective[j]) { seelecselec.pu...

inversion of control - How to force a registered "ambient" object to be resolved? -

by "ambient object," mean 1 present doing in background, nobody else knows about. example, object hooks events on variety of other objects , logs messages when fire. the problem is: since nobody except unity builder knows object exists, nobody resolves it, , never gets created. there elegant solution problem? i create dummy class so: public class ambientobject { public object theobject { get; set; } } create factory methods return ambients inside ambientobject wrappers each case, register them unity, , have composition root container.resolveall<ambientobject>() (and ignore return value) ensure they're created, that's not elegant. it sounds want unity automatically resolve instance in background. there's lot of ways of doing it, can think of two: 1. when creating container lazy. public static class ioccontainer { private imyambient _ambient; private static readonly lazy<iunitycontainer> container = new lazy<i...

node.js - Using a web server to control an arduino -

i'm using node.js , johnny 5 in order control arduino on network. i'm trying make light on arduino turn on when client clicks on button in browser. figured out should use socket.io module so.. knows how it...?? found guy did using narf module. necessary? thanks! either connect via rs232 arduino. don't know wheter possible @ node.js. other option put ethernet shield on arduino, implement simple web service , call node.js. with second option it's calling url connect arduino.

python - Failed to copy-paste after automatically pasting to the clipboard selected text -

i wanted write program paste selected text automatically (for example, no need use ctrl+c copy), clipboard. program looks this: import pyautogui import win32con import win32clipboard import time def get_clipboard(): data = "" try: win32clipboard.openclipboard() except: r = "" try: data = win32clipboard.getclipboarddata() except: r = "" try: win32clipboard.closeclipboard() except: r = "" return data while true: time.sleep(1) try: pyautogui.hotkey("ctrl","c") except: continue x = get_clipboard() if x == "": print ("no word in clipboard!") else: print (x) as can see, used autohotkey combination paste selected text clipboard. causes failing normal copy-paste using. if want paste selected text mouse, pasted blank because program empty clipboard. my question how correct this...

android - Custom PopupMenu styles are being ignored -

i've been struggling popupmenu styling, , after lot of research, process of creating custom popupmenu style theme seemed straightfoward. example answer on this question seems easy way change background color of popupmenu. however, none of these solutions have worked project. started digging style sources find out should inheriting style popupmenu in own project. i'm running tests on handset running api 19, , base theme looks this: <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- ... --> <item name="android:popupmenustyle">@style/custompopupmenu</item> </style> <style name="custompopupmenu" parent="@style/widget.appcompat.light.popupmenu"> <item name="android:popupbackground">@color/retina_burning_hot_pink</item> </style> this solution of accepted answers here show. not style popupmenu. dug sources find geneology of th...

Apache directory authentication against ldap groups -

i'm using apache 2.2.15 , need specified directory authenticate against 1 of 3 ldap groups. example, want directory able authenticate against either group1, group2, or group3. if user has 1 of these groups associated ldap accounts should able access content within directory. in httpd.conf file have following block of code: <directory /path/to/folder> authname "name of authentication" authtype basic perlsetvar basedn dc=abc, dc=def, dc=ghi perlsetvar ldapserver nameofldapserver perlsetvar uidattr uid perlsetvar authgroup (want somehow 3 groups) perlsetvar cookiename nameofcookie perlsetvar sessionsdb /path/to/sessions perlauthenhandler auth::authldaphandler require valid-user </directory> i've tried adding 3 groups in 1 line authgroup had no luck. created multiple declarations of authgroup see if anything, no luck. ideas on how make directory a...

ruby - Access parent attribute in child model rails -

working on creating conditional validation model. check need check if parent.parent_attribute == "true" validates :departure_date, presence: true, future: true, :if => :awesome_method? belongs_to :parent def awesome_method? if @parent.parent_attribute == "true" true else false end end currently @parent.parent_attribute returning nil though payload has it. think i'm running issue can't access parent_attribute because hasn't saved yet... how perform check parent has value before setting validation? update clarity's sake, creating parent , child simultaneously. when try use parent.find... couldn't find parent 'parent_id'=correct_invoice_name update 2 there create in both parent , child following json creates parent child. { “parent": { “parent_id": "plzdontsave", “data": 2525.25, “parent_attribute": true, “child_attributes":[ { “child_toy...

php - Keeping CodeIgniter session active -

i have codeigniter app , plain php stuff on domain e.g. visit codeigniter app @ http://foo.com , plain php files @ http://foo.com/plainphp/somefile.php i want keep ci session active when working @ somefile.php long period. kind of understand should ping ci app regularly or simpler method ping happens when refresh somefile.php manually. my question is: what need include in somefile.php ci session doesn't time out?? set session preferences setting in application/config/config.php sess_expiration :the number of seconds session last. default value 2 hours (7200 seconds). if non-expiring session set value zero: 0 see documentation of codeigniter : session settings

new line with variable in python -

when use "\n" in print function gives me syntax error in following code from itertools import combinations a=[comb comb in combinations(range(1,96+1),7) if sum(comb) == 42] print (a "\n") is there way add new line in each combination? the print function adds newline you, if want print followed newline, (parens mandatory since python 3): print(a) if goal print elements of a each separated newlines, can either loop explicitly: for x in a: print(x) or abuse star unpacking single statement, using sep split outputs different lines: print(*a, sep="\n") if want blank line between outputs, not line break, add end="\n\n" first two, or change sep sep="\n\n" final option.

php - SOLVED: if_exists returning false negatives remote url -

ive been looking @ ages now, , decided time admit defeat , ask :d i'm designing world of warcraft guild website friend using wowarmoryapi. i'm doing members list, , not members (lower levels etc) have images yet. figured filter out ones returning false images , show "blankportrait.png" in place. here code i'm using, (its on local site, no links i'm afraid) $portrait = $member['character']['thumbnailurl']; $noportrait = "wp-content/themes/the-confederation/inc/images/blankportrait.png"; if (file_exists($portrait)) { $portrait; } else { $portrait = $noportrait; }; ?> <div class="member"> <div class="memberportrait"><img src="<?php echo $portrait ?>"/></div> any possible appreciated! edit:: got in touch friend gave me solution using curl, here c...

xml - Hide Floating Action Button in Android unless position in Recycler View is at the very top -

i'm trying display floating action button when recycler view position @ top. there anyway can achieve this? here current layout file: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:background="#bbb" android:layout_height="match_parent"> <android.support.v7.widget.recyclerview android:id="@+id/postsrecyclerview" android:layout_width="match_parent" android:scrollbars="vertical" android:layout_height="match_parent" /> <android.support.design.widget.floatingactionbutton android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignparentbottom="true" android:layout_alignparentright="true" ...

What is the Vi editor regex for this? -

i have lot of columns in table. want replace in query: select count(distinct a), count(distinct b), count(distinct c), count(distinct d) table_name; to reflect aliases: select count(distinct a) a, count(distinct b) b, count(distinct c) c, count(distinct d) d table_name; try this: s/\vdistinct\s(.{1})\)/distinct \1) \1/g you gotta put \v @ beginning use groups.

php - Why isn't my variable being set with SESSION variable? -

i thinking syntax issue have tried few different ways. php 5.4.16 running on iis 6 (these not choices). i cannot $usr set $_session['uid']. ran dump right after setting , see uid info session data null $usr. syntax wrong? think going on? function user_customvalidate(&$usr, &$pwd) { session_start(); // initialize session data ob_start(); // turn on output buffering $appkey = "pwssssssssssssss"; $safeurl = 'https://safe.ssssss.com/login/sso/ssoservice?app=playbooks'; // first call after safe login - post set if ($_post && isset($_post['digest'])) { $digest = $_post["digest"]; // set session variables ... $_session['usernames'] = $_post["firstname"]." ".$_post["lastname"]; $_session['firstname'] = $_post["firstname"]; $_session['lastname'] = $_post["lastname"]; $_sess...

javascript - Keep element a set distance from top of browser screen without using CSS? -

i using bootstraps modals , adding position:fixed doesnt work. i have arrow element pointing towards modal triggering element. want arrow point trigger wherever trigger on screen. i can enough with: $("[data-toggle='modal']").click(function() { triggerpos = $(this).offset().top; $('.modal-arrow').css('top', triggerpos + "px"); }); the problem if there long modal causes user scroll, arrow doesn't stay fixed; moves modal user scrolls. see fiddle: https://jsfiddle.net/umv4jhlg/22/ of course have tried various arrangements css, no result. i have tried adjusting on window scroll: $(window).scroll(function(){ var triggerpos = $(this).offset().top; $('.modal-arrow').css('top', triggerpos + "px"); }) but no results. would know of way can keep .modal-arrow steady using jquery? try .scrolltop() add top position

sql - On a single column : Algebraic operation on Aggregate functions -

is possible on same sql select query (no function/procedure nor pl/sql) compute algebraic operation on 2 aggregate functions ? | id || | |-----||-----| | 1 || 10 | | 2 || 20 | | 3 || 30 | | 4 || 40 | select (select sum(a) table 'id even') - (select sum(a) table 'id odd') table 'condition' any idea ? ps : databse oracle 11g you can this: select sum(case when mod(id,2)=0 else 0 end) - sum(case when mod(id,2)=0 0 else end) test yourcondition the sqlfiddle mysql sample, since oracle have mod function should work is. see working here: http://sqlfiddle.com/#!9/1ba756/2

c++ - Best practices - returning pointer from a function -

i have dilemma, how should return smart pointer function, when function might fail. pick 1 of following options: return pointer, , throw exception if function fails: std::shared_ptr foo() { // ... if (!ok) throw; return ptr; } return pointer, , return empty pointer, if function fails std::shared_ptr foo() { // ... if (!ok) return std::shared_ptr(); return ptr; } pass pointer reference, , return bool flag bool foo(std::shared_ptr& ptr) { // ... if (ok) ptr = ...; return ok; } is there best practice, guideline, how report, function didn't execute properly? or project-specific? thanks answers honestly correct answer depends on called function does, , consequence of failure is. libraries i'd suggest either throwing exception or returning value indicates failure. passing pointer reference , returning flag ...

unit testing - Python mock return of a getattr() call -

edit: might falling xy problem trap here. here's want know . i have following function: def foo(): bar = functogetbar() return bar.getattr("some_attr", none) in test, try do: mocked_bar = magicmock() expected_return_val = [obj1, obj2, ...] functogetbar.return_value = mocked_bar # functogetbar patched def testgetbar(self): assertequal(expected_return_val, foo()) now want provide expected_return_val onto some_attr attribute on bar object. i have tried using propertymock: type(mocked_bar).getattr = propertymock(return_value=expected_return_value) running test error: typeerror: 'list' object not callable if return_value set scalar (not list), result of getattr call in real function mock, , not scalar provided. also, i'm worried mocking out getattr method, since common method used elsewhere in function. how can set list on attribute of mock object under test?

python - Function to compute 3D gradient with unevenly spaced sample locations -

i have experimental observations in volume: import numpy np # observations not uniformly spaced x = np.random.normal(0, 1, 10) y = np.random.normal(5, 2, 10) z = np.random.normal(10, 3, 10) xx, yy, zz = np.meshgrid(x, y, z, indexing='ij') # fake temperatures @ coords tt = xx*2 + yy*2 + zz*2 # sample distances dx = np.diff(x) dy = np.diff(y) dz = np.diff(z) grad = np.gradient(tt, [dx, dy, dz]) # returns error this gives me error: valueerror: operands not broadcast shapes (10,10,10) (3,9) (10,10,10) . edit: according @jay-kominek in comments below: np.gradient won't work you, doesn't handle unevenly sampled data. i've updated question. there function can can computation? two things note: first, scalars single values, not arrays. second, signature of function numpy.gradient(f, *varargs, **kwargs) . note * before varargs . means if varargs list, pass *varargs . or can provide elements of varargs separate arguments. so, np.gradi...

ggplot2 - how to use ggplot through Azure ML R Script -

Image
in data exploration phrase, need visualization check relationship between data columns. have tried azure ml built-in visualization , felt it's limited. r ggplot allows me choose chart want , customization. i new in using azure ml. when trying azure ml r script , type: library("ggplot2") p <- ggplot(train, aes(x= item_visibility, y = item_outlet_sales)) + geom_point(size = 2.5, color = "navy") + xlab("item visibility") + ylab("item outlet sales") cannot find visualization... not in visualization result, neither in log ourput have tried azure ml built-in plot(), cannot find column in dataset... so, there anyway, when using ggplot in azure ml r script, can find visualization results? finally found visualization. put code in azureml studio execute r script module fine. after code has been executed successfully, right click execute r script module, , choose r device, visualization there

node.js - Aggregate with Sorting a Date not working -

this similar question on stackoverflow reason not work. have spent lot of time without no success. here collection setup { "_id" : objectid("5715acfcf1dbdc7c0ae94379"), "users":[objectid("570d2308ba5bc6842242e881"), objectid("570d7e4b369ac0c525e98331") ], "messages" : [ { "user" : objectid("570d2308ba5bc6842242e881"), "message" : numberint(0), "readind" : "n", "createdate" : isodate("2016-04-19t03:59:12.587+0000"), "_id" : objectid("5715ad10f1dbdc7c0ae94396") }, { "user" : objectid("570d2308ba5bc6842242e881"), "message" : numberint(1), "readind" : "n", "createdate" : isodate("2016-04-19t04:11:10.541+0000"), "_id" : objectid("57...

database design - What would be the advantages/disadvantages of prefixing column names with the item name? -

i working on blog module use in future project. i decided prefix table names blog_ since it's module , different modules can have tables same name. yesterday looking source code of ips boards , saw this. point interested me used prefixes column names too. as example: blog_categories category_id category_name category_slug or blog_categories id name slug which 1 think better if it? to extent flamewar territory, post discuss why think people choose 1 or other. in latter category. note pros , cons depend on database system. reasons add prefixes with prefixes, column names largely semantically unique. category_id refers id of category table. people think easier read. others point out allows joins use using () since means join columns have same name. unfortunately latter case not perfect. using () limits planner can join since re-ordering joins can change join criteria. planners might able around however. check database...

testing - If I do a system restore, will I get my program back? -

i made project on eclipse school hand in. edited minor things in program in rush , handed in without checking if program still ran. turns out didn't, , can't seem find error. don't have time figure out. if did system restore point in time before handed in, project @ same state was, @ time? thank you sorry, know isn't right section i'm new site , don't know go...

How to replace blank space with new line? in notepad++ regex -

i have list of data in format example word1 word2 word3 word4 word5 word6 word7 word8 word9 but want split each word in new line become like: word1 word2 word3 word4 word5 word6 word7 word8 word9 the blank space between words perfect seperator used in search&replace not sure of code in notepad++ regex search? thanks entering \s+ on find what field , \n (change \n\n 2 new lines) on replace with field followed replace all transforms: word1 word2 word3 word4 word5 word6 word7 word8 word9 onto: word1 word2 word3 word4 word5 word6 word7 word8 word9

ios - didSelectRowAtIndexPath not called in subclassed UITableView -

i have subclassed uitableview can detect when 3d touch gestures performed anywhere on view. works great, didselectrowforindexpath never called. here subclass: protocol passtouchestableviewdelegate { func touchmoved(touches: set<uitouch>) func touchended(touches: set<uitouch>) } class passtouchestableview: uitableview { var delegatepass: passtouchestableviewdelegate? override func touchesmoved(touches: set<uitouch>, withevent event: uievent?) { self.delegatepass?.touchmoved(touches) } override func touchesended(touches: set<uitouch>, withevent event: uievent?) { self.delegatepass?.touchended(touches) } } can suggest how can didselectrowatindexpath working again?

image - Python ImageIO: Too many open files -

i using imageio in python in order open video files in directory , convert them numpy arrays. here script using: 1 __future__ import print_function 2 avi_to_numpy import * 3 os import listdir 4 import numpy np 5 import imageio 6 7 class_path = '../diving/' 8 max_frames = 16 9 stride = 8 10 videos = [vid vid in listdir(class_path)] 11 train = [] 12 13 vid in videos: 14 print(str.format('loading {}...', vid), end="") 15 filename = class_path + vid 16 reader = imageio.get_reader(filename, 'ffmpeg') 17 frames = [] 18 19 i, im in enumerate(reader): 20 if len(frames) == max_frames: 21 break 22 23 if % stride == 0: 24 frames.append(im) 25 26 reader.close() 27 train.append(np.array(frames)) 28 print('done') 29 30 31 print(len(train)) eventually script crashes following error output: traceback ...

asp.net - VB.NET Regex Boolean Match -

i score password based on various features, don't believe regex correct: if regex.ismatch(password, "/\d+/", regexoptions.ecmascript) 'contains number score += 1 end if if regex.ismatch(password, "/[a-z]/", regexoptions.ecmascript) 'contains lowercase letter score += 1 end if if regex.ismatch(password, "/[a-z]/", regexoptions.ecmascript) 'contains uppercase letter score += 1 end if if regex.ismatch(password, "/.[!,@,#,$,%,^,&,*,?,_,~,-,£,(,)]/", regexoptions.ecmascript) 'contains special character score += 2 end if how fix this? believe these formatted c# not vb.net. the .net regex class takes raw text of regular expression. you should not wrap in / characters; match literal text / . some other notes: you don't need regexoptions.ecmascript character classes not comma-separated you're missing...

python multiplication tables with while loops with different starting int -

i need homework. want me make 10x10 multiplication tables using multiple while loops , nesting. want user prompted first number row , column. if give 3 column , 12 row this: 3 4 5 6 7 8 9 10 11 12 -------------------------------------------------- 12| 36 48 60 72 84 96 108 120 132 144 13| 39 52 65 78 91 104 117 130 143 156 14| 42 56 70 84 98 112 126 140 154 168 15| 45 60 75 90 105 120 135 150 165 180 16| 48 64 80 96 112 128 144 160 176 192 17| 51 68 85 102 119 136 153 170 187 204 18| 54 72 90 108 126 144 162 180 198 216 19| 57 76 95 114 133 152 171 190 209 228 20| 60 80 100 120 140 160 180 200 220 240 21| 63 84 105 126 147 168 189 210 231 252 this found internet search help: row = int(input("enter first row number: " )) while(row <= 10): column = int(input("enter frist column number: ...

css - Can't style element in shadow dom in media query -

in styles/app-theme.html trying change menu icon size of paper-drawer-panel in media query. element in index.html. since in shadow dom, can't seem access it. tried with: probably not relevant, here index.html: <template is="dom-bind" id="app"> <paper-drawer-panel force-narrow="true"> <div drawer> <drawer-custom></drawer-custom> </div> <div main> <div id="header-v-center"> <paper-icon-button id="paper-toggle" icon="menu" paper-drawer-toggle> @media (max-width: 600px) { iron-icon#icon::shadow { height: 6px; width: 5px; } } and @media (max-width: 600px) { :root { --iron-icon-height: 6px; --iron-icon-width: 50px; } } to no success. suggestions? polymer uses shim (a partial polyfill) evaluate custom properties. such, aren't automatically re...

java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path but natives are set -

Image
i understand question has been asked before, yet no matter how many solutions try, still following error: exception in thread "game" java.lang.unsatisfiedlinkerror: no lwjgl in java.library.path @ java.lang.classloader.loadlibrary(unknown source) @ java.lang.runtime.loadlibrary0(unknown source) @ java.lang.system.loadlibrary(unknown source) @ org.lwjgl.system.library.loadsystem(library.java:97) @ org.lwjgl.system.library.<clinit>(library.java:48) @ org.lwjgl.system.memoryaccess.<clinit>(memoryaccess.java:22) @ org.lwjgl.system.pointer.<clinit>(pointer.java:22) @ org.lwjgl.glfw.glfw.<clinit>(glfw.java:594) @ main.init(main.java:27) @ main.run(main.java:39) @ java.lang.thread.run(unknown source) the problem have set natives: this location folder: i have downloaded lwjgl , in order make work. thanks in advance! it turns out anti-virus deleting lwjgl.

c++ - Access Violation error when I debug my priority queue program -

i getting access violation error in code when try run it. program priority queue inserts value , prints heap after each insertion , min extract. header file: #pragma once /* header file priority queue class */ #ifndef priorityqueue_h #define priorityqueue_h class priorityqueue { private: int size; int *data; public: static const int capacity = 50; priorityqueue();//constructor ~priorityqueue();//destructor int getparent(int index); int getleftchild(int index); int getrightchild(int index); void swap(int &, int &); void insert(int item); //enqueue - heap_insert void printarray(int []); void heapify(int index); //remove , return smallest item in priority queue int extractmin();//dequeue bool empty() const; int min() const; //return smallest item }; #endif main code: #include <iostream> #include "priorityqueue.h" using namespace std; int main() { priorityqueue myqueue; //class o...

android - Tablet devices loading wrong orientation -

my app uses 1 page main activity , in manifest set not allow rotation hence orientation stays same wether or not rotate device. on tablets when user in landscape orientation , runs app. app loads default orientation (portrait) in landscape view instead , im seeing half screen. help. part of activity in manifest use nosensor disable rotation. <activity android:name="com.paul.xicon.mainactivity" android:windowsoftinputmode="adjustpan" android:label="@string/app_name" android:screenorientation="nosensor"> i'm not sure how disabling screen rotation. should work fine in activity tag of manifest. android:screenorientation="landscape" (disables screen-rotation & restricts landscape mode) or, android:screenorientation="portrait" (disables screen-rotation & restricts portrait mode)

ios - Can't create trigger in Realm -

i'm using realm in ios, have user table , history table.when user table's record updated or created,i want create trigger save event in history table. check out notifications section of realm documentation. should use notification token listen changes made user table , run code saves event history table in notificationblock of token.

elasticsearch wildcard string search query with '>' -

i have string field mapped 'not_analyzed'. each string has '>' simbol , need find string it. string e.g) one>two>tree>four>... with below query, result expected. "query": { "wildcard": { "activityseq": { "value": "one*" } } } but when added '>' in value, it's not. "query": { "wildcard": { "activityseq": { "value": "one>*" } } } or "query": { "wildcard": { "activityseq": { "value": "one>*" } } } any idea of this? document sample { "_index": "pm", "_type": "dmcase_00090", "_id": "avq7wjht0bpb6l5mykw7", "_version": 1, "_score": 1, ...

collections - Map with LIst using Collectors.toMap in Java 8 -

i convert below code java stream, hashmap<string, list<data>> hemap = new hashmap<string, list<data>>(); (data hedata : obj) { string id = hedata.getdata().getid() + hedata.getplandata().getcode() + hedata.getplandata().getid(); if (!hemap.containskey(id)) { citizenhelist = new arraylist<data>(); citizenhelist.add(hedata); hemap.put(id, citizenhelist); } else { hemap.get(id).add(hedata); } } i tried below code using stream, not succeed on this. hemap=obj.stream().collect(collectors.tomap(t->getkey(t), obj.stream().collect(collectors.tolist()))); private string getkey(data hedata){ string id = hedata.getdata().getid() + hedata.getplandata().getcode() + hedata.getplandata().getid(); return id; } this job groupingby collector: import static java.util.stream.collectors.groupingby; map<string, list<data>> hemap = obj.stream().collect(...

jquery - call different functions based on a variable -

really, i'm looking @ pattern in code , realizing potentially simplified. so, that's ultimate goal. plugin i'm writing calls different functions based on existence of data attributes. var = $.extend({},$.bcplugins.defaults,options); var b; // variable each plugin's data attribute var crumbsinstances = doc.find('[data-bcp-crumbs]'), copyrightinstances = doc.find('[data-bcp-copyright]'), activenavinstances = doc.find('[data-bcp-activenav]'); // determine wich functions called if (crumbsinstances.length) { crumbsinstances.each(function() { b = {}; b = $$.extend({}, b, $(this).data(a.dataoptions)); crumbs(a,b); }); } if (copyrightinstances.length) { copyrightinstances.each(function() { b = {}; b = $$.extend({}, b, $(this).data(a.dataoptions)); copyright(a,b); }); } if (activenavinstances.length) { activenavinstances.each(function() { b = {}; b = $...

How to capture job status with python multiprocessing.Process -

(using python 3.4) this question identifying completion of jobs ran using multiprocessing.process , send end result of job function further processing. i'm using multiprocessing.process run 6 unix jobs in parallel. 6 jobs submitted using shell script ./runme runme simple shell script having command line calling tool. #!/bin/csh nc run -r cpus/4 -- qrc -cmd designname.ccl nc bsub end result of run creates text file consumed post processing script. my existing python code has following logic: def sub_runqrc (designname, outputdir): qrcrun_process = subprocess.popen("./"+runme, shell+true, cwd=designdir, stdout=subprocess.pipe, stderr=subprocess.pipe) line in qrcrun_process.stdout: ### grep job id ### return_dict.update({designname:<jobid>}) return (return_dict) #main function logic line in designlist: #### designlist file , has 6 names in #### #### other logic ##### qrc_processes = multiprocessing.process(...

c++ - I am designing a programming that calculates the odds of profiting if you played several scratch- off lottery games -

this code have written far calculate odds of profiting playing lottery scratchers. have prompt user out output file name (output.txt), formatted table results written. far program output results, not in output file. not sure how or go in code. #include <iostream> #include <fstream> #include <string> #include <iomanip> using namespace std; int main() { // declaring variables int lowestamountofprofit; char filename[]="scratcher.txt"; string gamename; int costofticket, numberofprizes; int prizevalue, numberoftickets, ticketsnotclaimed; double remainingtickets; double remainingticketsforprofit; double odds; // program ask user enter lowest amount // profit when playing lottery. cout << "enter lowest dollar amount profit: " cin >> lowestamountofprofit; cout << "enter output file name: " cout << "generating report..." //open input file ifstream fin; fin.open(filename); //if input...

Saving a bitmap file in android and reading back to display in Imageview -

i have bitmap file need upload php server file large decided resize , save it. later on try read display resized image. time not getting same image below code writing image , returning file public static file savebitmap(bitmap bmp) throws ioexception { bytearrayoutputstream bytes = new bytearrayoutputstream(); bmp.compress(bitmap.compressformat.jpeg, 100, bytes); file f = new file(environment.getexternalstoragedirectory() + file.separator + "testimage.jpg"); f.createnewfile(); fileoutputstream fo = new fileoutputstream(f); fo.write(bytes.tobytearray()); fo.close(); return f; } below code reading , displaying file file=imageutil.savebitmap(this.bitmap); this.imgchoosenimage.setimageuri(uri.parse(file.getabsolutepath())); please tell me going wrong here first check images saved in ur path defined, , make sure ur giving correct path retriving image. have used below code saving imge in gallery str...