Posts

Showing posts from August, 2015

osx - Keyboard Shortcut to exit out of text area from within IntelliJ IDEA settings? -

Image
while within textarea within intellij modal panel, find impossible out (click ok/apply) using keyboard shortcut. intellij idea 14.1 mac os x yosemite e.g. i know isn't best answer, can hit ctrl + tab 6 times followed space .

java - Struts 1.2 : Unable to load a jsp as Action class isn't called -

i enhancing pre-existed code in struts 1.2. supposed add tab called prcm admin . have made following entries in main xml files , jsp. have action class method getviewpricemanagementadmin . when tried debug code seems control doesn't reach action class @ all. i have checked calls , looks correct. blank tab loaded in application. i have shared error on console. struts-config.xml <action path="/prcmmgmtadmin" type="mypackage.web.action.prcmadm.prcmmgmtadminaction" name="prcmmgmtform" parameter="methodname" scope="request" validate="false"> <forward name="prcmmgmtadmin" path="prcmmgmtadmin" contextrelative="true" /> </action> action-servlet.xml <bean name="/prcmmgmtadmin" class="mypackage.web.action.prcmadm.prcmmgmtadminaction"> </bean> tiles-def.xml <definition name="prcmmgmtad

How to draw 3D profiling using latitude, longitude and altitude in iOS/iPad? -

Image
i have gpx file , need show route below image i no. mkpolyline , it's super-classes use either cllocationcoordinate2d * or mkmappoint * data types, both of 2d. great question - i'd know if possible well. not sure might or achieve more attractive use of kml file.

Can't track E-Commerce shipping details using Google Analytics Measurement Protocol -

i need track e-commerce data in google analytic account using measurement protocol. in request need send following data , data need tracked in account. billing city (utmtci) billing region (utmtrg) billing country (utmtco) but when tried find parameters these using enter link description here not find matching parameter. please if 1 know whether can track these using measurement protocol. this has been discussed (but not yet answered) here - seems fields have been deprecated. i not see spelled out in documentation, field not appear in parameter reference, not in api (via query explorer) , not in ga user interface. if stuff not part of documentation it's pretty safe assume not there. you can create custom dimensions in property settings , send geo information there.

command line interface - CF CLI features that are enabled in Bluemix -

there lot of cloud foundry features provided cf cli, bluemix platform has decided disallow. cf_staging_timeout - not have effect on bluemix while uploading big war files. cf set quotas - not work on bluemix. delete organizations - bluemix documentation says has done through support tickets. is there documentation, features not work on bluemix? unfortunately not documented features of cloud foundry cli implemented in bluemix , ones not - other documented here . features, such deleting organizations, can affect multiple things such billing has done through support tickets. your best bet try whichever command need cloud foundry cli or bluemix documentation , see if accomplishes task. also - in reference brian martin's answer on post, privileges of user account affect ability of commands run. sure check have admin privileges on app/services want administrate.

How to fill a dynamic textbox with a text from another textbox using jquery? -

