Posts

Showing posts from September, 2010

javascript - Including Jquery Library from a external scource -

i trying include following jquery library: http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js when run bellow code alert not displayed: <div style="float: left; margin-left:0px; width:20px; padding-top: 10px;"> <form id="payment_form" action="https://arembepe.net/tester3.php" method="post"> número cartão: <input type="text" id="card_number"/> <br/> </form> </div> <script src="https://assets.pagar.me/js/pagarme.min.js"></script><script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"> alert(123); </script> however when run same code without reference jquery library alert displayed: <div style="float: left; margin-left:0px; width:20px; padding-top: 10px;"> <form id="payment_form" action="https://arembepe.net/tester3.php" method="po

ruby on rails - How to ignore pending migrations? -

i have rails app connects rails app database. have several common models. when using console, works fine (activerecord queries tables properly), when using web server, rails checks pending migrations , raises error migrations pending . want pass check these 2 apps have different migrations. , start server. tried: config.active_record[:migration_error] = false config.active_record.migration_error = false but no luck. how can make rails ignore pending migrations? skip check? or there way name them somehow, or set appropriate mtime , last migration file? try in appropriate environment file in in rails_root/config/environments/ development.rb , staging.rb or production.rb config.active_record.migration_error = false since rails stores migration information in table called schema_migrations. can add version migration table skip specific migration. version number string comes before description in file name. alternatively, can rename migration example from 2016080110

c# - OleDB Could Not Determine the Decimal Value -

i trying table foxpro c# . using following statement; sqlcmd.commandtext = @"select ew.ew_pplid, ew.ew_name, ew.ew_from, ew_to, ew.ew_totdays empwork ew inner join employs emp on ew.ew_pplid = emp.em_pplid emp.em_netname not '' , trim(emp.em_netname) <> '' , emp.em_type <> 2 , ew.ew_from > ?"; sqlcmd.parameters.addwithvalue("pdate", convert.todatetime("01/08/2016")); but getting error have never seen before; the provider not determine decimal value. example, row created, default decimal column not available, , consumer had not yet set new decimal value. has seen error before, , if how can around this? if if choking on date time false message, try slight alteration via , ew.ew_from > ctod( ? )"; and parameter string of date sqlcmd.parameters.addwithvalue

java - Security: Write javax.mail.Message to File with Encryption -

