Best Qusition......... Ans plz
After coldboot DNS/clock fails to be set, after normal boot DNS/clock set correctly
See also questions close to this topic
-
How can I download a EXCEL flle(in direcctory 1) residing in my local directory(any usual directory2) using CodeIgniter?
I am new to Codeigniter and was working to download a file let say that resides in c:/downloads(an excel file, CSV) to my usual download folder, I am using Wamp server and Codeigniter-3, anything I have gone through does not make any sense to me. Is there a way to do that?
Thanks for any contribution in advance.
-
clear cart from session , and after logging it to console i get empty array but when visit cart view i still get cart items
I am working on e-commerce project , after checkout i wrote a code that deletes the cart items , and just to make sure i console.log(req.session.cart), and it shows an empty array means that session.cart is empty , but then i redirect user to home page , but then on home page i still get cart and its items , how to solve this problem? thanks .
this is how i cleared my cart its working fine!
order.save().then((r) => { // console.log(r) console.log("after checkout") for (let index = 0; index < req.session.cart.length; index++) { req.session.cart.splice(index) } console.log("Cart after clearing items ") console.log(req.session.cart
but if I revisit my cartView route i still get cart adn its items
router.get('/viewCarts', (req, res) => { console.log("cart items ",req.session.cart) catSchema.find({}).then((categories) => { // console.log(req.session.cart) res.render('../views/cartView/cartView.ejs', { layout: '../views/welcome/welcomeHeader.ejs', options: 'BUY', title: 'MY CART', cat: categories, cart:req.session.cart }); }); });
-
I want to download Multiple images as a zip file using javascript
I am trying to download multiple image when i click to download button but unfortunately i am getting empty folder in zip file , images or files are not downloading in zip file please help me how can i resolve that ? thanks.
Note :- I am getting images or files in array from db like this ["zFbf2cGRPLTaXbqzA5VWt8FZTjhXkt4LoC041fIH.jpeg","ucy0WknOKMhuNtfqcRgmWUgpvp2IPKhU84lU2tAq.jpeg"]
html view
<a href="javascript:;" class="download text-primary p-5" data-original-title="Download Files" title="" data-placement="top" data-toggle="tooltip" > <i class="fa fa-download" aria-hidden="true"></i> </a>
script
let url="{{Config('yourstitchart.file_url')}}" //url = http://localhost/yourstitichart/yourstitichart.com/web/public/uploads/images/ window.onload = function(event) { let val= document.querySelector('.download') let files= {!!$event->image_gallery!!} // let files=["zFbf2cGRPLTaXbqzA5VWt8FZTjhXkt4LoC041fIH.jpeg", // "ucy0WknOKMhuNtfqcRgmWUgpvp2IPKhU84lU2tAq.jpeg"] var zip = new JSZip(); var folder = zip.folder("files"); files.map(async item=>folder.file(url+item)) val.addEventListener("click",(e)=>{ zip.generateAsync({type:"blob"}) .then(function(content) { saveAs(content, "example.zip"); }); }); } }, },
-
How to create and start an infinite background script in php? [best practices]
I want to create a PHP script that will run non stop and execute some instructions every minute/hour (according to my need). It should never die.
How should I proceed to this one? How do I start the script itself?
What Iv'e done so far is created an infinite for loop and checking the time and if it's a new minute then calling my function. But when I call the link, it shows my browser is busy.
-
How to insert multiple row data from a table into another table in MySQL using checkboxes
I trying to insert my data from table_request into table_list by click the approve/reject button under the table.
User will click the checkboxes for select all or select specific row.
The current problem is the about the foreach and insert statement are wrong. After I click approve, it can only insert table_request id into table_list.
Requesting the resolution.
Thanks
This is my table_request.php
<form name="bulk_action_form" action="action.php" method="post" onSubmit="return approve_confirm();"/> <table class="bordered"> <tr> <th><input type="checkbox" name="select_all" id="select_all" value=""/></th> <th>Name</th> <th>Remark</th> </tr> <?php $query = "select * from `table_request`;"; if(count(fetchAll($query))>0){ foreach(fetchAll($query) as $row){ ?> <tr> <td><input type="checkbox" name="checked_id[]" class="checkbox" value="<?php echo $row['id']; ?>"/></td> <td><?php echo $row['Name'] ?></td> <td><?php echo $row['Remark'] ?></td> </tr> </table> <input type="submit" name="approve_btn" value="Approve"/> </form>
This is my action.php
<?php session_start(); include_once('connection.php'); if(isset($_POST['approve_btn'])) { $idArr = $_POST['checked_id']; $Name = $row['Name']; $Remark = $row['Remark']; foreach($idArr as $key => $value) { $save = "INSERT INTO table_list(id,Name,Remark) VALUES ('".$value."','".$name[$key]."','".$Remark[$key]."')"; $query = mysqli_query($conn,$save); } $query .= "DELETE FROM `table_request` WHERE `table_request`.`id` = '$id';"; header("Location:table_request.php"); } ?>
Requesting the resolution.
Thanks
Here is my code for the table row
-
Connect to HDFS HA (High Availability) from Scala
I have a Scala code that now is able to connect to HDFS through a single namenode (non-HA). Namenode, location, conf.location and Kerberos parameters are specified in a .conf file inside of the Scala project. However, now there's a new cluster with HA (involving standby and primary namenodes). Do you know how to configure the client in Scala to support both environments non-HA and HA(with auto-switching of namenodes)?
-
RabbitMQ Fetch from Closest Replica
In a cluster scenario with mirrored queues, is there a way for consumers to consume/fetch data from a mirrored queue/Slave node instead of always reaching out to the master node?
If you think on scalability, having all consumers call a single node responsible to be the master of a specific queue means all traffic goes to a single node.
Kafka allows consumers to fetch data from the closest node if that node contains a replica of the leader, is there something similar on RabbitMQ?
-
Kafka scalability if consuming from slave node
In a cluster scenario with data replication > 1, why is that we must always consume from a master/leader of a partition instead of being able to consume from a slave/follower node that contains a replica of this master node?
I understand the Kafka will always route the request to a master node(of that particular partition/topic) but doesn't this affect scalability (since all requests go to a single node)? Wouldnt it be better if we could read from any node containing the replica information and not necessarily the master?
-
Relational Database Design for Ordering Entries
I would like to study past approaches to designing a table schema that solves the following problem efficiently:
Background: A single table has 10,000 unordered objects. The 10,000 objects have a many-to-one relationship with 50 different categories. Every day, 500-1000 objects are inserted into the table and 500-1000 objects are deleted from it. The number of elements inserted or deleted at a single point in time is arbitrary.
Problem: Redesign the table to accommodate ordering these objects within each category.
Inserted objects should be capable of taking on any existing order within a category. The table should be capable of deleting a set of objects whose order is non-sequential.
Question: How would you solve this?
Question: Can you link me to past investigations and solutions of this generic problem?
Visual Background:
The table presently looks like this, where id is the primary key:
id name category 1 Sta A 2 Danny A 3 Elle B 4 Bob B 5 Dan B My client wants items in category
A
to always appear in this order on the UI:Danny Sta
Unless my client changes the order to produce:
Sta Danny
One way to meet this requirement is to introduce another column called
order_in_user_viewer
.id name category order_in_user_viewer 1 Sta A 1 2 Danny A 2 3 Elle B 1 4 Bob B 3 5 Dan B 2 This design does not immediately seem good. For if I want to insert a row with category=
A
, then before inserting the row, I need to count how many rows have categoryA
. If I want to delete the row withDan
, then I need to update the row withBob
to have order2
.I'm wondering if there are smarter designs?
-
Oracle - Exchange partitions between two List partitioned tables
Need some help here.
I have an ETL process which loads the data into a target table A. We have created another table B which is same as the target table in structure and this table is accessed by reporting team to generate reports. This is done to minimize the downtime for report generation. This way the reports are always accessing the latest data.
Target table B is a List partition table, partitioned on Client ID. ETL team loads data for each client in the respective partition, in Table A.
I tried doing it with Exchange partition: exchange partition mechanism to swap the segments of A and partitioned table B. But couldn’t do it as both tables are List partitioned and Oracle doesn’t like that. I created partitions so as to avoid creating multiple tables (TableA_ClientId) for each Client.
My other option: whenever data is loaded into target table A, rename the table B as table Temp, table B as table A and table A as table Temp.
Can you please suggest a better approach.