Posts

Showing posts from January, 2011

localization - WiX find usergroup on non-english OS -

i need find local administrators group in wix installer in order add user group. should work in localized way according os installer running under. have tried several approaches, like <util:group id="administratorsgroup" domain="[computername]" name="administrators"/> this, however, yield desired user group on english os only, in german example "administrators" written "administratoren" (other languages accordingly), , above code not work. i tried: <util:group id="administratorsgroup" domain="builtin" name="administrators"/> and <util:group id="administratorsgroup" name="builtin\administrators"/> which leads error during execution, stating group not found. it possible use custom action, not do. also, tried translate "administrators" appropriate language , using $(loc.administrators), appears more hack me (sorry). can 1 give hint, name or

python - SQLAlchemy model data isn't rendered in Jinja loop -

i'm trying display menu of items (like lunch menu) can't them show up. added items via flask-admin page , checked database verify items exist know that's not problem. why doesn't menu item data render in loop? class menuitems(db.model): id = db.column(db.integer(), primary_key=true) name = db.column(db.string(50), index=true, unique=true) price = db.column(db.float(6), unique=false) description = db.column(db.string(140)) @app.route('/menu') def menu(): menu_items = menuitems.query.all() return render_template('menu.html', title="dave's bread - menu", menu_items=menu_items, user=current_user) {% item in menu_items %} <td> <p><strong>{{ menu_items.name }}</strong></p> <p>{{ menu_items.description }}</p> <p>price: {{ menu_items.price }}</p> </td> {% endfor %} you're accessing properties on menu_items inside loop. mean

java - Integration test works with activator but not IntelliJ -

