Posts

Showing posts from June, 2014

python - Add Header row to multiple .txt files using -

python newbie hoping can little bit of help. have bunch of .txt files listing gps data. create python script open each .txt file in directory , add headers (prior converting .csv , processing esri gis feature classes). have python code list .txt files in target directory , have python code add headers single specified .txt file not sure how tie 2 bits of code whole script process .txt files python code list .txt files: import glob workspace = "c:\\pathway\\totarget" date = time.strftime('%y_%m_%d') directory = workspace + "\\" + date glob.glob(directory + "./*.txt") so, if import glob workspace = "c:\\pathway\\totarget" date = time.strftime('%y_%m_%d') directory = workspace + "\\" + date listoffiles = glob.glob(directory + "./*.txt") print listoffiles i list of .txt files in target directory. far good. ================ python add header specified .txt file listoffiles = "c:\\pathwa

android - How to save image bitmap after rotation? -

i develop app save images sd card , pictures upside want rotate them , save them in rotate position choose . know how rotate on code image not saved permanently. here code : //rotate picture public static bitmap rotate(bitmap source, float angle) { matrix matrix = new matrix(); matrix.postrotate(angle); return bitmap.createbitmap(source, 0, 0, source.getwidth(),source.getheight(), matrix, false); } //resize image public void resizeimage(string path , int wdist,int hdist){ try { int inwidth = 0; int inheight = 0; inputstream in = new fileinputstream(path); // decode image size (decode metadata only, not whole image) bitmapfactory.options options = new bitmapfactory.options(); options.injustdecodebounds = true; bitmapfactory.decodestream(in, null, options); in.close(); in = null; // save width , height inwidth = options.outwidth; inheight = options.outheig

python - NumPy convert 8-bit to 16/32-bit image -

i using opencv 2 images manipulations in ycbcr color space. moment can detect noise due conversion rgb -> ycbcr , ycbcr -> rgb, said in documentation : if use cvtcolor 8-bit images, conversion have information lost. many applications, not noticeable recommended use 32-bit images in applications need full range of colors or convert image before operation , convert back. so convert image in 16 or 32 bits, didn't found how numpy. ideas? img = cv2.imread(imgnamein) # here want convert img in 32 bits cv2.cvtcolor(img, cv2.color_bgr2ycr_cb, img) # image processing ... cv2.cvtcolor(img, cv2.color_ycr_cb2bgr, img) cv2.imwrite(imgnameout, img, [cv2.cv.cv_imwrite_png_compression, 0]) thanks @moarningsun, problem resolved: i = cv2.imread(imgnamein, cv2.cv_load_image_color) # need sure have 8-bit input img = np.array(i, dtype=np.uint16) # line change type, not values img *= 256 # values in 16 bit format

xcode - Create Menu and SubMenu's in cocoa app -

Image
i developing cocoa app need create menu , submenu's in application. i have attached screenshot designed using flex. how can same in cocoa. any appreciated. thanks. your question incomplete,though try match solution expecting…the screenshot posted(you never mentioned source of screenshot have taken,by analysing design edited in question “flex”) looks don’t want deal nsmenuitem , nsmenu classes drop down menus… solution 1 : make custom view(probably subview of nsview popview ) handles input, displaying labels,imageviews etc. ==> basically,both menu bar , menu item wrapped nsview , drop down menu wrapped nspanel…well per design have use nsview,because able add corner , yes,there possibility of adding ground colour well…the menu item has subviews of nstextview. if menu bar item has 1 text subview title, , if sub menu item has 3 text subviews, 1 check mark, 1 title , 1 hot key list…no need worry handling events,the respective classes own event handling…it’s

html - How can I wrap a data inside a cell? -

