Posts

Showing posts from July, 2013

java - Hibernate Criteria division inside sum -

i have 3 tables: route(number, frequency ..), operator(name, ..) , route_operator(route_number, operator_name) . assume have following records in route_operator table +--------------+----------------+ | route_number | operator_name | +--------------+----------------+ | 100 | ok travel | | 111 | ok travel | | 111 | venture travel | +--------------+----------------+ and route table: +--------+-----------+ | number | frequency | +--------+-----------+ | 100 | 4 | | 111 | 4 | +--------+-----------+ now, using hibernate criteria want return sum of routes' frequency operated ok travel but, if there more operators taking route, frequency has divided number of operators take route. thus, returned result must 6 (4 route 100 + 4/2 route 111 because taken venture travel well). i have written raw sql this: select sum(r.frequency / (select count(*) route_operator ro2 ro2.route_number = r.number)) route r inner join...

curl - Procure particular product details through Flipkart API using PHP? -

what trying: have default products, based on title/name of product, need the similar products flipkart. what did far: have managed total list of products flipkart using curl request through api in php. unable specific product details in efficient way. note using json you can use flipkart api fetch data based on query search. flipkart api documentation .

ruby - How can I enable gzip file creation in Rails 4.2? -

as of april 14, 2015 looks .gz file compilation removed sprockets in latest version of rails. https://github.com/rails/sprockets/issues/26 i used these files on s3 server speed page loads, since compilation of gzip files have been removed per above thread there big question looming in mind. if using asset host, new solution having compiled .gz files? if serving files server relatively easy, static assets hosted elsewhere , need precompilation. anyway, has figured 1 out. temp solution if can't asset pipeline generate , upload .gz files once did manually create them using grunt-contrib-compress( https://github.com/gruntjs/grunt-contrib-compress ). know manual solutions don't scale , rather have asset pipeline take care of 1 @ deploy time. thanks help. :) as rake not override chains tasks, declare assets:precompile . following solution should work without changing deployment-scripts: #/lib/tasks/assets.rake namespace :assets # make use of rake's beh...

numpy - Slow Stochastic Implementation in Python Pandas -

i new pandas , need function calculating slow stochastic. think should possible without difficulty not familiar advanced apis in pandas. my data frame contains, 'open', 'high', 'low' , 'close' prices , indexed on dates. information should enough calculate slow stochastic. following formula calculating slow stochastic: %k = 100[(c - l14)/(h14 - l14)] c = recent closing price l14 = low of 14 previous trading sessions h14 = highest price traded during same 14-day period. %d = 3-period moving average of %k you can rolling_* family of functions. e.g., 100[(c - l14)/(h14 - l14)] can found by: import pandas pd l, h = pd.rolling_min(c, 4), pd.rolling_max(c, 4) k = 100 * (c - l) / (h - l) and rolling mean can found by: pd.rolling_mean(k, 3) moreover, if you're stuff, can check out pandas & econometrics .

C# Substring() stops string at & symbol -

c# substring() doesn't work, stops before & symbol: var name = "my_company_&_friends"; var sub = name.substring(2); // sub should string starting symbol index 2 // sub should "_company_&_friends" // "_company_" is bug ? how fix ? it expecting http://csharppad.com/gist/f38e23c03c66664698a7 what doing after causing issue.

c# - Programatically start a process independent of platform -

situation i trying run command-line tool, dism.exe, programmatically. when run manually works, when try spawn following: var systempath = environment.getfolderpath(environment.specialfolder.system); var dism = new process(); dism.startinfo.filename = path.combine(systempath, "dism.exe"); dism.startinfo.arguments = "/online /get-features /format:table"; dism.startinfo.verb = "runas"; dism.startinfo.useshellexecute = false; dism.startinfo.redirectstandardoutput = true; dism.start(); var result = dism.standardoutput.readtoend(); dism.waitforexit(); then result comes out as: error: 11 you cannot service running 64-bit operating system 32-bit version of dism. please use version of dism corresponds computer's architecture. problem i'm aware of causes this: project set compile x86 platform. (see this question example, although none of answers mention this). however, unfortunately requirement @ moment continue targeting pla...

c++ - Segmentation fault in LIS solution for Cracking the Coding interview 11.7 -

