Note: I am aware of this question Could two planets be tidally locked to each other so close they share their atmosphere? My question is not about that. It is specifically about human travel. By a cosmic accident, Slartibartfast's design, or through God's will there is a planet that is shaped like an old-fashioned dumbbell. Each lobe is Earth-sized and Earth-like in terms of their basic composition - at least on the surface. What lies under the surface may be assumed to be whatever is necessary to hold the structure together. You can assume a degree of hollowness if that helps with the plausib
In my project I am using MVC4,C# and itextsharp to generate pdf from html. I need to insert header with a logo and template name, and footer with paging (page number/Total number of pages). I am done the the footer, I have used this code to add footer to the pdf file: public static byte[] AddPageNumbers(byte[] pdf) { MemoryStream ms = new MemoryStream(); ms.Write(pdf, 0, pdf.Length); // we create a reader for a certain document PdfReader reader = new PdfReader(pdf); // we retrieve the total number of pages int n = reader.NumberOfPages; // we retrieve the size of the first page Rectangle psize
I am trying to load my custom library as an extension of CI_Controller in CodeIgniter 3.0, but it does not seem to work. This is my source code. Library class MY_Login extends CI_Controller { function __construct() { parent::__construct(); // call with constructor. $this->isLogin(); } function isLogin() { // source code } } Controller class Dashboard extends CI_Controller { protected $CI; public function __construct() { parent::__construct(); $this->load->library("MY_Login"); $this->CI =& get_instance(); } }
This might be more a question on computer architecture than on C++ itself, but I was wondering if pass-by-reference could theoretically be implemented without using pointers in a language like C++. Here are three examples of code that have similar function and structure. //Version 1: Uses global variable #include <iostream> int global_var = 0; int increment(void) {return ++global_var;} int main(void) { while (global_var < 100) printf("Counter: %i\n", increment()); return 0; } //Version 2: Uses pass-by-pointer #include <iostream> int increment(int* ptr) {return ++(*ptr);} int main(void) { int l
I am having a transaction using spring data , and I am trying to do an save operation (insert operation) . [SQL0913] Row or object table in Schema type *FILE in use. Following is the entity @Entity @IdClass(OsytxlId.class) @Table(name="OSYTXL") @NamedQuery(name="Osytxl.findAll", query="SELECT o FROM Osytxl o") public class Osytxl implements Serializable { private static final long serialVersionUID = 1L; @Id @Column(name="TLCONO") private BigDecimal tlcono; @Id @Column(name="TLDIVI") private String tldivi; @Id @Column(name="TLLINO") private BigDecimal tllino; @Column(name="TLLMTS") private BigD
I have a excel sheet where I have columns that say "I like TSX but I prefer 350" "I like beamer but I am fan of S-Class" I want to replace this with "I like Acura but I prefer BMW" "I like BMW but I am fan of Mercedes" I have another excel sheet with the match and replace values. For example TSX, Acura TL, Acura 350 BMW Beamer, BMW etc. I know how to use vlookup, but this is way advance for me. Any help? Thanks you.
I'm using PHP's built-in DOMDocument() class to do some simple web-scraping. However, I get the error: Class 'App\Http\Controllers\III_Ranks\DOMDocument' not found Here's my code: <?php namespace App\Http\Controllers\III_Ranks; use App\Http\Controllers\Controller; use Illuminate\Http\Request; use Illuminate\Http\Response; class RanksController extends Controller { public function getRanks() { $list1 = new DOMDocument(); //etc... } } I figure this is a namespace issue, but I have no idea how to access DOMDocument()
So i have been doing some JavaScript and is currently learning jQuery. Time to time i get a bit confused by how jQuery does things compared to JS. Got an HTML audio tag that looks something like this: <audio id="audio" src="audio.mp3"></audio> With JS i simply play it with: document.getElementById('audio').play(); So i figured, doing the same with jQuery would just be: $('#audio').play(); That doesn't work, instead i have to write it like this: $('#audio')[0].play(); Can anyone explain this to me? Thanks.
I am getting the following error when trying to generate a lift chart for a random forest model being run through rattle: Error in prediction(crs$pr, no.miss) : Number of classes is not equal to 2. ROCR currently supports only evaluation of binary classification tasks. My code is as follows: # Evaluate model performance. # Lift Chart: requires the ROCR package. library(ROCR) # Obtain predictions for the rf model on TBA_jul21c.csv [**train**]. crs$pr <- predict(crs$rf, newdata=na.omit(crs$dataset[crs$sample, c(crs$input, crs$target)]), type="prob")[,2] # Remove observations with missing target.
I have a JTable filled with data about students (student id, name...), and when I select a row from a table, the form opens and its field need to be filled with same values (eg. if Johny Bravo was selected from the table. Then his name should be shown in text filed Name on the form, I did like this txtfieldName.setText(student.getName). My question is how do I set my Radio button automatically (my radio button is Male or Female) when I clicked the field. enter code here tableGuest.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { try{ int row = tableGuest.getSelect
What would be the best data type for storing Integer, Float values altogether in SQL Server. I need to store normal integer and point (float) decimal values in a single column. Ex. ColumnNameValues 15 15.5 12.3 17 19.8
In my Windows application, there are many screens with grid. I have used a DataTable as data source of the grid, and the DataTable has some really large data sets (> 50,000), which take a lot time to load data onto the screen if we load all at a time while loading the UI get un-responsive till all data not get loaded. I have implemented incremental loading in that grid using a background worker. Here is the code: // DoWork Event of the background Wroker. private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { while (bgstop) { e.Result = addNewRecord(); if (Convert.ToBoo
I try get position of click relative to element, but event doesn't have offsetX. onClick(e) { console.log(e.offsetX) // returns undefined console.log(e.target.offsetX) // returns undefined } render() { return <img src='http://placehold.it/1000x500' onClick={this.onClick} /> } How I can get position of click in element?
I'm on Windows Server 2008 R2 Standard (Microsoft Windows Server Version 6.1 Build 7601: Service Pack 1), running IIS 7.5.7600.16385 In IIS Manager for a Site assigned an ApplicationPool with Identity = ApplicationPoolIdentity (the default setting), how do I determine the Windows account the site uses for directory operations? In previous versions of IIS, Application Pools run under the Network Service account. What is default account for ApplicationPoolIdentity? IIS Manager > Server Instance > Application Pools > Application Pool > right-click Set Application Pool Defaults... --OR-- Advanced
I have done the code like this in view page and controller done in codeigniter. While pressing enter key multiple times data saving to the table. How can I solve this problem? View Page <form> <div class="cmt-box"> <textarea class="form-control" name="txtArea" id="txtArea<?php echo $row->id;?>" onkeypress="onTestChange(1)" rows="1"></textarea> </div></form> script function onTestChange(id) { $("#txtArea"+id).keypress(function(e) { if(e.which == 13) { dataString=document.getElementById("txtArea"+id).value; $.ajax({ type: "POST", url: "<?php echo site_url('show/insertcomment'); ?>", data: { comm
This article of the PHP manual uses mysqli_prepare() here but mysqli_stmt_* for everything else. However, in this article of the PHP manual, it uses mysqli_stmt_prepare() What is the difference between these? Can I use either? And if mysqli_prepare() is valid, does that mean mysqli_bind_param() is valid? OK, this article for mysqli_bind_param() says it's an alias for mysql_stmt_bind_param(). I guess it's safe to assume it's the same with mysqli_prepare() and the rest of the mysqli_* functions?
Based on this question I discovered Priceline's Last Minute offers. You need to pay for it in advance though. The process is a bit fuzzy and there are obviously no guarantees. Assuming I "request" a travel for the next week when do I get an answer? Is it possible to cancel my request before I get a result?
I need a to populate textFields dynamically in the web page and I have used listview for this: Form <BenificiaryFormModel> registerForm = new Form<BenificiaryFormModel>("registerForm", Model.of(new BenificiaryFormModel())); ListView listView = new ListView("registerListView", benificiaryRegFieldsList) { @Override protected void populateItem(ListItem item) { LOG.debug("Incrementer value {}", incrementer); BenificiaryRegFieldsBean listViewBean = (BenificiaryRegFieldsBean )item.getModelObject(); item.add(new Label("beneficiaryLabel", listViewBean .getLabel())); item.add(new TextField("beneficiary
Naming variables is quite important and being a non-native English speaker I wonder what the difference would be for using element, item and entry to name things within data structures or variables/parameters.
I'm working on a Shopify website, and I need to create a couple of image slideshows (for mobile layout only): (1) One for the product collection (2) One for the thumbnails of the product on the product page itself Anybody have any idea how to accomplish either? Thanks.
Whenever I set the crossorigin attribute on an image Firefox doesn't render the image. <img crossorigin="anonymous"> I'm using fabric.js which sets this attribute for me via JavaScript. I need to be able to render cross origin images. It works fine in Chrome and even IE. It seams as if Firefox previously have had some problems with CORS and I'm not sure if it's related, but I can seem to find any solutions to the problem. Since I am using a PHP proxy I have set the the headers: header("Access-Control-Allow-Origin: *"); This works fine in Chrome and even IE. So do any of you know why the image
Our Confluence database have over 100 tables and it is over 3 GB large. In initial setup the database was created with default characterset (WE8MSWIN1252). But now we want unicode characters to display on Confluence and, so that we want our database characterset to be AL32UTF8. But we don't want to lose any of the data because, it is in production environment. Our confluence 5.7.3 web application is supporting UTF-8 but database does not. How can I converert the Database to AL32UTF8, without loosing any data?
I have a navigation bar set up on my website, I have set up a search bar towards the right of the navigation bar, see code below <nav class="navbar navbar-trans navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand text-danger" href="index.php">Network TV</a> </div> <div class="navbar-coll
How can I send gzip data as part of body using restclient or postman?. I used apache restclient 3.2.2 also couldn't able to get the response. I have attached images for reference. Basically I have an xml file, want to convert it to gzip first and then send as part of body. To convert to GZip I used online tools to first convert my xml file to gzip and included the converted gzip file as part of body in my restclient. I got following java code and with code I'm getting response properly. But not able to get it working in restclient tool! ! restclient body URL url = new URL(String.format("%s?tid
I want to catch events on link click on node. I know how to set link click on column item, it's like: DATA: ls_layout TYPE lvc_s_layi, lt_layout TYPE lvc_t_layi. ls_layout-fieldname = 'Fieldname from table passing to alv tree'. ls_layout-class = cl_gui_column_tree=>item_class_link. APPEND ls_layout to lt_layout. o_cl_gui_tree->add_node( EXPORTING "other parameters... it_item_layout = lt_layout "other parameters... ). But I don't know how to set link click on node. Could you help me? Thanks.
Is there a way to automatically zip certain files at the build time with Node.js and npm? For example, I have a project, that file structure looks like this: Project/ --lib/ --node_modules/ --test/ --index.js --package.json I want to be able to zip lib folder, certain modules from node_modules and index.js into some zip archive to upload it on the AWS Lambda, for example. I do not need test folder or test Node.js modules (mocha and chai) to be zipped. I have even created a bash script for generating zip file, but is there a way to automatically execute this script, when 'npm install' is called
Is there a way to change the gateway address of the AP hot-spot feature of Android from 192.168.43.1 to something else such as 192.168.43.3 without recompiling anything? I have a rooted Android device.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class com.socketcruiter.config.SpringMongoConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.mongodb.core.MongoTemplate org.springframework.data.mongodb.config.AbstractMongoConfiguration.mongoTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingMong
I have an user control in AJAX for the date calendar and I want to disable the future dates in the Calendar. I have tried to do it by using the Maximum Value property but that doesn't disables the control. Any suggestions or help? <%@ Control Language="C#" AutoEventWireup="true" CodeFile="usrCtrlDatePicker.ascx.cs" Inherits="UserControls_usrCtrlDatePicker" %> <table cellspacing="0" cellpadding="0" border="0" style="height:18px;"> <tr> <td style="text-align:center; vertical-align:middle; height:16px"> <asp:TextBox ID="txtDateEntry" runat="server" Width="75px" MaxLength="1" style="text-align:jus