Posts

Showing posts from August, 2013

javascript - jQuery method that disallows input of certain chars -

i'm trying make jquery method delete wanted chars selected elements. for example: $("input").disallowchars(/\d/g);// should disallow input of non-digit elements in input elements this how thought it, doesn't seem work: $.fn.disallowchars = function(regexp){ this.keyup(function(){ var value = $(this).val(); value.replace(regexp, ""); $(this).val(value); }); return this; }; $("input").disallowchars(/\d/g); i'm total newbie @ this, how can make work. thanks you use string.fromcharcode() , keypress event instead: $.fn.disallowchars = function(regexp){ return this.keypress(function(e){ if(string.fromcharcode(e.which).match(regexp)) return false; }); }; demo but doesn't disable characters paste in input using mouse or paste keyboard shortcut. on modern browsers, use input event, or change keyup paste mouseup (ya mouseup, handle dropped text too): $.fn.disallowchars = function(...

php - MySQL: on resetting an auto_increment option -

this question has answer here: how reset auto_increment in mysql? 18 answers when creating mysql database, how can modify auto_increment option number can start last one? for example, have table created query. create table tablename (uid int(11) primary key auto_increment, ... ); if add data table consecutively, each data have own uid starting 1. if delete last data uid value of 3 , add new data, new 1 have uid value of 4, not 3. i want know how make new data have 3 uid. after deleting record have fire following query on database alter table tablename auto_increment = value; where value 'id' of deleted row. when next time add record take deleted rows id primary key

java - Unable to run JUnit test in IntelliJ -

i wanted start project using tdd. created test directory , later changed package integrated src direcotry. in both cases same error: class not found: "tests.objectstest" i tried different techniques of importing junit jar , none solved problem. tried rename test class gives no solutons whatsoever. it seems intellij or junit changes name of test class. shouldn't "objectstest.tests"? i using junit version 4.12 , latest intellij eap. edit project structure: project: -.idea -src -logic -objects -tests -test -test.java src , tests directories marked source , test. every package except test empty. on other pc intellij community edition works fine on eap there bug. unfortunatelly have use eap. test.java code: package test; import org.junit.test; public class test { @test public void cancreateinhabitant(){ } } check root directory of classes. must marked source (for java classes) or test (for java test classe...

hadoop - HDP on Windows Server 2012 R2 Single Node Installation Error -

i trying install hortonworks data platform (hdp) 2.2.6.0 hadoop on windows server 2012 r2, following quick start single node , failing. settings using virtual box windows server 2012 r2. java, python, etc. set. running administrator account. have run installer using cmd.exe admin. i un-checked "install ranger" installer. ignored part of installation (by un-checking lzo codec in installer): when deploying hdp lzo compression enabled, add following 3 files (in hdp windows installation zip) directory contains hdp windows installer , cluster properties file: - hadoop-lzo-0.4.19.2.2.6.0-2060 - gplcompression.dll - lzo2.dll the cluster proprieties txt can found here: https://pastebin.mozilla.org/8838912 . error install log, see error: create-user: creating user hadoop create-user: setting password hadoop hdp-ps failure: write-log : create-user failure: exception calling "setinfo" "0" hdp-ps failure: argument(s): "the password n...

c# - Marshal.StructureToPtr <-> PtrToStructure rounds DateTime field -

the structure public struct tick : iequatable<tick> { public datetime date; public decimal price; public int volume; public tick(datetime date, decimal price, int volume) { this.date = date; this.price = price; this.volume = volume; } public override bool equals(object obj) { var other = (tick)obj; return this.date == other.date && this.price == other.price && this.volume == other.volume; } public bool equals(tick other) { return this.date == other.date && this.price == other.price && this.volume == other.volume; } } is changed in test: [test] public void marshaldoesntroundsdatetime() { (int = 0; < 1000; i++) { var = new tick(datetime.now.addseconds(i), i, i); var now2 = now; var ticks = new tick[1]; unsafe { fixed (tick* ptr = &ticks[0...

excel - Hiding columns based upon cell value -

i not sure why code not working. intended recognise when press button (saying "hide1") , search through each column, row row, looking cells have value 1 once this, should change button "show 1". however, when run it, nothing happens. here macro excel: sub hide_columns() dim integer dim j integer = 3 j = 4 until = 26 until j = 54 activesheet.cells(i, j) if .value = 1 activesheet.columns(i).entirecolumn.hidden = true activesheet.shapes(application.caller).textframe.characters if .text = "show 1" .text = "hide 1" elseif .text = "hide 1" .text = "show 1" else msgbox ("vba has gone wrong.") exit sub end if end end if end j = j + 1 loop...

java - Using extended properties on Events in Office 365 REST API -

we in process of migrating application uses ews api newer office 365 rest api , because provides more flexible authorization options. current application uses extended properties store information (identifiers internal our applications) on event objects. the office 365 message api resource seems implement extended properties using singlevalueextendedproperties , multivalueextendedproperties fields. similar option available event resources ? extended properties in preview right now, , they're not implemented on events. working on that, stay tuned. since in preview, bear in mind things change. extended properties available on events .

add data on sql using javascript -

hello want add data on database in sql can't find how using javascript,i work on visual studio you can use javascript pass data .net mvc c# controller method var myviewmodel = {}; var team= {}; team.teamid = 1234; team.teamname = "test team"; myviewmodel.team= team; var teamplayerlist = []; var player1= {}; player1.id= "1"; player1.name = "patrick"; var player2 = {}; player2.id= "2"; player2.name = "padraig"; teamplayerlist.push(player1); teamplayerlist.push(player2 ); myviewmodel.teamplayerlist = teamplayerlist; $.ajax( { url: 'team/create', data: json.stringify({teamviewmodel : myviewmodel}), contenttype: 'application/json', datatype: 'json', type: 'post', success: function (data) { alert("success"); }, error: function () { alert('error'); } }); on backend in c# need controller class, , c# classes ho...

ruby - how to get started with Chef cookbook? -

i have followed below mentioned article configure apache, mysql, php using chef cookbook. http://gettingstartedwithchef.com/first-steps-with-chef.html my purpose write standalone application, needed setup mysql, apache, php etc. by following article, observed executing chef commands install stuffs & getting modifying configuration files manually. for example following command wrote respective ruby equivalent: rvm install ruby-2.1.2 ruby equivalent : `rvm install ruby-2.1.2` similar way, found alternatives shell commands & prepared ruby code. i not sure whether that's right approach. 2nd: how can custom functionality, let's bundling gemfile inside project repo or running rails migrations. how perform operations, please guide. there're many community created cookbooks many applications. can find many cookbooks on chef supermarket . in general, can install packet use packet manager way: supported install options can cookbook. pack...

linux kernel - register_kretprobe fails with a return value of -2 -

i have written kretprobe hook on randomize_stack_top() function mentioned in fs/binfmt_elf.c file. on loading lkm insmod register_kretprobe() call fails return value of -2. how go debugging/rectifying in order module started ? #include <linux/kernel.h> #include <linux/slab.h> #include <linux/module.h> #include <linux/kprobes.h> #include <linux/binfmts.h> #include <linux/elf.h> #include <linux/types.h> #include <linux/errno.h> #include <asm/uaccess.h> #include <asm/current.h> #include <asm/param.h> /* global variables */ int randomize_stack_retval; // randomize_stack_top() kretprobe specific declarations static char stack_name[name_max] = "randomize_stack_top"; static int randomize_stack_top_entry_handler(struct kretprobe_instance *ri, struct pt_regs *regs) { return 0; } static int randomize_stack_top_ret_handler(struct kretprobe_instance *ri, struct pt_regs *regs) { randomize_stack_retval = ...

r - Error in sample(1:17260(E), 20) : attempt to apply non-function -

it's possibly stupid question, i'm getting error message simple piece of code in r: s20_1 = e[sample(1:17260(e), 20),] the error message is: error in sample(1:17260(e), 20) : attempt apply non-function e dataframe 17260 rows. code based on 1 found here: sample random rows in dataframe . any appreciated. cheers! the error message tells wrong. try change line this: s20_1 = e[sample(nrow(e), 20),] or, since know size of e s20_1 = e[sample(1:17260, 20),] though recommend first method of course. hope helps.

objective c - Mac OSX open With function not working -

i want open image file in app using open function not opening here xcode settings xcode plist settings and here code of appdelegate app delegate code @property (assign) nsmutablearray *_allfiles ; - (void)applicationdidfinishlaunching:(nsnotification *)anotification{ if (_allfiles.count >0) { [self openfiles:[_allfiles objectatindex:0]]; } self.homeviewcontroller = [[homeviewcontroller alloc] initwithnibname:@"homeviewcontroller" bundle:nil]; [self.window.contentview addsubview:self.homeviewcontroller.view]; self.homeviewcontroller.view.frame = ((nsview*)self.window.contentview).bounds; } - (bool)application:(nsapplication *)theapplication openfile:(nsstring *)filename { [self application:theapplication openfiles:[nsarray arraywithobject:filename]]; [self.homeviewcontroller showalert:filename]; nslog(@"====%@",filename); return yes; } - (void)application:(nsapplication *)sender openfiles:(nsarray *)fi...

c++ - multi item replacing in cuda thrust -

i have device vector a,b,c following. a = [1,1,3,3,3,4,4,5,5] b = [1,3,5] c = [2,8,6] so want replace each of b in corresponding element in c. eg: 1 replaced 2, 3 replaced 8, 5 replaced 6 so following result result = [2,2,8,8,8,4,4,6,6] how achieve in cuda thrust or way of implementing in cuda c++. found thrust::replace replaces single element @ once. since need replace huge amount of data, becomes bottleneck replace 1 @ time. this can done efficiently first building map , applying custom functor queries map. the example code following steps: get largest element of c . assumes data sorted. create map vector of size largest_element . copy new values @ position of old ones. apply mapper functor a . functor reads new_value map vector. if new_value not 0 , value in a replaced new value. assumes c never contain 0 . if can contain 0 , must use condition, e.g. initialize map vector -1 , check if new_value != -1 #include <thrust/device_vector....

html - How do I create this effect hover? -

i have site: link code html: <ul class="add-to-links"> <li><a href="http://www.altradona.ro/wishlist/index/add/product/156/" class="link-wishlist" data-id="156"><span class="compara">++</span></a></li> <li><a href="http://www.altradona.ro/catalog/product_compare/add/product/156/uenc/ahr0cdovl3d3dy5hbhryywrvbmeucm8v/" class="link-compare" data-id="156"><span class="favorit">kjk</span></a></li> </ul> code css: .compara { width:42px; background:url("/media/wysiwyg/compare.png"); color:transparent !important; } .compara:hover { background:url("/media/wysiwyg/compare-hover.png"); } i tried create effect hover unfortunately not working. classic example ... missed in writing code? pictures on server. can tell me please should changed? thanks in advance! ...

embedded - How to link static library into specific section? -

i writing code embedded platform. need link 3rd party sdk. however, symbols sdk should go specific section (not .text ). possible that? i use gnu-based toolchain xtensa-lx106 processor , build esp8266 chip. to have modify linker script you're using. you'll find in makefile in line links final binary. linker script file passed via -t option. once have this, open in text editor , search section directive. you'll find group called .text in lists sections should go final text segment. you can add code-section name of sdk list. can use wildcards if sdk has multiple sections common prefix (that happends quite lot). the same thing can done using .data group , .bss group if nessesary. after these modifications can re-link executable , sections sdk library should go straight .text , .data groups. if want to, can create new groups in memory declaration @ top of linker file. gives direct control on exact address linker use. can redirect sdk library s...

css - background-position percentage not working -

everywhere read says should working fine, reason it's not. this fix else's issue fixing doesn't matter me, want know why. problem on .br .bg-image . know i'm trying use calc() using simple background-position: 50% doesn't work either. http://jsfiddle.net/ulaa9fnu/2/ html { height: 100%; width: 100%; } body { margin: 0px; height: 100%; width: 100%; overflow: hidden; } .bg-image { height: 600px; width: 800px; background-image: url('http://media1.santabanta.com/full1/outdoors/landscapes/landscapes-267a.jpg'); background-size: 100%; background-repeat: no-repeat; } .relative { position: relative; } .containeroverlay { background-color: rgba(0, 0, 0, 0.6); height: 100%; width: 100%; } .framesizer { height: 340px; width: 300px; overflow: hidden; position: absolute; } .frame { background-image: url('http://i.imgur.com/4acixsd.png'); background-repeat: no-repeat; bac...

make an application ask for password applescript -

i'm trying write applescript code makes firefox ask me password when open it. got, somehow doesn't work: on activate display dialog "please enter password" buttons {"cancel", "okay"} default answer "" default button 2 set x text returned if x "password" tell application "firefox" activate reopen end tell else "please try again" end if end activate i need know save script, when correct. lot! there error in set x text returned . needs know dialog you're referring to. see below. on activate set passwordrequest display dialog "please enter password" buttons {"cancel", "okay"} default answer "" default button 2 set x text returned of passwordrequest if x "password" tell application "firefox" activate reopen end tell else "please try again" end if end activate

sql server - Replacing SQL replication -

we looking replace sql server replication. today we've got several version on sql installations because sql replication not support working different sql versions (2005 , 2008 example), instead of having several installation of sql version (2005,2008,2012 etc...), looking install single version on server (let's 2014) , using version replicate between our clients (2005+). today using transnational , merge replication @ same time each database. i know: is there way make different version replicate each other? is there , tool can replace replication? sql server 2014 supports replication sql server 2008 , on. https://msdn.microsoft.com/en-us/library/ms143550(v=sql.120).aspx if use sql server 2012 backend, sql server 2005, 2008 , 2012 clients supported.

java - what construct makes PRIVATE serialversionUID useful? -

i have clue of serialversionuid for, , in far don't can up. can private variable that's not used inside class. there construct or behind that? there other examples of private variables / methods not used inside same class? can make them while still doing else make useful? how can access private variables myself class without creating getters?

c# - Generating a static constructor with all fields in Xamarin studio -

Image
pressing command+i on mac osx in xamarin studio gives me choice create constructor fields so: however, don't see way make own custom code generators these. xamarin studio has way generate code "code snippets", however, can't find way parameter list using code snippets. i looking way insert template c# class automatically lists local fields in order make static constructor. know of way?

email - Outlook if mso conditions -

i wonder possible specify more 1 exact versions of outlook in 1 if mso condition? like //pseudo if mso9 or mso10 or mso11 apply these styles end if if is, please can give link syntax explanation? i believe approach work. <!--[if (mso 9)|(mso 10)|(mso 11)]> here link: https://litmus.com/community/code/396-conditional-code-for-outlook

PEP 0492 - Python 3.5 async keyword -

pep 0492 adds async keyword python 3.5. how python benefit use of operator? example given coroutine async def read_data(db): data = await db.fetch('select ...') according docs achieves suspend[ing] execution of read_data coroutine until db.fetch awaitable completes , returns result data. does async keyword involve creation of new threads or perhaps use of existing reserved async thread? in event async use reserved thread, single shared thread each in own? no, co-routines not involve kind of threads. co-routines allow cooperative multi-tasking in each co-routine yields control voluntarily. threads on other hand switch between units @ arbitrary points. up python 3.4, possible write co-routines using generators ; using yield or yield from expressions in function body create generator object instead, code executed when iterate on generator. additional event loop libraries (such asyncio ) write co-routines signal event loop going busy (waiti...

java - Adding Two Mat of type 32FC4 in OpenCV for Android -

to reduce noise in image, trying average of 10 images. mat imgmain = new mat(n_height, n_width, cvtype.cv_32fc4); mat imgfin = new mat(n_height, n_width, cvtype.cv_32fc4); for(int i=1; <= 10; i++) { //crop image image.recycle(); image = null; image = bitmapfactory.decodefile("/storage/sdcard0/dcim/a" + string.valueof(i) + ".jpg"); pimage = bitmap.createbitmap(image, leftoff1, topoff1, n_width, n_height); utils.bitmaptomat(pimage, imgmain); scaleadd(imgmain, 0.1, imgfin, imgfin); } running application, following msg: caused by: cvexception [org.opencv.core.cvexception: cv::exception: /hdd2/buildbot/slaves/slave_ardbeg1/50-sdk/opencv/modules/core/src/matmul.cpp:2079: error: (-215) src1.type() == src2.type() in function void cv::scaleadd(cv::inputarray, double, cv::inputarray, cv::outputarray) ] @ org.opencv.core.core.scaleadd_0(native method) @ org.opencv.core.core.scaleadd(core....

android - plugin with id not working studio -

Image
i trying add google play services library in android studio.i have added google play services in build.gradle. but working me.i have referred many post regarding this.but doesn't solved problem. below posted build.gradle code have added google play services. build.gradle: buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:1.2.3' // note: not place application dependencies here; belong // in individual module build.gradle files } apply plugin : 'android' dependencies { compile 'com.google.android.gms:play-services:4.0.30' } allprojects { repositories { jcenter() } } } while adding google play services in dependencies @ gradle compile com.google.android.gms:play-services:4.0.30 . getting error:plugin id not working. anyone can me this.thank you. the build.gradle have posted seems...

c - print longest input line.(example in K&R(2e)(section 1.9)) -

when executing program (in ubuntu) , enter input ($ represents eof(ctrl+d)) :- giujb bjb $$ it not work input giujb bjb $$$ it works. i think should require give eof twice (in program). can explain why requires give eof 3 times? my code #include<stdio.h> #define maxlength 1000 char line[maxlength]; char longest[maxlength]; int getlength(); void copy(); int main() { int max=0,leng=0; while((leng=getlength())>0) { if(leng>max) {max=leng; copy(); } } if(max>0) printf("\n%s",longest); return 0; } int getlength() { char ch; int i; for(i=0;(i<(maxlength-1)) && ((ch=getchar())!= eof) && (ch!='\n');++i) {line[i]=ch; printf("%d",i); } if(ch=='\n') {line[i]=ch; ++i; } line[i]='\0'; printf("bye"); return i; } void copy() { int i=0; while((longest[i]=line[i])!='\0') ++i; } ...

r - Why is rbindXts's dup parameter not exposed? -

i want rbind bunch of xts objects, should not overlap, if overlap don't want add row twice: choose 1 or other. (i duplicated(index(x)) , delete them.) (example code showing problem, , desired output, below). poking around, found c source has dup parameter; defaults false , when set true behaviour wanted: .external("rbindxts", dup = t, x,y,z, package = "xts") is there reason wasn't exposed in rbind() interface? (by "good" reason mean along lines of known buggy, or bad performance on large data, or that.) or more practical reason, such no-one has had time write tests , documentation yet? update: went code, , found wasn't using rbind.xts , instead do.call.rbind() function described here: https://stackoverflow.com/a/9729804/841830 due memory issue in rbind.xts. (i found own (!) question 3 years ago, describes how delete duplicates: how remove row zoo/xts object, given timestamp ) update #2: do.call.rbind can modifi...

oracle11g - Convert a materialized view into a table in Oracle 11g? -

i running oracle 11g , sql developer on client. have materialized view convert ordinary table. how can done? the way have come create table same structure, export data mv , import table. have manually create fields (30+) table match in mv. figured there must better solution? simple drop materialized view .. preserve table it

php - Update minimum values based on another value - MySql -

i have set of information, i'm exploding id,code , number. list ($id,$code,$num) = explode("~",$data); i need update mysql based on unique code minimum of num for suppose first 3 requests looks like id = 9267399 code = 5d:148 num = 64 id = 9267398 code = 5d:186 num = 71 id = 9267397 code = 5d:122 num = 93 then 4th,5th requests has duplicate code 5d:148 different id's , num's. id = 9267402 code = 5d:148 num = 22 id = 9267563 code = 5d:148 num = 5 now need find min(num) duplicate code , update record mysql. queries should like $sql = "update table set id = '9267398', num = '71' code = '5d:186' "; $sql = "update table set id = '9267397', num = '93' code = '5d:122' "; $sql = "update table set id = '9267563', num = '5' code = '5d:148' "; here 5d:148 has 3 requests in min(num) 5. i have tried finding duplicate code $temp = array(); for...

Why can't I change vim syntax highlighting via local vimrc file? -

i trying customize vim highlighting placing additional instructions local config $project/.lvimrc , managed https://github.com/embear/vim-localvimrc plugin. unfortunately, seems commands like syntax match operator "\<myop\>" located in .lvimrc ignored silently vim. typing command in command line works expected. other commands .lvimrc work. may stop vim interpreting local highlighting correctly? it problem loading order, i.e., .lvimrc loaded, filetype syntax loaded , overwrites .lvimrc syntax commands. check including echom statements on both files. also notice local vimrc not standard way of customizing syntax highlight. vim faq 24.11 : you should not modify syntax files supplied vim add extensions. when install next version of vim, lose changes. instead should create file under ~/.vim/after/syntax directory same name original syntax file , add additions file. more information, read |mysyntaxfile-add| |'runtimepath'| ...

mysql - Access database outside of vagrant box as user -

Image
i'm using homestead , have created multiple databases. wanted use new username/password combination each database create. did this create database testdb character set utf8; create user 'testuser'@'localhost' identified 'testpassword'; grant privileges on testdb.* 'testuser'@'localhost'; now, when access vagrant box via vagrant ssh , use command $ mysql -utestuser -ptestpassword i can connect database. however, when trying access database outside (like via client (sequel pro)) can't connect database created user. i can, however, connect "base account" homestead:secret. homestead user can access every database, wanted use newly created user. how achieve this? the error comes sequel pro access denied user 'testuser'@'10.0.2.2' (using password: yes) this db connection config you must grant access outside user: create user 'testuser'@'10.0.2.2' identified 'tes...

Javascript Regular Expressions in RegEx -

here's problem. want replace "document 1", "document 12" strings in text hypertext link : <a onclick="gotodocument(document7);">document 7</a> i tried code : var reg=new regexp("((document )[a-za-z0-9/.]+)+\s(\w+)","gi"); var chaine= *thetext*; var socle_contenu = chaine.replace(reg, "<a onclick=\"alleraudocument('$1');\"'>" + '$1' + "</a>"); the result : <a onclick="gotodocument(document 7);">document 7</a> as can see, problem space in onclick function. i tried delete space want keep space human reader. couldn't make it. i tried "document " , number in $1 , $2, in order contacatenate 2 variables need. tried : var reg=new regexp("((document )\s(\w+))+", "gi"); but doesn't work ! can tell me how setup regular expression ? thanks ! you use callback function replace...

c# - How to Unit test ViewModel with async initialization in WPF -

i have created sample wpf mvvm project want unit test. viewmodels load data asynchronously in constructor: public class customeroverviewviewmodel { public customeroverviewviewmodel() { var t = loadfullcustomerlistasync(); } public async task loadfullcustomerlistasync() { list<bl_acc> customers = await task.run(() => // query db); } } in wpf, works charm. when want create unit test viewmodel, create object calling default constructor: [testmethod] public void test() { customeroverviewviewmodel = new customeroverviewviewmodel(); // test } however, unit test has no way of knowing when async method finished. can fixed using constructor initialization or should use different pattern? edit the unit tests don't need async loaded information, need instance of class test methods. seems lot of work use initialization method unit tests. all unit tests succeed throw error multiple threads try access same context (whi...

Adding Multiple jQuery UI Slider Values -

i using jquery ui slider - range fixed minimum. need take value 1 slider , add slider value , display result in text box below. the sliders setup with: $(function() { $( "#slider-range-food" ).slider({ range: "min", value: 50, min: 0, max: 500, slide: function( event, ui1 ) { $( "#amountfood" ).val( ui1.value ); total($( "#amountrent" ),ui1); } }); $( "#slider-range-rent" ).slider({ range: "min", value: 50, min: 0, max: 500, slide: function( event, ui2 ) { $( "#amountrent" ).val( ui2.value ); total($( "#amountfood" ),ui2); } }); $( "#amountfood" ).val( $( "#slider-range-food" ).slider( "value" ) ); $( "#amountrent" ).val( $( "#slider-range-rent" ).slider( "value" ) ); }); the function total values ...

javascript - How to call destroy on disabled jquery widget? -

used libraries: jquery-ui-1.9.1 , jquery-1.8.2 i have 1 widget function called destroy $.widget("my.customwidget", { options: { }, _destroy: function () { var self = this; this._super(); //some usefull functionality }, //some other declarations }); if widget disabled, due code in jquery-ui destroy method not called (code jquery-ui): function handlerproxy() { // allow widgets customize disabled handling // - disabled array instead of boolean // - disabled class method disabling individual parts if ( instance.options.disabled === true || $( ).hasclass( "ui-state-disabled" ) ) { return; } return ( typeof handler === "string" ? instance[ handler ] : handler ) .apply( instance, arguments ); } this handleproxy inside of _on function. callstack looks so: when element widget removed, $.cleandata called. cleandata calls $( elem ).trig...

PHPMailer goes to spam -

i have problem phpmailer. messages go spam on o2 , hotmail. on other servers works well. here code: require_once('class.phpmailer.php'); require_once('class.smtp.php'); $mail = new phpmailer(); $mail->from = "abc@mydomain.pl"; $mail->fromname = "xyz"; $mail->addreplyto('abc@mydomain.pl', 'xyz'); $mail->charset = 'utf-8'; $mail->host = "mail.mydomain.pl"; $mail->mailer = "smtp"; $mail->smtpauth = true; $mail->username = "abc@mydomain.pl"; $mail->password = "password"; $mail->port = 25; $mail->subject = "subject"; $mail->body = "message"; $mail->addaddress ('xxx@yyy.pl','user'); $mail->send(); can help? apart possibility server may blacklisted reason, common cause emails landing in spam servers encountered from-address , server's name not match. consider from-address someone@mydomain....

asp.net - How to make screen size 100 % even we minimize the screen in vb.net -

i have 1 statistical report displaying data month wise , year wise in bar graph. report ssrs used display data. count displaying when mouse on each bar of the graph. when screen size of report full window size of monitor (i.e. 100%), data correctly displaying when mouse on cursor on each bar of graph. my problem when minimize size of report screen data not showing correctly in each bar of graph. wrong value displayed.

ibm mobilefirst - What files will get deployed and where can I find the files in worklight console? -

we developing mobile app using ibm mobilefirst platform. we compile code using command line tool command 'mfp build' , deploy using 'mfp deploy', , able preview application url mentioned below: http://localhost:xxxxx/worklightconsole/index.html after doing 'mfp build' these 6 files: mobapp.war mobappadapter.adapter dashboard-all.wlapp dashboard-common.wlapp dashboard-desktopbrowser-1.0.wlapp dashboard-ipad-1.2.wlapp questions: where can find 6 files in 'worklight console'? (or) which other url have refer verify whether files have been deployed correctly or not? because when type in 'mfp build' deploys files not sure getting deployed. don't have installed instead 'liberty' used our knowledge the mobilefirst platform cli tool contains embedded websphere liberty profile server inside of it. server , internal database (during development time(!)), artifacts have mentioned deployed to. you create proj...

Azure Stream Analytics SU % Utilization keeps increasing -

i using stream analytics simple data pass-through scenario. job has multiple sql server outputs (three) , 1 eventhub input. event count small. problem su % utilization keeps increasing. temporary solution restart job once or twice day. am doing wrong? below sample of query. tried change queries use tumblingwindow, got same result. select field_1, field_2, field_3, field_4, field_5 [out-alias-1] [in-alias] field_1 'event1:%' or field_1 'event2:%'; select field_1, field_3, field_6, field_7, field_8 [out-alias-2] [in-alias] field_1 'event3:%' or field_1 'event4:%'; select field_1, field_3, field_4, field_9, field_10 [out-alias-3] [in-alias] field_1 not 'event1:%' , field_1 not 'event2:%' , field_1 not 'event3:%' , field_1 not 'event4:%'; you may observe baseline su % utilization few or without input events, because system consumes amount of resource. amount of resource consumed system may fluctuate on t...

function - How to grab number after a word or symbol in PHP? -

i want grab text php example, there data "the apple=10" , want grab only numbers data looks that. mean, number's place after 'equals'. and problem number source can 2 or 3 characters or on other word inconstant. please me solve them :) $string = "apple=10 | orange=3 | banana=7"; $elements = explode("|", $string); $values = array(); foreach($elements $element) { $element = trim($element); $val_array = explode("=", $element); $values[$val_array[0]] = $val_array[1]; } var_dump($values); output: array(3) { ["apple"]=> string(2) "10" ["orange"]=> string(1) "3" ["banana"]=> string(1) "7" } hope thats how need :)

c# - How to change selected row color in DataGrid Mahapp -

Image
i'm trying change color of selected row can't result. i've tryed this: <datagrid style="{staticresource azuredatagrid}"> but change can see first column colored azure. when select row, becomes white , can't see values on row selected. i'm new framework theme wpf , documentation isn't accurate. can me? changing selected row brush possible latest alpha version of mahapps.metro (1.1.3.x or later 1.2.0) here example main demo <datagrid x:name="metrodatagrid" grid.column="1" grid.row="1" renderoptions.cleartypehint="enabled" textoptions.textformattingmode="display" headersvisibility="all" margin="5" selectionunit="fullrow" itemssource="{binding path=albums}" autogeneratecolumns="false"> <datagrid.columns> ...

Split string expression with multiple parenthesis (C#) -

i have below string , want split in such way both parameters of function fngetdate separated. function: "fngetdate('d',-1+ cint(cbool(datepart('w',date())<=2)) + cint(cbool(datepart('w',date())=2)))" desired output (after split): [0] fngetdate( [1] 'd' [2] -1+ cint(cbool(datepart('w',date())<=2)) + cint(cbool(datepart('w',date())=2)) according comment, counting number of opening , closing parenthesis ok you. this example works me: string str = "fngetdate('d',-1+ cint(cbool(datepart('w',date())<=2)) + cint(cbool(datepart('w',date())=2)))"; int parlevel = 0; list<string> arguments = new list<string>(); string currentstring = string.empty; foreach (char t in str) { switch (t) { case '(': if (t == '(') parlevel++; currentstring += t; if (parlevel == 1) { a...

c# - Check if the date time slots are available in a week -

Image
i have scenario user can create , add rule. rule assigned time slot in week execution. suppose second rule added, can not assigned between time slot of first one. note: have implement single week i.e., monday sunday. no second week exists. single week logic run every week entire year. thorough attempt, if 1 rule running tuesday friday able assign time slots of merely monday or saturday sunday rule not able book/assign time slot saturday monday (i.e., starting point of week). following attempt far: foreach (var item in rules) { datetime startdatewanttobook = convert.todatetime((datetime.today.month + "/" + startday + "/" + datetime.today.year) + " " + startdaytime); datetime enddatewanttobook = convert.todatetime((datetime.today.month + "/" + endday + "/" + datetime.today.year) + " " + enddaytime); datetime startdatealreadybooked = convert.todatetime((datetime.today.month + "/" + item.startday...

fosuserbundle - Symfony impersonation - separate firewalls and separate user providers -

i have symfony application 2 firewalls, 1 admins , 1 normal users. admin: provider: admin # etc main_site: form_login: provider: fos_userbundle csrf_provider: form.csrf_provider i'd admin users able impersonate normal users. how can this, given they're using separate firewalls , separate user providers? there several things had work. context key: described here , had give both firewalls same context. without this, admins taken login page when trying switch users. config on both firewalls: had add basic switch_user configuration keys both firewalls: switch_user: role: role_admin if put config on main_site firewall, admins got access denied message when exiting impersonation , going admin page. (for example, route /admin/dashboard?_switch_user=_exit give 403). provider key on main_site 's config: main_site: switch_user: role: role_admin provider: fos_userbundle without this, got err...

R and latex: Tabulating ranked data frame -

i generated data frame gives me top n variables , associated values melting original data frame , applying ranking function. ranked data frame looks this: sysid variable value class1 class2 1 1 s.noun_noun 0.13121019 open open 2 1 s.verb_verb 0.12611465 open open 3 1 s.det_det 0.04076433 closed closed 4 1 s.verb_noun 0.03821656 open open 5 1 s.prep_det 0.03312102 closed closed 6 2 s.noun_noun 0.19791667 open open 7 2 s.verb_verb 0.13750000 open open 8 2 s.det_det 0.04375000 closed closed 9 2 s.prn_prn 0.03958333 closed closed 10 2 s.coord_prep 0.03750000 closed closed 11 3 s.noun_noun 0.16730769 open open 12 3 s.verb_verb 0.14615385 open open 13 3 s.det_det 0.05384615 closed closed 14 3 s.coord_prep 0.04423077 closed closed 15 3 s.prep_prep 0.04230769 closed closed now i'm trying pr...

scala - Can't unmarshall json HttpEntity with spray-json -

i trying run simple example documentation without changes: import spray.json.defaultjsonprotocol import spray.httpx.unmarshalling._ import spray.httpx.marshalling._ import spray.http._ import httpcharsets._ import mediatypes._ case class person(name: string, firstname: string, age: int) object myjsonprotocol extends defaultjsonprotocol { implicit val personformat = jsonformat3(person) } import myjsonprotocol._ import spray.httpx.sprayjsonsupport._ import spray.util._ val bob = person("bob", "parr", 32) val body = httpentity( contenttype = contenttype(`application/json`, `utf-8`), string = """|{ | "name": "bob", | "firstname": "parr", | "age": 32 |}""".stripmarginwithnewline("\n") ) marshal(bob) body.as[person] and fails on last line ("body.as[person]") following error , stacktrace: exception in thread "main" java.lang.nosuchm...

c++ - How to get all values in QTableView? -

i know if want take index , data of selected values in tableview like; qmodelindexlist _indexes = ui->tvdatabaseimages->selectionmodel()->selectedrows(); foreach (qmodelindex index, _indexes) { qdebug() << "tableview index = " << qstring::number(index.row()); qdebug() << "tableview index value = " << index.data().toint(); } however want tableview indexlist without selection. possible? if yes, how can ? using model behind qtableview : model=myview.model() ( int col = 0; col < model.columncount(); ++col ) { for( int row = 0; row < model.rowcount(); ++row ) { index = model.index( row, col ); qdebug() << index.data(); } } oddly, didn't find more straightforward.

javascript - `ref` issue with react-bootstrap elements -

i trying get value selected dropdownbutton ref='roletype', whatever tried fails. <dropdownbutton ref='roletype' bsstyle='link' title='role' key='1' bssize='xsmall'> {_items} </dropdownbutton> i have tried followings: react.finddomnode(this.refs.roletype) this.refs.roletype.getdomnode() note: not sure if important or not. dropdownbutton inside panel , inside section of div . you should use onselect prop of dropdownbutton , noted on docs . var dropdownbutton = reactbootstrap.dropdownbutton; var menuitem = reactbootstrap.menuitem; var hello = react.createclass ({ getinitialstate() { return { key: null } }, onselect(key) { this.setstate({ key: key }); }, render() { var selected = this.state.key ? <p>selected: {this.state.key}</p> : ''; return (<div> <dropdownbutton bsstyle="primary" tit...

MySQL Optimization - Need advices -

i have centos 7 vm 32 gb ram (4 cores/8 threads) 3.4 ghz+ ran mysqltuner script, , followed recommendations gave, it's still slow my current config in my.cnf file is: [mysqld] local-infile=0 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock symbolic-links=0 key_buffer = 32m max_allowed_packet = 268435456 thread_stack = 192k thread_cache_size = 384 key_buffer_size=32g max_connections = 1200 max_user_connections=1000 table_open_cache=3000 table_open_cache=5000 table_definition_cache=2048 sort_buffer_size=32m join_buffer_size = 32m read_buffer_size=32m wait_timeout=20 read_rnd_buffer_size=786432 bulk_insert_buffer_size = 8m myisam_sort_buffer_size=64m query_cache_size=128m query_cache_limit=8m query_cache_type = 1 query_prealloc_size = 262144 query_alloc_block_size = 65535 transaction_alloc_block_size = 8192 transaction_prealloc_size = 4096 max_write_lock_count = 8 tmp_table_size=320m thread_concurrency=32 innodb_lock_wait_timeout = 600 innodb...