there problem in cracking coding interview -part v question 11.7 , solution trying implement here solution in java converted c++.but facing issue of segmentation fault. #include<iostream> #include<vector> #include<algorithm> using namespace std; class htwt { public: int ht; int wt; htwt(int ht,int wt):ht(ht),wt(wt){} htwt(const htwt &other) { this->ht=other.ht; this->wt=other.wt; } bool operator<(const htwt& obj) const { cout << __func__ << std::endl; return (this->ht<obj.ht && this->wt<obj.wt); } }; typedef vector<htwt> vhtwt; typedef vector<vhtwt > vvhtwt; vhtwt& getseqwithmaxlen(vhtwt& seq1,vhtwt& seq2) { cout << __func__ << std::endl; if(seq1.empty()) return seq2; if(seq2.empty()) return seq1; return (seq1.size()...

Javascript regex ending word not found -

in regex , need match ending word starts '(', ')' or ',' . regex : /[\(\),].*$/ for example, given text (aaa,bbb)ccc need obtain )ccc . still, returns entire text. what's wrong regex? you can use: '(aaa,bbb)ccc'.match(/[(),][^(),]+$/) //=> [")ccc"] [^(),]+ negation pattern matches character listed in [^(),] . problem [(),].*$ matches first ( in input , matches till end.

Highlight the difference between two strings in PHP -

what easiest way highlight difference between 2 strings in php? i'm thinking along lines of stack overflow edit history page, new text in green , removed text in red. if there pre-written functions or classes available, ideal. you can use php horde_text_diff package. suits needs, , quite customisable well. it's licensed under gpl, enjoy!

android - Actionbar menu items not visible -

i want icons on action bar, getting them in menu options... here xml <menu xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto"> <item android:id="@+id/share" android:orderincategory="100" android:title="share on whatsapp" app:showasaction="always" /> <item android:id="@+id/medication" android:title="my medications" android:icon="@drawable/medication" app:showasaction="always" /> <item android:id="@+id/coc" android:title="add circle of care" android:icon="@drawable/add_icon" app:showasaction="always" /> <item android:id="@+id/report" android:title="report" android:icon="@drawable/report...

python - Using one function as an optional argument in another function -

say i've got function (a simple function point across): def f(x): if x: return(true) return(false) now want use function optional argument in function, e.g. tried this: def g(x, f_out = f(x)): return(f_out) so if did g(1) output should true , , if did g(0) want output false , f(0) false , f_out false . when try though, f_out true regardless of x . how can make such function f called when getting value f_out ? the code i'm using principle on more complicated it's same idea; have optional argument in function1 calls different function2 parameters parameters in function1 , e.g. x in example. (sorry i'm aware that's perhaps unclear way of explaining.) you're calling function f_out in declaration. want pass function parameter, , call inside g : def g(x, f_out=f): return f_out(x)

web services - Java Webservices using jax-ws -

web.xml <?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>ws</display-name> <listener> <listener-class>org.springframework.web.context.contextloaderlistener</listener-class> </listener> <listener> <listener-class> com.sun.xml.ws.transport.http.servlet.wsservletcontextlistener </listener-class> </listener> <servlet> <servlet-name>sayhello</servlet-name> <servlet-class> com.sun.xml.ws.transport.http.servlet.wsservlet </servlet-class> <load-on-startup>1...

javascript - Salesforce docusign Iframe Error -

i getting below error message, when trying access through custom button salesforce in service cloud console , non admin. integrated docusign package. error : javascript proxies not generated controlled dsfs.envelopecontroller: may not use public remoted methods inside iframe the same code working fine docusign previous release, issue in new release. error image url : https://community.docusign.com/docusign/attachments/docusign/docusignforsalesforce/1047/1/error.png thanks in advance, thank taking time reach out regarding issue. the current version of docusign salesforce (6.0) not support salesforce console view. our engineers aware of issue , actively working on solution

c# - Use converter without path -

how can use converter without binding path? i've got radio buttons , have converter passed string , returns whether or not checkbox checked: <radiobutton ischecked="{binding converter={staticresource languagetoboolconverter}, converterparameter='de_de'}" command="{binding changelanguagecommand, elementname=langselector}" commandparameter="de-de"> however, error message two-way binding requires path or xpath. in such case need specify path current datacontext ischecked="{binding path=., converter={staticresource languagetoboolconverter}, ..." from msdn : optionally, period (.) path can used bind current source. example, text="{binding}" equivalent text="{binding path=.}".