i've got junit test came 1 of sample code projects play framework works , passes when running activator test command line fails run, timing out, when running test in intellij. i'm new sbt, have work within ide? here's test: @test public void test() { running(testserver(3333, fakeapplication(inmemorydatabase())), htmlunit, browser -> { browser.goto("http://localhost:3333"); assertthat(browser.pagesource(), containsstring("add person")); }); } here's error log when running in intellij: [[37minfo] - application - creating pool datasource 'default' [[37minfo] - play.api.db.hikaricpconnectionpool - datasource [default] bound jndi defaultds [[37minfo] - application - shutting down connection pool. org.openqa.selenium.timeoutexception: java.net.sockettimeoutexception: read timed out build info: version: '2.44.0', revision: '76d78cf323ce037c5f92db6c1bba601c2ac43ad8', time: '2014-10-23 13:1

android - Built a custom file in XML, Can't call it in Java by any means -

i working on listviews. decided make customized listview. it, xml file (customized) required. built cannot call means in java. following line row_layout red error "cannot resolve symbol "row_layout": listadapter myadapter = new arrayadapter<string> (this, android.r.layout.row_layout, cars); following code of customized xml file row_layout : <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/row_layout"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/mytextview1" android:textsize="32dp" android:textstyle="italic"/

java - public static methods return issues -

i have created text.file user adds values to. part users data gets read , validated. struggle when user add values when prompted to, not return data. shows zeroes. must not returning values somewhere. here directions section. "ask user if there more amounts add not in text file.  ifso:  use static methods read , validate amount type , amount  use instance method add amount 1 of totals" and here have far. direction , help. public static char readvalidateamounttype() { system.out.println("enter amount type(t, d, e) enter: "); scanner keyboard = new scanner(system.in); char amounttype = keyboard.next().charat(0); amounttype = character.touppercase(amounttype); { if(amounttype !='t' && amounttype !='d' && amounttype !='e') { system.out.println("invalid amount type!"); system.out.print

php - single function in javascript called multiple times -

in below code i'm running loop. within have 4 links , have written onclick event. if click on particular link having user_id function myfunction , there i'm calling function refreshid(session_to_user) . first time click event working fine. if click on link 2 other functions start running vice versa. my requirement according link click function refreshid(session_to_user) should work. while clicking first should work first user_id. if clicked second link first user_id should suspended second link user_id should used. please me. for loop() { <a id='some' name='some' onclick='myfunction(".$result['user_id'].")'></a> } function refreshid(session_to_user) { setinterval(function() $('.chat-box').load("<?php echo base_url()."users/message/refresh_div/"; ?>" + session_to_user); }, 10000); } function myfunction(user_id) {

How to share Google Sheets and AppsScript linked to the sheet? -

i have google sheet. have developed apps script manipulates sheet. apps script has lots of different files: bunch of gs files , bunch of html files. when make copy of sheet, notice function: var script_project_key_cell_index = "b2"; var settingssheet = "configuration settings"; var settings = spreadsheetapp.getactivespreadsheet().getsheetbyname(settingssheet); var project_key = settings.getrange(script_project_key_cell_index).setvalue(getscriptprojectkey()); returns same value in both original , copy of sheet. notice 'make copy' option under code editor file menu. when create copy of code itself, seems create copy - spreadsheet copy linked to? question have how make sure when send google spread sheet 1 of clients, script associated sheet sent , change or modifications client not affect original sheet , scripts associated it. if have created an embedded app script sharing spreadsheet lead sharing of app script code. however if have crea

javafx - FX assessing if ListView is empty using different change listeners -

i want assess whether listview empty disable or enable submit button. in essence, when listview has no content button disabled , when has 1 or more elements enabled. i've managed achieve using listchangelistener, using code such as: vp.addlistchangelistener(change -> { change.next(); if (change.getlist().size() == 0 && change.wasremoved() || change.getlist().size() == 1 && change.wasadded()) { bp.togglesubmitavailability("submit"); } }); where method addlistchangelistener follows: public void addlistchangelistener(listchangelistener<name> listener) { names.addlistener(listener); } what ideally wanted use traditional changelistener , listen 1 of properties associated listview. example, thought may work: vp.additemslistener((observable, oldvalue, newvalue) -> { if (newvalue.size() == 0 && oldvalue.size() > 0 || newvalue.size() == 1 && oldvalue.size() == 0) {

python - Serving django static files with Apache -

i'm trying learn django, however, can't apache serve static files. i've tried using development server or gunicorn both running on port 8000. i can access page fine, bootstrap not loaded. also, when i'm trying open static files directly (mydomain.com:8000/static/app/css/bootstrap.min.css) "connection refused". <virtualhost *:8000> documentroot /home/django/project/ servername mydomain.com alias /static /home/django/project/static <directory /home/django/project/static> require granted </directory> root@ip-:~# tree -dc /home/django/project/ /home/django/project/ |-- app | |-- templates | | `-- app | | `-- includes | |-- __pycache__ | |-- static | | `-- app | | `-- bootstrap-3.3.6-dist | | |-- css | | |-- fonts | | `-- js | `-- migrations | `-- __pycache__ |-- static | |-- admin | | |-- css | | |-- fonts | | |-- img | | | `-- gis | |

android - Various activities use same views from one layout - how to refactor? -

i have 6 activities this. tried make custom activity hold imageviews won't have repeat myself in every activity. should leave or can make somehow in 1 place , let used (like layout - it's 1 , works): public class activityone extends appcompatactivity implements view.onclicklistener { @bind(r.id.iv1) imageview iv1; @bind(r.id.iv2) imageview iv2; @bind(r.id.iv3) imageview iv3; @bind(r.id.iv4) imageview iv4; @bind(r.id.iv5) imageview iv5; @bind(r.id.iv6) imageview iv6; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); butterknife.bind(this); iv1.setimagedrawable(getresources().getdrawable(r.drawable.c1)); iv2.setimagedrawable(getresources().getdrawable(r.drawable.c2)); iv3.setimagedrawable(getresources().getdrawable(r.drawable.c3)); iv4.setimagedrawable(getresources().getdrawable(r.drawable.c4));

Delphi - ZEOS MySQL - access denied -

i trying connect mysql database server (version 5.6) on web, delphi 7 application... with mysql workbench, works ok, can run select queries test user (the same user not working in delphi 7)... in delphi, using tzeosconn 7.1.4-stable , typed correct hostname db server, correct username , password... (parameter loginprompt = false) when change "connected" true, working ok... but when trying execute simple query: zq.sql.text:='select field database.table id='+inttostr(x)+';'; zq.execsql; where zq tzquery, , x integer, i got error: **ezsqlexception .. select command denied @my_internet_hostname ** when logged in mysql workbench, see same user wildcard session, mydbuser@% , same select works fine so think, problem in zeos component, adding automatically internet provider hostname... on mysql server have wildcard hostnames allowed ( - '%' - hosts can access mysql db ) can suggest me, problem zeos component??? ps: sorry eng

Shortcut to open source files in Source Insight -

i new source insight , wuld know keyboard shortcuts. example - in eclipse open source file can use ctrl+shift+r . there such shortcuts in source insight? you can set keyboard shortcuts via "options->key assignments" menu. standard shortcut "file open" ctrl-o can change if like.

html - Angular : template changing depending on javascript value -

i building angular app, templates changing depending on ngscope seen on samples below. <label class="btn btn-default"> <input id="cacher" value="settings" type="radio" data-ng-model="user.status">settings </input> </label> and here i'm calling html template userpagesettings <div id="wrapper" ng-switch="user.status"> <div ng-switch-when="settings"> <user-page-settings></user-page-settings> </div> </div> trouble is, i'm trying access templates (and correct route) through dropdown in navbar, supposed same thing normal menu. if call templates navbar shown on current page, therefore @ incorrect route. in navbar code i'm doing following, bringing me correct route, showing me default template (aka home, not shown here, called through same method , has number 6) <li role="menuitem"><a hr

elasticsearch - how to update the index setting,mapping after creating the index in elastic search on node.js -

i'm trying update setting , mapping index after creating in elastic search using node.js.when try update mapping , settings values in index not change.it remains in default settings.kindly suggest me way fix this. here mention coding. fs.readfile('./article_settings.json', 'utf8', function (err, data) { if (err) throw err; settingsvalue = json.parse(data); console.log("settings json"); console.log(settingsvalue); return elasticclient.indices.putmapping({ index: indexname, type : type_name, body: { "settings" : settingsvalue} }); }); fs.readfile('./article_mapping.json', 'utf8', function (err, data) { if (err) throw err; mapping = json.parse(data); console.log("mapping json"); console.log(mapping); return elasticclient.indices.putmapping({ index: indexname, type : type_name, body: {

javascript - Google Maps Implementation Issue & API Prefix Error -

Image
!! updated !! i'm having little trouble getting google map display correctly, , i'm getting error in console log. have tried adjusting prefix listed examples here . feel i'm still not understanding correctly. explain in laymans terms me? 1 - prefixed fullscreen api deprecated. please use unprefixed api fullscreen. more https://developer.mozilla.org/en-us/docs/web/api/fullscreen_api this believe errornous code is; // google map element var mapelement = document.getelementbyid('map'); // added thes lines try , solve prefix error. if (mapelement.requestfullscreen) { mapelement.requestfullscreen(); } edit : okay little trouble has turned couple of days of trial , error. have tried number of different things try , around issue, don't think im saavy enough undertand what's going wrong. just update error log; 1 - typeerror: google undefined p-apollo:32:5 2 - prefixed fullscreen api deprecated. please use unprefi

amazon web services - AWS SNS not sending Subscription Confirmation -

i have setup aws sns setup topic 'a'. i'm doing subscribe sns topic using http (tried both manually using aws console online , using java code). 'pending confirmation' in both cases. sns not send initial 'subscriptionconfirmation' provided url. note endpoint ready receive http post notification. when manually post side see servlet processing json send. reason receive nothing aws sns. note http end point used subscribe public facing sns should have no issue reaching it. any inputs appreciated. here subscribe function. public string subscribe(string arn,string url) { if(arn == null || arn.isempty()) arn = topicarn; subscriberequest subrequest = new subscriberequest(arn,"http",url); subscriberesult result = snsclient.subscribe(subrequest); //get request id subscriberequest sns metadata if(result != null){ logger.info("subscriberesult - " + result.tostring()); } logger.info("sub

How to prevent article titles to become links in Drupal 8 -

i making website in drupal 8. made new content type 'news item' , view called 'news' shows news items blog page. all news items made small enough, no linking full article through article title needed. i pretty new drupal , can not find or how switch off. tell me? that's easy: 1. edit view 2. format > show > fields 3. fields > content title > uncheck "link content" your preview should show title no link thanks feedback!

Upstart causes kernel panic on embedded Linux -

i using ptxdist create kernel , rootfs images linux embedded system, running on arm cortex a8 cpu. i trying use newer compiler (gcc 5+) , forced upgrade several external packages not compile under new gcc. i compiled following versions of upstart , immediate dependencies: upstart: 1.13.2 libnih: 1.0.3 dbus: 1.11.2 json-c: 0.12.1 when boot, following message: init: com.ubuntu.upstart.c:3525: assertion failed in control_emit_event_emitted: env != null init: caught abort, core dumped kernel panic - not syncing: attempted kill init! exitcode=0x00000600 searching online did not yield useful hints - the relevant issue found this , relevant older version of upstart, , libnih of correct version already. according comment #8 in bug report linked, not enough use version 1.0.3 of libnih -- have use ubuntu version, seems include dbus fixes solve problem seeing. bug report: david ireland (e-david) wrote on 2013-04-22: #7 i've built libnih 1.0.3 sou

reactjs - How to drag-n-drop TableHeaderColumn from material UI with react-dnd? -

how apply drag-n-drop functionality react-dnd library tableheadercolumn component material ui the problem react-dnd not support custom tags , suggests wrap tableheadercolumn in div material ui not allow wrap table component in tag :( i can't find examples theme and answer - there no way react-dnd, @ least moment. i've ended using react-sortable-hoc works expected in pair material ui table elements.

concurrency - Concurrent programming and nondeterminism -

first , have declare , not familiar concurrent / parallel programming, job web(php) developer, interested on such topic. i reading "seven concurrency models in 7 weeks" @ moment. on chapter one, author stated: this unfortunate because concurrent programs nondeterministic — give different results depending on precise timing of events. if you’re working on genuinely concurrent problem, nondeterminism natural , expected. i not understand why concurrent programs non-dererministic in natural? can 1 give me concrete real live example? also , "a genuinely concurrent problem"? non-genuinely concurrent problem. by way, beginner book concurrent/parallel book? not math/cs guru, , please suggest book coding examples, not full pages of theories , math formulas. i can read java/c code genuinely concurrent problems involve interactions real world (which made of sorts of different things, happening concurrently, shouldn't surprising). here

query string - Drupal Custom Module Hook_menu not working with querystring params -

i sending link out via email users when register must click , automatically direct , log them site. i'm getting 404 error when trying access link. example email sent out: www.someurl.com/custom_confirm/verify?email=test@test.com&hash=somehash my hook menu in custom_confirm looks this: function custom_confirm_menu(){ $items = array(); $items['custom_confirm/verify'] = array( 'title' => 'confirming registration', 'page callback' => 'verify_email', 'access callback' => true, ); return $items; } my function function verify_email() is not being invoked when hit url. it's giving me 404 , not hitting code inside verify_email function. is there wrong hook_menu? don't understand why not working?

xmpp - How to get offline message from Tigase pubsub in smack library in android -

i have integrated tigase server , want store pubsub offline message , retrive of when user online. for ex: user_a , user_b connected, if user_a sends message user_b , @ time user_b offline. in location message goes? user_b online didn't message. how retrieve offline message? does have set properties in init.properties file regarding this? here init.properties file content sets option configure tigase server. --comp-class-1 = tigase.muc.muccomponent --virt-hosts = test --user-db-uri = jdbc:mysql://localhost/tigasedb?user=tigase&password=tigase12 --user-db = mysql --admins = admin@test --comp-name-4 = message-archive --comp-name-3 = rest config-type = --gen-config-def --comp-name-2 = pubsub --comp-name-1 = muc --cluster-mode = false --sm-plugins = +message-archive-xep-0136,jabber:iq:register,jabber:iq:auth,urn:ietf:params:xml:ns:xmpp-sasl,urn:ietf:params:xml:ns:xmpp-bind,urn:ietf:params:xml:ns:xmpp-session,roster-presence,jabber:iq:privacy,jabber:iq:version,http://ja

Enter Key string.byte number in Lua -

i use detect space in string in lua: if string.byte(" ")==32 blah blah what return number (instead of 32) enter key or new line in lua? these numbers denote ascii codes each character. here's chart future reference (but 127, extended ascii not supported) newline 10. you can print list following code: for i=1,127 print(i .. " = " .. string.char(i)) end however, command characters (such newline) difficult interpret.

javascript - ExtJS web display are different in Chrome toggle device mode and mobile browser -

Image
hi tried build web application can used via mobile browser. first, develop web , simulate mobile mode via chrome. however, use mobile connected site, display not same chrome. i have no idea fix problem. give me suggestions or key words google? thanks i found solution. in ext-all.js , there function initmeta set meta. initmeta: function() { var me = this, maxscale = me.maxuserscale || 1; me.addmeta('viewport', 'width=device-width, initial-scale=1, maximum-scale=' + maxscale + ', user-scalable=' + (maxscale !== 1 ? 'yes' : 'no')); me.addmeta('apple-mobile-web-app-capable', 'yes'); }, we can modify initial-scale value make less 1. hope trick others. update i think better way avoid modify ext-all.js. when app.js execute launch function add these code: launch: function() { if (ext.suppor

javascript - Restore HTML form state for cascade controls when hitting F5 -

in page http://carmen-rails-demo.herokuapp.com/ there example country / state selection common in web forms. let's suppose select united states , colorado , after hit f5. in scenario country code remembered, not state code, because it's loaded ajax. how can save state , restore after page refresh f5? you can use localstorage save country , code, this: $('.country').change(function() { var country = $(this).val(); localstorage.setitem('country', country); $.get('states', {country: country}, function(data) { localstorage.setitem('states', json.stringify(data)); var $states = $('.states'); data.foreach(function(state) { $states.append('<option value="'+state.value+'">' + state.value + '</option>'); }); }); }); $('.states').change(function() { localstorage.setitem('state', $(this).val()); })

python - Why we need gateway interface for web applications? -

i new web applications , came across these 2 terms, wsgi , cgi. both gateway interfaces question why need these interfaces communication between server , web application? can't communicate directly? thanks when strings (data bytestring) received web server needed kind of 'adapter' make possible application/python environment treat these strings. how data 'shipped' server/gateway environment application/python environment defined wsgi. on other way, python server, when sent. see pep-3333 . it's needed because software in machine (applications) needs way communicate through network using http, web server plus cgi make possible in safe , standard way python-based applications.

mysql - I want to find current and upcoming shows record -

i have created schedule table. in there column sc_show_time . have inserted show_time - 15:00:00, 17:00:00, 21:00:00. suppose current time 18:00:00. want 17:00:00, 21:00:00 these 2 records. thanx in advance try query current show : select * shedule sc_show_date = curdate() , sc_show_time < curtime() order sc_show_time desc limit 1 next shows : select * shedule sc_show_date = curdate() , sc_show_time > curtime() order sc_show_time asc

How to change the date format in bootstrap Datepicker? -

the code datepicker follows: $("#startdate").datepicker({ autoclose:true, startview:"months", minviewmode:"months", orientation: "bottom", format: "dd-mm-yyyy" }).on('changedate', function(selected){ startdate = new date(selected.date.valueof()); startdate.setdate(startdate.getdate(new date(selected.date.valueof()))); $('.to').datepicker('setstartdate', startdate); }); $("#enddate").datepicker({ autoclose:true, startview:"months", minviewmode:"months", orientation: "bottom", format: "dd-mm-yyyy" }).on('changedate', function(selected){ fromenddate = new date(selected.date.valueof()); fromenddate.setdate(fromenddate.getdate(new date(selected.date.valueof()))); $('.from').datepicker('setenddate', fromenddate); }); the format in front-end is: 01-january-2016 now nee

c++ - QT Apps for smartphone -

i'm looking qt mobile development. is there of know real apps on store smartphone (ios or android or winmobile) written in c ++ / qt edit: in preliminary stage, considering whether technology can meet requirements. real apps me in choice. i'm looking @ qt because still believe in paradigm: "write once, compile anywhere". there showroom apps: https://showroom.qt.io/

javascript - Login form is protected against userscripts? -

here login form site rutracker.org: <form id="top-login-form" action="http://login.rutracker.org/forum/login.php" method="post" style="display: inline;"> <input id="top-login-uname" type="text" placeholder="имя" accesskey="l" tabindex="1" name="login_username"> <input id="top-login-pwd" type="password" placeholder="пароль" tabindex="2" name="login_password"> <input id="top-login-btn" type="submit" tabindex="3" value="вход" name="login"> </form> here greasemonkey script autologin: // ==userscript== // @include http://rutracker.org/* // @grant none // ==/userscript== var f = document.getelementbyid("top-login-form"); f.elements.nameditem("login_username").value = "xxxxxx"; f.elements.nameditem("login_passwo

ms word - c# msoffice office error 0x80010108 -

this code work perfect on win7 + office 2007, on win8 + office 2013 got error 0x80010108 rpc_e_diconnected object invoked has disconnected clients. any idea? hello everybody this code work perfect on win7 + office 2007, on win8 + office 2013 got error 0x80010108 rpc_e_diconnected object invoked has disconnected clients. any idea? public void printdoc() { try { system.windows.forms.cursor.current = cursors.waitcursor; exportxmldocument = new xmldocument(); wordapp = new microsoft.office.interop.word.application(); //msword.document newmaindoc = null; object missing = system.reflection.missing.value; var ni = new nodeinfo(); ni = (nodeinfo)tvxml.nodes[0].tag; xmlelement xe = exportxmldocument.createelement(tvxml.nodes[0].text); xe.setattribute("name", n

java - Understanding inner classes (Why inner classes exist) -

i reading thinking in java , why inner classes exist , problem solve. the compelling reason book tries give is: each inner class can independently inherit implementation. thus, inner class not limited whether outer class inheriting implementation. please review understanding: inner classes exist since java doesn't support multiple inheritance. (multiple inheritances) can done within inner class outer class can have multiple inner classes, , each of them can inherit different classes. in way, multiple inheritances can implemented. reason can think of inner classes address oop design principle composition better inheritance . updated most of explanation found answers below. example, inner class used in gui framework deal event handler. not mentioned reason quoted in book.i not saying answers below not good. actually. appreciated them(+1). want know there problem book? it little puzzling why thought of idea of multiple inheritance after reading most

php - select from multiple table and write on one table w3schools -

i want select multiple table , write on 1 table: insert interest_area (category_id, user_id) select category_id category category_name = 'html' union select user_id users first_name = 'memar'; but couldn't write. change query like insert interest_area (category_id, user_id) select category_id,user_id category c,users u c.category_name = 'html' , u.first_name = 'memar';

javascript - How can I pass a handler function that may not be defined yet or may change at some point? -

i ask question because feel there cleaner way solve problem using anonymous function wrap call. // not work because passes value found // @ obj.init @ time of binding. scope.on('anevent', obj.init); // works because wrapped in anonymous function , // obj.init method gets run whatever defined as. scope.on('anevent', function() { obj.init(); }); i want date method (obj.init) called whenever 'anevent' emitted. you're not binding variables , you're binding values . raw obj.init bind the value @ moment event handler. can't bind "the variable" , have value re-evaluated later. re-evaluate variable @ time of event firing, indeed straight forward option: scope.on('anevent', function() { obj.init(); });

c# - Extract string from a pattern preceded by any length -

i'm looking regular expression extract string file name eg if filename format "anythingatallanylength_123_testname.docx", i'm interested in extracting "testname" ... fixed length of 8. (btw, 123 can 3 digit number) i think can use regex match ... ".*_[0-9][0-9][0-9]_[a-z][a-z][a-z][a-z][a-z][a-z][a-z][a-z].docx$" however matches whole thing. how can "testname"? thanks use parenthesis match specific piece of whole regex. can use curly braces specify counts of matching characters, , \d [0-9]. in c#: var myregex = new regex(@"*._\d{3}_([a-za-z]{8})\.docx$"); now "testname" or whatever 8 letter piece found in captures collection of regex after using it. also note, there performance overhead look-ahead , look-behind, presented in other solutions.

javascript - onclick event on image element in php does not work -

maybe stupid question don't this. small example <form id="frm1" action="" method="post"> <ol> <?php ($i=1; $i <= $amount; $i++) { $dirname = "fotos/"."gallery".$i."/"; $images = glob($dirname."*.jpg"); foreach($images $image) { echo '<li><img name="'."picture".$i.'" src="'.$image.'" onclick="this.form.submit();" /></li>'; break; } } ?> </ol> </form> when submit form onclick event it's not working put simple alert() in it, work. can explain me this? i think form not proper resolved way. try: onclick="document.getelementbyid('frm1').submit();" but can't retrieve name attr of img tag way on server side. use <input type='hidden' store clicked image request,

apache - Rewrite rule to globally omit subdirectory in URL -

we have site , like: www.domain.com/forum/us www.domain.com/forum/ca www.domain.com/forum/mx etc. what we'd url rewrite globally strip out "forum" such added www.domain.com/{country}. such as: www.domain.com/us(/) www.domain.com/ca(/) www.domain.com/mx(/) is there way within apache rewrite rules ignore directory url in such blanket manner? you can use following in /root/.htaccess rewriteengine on #--don't rewrite existent directries rewritecond %{request_filename} !-d #--and files rewritecond %{request_filename} !-f #--rewrite other request "/forum/" rewriterule ^(.+)$ /forum/$1 [nc,l]

tcl - Explain regsub invocations -

regsub -all "\\\\033" $cmd "\033" cmd [regsub -all "\\\\c" $cmd "" cmd] regsub -all "\\\\$i" $cmd [lindex $exp_out $i] cmd can explain meaning of these 3 statements? 3 different statements. regsub -all "\\\\033" $cmd "\033" cmd this replaces instances of backslash followed 033 ascii esc character. reads string process cmd variable , writes variable. [regsub -all "\\\\c" $cmd "" cmd] this replaces instances of backslash followed c empty string (effectively deleting it). updates cmd variable. substitutes calling context number of substitutions performed. regsub -all "\\\\$i" $cmd [lindex $exp_out $i] cmd this one's bit more complex. particular numeric index, stored in i variable, replaces instances of backslash followed index i 'th element (counting 0) of list in exp_out . updates cmd variable.

Python 'any()' buildt-in function evaluation sequence -

this question has answer here: is shortcircuit behaviour of python's any/all explicit? 3 answers is there guaranteed evaluation sequence 'any()' built-in function? is, safe assume any([..., x, ... y, ...]) will check condition 'x' before 'y' 'x' listed before 'y'? note, question on 'is shortcircuit behaviour of python's any/all explicit?' deals 'short-circuit behavior'. not deal evaluation sequence ! please, provide proof/reference suggested statements. it depends on iterable itself. if ordered (ie list) yes. if isn't ordered (ie dictionary) not. what guaranteed evaluation stop when first true -ish value reached.

castle windsor - What is the proper way to call proxied method inside concrete class? -

this question has answer here: castle windsor intercept method call within class 4 answers for instance have irepository , implemented repository interceptors. inside interceptor see irepositoryproxy basetype object , not repository . for example: resolve irepository , call getfunctionalitypurposes , want call getallfunctionalitypurposes cached/proxied. this not work since methods invoked in repository not irepositoryproxy . irepository functionalitypurpose[] getfunctionalitypurposes(); functionalitypurpose[] getallfunctionalitypurposes() repository [cached("tender")] public virtual functionalitypurpose[] getfunctionalitypurposes() { var model = getallfunctionalitypurposes() .where(r => !r.ishidden && !r.groupid.hasvalue); return model; } [cached("tender", "functionalitypurpose")] public v

objective c - How can i create an keyboard button press event programmatically OSX -

i want create remote ios app. if press key arrow in ios device. how can fire same event of key board in mac os. rrecive data in mac through wifi using bonjour. problem can not create event. try learn quartz event services. did not sample. thanks.

c# - Is there any way to maintain window scroll position on postback? -

i using telerik version 2014.1.403.40 in asp.net web application, net framework 4. is there way maintain window scroll position on postback? tiried setting maintainscrollpositiononpostback="true" but no luck. tried various examples manually scroll window after postback still no result. have tried setting in code behind in page load ? page.maintainscrollpositiononpostback =true; also, try setting in web.config <page smaintainscrollpositiononpostback="true"/> if else fails.

Sharing variables between classes in Java EE -

i'm developping java web application , have problems sharing variables. best of knowledge, there 2 ways : (1) using static variables, each class can access given var, (2) using setter , getter. i have issue each method. first one, users (even different session ids) share same values. and, second one, access via getters force program use constructors , in case loose values got current user. so, can explain me how share information given sessionid? to more explicit : i tried seperate model view aspect of application. so, package model contain databases access or web service requests example, , view package contain servlet pages , user interactions programme. when user select option, information stored in public static var other classes can access. conflicts occur when 2 users select 2 different options. cause variable static... need variable can shared between classes , keep value given user your first option listed, using static variables store mutable state, do

c# - Is it safe to enable CORS for a Token based webservice? -

i coding c# webapi 2 webservice token based authentication sample app @ resource: http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api i wanting webservice able accessed users own html webpages. is safe enable cors domains local login webservice uses token based authentication? there no other possibility. otherwise users problems cors. enable cors.

vba - Find / Replace Multiple Substrings from Table in Excel -

Image
i'm copy/pasting text cell in excel has specific substrings need replacing, list of ~4,000 rows. have equal number of pieces of text/content number of rows, i'll need manually copy/paste in. essentially, specific substrings need replaced same substring, wrapped html link, needs happen occurrences of substring list. example: i have text: microsoft excel spreadsheet developed microsoft windows, mac os x, , ios. in sheet #2, have following; example i need excel output text above, strings specified replaced links in following format: <a href="http://www.apple.com/uk/mac/">mac</a> in example, output following: <a href="https://www.microsoft.com/">microsoft</a> excel spreadsheet developed <a href="https://www.microsoft.com/">microsoft</a> <a href="https://www.microsoft.com/en-gb/windows">windows </a>, <a href="http://www.apple.com/uk/mac/">mac</a> os x