Posts

Showing posts from August, 2011

html - Bootstrap 3 Vertical Alignment Across Multiple Rows and Columns -

Image
i new bootstrap. started project , came across challenge regarding vertical alignment bootstrap's grid system. community of experts able shed light , assist solution. to better illustrate issue, have taken 4 screenshots (links attached @ bottom) each of lg, md, sm, , xs scenarios. hope images make sense you. the problem is, while lg scenario looks great , aligned properly, viewport changes, content of 2 columns start show misalignment. here html markup: <div class="container"> <div class="row row-centered"> <div class="col-sm-6 col-md-6 col-lg-6"> <div class="row row-centered"> <div class="hidden-xs hidden-sm hidden-md hidden-lg"></div> <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12"> <h2>header number 1</h2> </div>

android - Snackbar shown along with Toast -

i using google's design support library show snackbars. after compile apk , run on phone (nexus 5), snackbar shown along toast. running directly android studio works fine (only snackbar shown). appreciated. how can disable toast , show snackbar how can disable toast , show snackbar simply not use toast. not show itself.

python - Matplotlib Mollweide/Hammer projection: region of interest only -

Image
i wondering if there's way show region of interest plot based on mollweide/hammer projection in basemap (matplotlib). i trying set plot-bounds pacific plate, in link below. however, set_xlim , set_ylim functions not seem have effect. in advance guidance. http://geology.gsapubs.org/content/29/8/695/f1.large.jpg from documentation, both hammer , mollweide projections don't allow print out entire world maps. here's code using polyconic projection, bounded straight lines. trick here define corner longitude , latitudes on creation. from mpl_toolkits.basemap import basemap import matplotlib.pyplot plt import numpy np my_map = basemap(projection='poly', lat_0=0, lon_0=-160, resolution = 'h', area_thresh = 0.1, llcrnrlon=140, llcrnrlat=-60, urcrnrlon=-100, urcrnrlat=60) plt.figure(figsize=(16,12)) my_map.drawcoastlines() my_map.drawcountries() my_map.fillcontinents(color='coral', lake_color='aqua') my_map.drawmapb

html - PHP multiply each value in the array by an additional argument -

i trying create php function multiplies values/content of array given argument. modify function can pass additional argument function. function should multiply each value in array additional argument (call additional argument 'factor' inside function). example $a = array(2,4,10,16). when say $b = multiply($a, 5); var_dump($b); should dump b contains [10, 20, 50, 80 ] here's code far: $a = array(2, 4, 10, 16); function multiply($array, $factor){ foreach ($array $key => $value) { echo $value = $value * $factor; } } $b = multiply($a, 6); var_dump($b); any idea? thanks! your function not right, has return array , not echo values. function multiply($array, $factor) { foreach ($array $key => $value) { $array[$key]=$value*$factor; } return $array; } rest fine. fiddle you can array_map $a

c# - Pagination code issue -

i have written below lines of code acconmplishing pagination in asp.net using repeater control as <asp:linkbutton id="linkbutton1" runat="server" causesvalidation="false" onclick="pagenexte_click" data-rel="tooltip" data-original-title="previous page.">&laquo;</asp:linkbutton> <asp:repeater id="rptpager" onitemdatabound="rptpager_itemdatabound" runat="server"> <itemtemplate> <asp:linkbutton id="lnkpage" runat="server" text='<%#eval("text") %>' commandargument='<%# eval("value") %>' enabled='<%# eval("enabled") %>' onclick="page_changed"></asp:linkbutton> </itemtemplate> </asp:repeater> <asp:linkbutton id="linkbutton3" runat="server" causesvalidation="false" onclick="pagenext_click&

axapta - Dynamics AX : Restrict Security policy (xDS) -

we have defined projectmanager role. want restrict list of accessible project. idea allow access project of user's department. department information available in field of employee , in financial dimension on project. i've created xds , works fine. but project manager can work on projects other departments. want "disable" xds when user fills in timesheets. because xds restrict project list when user add line in timesheets. do have idea? first of all, can try deactivate xds operation: xdsservices xds = new xdsservices(); xds.setxdsstate(false); //do have xds.setxdsstate(true); then, regarding business case, may go command , restrict list of projects join query. or go xds myproject tempdb table containing projects worker works on. then, have no more filtering issue this. you'll have implement additioal filter/restriction on other departements projects.

