Posts

Showing posts from June, 2014

java - Numbers of JVMs per JBoss server -

i'm wondering if number of jvms jboss server can increased? not sure if each of application can run on own jvm. if possible, advantages of having more 1 jvms in single server. each jboss instance runs on own jvm. scalability , high availability (ha) purposes, have n+1 jboss instances (and n+1 jvms accordingly) in architecture. this provides many benefits, notably http/https web thread pool increased (if underlying os/vms hardware beefy enough) can handle 2x many requests concurrently, bigger ejb thread pool along ha, clustered single sign on, session replication across nodes, , many other benefits. typically have 1 or more software load balancer such apache httpd proxying requests individual jboss worker nodes via mod-cluster or mod-jk.

how to implement advanced search in rails with form validation -

i have problem scenario in ruby on rails 4, hope guys can me out. i have products , brands , prices , users tables: products : name, description,user_id,... brands : title prices : value, shipping_fee,... users : username, password,... i need search page allows people search products based on: prices (minimum, maximum) brands seller name (it join users table) what's suggestion best way implementing such scenario? (or should cleanest way) ps1: i need validate fields in search form. ps2: i've seen sunspot , don't think if kind of full-text search option scenario have @ has_scope gem. it allows implement search in controller using resource scopes.

php - How to make table not offside when scrolling? -

i'm developing web page php show table, problem when i'm scrolling table, table cover header.if i'm using fixed header, footer , sidebar. please make table not cover header when scrolling. this php + html code: <!doctype html> <head> <link rel="stylesheet" type="text/css" href="css/blended_layout.css"> <title>early warning system</title> </head> <body> <div id="fixedheader"> <h2>early warning system</h2> </div> <div id="fixedsidebar"> hello world! </div> <div id="maincontent"> <table cellpadding="5" cellspacing="0" border="1"> <tr bgcolor="#ffffff"> <th>site id actual</th> <th>site name actual</th> <th>regional</th> <th>

javascript - Disqus not displaying comment count -

summary: setting disqus display comment count on page within our mvc .net site. have 'fixed' feature before on tumblr page, thought had needed skills on site failing. have reviewed of ryan's ( https://stackoverflow.com/users/1370956/ryan-v ) applicable answers have not found solution. i following directions disqus.com this: https://help.disqus.com/customer/portal/articles/565624 but having no success. understanding need is: add script disqus_shortname replaced within it insert href tag "#disqus_thread" appended end of article url once done think script should insert comment count number , display on page -- isn't working me. in tumblr supposed insert meta tag <meta name='text:disqus shortname' content='' /> but don't believe applies in setting (although didn't stop me giving try). i can assume i'm missing obvious. wonder if localhost environment interrupting testing since using link localhost page disp

Using sed to eliminate all lines that do not match the desired form -

i have single column csv looks this: kfig kunv k~lk k7rt 3vgt some of datapoints garbled in transmission. need keep entries begin capital letter, other 3 digits capital letter or number. example, in list above have delete k~lk , 3vgt . i know delete capital letters can write sed -n '/[a-z]\{4,\}/p' i want adjust last 3 digits capital letters or numbers. appreciated. just use: sed -n '/[a-z][a-z0-9]\{3,\}/p' however, if these identifiers there in file, propose following command (it assure whole line matched, reject example identifiers more 4 characters long): sed -n '/^[a-z][a-z0-9]\{3\}$/p' ^ means "match zero-length string @ beginning of line"; \{3\} means "match 3 occurences of previous atom", previous atom being [a-z0-9] ; $ means "match zero-length string @ end of line".

How to record screen with Android Studio -

Image
i connect phone android studio , code. want record phone screen. saw this button disabled in android studio. can capture screens can't record. can me this? update this how there in android studio. button disabled go menu view -> tool windows -> android you find record icon @ bottom left corner. if using avd, make sure "use host gpu" disabled . to take video recording of app: start app described in run app in debug mode. click android open android ddms tool window. click screen record on left side of android ddms tool window. click start recording. interact app. click stop recording. enter file name recording , click ok. source: https://developer.android.com/tools/debugging/ddms.html

c# - Ignore Special Characters (tittles) in Examine search -

