Posts

Showing posts from June, 2010

java - Is it possible to create multiple classes in one package and import them in another package? -

Image
hi have question on java package. have created package more 1 classes [package name 'animal' , file name 'zoo.java']. have created java file in package 'mypackage' , created file called 'main.java'. tried accessing members of 'animal' package 'main.java' , throwing me error because cannot access classes of 'animal' package. know classes in same package should accessible each other, or should make public. can change 1 class public in 'zoo.java'. found 1 solution create separate java files each class in animal package , make public. there other method ? understanding was, can write classes in 1 file , import them anywhere. below screenshot. and 1 more thing, in java library how implemented it? separate source files each class within package ? so found 1 solution create separate java files each class in animal package , make public. if want use classes outside of package they're defined in, yes, have...

java - error while deserializing object of size greater than 95Kb, working fine for less than 95Kb objects -

Image
i getting streamcorruptedexception when deserialize objects greater 95kb, code works fine objects less 95kb. here code: <!-- language: lang-java --> package hadoop; import java.io.bytearrayinputstream; import java.io.bytearrayoutputstream; import java.io.ioexception; import java.io.objectinputstream; import java.io.objectoutputstream; import java.util.arraylist; import java.util.collections; import java.util.concurrent.timeunit; import org.apache.hadoop.conf.configuration; import org.apache.hadoop.fs.fsdatainputstream; import org.apache.hadoop.fs.fsdataoutputstream; import org.apache.hadoop.fs.filesystem; import org.apache.hadoop.fs.path; public class hadoopclient { static arraylist<long> list = new arraylist<long>(); public long readfilefromhdfs(string source) throws ioexception { configuration obj = new configuration(); obj.set("fs.default.name", "hdfs://127.0.0.1:9000"); filesystem fs = filesyste...

xml - Select unique element by attribute using XSLT -

my xml has weird structures. being generated cms driving website, need use xml output database create print documents in adobe indesign. i need select content wrapped in span tags have specific classes xslt not working. here raw xml output: <newsitem> <!doctype xsl:stylesheet[ <!entity bull "&#8226;"> ]> <inlinexml> <h2>appointments</h2> <p><span class="pb-biz red bullet">&bull;</span> <span><strong>john smith</strong></span> interim president , ceo named permanent position.</p> <p><span class="pb-biz red bullet">&bull;</span> hospital announced <span><strong>james williams</strong></span> become division president .</p> </inlinexml> </newsitem> here xslt: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/xsl/transform version="1.0"> <xsl:output method=...

How to call external javascript from URL inside function -

i'm try make previous question little more clearer. so have cpa offer cpa network using tag. <script type="text/javascript" src="https://megadownloder.com/script_include.php?id=372715"></script> and <script type="text/javascript" src="https://megadownloder.com/script_include.php?id=372716"></script> now, want randomly call , choose between 2 when user click download button. example scenario: when user clicked download button, <script type="text/javascript" src="https://megadownloder.com/script_include.php?id=372715"></script> called. when new user clicked download again <script type="text/javascript" src="https://megadownloder.com/script_include.php?id=372716"></script> show. in ramdom manners. i hope make question clear , guys can me. thank much. you need round using math.round . math.random give number between 0 , 1 ...

c# - Xamarin.IOS MvvmCross App throws NullReference Exception in ViewDidLoad method in iOS9 -

i working on existing xamarin ios application pcl , uses mvvmcross ioc , databinding. built on mvvmcross 3.1.1 the app looks tabcontrol app buttons on mainviewcotnroller giving tab feel it. views declared in storyboard , in mainviewcontroller , prepareforsegue(uistoryboardsegue segue, nsobject sender) method is overridden load selected "tab" view based on segue selected - below if (segue.identifier == "firstsegue") { var dest = segue.destinationviewcontroller firstview; dest.request = new mvxviewmodelrequest<firstviewmodel>(null, null, new mvxrequestedby()); foreach (uiview v in src.placeholderview.subviews) { v.removefromsuperview(); } dest.view.frame = new cgrect(0f, 0f, w, h); src.placeholderview.add(dest.view); } the app runs fine on iphones ios 7.1 till 8.4. just before ios 9 released did test installation app on iphone 6 ios 9.1 beta , app crashed on loading. retrieved device logs (belo...

Spotify iOS SDK native auth -

Image
how implement native auth spotify ios sdk? don't want see popup window of spotify login implemented. or possible using web api? i @ app called "soundfocus" on app store - spotify auth screen looks native - need same. how it? thank you at moment native login not supported sdk:s. soundfocus using older api (like libspotify). should implement own backend service (authorization code flow) outlined in documents here: https://developer.spotify.com/web-api/authorization-guide/ authorization code flow this method suitable long-running applications user logs once. provides access token can refreshed. since token exchange involves sending secret key, should happen on secure location, backend service, not client browser or mobile apps. flow described in rfc-6749.

javascript - Change the picture into another picture in relation to hover -

Image
goal : when have cursor on image, should changed image: problem : don't know how solve in context. the source code taken plugin: scrollup-jquery-plugin a simplified version located in jsfiddle $(function(){ $.scrollup({scrolltext: false }); }); i have not changed in javascript source code. please me this. user :hover notation: #scrollup:hover { background-image: url("https://cdn0.iconfinder.com/data/icons/sweets/128/lollypop_blue_candy.png"); } and future: should not hard find yourself. using search engine keyword have in mind + "css" yields pretty solid results.

python - Centering label in a frame -

Image
i'm having trouble trying center label inside frame. i'm using grid geometry manager , i've tried sorts of things such using 'sticky' , re-arranging way frame works. heres screenshot of looks now: i'm trying 'even' text centered in frame. here current code: the_frame = frame(the_window, width= 400, height = 150, relief = 'groove', borderwidth = 2) the_frame.grid_propagate(false) the_text = label(the_frame, text = 'even') alpha_check = checkbutton(the_window, text = 'alpha', variable = boxtick0, command = oddoreven) beta_check = checkbutton(the_window, text = 'beta', variable = boxtick1, command = oddoreven) gamma_check = checkbutton(the_window, text = 'gamma', variable = boxtick2, command = oddoreven) margin = 5 the_frame.grid(padx = margin, pady = margin, row = 1, column = 1, columnspan = 3) th...

angularjs - How do i use ui-sref with multiple parameter -

in ui-sref , need add 2 states ui-sref="form.profile.retail , form.profile.corporate" , not sure how this, have tried using conditional operator didnt work. in form.html <a ui-sref-active="active" ui-sref="form.profile.retail"><span>2</span> login</a> here plunker thanks you can use ng-switch determine link place, cannot understand conditional needs i'll place example. assign scope variable isretail define when link should 1 or another: <div ng-switch on="isretail"> <a ui-sref-active="active" ui-sref="form.profile.retail" ng-switch-when="true">retail</a> <a ui-sref-active="active" ui-sref="form.profile.corporate" ng-switch-default>corporate</a> </div>

ios - Xcode7 synthesize setter settableview for null resettable property does not handle nil -

Image
in ios9 warning this on uitableviewcontroller. although works fine, understand meaning of warning. so setter not handle when tableview set nil. i can override setter rid of warning, there better way go this? or should not have synthesised built in property in first place? - (void)settableview:(uitableview *)intableview { if (!intableview) { return; } [super settableview:intableview]; }

html - Stylesheet not displaying within div id tab? -

this code on webpage, i'm trying make stylesheet says "hello!" display on tab1, isn't displaying. changes need made display stylesheet pastebin in tab1? able in past i'm unsure i'm doing wrong here. my webpage limited characters, must use pastebin put of writing page, since have 2000-2200 characters left can use, enough coding, not putting walls of text on each tab i'll making, well. <style> body{ color:#000000; font-size:13px; font-family:ebrima; background-image: url() !important; background-color:#ffffff !important; background-position:bottom-center !important; background-repeat:repeat !important;} h1{ margin:0px 0px 0px; font-size: 10px; color:#ff0000; font-family:ebrima; letter-spacing:0px; font-weight:normal; text-shadow: 0px 0px 2px #880000;} b, strong { font-family: ebrima; font-size: 12px;line-height: 10px; font-weight: bold; color: #ff5555;} i, em {color...

html - Overlapping CSS flexbox items in Safari -

Image
what's correct css force safari not overlap flex items within default flex container? safari seems give width flex items lots of content. safari: (v8.0.8 on mac os x 10.10.5 yosemite) the flex items display fine in chrome , firefox. chrome: css: main { display: flex; border: 3px solid silver; } main >div { background-color: plum; margin: 10px; } html: <main> <div> doh!!!!!!!!!!! </div> <div> lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incididunt ut labore et dolore magna aliqua. ut enim ad minim veniam. </div> </main> fiddle code: http://jsfiddle.net/ll05grus/6 the element shrinking. need set flex-shrink property 0 on shrinking element. main >div:first-child { -webkit-flex: 0; flex-shrink: 0; }

c# - How I can call the installer.ini arguments in a silent installer? -

i use code install in silent mode program : private void install_click(object sender, eventargs e) { string path = appdomain.currentdomain.basedirectory.tostring(); string configfilename = path + "config.ini"; string installerfilename = path + "installer.ini"; string configtext = file.readalltext(configfilename); string installertext = file.readalltext(installerfilename); } process process = new process(); process.startinfo.filename = @"d:\matlab\nsis\r2008a\win64\setup.exe"; process.startinfo.arguments = "/quiet"; process.startinfo.windowstyle = processwindowstyle.hidden; process.start(); process.waitforexit(); } but code made setup.exe run, doesn't use installer.ini have license number, outlog number ...how can this, use arguments of installer.ini silent installer of matlab program ? also tried :...

c# - Cannot get image file at server side from File Uploader in asp.net -

i have html control fileuploader and add runat="server" access @ server side, don't want user asp:fileuploader because of bad css style in bootstrap <span> <input type="file" runat="server" id="file_upload" /> </span> now need image html fileuploder save in database got example code google image fileuploader as byte[] imgbyte = null; if (file_upload.postedfile != null) { httppostedfile file = file_upload.postedfile; imgbyte = new byte[file.contentlength]; file.inputstream.read(imgbyte, 0, file.contentlength); } but when examine using breakpoint compiler not enter if body because of null vaule i used this scriptmanager.getcurrent(this).registerpostbackcontrol(this.file_upload); in form_load event due using asp:updatepanel but didn't file (image) fileuploader i need solve issue.. thanks in advance. edit: when remove asp:updatepanel can access file select. and use ...

forms - dhtmlx scheduler adding custom inputs -

is there possibility add custom input form on dhtmlx scheduler such text, select, texarea, etc. because desire add custom items on etc. thanks in advance! you can add number of predefined inputs or implement custom ones, check these articles http://docs.dhtmlx.com/scheduler/custom_lightbox_editor.html http://docs.dhtmlx.com/scheduler/lightbox_editors.html you can redefine details form completely, described here http://docs.dhtmlx.com/scheduler/custom_details_form.html

c++ - spin_lock.h port from windows to linux -

i have following header: #if !defined(_spin_lock_h_included_) #define _spin_lock_h_included_ #include <windows.h> class spin_lock { public: spin_lock(); virtual ~spin_lock(); void lock( void ); void unlock( void ); private: critical_section m_lock; spin_lock( const spin_lock& ); const spin_lock& operator = ( const spin_lock& ); }; there possibility port on linux minimum changes ? after comment i'm getting error: in file included ../sources/utils.11.0/mypdflibutils.cpp:43:0: ../sources/utils.11.0/spin_lock.h:39:2: error: ‘critical_section’ not name type critical_section m_lock; critical_section declared in winbase.h part of microsoft sdk this implementation: #include <windows.h> #include "spin_lock.h" spin_lock::spin_lock() { ::initializecriticalsection( &m_lock ); } spin_lock::~spin_lock() { ::deletecriticalsection( &m_lock ); } void spin_lock::lock( void )...

Java Android - Aide Error : There is no applicable contructor to '()' -

i got error there no applicable contructor "()" in aide , here code, think there no error, got error, how fix it? public class togglerd extends radiobutton { // implement necessary constructors @override public void toggle() { if(ischecked()) { if(getparent() instanceof radiogroup) { ((radiogroup)getparent()).clearcheck(); } } else { setchecked(true); } } } if check docs radiobutton see offers 4 constructors, none without arguments. way got extending view in android creating private method (call sharedconstructor or whatever) , call in each of constructors. this: public class togglerd extends radiobutton { // implement necessary constructors public togglerd(context context) { super(context); } public togglerd(context context, attributeset attrs) { super(context, attrs); } public togglerd(context context, attributeset attrs, int defstyleattr) ...

Azure Data Factory: Moving data from Table Storage to SQL Azure -

while moving data table storage sql azure, possible obtain delta (the data hasn't been moved) using azure data factory? a more detailed explanation: there azure storage table, contains data, updated periodically. , want create data factory pipeline moves data sql azure database. during each move want newly added data written sql db. possible azure data factory? see more information on azuretablesourcequery , copy activity @ link : https://azure.microsoft.com/en-us/documentation/articles/data-factory-azure-table-connector/#azure-table-copy-activity-type-properties . also see link invoking stored procedure sql: https://azure.microsoft.com/en-us/documentation/articles/data-factory-azure-sql-connector/#invoking-stored-procedure-for-sql-sink you can query each time on timestamp achieve similar delta copy, not true delta copy.

c# - Win8 App - WCF - how to fire timer event only once? -

i wrote win8 app calling wcf every minute data. win8 app shared via sideloading , i've got 10 clients app running. so problem - i've got call special method in wcf every 10 minutes. once because method should send emails , don't want them sent 10 times. don't want method called every client either have set timer in win8 app. how set timer who's firing event once every 10 minutes? i've tried set timer in wcf it's not practice guess (and didn't work)?! , i'm not allowed write windows service etc. firing timer event. am thinking complicated or isn't easy? should work backgroundthreads? missunderstand sideloading? wouldn't timer event fired 10 clients every 10 minutes? guess because every single client gets other data wcf too.....

session - PrestaShop 1.6 logout when url is without index.php -

when customer logged in , wants go home page url i.e. www.prestashop.com/index.php after page reload still logged. when url without index.php, www.prestashop.com, page behaviorus client logged out. no username in top, , must log in again. can't find reason. edit there's no problem index.php or without in url, there's problem https/http. default ssl enabled. when customer types http instead https problem apear.

sed - Extract data between two matched patterns in a binary file containing non-ASCII characters using bash -

i trying extract jpeg image binary text file. want extract data between 0xff 0xd8 (start of image) , 0xff 0xd9 (end of image) inclusive. earlier, have run following command desired image.jpg single paragraph file received.txt: sed 's/.*\xff\xd8/\xff\xd8/; s/\xff\xd9.*/\xff\xd9/' received.txt > image.jpg but when tried run same operation on different file, didn't work. tried using sed -n '/\xff\xd8/,/\xff\xd9/p' received.txt > temp.txt sed 's/.*\xff\xd8/\xff\xd8/; s/\xff\xd9.*/\xff\xd9/' temp.txt > image.jpg to remove lines before or after matched lines got no success. although file large, pasted hex dump of relevant portion below: 0a 55 57 5d 50 cf ff d8 ff fe ff ff ff d9 df 47 fe e7 c9 3b e9 9b 6b 55 c4 57 9b 98 73 fd 15 f7 77 7e f7 95 dd 55 f7 55 05 cc 55 97 55 dd 62 d1 1f 51 ef f1 ef fb e9 bf ed 5f bf f2 9d 75 af fe 6b fb bf 8f f7 f7 7e ff d3 bf 8e d5 5f df 57 75 fe 77 7b bf d7 af df 5d fb 0a 47 de d5 ff c1 23 9b 20 08 20 65 3c 06...

Is it possible to access MY_Controller Public Function in CodeIgniter via browser -

i learning codeigniter. have defined my_controller class residing inside application/core folder. inside this, there public function. my question is, can directly access function or other public function defined in my_controller via browser url. yes it possible. if method public can call using controller extends my_controller , not override method ( i.e not have method same name defined in my_controller class) : this how can it. create simple controller extend my_controller : somecontroller.php class somecontroller extends my_controller{ } now can access url such : yourdomain.com/somecontroller/yourmycontrollermethodname

javascript - Getting Decoded Version of a Unicode String? -

i write variable html element that: document.getelementbyid('mydiv').innerhtml = '<xsl:value-of select="@value"/>'; however written that: techno a.&#x15e;. which should be: techno a.Ş. how can manually decoded version of unicode string javascript? ps: i've realized problem occurs @ chrome not @ internet explorer. &# , ; html parser escapes hexadecimal character. need strip off them , pass remaining '15e' value (for example): <!doctype html> <div id="myid"> yo oyyoyoyooy &amp;amp;amp;#xaa;suuupspuspupsu ssdosudoisduoisudoiud &amp;amp;#xfe; </div> <script> document.addeventlistener("domcontentloaded", function(){ var nodeiterator = document.createnodeiterator( // node use root document.getelementbyid('myid'), // consider nodes text nodes (nodetype 3) nodefilter.show_text, // object containing function use acceptnode met...

c# - ExecuteNonQuery() not responding/working -

i have problem application, had worked before. application connects oracle database. @ moment want add new account. in c# code have database class following method: public void addaccount(string name, string addres, string username, string password) { string query = "insert account(id, name, addres, username, password, datecreated, game_id) values(account_seq.nextval,:name,:addres,:username,:password, sysdate, 1)"; openconnection(); try { oraclecommand command = new oraclecommand(query, connection); oracleparameter[] parameters = new oracleparameter[] { new oracleparameter(":name", name), new oracleparameter(":addres", addres), new oracleparameter(":username", username), new oracleparameter(":password", password) }; command.parameters.addrange(parameters); command.exec...

python - Fabric -- connecting to hosts in ~/.ssh/config still prompts for passphrase -

i'm making use of fabric.user_ssh_config = true , , ssh config looks like: host server_vm1.domain.com identityfile ~/.ssh/id_rsa_uiuc identitiesonly yes user t2 however, prompted passphrase every time connect machine (like it's looking @ standard id_rsa file, does require passphrase): [server_vm1.domain.com] passphrase private key: this happens when try fabric.api.put('ds.tar', '/root/test') . user t2 not same local user (from i'm running fabric script). can ssh terminal directly fine, no prompts.

Use of functional Haskell-like Accumulator in javascript functions -

i'm looking haskell , i'm fascinated of features, example end-recursive functions using accumulator. questions: is there construct in javascript similar that? or make sense regarding efficiency since javascript not functional haskell? is there library ramda, lodash, ... supports way of programming and if so, how write example in javascript: power_acc :: double -> int -> double power_acc x y = power_acc_h x y 1 power_acc_h :: double -> int -> double -> double power_acc_h x 0 acc = acc power_acc_h x y acc = power_acc_h x (y-1) (acc*x) is there construct in javascript similar that? yes, can literally translate js: function power_acc(x, y) { // double -> int -> double y = y>>>0; // cast positive int (avoiding nontermination) return power_acc_h(x, y, 1); } function power_acc_h(x, y, acc) { // double -> int -> double -> double return y == 0 ? acc : power_acc_h(x, y-1, acc*x); } or...

licensing - JavaScript license information for merged and minified file -

i add own copyright statement , license text on top of minified file, contains third party libraries own code. can without worries, if keep license comments of third party libraries (all mit license) intact? so, clarification, final file this: /* license */ /* underscore license */ [ ... minified underscore code ...] /* jquery license */ [ ... minified jquery code ...] [ ... minified code ...] both underscore , jquery licensed under mit license , long keep licenses intact in code, should fine. ianal disclaimer

r - subtract mean from every element dplyr -

i want demean columns using dplyr. tried failed using "do()" command. i want replicate following using easier dplyr commands: tickers <- c(rep(1,10),rep(2,10)) df <- data.frame(cbind(tickers,rep(1:20),rep(2:21))) colnames(df) <- c("tickers","col1","col2") df %>% group_by(tickers) apply(df[,2:3],2,function(x) x - mean(x)) i sure can done better using dplyr. thanks! if using dplyr , can mutate_each , use of methods mentioned in ?select match columns. here, using matches can take regular expression pattern. library(dplyr) df %>% mutate_each(funs(.-mean(.)), matches('^col')) %>% select(-tickers) but can done using base r : df[2:3]-colmeans(df[2:3])[col(df[2:3])] the colmeans output vector can replicated lengths same.

ios - Swift Dictionary Get Key for Values -

i have dictionary defined as: let drinks = [string:[string]]() drinks = ["soft drinks": ["cocoa-cola", "mountain dew", "sprite"], "juice" :["orange", "apple", "grape"]] how can key, given value. let key = (drinks nsdictionary).allkeysforobject("orange") as! string print(key) //returns empty array. should return "juice" func findkeyforvalue(value: string, dictionary: [string: [string]]) ->string? { (key, array) in dictionary { if (array.contains(value)) { return key } } return nil } call above function return optional string? let drinks = ["soft drinks": ["cocoa-cola", "mountain dew", "sprite"], "juice" :["orange", "apple", "grape"]] print(self.findkeyforvalue("orange", dictionary: drinks)) this function retur...

uitableview - UITableViewAutomaticDimension not working properly in iOS 9 -

in app have custom tableviewcells fixed ratio (16x9). achieve that, placed view in cell, fixed parent view (although did in interface builder: v/h:|-[innerview]-| ). also, put ratio constraint on it. in tableviewcontroller i'm using uitableviewautomaticdimension table cell height. the estimated row height 180, wich exact size cell have on 320px wide display (as i, can see, do). i'm still deploying 8.4, when running project on device ios 9, i'm getting tons of auto layout warnings, although works fine , looks perfect. the warning absolutely right. there 2 constraints don't want – these ios added on own. 2015-09-29 11:24:57.771 app[1039:324736] unable simultaneously satisfy constraints. @ 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 unde...

php - Yii2 custom login is not working -

i new in yii2, right working custom login, did code login when go in home page through index action didn't session there, here code public function actionindex() { $session = yii::$app->session; if ($session->isactive) { echo 'sdsd'; die; } return $this->render('index'); } public function actionlogin() { if (!\yii::$app->user->isguest) { return $this->gohome(); } $model = new user(); //if ($model->load(yii::$app->request->post()) && $model->login()) { if ($model->load(yii::$app->request->post()) && $model->validate()) { $username = $_post['user']['username']; $password = $_post['user']['password']; $condition = "username = '".$username."' , password = '".md5($password)."' , status = '1...

entity framework 5 - how to visualize entities of code first -

i have simple query.i have searched many times not getting satisfactory result. i want generate diagram entities(code first) , relationship between them.i have total 19 classes far.i have seen articles on reverse engineer code first.but see diagram looks created in database first approach. so far, have installed entity framework power tools in visual studio 2013 there getting 2 options--- 1>reverse engineer code first 2>customize reverse engineer template thanks in advance! you can use entity framework powertools "view entity data model(read-only)" feature https://msdn.microsoft.com/en-us/data/jj593170.aspx

Python Remove Item from list -

Image
i'm new python, working on it, guy in team left , need work on line, apologies if stupid question. i need remove items list (they'll contain phrase) , have googled , tried few ways doesn't seem working. what i've got is, def get_and_count_card_files(date): # retrieve dc , sd card files dc_files = dc_card_files.get_dc_files(dc_start_location, date) sd_files = sd_card_files.get_sd_files(sd_start_location) print(dc_files) if '*nocover*' in dc_files: dc_files.remove('*nocover*') dc_files being list (bunch of file names) , need remove has nocover in file name. exist print function shows me does. anyone idea i'm doing wrong with piece of code, * won't glob or regular expression in these contexts: if '*nocover*' in dc_files: dc_files.remove('*nocover*') so better say: if 'nocover' in dc_files: however, have find right entry remove in list, without using wildcards. for s...

visual studio 2015 - Error in building new Universal App in VS2015 -

Image
am creating new application in windows 10. it universal app. whenever try run getting error of sheexception if press on continue don't know problem. installed windows 10 , visual studio 2015. it working fine few days ago. it works fine if build platform changed x64. problem seems x86 only. in debug mode. works fine in release mode. build log 1>------ deploy started: project: app2, configuration: debug x86 ------ 1>updating layout... 1>checking whether required frameworks installed... 1>warning : dep0810 : app references microsoft.vclibs.140.00.debug, version 14.0.22929.0, found in sdk, have higher version of microsoft.vclibs.140.00.debug installed on target machine, 14.0.23019.0. if continue run application, run against installed version, microsoft.vclibs.140.00.debug, version 14.0.23019.0. consider updating sdk match version of microsoft.vclibs.140.00.debug installed. 1>registering application run layout... 1>deployment complete (30...

Open a New Frame Window From MainPage in Windows 10 Universal App? -

Image
how open new frame window contains xaml page when click button main window in universal app? you can check out sample on how offical microsoft samples on github can found here i'll summarize here. simpler implementation can found on mike taulty's blog . since haven't specified development language assume c# , xaml. create button in xaml clicked create new window: <button content="create" horizontalalignment="center" verticalalignment="center" click="oncreate" /> in code behind, add oncreate click handler: async void oncreate(object sender, routedeventargs e) { coreapplicationview newcoreview = coreapplication.createnewview(); applicationview newappview = null; int mainviewid = applicationview.getapplicationviewidforwindow( coreapplication.mainview.corewindow); await newcoreview.dispatcher.runasync( coredispatcherpriority.normal, () => { newa...

ios - Open In Place (but only a subset) -

my app can 'view' lots of different file types, can 'edit' single type. i have enabled 'open in place' (lssupportsopeningdocumentsinplace) users can use icloud drive 'launch' app. unfortunately file types listed 'open in' (my app) - whereas app file format should 'open in' - rest should 'copy to'. i've 'randomly' tweaked cfbundledocumenttypes (owners, editors etc.) no avail. know if possible - , magic combination of plist values is? thanks as of ios 10, setting lshandlerrank "owner" (ie. "alternate") should have effect. you'll still files open-in-place'able, ui changes.

c# - HTML to pdf conversion not happening -

i have html page need convert pdf the html page consist of gridview , images, searching on net came know can done using itextsharp when tried using following code pdf getting generated nothing aligned , not able gridview can u suggest better methods or whats wrong following code? protected void btnexportpdf_click() { response.contenttype = "application/pdf"; response.addheader("content-disposition", "attachment;filename=gridviewexport.pdf"); response.cache.setcacheability(httpcacheability.nocache); stringwriter sw = new stringwriter(); htmltextwriter hw = new htmltextwriter(sw); this.pdfform.rendercontrol(hw); stringreader sr = new stringreader(sw.tostring()); itextsharp.text.document pdfdoc = new itextsharp.text.document(itextsharp.text.pagesize.a4, 10f, 10f, 10f, 0f); itextsharp.text.html.simpleparser.htmlworker htmlparser = new itextsharp.text.html.simpleparser.htmlworker(...

addfieldtotab data types in SIlverstripe -

below theexample silverstripe.org addfieldtotab $fields->addfieldtotab('root.main', datefield::create('date','date of article')); $fields->addfieldtotab('root.main', textareafield::create('teaser')); $fields->addfieldtotab('root.main', textfield::create('author','author of article')); it show text type textareafield, varchar textfield, date datefield. but other data types, can find in documentation following, boolean compositedbfield currency datetime decimal double enum float foreignkey htmltext htmlvarchar int money multienum percentage primarykey text time year for complete list of fields check out subclasses listed @ http://api.silverstripe.org/3.1/class-formfield.html . field types flexible , can support multiple data types or relations, particular data types can represented variety of form fields. can create own field types subclassing formfield . depends on context best fit....

cx freeze - Scipy and CX_freeze - Error importing scipy: you cannot import scipy while being in scipy source directory -

i'm having trouble compiling exe while using cx_freeze , scipy. in particular, script uses from scipy.interpolate import griddata the build process seems complete successfully, when try run compiled exe, following message. traceback (most recent call last): file "c:\python27\lib\site-packages\cx_freeze\initscripts\console.py", line 27, in <module> exec(code, m.__dict__) file "gis_helper.py", line 13, in <module> file "c:\python27\lib\site-packages\scipy\__init__.py", line 103, in <module> raise importerror(msg) importerror: error importing scipy: cannot import scipy while being in scipy source directory; please exit scipy source tree first, , relaunch python intepreter. after looking @ scipy\ _init__.py file, there following: if __scipy_setup__: import sys _sys _sys.stderr.write('running scipy source directory.\n') del _sys else: try: scipy.__config__ import s...

ios - Swift 2: "the error is not handled" -

this question has answer here: issue swift 2 error handling 1 answer started "call can throw not marked try , error not handled" error after updated xcode 6.4 7 swift2 in "contactusobject.save()" . how can fix this? @ibaction func postcommentbtn_clicked(sender: anyobject) { if messagetxtcomment.text.isempty { let alertview = uialertcontroller(title: "message field empty", message: "please enter message post", preferredstyle: .alert) alertview.addaction(uialertaction(title: "ok", style: .default, handler: nil)) self.presentviewcontroller(alertview, animated: true, completion: nil) } else { var thecomment = messagetxtcomment.text let len = messagetxtcomment.text.utf16.count if len > 150 { thecomment = thecomment.substringtoind...

android - Setting minimum width of a RecyclerView item -

i trying set minimum width items of recyclerview gridmanagerlayout if put 5 items per row looks great when put 20 items per row size of item 20 dp want @ least 120 dp, how can that? gridlayoutmanager manager = new gridlayoutmanager(actividadescolectivasplazasactivity.this, columnas); adapter = new plazasadapter(ctx, listaplazas); mrecyclerview.setlayoutmanager(manager); mrecyclerview.sethasfixedsize(true); layout <horizontalscrollview android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_below="@+id/app_bar"> <linearlayout android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="match_parent"> <view android:layout_width="wrap_content" android:layout_height="fill_parent" class="android.support.v7.widget.recyclerview" ...

php - How does Laravel MessageBag work? -

i encountered magical laravel (4.2), want explaind how possible. when messagebag class in class a and pass variable class b , somehow class b overrides class messagebag without me declaring it. class classa { public function test() { $msgbag = new \illuminate\support\messagebag; new classb($msgbag); if($msgbag->any()) { #this trigger , spit out "message class b" dd($msgbag); }else{ print('nope no messages'); } } } class classb { protected $msgbag; function __construct(\illuminate\support\messagebag $msgbag) { $this->msgbag = $msgbag; $this->setmessage(); } public function setmessage() { $this->msgbag->add('message', 'message class b'); } } i tested same thing normal object behaved expected to. class classa { public function test() { $object = (object) ['class...

visual studio - Azure Cloud Service Error while running(F5) project -

i'm trying run , debug azure cloud service project works fine when deploy on azure cloud when try run in within visual studio debug/emulator throwing me error. error 7 unable setting value parameter name: profilename ps: i'm using visual studio 2013 azure sdk 2.7. builds without error. getting critical because need upload 500 mb of data every single time update code. can please guide me i'm missing here? thank make sure service configuration file called serviceconfiguration.local.cscfg or you'll encounter precise error. let me know if fix issue.

java - Simple XML - how to get data starting from an inner element? -

i trying create elements xml using simple xml android , not interested in root, nested elements. interested in getting account object below xml. <response xmlns="http://abc.abcdef.com/rest/xyz"> <request> <channel>334892326</channel> <number>486</number> </request> <status> <code>200</code> </status> <results> <account> <creationtimestamp>2014-01-12t1:31:07z</creationtimestamp> <category> <type>user-1</type> <name>user-1</name> </category> </account> <results> </response> i have tried following in bean, resulting object containing values null. @root(strict = false, name = "account") @path("response/results/account") public class account implements serializable { @elemen...

ruby on rails - Multiple Twitter applications with omniauth -

i've configured devise + omniauth documented on omniauth wiki: https://github.com/intridea/omniauth/wiki/setup-phase my initializer: provider :twitter, nil, nil, setup: true routes.rb: get '/settings/auth/:provider/setup' => 'settings/authorization_callbacks#setup' this setup action def setup application_id = params[:application_id].present? ? params[:application_id] : request.env["rack.session"]["omniauth.params"]["application_id"] application = application.find(application_id) request.env['omniauth.strategy'].options[:client_id] = application.identifier request.env['omniauth.strategy'].options[:client_secret] = application.secret render :text => "setup complete.", :status => 404 end result 400 bad request , have no idea why... checked , right application called, setting right values in "omniauth.strategy". maybe implemented can guess what's problem code? in...

IndexError: list assignment index out of range python 3.4 -

in lempel-ziv decode methode indexerror code, know size 3, while len(lt) 2. converted pseudocode python code . def decode(self,target): tlen = len(target) source = '' source += target[0] lt = ['',target[0]] loc = 1 size = 2 while loc < tlen: bitlen = ceil(log2(size)) index = self.bit_to_integer(target[loc:(loc+bitlen)]) seg = lt[index] if loc+bitlen < tlen: seg += target[loc+bitlen] size += 1 #print(size) #print(lt,size) lt[size] = seg loc += 1 source += seg loc += bitlen return source this error message: lt[size] = seg indexerror: list assignment index out of range if want add third item list, use append instead of assignment. replace lt[size] = seg with lt.append(seg)

javascript - Pagination on filtered rows — Resetting original data set — jQuery Datatables -

this problem had jquery datatables don't know why happening in first place! i have multiple select elements filters original data set. filtering logic on select change event. this datatables init (using state saving, documentation) : var table = $('#orders-listing').datatable({ bstatesave: true, bfilter:true, paging: true, bpaginate:true, language: { url: /* language file url */ }, fnstatesave: function(osettings, odata){ localstorage.setitem('datatables_'+window.location.pathname, json.stringify(odata)); }, fnstateload: function(osettings){ return json.parse(localstorage.getitem('datatables_'+window.location.pathname)); } }); and filtering logic on select change event: $('.filter-select').on('change', function() { $.fn.datatable.ext.afnfiltering.push( function(settings, data, dataindex) { // logic, return boolean, wether keep row being processed or not. } ); ta...

vb.net - Handles Me.Event vs Handles MyBase.Event -

class baseclass public event myevent(sender object, e eventargs) end class class derivedclass inherits baseclass sub derivedclasseventhandler(sender object, e eventargs) handles me.myevent 'do here end sub end class is there difference between above , using handles mybase.myevent , per guidance here under heading handling events inherited base class ? with simple example, there's little difference. argue using handles mybase... it's clearer future readers of code know event comes from. one potential reason preferring 1 or other in (unusual) situation of creating event same name in derived class - difference between me , mybase allows specific event you're handling: class baseclass public event myevent(sender object, e eventargs) end class class derivedclass inherits baseclass public shadows event myevent(sender object, e someothereventargs) sub eventhandler(sender object, e eventargs) handles mybase.myeve...

ios - Multipeer Connectivity send and receive NSManagedObject -

i'm looking send , receive nsmanagedobject through multipeer connectivity framework. class myobject: nsmanagedobject { @nsmanaged var name: string @nsmanaged var children: nsset } i've managed send strings , dictionaries, need send nsmanagedobject nsset. possible? here's i've tried: let data = nskeyedarchiver.archiveddatawithrootobject(nsmanagedobject) if session.connectedpeers.count > 0 { var error: nserror? if !session.senddata(data,topeers: session.connectedpeers, withmode: .reliable, error: &error){ println("send error:") println(error) } } else { println("no peers connected!") } func session(session: mcsession!, didreceivedata data: nsdata!, frompeer peerid: mcpeerid!) { nslog("%@", "didreceivedata: \(data.length) bytes") let nsmanagedobject = nskeyedunarchiver.unarchiveobjectwithdata(data) as! myobject } the ...