Newest Questions

Q&A for professional and enthusiast programmers

Div is positioned lower in Firefox than in other browsers

I've got a cart drawer that slides in from the side and multiple divs in it for products. One of the divs is positioned lower in Firefox and it overflows its container but it's all fine in other ...

Writing JavaScript function that generate prime numbers, why are some numbers excluded from the loop?

I wrote this function that generates prime numbers for a given range of numbers, I think it's simple and clear that must give the expected result, though, there are numbers that are excluded from the ...

How to override PreSaveAction within custom publishing pagelayout in sharepoint 2013

I have a custom publishing page layout.I want to set one field value dynamically within the page depending on the value of another field within the same page while editing before saving the page.The ...

CASE Statement MYSQL with Condition

I got 2 CASE statements: First CASE statement is as follows: Case When ((cust_shipmentdate_awb Is Null OR cust_shipmentdate_awb = '') AND (comp_shipdate_awb IS NULL OR comp_shipdate_awb = '')) Then '...

How to make jTable auto refresh in netbeans IDE

i have learning java aplication, but i'm confused when i search code to automatacly refress jTable. please help me to solved this problem

Django: How can I remove all stored messages?

I used django message framework only in one view(PasswordChangeView). Problem is that when I access to PasswordChangeView, this page shows all message in message storage such as Login successed, ...

git grep <regex containing newline>

I'm trying to grep all line breaks after some binary operators in a project using git bash on a Windows machine. Tried the following commands which did not work: $ git grep "[+-*\|%]\ *\n" fatal: ...

Using modal image in <div style=“background-image: url()”>

I am trying to use modal image in my responsive website. I have my images in divs as background-image. Like; <div class="someClass" style="background-image: url(image.jpg)"></div> I have ...

Use Angular Cli with Webpack

I am trying to incorporate cli generate commands in my angular2 project but it gives me a error I am using the angular2-webpack-starter from git You have to be inside an angular-cli project in ...

How to empty Guava cache every 30 seconds while sending it to another method?

I am populating my guava cache from multiple threads by calling add method. Now from the background thread which runs every 30 seconds, I want to send whatever is there in the cache to sendToDB method ...

In Python , can else block have further if-elif-else blocks?

Movie Tickets: A movie theater charges different ticket prices depending on a person’s age. If a person is under the age of 3, the ticket is free; if they are between 3 and 12, the ticket is $10; and ...

influxdb query result value change

