Posts

Showing posts from April, 2013

javascript - DisplayField overflow ellipsis in ExtJS 5 -

i want set text-overflow : ellipsis in displayfield, when add large text, displayfield groving horizontally. displayfield: xtype: 'displayfield', border: 1, style: { bordercolor: 'black', borderstyle: 'solid' }, maxheight:50, cls:'custom-field', height:50, width: 100, value: 'this <br/> multiline text<br/> , should ended <br/>with 3 dots when overflowy', css class: .custom-field{ text-overflow: ellipsis; } example on fiddle: https://fiddle.sencha.com/#fiddle/ole

c# - Can open a connection to a non-existing database, how is this possible? -

i have desktop software. @ login test if database can reached opening connection. if can't throws exception. if can good, close connection , go main window. until here normal. in mainwindow have thread checks connection 1 1 minute calling isdbconnectionok method below: sqlconnstring = @"data source=(localdb)\v11.0;attachdbfilename=" + configurationmanager.appsettings["databasepath"] + ";integrated security=true"; sqlconn = new sqlconnection(sqlconnstring); private bool isdbconnectionok(string errormessage) { using (var l_oconnection = new sqlconnection(sqlconn.connectionstring)) { try { l_oconnection.open(); return true; } catch (sqlexception) { if (!string.isnullorempty(errormessage)) { this.showmessageasync("waring", errormessage); } return false; } } } i test inserting usb stick dat...

Use Services in AngularJS -