here code var rowcount = $('#tblapplidn tr').length; var index = rowcount + 1; $('#tblapplidn').append("<tr><td><input type='hidden' name='identitity.index' value='" + index + "' /><input type='text' name='identitity[" + index + "].typeofidentification' value=" + $('#typeofidentification').val() + "></td><td><input type='text' class='textreq' name='identitity[" + index + "].identitynumber' value=" + value + "></td><td><input type='text' class='textreq' name='identitity[" + index + "].issuedate' value=" + $('#issuedate').val() + "></td><td><input type='text' class='textreq' name='identitity[" + index + "].expirydate' value=" + $('#expirydate').val() + ">&l

ruby on rails - Invalid gemspec error in ZenTest. Invalid requirements -

after installing testing tools, keep getting invalid gemspec error anytime type command. following error: invalid gemspec in [/var/lib/gems/1.9.1/specifications/zentest-4.10.1.gemspec]: illformed requirement ["< 3.0, >= 1.8"] i have tried updating latest zentest gemfile of 4.11.0 , downgrading earlier versions no luck. have tried uninstalling them gemfiles , re-installing them using following procedure: $ gem uninstall zentest $ sudo gem update --system $ gem install zentest the warning still comes up. why ["< 3.0, >= 1.8"] illformed requirement ? when have updated latest gem files program? doing wrong? according this thread on github, suggests changing gemspec line from: ["< x.x,>= x.x"] ["< x.x",">= x.x"] i tested , has worked far. makes sense me maybe it's syntax error. again, learning , not expert nor have full grasp on terminology yet. don't take credit fix g

java - Converting String to Integer (or other primitive) after pulling HTML with JSoup -

new programming. trying convert string integer. string has been retrieved website using jsoup. haven't read has helped. the lines labeled below 2 & 3 issue. can print these lines out text, not once i've added integer.parseint(). think issue related getting rid of white space, thought code used that. assuming 's' below letter "a", output follows (clearly line 1 printing): 6,981,000  any appreciated. public class incomestatement { string grossrevenue = "total revenue"; public incomestatement(string s) { string incomestatementurl = ("http://finance.yahoo.com/q/is?s="+s+"+income+statement&annual"); string incomestatementtablename = "table.yfnc_tabledata1"; try { document doc = jsoup.connect(incomestatementurl).get(); elements table = doc.select(incomestatementtablename); elements row = table.select("tr"); elements tds = row.select("td

php - Getting tax value to calculate once state is selected -

i'm attempting add sales tax logic site , have pretty start except running couple of issues. the largest issue tax value isn't being recognized. have of other values price, shipping cost, etc in database , i'm storing values session. so, pull that. when select state, value isn't being added calculations, i'm not sure how that. i'm not sure how make equation not calculate tax price if there not any. i'm calculating tax 1 state like: $base_price += $products[$product_id]['price'] * $product['quantity']; $tax_price += $base_price * $taxvalue['']; $tax_price - $base_price; for example: base_cost = $10 tax_value = $1.065 so $10 * $1.065 -$10 = tax so if customer chooses other state other tax state subtract price cost in tax spot. i haven't included of states, need see can tax value added in once state selected. <?php $base_price = 0; foreach($_session['shopping_car

vb.net - Want to create function validating textbox with letters only -

and function validate specific format " ad12-xyx- 123-efd-20" i have created function numbers only' want similar this private sub allownumericonly(byval ctrl control) if not isnumeric(ctrl.text) , ctrl.test<> "" msgbox("please enter numbers only." , vbinformation) ctrl.text = "" ctrl.focus() end if end sub please help! here's method detect letters there far more problem that. private function isallalpha(text string) boolean return text.all(function(ch) char.isletter(ch)) end function notice have written function rather sub . original method poorly written. should doing handling validating event of control, validating control contents in event handler , setting e.cancel true if fails, in case control retain focus. validation can done in place or method takes in string , returns boolean . example: private sub textbox1_validating(sender object, e system.componentmod

javascript - include a view file that it's name is in a variable into an EJS template -

i use method include ejs file in template: <% include header %> but if header variable, errors. how can include file it's name in variable ejs template? you can't: https://github.com/tj/ejs/issues/93 the issue opened in 2013 , never resolved. however, in version 2 call include as plain function : <%- include(header) %>

mysql - Searching database using keyword that will display all subject from database that has the keyword -

i creating system tracking coming in , out documents in office. user should able view reports or record. have created simple textbox serve search tool. search process should allow user select datagridview using keyword. example: if user search record has keyword of "book" subject has word "book" in should appear. example: keyword: book displays in datagridview: book of secrets book shelf record book regardless of uppercase or lowercase. kinda google i tried creating search process shows exact word , not statement word "book" this code try connection.open() dim query string query = "select id,type_of_document,items,received_from,received_date,remarks,marginal_note,referred_to,referred_date,action_taken tracker.recordtracker items = '" & srchtbx.text & "'" command = new mysqlcommand(query, c

.net - FileNotFoundException when calling remote C# dll from C++/CLR -

my project plug in platform built in native c++. , plugin reuse current functionalities of existing c# project, built upon .net framework 4.0. use c++/clr bridge call c# codes. is, host application, built in unmanaged c++, calls managed c++ dll calls c# dll. the platform run in 1 process , plugin run in process. , way platform find plugin dll user input directory in platform's user interface, platform load plugin dlls in directory plugin process. this works when plugin folder local folder. however, when set plugin folder remote folder, , when tried instantiate c# class c++/clr class, got filenotfoundexception, detailed information "unknown url protocol". our plugin project has both c++/clr , c# codes, built different dll files. in debug mode, in visual studio modules view, turns out c++/clr dlls loaded while c# dll not loaded(both in app directory). , exception happens when tried instantiate managed class in c++/clr codes, however, unfortunately there’s no stack

excel - Use cell value as -

i'm trying use value in cell f2 maximum value of range selection within larger range of numbers. i've gotten far below, getting compile error: variable not defined. option explicit sub selectbyvalue(rng1 range, minimunvalue double, maximumvalue double) dim myrange range dim cell object 'check every cell in range matching criteria. each cell in rng1 if cell.value >= minimunvalue , cell.value <= maximumvalue if myrange nothing set myrange = range(cell.address) else set myrange = union(myrange, range(cell.address)) end if end if next 'select new range of matching criteria myrange.select end sub sub callselectbyvalue() 'call macro , pass required variables it. 'in line below, change range, minimum value, , maximum value needed call selectbyvalue(range("a2:a41"), 1, range(f2).value) end sub in line:

ruby on rails 4 - Capybara::ElementNotFound radio by id -

i understand syntax capybara choosing radio button following choose("label name") i running issue doing label has default name changed #id . here html <label for="school_application_i_20"> require i-20 form?</label> <br> <label for="school_application_i_20_true">yes</label> <input id="i-20-1" name="school_application[i_20]" type="radio" value="true" /> <label for="school_application_i_20_false">no</label> <input id="i-20-2" name="school_application[i_20]" type="radio" value="false" /> <br> when try old method of choosing element choose('school_application_i_20_true') i capybara::elementnotfound: unable find radio button "school_application_i_20_true" when change choose use element id same error id. there way select radio button id?

java - What is wrong with my GUI program -

import java.awt.graphics2d; import java.awt.rectangle; import java.awt.geom.point2d; import java.awt.geom.ellipse2d; import java.awt.geom.line2d; public class car { private int xleft; private int ytop; public car(int x, int y){ xleft =x; ytop=y; } public void draw(graphics2d g2){ rectangle body = new rectangle(xleft, ytop+10, 60, 10); ellipse2d.double fronttire= new ellipse2d.double(xleft+10, ytop+20, 10, 10); ellipse2d.double reartire= new ellipse2d.double(xleft+40,ytop+20,10,10); point2d.double r1 = new point2d.double(xleft+10,ytop+10); point2d.double r2 = new point2d.double(xleft+20,ytop); point2d.double r3 = new point2d.double(xleft+40,ytop); point2d.double r4 = new point2d.double(xleft+50,ytop+10); line2d.double frontwindshield = new line2d.double(r1,r2); line2d.double rooftop = new line2d.double(r2,r3); line2d.double rearwindshield = new line2d.double(r3,r4); g2.draw(body); g2.draw(fronttire); g2.dra

file - Can Cmd Show Your Location? -

is there command or batch file can give me current location? please provide code. as said hexafraction that's not happening without external web service , ip database, or onboard gps receiver so can try hybrid script (batch/vbscript) found on net : tracklocation.bat @echo off title battrack location, pierre joussain color 0a mode con cols=41 lines=14 set vc=%temp%\battrack\%username% if not exist "%vc%" md "%vc%" set vs=%windir%\system32 :initialization cls echo. echo initialization... echo. echo ----^> checking resources... set ipwan= unknown echo set objhttp = createobject("msxml2.xmlhttp")>"%vc%\ipwan.vbs" echo call objhttp.open("get", "http://checkip.dyndns.org", false)>>"%vc%\ipwan.vbs" echo objhttp.send()>>"%vc%\ipwan.vbs" echo strhtml = objhttp.responsetext>>"%vc%\ipwan.vbs" echo wscript.echo strhtml>>"%vc

swagger ui - best way to tell swaggerui where the host is -

when build swagger.json file not know host use. can work out when page hosts swaggerui loads (in fact might want offer user choice). hoped see options.host on config swaggerui object - dont see one. there existing way of doing cant find or have hack way through code , add capability (pointers best place welcome) two ways one modify swagger.js accepts host option. swagger-ui passes options swagger-js works. submitted pull swagger-js fix second choice swagger-ui accepts 'spec' parameter. means hosting page can load swagger.json file, json.parse , set 'host' in , pass swaggerui constructor. harder caller doesn't require code changes swagger

django - Heroku Row Count Does Not Match DB -

i have built , deployed django application on heroku , trying estimate how many users can handle before need upgrade heroku dev. have created user , deleted row count on remains same, 283 to try , see what's happening counted row manually using postgresql studio. total of 352 rows or 69 rows on heroku says have. here breakdown of rows. total 352 custom model1 9 custom model2 24 custom model3 9 email address 13 email confirmation 18 auth permission 48 auth user 13 admin log 11 content type 16 session 168 site 1 migration history 22 does know how heroku calculates row count? thanks!

php - facebook redirect url contents -

ok, new phase of project rewriting our fb app new v4 php sdk . should redirecturl like? currently, happens during login flow: 1) create facebookredirectloginhelper (derived class), use generate loginurl url app (example.com/myapp) redirecturl. 2) put nice button user click 3) on user click, fb oauth dialog comes up, user clicks ok 4) next page (which connect facebook uid account in our system) comes - not within context of facebook - basically, breaks out of iframe . i have set redirecturl url of application: https://example.com/myapplication/index looking through various comments, seems ought canvas page url app settings: https://apps.facebook.com/<my app id> but if that, goes infinite loop of putting nice button (from #2) on , on and... what should value redirecturl ? assuming creating canvas app, users not see callback url. should put url on website fits facebook canvas. e.g. http://www.example.com/facebook/yourappname/ referance

mongodb - Testing motor.MotorClient() connection -

i want know how check motor connection successful. if kill mongod process , perform a: con = motor.motorclient(host,port) i "[w 150619 00:38:38 iostream:1126] connect error on fd 11: econnrefused" makes sense since there's no server running. because isn't exception i'm not sure how check case? i thought check con.is_mongos seems it's false (also stated in documentation). how check above error scenario? generally, answer don't . don't check if connection mongodb working. might find out it's working right now, next operation might fail anyway--your sysadmin might pull cable, server crashes, whatever. since need handle errors later in application no matter, there's no point checking ahead of time whether motor has connected or not. if insist on pointless check, knowing gains nothing, do: @gen.coroutine def am_i_momentarily_connected_to_mongodb(): yield motorclient().admin.command('ismaster') if ioloop has s

javascript - How to use Google Maps API v3 ClientID in application > Webbrowser control -

need google map v3 api work in .net application purchased clientid. the application using webbrowser control load html documenttext , url 'about:blank'. problem can't put about:blank authorized urls list in google map console. can't host html needs lot of data database. must in application. can me how use google map clientid in application without url or url = localhost? there way trick web browser control use localhost url use html in code? because can add localhost white list. lot well, can use oauth 2.0 instead of public api access key; if have public api access , should use key server applications , , set accept ip setting ip 0.0.0.0/0 .

cannot rename name apps of cli in heroku -

Image
i´m trying rename apps of cli, error, no app specified. i done heroku create heroku apps:rename newname it says: run command app folder. have clone app first. go app folder , run command again. or specifiy app via --app oldname: heroku apps:rename newname --app oldname

javascript - converting routing from state provider to route provider -

i have following code on config.js works fine: function config($stateprovider, $urlrouterprovider, $oclazyloadprovider, idleprovider, keepaliveprovider, adalauthenticationserviceprovider, $httpprovider) { // configure idle settings idleprovider.idle(5); // in seconds idleprovider.timeout(120); // in seconds $urlrouterprovider.otherwise("/dashboards/dashboard_1"); $oclazyloadprovider.config({ // set true if want see , when dynamically loaded debug: true }); $stateprovider .state('dashboards', { abstract: true, url: "/dashboards", templateurl: "views/common/content.html", }) .state('dashboards.dashboard_1', { url: "/dashboard_1", templateurl: "views/dashboard_1.html", resolve: { loadplugin: function ($oclazyload) { return $oclazylo

sql server 2008 - SQL parameter in where clause that allows for all, specific, or multiple values -

in sql server 2008 need able pass in parameter allows values, specific values, or multiple values. below sql works fine when parameter "all". , works fine single value. multiple values "msg 4145, level 15, state 1, line 7 expression of non-boolean type specified in context condition expected, near ','." i've tried number of things not getting it. --works fine declare @sql varchar(8000) ,@p_code varchar(100) ,@v_code varchar(100) set @p_code = ('''all''') set @v_code = @p_code select @sql = 'select distinct code from table where '+@v_code+' in ('+'''all'''+') or code in ('+@v_code+')' execute (@sql) --returns records --works fine declare @sql varchar(8000) ,@p_code varchar(100) ,@v_code varchar(100) set @p_code = ('''abcd''') set @v_code = @p_code select @sql = 'select distinct code from table wh

c# - Not seeing service contract when I add WCF service as a service reference -

i looking @ wcf service created 1 of our team-members , trying add service reference in client code. knowledge of wcf not extremely deep after adding service reference, should able see list of functions in object browser if extend service. now,normally service contract looks following: [operationcontract] void functionname(parameter request); however, 1 looks little different , not sure if not showing in list of functions has being different looks following: [operationcontractattribute(action = "somename", replyaction = "*")] [xmlserializerformatattribute()] responsetype somename(parameternamerequest); so here goes final question: how can add service in client code , still able call functions? since not showing in "callable" function list, have change service able call it? what real use/ benefit of doing way?

mesos - Docker when deployed on marathon is failing continously -

i new these technologies , trying figure things out. so, followed basic tutorials provided mesosphere , able create cluster locally (two vms) want deploy nodejs application created docker image contains nodejs express framework , script start server. can find docker image @ docker registry pujariamol/nodejs-express , has script @ root level called runscript.sh. the json tried deploying follows: { "id": "app4", "container": { "type":"docker", "docker": { "image": "pujariamol/nodejs-express" } }, "cmd":"echo hello > /tmp/out.txt", "cpus": 0.25, "mem": 512.0, "instances": 1 } i thought pull docker container , start it. also, wanted run runscript.sh trying './runscript.sh' in cmd didn't work tried writing text in out.txt testing purpose nothing seems work. moment application deplo

c++ - type errors in Mingw-x64 -

i'm trying build project (wpilib) on windows, coming linux works fine. installed mingw, didn't seem have threading stuff i'm using, deleted , installed mingw-x64. got me further, i'm stuck here. in file included c:/program files/mingw-w64/x86_64-5.1.0-posix-seh-rt_v4-rev0/mingw64/x86_64-w64-mingw32/include/winsock2.h:55:0, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/detail/socket_types.hpp:38, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/detail/win_tss_ptr.hpp:23, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/detail/tss_ptr.hpp:25, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/detail/call_stack.hpp:20, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/impl/handler_alloc_hook.ipp:19, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/handler_alloc_hook.hpp:80, c:\users\peter\gz-ws\boost_1_56_0/boost/asio/detail/handler_alloc_helpers.hpp:21, c:

c++ - Class members of different types, one for each enum variand -

i have enum this: enum field { foo, bar, baz, // 50 more follow } i want associate data type each value (foo - uint, bar - string, etc.), , want create class field each enum value, of type associated enum. i'd want have generic getter/setter allow atomically operate on group of fields. is there way of that, in generic fashion - avoiding specialized methods each field, retaining type safety want? if so, how it? honestly, if you're going this, you're going want in 2 ways: 1) create new class. if you're sharing 50 or fields between common classes, might create common class or struct hold data. 2) use std::map<variant/enum, value> . to me, if want create flexible system @ cost of performance, instead implement key/value system using std::map/std::unordered_map . boost.variant has implementation allowing various variant types acts more advanced enum. if use key, can sure map have enumerated number of types , still remain type

string - Swift - how to convert hyphen/minus sign into + sign -

i obtaining address in string variable ios reverse geocoding below code. clgeocoder().reversegeocodelocation(imagelocation, completionhandler: {(placemarks, error) in dispatch_async(dispatch_get_main_queue(), { if (error != nil) {println("reverse geodcode fail: \(error.localizeddescription)") textfield.placeholder = "address not found." } else { if placemarks.count > 0 { var placemark:clplacemark = placemarks[0] as! clplacemark var locationaddress:nsarray = placemark.addressdictionary["formattedaddresslines"] as! nsarray var tmpaddress = locationaddress.componentsjoinedbystring("\n") textfield.text = tmpaddress string } } }) }) tmpaddress variable has address - "2362-2658 w 12th st\ncity, state 20301\ncountry name" i need

asp.net core - vNext Owin Middleware -

i have simple middleware: public class middlewareinterceptor { requestdelegate _next; public middlewareinterceptor(requestdelegate next) { _next = next; } public task invoke(httpcontext ctx) { ctx.response.writeasync("<h2>from somemiddleware</h2>"); return _next(ctx); } } and in startup.cs configure method, hook so: app.usemiddleware<middlewareinterceptor>(); the above builds , app seems run fine, breakpoint in interceptor invoke method never hits. , likewise, there never output. tried debug.writeline also. now, tried method: public class middlewareinterceptor : owinmiddleware { public middlewareinterceptor(owinmiddleware next) : base(next){} public override async task invoke(iowincontext context) { debug.writeline(context.request.uri.tostring()); await next.invoke(context); } } and in startup.cs configure method, hook so: app.use(next => new middl

hyperlink - HTML links not working -

i created first website uploading first 2 pages including first , main page , second page first page links to. before doing so, link when clicked on, takes me correctly main page second page worked. after uploading on 000webhost.com no longer worked. meaning, can view main page when click on link should take me second page, doesn't anything. here code , still included in main page link should take me second page. have feeling has protocol , have make changes not sure changes correctly make link work. used sub domain @ 000webhost.com not own. here code , on main page: <li><a href="file:///c:\users\brian\desktop\noah\noahsfirstday.html">noah's first day</a></li> the link points file on computer (note file:// prefix). best practice have links own pages in relative form. so, example, assuming uploaded files same directory, use filename itself: <li><a href="noahsfirstday.html">noah's first day</a><

in jquery can i add a readonly attribute to a input that the only property i can touch is a function? -

i have multiple inputs (unknow number) <input id="ctl00_contentplaceholder_txtsopurchasersapid" onkeydown="return scriptreadonly();" style="width: 150px" name=ctl00$contentplaceholder$txtsopurchasersapid> there not on same page of app, id's , names dynamically loaded cannot add class because there many , don't know location of inputs. my question is, can attach attribute of readonly jquery inputs thing same on each of them onkeydown="return scriptreadonly(); yes, can, using attribute equals selector : $('input[onkeydown="return scriptreadonly();"]').prop("readonly", true); live example: function scriptreadonly() { } $('input[onkeydown="return scriptreadonly();"]').prop("readonly", true); <input id="ctl00_contentplaceholder_txtsopurchasersapid" onkeydown="return scriptreadonly();" style="width: 150px" name=ctl00$conten

java - Assert Response Payload of Zip File -

in application, i'm combining many files single zip file via java.util.zip.zipoutputstream api, want know how write effective unit test of zip file. at first began "test.zip" in test/resources , compared generated expected comparing bytes, doesn't work. bytes retrieved httpservletresponse (in case of test mockhttpservletresponse ) how can test zip contains proper file signatures? i suggest compare content. after getting zip file, unpack , compare have same amount of files, have same names , files's contents same.

ios - Hiding iAd ADBannerView in Swift when ad fails to load - no delegate or delegate does not implement didFailToReceiveAdWithError -

this code using: var bannerview = adbannerview() self.candisplaybannerads = true //show ad banner if ad loads func bannerviewdidloadad(banner: adbannerview!) {bannerview.hidden = false} //hide ad banner if ad fails load func bannerviewfailstoloadad(banner: adbannerview!,didfailtoreceiveadwitherror error: nserror!) {bannerview.hidden = true println("failed receive ad")} when set iad fill rate 0% nothing printed , output console: adbannerview: unhandled error (no delegate or delegate not implement didfailtoreceiveadwitherror:): error domain=aderrordomain code=5 "the operation couldn’t completed. banner view visible not have content" userinfo=0x7fd3fd3335e0 {adinternalerrorcode=5, nslocalizedfailurereason=banner view visible not have content, adinternalerrordomain=aderrordomain} delegate methods not called when using self.candisplaybannerads = true . need create adbannerview , set delegate delegate methods called, example, bannerview.delega

javascript - Passing multiple parameters in AJAX script -

below script through trying send 2 parameters: 'badge' , 'srnum' name2.php. $('input.accept').on('click',function(){ var badge= $(this).attr('id'); var srnum = $(this).attr('name'); //alert(badge+""+srnum); $.post('name2.php',{badge:badge,srnum:srnum},function(data){ $('td#status').text(data); }); }); name2.php -: <?php $badge = $_post['badge']; $srnum = $_post['srnum'];; $connection = oci_connect("","",""); $main_query=oci_parse($connection,"update leaveinfo1 set lead='approved' badge='$badge' , srnum='$srnum'"); oci_execute($main_query); oci_close($connection); ?> now, here not able post 2 variables using ajax script name2.php. how should post 2 or more variables , receive them in corresponding name2.php script. you sending variables correctly, not accessing them

javascript - Get fileName in jquery Upload plugin for append it in html form -

i have issue jquery upload plugin, using jquery upload file plugin version: 3.1.10 http://hayageek.com , problem filename wich want copy database. i have html form little complex texts , checkboxes , etc. a part of form looks this: <form> <input type="text" name="titlu" value="marcel"> <div id="incarcareimagine">upload image</div> <button type="button" onclick="showvalues()">publish</button> </form> <script> function showvalues() { var str = $( "form" ).serialize(); $( "#results" ).html( str ); var datastring = "results="+ str; $.post('motor/parser_incarcare.php',datastring,function(theresponse){ //alert('data sended php'); //shows data php response }); } </script> <script src="js/jq

java - Javacpp: liblept.4.dylib library not loaded -

on 64 bit mac osx trying use native c++ library java project described in link: https://github.com/bytedeco/javacpp-presets/tree/master/tesseract but error when run example, library liblept.4.dylib not loaded, , have no idea do. java.lang.unsatisfiedlinkerror: no jnilept in java.library.path @ java.lang.classloader.loadlibrary(classloader.java:1865) caused by:java.lang.unsatisfiedlinkerror:/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/t/javacpp21146551279247/libjnilept.dylib: dlopen(/private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/t/javacpp21146551279247/libjnilept.dylib, 1): library not loaded: /users/saudet/projects/bytedeco/javacpp-presets/leptonica/cppbuild/macosx-x86_64/lib/liblept.4.dylib referenced from: /private/var/folders/h8/wpw5p9196v1dz0hcy_s66_5w0000gn/t/javacpp21146551279247/libjnilept.dylib update: tried install tesseract , leptonica libraries via mac ports, error has disappered new error came "java failed write core dump, problematic fra

linux - Aliased over existing command -

i trying remember how alias commands when accidentally thought idea: alias exit='e' i had overwritten exit command! while searching answer saw here: http://www.linfo.org/alias.html "unalias removes not aliases created during current session permanent aliases listed in system configuration files." don't know entails didn't want somehow lose exit command forever. i couldn't find definitively answered question, when exited out of terminal , reopened it, typed exit , worked , still working. explain did , if exiting out of terminal(by clicking x) true solution problem?

javascript - Can't get flash or error messages to display on button submit -

i have form , i'm trying submit contents of form model "leeds" display success/failure message depending on if data passes model validations. the issue i'm having when click on "send message" button, takes me root root/leeds . this form i'm using: <%= form_for @leed, {url:root_path, html: {id:"contactform", name:"sentmessage", novalidate:true}} |leed| %> <div class="row"> <div class="col-md-6"> <!-- name --> <div class="form-group"> <%= leed.text_field :name, class: "form-control", :placeholder => "your name *", :required => true, :data => {:validation_required_message => 'please enter name.' } %> <p class="help-block text-danger"></p> </div> <!-- email -->

Add datagridview cell content into textbox in other form c# -

i have 2 forms. 1 have textbox show name of chosen customer , 1 have datagridview show list of customers. when click on textbox second form open. want know possible double click on datagridview cell text of textbox change datagridview selected cell on first form? here codes. i wrote code open form2: private void textbox1_click(object sender, eventargs e) { frmcustomer customer = new frmcustomer(); customer.showdialog(); } and in form2 : private void datagridview1_celldoubleclick(object sender,datagridviewcelleventargs e) { string name = datagridview1.currentrow.cells["clmname"].value.tostring(); form1 f = new form1(); f.txtcustomer.text = name; this.close(); } there nothing in textbox when form2 closed. any help? milion you can try passing form1 parameter when creating form2. private void textbox1_click(object sender, eventargs e) { frmcustomer customer = new frmcustomer(this); // represents form1

text editor - Search the file with some content and insert the row after that and write some other thing -

i want edit file in following way my sample file: 101 273970116 2719674681506161941d094101metabank wavecrest 5220taxi charger micro deposit - cr a271967468webp2p 150616 1273970110000001 6220110000156534057672 0000000007greengrp2c386datest user s 0273970110000001 6220110000156534057672 0000000005clarkgrp2c386dctest user s 0273970110000002 82200000020002200002000000000000000000000012a271967468 273970110000001 9000001000001000000020002200002000000000000000000000012 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 999999999999999999999999999999999999999999999999999999999999999999999999999999999999999

linux - How to deploy a Docker image to make changes in the local environment? -

edit +2=just fyi, root user means not have type out superuser (sudo) every time authorized cmd. alright after 24 hours of researching docker little upset if got facts straight. as quick recap, docker serves way write code or configuration file changes specific web service, run environment, virtual machines, cozy confines of linux terminal/text file. beyond doubt amazing feature: have code or builds made on 1 computer work on unlimited number of other machines breakthrough. while annoyed terminology wrong respect whats containers , images (images save points of layers of code made dockers servers or can created containers require base image go off of. dockerfiles serve way automate build process of making images running desired layers , roll them 1 image can accessed easily.). see catch docker "sure can deployed on variety of different operating systems , use respective commands". commands not come pass on local environment though. while running tests on dockerbuild

non trivial android fragments backstack -

i'm trying implement following fragment design: fragment replaced fragment b, in turn, replaced fragment c. whether in fragment b or c, want user navigation take fragment a. add backstack when replacing b. when move b c, don't add backstack. when navigating fragment b, works fine. but, when navigating c, , c on same screen - c doesn't disappear. wonder if related backstack usage. appreciated. my code equivalent to: fragment fragment; fragment = new fragmenta(); transaction.replace(r.id.container, fragment); transaction.commit(); fragment = new fragmentb(); transaction.replace(r.id.container, fragment); transaction.addtobackstack(null); transaction.commit(); fragment = new fragmentc(); transaction.replace(r.id.container, fragment); transaction.commit(); this general way add backstack. use tags. fragmentmanager fragmentmanager = getsupportfragmentmanager(); fragmenttransaction fragmenttransaction = fragmentmanager.begintransaction(); fragment1 fragment1

pdf - Adobe LiveCycle Flowed Form page margins -

i using adobe livecycle designer es 8.2 create pdf survey. i've managed create form scratch using flowed content boxes allow fields dynamically expand can print out survey later. issue having right though if field expanded , pushes other fields below beyond page range, create new page consisting of couldn't fit on previous page. fine, form automatically move content below last page up. basically, anytime page moved new page there lot of white space , id next page moved under newly positioned fields. thank you you need configure pagination of subforms using object > pagination palette. can use keep next/previous option control grouping of objects on page break. make sure top level subform set flowed .

reporting services - SSRS - Limit records by group -

i have report displays records grouped column "branch". limit records displays 7 records per page. break display if group different. how do this? here how want record display. page 1: branch1 id 1 2 3 4 5 6 7 page 2: branch1 id 8 9 10 page 3: branch2 id 11 12 13 14 15 16 17 you create group based off expression divides row number 7 , adds 1, set page break property on group. expression group like: =(fields!rownumber.value / 7) + 1

swifty json - swiftyjson bundled file not parsing -

i've validated coding , works until actual parsing function unsure why not able of values in array of json file. have tried multiple methods of getting every object in array specified string , still nothing. example code have. [ { "attack": 4, "card description": "<b>deathrattle</b>deal 2 damage other characters.", "card type": "0", "class": "10", "cost": 5, "health": 4, "name": "abomination", "rarity": 3 }, { "class": "1", "name": "fiery war axe", "cost": 2, "card type": 2, "card description": "", "rarity": 5 }, ] if use: json["array"].array your json must like: { "array": [ { "attack": 4, "card description": "deathrattledeal 2 damage other characters.", &quo

java - Check if the number entered is in array, otherwise add to the array -

the user enter size of array , values. if entered value exists, user must enter different number. can't seem construct proper code check if inserted value exists. public static void main(string[] args) { string holder="", s; int size; s=joptionpane.showinputdialog("enter size of array"); size= integer.parseint(s); string array1[]= new string[size]; //declared , instantiated array1 (int x=0; x<=array1.length-1;x++) { array1[x]=joptionpane.showinputdialog("enter value array[" +x +"]"); int a=0; if (array1[x].equals(array1[x])){ a=1; joptionpane.showmessagedialog(null, "exists"); } else joptionpane.showmessagedialog(null, "continue"); } (int x=0; x<=array1.length-1;x++) { holder=holder+ "\n"+ array1[x]; } joptionpane.showmessagedialog(null,holder); how this? checks if value exists

Show splash screen when application enters background android -

how can show android splash screen when application goes ground? the issue need hide application main page when user sends app background, , when s/he double tabs home button, see splash screen. we using following inside our code : public void oncreate(bundle savedinstancestate){ super.oncreate(savedinstancestate); getwindow().setflags(layoutparams.flag_secure, layoutparams.flag_secure); . . it looks fixing issue, code preventing user taking screenshot on device if app in foreground. i'm not sure how implement need did in ios. thanks. now haven't tried i'm not sure if it'll work, can try overriding onpause() method. after overriding onpause() add code sets splash screen cover entire activity. should put image app preview in recents panel. override onresume() method remove image activity, giving user control again.

java - Small rendered images from PDF slides -

i'm using ghost4j library ( http://ghost4j.sourceforge.net ) split pdf file of slides several images. problem have images slides in corner , small. want images format of page pdf, don't know how it. here code i'm using. pdfdocument examplepdf = new pdfdocument(); string filepath="input.pdf"; file file=new file(filepath); examplepdf.load(file); list<org.ghost4j.document.document> docs=examplepdf.explode(); simplerenderer renderer = new simplerenderer(); renderer.setresolution(300); int counter=0; ( org.ghost4j.document.document d : docs){ list<image> img=renderer.render(d); imageio.write((renderedimage) img.get(0), "png", new file( (counter+ 1) + ".png")); counter++; } i think problem in explode method doesn't take account original pdf didn't have standard pdf page size. pd. first tried code second answer of this question gave me heap space error when document have l

c# - Correct way to use a controller and deal with business logic -

i'm having trouble in how write asp.net mvc application, in how use business logic. provide example. don't know if right: public class usercontroller { public actionresult create(user user){ userservice service = new userservice(); if(!service.userexists(user.email)){ if(service.insertuser(user)){ service.sendconfirmation(user); } } } } or right public class usercontroller { public actionresult create(user user){ userservice service = new userservice(); service.createuser(user); } } in second example method createuser of userservice check if user exists, insert, send email. the main difference in second example controller calls 1 method while in second calls many methods , receives answers, in both cases logic inside userservice. what's correct? the second 1 one choose. utilizes proper encapsulation. controller should not logic communicate services , feed views data , manage progr

angularjs - Internet Explorer 9 and angular-file-upload not working properly -

i'm trying use upload file using angular , works except on ie9. i tried https://github.com/danialfarid/ng-file-upload requires flash when working non-html5 browsers, not work me. after tried https://github.com/nervgh/angular-file-upload , works! except after uploading file processing , maybe return error bad request. , not work in ie9. if upload successful code not see bad request. well, don't think problem code, wont post here. want had same problems shed me light in do. edit: in other words. in chrome, status 400 , in ie9 200. uploader.oncompleteitem = function (fileitem, response, status, headers) edit2: think found source of error. angular-file-upload function iframe.bind('load', function() { try { // fix legacy ie browsers loads internal error page // when failed ws response received. in consequence iframe // content access denied error thrown becouse trying // access cross domain page. when such thing occurs notifying // empty

Google Analytics: how to create a view which only has some events -

we need provide customer data specific google analytics events produced our mobile app, hide other analytics data app. anyone can shed light on how in google analytics? two choices: 1) create dashboard data eyes need see / benefits them, 2) administration configurations can set show views. views can configured show 1 account, 1 property or 1 subsection of property

c - Regarding scanf and many values to input -

so i'm trying solve http://www.codeabbey.com/index/task_view/sum-in-loop , have 45 random numbers input. i'm coding using c want use scanf function. problem since it's 45 numbers (which separated spaces) want copy paste values program can solve them array. should this: int x [45]; scanf("%d %d....(x42) %d",&x,&x,...(x42),&x); or there more efficient way of doing this? (i hope there t_t) you need not (and should not) write single format string containing 45(or whatever) format specifier, following 45 pointers. you need use loop. example: for loop array, hold supplied operands, too int x[45] = {0}; int sum = 0; (int = 0; < 45; i++) //style supported on c99 { scanf("%d", &x[i]); sum += x[i]; } printf("sum = %d\n", sum); for loop without array, won't hold operands, result int x = 0; int sum = 0; (int = 0; < 45; i++) //style supported on c99 { scanf("%d", &x);

Gmail save image programmatically -

i run small website. want users send email attached photos mobile devices our website gmail address. there way of programmatically logging gmail , saving image file locally? i realize 99.9% of time done letting users upload image file directly on website. wondering if there way using email, because in particular case more user friendly. cheers. yes, you'll need code pop3 email reading in language of choice. java: http://www.oracle.com/technetwork/java/javamail/index.html python: https://docs.python.org/2/library/poplib.html php: https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/phpmailer here's example in java: http://alvinalexander.com/java/javamail-pop-pop3-reader-email-inbox-example

Using XSLT variable in X PATH string -

i have xpath string follows: /results/server[@name='server1'] i construct new xpath using defined xslt variable: /results/server[@name='$server'] i haven't tried 'concat' might possible that. using xslt 2.0. xslt parser complains if use string defined above: xpst0003 xpath syntax error @ char 65 on line 89 near: unexpected token "" in path expression you can refer variable anywhere in xpath expression: /results/server[@name eq $server] if write quotes, '$server' , string literal happens contain dollar sign.