i have this query select friendly_name_str as "name", state from "device_tracker.emmip7" it returns the following data { "results": [{ "series": [{ "name": "device_tracker....

Develop a Whatsapp Bulk message software

I am a new in the community so please forgive me for any mistakes I do with the rules. I have a client that asked me to program him a Whatsapp Bulk message software on C Programming Language. I made ...

In Eclipse RCP Application, how can i push SWT code to launch a shell to open a Dialog box to get the File Name to the String varibale say fileName

In Eclipse RCP Application, how can i achieve my view to launch a shell to open a Dialog box to get the FileName to the String varibale say fileName? public class View extends ViewPart { ...

Laravel 5.3 Increment 001 to 002 in code

i have a registration_id in the format of KUTWJH210117001, next time when the user posts the registration_id i want to increment it by KUTWJH210117002 but i'm getting the out put as KUTWJH210117001 /...

Android and Web app

I am new in programming. I am going to make an android and web app for restaurant management system. Customer will order menu from android and restaurant will receive order on system. Can someone ...

n Queens Java not working for 4 by 4

My n Queens variation with an input seems to work for all inputs except 4x4 boards. It takes a board size and a starting position for 1 queen. Is there a reason why it isn't working for that size? I ...

ios: How to make UIPickerView(UIView) catch touch event before UITouchRecognizer?

Event Handling Guide for iOS said "There may be times when you want a view to receive a touch before a gesture recognizer. ", but I couldn't find how to do that. I tried delaysTouchesEnded = false, ...

searching a string from html page in php

<?php $data = file_get_contents("http://localhost/traveller/index.html"); $regex = '$_POST[/"search"/]'; if (isset($_POST["sub"])){ if (preg_match($regex, $data)) { echo $regex; } else {...

Can I use AWS Cognito Credentials to access Amazon SimpleDB?

I implemented Amazon SimpleDB in my mobile application and got it all working using the secret access key in a credentials file. From what I gather this won't work and isn't secure for mobile ...

PHP $_GET[] Issue

I'm familiar with the usage og PHP Get Variables but on my Activation Message Site, which is opened in the Browser by clicking on a Link in the Mailbox of the new user the $_GET[] does not do it's job ...

Does anyone know how to remove geoson polygon from map with mapboxgl?

I experience some difficulties to remove a geojon polygon from a layer with mapboxGL. Here the following code to add my geoson mpolygons where array_geo is a polygon geometry. Adding the polygon ...

How to detect string and PDF in base64 and write then into different files?

I get a base64 content from user. He can submit text which is base64 encoded or submit pdf which is again base64 encoded. Now I want to write plain text into an HTML file and the pdf file into a pdf ...

Why does it draw so slow?

I'm trying to develop a simple 2D game and for the animating, I'm using Timer and TimerTask. But it draws so slow only when I call repaint for Background image which is 24000 X 1600 size and 30MB png ...

How can i use java on the server hosted which is of shared type

Hi I have recently purchased domain and hosting space at the provider godaddy then now i want to understand how to install java on this server as it is shared hosting space. I have tried lot of all ...

Insert Timezone Aware into MySQL with SQLAlchemy

Assume the following pandas.DataFrame In [108]: import pandas In [109]: import numpy as np In [110]: import sqlalchemy as sql In [111]: df = pandas.DataFrame(np.random.randn(8, 2), columns=['a', ...

I need to retrieve data from database into a Gridview. displaying values must be selected according to dates selected

<div style=" margin-left: 214px;margin-top: -42px;margin-bottom:10px;"> From Date <asp:TextBox ID="txtfromdate" runat="server"></asp:TextBox> <asp:CalendarExtender ID="...

How to retrieve string value from a json using javascript?

My site stores strings in a json file and uses javascript to retrive value to HTML. Here's simplified version of the function. HTML: <html> <head> <script src="script.js"></...

Autocomplete combobox using jquery

I have a problem with autocompete combobox using jquery. Here I'm dynamically adding the new combobox. There is a add button functionality to add the combobox dynamically. My autocomplete is working ...

image upload from android to nodejs

how to get an image from android? I used console.log(request.files.image.originalFilename); how to read the image in nodejs server. console.log(request.files.image.path); can anyone give the ...

Point Free Style Required for Optimized Curry

Say we have a (contrived) function like so: import Data.List (sort) contrived :: Ord a => [a] -> [a] -> [a] contrived a b = (sort a) ++ b And we partially apply it to use elsewhere, eg: ...

Managed Debugging Assistant 'PInvokeStackImbalance'

I have a C function I'm exposing to F# code: #define EXPORT extern "C" __declspec(dllexport) EXPORT Video *NewVideoEncoder(LPCWSTR file, unsigned int width, unsigned int height) The client F# code ...

Finding bugs in buggy client / server program. concurrent client transactions can update the server state

Included is a buggy client / server program. The server maintains a set of integer-valued slots that the clients can read and write. The objective of the server is to allow many concurrent clients ...

Update JSON object via functional programming

var objList = [ {name: 'John', salary: 2000000}, {name: 'Adam', salary: 190000}, {name: 'Sally', salary: 300000} ] Filter the objects with salary > 195000 and return objects with just name ...

Filtering multiple selected filed in PHP before uploading

I currently have a PHP script that uploads multiple files selected to a certain folder, I was able to filter the size and file extension if I will just upload a single file. In my case I do upload ...

how to Project all columns in relational algebra

do we need project sign (pi) when we dont want to filter any columns in relational algebra? or simply if we want to get every column to be returned? and i guess same goes with the selction operator ...

Can't find how to configure the Geany compiler (Ubuntu)

I'm trying to set the Geany editor to work with Python 3 but can't find "Build>Set Build Commands" buttons. I need it to start learning Python. I've both Python 2 and 3 installed. I've tried to find ...

How to load an OBJ model from web server in unity

Any easy example to loading an .OBJ model from web server in unity 5.4.1

.htaccess rewrite rule is not working when generated from generateit

I am trying to rewrite a url and i have no clue of .htaccess because i am not an SEO literate. There are many questions on SO but nothing is serving to my purpose. I am using generateit.net to rewrite ...

unwanted url coming in google search results of my website

i have this page in our website http://www.tatkalirctc.com/pnrstatus but in google search results this page other versions of this page is indexing as causing duplicate content issue as well like ...

Subscribers from event driven subscriptiom table - Sybase Sql

We have an event driven subscriptiom table, where each time a person subscription changes, it is recorded with the subscription status AND the effective 'start date' and 'end date' of this new ...

Segregating Controls to each type using Lambda Expression c#

Can something enlighten me, I just wonder if there's easy and efficient way in handling different types of Controls Here's the scenario: I have a Panel Control. inside on my panel there's plenty ...

Need Help to display images from model

I have a model named 'Page' and i want to store many images for each Page object. So i created a Separate Model named 'Image' as a F.K of 'Page' model. In my template,, i am displaying all the Page ...

Is it possible to get the request per second from AWS load balancer?

Is it possible to get the number of requests sent to a load balancer in AWS? I am trying to monitor the number of requests that our load balancers are receiving. Both ELB and Application Load ...

How to add automatic row count to NetBeams jTable

The default code of the NetBeams jTable looks like this: jTable1.setModel(new javax.swing.table.DefaultTableModel( new Object [][] { { new Integer(1), "Name1", "Description1"},...

Undefined variable: files

I am continuously getting this error: ErrorException in e54e3fcd7ecd167b292fe93f7ff5e59b37987817.php line 11: Undefined variable: files (View: C:\xampp\htdocs\Land_Map\resources\views\pages\...

how to find two number whose sum is given number in sorted array

public static void findNumber(int number) { int[] soretedArray = { 1, 5, 6, 8, 9 }; for (int i = 0; i <= soretedArray.length; i++) { for (int j = i + 1; j < ...

quantize an analog signal in matlab

Sample and quantize the signals y1= sin(2000πt) + cos(2000πt) with Ts = 0.1 ms and for 0 ≤ t ≤ 2 ms. Where Ts is the sampling interval and the ADC has 8, 16, and 32 uniform quantization levels. I can'...

batch file to copy only one of filetype for each subfolder to another folder

here is my code: xcopy "C:\Users\Me\Desktop\data\*.mtl" "C:\Users\Me\Desktop\mtl" /s /e What it does is copy all the files of filetype .mtl from the subfolders under the data folder, and copy it to ...

How to remove title bar in android api 22?

I am tried by putting <activity android:name=".ActivityName" android:label="@string/app_name" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"> </activity> in ...
15 30 50 per page
Translating... 0%