this project in asp mvc 4 i'm trying retrieve data database displayed on table wont break word , consumes whole row sample image: http://animobile.info/upload/1/wontwrap.jpg i've tried code: <table cellpadding="0" cellspacing="0" border="0" class="display" id="myexchangeratetable" width="100"> <thead> <tr> <th> @html.displaynamefor(model => model.backup_location) &thinsp; &thinsp; @html.displaynamefor(model => model.backup_taken) @html.displaynamefor(model => model.restore_database_name) @html.displaynamefor(model => model.date_restored) </th> <th></th> </tr> </thead> @foreach (var item in model) {

installer - How to run heat.exe and register a dll in wix -

i need register dll in regasm , using <customaction id='comreg' directory='installlocation' execommand='"[windowsfolder]microsoft.net\framework\v4.0.30319\regasm.exe" "[installlocation]myproduct.dll" /codebase' return='check' /> to register , unregister <customaction id='comunreg' directory='installlocation' execommand='"[windowsfolder]microsoft.net\framework\v4.0.30319\regasm.exe" /u "[installlocation]myproduct.dll" /codebase' return='check' /> am using , installing , somnetimes gives error. recommending use heat.exe, http://wixtoolset.org/documentation/manual/v3/overview/heat.html went through link,but need how use in wix , stuff.i need tuitorial heat used scrape directories or files , generate .wxs files include in installer. if wish generate registry information .net dll com interface can use command following: heat.exe fi

javascript - Div elements won't keep desired aspect ratio -

i want create memory game. want place 6 cards in 4 rows. problem div element "behind" card visible , ruin whole design ( z-index3 or .back class inside code).it's working if put display.none .class problem blocks picture of card. here code using html <body> <div id="picbox"> <span id="boxbuttons"> <span class="button" id="rezz"> rezultat <span id="counter">0</span> </span> <span class="button" id="ttime">00 : 22</span> <span class="button"> <a onclick="resetgame();">reset</a> </span> <span class="button"> <a onclick="mutedsound();">mute sound</a> </span> </span> <div id="boxcard" align="center"> <div class="flipper&

mysql - how to read all the data using for loop -

my code connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);select @phonenos phonenos;select @nameofstop nameofstop;select @busstartstatus busstartstatus',function(err,result){ console.log("connection.query('call addtion("'+tr+'","'+lat+'","'+long+'","'+sp+'","'+dat+'","'+start+'","'+stop+'",@phonenos,@nameofstop,@busstartstatus);select @phonenos phonenos;select @nameofstop nameofstop;select @busstartstatus busstartstatus'"); my question have 24245676856859870d0a,242457658658786870d0a,24245676856859870d0a,242457658658786870d0a,24245676856859870d0a,242457658658786870d0a,24245676856859870d0a,242457658658786870d0a,2

c++ - Saving and restarting a paused gdb session -

my understanding gdb can monitor complete state of running program. can save gdb session paused @ breakpoint , resume session later? my first attempt generating core dump in first gdb session paused @ breakpoint , using core dump start second gdb session. saving core file in gdb this resulted in following error. program terminated signal sigtrap, trace/breakpoint trap. so breakpoint information inserted program state, interesting. on second attempt did same time added same breakpoint second session in first session. getting gdb save list of breakpoints? still, same error. can save , restart gdb session? if so, how? i don't think directly relevant i'm getting warning. warning: core file may not match specified executable file. is gdb stating such thing possible in general or gdb believe may have happened in running session? i'm confident same executable produced core dump being run under gdb. edit: else comes along, question: save process' mem

python - client denied by server configuration -

i trying setup django project apache , mod_wsgi file. getting error client denied server configuration: /home/ghrix/production . have google errro , found lot of solutions nothing worked me. my code follows : production.wsgi import os import sys sys.path = ['/home/ghrix/myproject/'] + sys.path os.environ['django_settings_module'] = 'config.settings' import django.core.handlers.wsgi application = django.core.handlers.wsgi.wsgihandler() production.conf file : <virtualhost *:80> wsgiscriptalias / /home/ghrix/production.wsgi servername firstweb.com serveralias firstweb.com alias /static/ /home/ghrix/myproject/static/ <directory /home/ghrix/myproject/ > options indexes followsymlinks wsgiprocessgroup production wsgiapplicationgroup %{global} require denied </directory> </virtualhost> i solved problem making 2 changes : 1) require denied -> change -> requ

