Rahul Desai

0

votes
0

answer
6

views

Gitlab merge from a specific source branch

I have a branch in gitlab called devops and i want to merge my master branch with devops branch. However, i do not want any other branch to issue a merge request with devops branch. Is it possible? Basically, for devops as the target branch while merging, only master can be the source branch. Can so...
Rahul Desai
1

votes
1

answer
232

views

<legend> not centering in Firefox

In my CSS, I did: legend{ text-align: center; } Still the legend is left aligned in Firefox. It works properly in Chrome. The solution mentioned here does not work for Firefox. My Fiddle: http://jsfiddle.net/5JeaQ/14/ UPDATE: I do not want to do width: 100% as it looks ugly with that. I am using Fir...
Rahul Desai
1

votes
1

answer
1.2k

views

NVD3 chart partly missing grid lines

In my chart here, if you can notice, it is missing grid lines for the first 4 and last 4 dates. I tried doing: .ticks(data[0].length) but it didnt help. What am I missing? jsFiddle
Rahul Desai
1

votes
5

answer
2.4k

views

Cant detect if responsiveVoice isPlaying()

There isnt much information on http://responsivevoice.org about isPlaying(). Here is what I tried which isnt working. I do not get the console.log(). setInterval(function(){ // continuously check if the audio is being played if(responsiveVoice.isPlaying()){ console.log('playing..'); }, 100 );...
Rahul Desai
1

votes
2

answer
728

views

orderBy not working properly with key,value pair [duplicate]

This question already has an answer here: Order by Object key in ng-repeat 3 answers I am pulling a JSON of US states with their key codes, wherein the key is their state code, like NY, and value is the name of the state, like New York. In the dropdown, I am having trouble ordering it alphabetical...
Rahul Desai
1

votes
4

answer
332

views

Milliseconds out of sync

I am developing a stopwatch application using Javascript/jQuery. The problem is that the milliseconds value is out of sync with REAL milliseconds. I am using function setInterval() with the interval of 1 millisecond, still it is causing this problem. jsFiddle: http://jsfiddle.net/FLv3s/ Please help!
Rahul Desai
3

votes
3

answer
7.2k

views

CSS transform and transition not working in Safari

I am working on a for a mobile site. It is working file in Firefox and Chrome but not in Safari. I am running it on Windows 8.1 and I observed the same issue on Safari in iPad mini. In the snippet below, if you check out the mobile view (max-width: 768px) and click on the menu icon in the top right...
Rahul Desai
5

votes
5

answer
11.5k

views

toFixed(2) function not working

