Posts

Showing posts from July, 2014

oracle - Ora-29283 error on 11g -

is possible access folder on pc oracle database? in other words database not installed on local machine , have created folder on pc 'c:\lob' want save images retrieved database, returning ora-29283 error: invalid file operation. i sure directory created because can see in directories folder in database. problem? because folder created on pc , database somewhere else? below procedure: create or replace procedure blob_update (file_name in varchar) file_ref utl_file.file_type; raw_max_size constant number := 32767; begin file_ref := utl_file.fopen('my_dir', file_name, 'wb', raw_max_size); -- here stops working ! -- .... utl_file.fclose(file_ref); end blob_update; pl/sql run in database system, i.e. on server. can access files on server. cannot files on pc. even if have defined directory in oracle ( create directory ... ) , granted sufficient access rights user, fail because oracle try access c:\lob on server , not

PHP Cookies works well on localhost, but it's not working on server -

i facing problem setcookie(), working fine on localhost not on server, issue happened when changed unicode webpages , database utf-8. following snippet of code: if(isset($_get['langid'])) { $langid = $_get['langid']; setcookie('langid', $langid); } elseif (isset($_cookie['langid'])) { $langid = $_cookie['langid']; echo $_cookie['langid']; } else { $langactive=mysql_query("select * languages id=2 , active=2"); $langactive=mysql_fetch_array($langactive); if (empty($langactive)){ $langid = 0;} else{ $langid = 2; } }

ios - UIBezierPath for Rounding Corner of Button not work properly -

Image
i made class uibutton , override awakefromnib. next (green button) use class. i have space in right of next button (green one). space more in ipad: override func awakefromnib() { super.awakefromnib() let path = uibezierpath(roundedrect: self.bounds, byroundingcorners: [.topleft, .bottomleft], cornerradii: cgsizemake(5, 5)) let masklayer = cashapelayer() masklayer.path = path.cgpath self.layer.mask = masklayer self.layer.bordercolor = mycolor.nextbuttonborder.cgcolor } you should put code in layoutsubviews() method. don't forget delete previous added masklayer. full example: override func layoutsubviews() { super.layoutsubviews() self.layer.mask = nil let path = uibezierpath(roundedrect: self.bounds, byroundingcorners: [.topleft, .bottomleft], cornerradii: cgsizemake(5, 5)) let masklayer = cashapelayer() masklayer.path = path.cgpath self.layer.mask = masklayer self.layer.bordercolor = mycolor.nextbut

Is there a Google Datastore adapter which is used to access Datastore in rails? -

in rails, can use adapter of sqlite3 access sqlite3 database. want use datastore database. there google datastore adapter sqlite3's ? development: adapter: sqlite3 database: db/development.sqlite3 has been tried? yes. idea? probably not. activerecord object relational manager built around relational sql databases. sqlite adapter adapter lets activerecord talk sqlite. while can swap mysql, postgresql or oracle adapter going on no-sql land not smooth sailing. there reason separate rails orms mongoid mongodb exist. concepts in non-relational database different , not should abstracted away adapter.

hadoop - What is best way to multiple dataframe? -

i have 4 data frame. df1 name,id, age df2 name,id,group df3 name,id,city df4 name,id, ctry i join 4 dataframe macth of same 'name' , 'id'. e.g df name, id,age,group,city,ctry try: list(df1, df2, df3, df4).reduce(_ join (_, seq("name", "id")))

android - Need fit in LinearLayout icons on every device -

i hope atleast try me :) i beginner , sorry english. my problem: need fit linearlayout on every device , not know how (it fits on phone, think not fit on others) <android.support.v7.widget.cardview android:layout_width="match_parent" android:layout_height="70dp" android:layout_marginbottom="@dimen/spacing_medium" android:layout_marginleft="@dimen/spacing_middle" android:layout_marginright="@dimen/spacing_middle" android:layout_margintop="@dimen/spacing_large" app:cardcornerradius="@dimen/card_corner_radius" app:cardelevation="@dimen/elevation_card"> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:padding="@dimen/spacing_medium" android:weightsum="1"> <linearlayout

Why i can not save list in c# list? -

i'm new in c# , write class: public class manager { public string versionname { get; set; } public double value { get; set; } } , use this: list<manager> lstsummary = new list<manager>(); manager summary = new manager(); summary.versionname = "12"; summary.value =12; lstsummary.add(summary); summary.versionname = "13"; summary.value = 19; lstsummary.add(summary); code save latest class record ,means save versionname=13 , value=19 ,how can solve problem?thanks. you have re-instantiate summary variable so: manager summary = new manager(); summary.versionname = "12"; summary.value =12; lstsummary.add(summary); summary = new manager(); // <-- add summary.versionname = "13"; summary.value = 19; lstsummary.add(summary);