i trying make rest request angularjs. main.js angular.module('frontendapp') .controller('mainctrl', ['$scope', '$http', function($scope, $http) { $scope.loaddata = function() { $scope.services = services.query(); }; services.js 'use strict'; angular.module('frontendapp').factory('services', function($resource) { return $resource('/services/:serviceid', { serviceid: '@_id' }, {}); }); i error: services not defined. did wrong ? edit: mains.html <div class="jumbotron"> choose category1 <div class="wrap" ng-controller="mainctrl"> <select ng-model="selectedvalue" ng-change="loaddata()" > <option value="1">category 1</option> <option value="2">category 2</option> <option value="3">category 3</option> <option value="4">cate...

regex - AWK - Search for a pattern-add it as a variable-search for next line that isn't a variable & print it + variable -

i have given file: application_1.pp application_2.pp #application_2_version => '1.0.0.1-r1', application_2_version => '1.0.0.2-r3', application_3.pp #application_3_version => '2.0.0.1-r4', application_3_version => '2.0.0.2-r7', application_4.pp application_5.pp #application_5_version => '3.0.0.1-r8', application_5_version => '3.0.0.2-r9', i able read file , search string ".pp" when string found, adds line variable , stores it. reads next line of file. if encounters line preceded # ignores , moves onto next line. if comes across line not contain ".pp" , doesn't start # should print out line next last stored variable in new file. the output this: application_1.pp application_2.pp application_2_version => '1.0.0.2-r3', application_3.pp application_3_version => '2.0.0.2-r7', application_4.pp application_5.pp application...

html - jquery mouse hover scroll the div -

Image
i trying make plugin. there logos of clients , 2 buttons on both ends ,if user hover on left button logos move right left , if hover on right button logos move left right (till last logo after stop animation) able code below ,but problem after last logo if again hover on button shows white space . same problem previous button if hover on button showing white space . var kiu = $('#cont1').width(); var screenwidth = $(window).width(); var realwid = kiu - screenwidth; $(".nextb").hover(function () { $('#conts').stop().animate({ 'margin-left': '-=' + realwid }, 4500); }, function () { $('#conts').stop().animate(); }); $(".prevb").hover(function () { $('#conts').stop().animate({ 'margin-left': '+=' + realwid }, 4500); }, function () { $('#conts').stop().animate(); }) html <div cl...

twitter bootstrap 3 - How to make Chart JS responsive? -

i using chart.js twitter bootstrap template. charts not sized correctly if don't mention height , width canvas. if specify width , height charts not responsive. how can solve issue? chart.js has property (responsive) can configure @ global or chart level via options make chart responsive. see http://www.chartjs.org/docs/#getting-started-global-chart-configuration > responsive // boolean - whether or not chart should responsive , resize when browser does. responsive: true, true makes responsive. false (default) makes non-responsive. example usage (only relevant part, check out codepen full exam) var ctx = $("#bar").get(0).getcontext("2d"); var mychart = new chart(ctx).bar(bardata, { responsive: true }); codepen - http://codepen.io/anon/pen/bdrgvx you might want check out maintainaspectratio option, if want maintain ratio of width height.

ios - 'openParentApplication(_:reply:)' has been explicitly marked unavailable here - Xcode 7 Beta -

after updating xcode 7 beta, receive following error message: "'openparentapplication(_:reply:)' has been explicitly marked unavailable here", when running line of code "wkinterfacecontroller.openparentapplication" here actual code: func getdata(messagetext: string) { let infodictionary = ["message" : messagetext] wkinterfacecontroller.openparentapplication(infodictionary) { (replydictionary, error) -> void in if let castedresponsedictionary = replydictionary as? [string: string], responsemessage = castedresponsedictionary["message"] { print(responsemessage) } } } +[wkinterfacecontroller openparentapplication:] relevant watchkit1 app extensions because watchkit1 app extensions, appex running on phone instead of on watch. with watchkit2 app extensions, appex running on watch, actions such less trivial accomplish. want use -[wcsession sendmessagedat...

Android Studio Google Play Service issue -

i having problem in android studio when tried import project facing following problem: project laste-android-master:/users/mac/documents/projects/laste-android-master/project.properties: library reference ../../../../library/android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib not found path /users/mac/documents/projects/laste-android-master/../../../../library/android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib resolves /users/library/android-sdk-macosx/extras/google/google_play_services/libproject/google-play-services_lib i having google play services installed, still getting problem, can me solve issue.

Elements from xml identify add and count (javascript/php) -

i pointers me going on this, don't know start, appreciate help. have (or +) xml files in format: <?xml version="1.0"?> <standings> <team rank="1" name="fsdfsdf, fsfsdaf" dci="uniquenumberhere" matchpoints="6" matchresultspwdb="2/2/0/0" opponentmatchwinpercent="50" gameswinpercent="66,6667" opponentsgamewinpercent="50" /> <team rank="2" name="dasdasd, asdasd" dci="uniquenumberhere" matchpoints="6" matchresultspwdb="2/2/0/0" opponentmatchwinpercent="41,5" gameswinpercent="80" opponentsgamewinpercent="36,6667" /> </standings> what want is: (1) extract dci key value, unique integer, , every dci add matchpoints , name. (2) adding more reports (xml) that, multiples occurrences same dci should appear (and add points , return one). (3) return xml formated (to later process ,...

php - How it's done - Laravel Blade statements -

how done, can have example in blade view: @if (count($records) === 1) (...) after analyzing bladecompiler.php file, can see converted php, there example method this: protected function compileif($expression) { return "<?php if{$expression}: ?>"; } it indirectly used "compilestring" method, takes , returns string. but then? can't find occurence of php's "eval" function call in entire project, how it's done? after blade has compiled php code, laravel puts result cached file in storage/framework/views/ directory. file called directly, don't need eval() statements.

html - Why does my Foundation Abide pattern not work? -

i have following html making sure password length on 8 characters: <label>password <small>required</small> <input type="password" name="password" id="password" required pattern=".{8,}"> </label> <small class="error">your password must @ least 8 characters long.</small> this works. however, if in different field use pattern [a-za-z]+ , this: <label>username <small>required</small> <input type="text" name="username" required pattern="[a-za-z0-9]+"> </label> <small class="error">username must consist out of letters or numbers only.</small> it allow everything . if change pattern in username field .{8,} , allow inputs on 8 characters in length, expected. why pattern username field not work? the documentation states correct way it: <label>your name <small>required</small> ...

ios - Why Pods.framework has to be optional? And why does that work? -

i have project in swift has dependencies managed cocoapods. @ given point in time decided change pods.framework link status required , instead of optional . running configuration works fine on simulator, if try run on iphone, following crash @ startup: dyld: library not loaded: @rpath/pods.framework/pods referenced from: /private/var/mobile/containers/bundle/application/... reason: image not found now if change optional , works fine. have found solution on github . still don't it, after reading apple's documentation . why work this?

wxPython overlapping images -

Image
i have program displays suit of cards overlapped images , wish select card double clicking on it. unfortunately, way i've programmed it, program pick image has been overlapped , not top image (e.g, if click on ks, system prints 'as' etc. js returns qs area of overlap, js right of that) the cards .png images 72x96 pixels. can please suggest how can set respond displayed card? here individual card images import wx class example(wx.frame): def __init__(self, parent, title): super(example, self).__init__(parent, title=title, size=(250, 200)) self.center() self.show() pnl = wx.panel(self) mainsizer= self.buildsuit(pnl) pnl.setsizer(mainsizer) pnl.layout() pnl.fit() def buildsuit(self, pnl): cards=['as', 'ks', 'qs', 'js'] suitsizer=wx.gridbagsizer(1, 13) border = 10 ii in range(0, len(cards)): card=cards[ii] image = wx.bitmap('images/cardimages/'+car...

sh - POSIX Shell backslash confusion -

i trying create shell script simple functionality, seems can not wrap head how handle backslashes correctly. 1 of functions this: #!/bin/sh func() { cmd="$*" printf "%s\n" "$cmd" echo -e $cmd } func '%{name}\\n' this correct output, need it: %{name}\\n %{name}\n now problem is, can not use "echo -e", script needs run on *nix system, echo command not have "-e" flag (hpux instance), why have use sh , not bash. want make script portable possible, i'd stay clear of using tr/sed or (even worse) script languages. the format of input string can chosen arbitrarily. using %{name} of reason, because if regular chars, work: #!/bin/sh func() { cmd="$*" printf "%s\n" "$cmd" printf $cmd echo } func 'name\\n' unfortunately breaks characters such "%": %{name}\\n func.sh: line 6: printf: `{': invalid format character how can desired resul...

c# - Access to the path is denied (encryption) -

i trying encrypt hello.txt file failed. when encrypt, exception: system.unauthorizedaccessexception: access path 'c:\users\username\desktop' denied. @ system.io.__error.winioerror(int32 errorcode, string maybefullpath) @ system.io.filestream.init(string path, filemode mode, fileaccess access, int32 rights, boolean userights, fileshare share, int32 buffersize, fileoptions options, security_attributes secattrs, string msgpath, boolean bfromproxy, boolean uselongpath, boolean checkhost) @ system.io.filestream..ctor(string path, filemode mode, fileaccess access) @ encrypt.encdec.decrypt(string filein, string fileout, string password) in c:\users\username\documents\my apps\encrypt\encrypt\form1.cs:line 518 @ encrypt.form1.proceededfe(string input, string output, string key) in c:\users\username\documents\my apps\encrypt\encrypt\form1.cs:line 154 so here code ( line 154 ): string inpute; string outpute; string pwde; private void ofd1_click(object sender, ev...

Displaying data using MySQL class in PHP -

i know how display data without using class, have been asked use mysql class instead. seems have initiate class , use written functions, whatever try display - doesn't work. getting "resource id #14", means should connection. please help! this part of mysql class: class sql //mysql { var $link_id; var $query_result; var $num_queries = 0; function connect($db_host, $db_username, $db_password, $db_name = '', $use_names = '', $pconnect = false, $newlink = true) { if ($pconnect) $this->link_id = @mysql_pconnect($db_host, $db_username, $db_password); else $this->link_id = @mysql_connect($db_host, $db_username, $db_password, $newlink); if (!empty($use_names)) $this->query("set names '$use_names'"); if ($this->link_id){ if($db_name){ if (@mysql_select_db($db_name, $this->link_id)) return $this->link_id; else die(mysql_error());// = "can't open database (...

Android : Pending Intent Not Firing if the application is not in foreground -

i trying open activity when user clicks on notification . had issued following intent pending intent intent caseintent = new intent(mcontext, loginactivity.class); caseintent.putextra("priority", priority); caseintent.setflags(intent.flag_activity_clear_top | intent.flag_activity_new_task); pendingintent pendingintent = pendingintent.getactivity(mcontext, 0, caseintent, pendingintent.flag_cancel_current | pendingintent.flag_update_current); but when click on notification, if app not in forground active have specified not opening @ all. wrong intent ?

python 2.7 - Assign array value to local variable -

i fetching records , contains array contains 2 further fields. example, fetched data this: {"id": 1, "name": "govind", "array": [{"subject": "maths", "score": 70}, {"subject": "maths", "score": 80}, {"subject": "english", "score": 90}]} i want assign value of "score" local variable "subject" "maths" , can have this: var1 = 70 , var2 = 80 code snap: try : cursor = db.students.find().sort('_id',pymongo.ascending) loop in cursor: item in loop: if loop[item] "type": #here need check value of array elements , remove them array. print key #loop[item] first loop gives me record. second loop loops on item of 1 array further need access array elements , comparison lower value. the output this **193 govind [{u'score': 47 , u'type': u'exam'...

How to set the last tab default in jquery Ul tabs? -

i use tutorial tabs. need set last tab active default anyone can ? unless have specific reasons stick code (which in opinion pretty convoluted) i'd use code that's show on jqueryui homepage . basically, html tabs like <div id="tabs"> <ul> <li><a href="#tabs-1">t1</a></li> <li><a href="#tabs-2">t2</a></li> <li><a href="#tabs-3">t3</a></li> </ul> <div id="tabs-1"> <p>...</p> </div> <div id="tabs-2"> <p>...</p> </div> <div id="tabs-3"> <p>...</p> </div> </div> and activating last tabs become simple, see documentation : negative value selects panels going backward last panel.: $(function() { $( "#tabs" ).tabs( { active: -1 } ); }); you see ho...

ios - AFNetworking JSON RESTful Service parameters -

i'm new using afnetworking , there i'm missing calling api. here code (most of part af* example) : afhttprequestoperationmanager *manager = [afhttprequestoperationmanager manager]; manager.securitypolicy.allowinvalidcertificates = yes; afjsonrequestserializer *reqserializer = [afjsonrequestserializer serializer]; [reqserializer setvalue:@"application/json" forhttpheaderfield:@"content-type"]; [reqserializer setvalue:@"application/json" forhttpheaderfield:@"accept"]; manager.requestserializer = reqserializer; afjsonresponseserializer *resserializer = [afjsonresponseserializer serializer]; [resserializer setreadingoptions:nsjsonreadingallowfragments | nsjsonreadingmutablecontainers]; resserializer.acceptablecontenttypes = [nsset setwithobjects:@"text/html", @"application/json", nil]; manager.responseserializer = resserializer; nsstring *urlstring =[nsstring stringwithformat:@"%@/users/userlogin", base...

c# - Adding a Command Column to DataGridView -

Image
i have c# datagridview columns. want add action column last cell in each row. there should buttons or icons view,delete,update in each row. here few options can think of: by far simplest add 1 column each button . ( recommended! ) of create custom cell type, maybe panel subclass buttons want. involves implementing idatagridvieweditingcontrol iterface @ least dozen fields , methods , 2 custom classes derived datagridviewcolumn , datagridviewcell many more things do. in short huge amount of work! sophisticated editing control maybe worth it. few buttons not! ( not recommended! ) or fake buttons little owner-drawing magic in cellpainting event. see below..! or add 1 sopisticated control outside datagridview acts on current row. usual way! here fun little example, owner-draws 4 'sidu' commands in 4th column of dataggridview dgv : private void form1_load(object sender, eventargs e) { dgv.rows.add(12); for( int = 0; i< dgv.rows.c...

c# - Autogenerate DTO elements when loading an XML for Deserialization -

suggest me proper solution autogenerating dto elements when loading proper xml deserialization. this dto using system; using system.collections.generic; using system.linq; using system.text; using system.xml.serialization; namespace ghelper.dto { public class elementsdto { [xmlroot("gallc")] public class farebb { [xmlelement("ip")] public string strip { get; set; } [xmlelement("port")] public int intport { get; set; } [xmlelement("type")] public int intport{ get; set; } [xmlelement("email")] public string stremail{ get; set; } } } } here xml <gallc> <ip>192.168.2.100</ip> <port>5051</port> <type></type> <email></email> </gallc> the problem is: when getting lengthy xml, consume lots of time create dto it. pleas...

onchange dropdownbox in html and php? -

does knows how code form dropdown after selecting options in dropdown form display layout depending on chosen dropdown options? for example, if choose 4 in dropdown list, form should display 4 empty textboxes, if choose 2, form display 2. check jsbin ! given example html: <select id='select'> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> </select> <input id='a' class="input" hidden></input> <input id='b' class="input" hidden></input> <input id='c' class="input" hidden></input> <input id='d' class="input" hidden></input> your solution this: $('#select').change(function (evt) { var no_inputs = $(this).val(); $('.input').each(function (i) { $...

wordpress - get link attribute id using jquery -

i working in wordpress.i want data-id value when click on link. my code this: <?php $query3 = "select t.* wp_terms t join wp_term_taxonomy tt on tt.term_id = t.term_id tt.parent = ".$res2->term_id; $result3 = $wpdb->get_results($query3); foreach($result3 $res3) { ?> <li> <a href="##" class="sub_cat_name" data-id= "<?php echo $res3->term_id; ?>"><strong><?php echo $res3->name; ?></strong></a> </li> <?php } ?> and jquery code is: <script> $(document).ready(function(){ $(".sub_cat_name").click(function(){ var cat_id = $(".sub_cat_name").attr("data-id"); alert(cat_id); }); }); </script> when click on different link alert fist term_id.so code should have write different id while click on different link....

android - Circular text around a button -

Image
this question has answer here: how show circular text using textview in android 7 answers i have button in ring shape , want add text around button. specifically, want text below. this simple custom view allows draw text in circular way. public class graphicsview extends view { private static final string quote = "this curved text"; private path circle; private paint cpaint; private paint tpaint; public graphicsview(context context) { super(context); int color = color.argb(127, 255, 0, 255); circle = new path(); circle.addcircle(230, 350, 150, direction.cw); cpaint = new paint(paint.anti_alias_flag); cpaint.setstyle(paint.style.stroke); cpaint.setcolor(color.ltgray); cpaint.setstrokewidth(3); setbackgroundresource(r.drawable.heart); tpaint =...

Ambigous PHP error message -

this question has answer here: only variables should passed reference 9 answers having this: ... private $responsebuffer = array(); ... and within line: $lm = end(array_values($this->responsebuffer)); i error: variables should passed reference (2048) as both end , array_values built in , not have call-by-reference i'm puzzled, 1 idea? (purpose: latest value out of $responsebuffer ) end function receives arguement reference, this: $var = array_values($this->responsebuffer); $lm = end($var);

Makefile cannot able to target dependecies -

# # makefile # # compiler use cxx = clang++ # flags pass compiler cxxflags = -ggdb3 -o0 -std=c++11 -wall -werror -pedantic-errors # flags c preprocessor cppflags = -mmd # maintainer's variant of cxxflags am_cxxflags = # command used compile c++ source file. # file name appended form complete command line. cxxcompile = # command used link c++ program cxxlink = # space-separated list of header files hdrs = # space-separated list of libraries, if any, # each of should prefixed -l libs = -lm -lpthread # default target # require argument provided @ command line # target name target = $(target) > problem line > targeting single .cpp > when want make project folder # # makefile # # compiler use cxx = clang++ # flags pass compiler cxxflags = -ggdb3 -o0 -std=c++11 -wall -werror -pedantic-errors # flags c preprocessor cppflags = -mmd # maintainer's variant of cxxflags am_cxxflags = # command used compile c++ source file. # file name appended form complete...

php - javascript calculate 10% discount on sub total -

how implement calculating 10% discount base on sub total in js?. here code. <!-- sub total --> function calculategrandtotal() { var grandtotal = 0; $('table tbody tr td:nth-child(4) input').each(function (index) { grandtotal += parseint($(this).val()); }); $('#sub_total').val(grandtotal); } it this: function calculategrandtotal() { var grandtotal = 0; $('table tbody tr td:nth-child(4) input').each(function (index) { grandtotal += parseint($(this).val()); }); $('#sub_total').val(grandtotal); $('#discount').val(calculatediscount(grandtotal)); } //separate function calculate discount function calculatediscount(amt){ if(!nan(amt)){ return amt*0.1;//10% disc }else return 0; }

Paginating in PostgreSQL: Knowing when to add next link -

i reading guide on postgresql pagination here . now, using seek method near bottom, looks this: select * news category_id = 1234 , (date, id) < (prev_date, prev_id) order date desc, id desc limit 10; after query runs, need determine if need add 'next' link page, doing grabbing count of rows date , id less date , id returned query. need next link infinite scroll plugin using. there better way determine if there rows left after query done? one simple way ask 11 rows, though you're showing 10. if 11th row present, there more data , need next link. this way don't have ask counts, run 1 query. again, if data doesn't change, getting count once , caching might more efficient. might bit error prone. the minus side retrieve maybe 10% more data, depending on table structure may or may not affect performance also.

How can I define a function in JavaScript? -

how define function? want define name1 in fb.api > name: name1, got error in console uncaught referenceerror: name1 not defined here javascript code: function share(platform) { var percent = $('.progress .percent').html().replace('%', ''); var names = $('.progress .names').html().touppercase().split(' &amp; '); var name1 = names[0]; var name2 = names[1]; var querystring = encodeuricomponent('name1='+name1+'&name2='+name2+'&percent='+percent+'&text='+text+'&lang='+lang); // var json = json.stringify(querystring); var share_params = base64_encode(querystring); var share_url = 'http://example?'; var url = 'https://www.facebook.com/sharer/sharer.php?u='+encodeuricomponent(share_url)+share_params; if(platform == 'whatsapp') { var share_title = name1+' + '+name2+' = '+percent+'%! ...

javascript - on load open model popup using bootstrap? -

model opening on click : <a href="#" data-remodal-target="test" >test</a> my model code : <div class="remodal" data-remodal-id="test"> <h3 class="modal-middle-heading">buy</h3> <p>please select desired gift city.</p> <form class="login-form"> <input type="text" placeholder="search city" /> </form> <button>search</button> </div> how can open model on load ? assuming using remodal , programmatically open model on onload event. this: window.onload = function () { $('[data-remodal-id=test]').remodal().open(); }; see demo

google analytics - Swift 2 / iOS 9 - libz.dylib not found -

i'm using external codes google in new swift 2.0 project required "libz.dylib" in earlier versions. after updating new xcode / new sdk. xcode unable import libz.dylib , throws errors undefined symbols architecture i386: "_deflate", referenced from: +[gaicompressionutil gai_databycompressingbytes:length:compressionlevel:mode:] in libgoogleanalyticsservices.a(gaicompressionutil.o) "_deflateend", referenced from: +[gaicompressionutil gai_databycompressingbytes:length:compressionlevel:mode:] in libgoogleanalyticsservices.a(gaicompressionutil.o) " deflateinit2 ", referenced from: +[gaicompressionutil gai_databycompressingbytes:length:compressionlevel:mode:] in libgoogleanalyticsservices.a(gaicompressionutil.o) "_inflate", referenced from: +[gaicompressionutil gai_databyinflatingbytes:length:israwdata:] in libgoogleanalyticsservices.a(gaicompressionutil.o) "_inflateend...

c - Client/server: running "nano editor" command from client -

i have client/ server program written c language, client can send , receive .txt documents server, wish open file received visualize command nano example, inside running process: something this: exec( nano, "file-to-open.txt") dont know how do this), can me? sorry english thank's lot try this: execlp("nano", "nano", "file.txt", null); the nano editor must in path, file.txt must in current directory of running client process, , importantly, whatever display editor going display on must accessible, terminal client run or appropriate x-windows display.

sml - Functors with multiple inputs in Standard ML -

high level question : how use functor s multiple arguments in sml? i've looked @ this , this , this , this (pdf) . of them seem conflict in terms of structure or functor definition syntax, , none of them show other unary functor . specifics : i'm trying write web server in standard ml (you can see effort here ), , have decided partition buffer , parser , tcpserver chunks. buffer , parser both straightforward structure s. idea tcpserver handles listening/accepting logic, allows user specify appropriate buffering/parsing strategy passing other 2 in. i've got like signature tcpserver = sig type sockaction type request val serve : int -> (request -> (inetsock.inet,socket.active socket.stream) socket.sock -> sockaction) -> 'u end functor server (buf : buffer) (par : parser) : tcpserver = struct type request = par.request datatype sockaction = close | leave_open local ... [eliding more definitions, including calls par.* , ...

sql server 2008 - Create failed for Login 'NT AUTHORITY\NETWORK SERVICE' ... User does not have permission to perform this action -

i following article http://www.codeproject.com/articles/674930/configuring-iis-asp-net-and-sql-server to setup database after have setup iis. works initially. can run web application successfully. after make changes access right in network service user, hit error , when go security > logins, see 3 users: builtin/users, sa , stevengai\user. now, went re-create "network service" (logins > new login), hit error below. should fix this? title: microsoft sql server management studio create failed login 'nt authority\network service'. (microsoft.sqlserver.smo) for help, click: http://go.microsoft.com/fwlink?prodname=microsoft+sql+server&prodver=12.0.2000.8+((sql14_rtm).140220-1752)&evtsrc=microsoft.sqlserver.management.smo.exceptiontemplates.failedoperationexceptiontext&evtid=create+login&linkid=20476 additional information: an exception occurred while executing transact-sql statement or batch. (microsoft.sqlserver.connectioninfo) ...

jquery - Closest selector affects more than one element -

i have asp.net application uses grid control 3 check box columns side-by-side. boxes in first column enabled; next 2 disabled. tried write jquery function enable adjoining check box in second column when user checks box in first column. here code: <script type="text/javascript"> $(document).ready(function() { $("[id$='firstcheckbox']").click(function() { var td = $("td", $(this).closest("tr")); if ($(this).is(":checked")) { $("input[type=checkbox]", td).prop("disabled", false); } else { $("input[type=checkbox]", td).prop("disabled", true).prop("checked", false); $(this).prop("disabled", false); } }); }); </script> this function works fine when have 2 checkbox column...

java - why does a string who clearly contains a piece of other, not result in a found hit using .contains()? -

this program attempts scan text file radio music log, , match songs directory of wav files. files named same convention: artist-title, ie: lukebryan-kickthedustup.wav. swap locations of title , artist using delimiter feature, allows easy comparison music log, formatted same way: title, artist. now, lets i'm searching term "lovingyoueasyza", loving easy zac brown band... when reaches file in directory assigned string "lovingyoueasyzacbrownband", ignores it, though contains string. you'll see i'm calling: if(searchme.contains(findme)) yet doesn't return hit. will return matches if findme string only contains song title, if part of artist title creeps string, stops working. why!? shorter titles critical able search artist name well, why can't search song title. i've tried using .trim() no avail. here sample output of when match found: searching term: "onehellofanamen" comparing to: "onehellofanamendbrantleyg...

c# - Sending data from one session to multiple session -

i facing problem in session,actually want send session information session suppose ex putting value in 1 text-box customer(like body weight) , want maintain session value other session. if understand question, example save information: this.session["weight"] = txtweight.text; then retrieve: string weight = this.session["weight"];

javascript - Aggregation working in console but not node? -

i totally new node.js (and javascript too), idea of anonymous functions, callbacks , likes totally foreign me , i'm still wrapping head around all... said please go easy on me! :) i've got following query i'm able use in mongo console without issues: db.warmod_events.aggregate({ $match: { $and: [ { "match.id": 1 }, { "match.event.player.name": 'xxx' }, { "match.event.event": 'round_stats' } ] } }, { $group: { _id : null, kills : { $sum: "$match.kills" } } }); from reading mongo node driver documentation (which seems little brief) came with, reason never returns anything, query result empty , i'm not sure why? var getkills = function (db, callback) { var collection = db.collection('warmod_events'); collection.aggregate( [ { $match: { and: [ {"match.matchid": 1}, {"match.event.player....

c++ - no matching function for call to sort() -

i'm teaching myself through programming: principles , practice using c++ (2nd edition) , i'm @ vectors section. can copy , paste code , still won't work. code follows. #include "iostream" #include "vector" #include "algorithm" using namespace std; int main() { cout << "please enter temperatures last 5 days\n"; vector<double> temperatures; for(double temp; cin >> temp;){ temperatures.push_back(temp); } double sum = 0; (double temp : temperatures){ sum += temp; } cout << "mean temperature " <<(sum / temperatures.size()) << endl; sort(temperatures); cout << "median temperature " << temperatures[temperatures.size()/2]; } help appreciated , explanation better. template function std::sort expects pair of iterators arguments (i.e. range ) and, optionally, comparator. there's no sort functi...

Error: could not find function "sqldf" using R to run SQL -

i faced question,there error message run sqldf package. load install.packages("sqldf") install.packages("rsqlite") install.packages("tcltk2") library("sqldf") library("rsqlite") library("tcltk2") final <-sqldf("select a.age, a.height inner join b on a.id = b.id ") error: not find function "sqldf" sessioninfo() r version 3.2.0 (2015-04-16) platform: x86_64-w64-mingw32/x64 (64-bit) running under: windows 7 x64 (build 7601) service pack 1 locale: [1] lc_collate=english_united states.1252 lc_ctype=english_united states.1252 [3] lc_monetary=english_united states.1252 lc_numeric=c [5] lc_time=english_united states.1252 attached base packages: [1] tcltk stats graphics grdevices utils datasets methods base other attached packages: [1] tcltk2_1.2-11 loaded via names...

How to sync 2 folders on 2 remote computers via Email? -

it quite weird question first look, in case if work company or organization strict rules communicate outer world, not funny. for example, it's usual when bank or enterprise company doesn't allow access inner resources outside, neither tunnel nor vpn possible, , way push information inner area email messages. email messages in such companies have several restrictions - e.g. "prohibited" or "dangerous" media content. but looks doable setup kind of email bridge, when both sides - e.g. worker's laptop @ home , desktop computer in office - exchange data, syncing dedicated folders sending email messages each other. such bridge may deal messages eligible according company's policies. i created such bridge , published in github: https://github.com/domax/email-bridge in short words how works: when application runs, first of scans ews inbox transport email, matching subject specific pattern and, if such emails found, extracts files attachm...

embedded - how to use accelerometer sensor to detect and match two toy cars' collision -

i using accelerometer sensor collect toy car's acceleration data tell whether bumps or collide toy car. idea checking whether there sharp change of acceleration data (for simplicity, considering x , y axis acceleration data since toy car running on smooth ground). when car started stop, there dramatic change acceleration data. need distinguish them. based on instinct, bumping cause sharp changed acceleration in short time, while engine starting cause smooth changed acceleration data. think should quite common question. new hand. i'd know whether there algorithm or method distinguish them. great if there implementation in c. lot. [update bumping situations] let me make question more specific. project involves several toy cars, can bump each other, or bump other things(such walls). need find out 2 cars collided each other. idea try compare 2 cars' acceleration data see if matched same pattern. divided project several steps: 1. detect bumps, need distinguish car bump...

python - Using the predict_proba() function of RandomForestClassifier in the safe and right way -

i'm using scikit-learn apply machine learning algorithm on datasets. need have probabilities of labels/classes instated of labels/classes themselves. instead of having spam/not spam labels of emails, wish have example: 0.78 probability given email spam. for such purpose, i'm using predict_proba() randomforestclassifier following: clf = randomforestclassifier(n_estimators=10, max_depth=none, min_samples_split=1, random_state=0) scores = cross_val_score(clf, x, y) print(scores.mean()) classifier = clf.fit(x,y) predictions = classifier.predict_proba(xtest) print(predictions) and got results: [ 0.4 0.6] [ 0.1 0.9] [ 0.2 0.8] [ 0.7 0.3] [ 0.3 0.7] [ 0.3 0.7] [ 0.7 0.3] [ 0.4 0.6] where second column class: spam. however, have 2 main issues results not confident. first issue results represent probabilities of labels without being affected size of data? second issue results show 1 digit not specific in cases 0.701 probability different 0.708. there w...

ruby on rails - Different views for different Devise users -

i have 3 devise models in application: users, publishers, , content creators. publishers inherit content creators, , content creators inherit users. i put custom index.html.erb file in each of these model's view folders want display instead of default user index.html.erb file, meaning, if publisher logs in, want them see index.hml.erb in views/publishers instead of 1 in posts. i have created separate controllers content creators , publishers have index action. routes file: devise_for :users devise_for :publishers , :controllers => { registrations: 'registrations' } devise_for :content_creators resources :posts 'tagged' => 'posts#tagged', :as => 'tagged' root "posts#index" how can configure routes file this? as user, in view can check by if current_user.publisher? <%= render 'view_for_publisher' %> elsif current_user.content_creator? <%= render 'view_for_content_creator...

ocaml - How to prevent warnings ocamlbuild/oasis warnings? -

i'm using ocaml, , oasis generate appropriate input ocamlbuild. very straightforward question here - every time go compile software ocaml setup.ml -build these warnings: w: cannot variable ext_obj w: cannot variable ext_lib w: cannot variable ext_dll w: cannot variable ocamlfind how these stop? edit i found of these defined in myocamlbuild.ml generated oasis. shell work with, zsh, different how ocaml source pulling it's informations on such things ocamlfind location , other variables. hence warnings. i'll see if can't figure out how fix warnings. works me: ocaml setup.ml -quiet -build but better fix warnings.

301 redirect from subdomain to domain using Plesk -

Image
i had subdomain m.example.com mobile users, have redesigned website responsive one. don't need subdomain. google has indexed many pages of subdomain on years , don't wanna lose traffic. want 301 redirect mobile traffic main website. e.g. m.example.com example.com m.example.com/unique-link example.com/unique-link i have windows server 2012 r2 plesk 12 running on it. far have tried learn plesk tutorials online none of them worked me, , don't wanna use server redirect asp.net website. please refer me guide or solution. thanks , regards it's better create domain alias m.example.com domain example.com. you need rename existed sub-domain m.example.com avoid name clash.

How to configure Apache to serve Drupal 6 Multisite configuration -

i trying setup apache serve drupal 6 multi-site configuration, cannot seem set up. in httpd.conf : documentroot "/users/kevinyoung/sites/drupal" <directory "/users/kevinyoung/sites/drupal"> options followsymlinks multiviews indexes multiviewsmatch allowoverride require granted </directory> directoryindex index.html index.php in httpd-vhosts.conf : <virtualhost *:80> documentroot "/users/kevinyoung/sites/drupal" errorlog "/private/var/log/apache2/error_log" customlog "/private/var/log/apache2/access_log" common </virtualhost> <virtualhost *:80> servername drupal.local serveralias *.drupal.local documentroot /users/kevinyoung/sites/drupal errorlog "/private/var/log/apache2/error_log" customlog "/private/var/log/apache2/access_log" common </virtualhost> in /etc/hosts : 127.0.0.1 drupal.local 127.0.0.1 <s...

ruby on rails - Strong params require works, but permit doesn't -

here's relevant rails code: def update project_id = update_params[:project] end def update_params params.require(:project).permit(:technology, :team_member) end and here's patch request (angular + coffeescript): restangular.all("projects/#{$scope.projectid}") .patch(team_member_delete: team_member.id, project: $scope.projectid) here's server sees: parameters: {"technology_delete"=>7, "project"=>"64", "id"=>"64"} and here's full error server log: started patch "/projects/64" ::1 @ 2015-06-12 17:23:40 -0400 processing projectscontroller#update html parameters: {"technology_delete"=>7, "project"=>"64", "id"=>"64"} completed 500 internal server error in 1ms (activerecord: 0.0ms) nomethoderror (undefined method `permit' "64":string): app/controllers/projects_controller.rb:73:in `update_params' ...