This one is weird, because I got it running in this fiddle but it is not working in the main fiddle. I believe the code is the same. Here is the main function: window.setInterval(function(){ for(var i=0; i < companies.length; i++) { var randomVal = (Math.random()*(10 - (-10) + 1)) + (-10); randomVal...
Rahul Desai
1

votes
1

answer
2k

views

D3 Bar chart - Remove labels with zero value

In the fiddle below, you can notice that the first bar has the label no even though its value is zero. How do I remove the labels with zero values in my stacked bar chart? jsFiddle CODE: var data = [ { "episode": "Ep. 01", "yes": "100", "no": "0" }, { "episode": "Ep. 02", "yes": "70", "no": "30" },...
Rahul Desai
2

votes
2

answer
954

views

Styling two different elements in the option of HTML select tag

In my PHP code, I am pulling a table of two columns from the database and displaying both of them in a dropdown list. Following is the code snippet: echo ""; while($row = pg_fetch_row($result)){ echo "" . $row[0] . " " . $row[1] . ""; } echo ""; I wanted to separate them both by styling them di...
Rahul Desai
1

votes
2

answer
105

views

Unable to style <li> element text with custom bullet

I have styled my list with custom bullet as shown below. The problem is that I want the text to be displayed as in the image below: So, basically, the overflowing text shouldnt be right below the bullet. I tried the solutions available here on SO but it didnt work in my case. ul{ width: 300px; bo...
Rahul Desai
1

votes
2

answer
79

views

Can't understand why replace() is not working here [duplicate]

This question already has an answer here: With regex how do i match between an XML tag multiple times? 5 answers My input is: 'testkkk111' And the output needs to be: 'testkkk111' ( tag unwrapped from 111) Here is what I have so far: var input = 'testkkk111'; var effect = 'strong', // dynamic se...
Rahul Desai
5

votes
6

answer
869

views

What is the difference between “perl test.pl” and “./test.pl”?

I have observed that there are two ways of executing a perl program: perl test.pl and ./test.pl What is the exact difference between these two and which one is recommendable?
Rahul Desai
2

votes
1

answer
2.1k

views

Animating jQuery dialog to different position

I am designing a webpage where I have got 6 dialog boxes in a grid layout. Each dialog box has a button. I want it to work this way: when user clicks on the button, the dialog box should get expand and the other boxes should move to the right side with proper alignment and shrink the box sizes. I am...
Rahul Desai
2

votes
2

answer
2.9k

views

Inline webworker: Cannot read property 'textContent' of null

I have created an inline webworker as follows: var blob = new Blob([document.querySelector("worker").textContent]); var worker = new Worker(window.URL.createObjectURL(blob)); However I am getting an error: Cannot read property 'textContent' of null What am I missing? jsFiddle
Rahul Desai
1

votes
2

answer
12.1k

views

jQuery UI Menubar not working

I got the code from here and the related files from here. I just changed the paths and kept only one menubar, its not working for me. Here is what I can see: Here is my code: In the HTML Head: $(function() { function select(event, ui) { $("").text("Selected: " + ui.item.text()).appendTo("#log"); if...
Rahul Desai
2

votes
1

answer
125

views

Validation error while submitting app to Firefox Marketplace

I was validating my manifest on this page with this manifest URL of my app hosted on GitHub: https://raw.githubusercontent.com/my_username/my_application/master/manifest.webapp This is the error I got: Manifests must be served with the HTTP header "Content-Type: application/x-web-app-manifest+json"...
Rahul Desai
1

votes
3

answer
96

views

Regular expression to extract elements from a string

In my perl program, I am having a string in $new which is of variable length. Following are some of the instances: $new = "sdf / wer / wewe / dfg"; $new = "lkjz / dfgr / wdvf"; $new = "asdfe"; How do I extract the elements seperated by / into an array using Regex?
Rahul Desai
2

votes
1

answer
562

views

keyboard friendly AJAX search

I have implemented the AJAX search which is similar to the example here. In this example, you might notice that you can switch between the search results using TAB key. In my search results, there is a table in the following format: *Client* *Status* *Hostname* value value value value valu...
Rahul Desai
2

votes
1

answer
276

views

Multistep form with dynamic data

I am creating a website where I want to have a list of categories on the first page, on selecting a category, it would take you to a list of sub-categories. And on selecting a sub-category, it would take you to a questionnaire based on the particular sub-category and finally, an email is sent to the...
Rahul Desai
1

votes
2

answer
4.2k

views

Set value/text of a <span> element using Dojo

I am developing a stopwatch application in an attempt to learn the Dojo Toolkit. So, to start with, I need to set the hours, minutes, seconds and milliseconds to 0. I tried: dojo.byId("hours").value = "00"; Also tried: domAttr.set("hours", 00); It didnt work. In the console, the following error is t...
Rahul Desai
1

votes
6

answer
666

views

How to display background image while no content?

I have a div with a background-image set. I will be dynamically adding content to this div, so I need it open with the background-image. For the background-image to show up, I did: background-size:100% 100%; Also, height: 100%; width: 100%; But it does not show the image. How do I get this working?...
Rahul Desai
1

votes
4

answer
165

views

extracting unique elements from sorted list of array

What I have done so far: var input = [1, 1, 3, 3, 3, 5, 5, 5, 9, 9, 9, 9]; var output = []; /*input.forEach(function(element){ // works as intended, but I know we can do better :) if(output.indexOf(element) == -1) output.push(element); });*/ output.push(input[0]); // first element is always uniq...
Rahul Desai
3

votes
1

answer
319

views

Object reference of OrganizationService is not creating in Micosoft Dynamic 365

I am trying to retrieve incident records from Dynamic 365 but while trying to create reference of OrganizationService , I am getting null reference. Don't know if anything is new in Dynamic 365 and I am doing it wrong? Note : UserName and Password is removed for a reason. But it is Passed in Code!!...
rahul desai
3

votes
3

answer
12.8k

views

jQuery validate get the error message below the textbox / input element

http://jsfiddle.net/msbUM/ How do I get the error message below the textbox / input element?
Rahul Desai
2

votes
1

answer
2.5k

views

Get nearest location from a set of predefined locations with Google Maps Javascript API

I have a set of 2 predefined locations and based on user's input of zipcode, I need to show the nearest one. So far, I have searched the user input location using the zipcode: $("form#zipcodeSearch").on("submit", function(event){ event.preventDefault(); var jsonUrl = 'http://maps.googleapis.com/ma...
Rahul Desai
2

votes
1

answer
2.8k

views

MongoDB update() is actually replacing the whole record in my code [duplicate]

This question already has an answer here: mongodb unwated removal of an empty field on update 2 answers I am updating my MongoDB database using the form data coming from a PHP script and it can have variable number of elements to be updated into MongoDB. For testing purpose, I tried.. $update = '"c...
Rahul Desai
7

votes
4

answer
12.5k

views

Removing blank elements from an array

In my Perl code, I am accessing an email. I need to fetch the table in it and parse it into an array. I did it using: my @plain = split(/\n/,$plaintext); However, there are many blank elements in @plain. It has 572 elements and about half of them are empty. Am I doing anything wrong here? What do I...
Rahul Desai
2

votes
5

answer
71

views

CSS not getting applied to <label>

I am developing a form and setting a size for the label and aligning it right so as to look decent. However the CSS is not getting applied. Here is my code: label{ width: 50%; text-align: right; } Fiddle How do I get this working?
Rahul Desai
2

votes
2

answer
2.3k

views

Limit drag movements to a circular SVG boundary

Here is a sample of the D3.js visualization that I am working on right now: Here, the grey circle is the SVG container. I would like to limit the drag of the green bubbles to the grey circle boundary. I found this example and I used it in my code, but I got two errors: Uncaught TypeError: Cannot rea...
Rahul Desai
2

votes
1

answer
4.9k

views

unable to create range

I am trying to select a dynamically added timestamp - hit enter in the contentEditable element. $('#content').on('keypress', function(e) { if (e.which === 13) { console.log('enter pressed'); e.preventDefault(); var range = window.getSelection().getRangeAt(0); var element = document.createElemen...
Rahul Desai
2

votes
2

answer
8.8k

views

HTML5 datepicker prevent past dates [duplicate]

This question already has an answer here: Disable certain dates from html5 datepicker 3 answers I am working on a website for booking movie tickets. What should I set the min attribute to, to prevent past dates in the HTML5 datepicker? (I do not want to use PHP solution mentioned here.) Is there a...
Rahul Desai
3

votes
2

answer
4.8k

views

Hide first <li> element

My HTML structure is as per the following: Welcome About Support ... How do I hide the first element saying "Welcome" using CSS? Note that 2 elements have the same class here: 'gallery-collection'.
Rahul Desai
2

votes
2

answer
148

views

axis label restoring to original position after hiding series

In my NVD3 chart here, I have shifted the X-axis label downward so as to go with the vertically aligned dates. For that I did: xTicks.select('.nv-axislabel').attr("y", 90); // line # 81 in JS Now the problem is that if I hide any of the series using the control on the top right, this X-axis label r...
Rahul Desai
4

votes
2

answer
73

views

How to scroll a scrollable div when scrolled on other, non-scrollable div?

I know the question sounds confusing, but here is what I am trying to do - in the snippet below, if the user scrolls on the green div, I want the yellow div to be scrolled accordingly, just as if the yellow div was scrolled. Note that the yellow div has overflow: auto; but the green one doesnt. doc...
Rahul Desai
5

votes
6

answer
701

views

Inserting an element in a 1D array at the first position

I was asked this question in a Javascript interview and sadly, I couldnt come up with a better answer than the obvious one at that time: Creating a new array, assigning new value to the first location and copying the rest. What would be the best algorithm in terms of time and space complexity for in...
Rahul Desai
2

votes
3

answer
644

views

need regex to extract two substrings from one string

I have a string similar to tvm11551.iso that I am trying to parse. In this string, these bolded numbers vary: tvm 11 5 51 .iso (please ignore the spaces here). I wrote the following program in PHP that would extract those two numbers from that string: $a = "tvm11551.iso"; if(preg_match('/^tvm\d{5}\....
Rahul Desai
1

votes
1

answer
5k

views

How to set datalist to show all options on focus?

I want to create a dropdown as in the snapshot below. I Googled and got to know that HTML5 datalist can help me do this. However, datalist does not show all options when the focus is on it. How do I show all options? Here is my code so far:
Rahul Desai
1

votes
2

answer
1.3k

views

Unable to inject service in the controller

I have done this when the service and controller are in a single file (usually, app.js) and it works without any issues. Now, I have the controllers and services organized in different files and the respective folders. I need to inject 1 particular service in a controller but I am running into an er...
Rahul Desai
2

votes
1

answer
5.5k

views

Get request being aborted in Internet Explorer 9

If you'll visit the site lab.buffspec.com SPECIFICALLY using Internet Explorer 9 and select a gildan 6.1, a hanes 6.1 or a gildan hood and then click on the get pricing button you will see that despite updating the quantity the total price isn't shown. This happens in Internet Explorer 9 only for th...
Rahul Desai

View additional