angularjs - Uncaught ReferenceError: ui is not defined for UI.Bootstrap -

i added "ui.bootstrap" application use tooltips. after adding "ui.bootstrap", application not loading. think im missing not sure, , how can fix this? can please help? thanks, sangamesh p.s. use angular app. maybe should add '' ui.bootstrap this: angular.module('myapp', ['ui.bootstrap']); bad example: angular.module('myapp', [ui.bootstrap]); hope helps.

java - Hibernate Model: set default @ManyToOne value of a Child Class -

i have class user has @manytoone field role. @entity @table(name="users") @inheritance(strategy = inheritancetype.single_table) @discriminatorvalue("role_admin") @discriminatorcolumn (name="rolename", discriminatortype= discriminatortype.string, length=20) public class user extends baseentity implements userdetails { // others fields username, password,... @manytoone @joincolumn(name = "role_id", referencedcolumnname="id") @notnull(message = "role field mandatory") private role role; //getter , setter } i have many classes extends user: userseller, userclient, useroffice.... @entity @discriminatorvalue("role_seller") @attributeoverride(name = "role", column = @column(name = "role_id")) public class userseller extends user { //additional fields companyid,... //getter & setter } i have 1 panel can insert / edit / delete kind

python - pandas: ValueError when assigning DataFrame entries using index due to a change since v 0.13.1 -

i begin concrete example: the following works on; pandas version: 0.13.1 numpy version: 1.8.0 b but not on; pandas version: 0.14.0 numpy version: 1.8.1 import pandas pd import numpy np = pd.dataframe(np.random.rand(10,4), index=np.random.rand(10)) a.loc[a.index] = a.loc[a.index] in pandas newer version results in: valueerror: truth value of array more 1 element ambiguous. use a.any() or a.all() i did not figure out change 0.13.1 -> 0.14.0 , how should modify code . for wondering application: useful when large dataframe needs updated iteratively, each time sub-frame. real-life code resembles more: while something: ... a.loc[b.index] = a.loc[b.index].add(b, fill_value=0) ... index of b subset of index of a

javascript - How to find a d3.js plot element by its connected data? -

i have d3.js plot made array of objects, such as: svg.selectall(".circ").data(dataarr) // dataarr array of objects .enter().append("circle") .attr("cy", function (d) { return d.y }) .attr("cx", function (d) { return d.x }) .attr("r", elemsize / 2) .on("dblclick", function (d, i) { itemwasclicked(d,i); // function handle double click } in mentioned itemwasclicked(d,i) routine (where d data of clicked element , i index of in array dataarr ) need find actual svg element clicked , change color. how find d3.js element data attached it? not want, unless necessary, use attaching/searching id element. if faster or there no way otherwise. inside of event handler this direct reference actioned element. see selection.on documentation : the specified listener invoked in same manner other operator functions, being passed current datum d , index i ,

c# - When retrieving an appointment with EWS the subject contains the organizer name -

im retrieving appointments ews specific room in office 365 account. when returning appointment(s) subject property of appointment contains name of organizer instead of subject gave appointment. im doing wrong? code example how im doing it: exchangeservice service = new exchangeservice(); service.credentials = new webcredentials("username", "password"); service.url = new uri("https://outlook.office365.com/ews/exchange.asmx"); datetime startdate = datetime.today.adddays(-30); datetime enddate = datetime.today.adddays(60); calendarview cv = new calendarview(startdate, enddate); folderid calendarfolderid = new folderid(wellknownfoldername.calendar, "room1@company.com"); calendarfolder calendar = calendarfolder.bind(service, calendarfolderid); finditemsresults<appointment> appointments = calendar.findappointments(cv); foreach (appointment appointment in appointments.tolist()) { //this contains wrong value..... string subject

How to customize jquery dialog appearance -

Image
many time use below code show jquery dialog want customize it. jquery('#dialog').load('path page').dialog('open'); suppose when click on link small jquery dialog open busy image way. here screenshot. so dialog show progress bar , after getting html data server side want increase height & width of dialog in loop upto level best fit html data inside in dialog. here bit code that $(".ui-dialog").animate({ left: (($(window).width() - 346) / 2) + 'px', top: (($(window).height() - 305) / 2) + 'px', height: '305px', width: '346px' }, 200, function () { $("#dialog").removeclass("busystyles").find('#faxmain').fadein(2000); $("#dialog").css({ height: '26px' }); }); so guide me sample code how customize line jquery('#dialog').load('path page').dialog('open'); have desired effect. so guide few steps 1) how set busy image @ center of dialog 2)

