Posts

Showing posts from January, 2011

c++ - Returning iterator index on an array search -

i search specific number , have iterator track array element being tested. if number found return index of array number found. here's have far: vector<int>::iterator iterator; find(vector.begin(),vector.end(), num); if(//the number found in search) { return //where number found } i'm not quite sure how sync iterator element of array being tested. appreciate toward solving problem if possible. this should want: std::vector<int> v = {500, 600, 700}; auto = std::find(v.begin(),v.end(), 600); std::size_t pos = - v.begin(); //found(iterator) - begin(iterator) // of course first should check if (it != v.end())

java - IllegalStateException when launching application after moved between computers -

tl;dr these exact files work on 1 workstation, , not one. what (error) fatal exception: main java.lang.runtimeexception: unable start activity componentinfo{com.example.erik.recipefriend2/com.example.erik.recipefriend2.mainactivity}: java.lang.illegalstateexception: need use theme.appcompat theme (or descendant) activity. the error @ line 26, in case this: setsupportactionbar(toolbar); what have done topic states, have been moving android studio project stationary computer onto laptop. have been using git bitbucket able work on both computers. when pulled project , tried run it, got error message displayed above. when zipped project stationary computer , unpacked , launched on laptop, got same error. lastly, pasted indivudial files (class files, drawables , xml-files) newly created project, still error. i running out of ideas. have line line checked classes on stationary computer , compared them lines on

while loop, windows form exercise c# -

updated thank replies. appreciated. apologize noob status. first assignment in c#, , first c# class. without previous programming experience @ all. lot of these concepts being first introduced. have done complete first section of assignment. public partial class form1 : form { public bool oddnum(double value) { return value % 2 != 0; } public bool isprime(int n) { if (n > 1) { return enumerable.range(1, n).where(x => n % x == 0).sequenceequal(new[] { 1, n }); } return false; } public bool evennum(double value) { return value % 2 == 0; } public form1() { initializecomponent(); } private void btngo_click(object sender, eventargs e) { double start = double.parse(txtstart.text); double end = double.parse(txtend.text); double oddcount = 0; double evencount = 0; double evensum = 0; double oddsum = 0;

ios - thread1: exc_bad_instruction on swift -

