FAQ Database Discussion Community


Apply bold italic character style to tag when importing xml to adobe indesign

adobe,indesign,adobe-indesign
Is it possible to apply a bold italic character style to a tag in adobe indesign. Currently you can create a character style e.g. 'strong' and map this style to a tag, so when you import an xml, the 'strong' character style will apply to any 'strong' tags. However, if...

Error: request for member ‘check’ in something not a structure or union

c
I am trying to implement this function in my code Check QUEUEdelete_check(Q q, int refc){ link *temp; *temp = q->head; if(temp->check.refc == refc) q->head = temp->next; free(temp); return temp->check; while(temp->next != NULL){ if (temp->next->check.refc == refc){ temp->next = temp->next->next; if(temp->next == NULL) q->tail = temp; free(temp->next); return temp->check; } temp...

Pass arguments from a class to another class that inherits from threading.Thread

python,multithreading
I have two class in my python code. The class Filtro must to send two parameters to the class Man_Thr but if I send them by the costructor I never call the costructor for the thread metod start. This is my code: import threading class Man_Thr(threading.Thread): def __init__(self,cmd,q): self.comando=cmd self.coda=q...

Memory leak with CIColor spritekit

memory-leaks,sprite-kit,instruments
I created a class that would generate a hud item, this hud item can animate the resulting texture which is a gradient created using cicolor that is then saved into a uiimage which is in turn used for an sktexture. I've noticed now that i am getting a lot of...

BASH finding empty mountpoint

bash,mount-point
I haven't had much luck finding the answer to my question. I would like to find the next logical empty mountpoint using the mountpoint command in Ubuntu. This will allow multiple occurrences of a script I am writing to automate some tasks. #!/bin/bash MNT="ewf" COUNT="" until mountpoint -q /mnt/"$MNT""$COUNT" do...

How do I run the python files from command shell/command prompt?

python,shell
Really frustrated with this as one thing works at one time. Sometimes import filename.py works. But in the tutorials all I see is python filename.py. But when I try to give that, I am facing an error like invalid syntax. I have edited all the environment variables and I have...

How to use iTextSharp to convert to PDF

c#,itextsharp
ASP: <asp:Label ID="Label1" runat="server" Text="Folder Location: "></asp:Label> <asp:TextBox ID="tbFolder" runat="server"></asp:TextBox> <br /><br /> <asp:Label ID="Label2" runat="server" Text="Destination Folder: "></asp:Label> <asp:TextBox ID="tbDestination" runat="server"></asp:TextBox> <br /><br /> <asp:Button ID="btnExecute" runat="server" Text="Button" OnClick="btnExecute_Click" /> code-behind: public void btnExecute_Click(object sender, EventArgs...

Use the same javascript function in different selects

javascript,html
I need to use the same JavaScript function called Cerca2 in 3 separated selects. The first one works, but the others do not. I've tried to fix the problem by myself but I can't find where it is. EDIT: code edited, now work perfectly, tnx for all the suggestion and...

need to output BitLocker status to txt file

powershell
I have a simple PowerShell script to check the status of BitLocker drive encryption on a computer on the network. I'd like for the script to determine the status of multiple computers in a text file. Here's my basic script so far that Nathan Rice had helped with: $TextFilePath =...

Creating a MenuItem with a Shortcut of Control+Plus – is using reflection to modify MenuItem's private fields the best method?

c#,.net,winforms,reflection,menuitem
I'm using the legacy MainMenu control (with MenuItems) control in an application, and would like to implement zoom in and zoom out menu items (with Control++ and Control+- keyboard shortcuts). (Note that I'm using MainMenu and not MenuStrip). MenuItem does have a Shortcut property, of type Shortcut, but that doesn't...

Google OAuth service redirects to URL with a # sign at the end

php,url,oauth,google-oauth,fragment-identifier
When the user is redirected to https://accounts.google.com/o/oauth2/auth?response_type=code&client_id=[clientid]&redirect_uri=http://example.com/googleauth&scope=email by our "Sign In with Google" button, the response's Location header that causes the redirection back to the site has a # symbol at the end: Response headers:location: http://example.com/googleauth?code=[code]# It certainly does not break the site's funcionality, but I'd like to get rid...

Placing text over absolute image

html,css
A similar question has been asked many times (how to place text over an image) but every solution says make a relative positioned container and place image and text inside. But what if the container needs to be absolute?? I want the image to be absolute in order to span...

Unable to target a class within a class in CSS

html,css
I'm attempting to target a class within a class but it is having no effect. My attempt: <style> .parentclass .childclass ul li a{ color:red; background:black; } </style> <div class="parentclass"> <ul class="childclass"> <li><a href="#">Item 1</a></li> <li><a href="#">Item 2</a></li> </ul> </div> However if I target only the parent class it works just...

Error even when using a Try/Catch block in PHP

php,laravel
I have a Laravel/PHP application with the following code: try { //gets the day of the last record for logged in user $lastRecord = $user->records()->orderBy('date', 'DESC')->first()->date; //convert to date $lastTime = \Carbon\Carbon::createFromFormat('Y-m-d', $lastRecord); } catch(Exception $e) { $lastTime = \Carbon\Carbon::now($user->timezone)->addDays(-1); } but I still get the error: ErrorException in Habit.php...

PyVisa-py backend

python,linux,raspberry-pi2
I have an error appeared on installing pyvisa-py pn on raspberry pi2, which is ImportError: cannot import name rname after I run command rm = visa.ResourceManager('@py') Here is the message given by interrupter: Traceback (most recent call last): File "", line 1, in File "/usr/local/lib/python2.7/dist-packages/pyvisa/highlevel.py", line 1477, in new visa_library...

PHP Script Unknown Error

php,if-statement,post,for-loop
I have a registration form that the user enters data in. Then after it is posted to the same page and checked for null fields, the variables are put in the $_SESSION array and the user is directed to another form to enter another set of data in a table....

How to incorporate a text qualifier in a file name used as a variable?

c#,csv,ssis
I have a C# script which takes in two CSV files as input, combines the two files, performs numerous calculations on them, and writes the result in a new CSV file. These two input CSV file names are declared as variables and are used in the C# script by accessing...

Passing a time zone into a web api call from moment with nodatime

javascript,c#,web-api,nodatime
I'm about to go insane dealing with datetime issues and the web. I have a web server hosted in the Central Time Zone. When clients in the Eastern Time Zone try and schedule an item for a given day using my app, they pass in the value of (for example)...

Updating multiple columns on same row MySQL

php,mysql
I couldn't find a definite answer to this specific issue, basically what I have created is a HTML table which displays the contents of a database into columns and rows. Currently it is very simple as I am understanding how it works for now. ID | First_Name | Last_Name |...

How do I get the width and height of a Canvas element that is set to 'Auto'?

c#,windows,canvas,phone
I'm developing an App for Windows Phone 8.1, and I have a canvas that draws a ball onto it programmatically. My problem is I want to set the boundaries of the canvas to be that of its width and height, but I'm using grids with relative sizes for the size...

Quotes in my HTML?

jquery
Sample JSON: {[ { "modelYear": 2015, "divisionId": 7, "divisionName": "Cadillac", "subdivisionId": 8290, "subdivisionName": "Cadillac Cars", "modelId": 27204, "modelName": "ATS Coupe", "lastModifiedDate": "2015-05-01T01:00:00-06:00", "effectiveDate": "2014-04-14T01:00:00-06:00" }, { "modelYear": 2015, "divisionId": 7, "divisionName": "Cadillac", "subdivisionId": 8290, "subdivisionName": "Cadillac Cars", "modelId": 27314, "modelName": "ATS Sedan", "lastModifiedDate": "2015-05-01T01:00:00-06:00", "effectiveDate": "2014-04-14T01:00:00-06:00"...

Android google maps v2 cluster markers if they are close to each other

android,google-maps,markerclusterer
I have an app which uses google maps and places markers on it. The problem is, that I don't know at the runtime the coordinates of the markers. So my question is, is there any library that is capable of clustering my markers if they are close by and after...

Kendo UI grid dropdown and angular

angularjs,binding,kendo-ui,telerik,kendo-grid
I try to setup custom dropdown in Kendo UI. I have a reference to my issue. http://dojo.telerik.com/aFIZa/13 My issue is that I do not know how I can setup the selected text in the template attribute? I want to show the text field but save the id as a value....

The command to add to path in Julia language

path,julia-lang
How can I add a path to my current path in Julia, so that I can organize files and modules in folders, but still access them?

How do I loop a statement in c++

c++,loops
I want to loop a question and make it say "press Y to continue or N to quit" but I don't quite know how. I tried to do a while loop but they haven't worked well. Here's the code: cout << "press Y to play again or anything else to...

Doctrine - Missing value for primary key

sql,symfony2,doctrine2,primary-key
I have this entity: /** * Class ParserURLs * @package AppBundle\Entity * @ORM\Entity(repositoryClass="AppBundle\Entity\ParserURLsRepository") */ class ParserURLs { /** * @ORM\Id * @ORM\Column(type="string", length=50) */ protected $external_id; /** * @ORM\Id * @ORM\ManyToOne(targetEntity="AppBundle\Entity\Parser") */ protected $parser; ... } Any I try to get results filtering by $parser, like this: $query = $this->doctrine->getManager()->createQuery(...

Wait for an async callback to finish before completing separate function in Javascript

javascript,asynchronous
Apologies if this is a repeat, but all I can find is help to let the function finish or unrelated languages, not what to do after. Anyway... So, I have two other-wise unrelated functions. One calls the Namey API, which returns a random name in a callback, and I use...

Changing column names in a data frame in R with the specific name

r
my output required in the column name is now i am getting as Column A Column B x = 128 Y = 145 in the code as we need to write is "Column A (N=x)" "Column B (N=Y)" How we will call the value in X in quotation mark. but...

Configuring Hiera on Puppet Enterprise

puppet,hiera,puppet-enterprise
I am new to Puppet and Hiera, and having a configuration issue when attempting to apply a module the contains a Hiera lookup to an agent. From /etc/puppetlabs/puppet/hiera.yaml: --- :backends: - yaml :hierarchy: - defaults - "%{clientcert}" - "%{environment}" - global :yaml: :datadir: '/etc/puppetlabs/puppet/hiera' From /etc/puppetlabs/puppet/hiera/develop.yaml: git_client: file_content:here When running...

Java boolean value is always true

java,constructor,boolean
I'm having trouble with my school Java code - I'm trying to create a constructor that takes a boolean value, and then uses it later, but for some reason it's always true. Could anyone tell me what I'm doing wrong? EDIT: I'm posting my entire code, I thought redacting it...

regex- get string in single quotes and get first number in paranthesis

ruby,regex
I'm trying to get the first string that is in the text and the first number inside the parentheses. I don't need the decimal points after it. for example. I want to be able to get the bold italicized pieces from below with a regular expression, or if there is...

:promt in Rails select() helper not working

ruby-on-rails,ruby-on-rails-4,erb
I have next string in my form template(from book 'Agile web development with Rails'): <%= f.select :pay_type, Order::PAYMENTS_TYPES, promt: 'Select a payment method' %> When form is being visited with browser, there is not default "promt" for select field indicated. What is the problem? UPD I'm using Rails v4.0.2 UPD...

Mongoose : search in an array

database,node.js,mongodb,mongoose
I have this schema: new mongoose.Schema({ providers : [{ provider: { type: String, required: true }, data : { type : String, unique: true } }] }); For instance, an item can be : providers: [{provider: "linkedin", data: "abcd"}, {provider: "twitter", data: "efgh"}] What I would like to search in...

Theano: how to efficiently undo/reverse max-pooling

python,optimization,neural-network,theano
I'm using Theano 0.7 to create a convolutional neural net which uses max-pooling (i.e. shrinking a matrix down by keeping only the local maxima). In order to "undo" or "reverse" the max-pooling step, one method is to store the locations of the maxima as auxiliary data, then simply recreate the...

Unexpected colors in `surf` plot

matlab,matlab-figure
I'm trying to write a matlab code that will answer the following question: Using functions linspace,meshgrid,surf and dot operations, plot the surface of the cones: z=sqrt(x^2+y^2) and z=-sqrt(x^2+y^2). Use the vector form of the coordinate transformation x=rcos(θ),y=rsin(θ), where 0 ≤ θ ≤ 2π and 0 ≤ r ≤ 2. Make...

python cannot decode circumflex

python,unicode
data = [item for item in contents.encode('utf-8').split('\r\n')] UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1807: ordinal not in range(128) Why can't it encode it when I encode it?...

How do I send a doclink via LotusScript?

lotus-notes,lotusscript
I am iterating through a view of unprocessed requests in LS in a database, and wish to send a reminder with doclink (rather than the doc itself) to the laggards via email. Do I have to manually assemble a rich text item to make a doclink or is there an...

punchDB / allDocs / .then return a value

javascript,angularjs,pouchdb
I am new in js and punchDB and have problem in fetch data from pounchDB this is usual in fetch data and process db.allDocs({include_docs: true}).then(function (result) { console.log( result.rows); })); but I want to return "result.rows" var result = db.allDocs({include_docs: true}).then(function (result) { return result.rows; })); Yes I can have...

Change ToggleButton for Expander in Wpf when expanding

c#,.net,wpf,xaml,wpf-controls
I want to change the toggler of expander when I collapse and uncollapse. Which means, I want to place an image instead. Is there a simpler way to do that in XAML rather than building ypur own expander template?

PHP turn data into json array

php,arrays,json
I'm trying to get the coordinates from my database and show them as markers on a map using the Jvectormap plugin. But how can I turn the data which I retrieve from my database into a working json array? I've done something similar before with the morrisJs plugin so I...

Normalized Mutual Information by Scikit Learn giving me wrong value

python
I’m new in Python and I’m trying to see the normalized mutual information between 2 different signals, and no matter what signals I use, the result I obtain is always 1, which I believe it’s impossible because the signals are different and not totally correlated. I’m using the Normalized Mutual...

Vertial column heading text in ui-grid

css,angularjs,css3,angular-ui-grid
I'm trying to write a angular ui-grid (the new ng-grid) with vertical text in the column headings but having some interesting results using the standard CSS trick .blue { color: blue; transform: rotate(90deg); transform-origin: left; height:100px; } http://plnkr.co/edit/CtDEcgSrebLFnBXcMrjS?p=preview I just wondered if this were possible and if anyone had any...

VBA - Why do I get a compile error expected function or variable

vba,access-vba
I am curious to understand why the following throws and compile error stating it is expecting a function or variable Dim frm as Form set frm = DoCmd.OpenForm(FormName:=mstr_FORM_NAME, View:=acDesign, WindowMode:=acHidden) but I can do this DoCmd.OpenForm FormName:=mstr_FORM_NAME, View:=acDesign, WindowMode:=acHidden set frm=Forms(mstr_FORM_NAME) I have no issue with doing what works, I...

React js src attribute is not updating

javascript,reactjs
I have a Component Img that receives an image file. The component reads the file and puts a base64 result into my state.base64 variable. When I forceUpdate the state and log the values, the result is there, but in browser it looks empty. Here is my code. Jsbin code...

Invalid session in Sencha Architect

javascript,extjs,sencha-touch,sencha-architect,sencha-cmd
I've been trying to create a new Sencha ID, but it always shows the error message They don't mention any thing over here, a simple message which doesn't show what kind of error we are doing there. Did anyone face this issue? Any solution for this.....

Kendo UI Grid one column does not display data

javascript,jquery,kendo-ui,kendo-grid
I have a Kendo UI grid that works great in development. When I deploy it to production, the data in just one of the columns (Salesperson) does not appear. I get no error at all. When I view source, the td is just empty. I've used Stackoverflow for years, never...

How to Know if an specific windows service is installed with Node js?

node.js,node-webkit
I'm new in Node JS. I'm building an new desktop app with web-kit. One of my requirements is verify if an determinate service is installed on Windows. How can I do that on Node js? I know how to find the application at the process list with Node Js. But...

onPrepareOptionsMenu in Fragment not being called as of AppCompat v22 (API 10)

android,android-fragments,appcompat,appcompat-v7-r22.1
We have an app that uses AppCompatActivity with multiple fragments, each of which contribute to the options menu. (i.e. the fragments override onCreateOptionsMenu and insert their own menu items) The fragments also override onPrepareOptionsMenu, in order to conditionally enable/disable certain menu items based on the state of the app. Prior...

Do not parser XML using SimpleXML library

android,xml,xml-parsing,simple-framework
I have an issue when I try paser xml string to object using SimpleXML(version 2.7.1) library. This is my string : <tbody> <tr> <th></th> <th>Weather</th> <th><img src="http://localhost:8080/img/today" /></th> <th><img src="http://localhost:8080/img/today_1" /></th> <th><img src="http://localhost:8080/img/today_2" /></th> </tr> <tr> <td><img src="http://localhost:8080/img/location_1" /></td> <td> <a...

Angular directive link function only runs on page load/reload

angularjs,angularjs-directive
I am trying to implement a toggle image [has 3 images src] based on if a user in a list has a filter set, the problem is the image src will not change when when I reloaded the candidates object via ajax because the link function in the directive is...

Apache dbd Internal error: AH00629: Can't connect to mysql

mysql,apache,basic-authentication,dbd
I'm trying to use dbd with mysql as authentification with Apache 2.4. When Apache starts, i have this error : [Tue May 12 13:07:18.789021 2015] [mpm_event:notice] [pid 10625:tid 140410697815936] AH00489: Apache/2.4.10 (Debian) configured -- resuming normal operations [Tue May 12 13:07:18.789118 2015] [core:notice] [pid 10625:tid 140410697815936] AH00094: Command line: '/usr/sbin/apache2'...

how to add digits in a long variable that will be converted to string?

java
i had this method: public long getLastSequenceNumber(); it should return me: 0 a number that should be like 34,60,103... the maximum amount of 12 digits number (243265438564 for example). What i want is when i get this number i want to convert it to a String and add the "0"...

AngularJS only fetch data if undefined

javascript,angularjs,http
I'm fetching some data with $http in a controller to show the user some data. But after this is done I don't want to do anymore fetches because the data is already fetched. However when going from one tab (controller) to another tab (controller) data is always fetched. My knowledge...

Image upload using paperclip in ruby on rails

ruby-on-rails,ruby,ruby-on-rails-4
I'm trying to upload image using paperclip. But the exception "NoMethodError in Shop::ProductsController#create undefined method `chomp' for nil:NilClass" occurs. Can anyone see and highlight the problem please? Here is Gemfile code gem 'paperclip', '~> 4.2.1' Controller class Shop::ProductsController < ApplicationController layout "shop" def index @products = Product.find_by_shop_id(session[:shop_id]).sort_by_name # @products =...

what would I use for a meteor package manager

meteor
I understand meteor has their own package manager under the covers (that way meteor deploy works to include the packages) but I'm looking for a package manager for meteor. By package manager, i'm looking for like bundler/gemfile (ruby) or maven/pom file (java). Again I understand the meteor install works fine,...

Database cannot be created

android,sqlite
I have tried to create a database in Android using SQLite. I have a separate class that inserts the values into the database, but I'm getting an error that says the database cannot be created and I'm not sure why! Any help would be appreciated. package com.example.siuni.mymedicare; import android.content.ContentValues; import...

SQL setup for searching

php,mysql
I want to be able to search various manufacturers by selecting checkboxes, how would I do this? What if they choose 7 to search how would i get it to work with the sql string right now i have to enter it manually like this LIKE '%BMW' but I want...

Excluding insert of specific rows when copying data in same table

mysql,sql
I use code below to copy and insert data in same table in mysql: INSERT INTO table (product_id, value, branch_id) SELECT product_id, value, "71" FROM table WHERE branch_id = "53" It works well for copying and inserting all data. In this case it copies rows with branch_id=53, adds new rows...

Running functions in parallel in R

r,snowfall
I have two functions fun1 and fun2. I would like to run them in parallel in my R script. When they complete I'd like to use their output in further processing sequentially. I guess this means that I need to wait for them to complete. I would very much appreciate...

Remove all characters between 2 characters in a String

java,string,char,between,removeall
I have a database with 50000 rows. I want to get all rows one by one, put them into a String variable and delete all characters between "(" and ")", then update the row. I just don't know how to delete all characters between "(" and ")". I want to...

WPF transparency changing, when elements are bound

wpf,xaml
A VisualBrush is used to fill a Rectangle in a WPF window. It fills by binding its Visual property to a non-transparent element in the window. How can the Rectangle fill be made transparent, so that what is behind the window is visible through it, without making other elements transparent...

Is “RETURNED NO ROW” equal to NULL?

sql,sql-server,select
In Sql Server, if my select statement returns no row, does it mean to NULL? I made a research but I am not sure about it IF (SELECT TOP 1 CLMN1 FROM SOMETABLE) IS NOT NULL THEN .... I was asking to understand the behavior of the if statement above...

How to disable Visual Studio's autocomplete while in comments

visual-studio-2013,autocomplete,intellisense
Visual Studio seems to have some kind of limited auto-complete that occurs while typing comments. It seems to be listing classes, variables etc just to fill in their name. Here's an image showing it popping up while I type "form". I find this highly undesirable because comments are not usually...

CoreData: Query to one-to-many-to-many relationship

ios,objective-c,cocoa,core-data,nspredicate
I have a core data model like this: and I'm trying to query all the movies showing a theater with particular schedule. But I can not figure out how can I this query with NSPredicate. I tried this: NSPredicate *moviesPredicate = [NSPredicate predicateWithFormat:@"SUBQUERY (movies, $x, $x.movies.showTimes == %@ AND $x.movies.theater.nameOfTheater...

How can I rebase as one commit using Git

git,rebase,squash
My history looks somewhat like this but times 10: i - j - e'- k - h'- l - m feature-branch / a - b - c - d - e - f - g - h master (the apostrophes meaning cherry picks) I want to rebase to this: i...

calling multiple macros from another macro in C++

c++,macros
Hi i have a question about the use of macros in C++. If i have two macros defined and create a third one like this: #define MAC1(X) {something here} #define MAC2(X,Y) {something here} So now third one is defined like this: #define MAC3(X,Y) MAC1(X); MAC2(X,Y) Can you please clarify how...

Adding custom color using CSS in a string of text from data-tooltip?

html,css
I wish to change the color of certain words in the data-tooltip string. <a class="link1" href="somejavascriptignore" data-tooltip="Click this to refresh the page">Refresh page</a> The words i wish to color a different way is "refresh" how can i target those words without having to edit the source link? Is it possible...

Converting a File:///… string to an Absolute URI

java,android,uri,filepath,absolute-path
So I am making an app that lets users pick images from their gallery to display, as well as take photos from the camera. The image is previewed via a bitmap that takes the string of the file path. When the user takes a photo the code below handles it...

Combine two lists of dicts, adding the values together

python,list,dictionary
I want to combine two lists of multiple dicts into a new list of dicts, appending new dicts to the final list, and adding together the 'views' values if encountered. a = [{'title': 'Learning How to Program', 'views': 1,'url': '/4XvR', 'slug': 'learning-how-to-program'}, {'title': 'Mastering Programming', 'views': 3,'url': '/7XqR', 'slug': 'mastering-programming'}]...

Can't call a Web API from jQuery script

jquery,asp.net,vb.net,asp.net-web-api
I'm making a litle test for a Web Api project before developing a real App. I implemented some basic GET action without a problem, but I have some issues with the POST request. I'm calling the POST request with jQuery like this var data = { name: "Pedro" }; $.post({...

Filling div with partial view from ajax submit result

jquery,ajax,asp.net-mvc,form-submit,ajaxsubmit
What I want to do: submit a form via ajax and return a partial view into an existing div in the page (without navigating away from the current page) I learned that ajaxSubmit allows form submission without redirection to other pages. So, I have got a form: <form id="addForm" method="post"...

Delete everything to the right starting from a specific character

sql,oracle
Let's say my database has a couple of entries 2345 2532-1 2593-R2 2380 2013-E1 How do I trim everything to the right of the dash '-' including the dash itself while maintaining all the numbers prior?...

Give points to user just on first signup with Facebook in Rails 4

ruby-on-rails,ruby-on-rails-4,model-view-controller,devise,omniauth
I use Facebook-omniauth gem with devise to register users Here is what i have in my callback class CallbacksController < Devise::OmniauthCallbacksController def facebook @user = User.from_omniauth(request.env["omniauth.auth"]) if @user.persisted? flash[:notice] = I18n.t "devise.omniauth_callbacks.success", :kind => "Facebook" sign_in_and_redirect @user else session["devise.facebook_data"] = request.env["omniauth.auth"] redirect_to new_user_registration_url end end end I want to add...

How does one use a reserved character in an Angular predicate?

javascript,angularjs
I'm using some data from Google Analytics in my app, which uses colons in the hash keys. For example, var pages = [{ 'ga:sessions': 100, 'ga:adImpressions': 1000 }, ...]; But Angular runs into problems when I want to order by something with a colon. This: <div ng-repeat="page in pages |...

Jquery Validate default settings doesn't work

jquery,jquery-validate,jquery-chosen
Default settings don't work. The "setdefaults" command doesn't do anything. My page may have a lot of forms and things going on. But for whatever reason, it always ignores the display:none "select box" "select#ffe". FFE is a Chosen select box, so it hides the select box and thus the form...

JSON skip first and last line of file

php,json
How can I make json_decode to skip the first and last line of a json file to be valid json output? My file looks like this: while(true);/* 0; JSON CODE /* */ My php code looks like this: $json = file_get_contents('https://..../getLiveSchedule.json'); var_dump(json_decode($json, true));` ...

multiple markers with unique infowindows using google maps javscript api v3

javascript,ajax,google-maps,google-maps-api-3
I know this question is posted all over stack overflow. But I've been working at it for days, and none of the solutions have worked. I'll post everything I'm doing and maybe someone will see my mistake. I'd much rather leave comments on the other existing questions but there is...

Angular-material md-select cuts off background to edge of content?

javascript,css,angularjs,angular-material
I updated to angular-material 0.9 and now when I open md-select it cuts off the background to the edge of the content. Is there some way to avoid this? http://codepen.io/anon/pen/yNOypa <div class="background"> <div layout="column" layout-align="center center" flex> <md-select placeholder="Pick"> <md-option value="1">One</md-option> <md-option value="2">Two</md-option> </md-select> </div> <p>The background ends at the...

How to repurpose my directive here to work in 2 different scopes?

javascript,angularjs,angularjs-directive,angularjs-service
http://plnkr.co/edit/39FGMocKB5GtQWnI1TFw?p=preview I have sidebar which contains a list of tags, when you click on a tag I use the TagDetailsFactory to send a tag into the scope of the view controller. Everything works great except for when you hover over a tag in the TagDetailsFactory scope. The tagDetails template does...

Xaml - Binding in FallBackValue

c#,xaml,silverlight,binding,telerik
How can i make two bindings on a column in grid, in the way that if first binding is empty or null, second binding will be used. I have tried to do that with FallbackValue property but you can't make binding inside it only static values. Here some code, which...

How is the pricing setup for Azure DocumentDB?

azure,azure-documentdb
Recently, Azure DocumentDB came out of preview and is available in General. I wanted to know how the pricing is set if I have a DB with Two separate collections in it? Currently, the Pricing Calculator doesn't show Document DB in it. Say S1 pricing is $25/month and I have...

Initializing a certain struct field on-initialization in C

c,string,struct
What I would like to do here is initializing all the players' names with the empty string value "", I have heard it can be done at the declaration point in C99, but I'm not entirely sure how. typedef struct data_players { char name[25]; int hp; int mana; int id;...

Is it possible to disable oracle trigger on Oracle Unit Test startup

oracle,unit-testing,oracle-sqldeveloper
We have a table that has a trigger used to write the row to a different database, that we don't want to execute during out unit tests. Is there a way to disable and reenable the trigger during startup and tear down? In the start up I have tried BEGIN...

ons-tabbar hide with jQuery

onsen-ui
I'm using onsen with ons-tabbar and want to hide/show the tabs with jquery. I want to hide the tabs in login page and show after login. This is my code: <head> <meta charset="utf-8"> <script src="http://debug-software.intel.com/target/target-script-min.js#h2kN-2HmemNy-2C0zFMFsSdJyBtr__GRx6CB-TI6nsA"></script> <link rel="stylesheet" href="css/onsenui.css"> <link rel="stylesheet" href="css/onsen-css-components-blue-basic-theme.css"> <link rel="stylesheet" href="css/login.css"> <script...

awk: Preserve multiple field separators

bash,awk,separator
I'm using awk to swap fields in a filename using two different field separators. I want to know if it's possible to preserve both separators, '/' and '_', in the correct positions in the output. Example: I want to change this: /path/to/example_file_123.txt into this: /path/to/file_example_123.txt I've tried: awk -F "[/_]"...

Java looping through integer array

java,arrays
Consider the following Java code: int[] array = {1, 2, 3, 4, 5, 6}; for(int i : array) { System.out.print(i + " "); } The above code obviously prints the contents of the array. 1 2 3 4 5 My question is why doesn't Java allow this? int[] array =...

How do I set unique value for each button to identify them?

javascript
Javascript Code: function createdivs() { var i = 1; $.ajax({ url: 'displaycontent.php', data: {action:'test'}, type: 'post', datatype: 'json', success: function(output) { var a = JSON.parse(output); var b = a.length; var i; for (i = 0; i < b;i++){ console.log(a[i]['idi']); console.log(a[i]['pgmname']); console.log(a[i]['comp']); console.log(a[i]['datephp']); if (a[i]['idi'] != 0){ for (var j=0 ;j...

Cannot mutably borrow in a pattern guard [E0301]

rust
unsafe fn get_sync_handle(pid: u32) -> Option<HANDLE> { let raw_h = OpenProcess(SYNCHRONIZE, 0, pid as DWORD); match raw_h { x if x >= 0 as HANDLE => None, x => Some(x) } } src\lib.rs:411:19: 411:23 error: cannot mutably borrow in a pattern guard [E0301] src\lib.rs:411 x if x >= zero =>...

FFmpeg android execute

android,ffmpeg,execute
On windows I could cut a video with below code with ffmpeg.exe Can't use ffmpeg in android. I used gradle to grab ffmpeg in my app. dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.github.hiteshsondhi88.libffmpeg:FFmpegAndroid:0.2.5' } I have these lines in my method VideoIn = getInternalDirectoryPath() + "/Download/Ab.mp4"; VideoOut =...

How to handle 204 response from ajax request in jquery

javascript,jquery,ajax,http-status-codes,jqxhr
I'm trying to handle a Status: HTTP/1.1 204 No Content error. I'm using .fail() to handle all other errors, but 204 is not handled by this function. While trying if (jqXHR.status == "204") {alert("error!");}, the alert is not thrown when a 204 is received. $.ajax({ url: url, method: 'GET', headers:...

How do I add Facebook and Twitter share buttons to a group of existing articles in Joomla?

joomla,website
Am I going to have to do it individually or is there some way I can alter the template or wrapper or whatever to add buttons to all articles at once?

Path Finding Application Algorithm

algorithm,maps,dijkstra,shortest-path,backtracking
I am trying to develop an application that maps my office (exactly like application like google maps, showing path from one seat to another). From what I have read so far, algorithms like Dijkstra's, or Back Tracking can be used to solve the problem. But these algorithms require something of...

Delete-Upsert-Read Access Pattern in Cassandra

cassandra
I use Cassandra to store trading information. Based on the queries available, I design my CF as below: CREATE trades (trading_book text, trading_date timestamp, OTHER TRADING INFO ..., PRIMARY KEY (trading_book, trading_date)); I want to delete all the data on a given date in the following way: collect all the...

Fail to use let-destruct for tuple in Coq

coq
I'm a new user for Coq. I have defined some functions: Definition p (a : nat) := (a + 1, a + 2, a + 3). Definition q := let (s, r, t) := p 1 in s + r + t. Definition q' := match p 1 with |...

LiveValidation plugin - HTML in failureMessage

html5,livevalidation
I am using the LiveValidation plugin and was wondering of there is a way to add HTML in the span tags that show a valid or invalid message. I have the following: var validatedObj = new LiveValidation('momlastname', { validMessage: ""}); validatedObj.add(Validate.Presence,{ failureMessage: "You need a name in this <strong>field</strong>"}); But...

Setting a time out with an if else statement in javascript

javascript,angularjs,if-statement,timeout
I have a function that is run when you mouseover and mouseout of a div. When you mouseout I need the function to wait a second before running. Is there a way to set a timeout on an if else statement to make this work? HTML: <div ng-mouseover="menu()" ng-mouseout="menu()"><img src="images/headermenubutton.png"...

Pythagorean Theorem test not working?

c,loops,for-loop
So I'm trying to write a program that loops through every possible combination of side lengths for 3 sides of a triangle, and prints the ones that follow the Pythagorean Theorem (i.e., sideA(sqr) + sideB(sqr) = hypotenuse(sqr) ). The ones that match, it's supposed to print. However the math isn't...

Javascript getter - why does it get called at construction?

javascript,leaflet,ecmascript-5
I'm new to Javascript getters/setters, but thought to use them in my Leaflet- and browserify-based project. Got a surprise. The getter gets called at initialization, for some reason unknown to me, before the class's own initialize method (Leaflet construction callback) gets to run. This of course means members are undefined...

NoseTest: running with coverage from Python script

python,nosetests
I want to run NoseTest from a Python script. But I want not only run it, but also measure test coverage. Just now I have the following code: import os import sys import nose sys.path.append(os.path.dirname(os.path.abspath(os.path.dirname(__file__)))) import tests if __name__ == "__main__": config = nose.config.Config(verbosity=3, stopOnError=False, argv=["--with-coverage"]) result = nose.run(module=tests, config=config)...

Merge Query in DB2

sql,merge,sql-update,db2
I need to update few columns in one table with the very convoluted calculation. I'm not good enough in SQL so I tried to use "with" clause in combination with update, but It threw error. Then I found a post online which suggested to use MERGE so I came up...