objective c - How to change frame of uiview is using autolayout in iOS? -

i added 1 view in xib, set autolayout. when run, want to change frame of view. know if using autolayout, need set translatesautoresizingmaskintoconstraints = yes in code. have done that, create new frame view shows warning message in console: @ least 1 of constraints in following list 1 don't want. try this: (1) @ each constraint , try figure out don't expect; (2) find code added unwanted constraint or constraints , fix it. (note: if you're seeing nsautoresizingmasklayoutconstraints don't understand, refer documentation uiview property translatesautoresizingmaskintoconstraints) ( "<nsibprototypinglayoutconstraint:0x16e4b750 'ib auto generated @ build time view fixed frame' v:|-(0)-[uiview:0x16ed3c30] (names: '|':uiview:0x16ee06b0 )>", "<nsautoresizingmasklayoutconstraint:0x16e19e30 h=-&- v=-&- uiview:0x16ed3c30.midy == uiview:0x16ee06b0.midy + 44>", "<nsautoresizingmasklayoutconstr

php - How can I get Laravel 4 environment variables to work? -

i have created app laravel , have set of environments want run on site always. setup comes start.php file declare environments so: $env = $app->detectenvironment(array( 'local' => array('mark-macbook.local'), 'development' => array('excelsior.servers.prgn.misp.co.uk'), 'production' => array('excelsior.servers.prgn.misp.co.uk'), )); i create files in root server.php , create files have correct database details each environment in so: .env.local.php <?php return array( 'database_host' => 'localhost', 'database_name' => 'borough', 'database_user' => 'root', 'database_password' => 'root', 'unix_socket' => '/applications/mamp/tmp/mysql/mysql.sock' ); .env.development.php <?php return array( 'database_host' => 'localhost', 'database_name' => 'db

c# - Custom panoramic control with edge snaping -

i trying create 'panoramacontrol' control windows phone 8, in terms displays slideshow of scenes, each of them having size of screenwidth. have tried using microsoft's panorama control have abandoned approach several reasons: the amount of scenes around 10-20, , might panoramacontrol handle, because there animation inside. i don't want control loop continuously, , panoramacontrol does. after research decided implement control on own, using scrollviewer , listbox , , result here: https://www.youtube.com/watch?v=2rcqdmkn0ey (the movement smooth on both device , emulator, bit choppy in link due screen capture) what missing however, scene scene snap-to-edge elastic functionality. have tried playing manipulation events, fail smooth elastic inertial movement , thought of asking suggestion towards elegant implementation before getting frustration or worse.. hacking , compromising.. therefore or suggestions (even towards different approaches) appreciated! :)

php - count unique id separeted by commas in single row -

i have following details in mysql as user_id follow_user_id 1 2,3,3,3,3 5 1,2,3,3,3,3 6 1,2,3,3,3,3 i write following code unique code follow: select length( follow_user_id ) - length( replace( follow_user_id, ',', '' ) ) +1 no_of_follow follow user_id =1; but provide result :6 need unique rows: i.e:4 plz me & regards in advance apart db design questions use in php after fetching row $result: count(array_unique(explode(",",$result["follow_user_id")));

java - Store enum class reference -

ok have 2 enums: public enum anotherenum { value1, value2, value3; } public enum myenum implements myinterface { value1(anotherenum); generic_reference_type a; myenum ( ?? ) { = ?? } getgenericreference() { return this.a; } } i want myenum store reference anotherenum class i'll able this: myenum.value1.getgenericreference().values(); is possible? if i'm reading question correctly. pass different generic type each instance of enum... can't that, because every instance of enum same class, can generic, if generic must have same generic parameter. however, can close intention basing code around enum class , expressed class<? extends enum<?>> : public enum anotherenum { a, b, c; } public enum yetanotherenum { x, y, z; } public interface myinterface { public enum<?>[] getgenericreferencevalues

ios - Best solution to refresh token automatically with AFNetworking? -

once user logged in, token ( digest or oauth ) set http authorization header , gives authorization access web service. if store user's name, password , token somewhere on phone (in user defaults, or preferably in keychain), user automatically logged in each time application restarts. but if token expires ? "simply" need ask new token , if user did not change password, should logged in once again automatically . one way implement token refreshing operation subclass afhttprequestoperation , take care of 401 unauthorized http status code in order ask new token. when new token issued, can call once again failed operation should succeeds. then must register class each afnetworking request (getpath, postpath, ...) uses class. [httpclient registerhttpoperationclass:[retryrequestoperation class]] here exemple of such class: static nsinteger const khttpstatuscodeunauthorized = 401; @interface retryrequestoperation () @property (nonatomic, assign) bool isretry

sql server 2008 - SQL Query - Select with a total column -

i have query returns rows current , non-current items. current items have no value non-current items have value i need query return current values , total value of non-current items: sample: name status value kb current 0 kb non-current 5 kb current 0 kb non-current 5 kb non-current 5 kb current 0 kb current 0 kb current 0 non-current 5 current 0 non-current 5 current 0 current 0 i need: name status value totalvalue kb current 0 15 kb current 0 15 kb current 0 15 kb current 0 15 kb current 0 15 current 0 10 current 0 10 current 0 10 i've tried select name,status,value,(select sum(value) table but totals values rather per name, if try group name error returns more 1 value. this totals values rather per name, if try group name

sql - Can any one simplify this query -

i have table this firstcity secondcity distance roadname roadstatus 008 007 4.600 a4 008 020 4.400 a4 005 008 4.300 a3 i want select rows particular city id first city or second city.furthermore assume city id 006. want records having either of city number 006. don't want 006 displayed. want other city number of record no matter column distance, roadname , road status. have tried this. select * directnodes firstcity='008' or secondcity='008'; it gives me 5 columns. want other city number of records having 008 without 008. output should this. city distance roadname roadstatus 007 4.600 a4 020 4.400 a4 005 4.300 a3 can tell me how achieve this. try this select case when firstcity = '008' secondcity else firstci

breeze - Error when mapping entity where data from related table is required -

i doing simple projection query in breeze: var p1 = new predicate('id', 'eq', articleid); var p2 = new predicate('isdeleted', '!=', true); var p3 = new predicate('isautosave', '!=', true); var query = entityquery.from(entitynames.article) .where(p1.and(p2.and(p3))) .select('code, description, imagefilename, notes, supplierdistance') i used entity mapper create partial entity put observable return function. good. then realised needed country name related table, first tried ".expand" , told breeze couldn't "expand" , "select" simultaneously. no problem, select related record directly: .select('code, description, country.countryname, imagefilename, notes, supplierdistance') but there no "country_countryname" property on entity creating partial of, mapping fails (unsurprisingly) "undefined not func

ios - Is there a way to find out automatically if a third party library has been updated -

im using couple of libraries found on github , , wondering there way know when third party library used in app has been updated? example, bug fix. must continuously visit users repository find out our selfs, or using dependency manager cocoa pods have functionality? thanks in advance. cocoa pods allows manage third party library, 1 feature has pod outdated checks new releases of library's , check if project has new commits more info on cocoa pods, see link example 1 (library releases only): say have afnetwoking in project using cocoapods following syntax: pod "afnetworking" if wanted check updates pod outdated , or update library if there releases pod update example 2(library recent commits): there times want recent commits regardless of if stability. on cocoapods can pod 'afnetworking', :git => 'https://github.com/afnetworking/afnetworking.git' . gets recent commit on git

sql - Unable to delete row from table -

i have 2 database main , main_2 , 2 tables table1 in main database , table2 in main_2 database. i want delete rows table2 not in table1 , using following query: delete main_2.dcl.table2 slno not in (select slno main.dcl.table1) i getting 0 row(s) affected but rows present in table2 , checked manually.

android - Using drawable resources -

i have problem, see trace stack: e/androidruntime(2410): caused by: org.xmlpull.v1.xmlpullparserexception: binary xml file line #5: <bitmap> requires valid src attribute my xml file looks like: <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item> <bitmap android:src="@drawable/btn_1"/> </item> </layer-list> btn_1 xml file in drawable resources when i'm using image(*.png) instead of xml drawable it's ok. can use drawable resource src bitmap? in case here btn_1.xml file. doesn't work if btn_1 file have no items. <layer-list xmlns:android="http://schemas.android.com/apk/res/android" > <item android:drawable="@drawable/btn_arrow_bg_red"/> <item> <bitmap android:gravity="center" android:src="@drawable/btn_arrow_white" /> </item> </layer-list> you cant have xml dr

javascript - publish application settings (not documents) in Meteor -

i have couple settings need in application. want make couple of them available on client. did: meteor.startup(function () { meteor.publish('settings', function () { return { isauth: false } }); and i've subscription like meteor.subscribe('settings'); this doesn't work @ all, somehow have feeling works collections. question how can these settings in client. also, these settings needed render stuff, need data during init! if it's okay put configuration settings in code, marco says. if want specify them in json configuration file, use meteor.settings - in public field in configuration file available on client in meteor.settings.public . it possible publish/subscribe, it's overkill: // on server meteor.publish("applicationsettings", function () { this.added("settings", "arbitrary_string", {isauth: true}); this.ready(); }); // on client settings = new meteor.collect

java - Size cannot resloved to be a type -

i got error when try validate form..this corresponding class file public class myuser { @notnull @size(min=1,max=20) private string name; @min(0) @max(120) private int age; public myuser(string name, int age) { this.name = name; this.age = age; } public myuser() { name = ""; age = 0; } } here added corresponding javax.validation jar file in class path still got error.can give me suggestions. you have import javax.validation.constraints.* or javax.validation.constraints.size

php - Accessing image file uploaded in app folder from URL in Symfony -

i have uploaded image files under "app/upload" directory of symfony2 . and have defined domain root " web " directory in vhosts . how have access images browser's address bar, like, "my-domain.loc/app_dev.php/upload/img-001.jpg"? you not, publicly accessible should in web directory not app directory. source: http://symfony.com/doc/current/quick_tour/the_architecture.html#the-web-directory

android - intent.getExtra() returns null object -

i trying pass class object between 2 activities in android application, null on other activity. here code : to pass data : public void onitemclick(adapterview<?> adapterview, view view, int i, long l) { try { products mcurrentproduct = (products) adapterview.getadapter().getitem(i); intent mproductdescription = new intent(getbasecontext(), activity_productdescription.class); bundle mbundle = new bundle(); mbundle.putparcelable(globalstrings.extra_message_data, mcurrentproduct); mproductdescription.putextras(mbundle); if (mproductdescription != null) startactivity(mproductdescription); } catch (exception e) { log.d("selection erro :",e.getmessage()); } } to data : intent mintent = getintent(); bundle mbundledata = mintent.getextras(); products mcurrentproduct = (products) mbundledata.getparcelable(extra_message_data); products p = (products)

c# - ASP.NET LINQ Error Cannot create a query result of type 'System.Collections.Generic.List`1[System.Int32]' -

i trying create dictionary<string, list<int>> through linq statement it gives me following error: cannot create query result of type 'system.collections.generic.list`1[system.int32]' var output = ( e in edc.energideklarationer_as municipalityname.contains(e.municipality) group e e.municipality g select new { municipality = g.key, listan = new list<int>() { g.count(e => e.h== "el"), g.count(e => e.h== "eldningsolja"), g.count(e => e.h== "flis"), g.count(e => e.h== "markvarmepump"), g.count(e => e.h== "ved") } } ).todictionary(x => x.m

testing - Is it OK to name a function parameter window in JavaScript? -

is ok name function parameter window in javascript (if said parameter correspond window object @ runtime)? in short want inject window object function improve testability, aware hide direct access window object within function said parameter. window not reserved keyword , name parameter window if wanted to. using variable/argument common in iife's minimizing , keeping value of window constant, see things like (function(window, undefined) { // code })(window); and there no issues this, other maybe confusion if decide use like function stuff(window) { window.value = 'woot'; } stuff( document.queryselector('input') ); // confusing ? which confusing.

powershell - Prevent shortcuts pinned to the taskbar by a script from being removed when re-running the script -

i have script pins application shortcuts windows taskbar. the script have works fine when pinning shortcuts. however, if script run second time remove shortcuts pinned. the issue appears here: $appword = "c:\temp\word.lnk" $appword = "c:\temp\excel.lnk" $apps = @($appword, $appexcel) foreach($_ in $apps) { ($shortcuts.parsename($_).verbs() | ? {$_.name -match "tas&kbar"}).doit() } how can stop pinned items being removed if exist? exclude verbs have word "unpin" in them: $apps | % { $verb = $shortcuts.parsename($_).verbs() | ? { $_.name -match "tas&kbar" -and $_.name -notmatch 'unpin' } $verb.doit() }

etl - how to create a new record dynamically using informatica powercenter -

i have employee's leaves related data , payment related information. e.g. employee e1 has taken maternity leave year. needs paid 6 months , if on leave greater duration (like 8 months) , need create 2 records her. one allowed duration , other extended duration. employee leavestartdate leaveenddate total_days_taken total_days_allowed leavetype e1 1jan2013 31aug2013 242 186 ml target expected : employee leavestartdate leaveenddate leavetype e1 1jan2013 30june2013 ml e1 1july 2013 31aug2013 extended ml how can create second record dynamically in informatica mapping? generally speaking, use java transformation in informatica dynamically create new rows. however, scenarios 1 described, need create 1 row based on condition can achieve adding 2 target instances , populating second target instance conditionally (using router or filter transformation). you can this: create 2

javascript - joomla popup that should close only by click button -

i using popup anywhere plugin in joomla. have display article page detail on popup @ time of user log in. here popup close on click out side of popup screen also, dont want this. popup should close @ time of clicking "agree" button article have. please let me know if have other plugins or ideas. this should prevent window being closed clicking away element: $('#your-close-button').click(function(e){ e.stoppropagation(); });

javascript - Uncaught TypeError: Cannot read property 'sheet' of null -

i'm learning angularjs, , run in problem after changing function: glist : function (){ return list }, with this: glist : function() { $http({method:'get',url:'/sessions'}). success(function(data){ return data; }). error(function(data){ $log.info(data); })}, and receive error: uncaught typeerror: cannot read property 'sheet' of null (anonymous function) modernizr-2.6.2.min.js:4 y modernizr-2.6.2.min.js:4 s.fontface modernizr-2.6.2.min.js:4 (anonymous function) modernizr-2.6.2.min.js:4 (anonymous function) modernizr-2.6.2.min.js:4 the function called here: $scope.sessions = sessions.glist(); then ng-repeat="session in sessions" while don't use sheet in code. help? the problem here during time in http request got response,the ng-repeat sessions in script called. means value of sessions null , think try access {{ session.sheet }} in html undefined , browser telling you

Java Rest Web Service: '+' character inside String param is treated as space character -

my client app sends string servers side decode it. string in question may contain '+' characters. problem when want treat string, seams '+' chars gone (probably treated concatenation operators. how solve problem? string not right type that? should use byte[] instead? client side: $.ajax({ type: "get", url: "my/url/decryptstring", data: "encryptedstring="+$("#mystringinput").val(), ... code on server side: ... public string decryptstring(@queryparam("encryptedstring") string encryptedstring) { logger.info("=====> decryptstring()"); string decryptedstring = null; properties properties = new properties(); logger.debug("encryptedstring: " + encryptedstring); // crypto properties try { properties.load(toto.class.getresourceasstream("/config.properties")); } catch (ioexception e1) {

xamarin.ios - issues after updating to Xamarin Studio -

could not register assembly error messages getting: 'monotouch.dialog-1': monotouch.monotouchexception: cannot register 2 managed types('monotouch.dialog.basebooleanimageelement+textwithimagecellview, monotouch.dialog-1, version=0.0.0.0, culture=neutral, publickeytoken=84e04ff9cfb79065' and 'monotouch.dialog.basebooleanimageelement+textwithimagecellview, xxxxx1, version=0.0.0.0, culture=neutral, publickeytoken=null') same native name('monotouch_dialog_basebooleanimageelement_textwithimagecellview'). tried mtouch arguments --registrar:legacy , not able fix issue. you've included both monotouch.dialog-1.dll , monotouch.dialog.dll in app. choose one.

MongoDB IDs - will two collections have the same ids? -

this question has answer here: possibility of duplicate mongo objectid's being generated in 2 different collections? 4 answers ok, have members collection , pet members collection, understand basic workings on how ids generated, there chance id gets assigned pets collection same members collection? the reason ask, improving social networking site, uses mongodb @ core. while social site give each pet id ( case if owner buys id ) use "_id" or '$id' main id in our database. so question possible knowing 2 totally separate collections end same id each other? - don't want. mongodb's objectid unlikely collide. contains counter, random number, process id, etc. objectids generated on different servers have different random number, process id, etc. objectids generated on same server differ in counter part.

oop - Python base class that makes abstract methods definition mandatory at instantiation -

i have base class define couple of empty methods. enforce/make mandatory definition of these methods in subclass , make crash @ init in case not overriden. ex: class shape: def __init__(self, name): self.name = name def number_of_edges(self): pass # method has overloaded in subclass class triangle(shape): def __init__(self, name): super(triangle, self).__init__() def number_of_edges(self): return 3 it seems python way raise notimplementederror : def number_of_edges(self): raise(notimplementederror) but beneficial crash , detect lack of implementation during class instantiation. why not default, , can done? use abc module create abstract base class. import abc class shape(object): __metaclass__ = abc.abcmeta def __init__(self, name): self.name = name @abc.abstractmethod def number_of_edges(self): pass any method decorated @abc.abstractmethod decorator trigger typeerr

django - Python - inheritance - constructor not called -

this class structure: class mymixin(object): def __init__(self, **kwargs): super(mymixin, self).__init__(**kwargs) class mybaseview(mymixin, templateview): def __init__(self, **kwargs): print 'mybaseview init' super(mybaseview, self).__init__(**kwargs) class mycommonview(mybaseview): def __init__(self, **kwargs): print 'mycommonview init' super(mycommonview, self).__init__(**kwargs) class myview(mycommonview): def __init__(self, **kwargs): print 'myview init' super(myview, self).__init__(**kwargs) in urls.py: url(r'^some/url/$', myview.as_view()) also, there instance variables defined in each constructor. didn't write them here because don't think relevant. result... myview , mycommonview init messages printed, mybaseview doesn't. so, mybaseview's constructor never gets called. know fact constructor isn't called because see things not initialized