Posts

Showing posts from September, 2013

java - the controller is saving the image but the image cannot be found in the desired folder ..is my controller correct -

@controller @requestmapping(value = "/admin/room") public class roomcontroller { @autowired private roomservice roomservice; @requestmapping(method = requestmethod.get) public string index(modelmap map) throws sqlexception { map.addattribute("room", roomservice.getall()); return "admin/room/index"; } @requestmapping(value = "/addroom", method = requestmethod.get) public string addroom() throws sqlexception { return "admin/room/addroom"; } @requestmapping(value = "/editroom/{ro_id}", method = requestmethod.get) public modelandview edit(@pathvariable("ro_id") int ro_id) throws sqlexception { modelandview mv = new modelandview("admin/room/editroom"); mv.addobject("room", roomservice.getbyid(ro_id)); return mv; } @requestmapping(value = "/deleteroom/{ro_id}", method = requestmethod.get) public string delete(@pathvariable("ro_id") int ro_id) t

asp.net mvc - How to get html of div in controller without post method in mvc -

i new user of mvc. please let me know how access div content inside controller. working on selectpdf. can not use post method using ajax. is there way achieve controller. thanks a div html, presentation user. controller logic called , data pushed view (html) trough objects. you cannot make div inside controller! otherwise, can push data controller view , in view show data in html div!

jquery - show the form response in modal window using Magnific Popup -

i trying submit form using ajax , show response on modal window using magnific popup. have posted code below. in regarding make work have click "send" button "popup" button. playing last 3 hours , couldn't make work. can please see doing wrong? want click send button , see php responses on modal popup window. <html> <head> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> <script src="https://rawgit.com/dimsemenov/magnific-popup/master/dist/jquery.magnific-popup.js"></script> <script type="text/javascript"> jquery(document).ready(function() { $(document).on('click', '.popup-modal', function (e) { $( "#indexform" ).on( "submit", function( event ) { event.preventdefault(); var formdata = $(this).serialize(); $.ajax({

ios - Type of Generic -

can somehow check type of t . want check type array or else. func request<t: mappable>(completionhandler: (result<t>) -> void) { } one way overload method, so: private func request<t: mappable>(isarray: bool, completionhandler: (result<t>) -> void) { if isarray { print("is array") } else { print("is not array") } } func request<t>(completionhandler: (result<array<t>>) -> void) { request(isarray: true, completionhandler: completionhandler) } func request<t: mappable>(completionhandler: (result<t>) -> void) { request(isarray: false, completionhandler: completionhandler) } i'm assuming somewhere have defined: extension array: mappable {}

How to filter the JSON data using AngularJS? -

i have 3 dropdown boxes. need filter data , need displayed in table based on checkbox selection(either single checkbox or two checkboxes or three checkboxes ). i have done following, if observe clearly, not able filter data using angularjs . like: a. should work individual checkbox selection : means if select single checkbox either name or description or field4 , respective matched filtered data should displayed in table, otherwise shouldn't displayed data(i.e if doesn't match our checkbox selection means won't display data) b. should work multiple(two) checkbox selection : means if select multiple checkboxes either one name , one description or one description , one field4 or one field4 , one name , respective matched filtered data should displayed in table, otherwise shouldn't displayed data(i.e if doesn't match our checkbox selection means won't display data) c. should work multiple(three) checkbox selection : means if select 3 chec

Make the browser wait for api response / http call response in angularjs -

i tried $q service follows browser still not waiting response. spent day figure out solution, tried $timeout . login.controller("loginctrl", ['$scope', '$rootscope', '$filter', '$window', '$http', 'apiservice', 'localstorageservice', 'doalert', '$translate', '$q', '$timeout', function ($scope, $rootscope, $filter, $window, $http, apiservice, localstorageservice, doalert, $translate, $q, $timeout) { $scope.islogout = true; $(window).unload(function () { $rootscope.$broadcast('onunload'); }); $scope.$on('onunload', function (e) { var deferred = $q.defer(); $http.get(url). success(function (data, status, headers, config) { deferred.resolve(data); }). error(function (data, status, headers, config) { deferred.reject(status);

java - ANTLR doesn't give correct output tokens for Scala Grammar -

Image
blockquote i new scala , trying parse scala files use of scala grammar , antlr. below code scala grammar got git hub link: https://github.com/antlr/grammars-v4/tree/master/scala there chances of repo moved pasting scala grammar code here: grammar scala; literal : '-'? integerliteral | '-'? floatingpointliteral | booleanliteral | characterliteral | stringliteral | symbolliteral | 'null' ; qualid : id ('.' id)* ; ids : id (',' id)* ; stableid : (id | (id '.')? 'this') '.' id | (id '.')? 'super' classqualifier? '.' id ; classqualifier : '[' id ']' ; type : functionargtypes '=>' type | infixtype existentialclause? ; functionargtypes : infixtype | '

angularjs - IONIC App-Horizontal, scrollable thumbnail slider -

there list of orders. when click on >(right chevron detail option), redirects me order detail page. order detail page may have list of items ordered 1 person. each item has camera option click picture. say there 2 items each camera option, clicking 2 pictures- 1 each item. and, want display both of them in div scrollable thumbnail slider without visiting phone's storage space images. i'm trying display images thumbnails, owl carousal using http://ngcordova.com/docs/plugins/camera/ , need display thumbnail gallery in div, immidiately after taking picture. controller code being used same in above mentioned link document. .controller('cameractrl', function($scope, $cordovacamera) { document.addeventlistener("deviceready", function () { var options = { quality: 50, destinationtype: camera.destinationtype.data_url, sourcetype: camera.picturesourcetype.camera, allowedit: true, encodingtype: camera.encodingtype.jpe

c# - bind enum to Combobox On CUSTOM CONTROL -

i have custom control in wpf , need bind combobox on enum wrote, searching on web found way go: <objectdataprovider methodname="getdict" objecttype="{x:type app:enumdescriptionvaluedict}" x:key="enumdescriptiondict"> <objectdataprovider.methodparameters> <x:type typename="app:transmission"></x:type> </objectdataprovider.methodparameters> </objectdataprovider> <combobox itemssource="{binding source={staticresource enumdescriptiondict}}" displaymemberpath="key" selectedvaluepath="value"/> but control xaml <usercontrol x:class="wpfcontrolfoo.usercontrol1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

c# - Delegates are immutable but how? -

what happens when add method existing delegate? mean when added method1 del, del holds address of method1. when add method2 afterwards, del still points method1 , method 2 address inserted on bottom of it. doesn't mean changed delegate? if can change why in books told "delegates immutable" ? mydel del = method1; del += method2; del += method3; let me use simple analogy. int immutable, when put int x = 123; x += 1; it means int _x = x + 1; x = _x; when adding 1 new temporary variable _x , drop initial x substituting _x ; in case of delegates del += method2; means quite same: delegate _del = delegate.combine(del, method2); del = (mydel) _del;

java - Partially transparent images in javafx -

i making project in eclipse. have uploaded .png file using 'image view' option.it has transparent areas .i want write code such detects click of user's mouse when on opaque area , take user new window defined me. this code should work in circumstances. imageview.addeventfilter(mouseevent.mouse_clicked, e -> { color color = image.getpixelreader().getcolor(e.getx(),e.gety())); if(color.getalpha() != 0) { //execute code here } });

poste.io Let's encrypt certificate issue exception -

i using poste.io mail server. while trying issue ssl cert using lets encrypt, throws below error. has observed , fix it? [2016-11-08 00:12:44] lescript.info: account registered. continuing. [2016-11-08 00:12:44] lescript.info: starting certificate generation process domains [2016-11-08 00:12:44] lescript.info: requesting challenge mail.domain.ltd [2016-11-08 00:12:45] lescript.info: sending signed request /acme/new-authz [2016-11-08 00:12:45] lescript.info: got challenge token mail.domain.ltd [2016-11-08 00:12:45] lescript.info: token mail.domain.ltd saved @ /opt/www//.well-known/acme-challenge/ueyhta88fis_e5wtn-soxki-lqbsk1-etoceie_untq , should available @ http://mail.domain.ltd/.well-known/acme-challenge/ueyhta88fis_e5wtn-soxki-lqbsk1-etoceie_untq [2016-11-08 00:12:47] lescript.error: please check http://mail.domain.ltd/.well-known/acme-challenge/ueyhta88fis_e5wtn-soxki-lqbsk1-etoceie_untq - token not available [2016-11-08 00:12:47] lescript.error: #0 /opt/mailserver-admin/s

java - Drools or vs and inside map check not work same way -

first drool examples work , parse should: package teeest import java.util.arraylist; import java.util.hashmap; rule 'test_and_comprassion' when $result:java.util.arraylist() $e:java.util.hashmap('test' == this['test'] && 'test2' == this['test']) $result.add(###def_id###l); end package teeest import java.util.arraylist; import java.util.hashmap; rule 'test_or_const_right_comprassion' when $result:java.util.arraylist() $e:java.util.hashmap(this['test'] == 'test' || this['test'] == 'test2') $result.add(###def_id###l); end; logic not matter here ;) it's example. unfortunately second one, gives me error: package teeest import java.util.arraylist; import java.util.hashmap; rule 'test_or_const_left_comprassion' when $result:java.util.arraylist() $e:java.util.hashmap('test' == this['test'] || 'test2' == this['test']) $result.add(###

asp.net mvc - Error when upgrading glass mapper -

currently have glass mapper v3 , in process of upgrading latest glass mapper i.e. v4, when build project giving me following error. severity code description project file line suppression state error cs1705 assembly 'glass.mapper.sc.mvc' identity 'glass.mapper.sc.mvc, version=4.2.1.188, culture=neutral, publickeytoken=null' uses 'system.web.mvc, version=5.2.3.0, culture=neutral, publickeytoken=31bf3856ad364e35' has higher version referenced assembly 'system.web.mvc' identity 'system.web.mvc, version=5.1.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' here table of support versions of mvc sitemap versions. 8.1 , 8.2 support 5.2 mvc. https://kb.sitecore.net/articles/087164 the latest glass mapper may not work older versions of sitecore. you can upgrade mvc 5.2 , add bindings web.config make requests 5.1 work on 5.2. <dependentassembly> <assemblyidentity name="system.web.helpers&quo

sql server - Remove special character in sql -

replace(ab.firstname,', '') how can remove character ' string in sql you need double single quotes below replace(ab.firstname, '''', '') or declare @name nvarchar(50) = 'ab''c' select replace(@name,'''', '')

How to programmatically manage startWatch and stopWatch in an AnyLogic model -

Image
i'm building model anylogic using process model library (pml). in network have 4 "source" elements emits agents, of same type different "category" string id inside them (saved variable) differentiate them; purchase order different departments. have inserted blocks measure time agents spend exit assembler elements (you see in picture inside red circles). time want plot in graph show how fast are. after test , reading documentation have see when agent pass under start photocell (agent of department) timer activated , opposite when agent (agent of department) pass under stop photocell timer stopped. in case of agent different category ids. how can synchronize timers measure time of object same category id? want if first source element "category nilo&salmoni" produce agent stopwatch measure time of 1 , not of one, emitted category, reach stopwatch first.

web - Enable GA and other trackers only for production when assets are prebuilt with webpack -

i'm shipping frontend application want track stats (ga , other trackers). app prebuilt webpack on ci , i'd have same bundle shipped both staging , prod environments. there issue that: if enable trackers during build time they'll enabled on both envs. one way see add set window.enabletrackers = true flag in index.html when sending app code server , decide whether install trackers or not, seems pretty ugly solution. is there other way u use it? checking domain name on client maybe? like: if(document.location.hostname === 'prod.example.com') { // enable trackers } this best resolved @ time compilation made configuring webpack differently production , stage bundles, use cli --define or --env explicitly enable tracking. if don't resolve inclusion of tracking during compilation, have resort other means. 1 option evaluate during runtime whether ga script should loaded in document. here's example of rect element load script if hostname ma

junit - @Mock objects returning null -

so have code below- @runwith(mockitojunitrunner.class) public class teamsubscriptionservicetest { @injectmocks private teamsubscriptionservice teamsubscriptionservice; @mock private imscustomerprofileservice imsservice; @mock private iuserservice userservice; @mock private httprequestservice httprequestservice; @mock private isubscriptiondbservice subscriptiondbservice; private string imstoken = "ims_token"; @before public void setup() { mockitoannotations.initmocks(this); when(imsservice.getaccesstoken()).thenreturn(imstoken); reflectiontestutils.setfield(teamsubscriptionservice, "jilendpoint", "www.testjil.com"); reflectiontestutils.setfield(teamsubscriptionservice, "adobeioapikey", "api_key"); } @test(groups = { testgroup.unit_tests }) public void testaddseat() throws ioexception { string teamid = "testteamid&q

ios - Russian phone number gets formatted on dial -

i'm facing problem on ios (i tried on iphone 5/ios 9 , iphone 6 plus/ios 8). goal open phone application , dial russian number. number 8 800 123 45 67 to short, i'm doing [[uiapplication sharedapplication] openurl:@"tel:88001234567"] whenever i'm trying call, phone number gets formatted , loses 1 0 become +880 123 4567 and when try add indicative 007, phone number called loses 1 8 become 00 7 (800) 123-45-67 last thing, when try use [[uiapplication sharedapplication] openurl:@"telprompt:88001234567"] it correctly shows me 00 7 (8800) 123-45-67 but when press "call", phone number called is 00 7 (800) 123-45-67 did have problem? normal behavior on ios? on android dial application doesn't format phone number. edit: pekka, when check page https://en.wikipedia.org/wiki/telephone_numbers_in_russia can see: calls outside russia: +7 abc xxx-xx-xx abc area code then fact 1 8 drops when

maven - Connection reset when I try to download artifacts from Sonatype Nexus with HTTP -

i setup sonatype nexus repository on own server @ home. server setup http on port 8081, , looks works okay browser both locally , remotely. the problem when try download artifacts (only of them, more 500kb) connection systematically closes (on server side) before transfer completed, resulting in network error. curl -h --url http://<myserver>:8081/..../artifact.jar > .... > curl: (18) transfer closed 116756 bytes remaining read the problem magically disappears when setup nexus run ssl (on https, port 8443), requires me verify certificate verisign or such, complicates matter. why transfer of above artifact (approv. 700kb in total) fail that? causes be?

Rails - Devise signin(@user) is not working in session -

i used customized controller signin following: class users::sessionscontroller < devise::sessionscontroller def create # super @user = user.where(:email => user_params[:email]).first if @user.valid_password? user_params[:password] sign_in(@user) @current_user = @user # set current user doesn't make sense redirect_to '/' else render :new end end end i tried using super , in database level user verified devise never set session. in both 2 cases see record updated in database: update `users` set `current_sign_in_at` = '...', `last_sign_in_at` = '...', `sign_in_count` = .., `updated_at` = '...' `users`.`id` = 1

c - Compiling PHP extension for windows -

i trying compile php-7.0.11 , sample extension on windows 8.1 using visual studio 2015. following https://wiki.php.net/internals/windows/stepbystepbuild . have followed every step still getting following error: { bison.exe --output=zend/zend_language_parser.c -v -d -p zend zend/zend_language_parser.y zend/zend_language_parser.y:49: unrecognized: %code zend/zend_language_parser.y:49: skipping next % zend/zend_language_parser.y:52: unrecognized: %destructor zend/zend_language_parser.y:52: skipping next % zend/zend_language_parser.y:53: unrecognized: %destructor zend/zend_language_parser.y:53: skipping next % nmake : fatal error u1077: '"c:\program files\ux-utils\bison.exe"' : return code '0x1' stop. } also, have noticed zend_language_parser.c file not generating in zend directory.

linux - How to add text at the end of each line after skipping Last N characters -

i'm on linux command line , have log file following content subscription service shutdown @ 9:59pm utc subscription service restarted @ 11:57pm utc i want add date before time stamp every line subscription service shutdown @ 01 oct 2016 9:59pm utc subscription service restarted @ 01 oct 2016 11:57pm utc something this: sed -r "s/([0-9]+{1}:[0-9]+{1}[a-z]{2}.*$)/01 oct 2016 \1/g" test.txt > new.txt where text.txt log file , "01 oct 2016 " text , \1 time inserted in group match.

electron - Rich HTML tray menu in a desktop web application -

Image
i want create tray menu app custom buttons, sliders, maybe nice transition effect, header , footer this: the application needs work on linux, windows , mac. guessed should possible desktop web app + html, can't find useful example framework. every example uses os' menu doesn't have elements need. can direct me how more or less implement in of web app frameworks? this can done in electron quite easily, i've created few tray apps myself in below images: here post outlines do: http://www.bytcode.com/articles/1 the rudimentary files need are: index.html main.js package.json in index.html design app way wanted look. in example above used couple of input boxes , styled css. in main.js file put main code power app. in package.json file put details app, dev dependencies etc. the main file should concerned main.js file. below example of main.js file app above. i've added comments understand: // sets variables (const) const {app

SAS EG lagcalculation issue, not calculating las as t - t-1 -

can 1 resolve issue there: data want; set have; mac; if first.mac do; daydif=0; kmdif=0; end; else do; daydif = date - lag(date); /* calculate difference between 2 dates */ kmdiff = kms - lag(kms); end; run; and got result (0 in first line . in second): mac date kms daydif kmdif sp0001 10dec07 1885462.00000 0 0 sp0001 12dec07 1885462.00000 . . sp0001 30apr09 1885462.00000 505 0 sp0001 15jul09 1886577.00000 76 1115 sp0001 16jul09 1887667.00000 1 1090 sp0001 17jul09 1889181.00000 1 1514 sp0001 17jul09 1888825.00000 0 -356 . . (here when machine changed, lag taken t - (t-2) , not t - (t-1) ) why???? wrong in code ?? machine date kms daydif kmdif sp0001 01oct14 2898108.00000 1 1059 sp0001 02oct14 2899148.00000 1 1040 hp0001 03oct14 2900334.00000 1 1186 hp0002 17jan08 926384

angularjs - HTML added in link function won't bind to scope -

i need template changes depending on object on scope. because it's object , not string, can't use template function, i'm using link function add html element. of course html needs explicitly $interpolated now, here's end with: scope: { obj: "=ngmodel", type: "<" }, controlleras: "display", controller: function() { let display = this; // sets bunch of other functions, including booleanlabel , displaydata }, link: function(scope, element, attrs) { let display = scope; function template(type) { switch (type) { case objtypes.x: return `<button ng-click="display.toggleboolean(display.obj)"> {{display.booleanlabel(display.obj.data)}} </button>`; case objtypes.y: return `<button> {{display.displaydata(display.obj.data)}} <

php - Check if user have permission or not to download any file in WooCommerce -

i want check whether user have permission or not download file. have product id , user id how can check? i have explored lot on google , in woocommerce documentation didn't find solution. any help? thanks in advance. here process information can use in function or hooked function in php files. here code: // current customer orders $customer_orders = wc_get_orders( $args = array( 'numberposts' => -1, 'meta_key' => '_customer_user', 'meta_value' => get_current_user_id(),// current user id 'post_status' => array_keys(wc_get_order_statuses()), ) ); // different loops downloadable products bought user foreach ( $customer_orders $customer_order ){ if (!empty($customer_orders)){ foreach ( $customer_orders $customer_order ){ if( !$customer_order->has_downloadable_item() && $customer_order->is_paid() ){ foreach( $customer_order->get_items()

javascript - Using collapsible elements like an accordian - Bootstrap 3 -

i have seen bootstrap 3 default functionality accordians close other collapsible elements when 1 open. is possible using collapse? <div class="collapse" id="collapse5"> <p> venenatis tincidunt. fusce @ dolor nunc. duis maximus pulvinar leo, id laoreet massa tincidunt ut. quisque scelerisque sit amet ipsum eget ornare. donec eu blandit lectus. suspendisse potenti. praesent posuere enim sapien. etiam et ullamcorper sem. nam quis leo eu enim porttitor mattis vitae vel libero. curabitur feugiat nec nulla quis luctus. </p> </div> <button class="btn my-btn" type="button" data-toggle="collapse" data- target="#collapse5" aria-expanded="false" aria-controls="collapseexample" onclick="this.classlist.toggle('open2')"> &nbsp; </button> essentially button opens collapsible d

java - Extend server code so server is able to interact wit clients using multithreading.So the no of clients sim connected the same server -

*cant figure out question above. have tried oracle tutorials , note still unable it. appreciated. the weight conversion server given on blackboard (conversionservernoconcurrency.java) can interact multiple clients, in sequential manner (that is, new client instance can connect server after server has finished dealing previous client). extend/modify given server code server able interact multiple clients in parallel (concurrently), using multithreading. number of clients simultaneously connected same server should not restricted. really need code other wise wont able implicate when doing assignment import java.io.*; import java.net.*; import java.util.scanner; public class conversionservernoconcurrency { private socket s; private scanner in; private printwriter out; public static void main(string[] args) throws ioexception { serversocket server = new serversocket(8888); conversionservernoconcurrency serverinstance = new conversionservernoconcurrency(); s

ios - Cannot subscript a value of type 'Set<String>' with an index of type 'Int' -

i having set of strings have data in it. when showing data set tableview, in cellforrowatindexpath method gives me above stated error. here code: var tradeset: set<string> = ["tkai", "yndx", "pstg"] func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("mytrade", forindexpath: indexpath) as! mytradetableviewcell let objects = tradeset[indexpath.row] cell.tradename.text = objects return cell } any great. thank you! a set not indexable , because order in elements of set listed irrelevant. should storing elements in array or different data structure. quick following (not recommended): var tradeset: set<string> = ["tkai", "yndx", "pstg"] func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = ta

c# - sending wms request to geoserver via brutile/sharpmap to load tiled map (tiled=true) -

i want load tiled map in mapbox of sharpmap. have geoserver , send wms request receive single tile map. how can receive multi-tile map? here code: dim wmsurl string = "http://192.168.21.202:8080/geoserver/threem/gwc/service/wms?tiled=true&version=1.1.0" dim laywms new sharpmap.layers.wmslayer("threem_zoom", wmsurl) laywms.addlayer("threem_zoom") laywms.setimageformat("image/png") laywms.timeout = 5000 laywms.srid = 4326 laywms.version = "1.1.0" mapbox1.map.layers.add(laywms) mapbox1.panonclick = true mapbox1.map.zoomtoextents() mapbox1.refresh() from documentation looks if on simple wms layers supported - need handle construction of tile bounds , make multiple wms requests tiled image back. the wms layer support pretty basic. have decipher server capabilities yourself, , specify nessesary layers , other properties in resource property.

php - Symfony translations use always default EN -

i have italian language set on browser, symfony localization give me english translations. how can italian strings if access page italian browser? now see "pluto" in en browser , in browser. config.yml: parameters: locale: en framework: translator: { fallbacks: ['%locale%'] } messages.en.yml: pippo: pluto messages.it.yml: pippo: paperino index.html.twig: {% block body %} <div class="container"> <div class="row"> <div class="col-sm-12"> {% trans %} pippo {% endtrans %} </div> </div> </div> {% endblock %} thanks if want set current locale headers need make event listener kernel.request event sets $request->setlocale(...) . see similar questions: symfony2 locale languages whole page event listener symfony2 wrong locale detection? http://symfony.com/doc/cur

data structures - time-complexity of nested loop -

why time-complexity of function (n) { //this loop executes n times for( = 1 ; <= n ; + + ) //this loop executes j times j increase rate of for( j = 1 ; j <= n ; j+ = ) print( “*” ) ; } its running time n*(n^1/2)=n^3/2 so, o(n^3/2) please explain mathematical steps. thank in advance. the running time bounded o(n^{3/2}) , that's not tight! notice inner loop makes o(n/i) iterations each i=1,2,...n ), time complexity o(n * (1 + 1/2 + 1/3 + ... + 1/n)) = o(n log n) . this because 1+1/2+1/3+...+1/n=o(log n) well-known harmonic series .

sql - how to display the column which is used to join the table -

Image
i have 2 tables this, query display list of empid & name of employees least working hours per month id the o/p should this. moth_ending emp_id name 20150131 1001 baba 20150228 1001 baba 20150331 1001 baba i tried code. select month_ending,name,total_workinghours employee_details left join dim_employee on employee_details.emp_id = dim_employee.emp_id learn use table aliases. think want: select ed.month_ending, ed.emp_id, e.name employee_details ed left join dim_employee e on ed.emp_id = e.emp_id; i don't see why left join necessary. if database set employee_details should refer valid employee.

How can i handle variables like A1, A2,..., An in a loop? in R -

i have 10 different objects: a1, a2, ... a10. need make simple change each variable. such as a1$x <- a1$x + 1 a2$x <- a2$x + 1 ... a10$x <- a10$x + 1 and a1[,'new_x']<-cumprod(a1$x) a2[,'new_x']<-cumprod(a2$x) ... a10[,'new_x']<-cumprod(a10$x) i'd shrink these codes using 'for' loop. tried for(i in 1:10) { ai[,'new_x'] <- cumprod(ai$x) } and of course not work. there way make work? you can use looping approach without first converting objects single list or data frame if use eval() function read objects , assign() function write objects. example: a1 <- data.frame(x=1:5) a2 <- data.frame(x=2:6) a3 <- data.frame(x=3:7) for(i in 1:3) { dfname <- paste0("a", i) df <- eval(parse(text=dfname)) df$new_x <- cumprod(df$x) assign(dfname, df) } a1