Posts

Showing posts from February, 2010

PHP $_GET .htaccess rewrite -

htaccess: rewriteengine on rewriterule ^test/ test.php rewriterule ^test/success/ test.php?success test.php: <?php if(isset($_get['success'])) echo "success"; else { echo "nothing set"; } ?> when try access test.php /test.php?success works , echos "success". want work same way overwritten in htaccess. want echo message when open /test/success/ . if possible, correct? .htaccess rewrite rules read top bottom, if apply input string, get start /test/success/ matches rewriterule ^test/ test.php becomes test.php test.php doesn't match rewriterule ^test/success/ test.php?success we end test.php . however, isn't want, because want last url rewrites test.php?success instead of other file. there easy fix problem, simple swap 2 lines of rewrite rules longer 1 listed first resulting .htaccess file: rewriteengine on rewriterule ^test/success/ test.php?success rewriterule ^test/ test.php

ios - Why do the layout positions change in preview when I simply add a new screen size to the preview screen? -

i have 4 inch screen displayed in assistant editor preview while i'm adding constraints view controller in storyboard. once situated in correct position constraints , layout looks on 4 inch screen, add screen size preview window. reason, adding screen size preview window causes layout preview on 4 inch screen changed. odd behavior or doing wrong? i had similar issue, instead 4.7 inch screen size. found using 2 things helped me keep layout , constraints consistent across screen sizes. first, keep storyboard default layout universal (square) constraints aren't applied 1 screen size only. second, when setting constraints, use "reset suggested constraints" button located on third constraints tab. i have yet experience layout issues using method. hope helps!

c# - Removing a number, after randomly picking it from a list -

i'm making little bingo game have list of numbers (1-90). have randomly pick number, how remove number after have randomly chosen it? this attempt far: public partial class form1 : form { int r = 0; public form1() { initializecomponent(); } private void btn_number_click(object sender, eventargs e) { random random = new random(); list<int> bingonumbers = new list<int>(); for(int = 0; < 91; i++) { bingonumbers.add(i); } r = random.next(bingonumbers.count); bingonumbers.removeat(r); richtextbox1.text = bingonumbers[r].tostring(); richtextbox2.text = bingonumbers[r].tostring(); } } everytime click on button, list gets refilled 90 numbers. guess should contain 1 less number every click, yes? then need instantiate outside click method. list<int> bingonumbers = enumerable.range(1, 90).tolist(); private void btn_number_click...

openssl - Is there any way to open a new connection using ssl without another handshake? -

i'm working on designing server, in protocol allows client open additional physical connections server operate in context of single logical connection. one thought had that, if we're using ssl, we'll need ssl handshake new connection. seems me should possible send secret client on original, secure connection allow new connection securely established without handshake (similarly i've read ssl session reuse). is possible? ssl this. provided both ends support it, there feature called 'session resumption' allows new connection via existing ssl session, via abbreviated handshake, without certificate exchange , negotiation of shared secrets.

testing - XMLUtil not showing details of mismatched xml attributes -

i using qtp's xmlutil compare 2 xmls. works fine except if there differences in tag elements. example, in xml1, tag is: <dirtybondprice pricetype="price" currency="gbp" weight1="02">110</dirtybondprice> in xml2, tag is <dirtybondprice pricetype="price" currency="usd" weight1="02">110</dirtybondprice> code snippet booleanresult = objxml1.compare(objxml2, objresultsxml) objresultsxml.savefile "c:\users\pankaj.jaju\desktop\6.xml" so difference show follows <mic_root state="mismatch"> <repotrade state="mismatch"> <specificdetail state="mismatch"> <dirtybondprice mic_elema_attr="%s=&quot;%s&quot;;%s=&quot;%s&quot;" mic_elemb_attr="%s=&quot;%s&quot;;%s=&quot;%s&quot;" state="mismatch" /> </specificdetail> </repotrade> </mic_root...

Spring 4 Create Bean Programmatically -