dependencies - How to execute n1ql query of Couchbase in scala? -

i want execute nickel query in project , want convert task doing using view perform nickel. possible..?? if yes please provide example , executing nickel queries in scala,and have add additional dependencies in project. if yes please provide link too. any suggestions appreciated we planning/working on scala driver, right can use java sdk through scala pretty easily. recommend follow official docs, convert java examples scala: http://docs.couchbase.com/developer/java-2.1/java-intro.html you want java-client dependency first: librarydependencies := "com.couchbase.client" % "java-client" % "2.1.4" if use implict conversions, can make life little easier too: import com.couchbase.client.java.couchbasecluster import com.couchbase.client.java.query.query import scala.collection.javaconversions._ object connectandquery { def main(args: array[string]): unit = { val cluster = couchbasecluster.create() val bucket = cluster.openbuc

objective c - xcode, ios, Can't move buttons around screen -

Image
the output on console: 2015-07-02 17:31:49.105 make maths fun[15079:90b] but_1.center.x = 155.000000 but_1.center.y = 90.000000 2015-07-02 17:31:49.105 make maths fun[15079:90b] but_2.center.x = 155.000000 but_2.center.y = 140.000000 the code: but_1.center = cgpointmake(155, 90); but_2.center = cgpointmake(155, 140); screenshot: the output says @ x , y when run program had them on viewcontroller try disable use auto layout option , try again. hope helps.

mySQL query to filter a field is not like given pattern -

i have mysql query select fields table username in table doesn't start "abc\". tried create query not working. select * user username not 'abc\%' but not working. new queries , can manage write simple queries 1 not sure if following correct way. you need escape slash (\). in mysql slash (\) used escape characters in query. select * user username not 'abc\\\\%'

Plotting a piecewise symbolic expression in MATLAB using ezplot -

i have created following symbolic integral: syms x; syms t; int(1./((1-t.*x).^3),t,0,1) ans = piecewise([x = 1, inf], [not 1/x in (0, 1) , x 1, -(x/2 - 1)/(x - 1)^2]) which results in piecewise function definition. want plot integral using ezplot function, leads error: error using ezplot (line 162) piecewise([1/x in dom::interval([0], [1]), -int(1/(t*x - 1)^3, t, 0, 1)], [~1/x in dom::interval([0], [1]), -(x - 2)/(2*(x - 1)^2)]) cannot plotted in xy-plane. error in sym/ezplot (line 61) h = ezplot(fhandle(f)); how can plot piecewise symbolic integral? though not find evidence mathworks, seems ezplot not work piecewise symbolic functions (source: there few open questions on topic in matlab forum). in answer presenting work-around, works explicit, invertible functions, i.e. fail stuff x^2 + y^2 = 1 or y^2 = y^4 , , similar stuff. in special case (which assume used often), 1 can manually generate x -vector , calculate corresponding y -values u

Fopen file with dir name in Mint with C -

i using file *fp = fopen("pasta/test.txt",w); but line doesn´t create file in folder "pasta", creating file name "pasta/test.txt", can me? the answer in question here (it not duplicate) distribution using irrelevant, since posix calls. google them, know them

javascript - Is it possible to change font color based on background slider image name using jQuery? -

i trying change font color of navigation based on color of background image image slider. i'm adding class nav looking @ end of image name "dark.png" or "light.png" change font color don't know how change font color every time slider switches images. if there simpler/better solution out there please let me know. realize i'm mixing pure javascript , jquery in example if has pure jquery solution awesome. here code simplified version troubleshooting. did jsfiddle example. html: <body> <nav> <ul> <li>about</li> </ul> </nav> </body> css: body { background-repeat: no-repeat; background-size:cover; width:300px; height:300px; } .dark { color:#ffffff; } javascript: $(document).ready(function(){ //slideshow: $(function () { var slideshow = $('body'); var backgrounds =

How can i verify if the text on the button is correct in selenium using C# -

i need verify if text on button correct? how can text on button in selenium using c#. thanks hi answer using method. public static t getattributeastype<t>(this iwebelement element, string attributename) { string value = element.getattribute(attributename) ?? string.empty; return (t)typedescriptor.getconverter(typeof(t)).convertfromstring(value); }