i have 'javax.mail.message' object should written file system. use javax.mail (com.sun.mail) version 1.5.5 javax.mail.message message = buildmessage(...); message.writeto(new fileoutputstream("message.plain")); now message written file. how can encrypt & decrypt file? post example below, code fails. my example code: static byte[] salt = new byte[8]; static { securerandom random = new securerandom(); random.nextbytes(salt); } public final void test() throws exception { message message = buildtestmessage(...); secretkey secret = encode(message, new fileoutputstream("test.encrypted"), "01234567".tochararray()); message message2 = decode(new fileinputstream("test.encrypted"), "01234567".tochararray()); // out sth. from@domain <--> null system.out.println(message.getfrom()[0] + " <--> " + message2.getfrom()); } private message decode( inputstream mailfilei

python - Am I using virtualenv wrong or is this a limitation of it? -

so used virtualenv define environments number of projects working on. defined virtualenv python being version 3.4. eventually, global python upgraded 3.4.0 3.4.3. proved problem because virtualenv dependent on global binaries (the contents of /lib/python3.4 in virtualenv links global binaries), , these aren't defined minor versions. in other words, when upgrade done, contents of binary folder /usr/lib/python3.4 replaced. because python doesn't install things separately in 3.4.0 , 3.4.3 single folder named /usr/lib/python3.4 . since python executable in virtualenv 3.4.0, there compatibility issues 3.4.3 binaries (it fail load ctypes prevented python dependent run). fix i've found downgrade global python installation, feels "dirty". if had 1 project running 3.4.0 , running 3.4.3 ? there no way make them work in parallel on same machine given 1 binary folder can exist 3.4.x installation ? i'm trying understand if i'm missing obvious here or if c

javascript - TypeScript Interface not working as I expected -

so right now, i'm trying make small modular web application. using typescript, quite new to. in code, i: define structure of interface ( programlist ) i create object 1 property ( programlist ) of type programinfo i define programlist 1 array item using programlist interface. here code: interface programinfo { path:string; name:string; pkgname:string[]; start?:string[]; cli?:string[]; } let program = { programlist: programinfo[] }; program.programlist = [ { path: "/default_programs/wospman", name: "wospman (webos package manager)", pkgname: ["com", "webos", "wospman"], start: ["wospman", "wospm"], cli: ["wospman"] } ]; my ide (jetbrains webstorm), keeps giving me typescript compile errors: ts2304: cannot find name programinfo` although defined programinfo on first few lines. when do: let progr

android - MPAndroidChart: Bar Chart variables X entries -

i have added mpandroidchart project code , use bar chart x-entires want enter start date , end date variables. please how can ? finally found solution not totaly good: i have modify public class dayaxisvalueformatter below: private barlinechartbase<?> chart; private string[] mvalues; private arraylist<long> mdatelist = new arraylist<long>(); private int msize; public dayaxisvalueformatter(barlinechartbase<?> chart, arraylist<long> datelist, int size) { this.chart = chart; this.mdatelist = datelist; this.msize = size; } @override public string getformattedvalue(float value, axisbase axis) { // "value" represents position of label on axis (x or y) return longtostringfortimereal(mdatelist.get( msize)); } //pour le formatage de la date public static string longtostringfortimereal(long time) { date date = new date(time); simpledateformat simpledate = new simpledateformat("yyyy/mm/dd");

c# - Create checkbox next to each label -

i need page maintained, need of stuff programmatically generated. need create checkboxes next normal labels, without touching .aspx file. right generate list labels on page called labels . each label on site has id beginning lbl_ , ones supposed have checkbox begin lblx_ . want use create said checkboxes: foreach (label label in labels) { if (label.id.contains("lblx_")) { checkbox cb = new checkbox(); cb.id = "cb_statistikname_" + label.id; label.controls.addat(0, cb); } } right code replaces labels, same happens when use label.control.add(cb) you can use page.controls.addat() combination of page.page.controls.indexof() if(label.parent != null && label.parent.controls.indexof(label) >= 0) label.parent.controls.addat(label.parent.controls.indexof(label) + 1, cb); note :this should done in page preinit events.

java - trying to remove the favicon of spring boot in spring-boot-starter-parent 1.3.2 -

i trying remove favicon of spring boot application , content of spring-boot-starter-parent in pom.xml <parent> <groupid>org.springframework.boot</groupid> <artifactid>spring-boot-starter-parent</artifactid> <version>1.3.2.release</version> <relativepath/> <!-- lookup parent repository --> </parent> after research have tried changing application.properties file spring.mvc.favicon.enabled=false still tomcat favicon still appears in header. issue?

linux - Installing a oracle forms development machine -

Image
after working oracle databases , apex many years, want knowledge oracle forms & reports, because still quite used. i've never seen oracle forms & reports, want create development installation learning purposes. unfortunately installing oracle forms seems bit more tedious expected , i'm bit stuck. windows installation i first tried installing oracle 12c (from http://www.oracle.com/technetwork/developer-tools/forms/downloads/index.html ) on windows 7 x64. installed "standalone forms builder", because when chose "forms , reports deployment", got error: after installation tried start frmbld.exe, got error: frm-91135: fatal error: message file d:\oracle\client\user123\product\12.1.0\client_1\forms\mesg\fmcus.msb not found my oracle client installed in directory, mentioned file certainty not there. linux installation googling around did not find solution problem, decided switch linux virtual box machine. installed oracle linux x64 ,

java - Setting JavaFX Anchor Pane's anchors in CSS -

one of windows in gui application consists of similar hboxes same controls inside. wanted center in top layer pane (in case - anchor pane). here's code: <?xml version="1.0" encoding="utf-8"?> <?import javafx.scene.layout.anchorpane?> <?import javafx.scene.control.label?> <?import javafx.scene.layout.vbox?> <?import javafx.scene.layout.hbox?> <?import javafx.scene.control.textfield?> <?import javafx.scene.control.button?> <anchorpane xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1"> <vbox fx:id="modewindowpane" alignment="center" anchorpane.bottomanchor="0.0" anchorpane.leftanchor="0.0" anchorpane.rightanchor="0.0" anchorpane.topanchor="0.0"> <hbox alignment="center" anchorpane.bottomanchor="0.0" anchorpane.leftanchor="0.0" anchorpane.rightanchor=&quo

ruby - How to run RSpec scripts with custom arguments -

i have specific requirement run rspec scripts supplying configuration file during run time. rspec doesn't allow supply custom arguments through command-line except pre-defined ones "--tag, --format, --output etc.." is there workaround this? after lot of digging in through various online resources , stackoverflow, found workaround this: by using dotenv gem, can achieve this. install dotenv $ gem install dotenv create .env file in test script folder custom arguments "key=value" pairs, e.x: config_file=test_config.yaml read values environment variables in spec file require 'dotenv' dotenv.load describe "passing arguments" before(:all) @configfile = env['config_file'] end "initiating device config" puts "using device config file #{@configfile}" end end now read config file name environment variable in test scrips.

html - How to enable javascript window.close() in vaadin dialog? -

Image
i have html page has close button on click, should close window. html page being loaded on vaadin dialog. understand vaadin takes care of closing dialog window.setclosable(true). but, button in html page should same. how enable ? below code : myhelp.html: <html> <head> </head> <body> . . <!-- @ footer right corner --> <p class="myclass" align="right"><img src="images/iconclose.gif" width="50" height="10" border="0" onclick="window.close()" title="close"></p> . . </body> </html> java code: . . string link = "test/myhelp.html"; menuitem menuitem = null; if (link.contains("/test")) { menuitem = menubar.additem("", new externalresource(stringutil.append("/images/", images.get(i))), new command() { @override public void menuselected(menuitem selecteditem) { final window window = new window(this

php - Can't figure out this mysql query -

ok, first i've been trying make php script right query, when run sql error check, discover query whats wrong in script... since php fine, won't bother posting php does. i've been trying several syntaxes people recomend on many places... i'm trying using phpmyadmin directly insert queries , test how works faster... i did many of queries on past can't figure out wrong.... tried using phpmyadmin default syntax , use necessary stuff... still no work. the query im using: update `promos` set `img2`='captura_de_tela__2_.png' `id` 1 so table promos, field want change field 'img2', on id 1, , insert image src there, 'captura_de_tela__2_.png'.... still trying... not working still... please help!!! update `promos` set `img2`='captura_de_tela__2_.png' `id` = 1

osx - Dealing with NSRect in python -

i have function: def getmediabox(doc, pagenum): page = cgpdfdocumentgetpage(doc, pagenum) return cgpdfpagegetboxrect(page, kcgpdfmediabox) which returns: <nsrect origin=<nspoint x=0.0 y=0.0> size=<nssize width=499.0 height=709.0>> is data type python can with? <> brackets mean? ideally, want query , test size numbers. interestingly, coregraphics seems accept nested lists, [[0,0],[499,709]] when expects nsrect. many thanks: appreciated. you can query nsrect object following lines: x = cgrectgetwidth(mediabox) y = cgrectgetheight(mediabox)

How to find dependencies between database tables in SQL Server 2012 -

i have blogging website has sql server 2012 on backend. building mobile app , post blogs directly backend. i able insert post primary table, post not appearing on website. i suspect there 1 or more tables contain additional data constituting blog post i'm unable find them. is there efficient way find additional related tables? possible there "hidden" fields or tables in database? first query give list of tables table references, , second give list of tables reference table. works if there referintial integrity set between tables. declare @tablename varchar(max) = 'mytable', @schemaname varchar(max) = 'dbo' select distinct s.name schemaname, o2.name tablename sys.foreign_keys fk join sys.objects o on fk.parent_object_id = o.object_id join sys.schemas s on o.schema_id = s.schema_id join sys.objects o2 on fk.referenced_object_id = o2.object_id join sys.schemas s2 on o2.schema_id = s2.schema_id o.name = @tablename

Using JNI libraries in flink cluster -

i need use jni libraries run jar on flink cluster. can please guide me how this? if provided using vm arguments how pass vm arguments while running jar using flink cli? there change need madein flink script? one way use jni library path provide java.library.path parameter: java -djava.library.path= you can provide jvm arguments task manager (responsible executing individual flink tasks) using flink_env_java_opts_tm environment variable: export flink_env_java_opts_tm="-djava.library.path="

Android Studio: No resource found that matches the given name: attr 'searchViewTextField' -

i making (was trying to) changes existing eclipse project. imported studio, , added dependencies. build.gradle apply plugin: 'com.android.application' android { compilesdkversion 23 buildtoolsversion '23.0.3' defaultconfig { applicationid "com.uniapps.prayer.times.almoazin" minsdkversion 16 targetsdkversion 23 compileoptions { sourcecompatibility javaversion.version_1_7 targetcompatibility javaversion.version_1_7 } } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt' } } } dependencies { compile files('libs/startappinapp-2.4.1.jar') // compile 'com.android.support:appcompat-v7:24.1.1' // compile "com.android.support:appcompat-v7:23.0.0" compile "com.google.android.gms:play-services:9.4.0&

http - How to receive remote push notifications in android using GCM in Delphi 10 -

i trying send , receive remote push notifications using gcm services, when had delphi xe7 method in answer 2 in question working [ google cloud messaging in delphi xe5? , in seattle dosent, java errors, however, i've followed answer in question, , managed device token id, cant dont receive notification when send mobile phone, code send : const sendurl = 'https://android.googleapis.com/gcm/send'; var params: tstringlist; authheader: string; idhttp: tidhttp; ssliohandler: tidssliohandlersocketopenssl; begin idhttp := tidhttp.create(nil); try ssliohandler := tidssliohandlersocketopenssl.create(nil); idhttp.iohandler := ssliohandler; idhttp.httpoptions := []; params := tstringlist.create; try params.add('registration_id='+ memo1.lines.text); params.values['data.message'] := edit1.text; idhttp.request.host := sendurl; authheader := 'authorization: key=' + myserverkey; idhttp.request.customheaders.add(authheader); idhttp.re

java - RxJava hook not being called on custom Scheduler -

i have registered hook via rxjavahooks.setonscheduleaction(new myonscheduleaction()); and created custom scheduler (for testing purposes) using scheduler scheduler = schedulers.from(executors.newsinglethreadexecutor()); but following piece of code doesn't call registered hook: observable.create(subscriber -> { subscriber.onnext("hi"); subscriber.oncomplete(); }).subscribeon(scheduler).subscribe(mytestsubscriber); if i, however, replace subscribeon(scheduler) subscribeon(schedulers.io()) (or subscribeon(schedulers.computation()) , matter) hook called expected. is expected behaviour? i'm using rxjava 1.1.8. this bug schedulers.from() , fixed in 1.1.9. can track related issue/ pr here .

php - Find the direction of a language using its locale identifier? -

does icu (php intl extension) provides way detect direction of language (rtl/ltr) ? direction script data. language can use many scripts , script can used many languages, i'm not sure can map language direction. even if could, php provides no way these informations. can try icanboogie/cldr see if cldr data of use (after languages use 1 script). you can find here mapping between languages , scripts , here scripts data include direction.

java - Json to xml conversion generating confusing xml string -

i have dto class converting json , storing db. need corresponding xml file json. class foodto { private string id; // array of strings. private arraylist<string> names; // object of other class having 2 values string socid , string socname. private someotherclass soc; } i using gson google library create json object , xml string. foodto foodto = new foodto(); gson gson = new gson(); string jsonstring = gson.tostring(foodto); jsonobject json = new jsonobject(jsonstring); string xmlstring = xml.tostring(json, "parent"); when each member of foodto object contains value generates perfect xml. <parent> <id>some id</id> <names>john</names> <names>mac</names> <soc> <socid>123</socid> <socname>xyz</socname> </soc> </parent> but problem when value in object empty generates confusing xml not possible convert same json , class object afterwards

objective c - How to open Phonegap iOS application using url in email for password reset -

i have created ios application using phonegap. want implement reset password functionality. when user selects 'forgot password', application sends link reset password on registered email. using link user can update password web browser. i want open phonegap application when user clicks on link received in email. the link like: https://mydomainreset.com/reset can launch application using url scheme of ios? i.e. can set " https://mydomainreset.com " in "url types"->"url schemes" in info.plist of application. if no there other way this? thanks in advance.

installation - Visual basic 2015 makes my PC shutdown from power source -

i have downloaded full (3.7gb) iso visual studio2015 official site.i aware take 'long' time. 'acquiring' part of installation got completed in 10 min. 'applying' part progressing fast.i don't know why pc got turn off power source (the switch turn on in cpu doesn't display green light displays when turn on not started). not able turn on cpu button .i have switch off power source , again turn on. thought there might issues electricity when again tried install visual studio 2015 iso same thing happened again. please me :(( i in such condition few months , later found issue of overload , overheating pc.make sure have appropriate environment , conditions location of cpu.you can try open cpu cabinet , check whether there ventilation facility available because during setup of visual studio cpu may acquire huge workload on processor , ram may cause overheating of processor leading shutting down of pc protection further damage

android - Build indoor location map with Bluetooth tracking -

Image
hi idea track multiple mobile devices location within building, , because it's indoors, bluetooth seems better choice. even though bluetooth have short range, because building have high dense of bluetooth-enabled devices, hundreds of them, , in similar area, possible draw out map track each devices based on network built each bluetooth devices? like put central device in middle 'server', each devices track each other's location when near each other, , when device gets nearby enough 'server' reports locations , 'server' build map based on distance. ibeacon usefull idea. can send individual device distance or other necessary infos server, can map out device location, if trying in real time not sure, still u may check estimote ibeacon, estimote has similar feature named indoor navigation.

android - ibm bluelist and node js sample code error -

using ibm bluemix blulist application : https://github.com/ibm-bluemix-mobile-services/bms-samples-android-bluelist?cm_mc_uid=44237229817214706405928&cm_mc_sid_50200000=1470653588 getting error in android studio : error:execution failed task ':app:compiledebugjavawithjavac'. java.io.filenotfoundexception: c:\users\darshan\downloads\bms-samples-android-bluelist-master\bluelist\app\src\main\jnilibs\sqlcipher.jar (the system cannot find file specified) it looks haven't followed steps in readme under enabling encryption correctly. please ensure have downloaded appropriate files , added them app\src\main\jnilibs directory if you'd enable encryption. please keep in mind sample no longer supported. if continue have issues, try out of our supported simple android samples .

Python : replacing words while iterating -

i'm not sure why code not working. trying iterate on copy of list of words , replace words given word. instead getting raised invalid syntax errors. understand (from reading other posts on here) modifying lists while iterating bad practise, therefore created copy using [:] . here code have: def change(z): words = z.split() in words[:]: if 'because' in i: words.replace(i, 'as') print(words) change(input("line: ")) and error: traceback (most recent call last): file "c:/users/jarrod/desktop/py/ncss2016adv/kindlenook.py", line 9, in <module> change(input("line: ")) file "<string>", line 1 ^ syntaxerror: invalid syntax any clues why syntax incorrect appreciated. you should give code creates error get, stated other people in comments. anyway, in code, i string, not list, because iterating list split loop. so, maybe should use if == 'because

c# - RuntimeBinderException on inherited interfaces -

i getting runtimebinderexception when calling inherited method of interface passing dynamic 1 of arguments. i not understand behaviour. here complete example: using system; class program { static void main(string[] args) { dynamic dyn = new record(); iadvancedtable advtable = new table(); itable table = advtable; // works charm using "base-interface" table.insert(dyn); // using inherited interface throws runtimebinderexception advtable.insert(dyn); console.readkey(); } } public interface itable { void insert(record record); } public interface iadvancedtable : itable{} public class table : iadvancedtable { public void insert(record record){ /*stub*/ } } public class record{} looks there no recursion in runtimebinder checking "inherited interfaces" on actual interface. there reason this?

eclipse - scoping: get all instances of specific type in current file xtext -

following question: here trying customize scoping. want in scope of 'predicate' in language of objects visible in scope, types 'typedef'. predicate: 'predicate' name=id ('(' params=typedparamlist ')')? (':' body=temporalexpression tok_semi) | ('{' body=temporalexpression '}'); typedef: 'type' name=id '=' type=vartype tok_semi; here example of language: type move = {left, right}; predicate stop(move m1, move m2) : m1=left , m2=right; it's not recognize left , right.(can't resolve reference) i tried this: val allcontentscurrfile = ecoreutil2.ealloftype(context,typedef) val allcontentscurrfile2 = ecoreutil2.getallcontentsoftype(context,typedef) i putted parameters scopes.scopefor method (in addition params of predicate) , isn't worked me. don't know how it, how find instances of specific type in current file cross reference wor

Python for .NET import error -

i trying use functions dll 'xxx_clr.dll' contains 'xxx_clr' assembly. here code: import clr print clr.findassembly('xxx_clr') print clr.addreference('xxx_clr') import xxx_clr which gives me importerror: c:\windows\microsoft.net\framework64\v4.0.30319\\xxx_clr.dll xxx_clr, version=1.0.0.0, culture=neutral, publickeytoken=null traceback (most recent call last): file "c:\cygwin64\home\user\owncloud\projects\biotic\spectrum\code\hamamatsu.py", line 6, in <module> import xxx_clr importerror: no module named xxx_clr

xml - XSLT - Set attribute with value of child -

i want set attribute of parent based on value of first child. using xslt 1.0. <div> <div> <span>a</span> <span>text...text</span> </div> <div> <span>1</span> <span>text...text</span> </div> </div> should transformed to: <div> <div data-type="alphanumeric"> <span>text...text</span> </div> <div data-type="numeric"> <span>text...text</span> </div> </div> can me how can this? thank you! try like: xslt 1.0 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/> <xsl:strip-space elements="*"/> <!-- identity transform --> <xsl:templat

html - Applying CSS styling TOP correctly -

Image
i'm kind of new css styling, went couldn't express how solve, hope clear in image attached, want put label beside top of textarea, 1 please in this the thing asking called vertical-align , in case have used vertical-align:top see fiddle the vertical-align property sets vertical alignment of element. can read more vertical-align here , here html <div> <label>employee comments</label> <textarea></textarea> </div> css label{vertical-align:top;}

javascript - Get all visible CKEditor instances -

it possible loop through ckeditor instances like: for(var instancename in ckeditor.instances) { ... } some of ckeditors hidden in case. so, how possible loop through visible ckeditors? i ended checking visibility of closest div for(var instancename in ckeditor.instances) { if($("#"+instancename).closest(".form-group").is(':visible')){ ... } }

java - Error: could not inspect JDBC autocommit mode -

i use hibernate , have 1 dao jdbc needed. in dao use batch. connection.setautocommit(false); (int = 0; < callslist.size(); i++) { calls calls = callslist.get(i); stmt.setint(1, calls.getsecdur()); /////....... stmt.addbatch(); if ((i+1) % 100 == 0){ stmt.executebatch(); connection.commit(); } } stmt.executebatch(); connection.commit(); and in jpa dao have error could not inspect jdbc autocommit mode i not understand why, , how solve it, think problem because of connection.setautocommit(false); error catch in jpa dao @override public list<e> getall() { list<e> list = null; try { criteria criteria = getsession().createcriteria(entityclass); list = (list<e>) criteria.list(); } catch (exception ex) { logger.lo

.htaccess - URL Rewriting I don't want to show index.php in url -

i running php applications on http://localhost:8085/ my directory structure this: c:\wamp\www\website i have placed .htaccess file in website folder. <ifmodule mod_rewrite.c> #turn on rewriteengine rewriteengine on rewritebase /website/ #rules rewriterule ^(.*)$ index.php </ifmodule> when ever click on index.php takes me http://localhost:8085/ home page wrong want got http://localhost:8085/website . please guide me you need add website before index.php like, rewriterule ^(.*)$ /website/index.php updated, try full code, rewriteengine on rewritebase /website/ rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d rewriterule . /website/index.php [l] note: need use http://localhost:8085/website/ base url in every link used in site, otherwise redirect http://localhost:8085/ like, <a href="http://localhost:8085/website/index.php">home page</a> alternatively, not use / before href , use file name

shell - Concatenate two columns and paste the merged column -

i have tab delimited file follows- loci1 loci2 name1 name2 utr3p utr3p terf1 isca2 utr3p intron lpp paaf1 utr3p intron rpl37a rcc1 coding intron bag2 rp11 intron intron kif1b snora21 intron downstream gusbp4 ctd intron intron cltc vmp1 utr3p utr3p pcyt1a zhx3 i concatenate 2 columns name1 , name2 (joined "__").the merged column should pasted new column "merged_names" in new file. how can using awk. expected output - loci1 loci2 name1 name2 merged_names utr3p utr3p terf1 isca2 terf1__isca2 utr3p intron lpp paaf1 lpp__paaf1 utr3p intron rpl37a rcc1 rpl37a__rcc1 coding intron bag2 rp11 bag2__rp11 intron intron kif1b snora21 kif1b__snora21 intron downstream gusbp4 ctd gusbp4__ctd intron intron cltc vmp1 cltc__vmp1 utr3p utr3p pcyt1a zhx3 pcyt1a__zhx3 you can use awk : awk 'begin{ofs=fs="\t"} nr==1{$

sql - PostgreSQL constraint exclusion not working with subquery SELECT IN -

when using partitioning in postgresql, master master partition table create table master ( _id numeric, name character varying ); and having 2 sub tables partition_1 create table partition_1 ( -- _id numeric, -- name character varying, constraint partition_1_check check (_id < 1000) ) inherits (master); create index partition_1_id_idx on partition_1 using btree (_id); partition_2 create table partition_2 ( -- _id numeric, -- name character varying, constraint partition_2_check check (_id >= 1000) ) inherits (master); create index partition_2_id_idx on partition_2 using btree (_id); and table ids (1,3) in example create table _ids ( _id numeric not null, constraint ids_pkey primary key (_id) ) the statement explain select * master _id in (select * _ids) yields seq scan of both partitions regardless whether _ids contains elements partition_1/2 or not. hash semi join (cost=39.48..141.14 rows=2621 width=14) hash con

node.js - MongoDb query for Month comparision in loopback application -

i using mongodb datasource loopback application. in have retrieve documents current month. so tried following: app.models.aaaa.count({ $where : 'return this.date.getmonth() == 7'}, function(err, res){ }); now want filter based on year , userid also. how can construct query that. i tried following: app.models.aaaa.count({ $where : 'return this.date.getmonth() == 7 && this.date.getyear() == 2016'}, function(err, res){ }); but checks month..please share ideas. in advance edit: [ { "aaaid": "57a84a572b9a79022198c6dd", "bbid": "876hjg786", "date": "2016-08-08t00:00:00.000z", "cccc": [ "57a1bfd0c77554fd746a538d'", "57a1bfebc77554fd746a538f" ], "id": "57a85e1d9841c9cb1b100f21" }, { "aaaid": "57a84a572b9a79022198c6dd", "bbid": "876hjg786", &q

PHP contact page not sending on Wordpress website -

i'm creating custom wordpress theme , contact page template wont process process.php file send mail. the file inside theme folder. however, on submission redirects home page title of page being file not found . i error in mamp access logs file: 127.0.0.1 - - [08/aug/2016:11:55:31 +0100] "post /wordpress-4.5.3/wordpress/contact/process.php http/1.1" 404 3384 the code within process.php file looks this: $to = "myemail@gmail.com"; $subject = htmlspecialchars($_post['name']); $email = htmlspecialchars($_post['email']); $number = htmlspecialchars($_post['number']); $message = htmlspecialchars($_post['message']); $headers = "senders email address: " . $email; $headers .= "senders number: " . $number; mail($to, $subject, $message, $headers); and template contact file looks this: <form method="post" action="process.php"> <p> name: * &l

Meteor 1.4 version install packages Error -

i new here , meteor. have package install problems. when did step of video https://www.youtube.com/watch?v=bvkqntifbqk&index=3&list=pllnphn493bhfyzusk62avycgcaouqbt7v i error this c:\users\home\appdata\local.meteor\packages\meteor-tool\1.4.0-1\mt-os.windows.x86_32\isopackets\ddp\npm\node_modules\meteor\promise\node_modules\meteor-promise\promise_server.js:165 throw error; ^ error: no metadata files found isopack at: /c/users/home/appdata/local/.meteor/packages/stolinski_stylus-multi/1.4.3 @ isopack. loadunibuildsfrompath (c:\tools\isobuild\isopack.js:900:13) @ c:\tools\packaging\tropohouse.js:520:19 @ array.foreach (native) @ function. .each._.foreach (c:\users\home\appdata\local.meteor\packages\meteor-tool\1.4.0-1\mt-os.windows.x86_32\dev_bundle\lib\node_modules\underscore\underscore.js:79:11) @ c:\tools\packaging\tropohouse.js:519:11 @ c:\tools\utils\buildmessage.js:359:18 @ [object object].withvalue (c:\tools\utils\fiber-helpe

linux - Find common files between two folders -

given 2 root folders , b, how can find duplicate text files between subfolders of , of b ? in other words, considering intersection of files , b. i dont want find duplicate files within a, or within b, files, in , in b. edit by duplicate mean files same content as indicated in comments section, generate single md5 checksum each file, once - duplicated checksums. something this: find dira -name \*.txt -exec md5sum {} + > /tmp/a find dirb -name \*.txt -exec md5sum {} + > /tmp/b now find checksums occur in both files. so, along these lines: awk 'fnr==nr{md5[$1];next}$1 in md5' /tmp/[ab] or maybe this: awk 'fnr==nr{s=$1;md5[s];$1="";name[s]=$0;next}$1 in md5{s=$1;$1="";print name[s] " : " $0}' /tmp/[ab]

github - merge from another repo git -

i cloned project git , did changes , want import changes done on original repo , keep changes in same time ! added new remote : git add remote original_repo git fetch original_repo git checkout -b branch_for_merge original_repo/master the problem when : git status i can't find changed files , gives me : nothing commit, working directory clean what should find changes , resolve conflicts , merge branch ? git checkout -b branch_for_merge original_repo/master this makes branch_for_merge point same commit original_repo/master , makes no sense @ all. what want (assuming did work on local master branch): git checkout master # sure git pull original_repo master this fetch changes original_repo (no-op since did yourself) , git merge original_repo/master you. benefit on git fetch ; git merge original/repo_master more helpfull commit message (which can edit of course).

nlp - How to find the semantic similarity between 2 sentences? -

please tell me methods find semantic similarity between sentences. for example: sen1 :- ram killed ravan sen2 :- sam killed ravan what similarity between both sentences? methods find semantic similarity of sentences: check vector representation models - form word doc matrix , find cosine similarity between each dimensions. check lsa (latent semantic analysis) https://en.wikipedia.org/wiki/latent_semantic_analysis this method helps give semantic similarity between words vehicle , car. but, bag of words model(bow).

css - jquery horizontal slider white space issue -

Image
i working on project in horizontal slider need show multiple products blocks. since there not fix number of products have given width of div 1360% problem facing here if products less white spaces showing in div obvious of 1360% div size. if keep width of div auto design structure messes. how can avoid white space? live site link - http://foxboxretail.in/ css .common-blocks { width: 100%; width: 1366%; overflow: hidden; height: auto; transition: 0.5s; margin-left: 0px; } in above css if keep width auto & max-width:1360% content gets overlap jquery <script> var registerevents = function () { $(".next").off("click").on("click", function (event) { if ($(this).hasclass('disable')) return; $(this).addclass('disable'); window.settimeout(function () { $(event.target).removeclass('disable');

php - Required only, if other field has special value? -

is possible this. using yii 1.1 public function rules() { return array( array('user_firstname, user_lastname, user_username, user_password,user_mobile,user_email', 'required','on'=>'createuser'), if ($this->user_role > 2 ) { array('user_special_permission, 'required'), } array('user_email, user_username, user_password', 'length', 'max'=>255), array('user_active, user_deleted', 'length', 'max'=>1), // following rule used search(). // @todo please remove attributes should not searched. array('user_id, user_firstname, user_lastname, user_mobile, user_email, user_username, user_password, user_last_login, user_num_logins, user_num_failed_logins, user_active, user_deleted', 

How to convert certain categorical values from a DataFrame to numerical(int) in python? -

i have dataframe multiple columns , categorical data in want assign numerical (int) value in order proceed data clean-up need do. e.g. want cells in column oldvalue & newvalue containing "1st call" have value of 2, "2nd call" have value of 3, , on... i post screenshot of dataframe understand mean. i new programming languages hence if please put practical example answer of huge help. you may use replace , passing dictinary maps each category on numerical value , add new column dataframe: df['oldvalueint'] = df['oldvalue'].replace( {'1st call attempted': 2, '2nd call attempted': 3}) example: df = pd.dataframe([['a','x'],['b','x'],['a','y']], columns=['ab','xy']) df['abint'] = df['ab'].replace('a': 1, 'b': 2) print df which yields ab xy abint 0 x 1 1 b x 2 2 y 1 or if want replace

javascript - Removing elements of array causes multiple re-renders -

i have mobx observable array, , want remove multiple elements lodash's remove . causes re-render every element in array. const array = observable([1,2,3,4,5,1]); const app = observer(() => { console.log('rendering...'); return ( <div> { array.map(e => <div> {e} </div>)} </div> ); }); reactdom.render( <app />, document.getelementbyid('app') ); if try remove every occurrence of 1 , rendering... logged once every element: _.remove(array, num => num === 1); > "rendering..." > "rendering..." > "rendering..." > "rendering..." > "rendering..." > "rendering..." how can make re-renders once? the api mobx looks vanilla javascript, every alteration of observable array causes synchronous update of observers. mitigate this, wrap alteration in transaction : transaction(() => _.remove(array, num => num === 1));

merge - Tell git to always ignore some file/folders when merging -

suppose project has following folders: core src and have branches: master , testbranch src in master , src in testbranch contains different content. i want tell git not merge src folder when merging master , testbranch . in other words, want merge core folder between branches. also, want git track src folder individual branches usual files. is there possible solutions? as per experience it's not possible using single repository. can use git sub-module main branch. src folder git submodule. , project folder main repository contain core src folder git submodule. ( or vice-versa )

shell - Perl code to connect to sybase DB throwing an Informational error -

i have perl code connect sybase db. when code run, code connects sybase. after successful connection, fires default sql query..."select @@ version" check version of db not valid in sybase , throws error. wanted stop query being fired no error received. i not perl developer! sub main::open_netcool { use vars qw($user $password $os); $os = (defined $os ) ? $os : $main::env{dsquery}; dbi->connect("dbi:sybase:server=$os", $user, $password, {raiseerror=>1, taint=>1, autocommit=>1} );

bluetooth lowenergy - Using Android Beacon Library to transmit as iBeacon -

i trying transmit ibeacon using android beacon library not sure if code right. use app nrf master control panel verify if transmitting ibeacon doesn't seem that. below code beacon beacon = new beacon.builder() .setid1("6fb0e0e9-2ae6-49d3-bba3-3cb7698c77e2") .setid2(integer.tostring(minor1)) .setid3(integer.tostring(minor2)) .setmanufacturer(0x0000) .settxpower(-59) .setdatafields(arrays.aslist(new long[] {0l})) .build(); beaconparser beaconparser = new beaconparser() .setbeaconlayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24"); beacontransmitter beacontransmitter = new beacontransmitter(getapplicationcontext(), beaconparser); beacontransmitter.startadvertising(beacon); } }); thanks! the

bash - rsync symlinks to php files -

i'm trying rsync website server, while preserving symlinks. have reade documentation , should trick rsync -vra --links except 1 problem: doesn't copy symlinks not directed folder, file (.php in case, don't think important). breaks. this link works: htdocs/content/uploads -> /data/sharedstorage/uploads this link gets skipped htdocs/content/config.php -> /data/sharedstorage/config.php does know how can fix this? p.s: want keep symlinks, don't want copy files original symlink links to. it seems transfer them symlinks. feedback rsync gives doesn't recognise symlinks. because have extension. , see files ... so problem not problem after all. more "bug" within verbose function in rsync

java - How to get input stream of contents of a zip file? -

i have input stream of zip file web service response. zip file contains 1 xml file. need extract input stream of xml file input stream of zip file. please help.i have tried below code.but no success. datahandler datahandler = oddocclient.getuniquedoc(null, null); inputstream = datahandler.getinputstream(); zipinputstream zipinputstream = new zipinputstream(inputstream); zipentry zipentry=zipinputstream.getnextentry(); file tempzipfile= new file("d:\\workspace\\invoicing\\zip\\tempzip1.zip"); fileoutputstream fileoutputstream= new fileoutputstream(tempzipfile); ioutils.copy(inputstream, fileoutputstream); inputstream.close(); inputstream.close(); fileoutputstream.close(); zipfile zipfile = new zipfile(tempzipfile); inputstream=zipfile.getinputstream(zipentry); this input stream used further. with above code getting following exception. java.util.zip.zipexception: invalid end header (bad central directory offset) @ java.util.zip.zipfile.open(native

cordova - Connecting a phone app (phonegap) to a localhost file(in local machine) -

i creating phonegap mobile app(android).i have emulated app using phone.when registration on form in local machine , data submitted database.but when try same using phone nothing happens.the reason think phone can't reach loop address of machine.how can go this? registration file (html) <script type="text/javascript"> $(document).ready(function(){ $("#signup").click(function(){ var name = $("#name").val(); var email = $("#email").val(); var username=$("#username").val(); var password=$("#password").val(); // returns successful data submission message when entered information stored in database. var datastring = 'name='+ name + '&email='+ email + '&username=' + username + '&password=' + password; if(name==''|| email=='' || username=='' || password=='') { alert("