Posts

Showing posts from February, 2013

javascript - Kendo UI HierarchicalDataSource for Treeview with dynamic schema -

i'm trying display kendo treeview hierarchicaldatasource. it's simple region, country, city hierarchy difficulty comes fact have 3 possible levels of regions , countries can appear @ second or @ third level. basically, - first level of regions contains other regions - second level of regions contains other regions or countries - third level of regions contains countries here schemas: var portsschema = { schema: { data: "portlist", model: { id: "code" } } }; var countryschema = { schema: { data: "countrylist", model: { id: "code", children: portsschema } } }; var regioncountryschema = { schema: { data: "regionlist", model: {

ag-grid angular 2 header template -

i wrapped ag-grid in ng2 component. and want first header checkbox parent functionality. how can container component? ag-grid.component @component({ moduleid: module.id, selector: 'rg-grid', templateurl: 'grid-control.component.html', directives: [aggridng2] }) export class rggridcomponent { private gridoptions: gridoptions; private showgrid: boolean; @input() rowdata: any[]; @input() columndefs: abstractcoldef[]; } container component @component({ moduleid: module.id, selector: 'alerts-table', templateurl: 'alertstable.component.html', directives: [rggridcomponent] }) export class alertstablecomponent implements oninit { selectedalert: ialert; users: user[]; checkedalerts : ialert[]; displaydialog : boolean; dialogcontent : string; columns : coldef[]; constructor(private _alertsservice: alertsservice, private _usersservice: usersservice) { this.displaydialog = false

ios - Add parameters to image; upload api like "userid" = "50" -

func uploadprofilepicture(data : nsdata,completion: (success : bool) -> void) { pkhud.sharedhud.contentview = pkhudtextview(text: "loading...") pkhud.sharedhud.show() alamofire.upload(.post,globalconstants.kupdatepropic,multipartformdata: { multipartformdata in multipartformdata.appendbodypart(data : data, name: "image", filename: helper.timestamp(), mimetype: "image/png") }, encodingcompletion: { encodingresult in switch encodingresult { case .success(let upload, _, _): upload.responsejson { response in debugprint(response) let status : nsstring = response.result.value?.valueforkey("status") as! string if(status .isequaltostring("1")){ let profile_image : nsstring = response.result.value?.valueforkey("profile_image&qu

firebase - Swift - Could not cast value of type '__NSCFString' to 'NSDictionary' -

i got error, i'm trying string dictionary . code: firdatabase.database().reference().child("users").child(uid).observeeventtype(.childadded, withblock: { (snapshot) in let dictionary = snapshot.value as! nsdictionary if let username = dictionary["name"] as? string { cell.name.text = username } if let userlogin = dictionary["login"] as? string { cell.login.text = userlogin } }) in firebase database "name" , "login" both strings. cannot understand what's problem. any appreciated! issue regards snapshot cast nsdictionary. since snapshot value string. try this: firdatabase.database().reference().child("users").child(uid).observeeventtype(.childadded, withblock: { (snapshot) in if let dictionary = snapshot.value as? nsdictionary { if let username = dictionary["name"

How do I write contents in build.gradle in Android.mk file? -

i have build.gradle file i'm trying integrate. i've few statements i'm not able write android.mk file. android { compilesdkversion 23 buildtoolsversion "23.0.1" defaultconfig { applicationid "com.sec.android.myapp" minsdkversion 23 targetsdkversion 23 versioncode 1 versionname "1.0" testinstrumentationrunner "android.support.test.runner.androidjunitrunner" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile filetree(dir: 'libs', include: ['*.jar']) androidtestcompile 'com.android.support.test:runner:0.4.1' androidtestcompile 'com.android.support.test.uiautomator:uiautomator-v18:2.1.1' } i don't know how write following build configs build.gradle andr

jquery - How to align (width wise) bootstrap select dropdown with input box? -

i using bootstrap select on form. below having input box. have input box's width similar select box. <div class="container-fluid"> <div class="row"> <div class="col-md-12"> <select class="selectpicker"> <option>mustard</option> <option>ketchup</option> <option>relish</option> </select> </div> </div> <div class="row"> <div class="col-md-2"> </div> <div class="col-md-8"> <input class="form-control" id="input_id" type="text" value="" /> </div> <div class="col-md-2"> </div> </div> </div> please see: https://jsfiddle.net/5l30q27f/8/ in bootstrap-select.css, appears width has been set 220px. use exact width input box not think idea, since suspe

angular - No provider for RouterOutletMap! in angular2 app -

i trying make routing angular2 app. have seen many questions this , this none of them helped me. here app.route.ts : import { providerouter, routerconfig } '@angular/router'; import {formcomponent} './form.component'; import {aboutcomponent} './about-this.component'; const routes: routerconfig = [ { path:'home' , component: formcomponent }, { path:'about', component: aboutcomponent }, { path:'**' , component: formcomponent } ]; export const approuterproviders = [ providerouter(routes) ] and here root component: import { router_directives, router } '@angular/router'; import { component } '@angular/core'; import {navbarcomponent} './shared/navbar.component'; import {approuterproviders} './app.routes' @component({ moduleid: module.id, selector: 'app-root', templateurl: 'app.component.html', styleurls: ['app.component.css'], directives:[navba

ruby on rails - Application pushed to heroku but not working due to dotenv gem -

i have pushed heroku application not run. see due dotenv gem. there way around this? need dot-env gem in order encrypt basic auth user name , password. i'd prefer not use devise or of complexity simple application. below heroku terminal output, issue dont know how spot errors/read output. /app/config/application.rb:4:in `require': cannot load such file -- dotenv (loaderror) /app/config/application.rb:4:in `<top (required)>' /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require' /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:141:in `require_application_and_environment!' /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:67:in `console' /app/vendor/bundle/ruby/2.2.0/gems/railties-4.2.5/lib/rails/commands/commands_tasks.rb:39:in `run_command!' /app/vendor/bundle/ruby/2.2.0/ge

binaryfiles - how does gcc compiler produces machine/processor independent binary? -

my question bit dummy, had question in mind. how gcc @ compile time determines target machine/processor getting build-ed ? are instructions generated gcc/g++ target system independent ? for example have x86_64 machine intel based , amd based , motorola based system etc... do processors have same instruction set , opcode associated ? if not machine-code/binary generated gcc have kind of runtime check ? thanks in advance answer. this bit complicated. depends on how gcc configured , compiled during installation. on ubuntu 16.04 x64 system there gcc installation. if in terminal type gcc -v , i'll --target=x86_64-linux-gnu , means gcc produce code x64 linux. --host=x86_64-linux-gnu means gcc x64 linux application. more of @ link . another useful output @ --with-multilib-list=m32,m64,mx32 - means compile default 64bit application 2 types of 32bit applications (-m32 , -mx32). last not least --with-tune=generic , means apps compiled generic x64 platfor

javascript - JQuery to add list items -

i have autocomplete input field using jquery . following jquery return list $(function () { var list = list[<%=additional.count%>]; <% (var = 0; < additional.count; i++) { %> list[<%=i%>] = <%=additional[i].text %>; <% } %> var availabletags = list; $("#scheme_textbox").autocomplete({ source: availabletags, select: function (event, ui) { selectedorigoscheme(); } }); }); the list generated in code behind shown below list<ajbg.servicecontracts.messages.thirdpartyapis.origo.getstaticcedingschemes.cedingscheme> origocedingschemes = target.getstaticcedingschemes(request).cedingschemes; list<selectlistitem> listitems = new list<selectlistitem>(); foreach (ajbg.servicecontracts.messages.thirdpartyapis.origo.getstaticcedingschemes.cedingscheme origocedingscheme in origocedingschemes) { list

How to add an Id for material ui Raised Button component? -

i want set hidden property sign in button, <raisedbutton id='signinbutton' label="sign in" /> but doesnt seem work. suggestions? this works me the expected behaviour snippet above: <raisedbutton id='signinbutton' label="sign in" /> should place id attribute onto button element created raisedbutton . i haven't tried in other versions in mui 0.17.4. works expected. note: button element id attribute applied not root div element. also, id 1 of props looked , applied button id or id ignored. couldn't find in source happens did test. if isn't helpful let know mui version, , specific steps can take reproduce.

php - How to setting global variables in OpenCart 2.3.0.2? -

when want set global variable in template ( .tpl files), use global in opencart 2.2 or older version. for example: <?php global $config; if($config->get('my_options')== 1) { ?>....<?php } ?> but, it not work in latest opencart 2.3.0.2 because predefined global $config in controller rather inconvenient (we have use config value in many template file). more experience have answer problem. the least code defining them constants in config.php or admin/config.php, depending on need them. make these constants available throughout catalog or admin context. another way using $this->config in controllers key/values out of setting table models or controllers.

Elastic search Logstash How to configure UTC Time according to orcal time stamp -

i'am working elastic search logstash ,catching updates orcal data base elastic search. problem ==> how configure sql_last_start utc time parameter orcal time stamp. this configration ====> input{ jdbc { . . . statement => "select * cm.elsayed 'timestamp' > ':sql_last_start'" } } filter { date { match => [ "timestamp", "yyyy-mm-dd hh:mm:ss.ssssssssssssss z" ] target => "timestamp" timezone => "utc" } } i think may jdbc_default_timezone input add jdbc_default_timezone => "utc" input

php - Unable to fetch characters as in Mysql database -

unable fetch characters in mysql database below table. table1 +-------------------------------+ | aph | id0 | +-------------------------------+ | | costa rican colón | | b | icelandic króna | | c | somali shilling | | d | nicaraguan córdoba | +-------------------------------+ when db using pdo in php above character shown costa rican col�n what should do? after fetching mysql need use htmlentities below in php $str = htmlentities('costa rican colón'); echo $str;exit;

php - Reset password link not working -

i have reset password link seemingly won't process $_get('variable') . forgot password form: <?php $error = $email = ""; if (isset($_post['email'])) { $email = sanitizestring($_post['email']); $com_code = md5(uniqid(rand())); if ($email == "") $error = "not fields entered<br>"; else if (!filter_var($email, filter_validate_email)) $error='email invalid'; else { $resulte = querymysql("select email users email='$email'"); if ($resulte->num_rows == 0) { $error = "<span class='error'>email error</span><br><br>"; }else { querymysql("update users set com_code='$com_code' email='$email'"); $mail_to = $email; $subject = 'reset password '; $body_message = 'please click on link reset pass

d3.js - How do I pass bound data to a function in d3? -

i trying make small multiples chart following mike bostock's example . this example uses enter().append("svg") create new svg each data point. in each svg create chart. i have data in csv file looks this: count, radius 15, 5 10, 3 with data i'd create 2 svgs (one each data point), first 1 containing 15 circles each radius of 5, , second svg containg 10, each radius of 3. have function drawcircles wish use draw circles based on dataset, i'm having trouble passing data through function. here's code: d3.csv("nations.csv", function(data) { var svg = d3.select("body").selectall("svg") .data(data) .enter().append("svg") .attr("width", width + margin.left + margin.right) .attr("height", height + margin.top + margin.bottom); drawcircles(function (d) {return +d.count;}, function (d) {return +d.radius;}) i can't seem pass d.count , d.radius through arguments drawcir

networking - How can I manage switching between wifi networks on raspberry pi? -

what want switch wifi networks raspberry pi headlessly. looking way simple , not include coding or using wpa_supplicant , stuff. have @ connman package. connmanctl commandline utility looking for.

jquery - how to update a dependent dropdown like create data in yii2 -

i add code, code select sub category dropdown notwork on upadte page worked on create page. how this <?php $coursescat = arrayhelper::map(coursescat::find()->all(),'id', 'cat_name'); $form = activeform::begin(['options' => ['enctype' => 'multipart/form-data']]); if($model->isnewrecord) { echo $form->field($model, 'cat_id')->dropdownlist($coursescat, ['prompt'=>'-choose category-', 'onchange'=>' $.post( "'.urldecode(yii::$app->urlmanager->createurl('coursedetail/lists&id=')).'"+$(this).val(), function( data ) { $( "select#subcat_id" ).html( data ); }); ']); echo $form->field($model, 'subcat_id') ->dropdownlist( ['prompt'=>'-choose sub category-'], ['id'=>'subcat_id']

AngularJS +how to wait for task to finish before running next task -

i have still problems database, found out, problems come fact, opening database takes time, app not waiting till task has finished. is there way make angular wait till database opened correctly before starts next task? thanks, christian. update: 2016-08-08 - 03:13 pm thanks answers. can see, first idea promises ($q) right, but: my app has app.js, main file. calls initdb. should open database. should call createtables, creates table, if doensn't exist. the rest of app splitted in 4 pages (templates). every page has it's own controller. so idea init db, create table, , work database, used on different controllers. this won't work, because need put of stuff in .then() of initdb in app.js??? this first angularjs app, maybe reason why lot of mistakes... thanks, christian. one of core concepts of angular working services/factories. there ample documentation , blogs how these work , how use them, basic idea these singleton "controllers"

iOS UISearchController width Not equal screen,Right less than screen -

- (uisearchcontroller *)searchcontroller { if (_searchcontroller == nil) { _searchcontroller = [[uisearchcontroller alloc]initwithsearchresultscontroller:nil]; _searchcontroller.searchresultsupdater = self; _searchcontroller.hidesnavigationbarduringpresentation = yes; _searchcontroller.dimsbackgroundduringpresentation = yes; self.tableview.tableheaderview = _searchcontroller.searchbar; } return _searchcontroller; } don't use uitableviewcontroller, instead use uiviewcontroller subclass. arrange searchbar , tableview. dont put search bar in tableview header. note: uitableviewcontroller indexed search gives space on right side.

string - Modifying data in a column Python -

hi guys have column this, start start = 11122001 start = 12012014 start = 23122001 and want remove "start =" , date format start 11/12/2001 12/01/2014 23/12/2001 how do properly? it depends on trying do. if want remove start = each line: lines = [ format_date(re.sub("^start =", '', line)) line in lines ] (presuming have text line line in list). to format date need implement function format_date convert dates 11122001 11/12/2001 . there several ways how depending on input format. 1 of solutions: def format_date(x): if re.match(x, '[0-9]{8}'): return "/".join([x[:2], x[2:4], x[4:]]) else: return x you check first if line match date expression (looks date), , if does, rewrite it. otherwise return is. of course, can combine solution in 1 line , don't use function @ all, in case not clear. another, map -based solution: def format_line(x): x = re.sub("^start =", '

cmake target_link_libraries - unwanted target -

i have problem cmake target_link_libraries. have 3 libs. first static compiled, second 1 (shared lib) link , third 1 executable use second lib. problem first lib automatically added third lib , leads "object defined" problem. is possible hide away first lib third one? i use cmake 3.4.x compiler: msvc 2010 x64 thanks in advance tonka your third "lib" isn't library, application. need add using add_executable , not add_library . if shared library links in static library, , want link application both static library , shared library, 2 copies of static library. never link static libraries plan use elsewhere shared library, reason. either make first shared (the name implies that's want, describing), or workaround design problem not explicitly link application static library.

bluetooth lowenergy - Get battery voltage and temperature from Ibeacon using Cordova-BLE Plugin -

i trying battery voltage , temperature beacon device using intel xdk cordova ble plugin https://github.com/don/cordova-plugin-ble-central . when scan app device id , rssi value. deviceid mac address (d4:3a:72:47:a0:39). ble.scan() function works fine, can't able connect using ble.connect() function. tried cordova eddystone plugin https://github.com/evothings/cordova-eddystone also. in plugin, scan function not working evothings.eddystone.startscan(foundbeacon, scanerror). can explain how proceed further. appreciated! the standard ibeacon format not provide battery or temperature data. eddystone telemetry frames so, , beacon manufacturers provide proprietary extensions allowing getting info. to these data programmatically, need first find manufacturer documentation see if using eddystone or extensions send these data. if extensions, plugins not work. if eddystone, plugin allowing access eddystone telemetry.

php - CakePHP authentication tutorial doesn't work -

i'm new cakephp, , i'm using version 2.8.5. have followed tutorial adding authentication website here: http://book.cakephp.org/2.0/en/tutorials-and-examples/blog-auth-example/auth.html , having problems trying login. i can add new users, whenever try login returns false , get: invalid username or password, try again. i get: warning (512): invalid salt: pass01 blowfish please visit http://www.php.net/crypt , read appropriate section building blowfish salts. [core/cake/utility/security.php, line 323] (pass01 password). have followed instructions of tutorial regards blowfish hashing, passwords in database don't appear hashed (they appear are). user.php app::uses('appmodel', 'model'); app::uses('blowfishpasswordhasher', 'controller/component/auth'); class user extends appmodel { public $validate = array( 'username' => array( 'required' => array( 'rule

Allow users to search for other users in Wordpress Frontend -

i have plugin i've created within site, shows 1 page i'm calling users , specific information users. would possible allow users search other existing users front end of site? this kind of thing i've got going on @ moment, haven't been able find kind of search of sort of thing, if point me in right direction it's appreciated, i haven't included code it's not relevant really, can include if needs be, thanks in advance! http://focusedlearning.hcrlaw.com/courses-admin/ <?php $total_users = count_users(); $total_users = $total_users['total_users']; $paged = get_query_var('paged'); $number = 20;?> <?php $args = array( 'order' => 'asc', 'orderby' => 'display_name', 'count_total' => 'true', 'role' => 'subscriber', 'offset' => $paged ? ($paged) * $number : 0, 'number' => $numbe

Proper TDD + Dependency Injection in Akka.net -

i have , agent, read directory x , create child agent each subdirectory finds. to testing enviroment i've used system.io.abstractions package creates ifilesystem interface , it's implementation (for normal program use). agent (for dir x) uses autofac di create child agents (since need give them ifilesystem dependency, , more in future): var props = context.di().props<directoryreader>(); var directoryagent = context.actorof(props, "directoryreader"); my tests looks this: public class directoryreadertests : akka.testkit.xunit2.testkit { public directoryreadertests() : base(@"akka.loglevel = debug") { var builder = new containerbuilder(); builder.registertype<filesystem>().as<ifilesystem>(); var container = builder.build(); // <--- how use testkit } [fact] public void createsagentforeachsubdirectory() { eventfilter.info() .expect(3, () => gettar

Package that runs perfect on SSIS, but fails on SQL - server job activity -

i wonder if can me, having problem can't figure out last few days... these errors when run package, runs perfect on ssis, on sql - server job activity: error: there errors during task validation error: .. failed validation , returned error code 0xc0208449 error: 1 or more component failed validation ado net source has failed acquire connection {...} following error message "exception hresult: 0x80131937 some additional info: i using project deployment mode my sql server version 2014 my protection level in ssis dontsavesensitives both in project , packages, think doesn't matter when deploy anyway. the package error run on ssis not on sql-server job activity when runnin within sql agent job, package failing acquire connections. first review package/job connections, , make sure have deployed properly. then rule out access permissions issues testing package using sql server user/password account. if works way need use sql serv

php - what's the syntax error in this simple login mysql query? -

Image
this question has answer here: php parse/syntax errors; , how solve them? 12 answers this php query login why show me syntax error this"( ! ) parse error: syntax error, unexpected '$sql_quey' (t_variable) in c:\wamp64\www\aps_db\login.php on line 6 " 1 tel me plz you need add ; on line number 4. missed it.

linux - Node.js - exec command for tar files works correctly first time, but produces corrupted tar contents upon subsequent execution -

i building web app node.js, , @ point need produce tar archive of directory of pdfs. application running on vm running ubuntu 14.04 server. code shown below: function tardirectory(path, token, callback) { var exec = require('child_process').exec; var cmd = 'cd ' + path + ' && tar -cvf genericname-' + token + '.tar' + ' ' + token; exec(cmd, function(error, stdout, stderr) { console.log(stdout); console.log(stderr); if (error) { console.error(error); } if(callback) callback(); }); } and tardirectory function called following code: router.post('/files/generate', function(req, res, next) { idlist = req.body['ids[]']; token = req.body['token']; // if single file being generated if (typeof req.body['ids[]'] === "string"){ filehelper.generatefile(idlist[0], req.app.locals.site.basedir + "temp/", token); } // if multiple files being

java - Spark Job Take too Much Time -

i have 1gb data in kafka , running spark-streaming job take data kafka , in put java cleansing code , after put hadoop, in parsing or in cleansing it's taking time. spark standalone cluster configs are:- 2 nodes 16 gb ram , 4 core. sample code given below: private void processrdd(javapairdstream < string, string > messages) throws jsonexception { //messages.print(); javadstream < string > fields = messages.map(new function < tuple2 < string, string > , string > () { /** * */ private static final long serialversionuid = 2179983619724411716 l; /** * @throws jsonexception * */ public string call(tuple2 < string, string > message) throws jsonexception { customparser customparser = new customparser(); string parsedata = customparser.parse(message._2.getbytes()); //system.out.println("=====>>>>>>1

c# - Convert key=value string to JSON -

i have string of keys , values in following format: key1=somevalue, key2="hello, world!", some.other.key=hello world!, key4="hello, ""world""!" how can convert json string using c#? can done using regex, can't come right pattern. neither able figure out how using libraries newtonsoft.json . the json want produce following: { "key1":"somevalue", "key2":"hello, world!", "some.other.key":"hello world!", "key4":"hello, \"world\"!" } well, nested quotes updated question things go match trickier. can't see viable way of extracting values arbitrary level of nested quotes. (this true regex approach -- it's still possible scan string manually , count number of subsequent quotes respect nesting level.) assuming limit ourselves 1 level of nested quoted strings, regex be: (?<key>[^=,\s]+)=(?:"(?<value&g

css - jquery-ui dialog doesn't size correctly when content has white-space wrapping disabled -

<div style="white-space: nowrap;"> text containing spaces wrapped. </div> <script type="text/javascript"> $(function(){ $("div").dialog(); }); </script> when dialog opens, size narrow display unwrapped contents. how can ensure dialog wide enough without setting arbitrary width? if got right, adding width:auto dialog option enough $("div").dialog({ width:'auto' }); demo: http://codepen.io/8odoros/pen/rlqjjl

regex - How do I have the index of an item in a python list which exactly matches a given regular expression pattern? -

suppose have list of string items following: lst = ['apple', 'mango', 'mime'] p = r"mime" # regex pattern now, want have index of item matches pattern p . clearly, answer 2 . how do it? here code re module regular expressions import re lst = ['apple', 'mango', 'mime'] p = r"mime" # regex pattern in range(0,len(lst)): if re.compile(p).match(lst[i]): print

javascript - Collapasble tree using divs to hide child branches using jquery -

i have created collapasbe tree using divs, i've got working fine, part i'm having trouble is, if click on parent branch expand want rest of branchs hide , re-appear when collapse them. - parent item - if expand -- child item - if expand --- item - , on --- item - , on -- child item - hide -- child item - hide - parent item - hide - parent item -hide i have working example here https://jsfiddle.net/zidski/5dtgb91t/ i've updated example: https://jsfiddle.net/zidski/5dtgb91t/2/ i can parent child ids, trying work out how keep active branch show , hide rest. //gets id parent - branch0 var getbranchparentid = $(this).parent().parent().parent().prop("id"); //goes through each branch in parent - branch0_0,branch0_1 etc $('#' + getbranchparentid).children().children('.branch').each(function() { var bell = $(this).attr('id'); // if branch active hide other branches, if click make not active branches should show var isactivechild =

c# - Simple Injector and assembly scanning -

i'm diving process of learning ioc , other patterns , have run issue when trying register open generics based on list of assemblies. i'm building core of framework separate class libraries , have set of test projects declare test classes inheriting framework. problem framework.test.service dll addpersoncommandhandler : icommandhandler<addpersoncommand> isn't loaded @ runtime icommandhandler<> open generic fails find anything. need create addpersoncommandhandler instance in advance 1 assembly in list , works. is there simple way force loading? =========== edit: wireup code in unit test project holds app domain , references other assemblies. public container setupioc() { var container = new container(); container.register(typeof(iunitofwork), typeof(entityframeworkunitofwork), lifestyle.singleton); var assemblies = appdomain.currentdomain.getassemblies(); container.register(typeof(icommandhandler<>), assemblies); cont

How to log commands issued from Intellij with Scala plugin to SBT -

i worked time sbt , text editor. then, moved intellij, installed scala plugin , , created new project in picture here choosing based on sbt. also, in settings, chose sbt launcher custom, , made point already-installed sbt. i believe intellij calling sbt commands sbt run , stuff in background. question: how can see (a log of) these commands they're called intellij sbt , responses? , plus: can edit them? opened "edit configurations" couldn't find sbt compile . i believe intellij shows responses (e.g., [info] downloading...) below in "background tasks", but 1. doesn't log these responses and 2. doesn't show commands issued intellij sbt. big picture/what i'd want do: have intellisense features intellij , scala plugin, build , run terminal , not have effects intellij on that. the intellij scala plugin doesn't (yet) call sbt except project import/refresh or if have run configuration uses sbt. compilation done built-in comp

android - Switch case in Data Binding -

is possible write switch case android data binding? suppose have 3 conditions like value == 1 print value == 2 print b value == 3 print c does there way stuff in xml using data binding? i know can implement conditional statement like android:visibility="@{age < 13 ? view.gone : view.visible}" but here searching switch case statement. no, far know not possible , make xml files unreadable. think better implement in business logic, not in layout files.

asp.net mvc - SubmitOnChanges / InsertOnSubmit / DeleteOnSubmit are not detected -

submitonchanges / insertonsubmit / deleteonsubmit not detected in asp.net mvc4. should do? please help! submitchanges , insertonsubmit , deleteonsubmit methods of datacontext class , table<entity> class of linq2sql respectively. if using linq2sql in mvc4 , have instance of datacontext class , table<entity> classes (for each of tables), you'll have these methods available you.

c# - Multiple Database with single Website using Database Overwrite the Connection String -

i have multi tenancy web application. want publish 1 website support multiple database connection string save in database example: login user-a --> connect database-a login user-b --> connect database-b master database save user , connection string. but problem when user login application working correctly(using db-a) once user-b login how overwrite connection string. both user show db-b data. can please thanks you can use session assigning connection string based on type of user. on user logout, close session. stop values being overwritten.

angularjs - How to do something when an AngularUI's modal is closed? -

i'm working angularui's modal , , change variable of controller when modal closed. my modal looks this: <div class="modal fade" id="awesomemodal" role="dialog"> ... <button type"button" data-dismiss="modal">close</button> </div> i guess close event of modal has data-dismiss , don't find yet how @ specific moment. what set $scope.finished = true; when modal closed. i know can <button type"button" data-dismiss="modal" ng-click="finished = false>close</button> , there is, in opinion, cleaner way it. since asking $uibmodal, here event can used capture modal close event: var modalinstance = $uibmodal.open({ templateurl: 'modules/alerttemplates/redirecttomodal.html', controller: 'redirecttocontroller', controlleras: 'redirecttocontrollervm

tcp - "Error locating server" - SQL Server 2014 -

i have problem trying connect sql server. tried using ip address or name of server on connection string still "error locating server". enabled tcp/ip on server , restart it, no results. my actual connection string : server=posteserveur-pc\sqlexpress;integrated security=false;database=****;user id=****;password=****; the error : a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider:sql network interfaces, error:26 - error locating server/instance specified) i have read lot of answers similar problems, still don't i'm doing wrong. the sql service running, tcp/ip listening, , can ping server via cmd, user id works too, wrong ? all ideas welcome. thanks. you need check steps. make sure server name correct, e.g., no typo on name. make sure instance name correct , there such instan

tasm - assembly reverse a string -

the string read until 1 pressed, , 1 on last position of string. don't know why output off, example input is: asd1 , output is: $1111. anyway, here code data segment msg db 0dh,0ah,"your string: $" rev db 0dh,0ah,"reverted: $" s1 db 20 dup('$') s2 db 20 dup('$') data ends code segment assume cs:code,ds:data start: mov ax,data mov ds,ax lea dx,msg mov ah,09h int 21h lea si,s1 lea di,s2 mov bx,0 l1: mov ah,01h int 21h mov [si],al inc bx inc si cmp al,31h jnz l1 mov cx,bx mov di,bx dec1: dec si loop dec1 mov cx,bx l2: mov al,[si] mov [di],al dec di inc si loop l2 lea dx,rev mov ah,09h int 21h mov cx,bx l3: mov ah,02h mov dl,[di] int 21h inc di loop l3 mov ah,4ch int 21h code ends end start edit:this code looks , if input asd1, 1dserted edit : after ped7g's comment, reworked code. new 1 doesn't use stack reverse string , string not read whole string, read char char until "enter" pressed. below ne

browser - Is there any way to pass http headers when I use desktop.browse method in java? -

i want use browse() method java.awt.desktop class open web page, problem need set http headers specific values cookies. how that? if desktop.browse() not suitable, there other solution allows me open browser window mentioned status above? desktop.browse(...) lauches default browser url give it. cannot influence browser sends request uri, browser. if know browser opened might manipulate session storage on disk before launching it, not recommend this. if session-cookie, might able give session cookie url parameter instead, depends on webserver querying , have try whether work. other that, download url in java code, setting headers like, store result temporary file , open file uri via desktop.browse(...) .

node.js - How to set memory limit to NodeJS running with forever -

i'm running node js process through forever below: sudo forever start -o out.log -e error.log myserver.js i want change memory limit of nodejs server below when i'm running purely node. node --max-old-space-size=512 myserver.js how can same when i'm running forever? there way 'forever start --max-old-space-size=512' you can pass node options changing command (which defaults "node"). so example: sudo forever start -c "node --max_old_space_size=512" -o out.log -e error.log myserver.js

mysql - Is Apache Hadoop 2.7.1 is compatible with Apache Sqoop 1.4.6? -

i have installed apache hadoop 2.7.1 , integrate apache sqoop 1.4.6. when trying import mysql database hive using sqoop commands : sqoop import \ --connect "jdbc:mysql://localhost:3306/assignment5" \ --username root \ --password cg \ --table emp_detail \ --fields-terminated-by ',' \ --lines-terminated-by '\n' \ --hive-home /user/hive/warehouse/assignment5.db \ --hive-import \ --hive-table emp_detail and getting issue : exception in thread "main" java.lang.incompatibleclasschangeerror: found interface org.apache.hadoop.mapreduce.jobcontext, class expected @ org.apache.sqoop.config.configurationhelper.getjobnummaps(configurationhelper.java:65) @ com.cloudera.sqoop.config.configurationhelper.getjobnummaps(configurationhelper.java:36) @ org.apache.sqoop.mapreduce.db.datadrivendbinputformat.getsplits(datadrivendbinputformat.java:125) @ org.apache.hadoop.mapreduce.jobsubmitter.writenewsplits(job