github - separate git pull requests with different branches | How to git push a branch -

i forked , cloned repo local machine: /sample_app i want submit 3 different pull requests original repo. far can tell way create seperate pull requests separate branches? confused sequence of commands here. i ran: git checkout -b firstbranch made changes... made changes.. git add . git commit -m "finished first feature" however when run: git push i get: everything up-to-date despite fact made bunch of changes on new branch(i can verify on new branch). am supposed run other git push ? on forked repo still see 1 master branch , no other branches. after push gather need click on pull request button , select branch submit through pull request correct? then can go command line , do: git checkout master git checkout -b secondbranch ##to create second branch second feature and repeat process, etc am getting right? how push branch can create branch specific pull request. not merging main branch. your process right. need do: git push ...

javascript - Error while using node passport authentication -

i using passport authentication in application. when try initialize passport getting error. using express building application. have corr here app.js file app.js /** * module dependencies. */ var express = require('express') , routes = require('./routes') , user = require('./routes/user') , http = require('http') , path = require('path'); var login = require('./routes/login'); var bodyparser = require('body-parser'); var app = express(); var db = require('./db.js'); var urlencodedparser = bodyparser.urlencoded({ extended: false }); var fetch = require('./routes/collect'); var passport = require('passport'); // environments app.set('port', process.env.port || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'jade'); app.use(express.favicon()); app.use(express.logger('dev')); app.use(passport.initialize()); app.use(passp...

c# - SET NO Count ON in SQl Server Causes an issue with ExecuteNonQuery -

according of sql texts have seen set nocount on add's db performance , dba's don't see off. however in asp.net i'm dealing , causes calling stored procedures using executenonquery result in -1. is known issue , if workaround? so question how have set nocount on , executenonquery return number of rows affected. this question ' executenonquery ' only. know can use executescalar , @@rowcount what else did expect? explicitely tell database not count rows , asking why counted rows not returned? the database not deliver number of rows affected, because turned off . that's neither issue nor bug, that's whole point of did.

Android OutOfMemory when GC reports free memory? -

so i'm looking through log of oom failure see following: 05-15 14:18:15.801: d/dalvikvm(5425): gc_before_oom freed 12k, 63% free 18896k/49863k, paused 43ms, total 44ms 05-15 14:18:15.801: e/dalvikvm-heap(5425): out of memory on 25694224-byte allocation. 05-15 14:18:15.801: i/dalvikvm(5425): "asynctask #4" prio=5 tid=35 runnable 05-15 14:18:15.801: i/dalvikvm(5425): | group="main" scount=0 dscount=0 obj=0x41f117e8 self=0x5db0f2c0 05-15 14:18:15.801: i/dalvikvm(5425): | systid=5539 nice=10 sched=0/0 cgrp=apps/bg_non_interactive handle=1544307456 05-15 14:18:15.801: i/dalvikvm(5425): | schedstat=( 0 0 0 ) utm=19 stm=2 core=0 05-15 14:18:15.801: i/dalvikvm(5425): @ android.graphics.bitmapfactory.nativedecodebytearray(native method) 05-15 14:18:15.801: i/dalvikvm(5425): @ android.graphics.bitmapfactory.decodebytearray(bitmapfactory.java:520) this looks weird me. why there oom on ~25mb allocation when have ~30mb available? edit the code goes thro...

java - Why System class declared as final and with private constructor? -

this question has answer here: java — private constructor vs final , more 3 answers as per understanding final class a final class class can't extended. a class single no argument private constructor a class private constructors cannot instantiated except form inside same class. make useless extend class. not mean cannot sub classed @ all, among inner classes can extend , call private constructor. so understanding is, if create class single no argument private constructor, no meaning declare class final . why system class in java, declared final class although has single no argument private constructor? i heard making class final has performance gain . correct , reason declare system class final? please clarify me why java implemented system class this. sometimes, need "utility" classes, contain static utility methods. class...

jquery - In menu, 3rd level dropdown comes down to the 2nd level menu bug -