javascript - Cannot make a simple http GET call in Angular2 -

i trying make simple http get request angular2 app: this.http.get("https://mybaseurl.com/hello") .map(res => res.json()) .subscribe( function(response) { console.log("success response" + response)}, function(error) { console.log("error happened" + error)}, function() { console.log("the subscription completed")} ); the node.js server configured way: app.get('/hello', function(req, res) { res.send("hellow world"); }); when make call keep getting error: caused by: unable parse url 'https://mybaseurl.com/hello'; original error: cannot read property 'split' of undefined @ inmemorybackendservice.parseurl (in-memory-backend.service.ts:518) @ inmemorybackendservice.handlerequest (in-memory-backend.service.ts:279) @ inmemorybackendservice.createconnection (in-memory-backend.service.ts:240) any idea doing wrong? edit: pasting entire class code: import {com

c# - Align TextBlock in Button / StackPanel correctly -

Image
i try align textblocks left. button should take rest of area (up picture). how can this? this uwp / c# app. <grid> <grid.columndefinitions> <columndefinition width="*"/> <columndefinition width="auto"/> </grid.columndefinitions> <grid.rowdefinitions> <rowdefinition/> </grid.rowdefinitions> <grid verticalalignment="center" horizontalalignment="left"> <button background="transparent" horizontalalignment="stretch"> <stackpanel horizontalalignment="left"> <textblock x:name="textblock1" textwrapping="wrap" text="name1"/> <textblock x:name="textblock2" textwrapping="wrap" text="name2" /> </stackpanel> </button> </grid> <stackpanel

node.js - Cordova - Inappbrowser facebook login -

i'm trying implement facebook login in app. have 3 scenarios : user use desktop browser (working). user use mobile app, hasn't fb app ( not working working ). user use mobile app, logged fb app (not working). so how proceed: i'm opening inappbrowser myserver.com/auth/facebook facebook auth app identified appears user enters crendentials, , fb callbackurl direct either myserver.com/auth/fb_success or myserver.com/auth/fb_fail in fb_success & fb_fail page, send postmessage defining state (success/fail) it works fine on desktop browser, not on mobile app (i'm getting blank page). i know inappbrowser not real dom window object, , cordova window doesnt support opener, postmessage not available: https://issues.apache.org/jira/browse/cb-4897 so wanted check location url, don't know how can access information. when redirects occurs, seems no more information available. tried figure out why loadstop event isn't showing me these url, no luc

java - Fetch an EmbeddedId with a jpa query -

i have following entity embedded id : public class refmoduleprofile { private string pertinance; @embeddedid private refmoduleprofilepk pk = new refmoduleprofilepk(); } @embeddable public class refmoduleprofilepk implements serializable { @manytoone private refmodule module; @manytoone private refprofile profile; } now want load refmoduleprofile refprofile , refmodule fetched : @query("select rmp refmoduleprofile rmp inner join fetch rmp.pk.module rmp.pk.profile = :profile") list<refmoduleprofile> findbyprofilwithfetchedmodule(@param("profile") refprofile profile); this request generate following sql : /* select rmp refmoduleprofile rmp inner join fetch rmp.pk.module rmp.pk.profile = :profile */ select refmodulep0_.id_module id_modul2_36_0_, refmodulep0_.id_profile id_profi3_36_0_, refmodule1_.id_module id_modul1_34_1_, refmodulep0_.module_profile_pertinance module_p1

html - Highlights and active/redirect to bootstrap tab if error raised by jQuery validation plugin -

i have form multiple tabs using bootstrap tabs. html tabs structure like:- <div class="tabs-container"> <ul class="nav nav-tabs"> <li class="active"><a data-toggle="tab" href="#tab-1"> tab 1</a></li> <li class=""><a data-toggle="tab" href="#tab-2"> tab 2</a></li> </ul> <div class="tab-content"> <div id="tab-1" class="tab-pane active"> <div class="panel-body"> <fieldset class="form-horizontal"> <!--form field here--> </fieldset> </div> </div> <div id="tab-2" class="tab-pane ">

java - How clean up activity task candidates properly? -