using umbraco v6, examine search (not full blown lucene queries) . latin/south american website. i've asked colleges how type in tittles search/url, , said don't, use "regular" characters (a-z, a-z). i know how strip special characters out of string when passing examine, need other way around, in examine removing special characters properties match query. have numerous "nodes" have tittles in name (which 1 of properties searching on). posts i've researched: http://shazwazza.com/categories/examine?p=2 ignore special characters in examine https://groups.google.com/forum/#!topic/umbraco-dev/w6cwypoc43y i've tried writing luence query (or think) i'm not getting in hits. // q query querystring var searcher = examinemanager.instance.searchprovidercollection["customsearchsearcher"]; //var query = searcher.createsearchcriteria().field("nodename", q).or().field("description", q).compile(); //var searchresu

windows - How to record ping statistics in tabular format? -

i need record ping statistics tabular format on windows. c:\users\hsangal>ping localhost -t -n 2 pinging techbeamers.local [127.0.0.1] 32 bytes of data: reply 127.0.0.1: bytes=32 time<1ms ttl=128 reply 127.0.0.1: bytes=32 time<1ms ttl=128 ping statistics 127.0.0.1: packets: sent = 2, received = 2, lost = 0 (0% loss) approximate round trip times in milli-seconds: minimum = 0ms, maximum = 0ms, average = 0ms i using windows batch scripting, looking lead experts. data wish record in tabular format part of ping command output highlighted below: packets: sent = 2, received = 2, lost = 0 (0% loss) you use find lines information of interest only, like: ping localhost -n 2 | find "packets:" this returns line packets: sent = 2, received = 2, lost = 0 (0% loss), . wrap around for /f statement this: for /f "tokens=3,5,7,8 delims=,=() " %i in ('ping localhost -n 2 ^| find "packets:"') echo %i;%j;%k;%l the output (s

How to access active directory by multiple user in MS Azure -

i have active directory in ms azure. want colleague use same directory can rnd on same. have created user them using hotmail id. have changed user role "global admin" them. cant see option access same active directory after log in. there way give url https://manage.windowsazure.com/@iamnewinazurehotmail.onmicrosoft.com#workspaces/all/dashboard , log in hotmail account. you need add him in administrators list in setting option of azure panel. steps: login azure portal root administrator. go left panel , select setting. go administrators tab in right side pane. click on add button in task pane , add hotmail or organisation id co- administrator, select subscription in want allow him. click on tick mark apply these settings.

java - Execute shell script with different interpreter -

i trying execute python script using jsch , want run python script .sh file using different interpreter (shebang). here content of shell script file ( fileexec.sh ): #!/usr/bin/env python print 'hello python' it looks shebang cannot changed since getting: bash : print command not found here java code: session = newsessionfor(user, host, port); channel channel = session.openchannel("exec"); file shfile = new file("fileexec.py"); filewriter writer = new filewriter(shfile); writer.write(shebang + "\n"); writer.write(command); writer.close(); printwriter printwriter = new printwriter(shfile); printwriter.println(shebang); printwriter.println(command); printwriter.close(); ((channelexec) channel).setcommand(fileutils.readfiletobytearray(shfile)); the shebang used os when executing file. you not executing file, copy-pasting contents of python file onto shell prompt. if don't want store , execute file on server, ca

php - How to show popup on same page after data submission -

i have html form <form class="form" method="post" action="data.php"> <div class="form-group"> <input class="form-control input-lg" type="text" placeholder="full name" name="name" id="name" required=""> </div> <div class="form-group"> <input class="form-control input-lg" type="tel" placeholder="phone number" name="phone" id="phone" required=""> </div> <div class="form-group"> <input class="form-control input-lg" type="email" placeholder="email id" name="email" id="email" required=""> </div> <div class="form-group"> <!--<input class="form-control input-lg option" type="date"

sql function - How does SQL server treat text comparisons with LEADING spaces -

much made (and able found on internet) how not need use where rtrim(columnname) = 'value' in sql server, because automatically considers value or without trailing spaces same. however i've had hard time finding info leading spaces. if (for whatever reason) our data warehouse has leading spaces on varchar / char type of fields , need have clauses - still need ltrim() ? i'm trying avoid big performance hit researching out other options. thank you leading spaces never ignored in comparisons of text based data type. if comparing equality of text columns, best option validate values on data entry make sure text unwanted spaces in front not allowed. example if database expecting user type list of possible values database application expecting, not allow user interfaces let users enter text free-form, force them enter 1 of explicit valid values. if need user able enter free-form text never want leading spaces, strip them on insert. normalizing database

ruby - How to convert data in a file to a nested hash or an array of hashes -

i have file in following format. have 100 records starting record 1 in file. here few records file: record 1: [record acct_num "11111111" trxn_dt "20140822" post_dt "20140822" trxn_amt "33.4" trxn_cat "rci" trxn_cat_desc "abcd"] record 2: [record acct_num "44444444" trxn_dt "20140819" post_dt "20140822" trxn_amt "183.75" trxn_cat "aci" trxn_cat_desc "defg"] i want convert data in file nested hash or array of hashes can perform assertions. want nested hash like: { { acct_num => "11111111", trxn_dt => "20140822", post_dt => "20140822", trxn_amt => "33.4", trxn_cat => "rci", trxn_cat_desc => "abcd" }, { acct_num => "44444444",

php - Using value from previous test case in PHPUnit -

i trying assign value variable inside first testing function , use in other testing functions inside class. right in code second function fails due error: 1) apiadtest::testapiad_postedadcreated guzzlehttp\exception\clientexception: client error: 404 and dont know why. how code looks like: class apiadtest extends phpunit_framework_testcase { protected $adid; private static $base_url = 'http://10.0.0.38/adserver/src/public/'; private static $path = 'api/ad/'; //start of expected flow public function testapiad_postad() { $client = new client(['base_uri' => self::$base_url]); $response = $client->post(self::$path, ['form_params' => [ 'name' => 'bellow content - guzzle testing' ]]); $data = json_decode($response->getbody()); $this->adid = $data->id; $code = $respons

.net - Efficient way to extract key values using C# -

we token key values in following format shown below. efficient way extract amount , currency code key values?. trying use split method not sure if best way. "{\"amount\":12.0,\"currencycode\":\"840\"}" use json.net http://www.newtonsoft.com/json . popular json parser .net. can call jobject.parse ("yourtext"); , can inspect json. documentation, please follow link http://www.newtonsoft.com/json/help/html/introduction.htm . happy coding!

javascript - Change attributes dynamically using jquery -

i running loop appending input fields. now, using loop, attributes similars. so, when need grab 1 of grabbing more 1 field. how dynamically change attributes according index, can grab correct input field ? ebs_no = data.number_ebs; for(i=0;i<ebs_no;i++){ $('form.ebs').append("<br>ebs"+(i+1)+"</br>"); $('form.ebs').append('<br> snapshotno <input type="text" name="'+i+'"></br>'); $('form.ebs').append('<input type="submit" name="submit">'); $('[name='+i+']').on('submit',function(){ alert($('[name='+i+']').val()); }); } replace this: alert($('[name='+i+']').val()); by this: alert($(this).val()); the code $(this) refers element being treated

android - Using UrbanAipShip causing ANR when using sharedpreferences -

i'm using urbanairship library, wrote init part of urbanairship in application class. in launcher activity used sharedpreferences. because of using urbanairship causing anr @ point of accessing shared preferences in app. i dont why. please me.

CSS image hover / scale works great in chrome but not IE -

i working on website , have horizontal table 4 images want scale larger when hovered. have opacity effect become solid when hovered on. works great on chrome images @ 100% opacity , not scale larger when hovered on ie. jsfiddle: https://jsfiddle.net/u9hk6x5y/ #hoverimage { text-align:center; margin-left:13%; margin-right:13%; z-index: 9999; } #hoverimage1 { width: 162px; float: left; margin-right: 10px; z-index:9999; } #hoverimage2 { width: 162px; float: left; margin-right: 10px; z-index: 9999; } #hoverimage3 { width: 162px; float: left; margin-right: 10px; z-index: 9999; } #hoverimage4 { width: 162px; float: left; margin-right: 10px; z-index: 9999; } #hovergallery{ -webkit-transition-duration: 0.5s; /*webkit: animation duration*/ -moz-transition-duration: 0.5s; /*mozilla duration version*/ -o-transition-duration: 0.5s; /*opera duration version*/ transition-duration: 0.5s; opacity: 0.8; /

regex - how to block referrer spam using htccess -

my website getting referrer spam added following code in htaccess rewritecond %{http_referer} floating-share-buttons.com [nc,or] rewritecond %{http_referer} 4webmasters.org [nc,or] rewritecond %{http_referer} trafficmonetizer.org [nc,or] rewritecond %{http_referer} erot.co [nc,or] rewritecond %{http_referer} yourserverisdown.com [nc,or] rewritecond %{http_referer} event-tracking.com [nc,or] rewritecond %{http_referer} traffic2money.com [nc,or] rewritecond %{http_referer} buttons-for-website.com [nc,or] rewritecond %{http_referer} success-seo.com [nc,or] rewritecond %{http_referer} free-social-buttons.com [nc,or] rewritecond %{http_referer} get-free-traffic-now.com [nc,or] rewritecond %{http_referer} e-buyeasy.com [nc,or] rewritecond %{http_referer} videos-for-your-business.com [nc,or] rewritecond %{http_referer} callgirlservices.in [nc] rewriterule ^(.*)$ – [f,l] from http://99webtools.com/blog/block-referrer-spam-with-htaccess/ still getting referrer above websites. me in blo

Getting SQL from ResultSet Java -

i have resultset object not know sql , params of it. how discover resultset's sql? short answer? can't. resultset object independent of query or stored procedure produced it.

css - Chevron - Problems with the responsive behaviour and input field disabled on it -

Image
i have following component: the problem had fix height , big problem when want resize windows. , in same time i'm not able use input fields inserted in div. here code: css: #chevron { position: relative; padding: 12px; margin-bottom: 6px; height: 100%; z-index:-1; } #chevron:before { content: ''; position: absolute; top: 0; left: 0; height: 100%; width: 51%; background: #f7f7f7; -webkit-transform: skew(0deg, 6deg); -moz-transform: skew(0deg, 6deg); -ms-transform: skew(0deg, 6deg); -o-transform: skew(0deg, 6deg); transform: skew(0deg, 6deg); z-index: -1; } #chevron:after { content: ''; position: absolute; top: 0; right: 0; height: 100%; width: 50%; background: #f7f7f7; -webkit-transform: skew(0deg, -6deg); -moz-transform: skew(0deg, -6deg); -ms-transform: skew(0deg, -6deg); -o-transform: skew(0deg, -6deg); transform: skew(0deg, -6deg); z-index: -1; }​ html <div class=&qu

Remove password and connect with new password wifi android -

i ask help, code : protected void onactivityresult(int requestcode, int resultcode, intent data) { if(requestcode==request_code_input){ switch (resultcode){ case result_code_pass: connectivitymanager connectivitymanager = (connectivitymanager) getsystemservice(context.connectivity_service); networkinfo networkinfo=connectivitymanager.getnetworkinfo(connectivitymanager.type_wifi); wifimanager wifimanager= (wifimanager) getsystemservice(context.wifi_service); pass=data.getstringextra("password"); namewifi=data.getstringextra("namewifi"); wificonfiguration conf=new wificonfiguration(); conf.allowedkeymanagement.set(wificonfiguration.keymgmt.none); list<scanresult> networklist=wifimanager.getscanresults(); if(networklist !=null){ for(scanresult network : networklist){

Selenium-Webdriver (Java) failing to execute 'hoverover and click' function consistently -

i'm trying access screen in application, appears when mouse-hover on tab , click on 1 of options. used actions method execute using selenium. here's code: element=driver.findelement(by.id("tab")); actions hoverover=new actions(driver); hoverover.movetoelement(element).movetoelement(driver.findelement(by.id("menu"))).click().build().perform(); when login application , directly call tab, i'm able access without issue. problem occurs when access tab different screen in application. whenever access hover-over page different page in application, page loads correctly of time fails , recieve 'no such element' or 'stale element reference' error. i'm not sure how able access tab without issue , how throwing errors. please guide me here , let me know if there else(any additional functions/or alternative actions?) can mouse-over click works time. edit: tried using both explicit , implicit waits , thread.sleep well, in vain. in chro

class - returning instances in python -

class classname(): def func(self,a,b): self.c = a+b self.d = a-b self.e = a*b return self cn = classname() this way can access cn.c, cn.d , cn.e can use else other self return , structure. know possible in matlab can define structure in function. expect should this: class classname(): def func(self,newself,a,b): self.c = a+b self.d = a-b newself.e = a*b return self, newself cn = classname() i know not valid code idea want code. i think want this: class classname: def __init__(self, a, b): self.c = a+b self.d = a-b self.e = a*b cn = classname(12, 34) # random values 'a' , 'b'. use whatever like! print(cn.c) >>> 46 print(cn.d) >>> -22 print(cn.e) >>> 408 the __init__ function automatically called when object created. self refer object, adding attributes add object, don't need return anything.

maven.repository.redhat.com Nexus Proxy -

Image
i setup maven.repository.redhat.com proxy in nexus 2.11.3-01 but getting few artifacts. "browse index" , "browse remote" show artifacts. "browse storage" shows 2 artifacts. did not 2 artifacts.. showed automatically. so when building maven projects has dependency <dependency> <groupid>org.jboss.bom.eap</groupid> <artifactid>jboss-javaee-6.0-with-tools</artifactid> <version>6.4.2.ga</version> <type>pom</type> <scope>import</scope> </dependency> i : [error] non-resolvable import pom: failure find org.jboss.bom.eap:jboss-javaee-6.0-with-tools:pom:6.4.2.ga in https://nexus.xxx.com:8443/content/groups/public/ cached in local repository, resolution not reattempted until update interval of xxx-nexus-repository has elapsed or updates forced @ line 98, column 25 artifacts show in storage tab when requested through proxy. requested these thr

AngularJS: Disable html button if history is empty -

in angularjs application have implemented html button "go back"-functionality . in case history empty (because user hasn't changed path since page load) want hide/disable it. is there way detect if history empty angular? you can check $window service of angular js. same window object of javascript. the history object contains urls visited user (within browser window). the history object part of window object , accessed through window.history property. if want see whether history empty or not should use if( $window.history.length <= 1 ) { //internet explorer , opera start @ 0, while firefox, chrome, , safari start @ 1 console.log("empty"); } please make sure you've injected $window service in controller. couple of functions of history object here . can write more lines detect browser first , after apply conditions in angular way. please check post

How can I implement from xml file layout inside the App using Android studio? -

Image
i'm beginner in android. want implement graphic layout android app: how can generate xml implement layout on picture in android? below desired layout <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:weightsum="3" android:layout_height="match_parent"> <linearlayout android:layout_width="match_parent" android:layout_weight="1" android:background="#c3c3c3" android:layout_height="0dp"> <imageview android:background="@color/black_color" android:layout_width="match_parent" android:src="@drawable/ic_launcher" android:layout_height="match_parent" /> </linearlayout> <scrollview android:layout_w

c# - Run GTK# Application in Kiosk Mode -

i writing c#/mono app (gtk# gui) raspberry pi. want run app in kiosk mode (fullscreen, no metacity/ window borders, unable exit). how work under linux/raspian? in windows using wpf can set window borderless , maximize it. havn´t found similar property on gtk-window. this works on os-x, not have linux box double-check right now, should same: using system; using gtk; namespace gtkfullscreennotdecorated { class mainclass { public static void main (string[] args) { application.init (); mainwindow win = new mainwindow (); win.show (); win.fullscreen (); win.decorated = false; application.run (); } } } the main thing win.fullscreen. in full screen, gtk2 window decoration not visible, add it. run , without performing win.fullscreen() see how display manager turning decoration off.

java - What is the best way to resolve dependencies between my classes when I write a library? -

i'm doing small homemade project , noticed wish reuse portion of code in other projects. the conclusion move code in separate module , publish in artifactory (i'm using maven) become reusable. the problem classes within new module rely on each other. usually, when develop non-library project, use spring's inversion of control feature resolve dependencies between classes. can't use dependency injection in module, because dependencies resolved when bean obtained container. therefore, lets imagine following situation: i have class1 in module. has field of type class2, should be.. lets say.. instance of same object (i.e. singleton). own ideas how resolve it: 1) if class2 doesn't contain state, methods (and plays utility role) can make static. therefore won't need resolve dependency, since don't need create it's instance anymore. result, can become hard test type of class. 2) can implement singleton pattern without using di. static class2.geti

.net - C# Linq Join Into statement editor error -

var joinedtables = tablerow in filteredtable.asenumerable() join contactsrow in contacts.asenumerable() on tablerow.field<double>("opportunity: store number") equals contactsrow.field<double>("national store .") lj r in lj.defaultifempty() select resulttable.loaddatarow(new object[] { tablerow.field<double>("opportunity: store number"), tablerow.field<datetime>("target circuit completion (foc)"), tablerow.field<string>("vendor name"), contactsrow.field<string>("contacts - acm - email") }, false); i trying left-outer-join on 2 tables using linq using this answer . when try add fields contactsrow object array argument of .loaddatarow() function, editor s

asp.net - C# SQL table select and count distinct values -

i have asp website sql database table. in table column mane "type". want distinct values column values count in datatable. example database table: id type --------- 1 type1 2 type2 3 type3 4 type2 5 type2 6 type3 i want following datatable: type count ------------ type1 1 type2 3 type3 2 you can use select type, count(type) count table1 group type result | type | count | |-------|-------| | type1 | 1 | | type2 | 3 | | type3 | 2 | sqlfiddle demo

c++ - boost property tree cannot read multiple json data in one file -

i need decide problem. using boost property tree parse twitter messages stored in json file. messages saved in 1 json file , need parse 1 one. here twitter json data saved in file. has 3 different messages. (below deducted message test) {"id":593393012970926082,"in_reply_to_status_id":1,"user":{"id":2292380240,"followers_count":2},"retweet_count":0} {"id":654878454684687878,"in_reply_to_status_id":7,"user":{"id":2292380241,"followers_count":4},"retweet_count":5} {"id":123487894154878414,"in_reply_to_status_id":343,"user":{"id":2292380242,"followers_count":773},"retweet_count":654} and here c++ code parsing message, using property tree. #include <boost/property_tree/json_parser.hpp> using namespace std; using namespace boost::property_tree; string jsonfile = "./twitter.json"; i

java - Jersey Moxy based rest service not consuming nested json post request payload -

i have snake case representation of json data '{"first_name":"michael", "last_name":"jordan", "address_loc":{"city_name":"mumbai", "street":"galino1"}}' . want consume data jersey + moxy based post method resource in form of pojo representation. please suggest.please note normal camel case representation of json working using given following code snippet have requirement of using snake case. @xmlrootelement public class person { private string firstname; private string lastname; private addressloc addressloc = new addressloc(); public person(){}; public address getaddressloc() { return addressloc ; } public void setaddressloc(address address) { this.addressloc = address; } public string getfirstname() { return firstname; } public void setfirstname(string firstname) { this.firstname = firstname; } public string getlastname() { return lastname; } public void

variables - If i enter a value above 16383 in this C program that converts decimal to binary, it doesn't work. Why? -

this decimal binary converter, user inputs decimal number , binary version outputted. works fine except when input number (shown variable 'a' in code) greater 16383. i'm not quite sure why. curious thing when 16383 used input number, binary output long series of 1's. not sure if that's clue answer. anyways, here's code: #include<stdio.h> #include<conio.h> void main() { clrscr(); int a,x=1; printf("enter number in base 10:"); scanf("%d",&a);//max value:16383 reason?? while(x<=a) { x=x*2; } x=x/2; printf("\nbinary version:"); if(x==1) printf("1"); else { while(x>=1) { if(a/x==1) { printf("1"); a=a-x; } else printf("0"); x=x/2; } } getch(); } are you, chance, working on 16-bit machine (where sizeof(int) 2 )? because 16383 0x3fff . 1 more 0x4000 , when double

node.js - npm request module's formData is undefined in POST call to another Server + Express4.x.x -

var form = { widgetreleaseid: req.body.widgetreleaseid, version: req.body.version, uploaddate: req.body.uploaddate, myfiles : myfiles }; below npm request. request.post( { url:target_url+'widget-releases/', formdata:form }, function optionalcallback(err, httpresponse, body) { console.log('body'+body) if (err) { console.log(err) } del(['uploads/'+req.session.loginuser+'**/*'], function (err, paths) { console.log('deleted files/folders:\n', paths.join('\n')); }); res.redirect('/admin-ui/widget-release/add'); }); api exposed 'post' on nodejs server. .error coming while reading files folder supposed

Using fuzzily with more than one field RAILS -

rails 4.2 ruby 2.1 fuzzily (0.3.3) i using fuzzily gem searches , it's working. in controller, have this: @notes = note.find_by_fuzzy_description("%#{item}%") the notes table has following fields: user_id description contents what return fields user_id = 5 (for example). idea how fuzzily? as stated in github open issues it's well-known requested feature not resolved. can try test note.where(user_id: user_id).find_by_fuzzy_description("%#{item}%") , if works correctly, doubt does. as workaround can try fuzzy search big limit , select results belongs user , apply standart limit. slower, wouldn't recommend use if have many users.

spring integration - Create programatically message-driven-channel-adapter to process the messages on queue -

i process message programmatically using message-driven-channel-adapter. here scenario have implement: application during startup read configuration service. configuration provides information queues contain messages. hence create message-driven-channel-adapter each queue listen messages asynchronously. any example initializes spring integration context programatically instead of using xml useful. if going programmatically, i'd suggest bypass spring integration magic , use defaultmessagelistenercontainer directly. afterwards can send messages existing messagechannel directly messagelistener implementation or using messaging gateway. please, careful programmatic configuration not miss important attributes applicationcontext or invocation afterpropertiesset() .

Clojure flat sequence into tree -

i have following vector, [-1 1 2 -1 3 0 -1 2 -1 4 0 3 0 0] which represents tree [[1 2 [3] [2 [4] 3]]] where -1 begins new branch , 0 ends it. how can convert original vector usable tree-like clojure structure (nested vector, nested map)? think clojure.zip/zipper might i'm not sure how build function args. zippers tool this:  (require '[clojure.zip :as zip]) (def in [-1 1 2 -1 3 0 -1 2 -1 4 0 3 0 0]) (def out [[1 2 [3] [2 [4] 3]]]) (defn deepen [steps] (->> steps (reduce (fn [loc step] (case step -1 (-> loc (zip/append-child []) (zip/down) (zip/rightmost)) 0 (zip/up loc) (zip/append-child loc step))) (zip/vector-zip [])) (zip/root))) (assert (= (deepen in) out))

Does .NET Framework 3.5 SP1 include 3.5? -

according microsoft download site : microsoft .net framework 3.5 service pack 1 cumulative update contains many new features building incrementally upon .net framework 2.0, 3.0, 3.5, , includes .net framework 2.0 service pack 2 , .net framework 3.0 service pack 2 cumulative updates. so .net framework 3.5 sp1 include 3.5 or not? the wording confusing yes, title says, it's "full package", original framework + sp1 additions.

javascript - Reactjs animate replace: How to wait for fade out before adding content to fade in? -

i trying use reactcsstransitiongroup replace content fading out content, waiting disappear completely, , fading in new content. i using key props solution this related question , content being swapped out , animated. problem, though, new content added dom , takes space in flow start, rather waiting until old content has faded out. i.e., can delay fading in transition delay, gap content fade in there start. since css visibility:hidden still adds space element in flow using opacity doesn't either. my question: there way achieve desired outcome using css? if not, presume component have detect end of fade-out transition , add new element; recommended react way detecting , reacting transitionend events? my code far: // jsx let key = this.state.adding ? 'addform' : 'addplaceholder'; <reactcsstransitiongroup transitionname="fade"> <div key={key}> {this.state.adding ? this.renderform() : this.renderplaceholder()} </div>

linux - 'ls -l' command explanation except of permissions -

can please explain 'ls -l' headers ? drwxrwxr-x 1 www-data www-data 16384 aug 3 07:47 cached/ drwxrwxr-x 1 explained here: explanation of ls -l command in linux? can please clarify rest ? command ls -l output explained: http://go2linux.garron.me/command-ls-file-permissions/

java - I can't resize or move elements on Intellij IDEA GUI designer -

Image
i want drag , drop them in netbeans. is there way functionality of netbeans or eclipse in idea? you can drag , drop components , alter on part of layout appear. might need split column if want component on half of parent. see: https://www.jetbrains.com/idea/help/placing-gui-components-on-a-form.html but set minimum size or set if component should grow, need properties panel of selected component (on left). see: https://www.jetbrains.com/idea/help/setting-component-properties.html

android - WSO2 EMM - blacklist application -

is possible define white list instead of blacklist in wso2_emm , lock other apps when device connected enterprise network? how can modify wso2_emm this? client devices android. in current implementation, can not achieve that. can try digging code , improve. it's in our official documentation[1]. [1] - https://docs.wso2.com/display/emm110/wso2+enterprise+mobility+manager thanks

Q: Disable access to default vhost and through server IP on Apache 2.4.10 -

i'm trying apache 2.4.10 on debian 8 "jessie" , running multiple websites hosted on it. might obvious , answered question i've never had need set-up dedicated web host (usually drop wamp server development needs or pick web hosting service) , far have not had luck finding answer problem (i've found complete opposite answers of i'm trying achieve). need working because apart hosting couple of websites, there additional software set-up, which, regular web hosting service won't do. everything seems working intended problem can't seem find optimal configuration wouldn't block access default vhost 403 - forbidden. need apache ignore requests (not return 404 document tell browser there's nothing there) accessing default vhost or accessing server directly through it's designated ip. designated ip should left ssh access (since don't have kind of physical access server). basically, web server should accessible web browser through "f

java - getResources array xml in pageradapter -

i try pass value xml array listfragment . public class tabspageradapter extends fragmentpageradapter { static context context; static resources res = null; static string[] content = null; public tabspageradapter(fragmentmanager fm, context c) { super(fm); context = c; } @override public listfragment getitem(int index) { res = context.getresources(); content = res.getstringarray(r.array.trg_values); listfragment fragment = new daerahfragment(); bundle args = new bundle(); args.putstring("daerah", content[index] ); fragment.setarguments(args); return fragment; } @override public int getcount() { // item count - equal number of tabs return 7; } } here xml <string-array name="trg_values"> <item name="kuala terengganu">1</item> <item name="marang&quo

linux - container_of isn't returning expected address -

i'm not sure i'm doing incorrectly it's time eyes. make device device_create() providing "extra data" follows: pdevice = device_create(ahcip_class, null, /*no parent*/ mkdev(ahcip_major, ahcip_minor + i), &mydevs[i], driver_name "%d", ahcip_minor + i); expecting sysfs attribute function going take pointer struct kobject member of struct device following attribute function static ahcip_dev *get_ahcip_dev(struct kobject *ko) { ahcip_dev *adev = null; struct device *pdev = container_of(ko, struct device, kobj); if (!pdev) { pr_err("%s:%d unable find device struct in kobject\n", __func__, __line__); return null; } /* debugging stuff */ pr_info("%s:%d mydevs[0] %p\n", __func__, __line__, mydevs); pr_info("%s:%d mydevs[1] %p\n", __func__, __line__, mydevs+1); pr_info("%s:%d mydevs[0].psysfs_dev %p\n", __func__,

android change webview when change a tabstrip -

i wonder if can me work, want change webview url every time change tab in tabstrip i new developer kind of great. the main code of pager , tabs import android.graphics.color; import android.graphics.drawable.colordrawable; import android.graphics.drawable.drawable; import android.graphics.drawable.layerdrawable; import android.graphics.drawable.transitiondrawable; import android.os.bundle; import android.support.v4.app.fragment; import android.support.v4.app.fragmentmanager; import android.support.v4.app.fragmentpageradapter; import android.support.v4.view.viewpager; import android.support.v7.app.actionbaractivity; import android.support.v7.widget.toolbar; import android.util.typedvalue; import android.view.menu; import android.view.menuitem; import android.view.view; import android.widget.toast; import com.astuetz.pagerslidingtabstrip; import com.readystatesoftware.systembartint.systembartintmanager; import butterknife.butterknife; import butterknife.injectview; public cl

excel - Copy/paste 1 column, dynamic range, into separate worksheet -

i'm looking copy dynamically changing range of values column e, starting @ row 6, , paste worksheet (starting @ column g row 15). numbers can pasted values. essentially, copy function stop when row becomes blank. pretty newbie vba have done messing around it. thanks! welcome stackoverflow :) range("e6", range("e" & activesheet.rows.count).end(xlup)).copy range("g" & activesheet.rows.count).end(xlup).offset(1, 0).pastespecial looks confusing means: range of e6 bottom of row ctrl+up arrow copy bottom of row g ctrl+up arrow down 1 next blank paste in future if want make sure show enough detail prove have had go , not wanting written you, comment above on about. good luck

C# Console Application connecting to Exchange Online -

i have c# console app written manipulate mailbox hosted on exchange 2010 server. i'm leveraging ews connect box using autodiscover. in near future mailbox moving exchange online (as part of migration office365). i've been reading, appears app have registered in azure ad. case, or autodiscover continue function is? autodiscover works exchange online. however, if running own dns e-mail domain administrator have configure required dns record. dns records required domain displayed in office365 portal.