Image
as in opencart 3rd level mobile can't accessible did changes , coding header.tpl every thing goes fine except 3rd level menu in desktop version, when hover top menu 3rd level comes down 2nd level men first time works usual every time refresh same bug occurs here screenshot , link when mouseover first time on components menu when mouseover on monitor once have mouseout monitor menu , again mouseover on components shows fine the bug comes first time load or refreshing of page for more view see link http://itracktraining.com/testoc/oc/upload/ new things have added in website these 3 codes http://itracktraining.com/testoc/oc/upload/catalog/view/theme/default/stylesheet/jquery.smartmenus.bootstrap.css http://itracktraining.com/testoc/oc/upload/catalog/view/javascript/jquery.smartmenus.js http://itracktraining.com/testoc/oc/upload/catalog/view/javascript/jquery.smartmenus.bootstrap.js make following changes: css: .dropdown-menu { top: 0; le...

android - conflicting appcompat-v7 with other dependencies -

i read error after adding dependencies action bar sherlock in android studio 0.5.8 didn't me. i found several android custom dialog library in github. gradle gives me theis error when include each 1 in dependencies : warning:string 'abs__activity_chooser_view_dialog_title_default' has no default translation. warning:string 'abs__share_action_provider_share_with' has no default translation. f:\work\workspace\nitask\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.3\res\values\values.xml error:attribute "titletextstyle" has been defined error:attribute "subtitletextstyle" has been defined error:attribute "divider" has been defined error:attribute "background" has been defined error:attribute "backgroundsplit" has been defined error:attribute "navigationmode" has been defined error:attribute "displayoptions" has been defined error:attribute "title" has be...

ruby on rails - NoMethodError in Student#categories -

showing /home/ns/school/app/views/student/_student_category_list.erb line #4 raised: undefined method `each' nil:nilclass <ul id="category-list"> <% @student_categories.each |c| %> <li class="list<%=cycle('odd', 'even')%>"> <div class="category-name"><%= c.name %></div> <div class="category-edit"><%= link_to "#{t('edit_text')}", :url => { :action => 'category_edit', :id => c.id } %> </div> <div class="category-delete"><%= link_to "#{t('delete_text')}", :url => { :action => 'category_delete', :id => c.id } , :confirm =>"#{t('delete_confirm_msg')}"%> </div> </li> <% end %...

erp - Open specified report and page in Acumatica -