c# - Convert Func<DerivedType, Object> to Func<BaseType, Object> -

what best way convert delegate takes first parameter of derived type 1 receives base type? mean is: func<derivedtype, object> original = ...; func<basetype, object> converted = something(original); casts, of course, not work, since these 2 different types. since want pass base type method takes derived type, need add cast. if know calls converted passing derivedtype , make straightforward wrapper, this: func<basetype,object> converted = b => original((derivedtype)b); demo.

objective c - How can I get city name without current location(lat-long) in iOS? -

i have gps class returns lat, long. , i'm trying city name or address coordinates geocoder. works well. but, possible city name or without geocoder or (lat-long)? i have completed task use api: http://ip-api.com/json this give current location ip address call json , got whatever required.

angularjs - Calculation on binding in angular -

i using ng-repeat , have array of object. so according 1 of parameter want resize image. duration contains time in milliseconds. want change in minutes , set pixel style="width:{{albumitem.duration}} try below code:- ng-style="{{setwidth(albumitem.duration)}}" controller:- $scope.setwidth=function(millis){ var minutes = math.floor(millis / 60000); return{ "width":minutes+"px" } } plunker hope :)

c# - No method 'Contains' exists on type 'System.Data.Linq.DataQuery`1[System.Object]' -

i trying build contains expression. private expression<func<t, bool>> contains<t>(string property, ienumerable<dynamic> values, t item) { parameterexpression pe = expression.parameter(item.gettype(), "c"); expression columnnameproperty = expression.property(pe, property); var somevaluecontain = expression.constant(values, values.gettype()); var convertexpression = expression.convert(columnnameproperty, typeof(guid)); expression expression = expression.call(somevaluecontain, "contains", new type[] { }, convertexpression); return expression.lambda<func<t, bool>>(expression, pe); } at run time got exception. "no method 'contains' exists on type 'system.data.linq.dataquery`1[system.object]'." the soultion cast values parameter list private expression<func<t, bool>> contains<t>(string property, ienumerable<dynamic> values, t item) { param

osx - Image Generation from TrueType font in Swift/Cocoa -

i'm trying generate nsimage ttf font using swift in cocoa (not uikit) , i'm struggling context creation @ moment. my base code came project: https://github.com/reeonce/ionicons.swift it's designed uikit, tried translating cocoa. here's original code: extension uiimage { public class func imagewithionicon(icon: ionicons, height: cgfloat, color: uicolor) -> uiimage { let font = uifont(name: "ionicons", size: height)! let iconsize = (icon.rawvalue nsstring).sizewithattributes([nsfontattributename: font]) uigraphicsbeginimagecontextwithoptions(iconsize, false, 0.0) (icon.rawvalue nsstring).drawatpoint(cgpointzero, withattributes: [nsfontattributename: font, nsforegroundcolorattributename: color]) let image = uigraphicsgetimagefromcurrentimagecontext() uigraphicsendimagecontext() return image } } and here have @ moment: extension nsimage { public class func imagewithionicon(icon:

c - Return result less than 2seconds -

i have exercise tells me calculate square root, program returns result in 6 seconds, how can return square root in less 2 seconds? this implementation 1 /* ************************************************************************** */ 2 /* */ 3 /* ::: :::::::: */ 4 /* ft_sqrt.c :+: :+: :+: */ 5 /* +:+ +:+ +:+ */ 6 /* by: wjean-ma <wjean-ma@student.42.fr> +#+ +:+ +#+ */ 7 /* +#+#+#+#+#+ +#+ */ 8 /* created: 2015/07/13 13:28:12 wjean-ma #+# #+# */ 9 /* updated: 2015/07/14 16:48:21 wjean-ma ### ########.fr */ 10 /*

aspectj - Audit trough AOP all public methods of an annotated class -

there possibility audit trough aop(using spring aop, aspectj etc.) public methods of class annotated @service or @repository or ever annotation consider class level , not @ method level? want have this: @pointcut(value = "execution(public * *(..))") public void anypublicmethod() {} @around("anypublicmethod() && @annotation(repository)") public object dologtime(proceedingjoinpoint joinpoint) throws throwable { //do } the pointcut should be execution(public * @my.package.repository *.*(..)) which implicitly same as execution(public * (@my.package.repository *).*(..)) p.s.: pointcut question targets methods annotated @repository , not want.

javascript - Element added via jquery append does not persist on screen -

i trying make to list app. append list elements task list using append() function html <!doctype html> <html> <title>todo</title> <head> <meta charset="utf-8"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> <script type="text/javascript" src="script.js"></script> <h2>to list</h2> </head> <form name = "taskform"> task: <input type = "text" name = "task" > <input type = "submit" id = "submit" value = "add"> </form> <ul class = "list"> <li class = "item"></li> </ul> </html> script $(document).ready(function(){ $('input#submit').click(function(){ var newtask = $('input[name=task]').val(); $('.list'

c++ - ConvertUTF16toUCS4 in Apache Xerces -

the source code apache xerces: convertutf16toucs4 is: conversionresult convertutf16toucs4( utf16 **sourcestart, utf16 *sourceend, ucs4 **targetstart, const ucs4 *targetend) { conversionresult result = ok; register utf16 *source = *sourcestart; register ucs4 *target = *targetstart; while (source < sourceend) { register ucs4 ch; ch = *source++; if (ch >= ksurrogatehighstart && ch <= ksurrogatehighend && source < sourceend) { register ucs4 ch2 = *source; if (ch2 >= ksurrogatelowstart && ch2 <= ksurrogatelowend) { ch = ((ch - ksurrogatehighstart) << halfshift) + (ch2 - ksurrogatelowstart) + halfbase; ++source; }; }; if (target >= targetend) { result = targetexhausted; break; }; *target++ = ch; }; *sourcestart = source; *

c# - Reading XML dynamic data in SQL Server -

i have xml column in table contains collection of data. every record may hold different collection type customers data , invoices data etc. how can read cell & convert table in order bind data grid, collection times looks that <arrayofreceipttransfer_receipt xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <receipttransfer_receipt> <receipttransfer_receipt_id>77491</receipttransfer_receipt_id> <receipttransferid>17839</receipttransferid> <receiptid>74080</receiptid> <amount>500.00</amount> </receipttransfer_receipt> </arrayofreceipttransfer_receipt> and looks like <arrayofinvoicebudgetitem xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:xsd="http://www.w3.org/2001/xmlschema"> <invoicebudgetitem> <invoiceid>21978</invoiceid> <budgetitemid>1

python - Pyinstaller: how to include file -

i'm trying make simple project python compile pyinstaller my code : # coding: utf-8 f = open("1.txt") print f.read() but it's showing me after compile error : no such file 1.txt so question how include file , image pyinstaller

xaml - the attachable property 'triggers' was not found in type 'style' wpf -

i can use <style.triggers> , got message "the attachable property 'triggers' not found in type 'style'"? need use it, change background image picture. can me? <button content ="a" name="btmeunu" width="77" horizontalalignment="left" borderbrush="{x:null}" height="75" margin="-8,-16,0,-6"> </button> //convertor public class backgroundimageconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, cultureinfo culture) { bool isclicked = (bool)value; if(isclicked) { return new imagebrush([[image1.png bitmap]]//change accordingly) } return new imagebrush([[image2.png bitmap]]//change accordingly) } public object convertback(object value, type targettype, object parameter, cultureinfo culture) { return value; } } //xaml background="{binding relativ

adobe - Configuration of plugins -

i try use following plugins in local mode: s.util.cookieread https://marketing.adobe.com/resources/help/en_us/sc/implement/util_cookieread.html s.util.cookiewrite https://marketing.adobe.com/resources/help/en_us/sc/implement/util_cookiewrite.html when type in console i.e. s.util.getqueryparam take function seems configuration in file allright. s.util.getqueryparam appmeasurement.a.util.getqueryparam(c, b, d) how ever when go add example in plugin function s.campaign = s.util.getqueryparam("cid"); when run site can't see of plugin also when use the getnewrepeat https://marketing.adobe.com/resources/help/en_us/sc/implement/getnewrepeat.html plugin shows me new visitor. is there special configuration should make in order make them work properly? // set session cookie named foo value 'bar' s.util.cookiewrite('foo','bar'); // cookie named 'foo' , return value if found, , assign prop1 s.prop1 = s.util.cookieread(&#

In GIT, obtain commits using git log with path -

i obtain last 10 commits using git log specifying path of repository. used option -path have "is outside repository" error git log --no-merges -10 -p /home/my_folder/git/repo fatal: /home/my_folder/git/repo: '/home/my_folder/git/repo' outside repository the comand running example in folder /home git assumes current working directory inside repository want operate on. when running git command outside repository directory hierarchy, can use global -c option git specify repository use: git -c /home/my_folder/git/repo log --no-merges -10 -p usually it's easier cd repository before running git commands.

python - Geopy Import Error -

i have problems in using geopy package. have installed pip , i'm using python 2.7.3. geopy correctly installed under /usr/local/lib/python2.7/dist-packages i've tried run file importing geopy.geocoders suggested geopy's documentation: from geopy.geocoders import nominatim geolocator = nominatim() but have error: traceback (most recent call last): file "geopy.py", line 1, in <module> geopy.geocoders import nominatim importerror: no module named geocoders i checked python path printing sys.path() , think correct because shows me correctly /usr/local/lib/python2.7/dist-packages/geopy and /usr/local/lib/python2.7/dist-packages/geopy-1.10.0.dist-info i've tried uninstall , reinstall geopy, using easy_install instead of pip nothing changed. any ideas? thank you. the issue module name geopy , higher on pythonpath dist-packages directory. in order fix this, rename python file. in order verify this, can run python

CodeIgniter Skeleton, submenus lost path to css and js -

i decided use codeigniter-skeleton-master (author anvoz) build web site. added new menus , sub menus on example. setup new menus haven't problem, because copy example of todo, make todo1 , works without problem. but, on added submenus entered under todo1 displayed web page cannot proper access css , js files , navbar displayed without css , js. problem caused site url() grab controller name todo1 , css , js in wrong path ! example: todo1 ->path : http://localhost/ci3a/ ->this work ok instead used css , js path added onto , have acess files todo1/aboutus ->path : http://localhost/ci3a/todo1 ->this controller name-todo1 cause wrong path , css , js files cannot used! organisation of files : application assets, contain css, images , js subfolders system in application/config/ assets.php have: $config['assets_url'] = 'assets/'; autoload.php have: $autoload['helper'] = array('url'); config.php have: $config['base_url

mysql - Inner Join with LIKE, what is wrong? -

i have 2 tables table 'prd_help_zusatz' id title art 1 text 1 material 2 text 2 material 3 text 3 farbe table 'prd_produkt' id prd_material ... 1 [1][2] 2 [2] the prd_material prd_produkt ids prd_help_zusatz in [] many materials chosen. give out possible values prd_help_zusatz materials used prd_produkt . my select-code select h.id prd_help_zusatz h, prd_produkt p h.art = 'material' , p.prdart = 'uhr' , h.id p.prd_material group h.titel_d the problem is, on prd_material values not equal. how can select this? .. h.id '['p.prd_material']' doesn't work. i suggest use query: select * prd_help_zusatz h join prd_produkt p on p.prd_material concat('%', h.id, '%') , p.prdart = 'uhr' sql fiddle demo

jquery - Semantic ui checkbox strange bahaviour -

i'm trying ti use semantic ui checkbox, behaves strange. have click somewhere out of checkbox, make it's background change color regardless of state [https://jsfiddle.net/6393n6e9/][1] it works ok on semantic ui website in same browser [http://semantic-ui.com/modules/checkbox.html#/definition][2] what missing? i have not included semantic package fiddle, on dev environment, have initialize checkbox this: // affect elements have classes ui & checkbox $('.ui.checkbox').checkbox(); or // affect 1 need, if has id specified $('#mycheckbox').checkbox(); also make sure semantic-ui files loaded, , typos (this got me last time, lol)

python - Convert numeric value in module to its variable name -

in python 2.7, what's best / easiest / "pythonic" way convert integer value name of module-scoped constant value? bonus points if there's way scope search variable names beginning magic prefix. in other words: evt_foo =0x0001 evt_bar =0x0002 evt_spam=0x0004 evt_eggs=0x0008 def getevtname( val ): """ should return 'evt_foo' when given number 0x1 """ pass i know create dictionary reverse-lookup, i'd think there's better way in python. suggestions? you can use globals() function name if global object : >>> evt_foo =0x0001 >>> evt_bar =0x0002 >>> evt_spam=0x0004 >>> evt_eggs=0x0008 >>> >>> def getevtname( val ): ... return next((i i,j in globals().iteritems() if j==val , i.startswith(something)),none) ... >>> getevtname(0x0001) 'evt_foo'

sql server - combining Geography data -

using works: declare @shape geography = 'polygon empty' set @shape.stsrid = 4326; select @shape = @shape.stunion([polygondata]) [bla].[polygon] select @shape.stastext(); on table this: create table [space].[polygon]( [id] [uniqueidentifier] not null, [polygondata] [geography] null) unfortunately, slow. not think can index wonder if there alternative approaches can used merge polygons obtain outer points of combined polygon. thanks.

symfony - FOS Rest Bundle AccessDeniedListener not called -

i've been scratching head while. looking @ symfony's exception handling , checking listeners configured. saw fos rest bundle provides accessdeniedlistener defined in services definition <service id="fos_rest.access_denied_listener" class="%fos_rest.access_denied_listener.class%"> <tag name="kernel.event_subscriber" /> <tag name="monolog.logger" channel="request" /> <argument>%fos_rest.access_denied_listener.formats%</argument> <argument>%fos_rest.access_denied_listener.unauthorized_challenge%</argument> <argument>%twig.exception_listener.controller%</argument> <argument type="service" id="logger" on-invalid="null" /> </service> however putting die() inside getsubscribedevents of has no effect i'm guessing it's being ignored reason. thought getsubscribedevents

c# - Match Specific Printer Command Pattern -

i sending commands printer of format. {aa00:00;|} {aab08:02;|} where { first character, } end character,|is last 1 character. in between these have specific commands aa00:00; , may vary. i want check these format in regex , new regex, appreciated. update i misread comment numbers , thought commas acceptable. try pattern "^{[a-z]+\\d+:\\d+;\\|}$" breakdown: ^ - beginning of line {[a-z]+ - open bracket following 1 or more capital letters \\d+ - 1 or more numbers : - colon character ; - semi-colon character \\|} - pipe character followed close bracket $ - end of line code sample: using system; using system.text.regularexpressions; public class program { public static void main() { string[] commands = { "{aa00:00;|}", "{abc0:93;||}", "{aab08:02;|}", "{123aa:aa;|}", "{aa123,123:123,123;|}" }

elasticsearch - Elastic Search Aggregation with scripting giving exception -

query failed [failed execute main query]]; nested: groovyscriptexecutionexception[arrayindexoutofboundsexception[-1]]; i using following aggs query { "aggs": { "hscodes_eval": { "terms": { "field": "fscode" }, "aggs": { "top_6_fscodes": { "terms": { "field": "fscode", "script": "doc[\"fscode\"].value[0..6]" } } } } } } i want count of documents matching first 6 characters of field fscode. getting above exception.please help. try this: { "aggs": { "hscodes_eval": { "terms": { "field": "fscode" }, "aggs": { "top_6_fscodes": { "terms": {

java - Using a modified Vigenere cipher algorithm, decryption does not result in original input -

i have made modified vigenere cipher algorithm, i'm running issues. if encrypt string , decrypt result, don't original string back. source code: public class viganereencryptionbase64 { private char[] keys = new char[19]; int sizekey = 0; int cimin = 0; final string mveas = " !\"#$%&'()=+,-./0123456789:;<=>?@abcdefghijklmnopqrstuvwxyz[\\]^_'abcdefghijklmnopqrstuvwxyz{|}~"; public viganereencryptionbase64() { string keys = "bangdollamc08itats"; this.keys = keys.tochararray(); } public string encrypt(string toencrypt) { char charstoencrypt[] = toencrypt.tochararray(); char encryptedchars[] = toencrypt.tochararray(); int = 0; while (i < encryptedchars.length) { int sube = mveas.indexof(charstoencrypt[i]) + mveas.indexof(keys[sizekey]) + cimin; sizekey++; if (sizekey == keys.length) sizekey = 0;

include maven-ant build libs in eclipse java project -

i struggling maven-ant build eclipse. i did work below steps. [gui] new java project add build.xml in project top folder run ant file , succeed! trying code, somehow auto completion not work.(guessing eclipse can not read maven-ant dependency.path ) so tried. add ~/.m2/repository in build path external class folder - not work - looks weird me include whole folder. current project, need little libraries, has whole libraries uses in other projects. add builders build.xml want eclipse java project run ant build files automatically - not work neither. how can add maven-ant libraries properly? sharing experiences , answers xd =========== information ==================== this build.xml . <?xml version="1.0" encoding="utf-8"?> <project name="hibernateex2" default="db" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> <property name="source.root" value

Android AppCompat change text color of material buttons -

i want change button's text color, can't figure out how (i want use buttons appcompat v22.2). tried android:color , android:textcolor , android:textcolorprimary , android:colorforeground , these didn't job me. can me go wrong or show working example change text color of button e.g. green? i'll happy when it'll on :-) i looked solution 4 days, please don't reply links google search. if have relevant, please link that there android:style="?android/textappearancesmall" in button definition in layout xml (activity generated loginactivity). i'm sorry (i don't know how better in english). i know it's been long time since asked question, didn't know how close questions when find solution myself then, i'm doing users here find answer expect be. the problem button's style set ?android/textappearancesmall (wrong if wanted use attribute :) ), fell default values everything. once removed android:style attribute, ok.

Possible to prevent Camel routes shutdown during spring refresh event -

i have been trying integrate spring cloud ribbon client camel routes no luck. apparently ribbon client performs application context refresh during camel context restarted. reference: https://github.com/spring-cloud/spring-cloud-netflix/issues/438#issuecomment-121282986 i'm looking way prevent camel tearing down during these refreshes, or other solution prevents such painful pause. possible? you can try configure camelcontext not shutdown eager, setting shutdowneager=false on springcamelcontext . however depends on events spring emits, can set deubg logging on org.apache.camel.spring.springcamelcontext , see events emitted. shutdown eager false not stop camel on contextclosedevent maybe need.

how can i use two associations at once in cakephp -

i'am using cakephp 2.x have 2 tables users , jobs in database, in users table save 2 types of users job candidate , company in situation found self facing 2 relations between tables : (1,n)users can add (0,1)jobs. (user role here company) many (1,n)users can apply many (1,n)jobs. ( candidate) can use belongsto , habtm(hasandbelongstomany) @ once between 2 models ? : job model class job extends appmodel{ public $belongsto=array( 'user'=> array( 'classname' => 'user', 'foreignkey' => 'user_id', 'countercache'=>true, 'fields'=>array('id','username','role'), ) ); public $hasandbelongstomany=array('user'); public $usetable = 'jobs'; user model class user extends appmodel{ public $hasandbelongstomany=array('job'); how retrieve data depending on first or second context 1- show jobs of company. 2- show users applie

java - How does gradle-eclipse plugin deal with dependsOn -

how gradle eclipse plugin figure constructs below compilejava.dependson xjc gradle-eclipse plugin doesn't special gradle constructs. you'd able open gradle tasks view , run 'xjc' or 'compilejava' task. can add 'compilejava' or other project tasks run after import in gradle import wizard , have task running every time gradle project refreshed (right-click on project -> gradle -> refresh all). whenever build project in eclipse jdt compilejava task not running if asking... you'd have start manually somehow.

Find where a program aborts (VB.net) -

i have huge vb6 legacy program converted vb.net. main forms display on screen, , print comment on last executable line before entering windows message loop. then program dies (all windows disappear) no indication of went wrong. i have been unable determine code executing when program aborts, , appreciate ideas. i running in visual studio 2008 professional (since code converted vb6), using debugger. i have added method call first line in every timer_tick handler , every form_activated handler. same call in many major functions. there breakpoint set in first line of sub call... , not hit after message loop starts. i have attempted @ windows messages, not familiar spy++ tool, , totally swamped messages. know can limit particular window, program opens many windows, , new 1 trying open causes failure. if don't other solutions, can further research using spy++, i'd other suggestions on finding location. thanks. without code, guess match describe happenin

c# - OWIN - token based authentication on classic MVC web application? -

to honest, don't seem grasp owin concept - first library can't seem understand no matter try :( now problem... i have 2 mvc apps - 1 uses webapi , 1 don't. webapi app uses token based authentication , works, right i'm trying implement authentication in second (non webapi) app , don't know how it. tried using token code webapi app, realised token generator can't called directly in mvc controller, ended like: [httppost] public actionresult login(loginmodel logindata) { string baseurl = request.url.getleftpart(uripartial.authority); string resultcontent = ""; using (var client = new httpclient()) { client.baseaddress = new uri(request.url.getleftpart(uripartial.authority)); var content = new formurlencodedcontent(new[] { new keyvaluepair<string, string>("grant_type", logindata.grant_type), new keyvaluepair<string, string>("company", logindata.compan

linux - adding an adapter sequence to the end of a fastq file -

i have large fastq file , want add sequence "ttaagg" end of each sequence in file (the 2nd line every 4th line after), while still maintaining fastq file format. example: first line start with: @hwi-d00449:41:c2h8bacxx:5:1101:1219:2053 1:n:0: gcaatatccttcaacta + fffhfhgfhaggiiiii and want print out: @hwi-d00449:41:c2h8bacxx:5:1101:1219:2053 1:n:0: gcaatatccttcaactattaagg + fffhfhgfhaggiiiii i imagine sed or awk this, haven't been able find solution allows me keep fastq format. i tried: awk 'nr%4==2 { print $0 "ttaagg"}' < file_in.fastq > fileout_fastq which added ttaagg second line , every fourth line, deleted other 3 lines. does have suggestions of command lines can use or if know of package available can this, please let me know! try gnu sed: sed '2~4s/$/ttaagg/' file

java - ThreadLocalRandom or AtomicInteger -

i have need generate non-overlapping numbers (random or incremental doesnt matter each generated number unique) in multiple threads. think have 2 choices use atomicinteger , share across threads use threadlocalrandom different start , end ranges each thread i need fast , numbers should unique across threads. 1 better? option 1 slower because atomicinteger provides thread safety through use of volatile int - meaning modifications or reads must always fetch from/write ram, slower reading/writing in processor's cache memory. option 2 might faster (depending on how time takes calculate next number in sequence vs. memory fetch), run risk (albeit small) of generating duplicate numbers randomly. might suggest third option? use thread local int or long pre-defined range. won't have worry cache coherency 1 thread have access each primitive counter store. still run risk of wrap-around, know when happens, unlike risk of running duplicates on random number sequ

swift - How to get notified when iPhone battery is at 10% -

i'm building apple watch app let see iphone battery level, code battery level: uidevice.currentdevice().batterymonitoringenabled = true batterylevel = uidevice.currentdevice().batterylevel now how can call notification when iphone battery @ 10%? thanks this objective-c translated swift: [[uidevice currentdevice] setbatterymonitoringenabled:yes]; float battery = [[uidevice currentdevice] batterylevel]; if (battery < alertlevel) { //send notification } how send uilocalnotification uilocalnotification *notification = [[uilocalnotification alloc] init]; notification.firedate = [nsdate datewithtimeintervalsincenow:0]; notification.alertbody = @"warning!"; notification.timezone = [nstimezone defaulttimezone]; notification.soundname = uilocalnotificationdefaultsoundname; notification.applicationiconbadgenumber = 0; nsdictionary *infodict = [nsdictionary dictionarywit

Hybrid openmp mpi mandelbrot code -

im facing 1 problem: ive done mpi version of mandelbrot , works perfect. have implement hybrid version using openmp. ive put openmp parallelization in loop calculations ( inside function calculomandelbrot). if delete omp instruction ( omp parallel , omp barrier) works perfect ( mpi implementation). should work cant guess lost. im having image of imageheight*imagewidth , every process mades part ( ex: if have image of 100 height, , 4 processes, every process calculates 25 rows, done in calculomandelbrot function). send message master results of calculation of part of every process. the ppm results mess. dont know why... apreciated... / // mandelbrot.c // // // mandelbrot calculation iterate equation // z = z*z + c, z , c complex numbers, z // zero, , c coordinate of point being tested. if // magnitude of z remains less 2 ever, point // c in mandelbrot set. in code write out number of iterations // before magnitude of z exceeds 2, or uchar_max, whichever // smaller.//