i've been looking way add datasources @ runtime. want move away defining datasources in @configuration class , instead when app loads want dynamically create datasource beans , inject them spring context. i'm not sure how can go doing that. this ended with, not sure if right approach or not, if there better way please share. @component class springcontextlistener implements applicationlistener<contextrefreshedevent> { public void onapplicationevent(contextrefreshedevent event) { org.apache.tomcat.jdbc.pool.datasource ds = new org.apache.tomcat.jdbc.pool.datasource(); ds.setdriverclassname("com.mysql.jdbc.driver"); ds.seturl("jdbc:mysql://mysql:3306/test?useunicode=true&characterencoding=utf8&maxallowedpacket=512000"); ds.setusername("myusername"); ds.setpassword("mypassword"); configurableapplicationcontext ctx = (configurableapplicationcontext) event.ge...

python - FLASK: Serving file to browser behind API proxy -

when user enters http://example2.com:5500/?param=x code below generates data.csv file , serves browser. works this. however, have deployed behind api proxy, user makes call http://example1.com/?param=x internally transformed http://example2.com:5500/?param=x . as result, instead of serving data.csv browser before, displays on browser data.csv content. view source-code feature shows data.csv should contain, without html headers, data.csv content, not being served attachement. ideas? from flask import make_response @app.route('/', methods = ['get']) def get_file(): alldata = [] while len(new_data) > 0: new_data = api.timeline(max_id=oldest) alldata.extend(new_data) oldest = alldata[-1].id - 1 outdata = "" data in alldata: outdata += ",".join(data) + "\n" response = make_response(outdata) response.headers["content-disposition"] = "att...

mysql - How to improve wind data SQL query performance -

i'm looking on how optimize (if possible) performance of sql query used reading wind information (see below) changing e.g. database structure, query or else? i use hosted database store table more 800,000 rows wind information (speed , direction). new data added each minute anemometer. database accessed using php script creates web page plotting data using google's visualization api. the web page takes approximately 15 seconds load. i've added time measurements in both php , javascript part profile code , find possible areas improvements. one part hope improve following query takes approximately 4 seconds execute. purpose of query group 15 minutes of wind speed (min/max/mean) , calculate mean value , total min/max during period of measurements. select avg(d_mean) group_mean, max(d_max) group_max, min(d_min) group_min, dir, from_unixtime(max(dt),'%y-%m-%d %h:%i') group_dt ( select @i:=@i+1, ...

Pulling supplies, cost from database and multiplying by quantity, returning total in ColdFusion -

i overwhelmed, not thinking right trying write simple code. have select option, when supply selected should pull cost database , populate appropriate field. user enters quantity , calculates total without refreshing page. "submit()" value on cfselect clears field, populates cost. don't know how else save values without submitting form. goal have 25+ rows can select supplies & quantity , populate totals each , grand total. <cfquery name="supplies" datasource="application_dev"> select * supplies </cfquery> <cfoutput> <cfform> <table> <tr> <td colspan=3>additional supplies</td> </tr> <tr> <td>date</td> <td>supply</td> <td>cost</td> <td>quantity</td> <td>total</td> </tr> <tr> <td><cfinput type="date...

material design - AppCompat ProgressBar coming blue in android L -

i have customized themes per documentation action bar , nav bar color changing. progress dialog still in blue. please me sort out: <style name="apptheme" parent="theme.appcompat.light.darkactionbar"> <!-- customize theme here. --> <item name="colorprimary">@color/theme_green_dark</item> <item name="colorprimarydark">@color/theme_green_dark</item> <item name="coloraccent">@color/theme_green_dark</item> </style> <style name="splashscreentheme" parent="@style/theme.appcompat.light"> <item name="android:windowbackground">@color/loader_dark_color</item> <item name="android:windownotitle">true</item> <item name="windowactionbar">false</item> <item name="android:windowfullscreen">true</item> <item name="android:windowcontentover...

PHP - Where to implement Session Logic in MVC? -

access application (in order) whitelist ip address redirect 404 on invalid ip check if last activity > 2 hours ago redirect login page , expire session check if user logged in, looking @ user data in $_session redirect login page if not valid index.php (notice similar this question): /** * set timezone */ date_default_timezone_set('zulu'); /** * include globals , config files */ require_once('env.php'); /* * closure providing lazy initialization of db connection */ $db = new database(); /* * creates basic structures, * used interaction model layer. */ $servicefactory = new servicefactory(new repositoryfactory($db), new entityfactory); $servicefactory->setdefaultnamespace('\\myapp\\service'); $request = new request(); $session = new session(); $session->start(); $router = new router($request, $session); /* * whitelist ip addresses */ if (!$session->isvalidip()) { $router->import($whitelist_config); ...

android - Memory errors using Allocations and RenderScript -

i working on live streaming wifi camera android tablet. have frame grabber running in thread, in turn takes pixels , passes them renderscript filter processing (another thread). output allocation linked surface viewing. the app crash periodically sigsegv faults, monitor says it's happening in either thread, gcdaemon or jnisurfacetexture. have 2 kernels running (switchable) , both fail eventually. more basic kernel pixel [] camera input allocation, sent renderscript , result output allocation of 'foreach' call sent surface using .iosend(). if take pixel [] array camera thread , copy directly output allocation, , call .iosend(), never crashes (i.e. circumventing renderscript calls). can create output allocation (temp one) , use return output allocation of 'foreach' call, copy surface linked output allocation , not crash, although strange pixelation effects in video. i'm still bit new renderscript there thread safety issues not aware of? or perhap...

android - Turnbased matches disappear after loading for the first time -

i'm developing game android using google play services creating turnbased match. at first fine load turnbased matches signed in user using games.turnbasedmultiplayer.loadmatchesbystatus(getapiclient(), new int[]{turnbasedmatch.match_turn_status_my_turn, turnbasedmatch.match_turn_status_their_turn, turnbasedmatch.match_turn_status_invited, turnbasedmatch.match_turn_status_complete}) .setresultcallback(this); it loaded matches of given states. since last weekend callback called there no matches, i'm not participating in match (status response ok). deleted cache of google play services on phone , rebooted device. @ moment matches shown again until next time opened app. again matches missing. once start new match match keeps showing above method (refreshing list) until close app. @ next launch match gone. i have game not published yet in test phase on google play developer console. found same issue on emula...

mysql - Mounting container volume from the hosts' drive? -

im setting mysql container so: docker run -v /srv/information-db:/var/lib/mysql tutum/mysql /bin/bash -c "/usr/bin/mysql_install_db" now, works when nothing mounted on /srv on host, when mount drive, docker seems write underlying filesystem (/), eg: /]# ls -l /srv total 0 /]# mount /dev/xvdc1 /srv /]# mount ... /dev/xvdc1 on /srv type ext4 (rw,relatime,seclabel,data=ordered) /]# docker run -v /srv/information-db:/var/lib/mysql tutum/mysql /bin/bash -c "/usr/bin/mysql_install_db" /]# ls -l /srv total 16 drwx------. 2 root root 16384 apr 22 18:05 lost+found /]# umount /dev/xvdc1 /]# ls -l /srv total 4 drwxr-xr-x. 4 102 root 4096 apr 22 18:24 information-db anyone seen behaviour / have solution? cheers i've seen that. try perform stat -c %i checks both inside host , container before , after mount event (in order inode values of target dirs). guess they're mismatched reason when mount external device.

ios - Returning a BOOL method inside a block? -

i have bool method returns yes or no inputted string. i'm able return yes or no , cannot seem able make network connection , return yes or no depending on server's response. tried using __block , don't feel wait web request finish, there way return yes or no in success block without giving me error: incompatible block pointer types sending 'bool(^)(nsurlsessiontask*__strong, nserror __strong' parameter of type 'void(^)(nsurlsessiontask ...) -(bool)customresponseforstring:(nsstring *)text { __block bool response_available; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_default, 0), ^{ afhttpsessionmanager *manager = [afhttpsessionmanager manager]; manager.responseserializer = [afhttpresponseserializer serializer]; [manager.responseserializer setacceptablecontenttypes:[nsset setwithobject:@"text/plain"]]; [manager get:[nsstring stringwithformat:@"http://example.com/response.php?input=%@"...

uiscrollview - iOS fixed width ScrollView -

Image
i want achieve following auto layout. --------------------- | | | | | | | scrollview | | | | | | | | | --------------------- | | | content | | | --------------------- the scrollview has width equal screen size , content inside scrollview extends screen. not want user able scroll horizontally. i have tried put view inside of scrollview , set both of them have leading, trailing, top, , bottom constraints 0. try dynamically set width of content , scrollview screensize. simply surround page's content in scrollview set have leading, trailing, top, , bottom constraints 0. try dynamically set width of scrollview screensize. both of following result in this... notice how centered horizontally have set be, yet horizontal scrollbar present , can scroll blank screen. you set wro...

html - unable to align div in center in Bootstrap v3.1.1 -

am using bootstrap v3.1.1 , try align div center unable align div center this page code need in center of page unable can 1 me algin form in center <!doctype html> <html lang="en"> <head> <title>animus blogging category flat bootstarp resposive website template | home :: w3layouts</title> <link href="css/bootstrap.css" rel="stylesheet" type="text/css" media="all"> <link href="css/style.css" rel="stylesheet" type="text/css" media="all" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="keywords" content="graphic responsive web template, bootstrap web templates, flat web templates, andriod compatible web template, ...

vb.net - Code behind does not run from HTML with <% tags -

i have following html: <td align="center"> <%#createdynamichtml()%> the <%# %> tags, whatever they're called, meant point code behind function. here function: public function createdynamichtml() string dim html string = string.empty 'create lots of html return html end function it compiles function not run. put break point in there, doesn't hit. what's going on? the # symbol databinding. = symbol short response.write. try using <%=createdynamichtml()%>.

javascript - How can I highlight a specific div from a hash in the URL? -

when user comes website via www.example.com/#div4 , division specified in url highlighted #f37736 (orange) , within 2 seconds transition smoothly #00a087 (the default color). the div highlighted class of "fixed-nav-bar". what i've tried: var hash = false; checkhash(); function checkhash(){ if(window.location.hash != hash) { hash = window.location.hash; } t=settimeout("checkhash()",400); }; you hash, target division it's class name. you'll change color of div orange color, animate default color. you need include jquery color library animate background-color though, vanilla jquery cannot animate background-color . can use jquery ui's highlight effect , thought ui library little heavier in size. $(document).ready(function () { var hash = window.location.hash; $('.' + hash).css('background-color', '#f37736').animate({ backgroundcolor: '#00a087' }, 2000); }); ...

git - How do I import specific or old commit from bitbucket using eGit in eclipse -

i have created 1 branch (say submaster) master in bitbucket , done around 4 commit eclipse using egit. now want import project 2nd commit of submaster. possible import directly eclipse or have first download old commit , import eclipse? you need cherry-pick, cli easier, if must use egit, plenty of documentation, such https://wiki.eclipse.org/egit/user_guide#cherry_picking

android - Activity with ListView and other elements -

Image
i dont know how set activity layour right. have layout button @ top , when click want populate listview present data(like history of ordered pizzas). when click button this: i dont understand why button keeps copying. want 1 @ top. activity_tab_history.xml <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbottom="@dimen/activity_vertical_margin" tools:context="com.example.tomek.pizzaservice.tabhistoryactivity"> <button android:layout_width="wrap_content" android:layout_height="wrap_content" ...

XCode 6.1.1 UITableView White Spacing Gap -

Image
i have been running issues uitableview after being dragged , dropped view controller appears sizable white space gap top of element ot start of prototype cells. why occur default , there way remove this? maybe in size inspector? i having same issue in 6.3.2 , had go viewcontroller's attribute inspector , uncheck "adjust scroll view insets" in layout information section. sorry, won't let me post images, solved frustration me. hope helps else.

xcode - Accessing an Image with specific resolution in the Asset Catalog programmatically with Swift -

i have image set called "smileyface" contains 1x, 2x , 3x image sizes. want copy pasteboard specific size image set. how reference 1x, 2x or 3x programmatically in code below? let image = uiimage(named: "smileyface" ) let image2 = uiimagepngrepresentation( image ) uipasteboard.generalpasteboard().setdata(image2, forpasteboardtype: "public.png") this code copies 1x. want copy 2x image. please not send me apple documentation not seem reference this. update: figured out ztan's post below. let xscale = uitraitcollection(displayscale: 3.0) //could 1.0, 2.0 or 3.0 let image = uiimage(named: "smileyface" )?.imageasset.imagewithtraitcollection(xscale) uipasteboard.generalpasteboard().image = image; println("width: \(image!.size.width).") println("trait: \(image?.traitcollection).") you can use imageasset.registerimage() method: let scale1x = uitraitcollection(displayscale: 1.0) let scale2x = uitra...

python - Pandas Read CSV with string delimiters via regex -

i trying import weirdly formatted text file pandas dataframe. 2 example lines below: loaded lane 1 mat. type= 2 leffect= 1 span= 200. space= 10. beta= 3.474 loadeffect 5075. lmax= 3643. cov= .13 loaded lane 1 mat. type= 3 leffect= 1 span= 200. space= 10. beta= 3.515 loadeffect10009. lmax= 9732. cov= .08 first tried following: df = pd.read_csv('beta.txt', header=none, delim_whitespace=true, usecols=[2,5,7,9,11,13,15,17,19]) this seemed work fine, got messed when hit above example line, there no whitespace after loadeffect string (you may need scroll bit right see in example). got result like: 632 1 2 1 200 10 3.474 5075. 3643. 0.13 633 1 3 1 200 10 3.515 lmax= cov= nan then decided use regular expression define delimiters. after many trial , error runs (i no expert in regex), managed close following line: df = pd.read_csv('beta.txt', header=none, sep=...

html - Javascript - change paragraph Text on Each Button Click -

i trying create 3 buttons, , using javascript, if button 1 clicked changes "click button" text "you pressed button 1" same button 2 , 3! and if button 3 pressed, text colour changes green however, can't seem work! appreciated here current code: <!doctype html> <html> <head> <title>button</title> </head> <body> <script type="text/javascript"> function changetext() { var b1 = document.getelementbyid('b1'); var b2 = document.getelementbyid('b2'); var b3 = document.getelementbyid('b3'); if(b1.onclick="changetext();") { document.getelementbyid('ptext').innerhtml = "you pressed button 1"; } if(b2.onlick="changetext();") { document.getelementbyid('ptext'...

javascript - Reference error while trying to encapsulate an animation function -

i'm trying put function own class object. here below. the canvas property holds dom functions, , getting error next property, ctx, should refer method defined in canvas. so property ctx should refer ctx method defined in canvas property. bt when page loads, dev tools telling me there reference error @ point - canvas not defined. i encounter problem when canvas defined in external global variable. var drawcrash = { canvas : function () { dom methods here }, ctx : canvas.ctx, pointer : canvas.pointer, particles : "", nbrparticles : 160, speed : 6, strength : .4, radius : 4, perspective : 0.5, ang : null, cosorsin1 : null, cosorsin2 : null, //functions setspeed : function (_inputspeed) { this.speed = _inputspeed; }, startdrawing : function () { pointer.down = function() { } } run(); } } i believe canvas not available. don't put line ctx: c...

javascript - highlight text in a variable using RegExp and span -

i have div of text. want highlight of text stored in variable using regexp , span. text highlighted unknown @ run time. var t = $("#highlightoutput").html(); //sentence var s = t.search(hstr);//what shd replaced var query = new regexp(s, "g"); console.log(s); t = t.replace(query, "<span class='highlight'>"+s+ "</span>"); //problem here //how write regex code highlight text stored in s. $("#highlightoutput").html(t); search returns index, want actual text. use match that: method returns array of matches, , can take first one. var s = t.match(hstr)[0];

oracle - how to Move data from one table to another c# -

i have 2 table named test1 , test2 want move data test1 test2 in way if condition matches update data else insert in database.i have done oracle query posted down.i have achieve 2 more tasks **1>i have move operation in console c# application 2>i have remove leading blank spaces entries t2_fname , account_number** how can achieve task need ado.net c# code if how it merge test2 using test1 b on (a.t2_name = b.t1_name) when matched update set a.t2_fname = b.t1_fname, a.account_number = b.account_no, when not matched insert (t2_slno,t2_name,t2_fname,account_number) values (t2_node_seq.nextval, b.t1_name,b.t1_fname,b.account_no); you can create console application , use ado.net execute query use trim function in oracle remove leading blank spaces. here code (not tested don't have oracle db) using system; using system.data; using system.data.oracleclient; namespace testapp { class program { static void main() { ...

python - Is there a way to start unit tests which related only to changed code? -

in python project, have big number of unit tests (some thousands). though logically distributed between files , classes, need lot of time in order find ones, cover functionality i'm changing. of course, can run test specific file/class, again because of big number of tests, it'll time-consuming run them continuously (i'm executing unit tests each time after saving file in ide). so in general need solution following activities @ time: tracks files have been changed since last file saving traces dependencies between code have been changed in files , unit tests cover code selectively executes unit tests cover code has been affected does have idea similar? you might checkout pytest-incremental : the idea execute tests faster executing not of them “required” ones. install via pypi : pip install pytest-incremental usage: $ py.test --inc i think looking for, "looks imports recursively find dependencies (using ast)" , runs changed ...

javascript - How to refresh ng-repeat on modal close? -

the setup: have page (angular) repeater in it. <tr ng-repeat="row in results.leads"> <td>{{row.submittedbyname}}</td> within repeater, there column button opens modal alter row's data. modal, in turn, has button saving of record, closes current modal, opens new modal, let's user enter comment, saves, , closes modal. this works great. fantastic. what doesn't work is... when modal closes, ng-repeat supposed refresh, actions taken in modal remove rows data. if refresh page manually, row vanishes - without refreshing page, nothing happens. the angular controller: 'use strict'; angular.module('leadapproval.controllers', []). //this main page core method - data loaded here, , in-table-row buttons work here. controller('leadapprovalctrl', function ($scope, $location, $modal, api, notificationservice) { $scope.currentpage = 1; $scope.pagesize = 13; $scope.loaded = false; ...

c++ - What is the most efficient way to find multiple sums from a file? -

let's have file containing multiple rows of 3 columns: 3 1 3 1 2 3 4 5 6 . . . the goal find sum of each column. solution simple: make 3 variables sum , 3 more temp variables. however, solution doesn't scale well. if there 6 columns? i'd have make total of 12 variables. there other ways making count variable , temp variable , adding temp variable correct sum using modulus of count. seems hack. is there better way of doing or c++ standard library meant this? why not have single variable called sum , variable called temp. basic outline: initialize sum 0; while there more lines: read 1 line of input till \n found while line has more inputs: read each number out of (using temp) sum += temp next number print out sum , reset 0 next line

javascript - Route with multiple modules an inline views not working - $http interceptor possibly causing errors -

i'm working in project angular. the idea have different modules , each 1 of them able register own routes. partials within same html inline. not working... here plunkr http://plnkr.co/edit/n3q1fw95ld24xqtf37az the code like: <body ng-class="{loaded: loaded}" ng-app="stream" ng-controller="streamctrl"> <div id="wrapper" ng-show="loaded"> <div ng-view></div> </div> <script type="text/ng-template" id="welcome.html"> template </script> </body> and js: (function() { "use strict"; angular.module("default", ["ngroute"]) .config( ["$httpprovider", "$routeprovider", "$locationprovider", function ($httpprovider, $routeprovider, $locationprovider) { $routeprovider .when("/mee", { templateurl: "partials/welcome.html" ...

angularjs - http-rewrite-middleware with generator-cg-angular -

anyone succeded use "http-rewrite-middleware" "generator-cg-angular"?? i try setup in gruntfile.js, similar recomend grunt connect. var rewritemodule = require('http-rewrite-middleware'); and in grunt.initconfig have connect: { main: { options: { port: 9001, hostname: 'localhost' }, }, development: { options: { middleware: function (connect, options) { var middlewares = []; // rewriterules support middlewares.push(rewritemodule.getmiddleware([ {from: '^/rest/user', to: '/json/user.json'} ])); if (!array.isarray(options.base)) { options.base = [options.base]; } var directory = options.directory || options.base[options.base.length - 1]; options.base.foreach(function (base) { // serve static files. mi...

grep - Retrieve lines of a text that contain a certain string only in the end and not somewhere in between -

i have text file of taxonomic assignation of bacterias looks ( numbers indicate different bacterias): 1130952 k__bacteria; p__acidobacteria; c__acidobacteriia; o__acidobacteriales; f__acidobacteriaceae; g__edaphobacter; s__modestum 555445 k__bacteria; p__firmicutes; c__clostridia; o__clostridiales; f__lachnospiraceae; g__clostridium; s__fimetarium 325910 k__bacteria; p__firmicutes; c__clostridia; o__clostridiales; f__ruminococcaceae; g__; s__ 744205 k__bacteria; p__proteobacteria; c__deltaproteobacteria; o__; f__; g__; s__ many of bacterias don´t have classification down specie level, lack information : "s__". see bacterias have information (as in 2 bacterias above, 1 being "s__modestum" , other "s__fimetarium"). using mac terminal (mac os x 10.9.5) , tried, grep -v "s__" file but since assignation contain s__ noting (it excludes them guess..). i have tried using * @ end in s__* doesn't work either. what apply command...

javascript - How to use the Closure Compiler File Watcher in PHP Storm -

Image
i trying google's closure compiler work php storm minifying javascript files. i'm not quite sure i'm doing wrong trying work , can't find guides/tutorials on web anywhere other php storm's own docs, aren't specific enough. i installed closure compiler using "npm install -g closurecompiler" it placed here: "/usr/local/bin/ccjs" (alias of "/usr/local/lib/node_modules/closurecompiler/bin/ccjs") i created file watcher in php storm so: link image now when save js file following error: /usr/local/bin/ccjs --compilation_level simple_optimizations --js common.js illegal source file after options: simple_optimizations process finished exit code 3 with or without simple_optimizations option gives error. presumably can't locate file i'm working with, possibly because of path it's working from. question very, simple, how specify correct path? i have tried specifying exact path (and verified ...

marklogic - SPARQL queries causing XDMP-MEMCANCELED -

we performing series of different sparql queries on database containing ~5 million triples. our queries cause xdmp-memcanceled-error though not consistently, return correct result within few seconds or less. queries occationally seems hang , cause server run @ 100% cpu until query times out. we have tried increasing memory-related settings find. query runs fine on other triple stores/engines. we running marklogic 8.0-11 aws instance 8 gb of internal memory , 16 gb of swap space. example of straightforward query causes error: prefix xsd: <http://www.w3.org/2001/xmlschema#> prefix t5_m: <http://url.com/t5/model#> prefix t5_d: <http://url.com/t5/data#> select distinct ?_app_id ( ?_err ?_reason ) ?_comment ?_severity { bind ( 3 ?_severity) bind ( "generated hl7 v2 conformance profile of ihe pcd-01 message" ?_comment ) filter( ?_app_id = 'app_id') filter ( ?_ts >= '2015-04-21t09:04:07.871' ) filter ( ?_ts <= '2015-04-21...

Post json file to my REST service in java -

i'm trying post data angular js form saved database using rest service using java. below code rest @stateless @path("driverprops") public class driverpropfacaderest extends abstractfacade<driverprop> { @persistencecontext(unitname = "com.mycompany_groupprojectbackend_war_1.0-snapshotpu") private entitymanager em; public driverpropfacaderest() { super(driverprop.class); } @post @override @consumes({ "application/json"}) public void create(driverprop entity) { super.create(entity); } hers part of driverprop class import java.io.serializable; import javax.persistence.basic; import javax.persistence.column; import javax.persistence.entity; import javax.persistence.generatedvalue; import javax.persistence.generationtype; import javax.persistence.id; import javax.persistence.namedqueries; import javax.persistence.namedquery; import javax.persistence.table; import javax.validation.constraints.notnull; import javax.xml.bind....

android: how to get memory usage (ram) of a given PID programically -

i want log ram usage of given application @ given time rate. wrote code full memory value used not know how memory usage of given pid. please me out this code used memory activitymanager localactivitymanager = (activitymanager)getsystemservice("activity"); activitymanager.memoryinfo localmemoryinfo = new activitymanager.memoryinfo(); localactivitymanager.getmemoryinfo(localmemoryinfo); log.i("",string.valueof(localmemoryinfo.availmem)); i think can using public memoryinfo[] getprocessmemoryinfo (int[] pids), not know how code since im android beginer activitymanager localactivitymanager = (activitymanager)getsystemservice(context.activity_service); // use context.activity_service not literal "activity" list<activitymanager.runningappprocessinfo> procsinfo = localactivitymanager.getrunningappprocesses(); int[] pids = new int[procsinfo.size()]; (int = 0; < procsinfo.size(); i++) { activitymanager.runningappproc...

sql server - Error assigning pass through query to report recordsource in VBA code -

i have following code : private sub report_open(cancel integer) on error goto errorhandler dim isptqueryexists integer isptqueryexists = isquery("mytestquery") if isptqueryexists = -1 set qdf = currentdb.querydefs("mytestquery") qdf.sql ="my sql query" me.recordsource = "mytestquery" end if else dim databasename string dim servername string servername = "xxxx" databasename = "xxxx" set qdf = currentdb.createquerydef("mytestquery") strconnectionstring = "xxxx" qdf.connect = strconnectionstring qdf.sql = "my sql query" me.recordsource = "mytestquery" end if errorhandler: msgbox err.description end sub ******************************************************** ' function: istablequery() ' ' purpose: determine if table or query exists. ' ' arguments: ...

Do different browsers handle various PHP functions differently? -

context: i'm working on matlab script decodes messages encrypted 1:1 letter-replacement scheme. works finding the common character in message , remapping letter of corresponding commonness based on stats found online. demo, i'm writing message letter frequencies correspond ones in script. write letter, developed rudimentary html form accompanying php script (live @ http://nd.edu/~wbadart/letter ) count letters in input, rank them, , display rank along side desired rank. question: i'm using firefox, , tool worked fine, displaying incorrect values teammates in chrome , safari. 1 of telling errors chrome , safari both incorrectly displayed variable $mssglen nothing more strlen() of input. know account these discrepancies? thanks! try add encoding head section of html , try use mb_strlen instead of strlen. <!doctype html> <html> <head> <meta charset="utf-8"> php server side language, there no difference between...

winforms - Stopping Button Click Function in C# Winfoms -

i have save button grabs information , stores in sql winform. issue i'm having if click save button, still stores blank information in database. don't want this. here's code. keep in mind, actual saving, updating, getting data work perfectly. private void btnsave_click(object sender, eventargs e) { if (txtlocalsourcepath.text != null) { if (resourcekey == 0) { connstring = configurationmanager.connectionstrings["dev"].connectionstring; getdata(connstring); insertdata(connstring); getdata(connstring); lblinsertnewrecord.visible = true; lblinsertnewrecord.text = string.format("you have inserted new record @ {0}", system.datetime.now); } else { updatedata(); getdata(connstring); lblinsertnewrecord.visible = true; ...