in acumatica there exception pxredirectrequiredexception allows redirect page in acumatica. there posibility open report , application page? you can use pxredirectwithreportexception. here code example of assetmaint: assettranrelease graph = createinstance<assettranrelease>(); assettranrelease.releasefilter filter = (assettranrelease.releasefilter) graph.filter.cache.createcopy(graph.filter.current); filter.origin = faregister.origin.disposal; graph.filter.update(filter); graph.selecttimestamp(); int = 0; dictionary<string, string> parameters = new dictionary<string, string>(); foreach (faregister register in created) { register.selected = true; graph.fadocumentlist.update(register); graph.fadocumentlist.cache.setstatus(register, pxentrystatus.updated); graph.fadocumentlist.cache.isdirty = false; param...

Unable initialize the Matlab dll in c++ -

i'm using windows 7 x64 matlab r2012b x32 , vs2010. i want call matlab function named add in c++. convert add.m dll using mcc command, , add project. have got error after tried initialize dll. int _tmain(int argc, _tchar* argv[]) { if(!addinitialize()) cout<<"addinitialize fail!!!"<<endl; return 0; } the output info: first-chance exception @ 0x74c6c42d in matlabtest.exe: microsoft c++ exception: mathworks::mcli18nutil::deployedexception @ memory location 0x0029eff0.. thread 'win32 thread' (0xc04) has exited code 0 (0x0). program '[1100] matlabtest.exe: native' has exited code 0 (0x0). because ran mcc command -c option, need add add.ctf file path dll stored before initializing dll. i can run mcc command again without -c option generate new dll. , use new dll instead of old 1 solve problem.

python - Select random row based on intervals -

is there function in python pandas randomly selects row based on values column in dataframe (function perform roulette wheel selection )? i.e. id value 1 1 2 2 3 3 then chance 1/(1+2+3) row 1 selected, chance 2/6 row 2 , 3/6 row 3. i know easy write own function random number between 0 , sum(value) , loop , select row wondering if there pre-defined function. select index like: i = choice(range(len(df)), df.value) where choice whatever want here . then use iloc .

symfony - Twig and atomic pattern — Clean twig rendering -

i'm trying follow atomic design pattern twig. when rendering simple atom, need like: {% include '@mybundle/resources/views/atoms/button/button.html.twig' { href: '/section1', text: 'example text' } %} this approach starts getting messy when atom or component has more variables, or directory structure bit more complex. i'd awesome able like: {% button('/section1','example text') %} i know can achieved twig function, i'm worried pattern can tricky larger code base. any experience around this? cheers! you can use macro structure. read documentation: http://twig.sensiolabs.org/doc/tags/macro.html {% macro button(href, text) %} {% here can place template %} {% endmacro %} then need import twig file macro once. after can use construction {% button('/section1','example text') %} .

sequencefile - How to create hadoop sequence file in local file system without hadoop installation? -

is possible create hadoop sequence file java without installing hadoop? need standalone java program create sequence file locally. java program run in env not have hadoop install. you need libraries not installation. use sequencefile.writer sample code : import java.io.ioexception; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; import org.apache.hadoop.io.nullwritable; import org.apache.hadoop.io.sequencefile; import org.apache.hadoop.io.text; public class sequencefilecreator { public static void main(string[] args) throws ioexception { // todo auto-generated method stub configuration config = new configuration(); filesystem fs = filesystem.get(config); sequencefile.writer writer = new sequencefile.writer(fs, config, new path("localpath"), nullwritable.class, text.class); writer.append(nullwritable.get(), new text("")); ...

c - GCC installed on ubuntu 14.04, but no toolchain visible on eclipse? -

Image
so itÅ› first time using eclipse in ubuntu , seem have problems setting gcc toolchain. expect toolchains work standard helloworld example, don't (after building project of course). i following error: when adding new project, have choice between these toolchains: when unmarking ¨show project types , toolchains if...¨ , gcc toolchain in list, doesn´t seem right (and not working).

python - Numpy vectorize and atomic vectors -

i implement function works numpy.sum function on arrays on expects, e.g. np.sum([2,3],1) = [3,4] , np.sum([1,2],[3,4]) = [4,6]. yet trivial test implementation behaves somehow awkward: import numpy np def triv(a, b): return a, b triv_vec = np.vectorize(fun, otypes = [np.int]) triv_vec([1,2],[3,4]) with result: array([0, 0]) rather desired result: array([[1,3], [2,4]]) any ideas, going on here? thx you need otypes=[np.int,np.int] : triv_vec = np.vectorize(triv, otypes=[np.int,np.int]) print triv_vec([1,2],[3,4]) (array([1, 2]), array([3, 4])) otypes : str or list of dtypes, optional the output data type. must specified either string of typecode characters or list of data type specifiers. there should 1 data type specifier each output.

ios - What causes grey, blurry area when pushing and popping UIViewController -

Image
this grey , blurry area show when pushing or popping view controller. causes , how fix it? try this. -(void)viewwilldisappear:(bool)animated{ [super viewwilldisappear:animated]; [self.view setalpha:0]; } do not forget re set alpha when come back. - (void) viewwillappear:(bool)animated{ [super viewwillappear:animated]; [self.view setalpha:1]; }

java - Fragment Webpage is not currently in the FragmentManager -

i have application contains viewpager loads 3 webpages local html file, works fine when try start intent in different activity crashes following message: 05-15 11:33:12.533 7702-7702/com.example.android.horizontalpaging e/fragmentmanager﹕ fragment webpage{22947acd} not in fragmentmanager 05-15 11:33:12.533 7702-7702/com.example.android.horizontalpaging e/fragmentmanager﹕ activity state: 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanager﹕ active fragments in 3e30ef82: 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanager﹕ #0: null 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanager﹕ #1: null 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanager﹕ #2: null 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanager﹕ added fragments: 05-15 11:33:12.534 7702-7702/com.example.android.horizontalpaging d/fragmentmanag...

Difference between classes and constants in ruby w.r.t const_get? -

why const_get(class_name) return actual class, though const_get method supposed return constant of given name. ruby store classes constants, or else? no, const_get not return constant. constants not objects, cannot return them. const_get does , returns object constant points to . in other words, const_get(:foo) is more or less same foo and if object constants points happens class, then, yes, const_get return class. if object constant points happens else, const_get return else. foo = 'not class' bar = class.new const_get(:foo) # => 'not class' const_get(:bar) # => bar

Linux command to find all the files with same name but different extension in a directory? -

i working on project need deal lots of files same name different extensions. please suggest command/solution file name. thanks in advance your helper here find command find /<directory_name> -name <file_name.\*>

Error while creating maven project from eclipse -

this question has answer here: could not calculate build plan: plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or 1 of dependencies not resolved 24 answers when create new maven project eclipse, getting following error could not calculate build plan: plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.5 plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or 1 of dependencies not resolved: failed read artifact descriptor org.apache.maven.plugins:maven-resources-plugin:jar:2.5 this error see in pom.xml failure transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.5 http://repo.maven.apache.org/maven2 cached in local repository, resolution not reattempted until update interval of central has elapsed or...

linux - Copy and replace file recursively -

i try find way copy , replace files recursively. example: folder /home/test/ 1/test.jpg 1/sth_other.png 2/test.jpg 2/sth_other.jpg 3/test.jpg 4/test.jpg you can see in folder /home/test have more , more folders (1,2,3,4) file name 'test.jpg'. i have file /home/test.jpg question: how replace file 'test.jpg' in 1/2/3/4(folders) file /home/test.jpg ? with find, do: find /where -name test.jpg -type f -exec cp -i /home/test.jpg {} \;

sql server - How to insert an element into xml column not knowing if the tree will already exist? -

i have table of values in sql server 2008 wish insert value xml column within matching row of table. xml column may or may not have tags leading element want insert. i can achieve through multiple update / xml.modify statements ensure tags exist prior inserting element, seems inefficient , if wanted insert element 5 or 10 tags deep? here's created example in sql fiddle the setup have 2 tables (simplified/made here make understandable scenario) create table tablecolors (id nvarchar(100), color nvarchar(100)) create table xmltable (id nvarchar(100), xmlcol xml)` i need insert element <root><colors><color>tablecolors.color</color></colors></root> xmltable id matches , element doesn't exist. xmlcol can contain many more elements or blank. color tag 0 or many , colors tag 0 or 1. the final statement insert element in right place makes sense, won't work if parent tags don't exist. update xmltable set xmlcol.modify(...

Can there be a Regex : "First two character should not be same in a string" -

can there such regex? first 2 characters should not same in string. for engines supporting look-ahead (which case in languages), can use this: ^(.)(?!\1) it captures first character , checks next character not same character, negative look-ahead , backreference \1 . though juhana stated in comment, should consider using normal string operations check, unless regex option available.

credentials - Kendo UI with bower and TeamCity (CI) -

i've got existing project running have added kendo ui via bower. have licensed copy using professional package. our teamcity server running windows many build agents, how can pass credentials bower authenticate kendo ui repo ? i prefer not run command on each build agent machine, , don't mind if have store credentials in plain text. using .netrc file should work. make sure stored in right directory windows. should home directory of user teamcity server runs as.

hadoop - Difference between MapR-DB and Hbase -

i bit new in mapr aware hbase. going through 1 of video found mapr-db nosql db in mapr , similar hbase. in addition hbase can run on mapr. confused between mapr-db , hbase. exact difference between them ? when use mapr-db , when use hbase? basically have 1 java code bulk load in hbase on mapr , here if use same code have used apache hadoop , code work here? please me avoid confusion. they both nosql, wide column stores. hbase open source , can installed part of hadoop installation. mapr-db proprietary (not open source) nosql database mapr offers. core difference mapr detail mapr-db (along file system (they not use hdfs)) mapr-db offers significant performance , scalability on hbase (unlimited tables, columns, re-architecture name few). mapr maintains can use mapr-db or hbase interchangeably. suggest testing on both extensively before committing 1 vs other. need realize mapr-db mapr's proprietary nosql hbase equivalent , if require support mapr-db you...

php - Duplicate Data how to remove -

Image
hotels_data table hotel_rooms table mysql query $pdo = $dbo->prepare('select distinct hotels_data.*, hotel_rooms.hid, hotel_rooms.room_name, hotel_rooms.price hotels_data left outer join hotel_rooms on hotels_data.hotel_id = hotel_rooms.hid '); outputing data i loop hotel rooms $row = $pdo->fetchall(pdo::fetch_obj); foreach($row $rows){ print ' <!-- listing --> <div class="list_hotels_box"> <ul class="list_hotels_ul"> <li style="display:block;"> <img src="../img/hotel_img.png" alt="" style="width: 180px; height:180px;"/> </li> <li style="width: 100%;"> <a href="javascript:void()"><h3 ...

changing shape color programmatically in android -

this question has answer here: how change shape color dynamically? 11 answers i trying change color of shape in programmatically, not working. here shape <?xml version="1.0" encoding="utf-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="oval"> <solid android:color="#9f2200"/> <stroke android:width="2dp" android:color="#fff" /> </shape> here how using background of button <button android:id="@+id/ibtn_ea_colorpick_new" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginleft="10dp" android:layout_marginright="10dp" android:background="@drawable/round_button" /> and here how c...

rust - How to print structs and arrays? -

go seems able print structs , arrays directly. struct mystruct { a: i32, b: i32 } and let arr: [i32; 10] = [1; 10]; you want implement debug trait on struct. using #[derive(debug)] easiest solution. can print {:?} : #[derive(debug)] struct mystruct{ a: i32, b: i32 } fn main() { let x = mystruct{ a: 10, b: 20 }; println!("{:?}", x); }

php - set s3 image as a featured image in wordpress post while posting the post programatically from an external source -

Image
i pretty new wordpress. requirement need make post external source using ajax wordpress site. post data merely contain "posttitle,description,etc..." , "imageurl" pre-uploaded amazon s3. i succcessfully able post data using following reference http://codex.wordpress.org/function_reference/wp_insert_post#example but need save s3 url (external image) worpress post tables , show featured image without again uploading wordpress server. to figure out how images being saved, logged wp admin , created post featured image, searched wp tables image path , saving image relative path in 'postmeta' table below. the images stored relative reference path.then thought if forcefully insert s3 url (which absolute),wordpress might not able recoginize might searching local files.how achieve inserting s3 urls wordpress tables , make them show in posts. searched everywhere couldn't find solution particular case. appreciated. in advance. you can use ...

Xamarin Forms: How to set FontAttributes Bold for a custom font -

i have xamarin forms project use fontawesome follow link: http://forums.xamarin.com/discussion/31530/fontawesome-label-heres-how it work well. when add code: mylabel.fontattributes = fontattributes.bold; the icon becomes rectangle image "?" in it. i think it's because custom font set in normal font attribute. how can set font bold attribute in xamarin forms? ok, fontawesome not support bold type. have use normal font attribute.

facebook - Pull the likes and comments of a post using Graph API -

i need pull likes , comments of post in facebook using graph api. found out facebook not return data whole returns in pagination format. there way likes ad comments data of post @ once instead of getting in pagination format? if not there other can maximum data per page don't have loop through many pages obtain data? please suggest!

java - Trying to HTTP POST But Getting MalformedURLException: no protocol: yahoo.com -

overall i'm trying write script captures servers' response http post using java. unfortunately, i'm stuck @ encoding url portion of it. while followed several online example on encoding url, still malformedurlexception... any idea might go wrong in encoding process? the error: $ java client_post sending http post request exception in thread "main thread" java.net.malformedurlexception: no protocol: http%3a%2f%2fyahoo.com @ java.net.url.<init>(url.java:567) @ java.net.url.<init>(url.java:465) @ java.net.url.<init>(url.java:414) @ client_post.sendpost(client_post.java:30) @ client_post.main(client_post.java:23) the code: //package client_post; import java.io.bufferedreader; import java.io.dataoutputstream; import java.io.inputstreamreader; import java.net.httpurlconnection; import java.net.urlencoder; import java.net.url; import javax.net.ssl.httpsurlconnection; public class client_post { private f...

asp.net - How to popup Modal Popup extender from Image button? -

i'm working on image viewer. if user clicks image it'd displayed in modal. giving me error targetcontrolid invalid. any idea how this? code below <form id="form1" runat="server"> <asp:scriptmanager id="scriptmanager1" runat="server"> </asp:scriptmanager> <asp:imagebutton id="imgitem" runat="server" imgurl="image1.jpg" /> <asp:modalpopupextender id="modalpopupextender1" runat="server" targetcontrolid="imgitem" popupcontrolid="panel1"> </asp:modalpopupextender> <asp:panel id="panel1" style="display: none" runat="server"> <p>image displayed here</p> </asp:panel> </form> i have tested code , working fine, means showing me modal popup on image click. problem can see invalid tag in imagebutton imgurl. kindly correct imagebutton tag , retest: ...

sql server - Role assignments in SSRS -

Image
i have created ssrs report. in report viewer saw 2 security sections site settings folder settings. what difference between these two? i have give access 2 types of users somebody having permission viewing report. somebody having permissions view reports, upload report , modify datasource , parameter properties in report. what should security roles should select adding these users? first add user : goto : 1) sitesettings-->security , click newrole assignment 2)enter group or user name , select role based on requirement. please see below screenshot. then click on ok button. here can see list of roles assigned group or users. 3) click on link of home , click on link of folder settings. 4) see results following. 5)then click on new role assignment , see below screenshot. 6) in screen enter group or user name , select roles , click ok users note: 1) somebody having permission viewing report. to see reprot==>select browser ...