it needed clean (modify) candidategroups , candidateusers in task listener: @override public void notify(delegatetask delegatetask) { delegateexecution execution = delegatetask.getexecution(); set<identitylink> candidates = delegatetask.getcandidates(); (identitylink candidate : candidates) { // ??? delegatetask.deletecandidategroup(candidate.getgroupid()); delegatetask.deletecandidateuser(candidate.getuserid()); } } the question call? there 2 different methods deleting group , user. method candidate.gettype() can helpfull identifying usr or group, org.activiti.engine.task.identitylinktype has values: public class identitylinktype { public static final string assignee = "assignee"; public static final string candidate = "candidate"; public static final string owner = "owner"; public static final string starter = "starter"; public static final s

Rails 5, Ajax, jQuery - increase number when button clicked -

if user clicks "add cart" button, need increase number 1 in navbar div, show how many products in cart. so, button has remote: true set and navbar has div id count . function use increase number: $('#count').html(function(i, val) { return val*1+1 }); but if reload page value disappears. how can make value stay there until action, 'checkout'? or maybe there better way this? create model method or helper method user finding count of active cart items. provides accurate value too. for example: class user < applicationrecord has_many :cart_items def active_cart_items return self.cart_items.group_by(&:product_id).count #.where(status:active) (optional) end end create ur_action.js.erb under ur_controller in set items in cart counter $('#count').html("<%=@user.active_cart_items%>")

java - i want to sum a column of sql table where date is current date -

i want sum values of column date today's date , pass variable. wrote following code it's not working. error: "column name sum(bill_total) not valid." considering "sum(bill_total)" column. string sql = "select sum(bill_total) t_report date=?"; preparedstatement pst = con.preparestatement(sql); pst.setdate(1, date); resultset rs = pst.executequery(); string sum=rs.getstring(sql); can tell me whats wrong query. in advance is me or error when you're fetching result? string sql = "select sum(bill_total) bill_total t_report date=?"; preparedstatement pst = con.preparestatement(sql); pst.setdate(1, date); resultset rs = pst.executequery(); string sum=rs.getstring("bill_total");

html - CSS text on the middle of div (div height:20%) -

<style> ._1{ height:20%; width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; } </style> <div class="_1">content</div> how make content align @ middle of div? thanks. demo edit: height % not px. set line-height: 20% it's not work. div{ height: 20%; width: 100%; text-align: center; display: flex; flex-direction: column; flex-wrap: nowrap; justify-content: space-around; align-content: center; }

dictionary - getting key-value pairs of custom object in python -

i working python boto package called mws interfacing amazon mws. think general python question, still not sure. using list_oder_items method product items order. items = conn.list_order_items(amazonorderid = order_id) result = items.listorderitemsresult then want save each item. for item in result.orderitems.orderitem: save_item_to_db(item) here item variable type <class 'boto.mws.response.orderitem'> , if print out shows this: orderitem{}(title: u'title', giftwrapprice: usd 0.00, conditionnote: u'brand new& authentic product....', codfee: none, asin: u'xxxx', orderitemid: u'xxxx', codfeediscount: none, quantityshipped: u'1', giftwraptax: usd 0.00, shippingprice: usd 3.99, quantityordered: u'1', itemtax: usd 0.00, promotionids: [], sellersku: u'xxxx', shippingdiscount: usd 0.00, shippingtax: usd 0.00, conditionid: u'new', promotiondiscount: usd 0.00, itemprice: usd

amazon web services - Need help regarding aurora DB scaling -

i need scale aurora db , down @ later sometime dont need downtime not bit. though of doing creating aurora replica , promoting scaling primary , promoting primary. involve downtime. please suggest alternative way. i first ask in sense need scale up? writing? reading? if run server high-read/low-write ratio, i'd suggest read-replica (or more) , configure application use read replica in specific cases you're making queries , not modifying data. in sense, you're offloading writes separate instance of same data , letting primary deal writes. if did this, i'd suggest spreading out read replicas across other availability zones, in case az of primary goes down, read-replica auto-promoted primary. armed info, suggest scale read replicas application configured use, can bring down replicas scale down without ever bringing down aurora primary. it's more of configuration problem in dealing multiple rds endpoints, essentially. hth. one caveat there delay in r

c# - How to create a file if it doesn't exist yet and add new text? -

my code works fine creating file if doesn't exist , inserting new text, or if file exists, rewrites current contents. path = @"c:\my folder\data.txt"; filestream files = null; bool done = false; while (!done) { done = true; try { filestream filestream = file.open(path, filemode.openorcreate); filestream.setlength(0); filestream.close(); files = file.openwrite(path); } catch (ioexception ex) { done = false; // thread.sleep(3); } } using (streamwriter fs = new streamwriter(files)) { fs.write(texta); fs.close(); }; files.dispose(); now need change doesn't rewrites contents anymore instead add new text previous contents. second, need know if file empty , in case insert texta or if there contents , in case add textb . try this string path = @"your file path"; bool done = false; while (!done) { done = true;

c# - Xamarin Forms Effect -

i create effect customize switch element in xamarin forms found error (specified cast not valid) in line 15. idea change this? class bellow using android.graphics; using android.widget; using puuber.droid.platform; using xamarin.forms.platform.android; [assembly: xamarin.forms.exporteffect(typeof(pinkswitcheffect), "pinkswitcheffect")] namespace puuber.droid.platform { class pinkswitcheffect: platformeffect { protected override void onattached() { var toggle = (android.widget.switch)control; xamarin.forms.color gold = xamarin.forms.color.fromhex("#fcb741"); toggle.trackdrawable.setcolorfilter(new porterduffcolorfilter(gold.toandroid(), porterduff.mode.srcin)); } protected override void ondetached() { // use method if wish reset control original state } } my xaml file this, effect add in xaml file: <?xml version="1.0" encoding="utf-8" ?> <contentpage xmlns="

Replace rows in a dataframe by matching individual rows of another dataframe in R -

i've 2 dataframes , want replace rows of first dataframe inserting rows of second dataframe. following did until now, not result want have. df1 <- data.frame(a = c(0, 0,0,0 ,1, 1, 1, 2, 2), b = rep(0, 9)) df2 <- data.frame(a = c(1, 1), b = rep(1, 2)) df1[match(df2$a, df1$a), ] <- df2 > df1 b 1 0 0 2 0 0 3 0 0 4 0 0 5 1 1 6 1 0 7 1 0 8 2 0 9 2 0 what want have dataframe adopts second row of df2 , looks following: > df1 b 1 0 0 2 0 0 3 0 0 4 0 0 5 1 1 6 1 1 7 1 0 8 2 0 9 2 0 is there function kind of matching? the point have rows(5,6,7) identical values: > which(df1$a %in% df2$a) [1] 5 6 7 > df1[which(df1$a %in% df2$a),] b 5 1 0 6 1 0 7 1 0 so if join or replace, 1 condition not enough replace rows 5,6 , exclude 7 in desired result. if want replace n rows, n=the number of rows in df2, can use following. replace first 2 rows a=1. df1[which(df1$a %in% df2$a)[1:nrow(df2)],] <- df2 > df1 b 1 0 0 2 0 0 3 0 0 4 0 0 5 1 1

java - Splitting Object -

i'm implementing interface setobject accept string, int, double etc. data type use in insert statement. when inserting data in database gives me values [a,b,c] [a,b,c] [a,b,c] . how can avoid output? interface: public interface callablestatement { arraylist<object> mylist = new arraylist<>(); public void setobject(arraylist<object> mylist); } public class position implements callablestatement { string departmentname; string departmenttype; string departmentdescription; public position() { array(); } public void array() { arraylist<object> mylist = new arraylist<object>(); mylist.add(departmentname); mylist.add(departmenttype); mylist.add(departmentdescription); } @override public void setobject(arraylist<object> mylist) { string query = "{call insertpositions(?,?,?)}"; try(connection con = dbutil.getconnection

What is the difference between == vs equals() in Java? -

i wanted clarify if understand correctly: == -> reference comparison, i.e. both objects point same memory location .equals() -> evaluates comparison of values in objects am correct in understanding ? in general, answer question "yes", but... equals compare written compare, no more, no less. if class not override equals method, defaults equals(object o) method of closest parent class has overridden method. if no parent classes have provided override, defaults method ultimate parent class, object, , you're left object#equals(object o) method. per object api same == ; is, returns true if , if both variables refer same object, if references 1 , same. testing object equality , not functional equality . always remember override hashcode if override equals not "break contract". per api, result returned hashcode() method 2 objects must same if equals methods shows equivalent. converse not true.

How to split in R a date range into quarterly basis period? -

i want split monthly date range quarterly basis period. date variable built as.yearmonth: > data$dates jul. 2014 ago. 2014 sep. 2014 ... ... jun. 2016 jul. 2016 ago. 2016 sep. 2016 how should it? cut function works dates? don't want manually. lubridate has quarter function. check out: library(lubridate) x <- ymd(c("2012-03-26", "2012-05-04", "2012-09-23", "2012-12-31")) quarter(x) quarter(x, with_year = true) then thing have sort out date formats understood.

css - block ng-animate when going to the same state -

(solution on bottom of post). currently we've problem in our project using ng-animate . we've got 2 states, lets name them now: state 1 , state 2. both have state name div class. <div class="state1"> . now state1 should slide top, , slide2 should slide in bottom. working fine when switching between slide1 , slide2. however, if user clicks on button moves state1 (when being on state1) content should change , no animation should done. currently use: .state1.ng-leave { } leaving animation on state1 div, , .state2.ng-enter { } on entering state. can see, when i'm on state1 , clicking on button give page state1 still .state1.ng-leave { } called , animation done. anyone got solution us? ng-leave {} state1 should triggered state2 entering. state1/state2 flow things we've tried: we tried add state('home.state1', { } block ng-animation state1. when enter state1, never need animation. didn't find solution using this. there can

drjava - Java-Storing values in a while loop -

i beginner in java , have assignment on loops. know question may sound basic couldn't find understandable answer. code looks like; import java.util.scanner; public class histogram { public static void main( string[] args) { scanner scan = new scanner( system.in); // constant final string ch = "*"; // variables int number; int count; int start; int width; int line; string output; // program code count = 0; number = 0; start = 1; width = 0; line = 0; output = ""; // creating loop while ( start == 1) { system.out.println( "enter numbers"); number = scan.nextint(); if ( number < 0 ) { start = 0; } else { while ( width < number) { output = ch + " " ; width = width + 1 ; system.out.print(output); } width = 0; } } }

ios - Comparing 2 UIColor(s) -

this must have been asked before, cannot find suitable reference. have found question , compares 3 numbers each other. i trying compare 2 uicolor(s) avoid duplication. each color referenced in r, g, b, alpha. form colors can control number formatting. what appropriate way handle this? all appreciated. if creating color same way can use == . if colors in different color spaces , want compare rgba value use following: extension uicolor { func equals(_ rhs: uicolor) -> bool { var lhsr: cgfloat = 0 var lhsg: cgfloat = 0 var lhsb: cgfloat = 0 var lhsa: cgfloat = 0 self.getred(&lhsr, green: &lhsg, blue: &lhsb, alpha: &lhsa) var rhsr: cgfloat = 0 var rhsg: cgfloat = 0 var rhsb: cgfloat = 0 var rhsa: cgfloat = 0 rhs.getred(&rhsr, green: &rhsg, blue: &rhsb, alpha: &rhsa) return lhsr == rhsr && lhsg == rhsg &&

Flash Notice Alert dismiss-able bootstrap and rails -- Cannot Delete flash notice -

i using emailer ruby on rails , has flash notice on completion. cannot seem delete bootstrap flash notice when press x button listed next flash notice. have tried jquery. whenever put class close on button. button not show clicked. here of code. create.html.erb <div> <% flash.each |key, value| %> <div class="alert-dismissible flash_notice" role="alert"> <button type="button" data-dismiss="alert" aria-label="close">xxx<span aria-hidden="true">&times;</span></button> <%= value %> </div> <% end %> </div> this contact controller emails me contact me form , renders flash notice class contactscontroller < applicationcontroller def new @contact = contact.new end def create @contact = contact.new(params[:contact]) @contact.request = request if @contact.deliver flash.now[:notice] = 'thank me

c# - Good practice for protecting personal information? -

i have property holds personal information. trying figure out best approach guard against kind of privacy violation: heap inspection. have far: private static securestring _testpi; public static string testpi { { return converttostring(_testpi); } set { _testpi= converttosecurestring(value); } } as can see have 2 methods converttostring , converttosecurestring . methods name points out convert string taken user or database , converts securestring, converted regular string when property called. also when class instantiated whatever need class set instance null . testclass mytest = new testclass(); mytest.testpi= teststring; validatepi(mytest.testpi); mytest = null; is best practice? i using .net framework 4.5.1

How can I connect two outlook accounts? -

i have 2 outlook mail accounts, example , b. connected them in account. can b accounts mails in account. when delete b account mail account, deleting on a. want outlook delete mail b account too. how can that? i found answer, new outlook "connected accounts" doesnt let deleting mails source.

sql server - INSERT failed because the following SET options have incorrect settings: 'QUOTED_IDENTIFIER' -

we getting below message while executing stored procedure, after without change deleting , re-executing stored procedure working fine. dbcore insert failed because following set options have incorrect settings: 'quoted_identifier'. verify set options correct use indexed views and/or indexes on computed columns and/or filtered indexes and/or query notifications and/or xml data type methods and/or spatial index operations. kindly understand this. quoted_identifier "sticky" option setting in effect when procedure created used @ runtime. since no procedure changes made, error suggests stored procedure created quoted_identifier off , index 1 of types mentioned in error message created/dropped. recreate stored procedure both quoted_identifier on , ansi_nulls on avoid problem going forward.

java - In 2016, do we still need to use BouncyCastle to work around the Export Control Restrictions on Cryptography that US Government imposes? -

many people use bouncy castle use wonderful implementations of java cryptography api (jca) ciphers, messagedigests, etc. many use circumvent export control restrictions imposes on usage of cryptography key lengths exceeding 128 bits. however, have read somewhere in 2016, there changes in restrictions govt imposes. can stop using bouncy castle , switch native java jca provider if reason why used in project? can throw light on ? yes. it's called java 9. try it. can disable export control programmatically . besides that, bouncy castle provider does not circumvent export control, lightweight api does. because cipher class contains constraint, , service provider implementations (spi's) used through class.

java - Maven 'Select Dependency' adding old artefact versions to pom.xml -

Image
i decided add dependencies pom.xml file using 'select dependency' functionality. when added selenium-java dependency, observed version added 2.42.2 instead of latest version of 3.0.1. double-checked central repository make sure 3.0.1 available, is. although can manually edited, why old version being called pom? see image attached. the usual reason indices not correct. there various possible reasons that: in eclipse, "download remote indices" not activated. the indices not downloaded correctly, check in "maven repositories" view. the index of (company) nexus broken , has updated/repaired. all in all, find indices out of date.

python - Delta time string to datetime object -

given string looks "hours:5 minutes:34 seconds:28" or "minutes:34 seconds:28" , there pythonic way convert datetime object? not want use regex if there's easier way. yes, there is. can this: import time datetime_string = "hours:5 minutes:34 seconds:28" if "hours" in datetime_string: datetime_object = time.strptime(datetime_string, "hours:%h minutes:%m seconds:%s") elif "minutes" in datetime_string: datetime_object = time.strptime(datetime_string, "minutes:%m seconds:%s") else: datetime_object = time.strptime(datetime_string, "seconds:%s") note : when create datetime object, values not provide filled default values.so, in case datetime_string contains seconds, hours , minutes set 0 .

powershell - Is Out-Host buffering? -

i ha function, call application & operator. application produces several line command line output, downloads files, , returns string: & "app.exe" | out-host $var = ... return $var it seems, on console appears output produced app.exe after app.exe terminates. user not have real time information file downloading. there way continuously update console when app.exe running? many console applications buffer theirs output stream, if known redirected. actually, it standard behavior of c library . so, buffering done app.exe , because of redirection, not out-host . solution not redirect output of app.exe , when outer command redirected. should know exact condition, when powershell not redirect output stream of console application , link directly own output stream, console interactive powershell.exe session. conditions is: command last item in pipeline. command piped out-default . solution wrap command script block, , pipe script block out-defaul

swift - iOS: How to properly add my own Frameworks to my App? -

i have workspace app project , multiple pure swift frameworks. framework a dependent on framework b . i go framework a's target, "linked frameworks , libraries", click "+". in pop-up dialog there folder "workspace" framework b listed. pick , click "add". when right click on , "reveal in project navigator" , @ file inspector, location set "relative group" , path is: ../myapp/deriveddata/myapp/build/products/ release-iphoneos /b.framework other times set to ../myapp/deriveddata/myapp/build/products/ debug-iphoneos /b.framework here confused: picked automatically? if set release-folder start in trouble when want build debug purposes (either no such module , or doesn't find methods, or...). have change scheme of b's target? first have rebuild b before can add right version a . it's hard pick right question, because i'm quite confused whole thing. shed light on this?

javascript - How to fix number of days mismatching at the change of the year -

in this code , var date1 = new date("1/1/2010"); var date2 = new date("12/31/2010"); var timediff1 = gettimediff(date1, date2); var date3 = new date("1/1/2011"); var date4 = new date("12/31/2011"); var timediff2 = gettimediff(date3, date4); var date5 = new date("1/1/2010"); var date6 = new date("12/31/2011"); var timediff3 = gettimediff(date5, date6); var diffdays1 = getdiffdays(timediff1); var diffdays2 = getdiffdays(timediff2); var diffdays3 = getdiffdays(timediff3); console.log('no. of days between ' + date1 + ' & ' + date2 + ' ' + diffdays1); console.log('no. of days between ' + date3 + ' & ' + date4 + ' ' + diffdays2); console.log('however,\nno. of days between ' + date5 + ' & ' + date6 + ' ' + diffdays3); function getdiffdays(timediff) { return math.ceil(timediff / (1000 * 3600 * 24)); } funct

javascript - Table date column formatting with google apps script html service -

i having problems figuring out basic table formatting. hoping can see have , suggest way of changing outcome. google spreadsheet has 2 columns 'number' , 'date'. my codegs looks function doget() { return htmlservice .createtemplatefromfile('index') .evaluate(); } function getdata() { return spreadsheetapp .openbyid('1111111111111111111111') .getactivesheet() .getdatarange() .getvalues(); } my index.html <? var data = getdata(); ?> <!doctype html> <html> <style> body { font-family: arial; } table { border: 1px solid #ccc; width: 100%; margin:0; padding:0; border-collapse: collapse; border-spacing: 0; } table tr { border: 1px solid #ddd; padding: 5px; } table th, table td { padding: 10px; text-align: left; } table th { text-transform: uppercase; font-size: 14px; letter-spacing: 1px; } </style>

sql server - Decrease execution time of SQL query -

Image
i've got question in terms of processing , making query more efficient whilst maintaining accuracy. before display query i'd point out basics of it. i've got case manipulates where -clause childs of parent. i've got 2 types of data need display; red , green type. red type has column ( trk_trackergroup_lkid2 ) set null default, whereas green data has value in said column (ranging 5-7 ). my problem need extract both types of data accurately count of outstanding issues in view, doing (by adding case) execution time goes < 1 second on 15 seconds . this query (with mentioned case): select ts.id trackerstartdateid, tsm.mappingtypeid, tsm.maptoid, tflk.trk_trackergroup_lkid, count(tf.id) cnt [dbo].[trk_startdate] ts inner join [dbo].[trk_startdatemap] tsm on ts.id = tsm.trk_startdateid , tsm.deletedflag = 0 inner join [dbo].[trk_trackerfeatures] tf on tf.trk_star

shallow copy - What is the difference between MemberwiseClone() and Assigning a Reference type in C#? -

if have code class student { public string rollid { get; set; } } class person { public student student { get; set; } public string address { get; set; } public string name { get; set; } public person clone() { return (person)this.memberwiseclone(); } } class client { static void main() { student s1 = new student(); s1.rollid = "151"; person p1 = new person(); p1.address = "bombay"; p1.name = "foo"; p1.student = s1; person p2 = p1.clone(); p2.student.rollid = "1558"; person p3 = p1; p3.student.rollid = "454"; } } and when change value of p2 changes value of p1 , same result when change value of object p3. question if both logic same thing real difference between assigning , using memberwiseclone() method. there other advantage if use memberwiseclone() method? the issue here you're doin

javascript - sails.js - Using models with a custom service instead of a connection -

i'm working in bit of weird situation need create api connects different database based on supplied parameters in request. write api in sails.js because i've worked bit (as opposed other frameworks). my problem cannot make dynamic connection in it, connections loaded upon lifting. i've found few related answers. first 1 https://stackoverflow.com/a/34845674/7131845 , says use custom service handle connection dynamically , suggests use of models it. , second 1 one: https://stackoverflow.com/a/38458390/7131845 pretty that. i did myself: i've created service handles connection database provided parameters, issue don't know how connect model work service instead of connection/adapter set. appreciate help.

Restoring an altered SQL Server database with an original MDF -

i'm using sql server 2008 r2 instance , inadvertently deleted column of id's restore. i have original mdf , ldf . can detach altered database , restore original status attaching new database using original mdf ?

javascript - How to download multiple images from url in nodejs -

here code in express.js - var writestream = fs.createwritestream('./uploads/streetview/images/' + image_name + '.jpg'); writestream.on('close', function() { console.log('file done'); }); request(g_url).pipe(writestream); its working file few image urls. when there more 1000, images gets distorted or corrupted.

openlayers 3 - Changes in a GeoJson file do not refresh on the map -

i create layer geojson file. made changes file , hope changes can reflected on map. map stays same. i think should force map reload json file wonder how that. i had same issue , how solved it: consider using vector loader function handle fetching geojson files. i've had numerous caching issues not using vector loading function fetch geojson files , method below eliminated problem. example: var utils = { refreshgeojson: function(source,url) { var = date.now(); if (typeof url == 'undefined') { url = source.geturl(); } url += '?t=' + now; //add current time prevent browser caching console.info('refreshgeojson url: ' + url); this.getjson(url).when({ ready: function(response) { var format = new ol.format.geojson(); var features = format.readfeatures(response, { featureprojection: 'epsg:3857' }); console.dir(features); console.log(features.length); source.addfeatures(fea

android - How to use OpenGL by using OpenCV Camera -

i'm using org.opencv.android.javacameraview opencv4android preview camera view , use opencv process pic. want use opengl draw on view. no idea so. can directly draw on mat opengl or must draw opengl images on javacameraview? the layout looks this: <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:opencv="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/activity_camera" android:layout_width="match_parent" android:layout_height="match_parent" android:padding="0dp" android:paddingbottom="@dimen/activity_vertical_margin" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" tools:context="com.croxx.o

Any way to catch potentially undefined variables in Python? -

although enjoy working python, i'm big fan languages enforce variable declaration before use, because catches silly spelling mistakes in variables before code run. is there utility can scan python files , warn if thinks variable potentially undeclared? there no pure python utility know of can perform function want. however, dynamic variable declaration can used part of program flow the try...except structure: if some_input: = 5 try: print except nameerror: do_something

sql - SSRS Numbers appear differently than same view in Excel -

in ssrs, have report running pulls sql view, reason showing insanely wrong numbers particular campaign. for example, getting in ssrs: ssrs numbers ssrs designer: i.stack.imgur.com/lohaf.png (cant post more 2 links as opposed exact same view being shown in excel: excel numbers it seems lead not have locks or closes being aggregated 1 campaign reason. joining 2 views becuase there data 2 different systems. works flawlessly within excel, stumped why cannot working in ssrs. i appreciate help. thanks sql view code select * xxviableleadsvelocifyencompassgrpcampaign left outer join xxlocksandcloses on xxlocksandcloses.campaign = xxviableleadsvelocifyencompassgrpcampaign.title xxviableleadsvelocifyencompassgrpcampaign select c.[campaignid], c.[title], c.[lead_ct], cast(c.[cost] int) "cost", cast(c.[cost per lead] int) "cost per lead", count(v.leadid) "viable leads", cast(cast(c.[cost] int)/count(v.leadid) decimal(10,2)) "c

cluster analysis - R Univariate Clustering by Group -

Image
i trying find method cluster univariate data group. example, in data below have 2 failure codes (a , b) , 6 data points each grouping. in plot can see each failure code there 2 distinct clusters failure time. manually isn't bad, can't figure out how larger data set (~100k rows , ~30 codes). end result give me medoid each cluster , count of codes in cluster. library(ggplot2) failure <- rep(c("a","b"),each=6) ttf <- c(1,1.5,2,5,5.5,6,8,8.5,9,14,14.5,15) data <- data.frame(failure,ttf) qplot(failure, ttf) results <- data.frame(failure = c("a","b"), m1 = c(1.5,8.5), m2 = c(5.5,14.5)) i end result give me table below. failure m1 m1count m2 m2count 1.5 3 5.5 3 b 8.5 3 14.5 3 this want, assuming 2 clusters per failure group, though change in tapply apply failure groups. res2 <- tapply(data$ttf, index = data$failure, function(x) kmeans(x,2)) res3 <- lapply(names(re

How to return List<String> from java to R (with rjava package)? -

i know how call java code strings, integers or java objects calling list of strings ? in document https://cran.r-project.org/web/packages/hellojavaworld/vignettes/hellojavaworld.pdf there table of how call types can find abbreviation lists. my function in java public list<string> getobjnames() { return this.obj; } i need call function rstudio rjava package. r code: list <- function (mydata){ hjw <- .jnew("fcamp/util/datareader/jsondatareader") outref2 <- .jcall(hjw, "lfcamp/input/context;", "readdata", evalstring = t, mydata) result <- .jcall(outref2, "???", "getobjnames", evalstring = false) return(result) } have ever seen abbreviation or document supposed use instead of "???" thanks advice :)

xml - Java web services. Validating incoming datas -

i'm working on implementing values validations in web service didn't develop , (to honest) i'm not (yet) java web services framework. the "entrance" method of ws defined this: @suppresswarnings({ "rawtypes", "unchecked" }) @post @produces({ mediatype.application_xml, mediatype.application_json }) @consumes({ mediatype.application_xml, mediatype.application_json }) @path("calculobaremo/calculobaremonuevo") public baremonuevoout calculobaremonuevo(@context httpservletrequest request, baremonuevoin baremonuevo)throws remoteexception{ ... } so can handle class baremonuevoin generated xml send web service. i have control hipotetic numeric field should receive numeric values (either integer or decimal -double-). let's take, example, fields integer , double. class baremonuevoin has following attributes: integer age , double salary what's problem? problem parsing xml -> class works this: x