i have error thread1: exc_bad_instruction. been trying hard on this. helpful personnel out there? import uikit import avfoundation class playsoundsviewcontroller: uiviewcontroller { var filepathurl: nsurl! var audioplayer: avaudioplayer? var receivedaudio:recordedaudio! override func viewdidload() { super.viewdidload() // additional setup after loading view. audioplayer = try! avaudioplayer(contentsofurl: receivedaudio.filepathurl) } override func didreceivememorywarning() { super.didreceivememorywarning() // dispose of resources can recreated. } @ibaction func playfastaudio(sender: uibutton) { audioplayer!.stop() audioplayer!.rate = 1.5 audioplayer!.currenttime = 0.0 audioplayer!.play() } @ibaction func playslowaudio(sender: uibutton) { // play audio slow audioplayer!.stop() audioplayer!.rate = 0.5 audioplayer!.currenttime = 0.0 audioplayer!.play() } @ibaction func stopbuttonsound(sender: uibutton) { audiopl

html - CSS dropdown submenu with dynamic width: how to align left? -

it's easy have li > ul submenu show css: .menu ul { padding-left: 0px; } .menu li { list-style-type: none; display: inline-block; padding-left: 0px; margin: 1px; background: #ddd; width: 100px; } .menu li ul { display: none; } .menu li:hover > ul { display: block; position: absolute; background: #000; } .menu li:hover > ul li { display: block; background: #bbb; width: auto; } in case, size of submenu automatically adjusts width of content. submenu aligns left left of parent li element is. let's want align submenu right, right should lign parent li's right side. can having fixed width of submenu, , use (assuming parent li 100px wide): #menu-left li:hover > ul { width: 150px; margin-left: -50px; } but can't use flexible width submenu's anymore. also, need know width of parent li. js fiddle explains question best: https://jsfiddle.net/ybc0uxq8/1/ anyone knows way have right side of sub ul lign right side of parent li without needing fixed

haskell - Resource for learning recursion and induction over lists and trees? -

i writing course on functional programming , 1 of modules in course covers lists, , 1 cover trees. both modules center on recursion , induction on these datatypes. seeking material covers these topics in order include part of course's bibliography. can please link resource (preferably book) can find these topics explained? may the craft of functional programming

algorithm - How to optimise a code to eliminate stopwords from a text Perl -

i have code read text file , file contain stopword list, code take great time in execution, how optimise code? #!/usr/bin/perl use strict; use warnings; print "choose name of result file\n"; $fic = <stdin>; open( fic1, ">$fic" ); @stops; @file; use file::copy; open( stopword, "c:\\ats\\stop-ats" ) or die "can't open: $!\n"; @stops = <stopword>; while (<stopword>) #read each line $_ { chomp @stops; # remove newline $_ push @stops, $_; # add line @triggers } close stopword; open( file, "c:\\ats\\ats" ) or die "cannot open file"; while (<file>) { $line = $_; #print $line; @words = split( /\s/, $line ); foreach $word (@words) { chomp($word); foreach $wor (@stops) { chomp($wor); if ( $word eq $wor ) { #print "$wor\n"; $word = ''; } }

javascript - sending JSON to google app engine datastore -

so i've been scouring interwebs , cant find works me. have simple html form need send via json app engine datastore. html form: <form method="get" name="vehicle-form" id="vehicle-form"> <input type="text" name="type" placeholder="vehicle type" requried> <input type="text" name="make" placeholder="make" requried> <input type="text" name="model" placeholder="model" requried> <input type="text" name="year" placeholder="year" requried> <button id="submit-btn">add</button> </form> javascript: edit: changed this- values going in null var formdata = {}; $("#part-form").serializearray().map(function (x) { formdata[x.name] = x.value; }); //var par = document.getelementbyid("

ios - How to show GKPath in GameplayKit -

is there trick show gkpath? for example path: class scenariopath: gkpath { //set // | | | | | | // --a--b--c--d--e--f-- // | | | | | | //6 punti con raggio quasi 600 e lato 500 va bene per scenario 2k * 3k static let lato = float(500.0) static let maxy = float(0.0) static let radius : float = 600.0 static let maxynormalize = maxy - radius static let pts = [ vector_float2(-lato,maxynormalize), vector_float2(+lato,maxynormalize), vector_float2(-2*lato,maxynormalize), vector_float2(+2*lato,maxynormalize), vector_float2(-3*lato,maxynormalize), vector_float2(+3*lato,maxynormalize)] init () { super.init(points: unsafemutablepointer(scenariopath.pts), count: scenariopath.pts.count, radius: scenariopath.radius, cyclical: true) } } i'm looking simple func show path. thanks gameplaykit not graphics framework. it's low-level toolkit can use any g

c# asp.net Why doesn't the request page see then posted values? -

this codebehind second page. namespace ns1 { public partial class second : system.web.ui.page { protected void page_load(object sender, eventargs e) { int loop1; namevaluecollection coll; coll = request.form; string[] arr1 = coll.allkeys; (loop1 = 0; loop1 < arr1.length; loop1++) { lbldebug.text = lbldebug.text + "form: " + arr1[loop1] + "<br>"; } } } } this 1st page form: <form id="form1" runat="server" method="post" action="second.aspx"> <div> type: <asp:textbox id="testtype" runat="server"></asp:textbox> data: <asp:textbox id="testdata" runat="server"></asp:textbox> <asp:button id="button1" runat="server" text="button" /> <asp:label id="l

c# - Textbox (and other controls) - "Object not set to an instance...." -

i realize common error , i've followed many fixes problem offered online have yet find solution. i developed winform app gets json external website. click button control , app goes through json serialiser method , posts results textbox , appends textarea. public void renderdata(string buttontext) { if (buttontext == "start") { equationdata deserializeddata = getdata("http://test.ethorstat.com/test.ashx"); var processed = new processequation(); int result = processed.calculate(deserializeddata); string res = deserializeddata.parm1 + " " + deserializeddata.op + " " + deserializeddata.parm2 + " = " + result; textboxresult.text = res; equation.append(" " + deserializeddata.parm1 + " " + deserializeddata.op + " " + deserializeddata.parm2 + " = " + result +

cryptography - Public key from private key in java is incorrect -

i have private key , need calculate public key in java. following answer get public key private in java came following code: string pemstring = "full private key string here"; pemstring = pemstring.replace("-----begin rsa private key-----\n", ""); pemstring = pemstring.replace("-----end rsa private key-----", ""); pemstring = pemstring.replace("\n", ""); //without exception: illegal base64 character logger.info(pemstring); byte[] decoded = base64.getdecoder().decode(pemstring); keyfactory kf = keyfactory.getinstance("rsa"); pkcs8encodedkeyspec keyspec = new pkcs8encodedkeyspec(decoded); privatekey privatekey = kf.generateprivate(keyspec); rsaprivatecrtkey privk = (rsaprivatecrtkey)privatekey; rsapublickeyspec publickeyspec = new rsapublickeyspec(privk.getmodulus(), privk.getpublicexponent()); publickey pubkey = kf.generatepublic(publickeyspec); string pubstring = base64.getencoder().encodetostring

java - How to load Changed language in android using EasySharedPreferences -

i trying load changed language using easysharedpreferences, im having problem of how load result of saved string, here code: public void shqiponclick(view v){ intent startmainactivity = new intent(this, mainactivity.class); startactivity(startmainactivity); languagetoload = "sq"; // language locale locale = new locale(languagetoload); locale.setdefault(locale); configuration config = new configuration(); config.locale = locale; getbasecontext().getresources().updateconfiguration(config, getbasecontext().getresources().getdisplaymetrics()); sharedpreferencedata.putstring("lang",languagetoload); } public void englishonclick(view v){ intent startmainactivity = new intent(this, mainactivity.class); startactivity(startmainactivity); languagetoload = "en"; // language locale locale = new locale(languagetoload); locale.setdefault(locale); configuration config = new configuration();

angular - Cannot add moment.js or ng2-bootstrap to angular2 project -

i message when gulp tslint task runs. i'm not sure how add moment.js ng2-bootstrap happy. node_modules/ng2-bootstrap/components/datepicker/date-formatter.ts(1,25): error ts2307: cannot find module 'moment'. here project on github. should work visual studio 2015 no additional configuration. i updated systemjs config specified: system.config({ packages: { app: { format: 'register', defaultextension: 'js' } }, map: { moment: '../lib/moment/min/moment.min.js' } }); system.import('app.js') .then(null, console.error.bind(console)); i added import components file. generates error. import {button_directives} 'ng2-bootstrap/ng2-bootstrap'; i'm loading module npm. "moment": "^2.11.2", i'm copying library files wwwroot within gulp file. maybe need copy on more files? don't know. i able make typescript transpiler happy adding few things.

stdmap - c++ inseting User Defined class into map -

i've been looking around quite time , think have of pieces code still won't work... i have map, map<number, entry> chainlist; and class number , entry, entry wont worry i'm pretty sure half works correct in number.h class number { public: //public functions //constructor/destructor number(int len); number(string copy); number(const unsigned char *copy, int len); number(const number& in); ~number(); ....... ....... friend void swap(number& first, number& second); bool operator<(const number& rhs) const; number& operator=(number &rhs); private: //our binary number array unsigned char *num; //hold length used, , maxsize of array int length; }; then, //in number.cpp number::~number() { delete [] num; } number::number(const number& in) { length = in.length;

c# - I want to validate a radiobutton before it changes state, but it really fires when the focus leaves the control -

Image
i have simple winform example demonstrates happens. there groupbox 2 radiobuttons. 2 buttons share validating event handler. on form button nothing. no events connected. there checkbox controls state of passing validation. checked passes , unchecked fails. when program starts , user clicks on either radiobutton validating event not fire. when click on control other current button validating event fires. nop button gives me click besides checkbox. in test checkbox represents status of passing validation. this not work because once uncheck checkbox , click radio button focus forever stuck. can't focus checkbox change state. the reason validating event called when focus leaving , not when radiobutton clicked. sees "valdating" fails , cancels event. this wrong approach. should doing test @ time of initial click? click event happens after state has changed. what event should use can test validation before changing radiobutton state? can leave button , fix i

shell - python: string as stdin to subcommand -

i have python script in need invoke shell command. shell command can accept input either file or stdin. in script, input stored in variable. proper way invoke command? if matters, shell command produces no output. i know write variable's content file , invoke command file argument seems inelegant. surely, there's better way. can tell me is? thanks. you can use subprocess module. import subprocess process = subprocess.popen(["mycommand", "with", "arguments"], stdin=subprocess.pipe) process.communicate("my text")

utf 8 - How to unmask a JavaFX PasswordField or properly mask a TextField? -

Image
in ui of mine, have passwordfield ( urm 1 @ bottom! ): i want user able check checkbox see in picture , have "secret" password characters displayed. not different option many modern password-asking ui:s floating around. however, cannot find in javafx api let me that? if worries hold true, use textfield display last key pressed half second or until next key pressed, , shall mask previous user input. produce cool animation effect 1 can see in modern ui:s. however, is there way me hold of os dependent (i think os dependent??) password echo character should use? if not possible os dependent character, i'd glad use character see on picture (javafx on windows 8 machine). utf-8 code point stranger? > however, cannot find in javafx api let me that? the passwordfield component not display masked text default. can use passwordfield textfield , toggle masked/unmasked text using these components respectively. unmasked text shown textfield , in example

Copying content without tags from an XML file in Notepad++ -

i'm not quite familiar xml files , notepad++, simple solution better, clumsy may be. i have large xml file , i'm trying copy content between tags (hope terminology right). sure i'm clear, text in screenshot below copy following text , paste elsewhere: discussion in study i have demonstrated an approach the notepad++ screenshot is there simple , quick way many lines of text @ once? any appreciated! open find , replace window pressing ctrl+h. set 'search mode' 'regular expression'. in 'find what' text box enter: (?s)<[^><]*?> , leave 'replace with' text box empty. press replace button , tags should disappear. this quick , easy fix using notepad++ may not work if there cdata tags present or comments containing < or >. you'll need xml parser more reliable transformations.

android - get location requestLocationUpdates service? -

i try make locationing service somehow cant make work. lat , lng null. i had exceptions on locmanager.requestlocationupdates(locationmanager.gps_provider, 0, 0, loclistener); if (network_enabled) { locmanager.requestlocationupdates(locationmanager.network_provider,0,0,loclistener); my code : package com.example.outmane.training; import android.app.service; import android.content.context; import android.content.intent; import android.location.location; import android.location.locationlistener; import android.location.locationmanager; import android.os.bundle; import android.os.handler; import android.os.ibinder; import android.util.log; import android.widget.toast; public class myservice extends service { private locationmanager locmanager; private locationlistener loclistener = new mylocationlistener(); static final double earth_radius = 6371.00; private boolean gps_enabled = false; private boolean network_enabled = false; private h

sql - Conversion from string "5:53:10 PM" to type 'Integer' is not valid -

i want time diff between dr(3) , dr(4) sub workinghours() cmd = new sqlcommand("select * dtrtable employeeid = '" & me.textbox3.text & "' , timeout not null", con) dr = cmd.executereader while dr.read gettimein = dr(3) gettimeout = dr(4) while gettimein < gettimeout gethours = gethours + 1 gettimein = gettimein + 1 end while gettimein = nothing gettimeout = nothing end while dr.close() me.textbox8.text = gethours gethours = nothing end sub you can use timespan class this, need strip off am/pm part. dim ts1 = timespan.parse(dr(3).tostring.replace(" am", "").replace(" pm", "")) dim ts2 = timespan.parse(dr(4).tostring.replace(" am", "").replace(" pm", "")) if ts1 > ts2 'do end if

c# - Is it necessary to have a using block if you explicitly dispose of a form? -

i've been getting win32exception infamous error: error creating window handle. until recently, realized happening on line tries call environment.exit(0) subsequently got rid of, , let form close itself. so question is, whenever know i'm not going need form anymore, call base.close() , base.dispose(true) . if that, necessary put form inside using block? it not necessary. however, using block handy , fail-safe programming construct. ie. common forget adding call dispose. when choose 'using' block never need worry disposing object. so, better practice using 'using' block disposable objects. you didn't mention placed call dispose method. should in block explained below. disposableclass disposableobj = null; try { disposableobj = new disposableclass(); .... .... } { if( disposableobj != null) { disposableobj.dispose(); } } the same above code can simplified as using(disposableclass disposableobj = new dis

silverstripe - How to create a unique name when looping through each new category? -

i need way each new category have unique name in data attribute . below how code runs , displays: e.g category one picture 1 | picture 2 | picture 3 category two picture 1 | picture 2 | picture 3 | picture 4 category three picture 1 | picture 2 what need when starts loop on each new category, every <a> in servicepagesvtsliders loop needs add 1 (or similar) data-gall="mygallery"> . way create unique group category. , when lightbox pops when link clicked cycle through particular images/iframes category instead of cycling through everything. e.g category one data-gall="mygallery"> * 3 category 1 data-gall="mygallery1"> * 4 category 2 data-gall="mygallery2"> * 2 category 3 my code: <% loop svtcategorys %> <div class="svt-service-row"> <div> <h2 class="svt-service-heading">$categoryname</h2> </div>

angularjs - How to retrieve data from json using ng-repeat -

how can use ng-repeat retrieve empname of empid :2 category :1.and how categoryname json object. here i'm pushing allitems data items array.similarly,how can data category :2 can please me out regarding issue ... myjson: $scope.items = []; $scope.allitems = [{ "categoryid": 1, "categoryname": "abc", "employee": [{ "empid": 1, "empname": "raj", "empjob": "accounts", "datalist": [{ "year": "oct-2015", "salary": "244" }, { "year": "jul-2015", "salary": "100" }, { "year": "jun-2015", "salary": "117" }] }], &qu

qt - QSystemTrayIcon DoubleClick Activation results in two Trigger events -

i'm developing application, have system tray icon. i'm trying catch qsystemtrayicon::doubleclick in system tray. reason not understand, have been unable catch. in stead, 2 qsystemtrayicon::trigger events. have tried using both qt4 ( v4.8.7 ) , qt5 ( v5.5.1 ). platform kde/plasma 5( v5.4.3 ), on debian testing. have tested on lxde available on debian testing. so question here is: bug in qt or other issue else where? /* header file */ class mytrayicon : public qsystemtrayicon { q_object public : nbtrayicon(); public slots: void handleactivation( qsystemtrayicon::activationreason reason ); private slots: void togglevisible(); void showinfo(); void quit(); q_signals: void newwindow(); }; /* cpp file */ mytrayicon::mytrayicon() : qsystemtrayicon() { seticon( qicon( ":/icons/newbreeze.png" ) ); connect( this, signal( activated( qsystemtrayicon::activationreason ) ), this, slot( han

java - Adding my items to an ArrayList -

i have created 52 cards added arraylist problem when try first item in list can outofboundserror because don't think has been added arraylist. private arraylist<card> deck; public deck() { deck = new arraylist<card>(); for(int = 1; < 14; i++) { if(i == 1){ card c = new card("ace", "hearts"); } else if(i < 11 && > 1) { card c = new card("" + i, "hearts"); } else if(i == 11) { card c = new card("jack", "hearts"); } else if(i == 11) { card c = new card("queen", "hearts"); } else if(i == 11) { card c = new card("king", "hearts"); } } for(int = 1; < 14; i++) { if(i == 1) { card c = new card("ace", "clubs"); } else if(i < 11 && >

java - How to divide large Http Response -

i have spring boot restful service api. consumers other applications. 1 of app's controller returns 1 000 000 strings on request. what best practice of splitting such responses in spring applications? update: figured out response needed developer's needs , executed once. it's better create script operation. answers. here example use multi part request in spring boot: https://murygin.wordpress.com/2014/10/13/rest-web-service-file-uploads-spring-boot/ however, prefer think problem architectural point of view.why should rest returns such huge response?and necessary returns results? there few factors might me give better answer. kind of situation when there trade off. 1)the basic question is, can't provide additional(they don't have mandatory, can optional parameters) reduce amount of returned results? 2)how frequent data change?if don't change pretty often(let's once day) can introduce sort of paging mechanism return segment of result

python - How can I plot a multi-class confusion matrix? -

Image
i trying plot confusion matrix topic classification. however, when plot it, can't see clearly. scribbled x , y axis without plotted. how can plot in better way see how documents being classified? have 22465 documents , 88 topics. here code: from pandas_confusion import confusionmatrix import matplotlib.pyplot plt model = logisticregression() model = model.fit(matrix_tmp, label_tmp) pred = model.predict(matrix_tmp_test) print(metrics.accuracy_score(label_tmp_test,pred)) print(metrics.classification_report(label_tmp_test,pred)) cm=confusionmatrix(label_tmp_test,pred) print(cm) cm.plot() plt.show() this plot receive.

C conditional operator in GCC -

from "21st century c" example 10.8 typedef struct { double width, height; } size_s; size_s width_height(char *papertype){ return !strcasecmp(papertype, "a4") ? (size_s) {.width=210, .height=297} : !strcasecmp(papertype, "letter") ? (size_s) {.width=216, .height=279} : !strcasecmp(papertype, "legal") ? (size_s) {.width=216, .height=356} : (size_s) {.width=nan, .height=nan}; } trying use style in winavr gcc (a_t_g.value.ax > xx) ? { leds |= rpr; //roll positive red leds &= ~rpa; //clear amber flag |= flagrdd; //set flag red } : (a_t_g.value.ax < -xx) ? { leds |= rnr; //roll negative red leds &= ~rna; //clear amber flag |= flagrdd; //set flag red } :{} this results in error: expected expression before '{' token . can gcc not handle or doing wrong? how

How to convert visual foxpro 6 report to word -

i have used following code show report. select mem_no,com_name,owner,owner_cate,iif(empty(photo),"c:\edrs\memphoto\void.jpg",iif(file(photo),photo,"c:\edrs\memphoto\void.jpg")) photo own1 curs own repo form c:\edrs\reports\rptsearch.frx print preview nocons here rptsearch.frx contains image. following code export data excel except image. copy "c:\documents , settings\administrator\desktop\a.xls" type xls in case of image shows path name. need know how can convert report in word can have images in word report. it looks creating simple list pictures. 1 of easiest ways use automation. ie: select mem_no,com_name,owner,owner_cate,; iif(empty(photo) or !file(photo),"c:\edrs\memphoto\void.jpg",photo) photo ; own1 ; curs crsdata ; nofilter #define wdword9tablebehavior 1 #define wdautofitwindow 2 #define wdstory 6 #define wdcollapseend 0 #define wdcellalignverticalcenter 1 #define cr chr(13) local array lacaptio

java - Does TransactionAttributeType.NOT_SUPPORTED make sense for retrieving entities? -

does having transactionattributetype.not_supported on every db lookup method makes sense? don't see point in having entity attached if it's not going execute update. @transactionattribute(transactionattributetype.not_supported) pubic list<anentity> getlistentities(){ typedquery<anentity> query = em.createnamedquery("anentity.myquery",anentity.class); return query.getresultlist(); } does still end in cache? the time seems useful use required transcation propagation when update required: @transactionattribute(transactionattributetype.required) public void editpersonname(integer id, string newname){ anentity anentity= em.find(anentity.class, id); anentity.setname(newname); } other don't see point. no, doesn't make sense use not_supported transaction propagation read-only queries, makes lot of sense use default required transaction propagation. need transaction reading data too . database uses transacti

php - How to redirect the URL/public/language to URL/public -

we using kohana 3.2 (php). our website have more language. pass url/language/public/. path must redirect url/public/. can advise us. en/public/white/css/en_style.css changed /public/white/css/en_style.css you can use following redirect in .htaccess : redirectmatch 302 ^/en/(.+)$ /$1 this redirect /en/foo/bar to /foo/bar change 302 301 (permanent redirect) when sure redirect working fine.

python - Geany custom command not working -

i have following code custom python script: #!/usr/bin/env python import sys import re sys import stdin sys.stdout.write(doc_filename) how can use custom command in geany current document name , path ? is "geanypy" needed installed run command ?

Bootstrap causing issues with my CSS -

so i've looked @ other questions on here bootstrap overriding original css files none helped fix problem. put css file last , no luck. have hamburger in top right corner , becomes black square, works when click on slide menu goes behind grid instead of in front of it. google fonts , sizing of text not working. links now. script file @ bottom of body. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css"> <link href='https://fonts.googleapis.com/css?family=cabin:400,700|arvo:400,700' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="aos-gallery.css"> https://jsfiddle.net/vrrfd1gx/4/ below in aziz's answer fix issue menu showing behind grid claimed bootstrap wasn

php - How to edit the Checkout button to Order Now -

Image
i need change text of checkout button viewed once hovered on cart if product in cart, need rename order now instead of checkout . please suggest me answer... below link image... click here view screenshot since want update checkout word order now in header cart => mini cart, following: assuming using rwd theme, navigate app/design/frontend/rwd/default/template/checkout/cart/minicart/items.phtml line no: 94 & 95 from: <a title="<?php echo $this->quoteescape($this->__('checkout')) ?>" class="button checkout-button" href="<?php echo $this->getcheckouturl() ?>"> <?php echo $this->__('checkout') ?> </a> update to: <a title="<?php echo $this->quoteescape($this->__('order now')) ?>" class="button checkout-button" href="<?php echo $this->getcheckouturl() ?>"> <?php echo $this->__('order n

grails - How to pass variable holding a value to groovy eq query? -

how can pass variable holding value instead of passing value directly groovy search criteria? for (def payee in payees) { def results = resp.cases.find("eq 'hrid','7547') // hard code values work def results = resp.cases.find("eq 'hrid',??????) // how can pass payee } i'm new this. please help. basing on examples , check it: def results = resp.cases.find { case -> case.hrid == payee }

Installing Android System-App on Emulator does not work -

i have system app capable of performing system level tasks (ex: remote reboot etc.). want try out in android-dev-studio emulator. i have googled , i've found far: build .apk adb remount adb push [myapp.apk] /system/app/ (this /system/priv-app in api level 19+) adb shell chmod 644 /system/app/[myapp.apk] adb reboot i have done of this. i've tried copying apk both folders "/system/app/" , "/system/priv-app/" folders. regardless, when reboot emulator not show , gets stuck. according question reboot not work emulators noticed correct, since copied .apk file lost upon restart. what missing here? i compiling , building sdkversion - 21. folder should copy system app to? (/system/app/ or /system/priv-app)? also if reboot not work emulators, how app installed , running? what's android version of emulator? "/system/app/" , "/system/priv-app/" directory structure have been changed since android l, should use:

jquery - ajax post request to spring controller -

Image
i trying send form data json jsp file spring controller. this, using jquery ajax post method hit controller. able touch controller , json. in both places, i.e on ajax method call , controller, using post request. still, data gets displayed on url. below files. jsp page code: $(document).ready(function(){ $("#submitbutton").click(function(){ var formdata=getformdata(); var strurl="http://localhost:8080/test_reportingui/adddb.htm"; $.post(strurl, {jsondata: json.stringify(formdata)}, function(response){ if(response.status=='ok') { alert("ok"); } else { alert('not ok'); } }, 'json'); }); }); spring controller: @requestmapping (value="adddb.htm", method=requestmethod.post) modelandview addeditcustomer() { modelandview modela

powershell remote import module error -

i have problem code invoke-command -computername $csc_server -scriptblock { import-module ("c:\build_v.6.1.0.9\tools\commoncomponents.buildcommands.dll") } error: could not load file or assembly "file: /// c: \ build v.6.1.0.9 \ tools \ commoncomponents.buildcommands.dll" or 1 of dependent components. assembly created in later version of runtime current, , can not loaded. when go server via rdp , try load module ok. how fix problem? upd > invoke-command -computername $csc_server -scriptblock {$psversiontable} name value ---- ----- serializationversion 1.1.0.1 psremotingprotocolversion 2.1 pscompatibleversions {1.0, 2.0} clrversion 2.0.50727.5420 buildversion 6.1.7601.17514 psversion 2.0 wsmanstackversion 2.0 and same via local session on remove server > $psversiontable name

c++ - OpenGL ES 2.0 shader integer operations -

i having trouble getting integer operations working in opengl es 2.0 shaders. gl_shading_language_version: opengl es glsl es 1.00 one example lines i'm having issues is: color.r = floor(f / 65536); error: error linking program: error:semantic-4 (vertex shader, line 13) operator not supported operand types to give more context what's happening, within library working way pass color float 3 integers have been bit shifted into. 3 (8-bit) int -> float pass shader | float - > r g b (using integer manipulation) works fine on normal opengl having trouble making work on raspberry pi. full vexter shader code here: attribute vec4 position; varying vec3 texcoord; uniform mat4 model; uniform mat4 view; uniform mat4 proj; vec3 unpackcolor(float f) { vec3 color; f -= 0x1000000; color.r = floor(f / 65536); color.g = floor((f - color.r * 65536) / 256.0); color.b = floor(f - color.r * 65536 - color.g * 256.0); return color / 256.0; } void mai

HTML entity in JavaScript (XML and PHP) -

newbie in troubles again))) need yr guys! i have xml file data this: <page> <content>&lt;p&gt;article content&lt;/p&gt;&#13; &#13; &lt;h1 style="font-style: italic;"&gt;header&lt;/h1&gt;&#13; &#13; &lt;p&gt;&amp;nbsp;&lt;/p&gt;&#13; &#13; &lt;p&gt;&lt;img alt="" src="/upload/images/1.jpg" style="height:51px; width:144px" /&gt;&lt;/p&gt;&#13; </content> </page> now want extract data via php & replace html jq. <?php $file = '111.xml'; $xml = simplexml_load_file($file); $str =$xml->content; $str = htmlspecialchars($str, ent_quotes); js('var conv = "'.$str.'"'); //js function puts parametr between <script... tags echo $str; ?> <script type="text/javascript"> $("#debug").html().text(conv); </script> so result nothing... if

swift - MySQL: why is 'true' saved as 0? -

i have db in mysql column of table boolean: `eligibilitydate` tinyint(1) not null data arrive ios swift app through following functions: let postparams = "action=save_report&id_fish=\(reporting.fishid)&fish_name=\(reporting.fishname)&detectedsize=\(reporting.detectedsize)&eligibilitysize=\(reporting.eligibilitysize)&eligibilitydate=\(reporting.eligibilitydate)&origin=\(reporting.origin)&production=\(reporting.production)&townreport=\(reporting.townreport)" request.httpbody = postparams.datausingencoding(nsutf8stringencoding) where guess bool variables eligibilitydate , eligibilitysize converted true/false 'true'/'false'. anyway seems 'true' value saved 0 in mysql...why? correct way? update a possible solution this: let postparams = "action=save_report&id_fish=\(reporting.fishid)&fish_name=\(reporting.fishname)&detectedsize=\(reporting.detectedsize)&eligibilitysize=\(reporting.eli

to calculate number of days between two dates in dql documentum -

i have 2 attributes, effect_date,next_effect_date. have calculate difference between these 2 dates in days. dql query? please help use query dm_document , date properties r_creation_date , r_modify_date generic object type & attributes: select datediff(day, r_creation_date, r_modify_date) dm_document r_object_id = '<set_id_here>' when specify object type name can adjust query. syntax datediff function datediff(date_part, date1, date2) result value depends on db under repository. documentation: if repository using oracle or db2, return value floating point number. if repository using db2, server assumes 365 days per year , 30.42 days per month (the mean number of days in month). these assumptions can cause return values differ expected value. illustrate, following example, asks number of days between march 1, 1996 , feb 1, 1996, returns 30.42 instead of 28: datediff(day, date('03/01/1996 0:0:0'), date('02/01/1996 0:0:0')) if r

c# - Entity framework 6 or Microsoft enterprise library for mvc project -

i'm looking better architecture project huge data (many stored procedures,views, tables). could suggest 1 better - ef6 or enterprise library interact data better performance. i know both different thing. 1 object relational mapper , other wrapper around ado.net. want know whether there performance improvement if use enterprise library access data in project or should go entity framework 6? there many stored procedures in project. thanks definitely should use entity framework 6 enterprise library little bit old. can achieve same performance pure ado.net using in cases entity framework allows create code faster (and matter).

css - Bootstrap class not applied in HTML select tag -

getting puzzled why bootstrap class text-uppercase not working select options in html, whereas apart select option classes working fine. here working demo text-uppercase : http://plnkr.co/edit/dr8jpacodgzvw8w0zx2u?p=preview <select class="form-control"> <option>one</option> <option><span class="text-uppercase">two</span></option> //class="text-uppercase" not working <option class="text-uppercase"> three</option> //same here </select> am doing wrong ? the class="text-uppercase" needs used option tag. <select class="form-control"> <option>one</option> <option class="text-uppercase"><span>two</span></option> <option class="text-uppercase"> three</option> //same here </select> you had been using class="text-uppercase" <span>

java - Move downloaded file into system root directory in Android -

i'm using roottools try , move , file that's downloading downloads folder system directory command command = new command(0, "cp -f " + environment.directory_downloads +"/old.html" + " /system/new.html"); roottools.getshell(true).add(command); but whatever reason, doesn't work . any ideas? the reason wasn't working because /system mounted read-only. had remount this mount -o remount,rw /system

javascript - Webpack - Error: Cannot define 'query' and multiple loaders in loaders list -

the error appeared after added 'react-hot' loader in array. i've followed tutorials: https://robots.thoughtbot.com/setting-up-webpack-for-react-and-hot-module-replacement however, i'm getting error: cannot define 'query' , multiple loaders in loaders list . var webpackdevserver = require("webpack-dev-server"); var webpack = require('webpack'); var path = require('path'); require("babel-polyfill"); var build_dir = path.resolve(__dirname, 'build'); var app_dir = path.resolve(__dirname, 'src'); module.exports = { entry: [ 'babel-polyfill', 'bootstrap-loader', 'webpack/hot/dev-server', app_dir + '/import.js', ], output: { path: build_dir, filename: 'bundle.js' }, module: { loaders: [{ test: /\.jsx?$/, loaders: ['react-hot', 'babel'], exclude: /node_modules/, query: { plugins: ['

Spring Integration - Scheduling Job from configuration file -

i'm using spring integration parse xml file , need create thread (and each 1 have different rate) each tag. right (with of many users here :)) i'm able split xml tag , route appropiate service-activator . this works great i'm not able redirect channel create "a thread" , execute operations. right have following configuration , in mind (that dont know if correct...) split tag -> route appropiate channel -> start thread(from tag configuration) -> execute operation this actual configuration split tag , redirect channel. router should redirect not toward channel directly, schedule them. in first instance enought redirect in pool fixed rate , later use xpath attribute , replace "fixed" rate correct value. i've tried many solutions create flow each 1 fails or not compile :( <context:component-scan base-package="it.mypkg" /> <si:channel id="rootchannel" /> <si-xml:xpath-splitter id="myspli