order by date format with union in mysql -

i have used union order by, in resultant table date format not ordering. ( select date_format(date_1, '%m/%d/%y') first_date, null second_date, col_2, col_3, col_4 table1 date_1 !='' ) union ( select null first_date , date_format(date_2, '%m/%d/%y') second_date, col_2, null col_3, col_4 table1 date_2 !='' ) order date_1 desc, date_2 desc; with above able retrieve records dates not ordered. help! excerpt mysql reference if column sorted aliased, order clause must refer alias, not column name. ( select date_format(date_1, '%m/%d/%y') first_date, null second_date, col_2, col_3, col_4 table1 date_1 !='' ) union ( select null first_date , date_format(date_2, '%m/%d/%y') second_date, ...

continuous integration - GIT VCS not updating sources after Teamcity upgrade -

i have upgraded teamcity 9 8. ever since upgrade, of git vcs not updating sources. build log show below checkout directory empty. [04:33:49]using vcs information agent file: 53c2fd4d_test.project.xml [04:33:49]clean build enabled: removing old files d:\builds\test.project [04:33:49]checkout directory: d:\builds\test.project [04:33:49]updating sources: server side checkout [04:33:49][updating sources] perform clean checkout. reason: "clean files before build" turned on [04:33:49][updating sources] transferring cached clean patch vcs root: test project [04:33:49][updating sources] repository sources transferred [04:33:49][updating sources] removing d:\builds\test.project i tried cleaning server cache @ <teamcity data directory>/system/caches didn't help. we had same problem. while refs/heads/<branchname> <hash> saw in changes tab build point commit time when upgraded 8 9. stubbornly ignoring subsequent checkins. the cause may have b...

c# - Async operations and UI update -

in wpf application made of caliburn micro , telerik controls i've different screens load data remote service show data in gridview /fills comboboxes. i'm using sync/await operators make load retrieval operations i'm has bottleneck. doing await have main ui thread wait syncronization worker thread... consider sample public class myviewmodel:screen { [omiss] public bool isbusy {get;set;} public list<foo> dropdownitems1 {get;set;} public list<foo2> dropdownitems2 {get;set;} public async void load() { isbusy =true; dropdownitems1 = await repository.loadstates(); dropdownitems2 = await repository.loadinstitutes(); isbusy = false; } } in case i've first task loaded second no parallelism...how can optimize this? isbusy property that's bound via convention busy indicator how can set ? thanks update #1: i'n real code public async task initcachedatatables() { var taskportolio = getportfolio(); ...

mfc - how to set the width and height of the dialog accurately in the mfc2010 -

i can drag dialog border, can set specific number. can drag dialog border, can set specific number. can drag dialog border, can set specific number. irrespective of ide using, can manually edit .rc file, , specify width , height dialogex resource . values device independent dlus. see dialog box measurements if don't know, are.

android - Make fragment totally inside framelayout -

Image
in app, want keep same ad banner @ bottom of screens, use 1 activity multiple fragments. in activity's layoutfile(activity_mail.xml), have framelayout container of fragments , adview @ bottom show banner ads admob. <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" tools:context=".mainactivity" tools:ignore="mergerootframe"> <framelayout android:id="@+id/container" android:layout_width="match_parent" android:layout_height="match_parent"/> <fragment android:id="@+id/adfragment" android:name="com.jiyuzhai.wangxizhishufazidian.mainactivity$adfragment" android:layout_width="...

javascript - How to share data between controller in different modules -

my code includes many modules. each includes service or controller. there main module connect others module. var app = angular.module('abc', ['ngroute','trancontroller','terminalcontroller','settingcontroller','usercontroller','devicecontroller','sidebar_service']) but how share data between controller if in different modules. help there're 2 ways share same data among different controllers of different module, rootscope , factory example $rootscope.test = "some value" rootscope easy initiate of 2 ways, recommend using factory cases. using rootscope might effect whole application, might lead global variable pollution