FAQ Database Discussion Community


Cassandra Cluster in AWS Multi Region VPC

amazon-web-services,cassandra,cassandra-2.0,amazon-vpc
I am trying to achieve the following schema for my Cassandra Cluster : 1 VPC in 4 different AWS Regions linked together with IPSec instances. 1 Cassandra Cluster made of 4 nodes, 1 in each VPC Nodes communicating together with private IP in VPC (10.0.0.0/8) Cassandra data accessible through REST...

Structure Array arguments in C

c,arrays,pointers,structure
I'm pretty new to C and am taking a class right now and having difficulty with a project. We have a structure in this project called a Symbol. We also have a structure in this project called a Node. Nodes have an array of Symbols. All I'm trying to do...

Replace first element of a string in R based on a condition

r,string,substring
I want to replace the first element of the strings in x with blank if it satisfies the condition : If first element of "101" in x matches the first string in y, replace first element of "101" with blank. x = c("101", "201", "301") y = c("1", "7", "3")...

select the element not equal `#text`

javascript,jquery,dom,mustache
After use mustache render I try to get the dom just append, how do I select only li.data? or How to make mustache return appendedDom not include #text? .. var html = Mustache.to_html(this.template.data, response); var appendedDom = $(html).appendTo(this.el.container); console.log(appendedDom); >> console.log <li class=​"data">​…​</li>​ #text I tried $(appendedDom+'.data') this not work...

IIRF Allow Specific IP's in a blocked range

ip,range,blocked,iirf
I have a range of IP addresses that are blocked. But I have 3 ip addresses within this block that need to be allowed. Can anyone help with this? The Rewrite rule looks like this: RewriteCond %{HTTP_true_client_ip} 54\.(242|243|234|235|236|237|224|225|226|227|208|209|210|211|221|204|205|196|197|198|80|81|82|83|84|85|86|87|88|89|90|91|92)\.\d{1,3}\.\d{1,3} RewriteRule ^(.*)$ $1 [F] I want to allow these three [54.243.53.243, 54.243.53.248,...

Android AppCompat ToolBar color can't be changed to white

java,android,android-studio,toolbar,appcompat
I attempted the following: <style name="myAppTheme" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorPrimary">@color/primaryColor</item> <item name="colorPrimaryDark">@color/primaryColorDark</item> <item name="android:windowNoTitle">true</item> <item name="windowActionBar">false</item> <item name="drawerArrowStyle">@style/DrawerArrowStyle</item> <item name="actionBarStyle">@style/MyActionBar</item> </style> <style...

Connecting to a Django remote server host

python,django,django-rest-framework
I ssh-ed into a remote server and ran the command: python manage.py runserver 0.0.0.0:8000 The server starts up, development server running at http://0.0.0.0:8000/ Then in my localhost system, I go to the browser and go to http://127.0.0.1:8000/myapp/ I'm getting a Problem loading page/Unable to connect error message. What am I...

Generic organic stain/dirt shape

javascript,algorithm
I am a searching for a algorithm which in essence returns an array of points which define the shape of a stain formed by liquid. I need no directional influence, it could be a stain produced by a drop falling vertically down. I started to spread points from a center...

Two reports to be made into one

join
I'm a novice at Oracle and SQL Server but I had created two simple reports. One that gives the 'No. of Orders' per Customer that each Agent made and another report that gives the 'No. of Receipts' per customer that each Agent secured. This pic shows the 'No. of Orders'...

Elasticsearch - How to get min/max/avg of set of nested documents

elasticsearch
Given the following mapping and documents in Elasticsearch, how would I get the min/max/avg of a set of nested documents that match a certain condition? For instance, how would I get them min age of pet that are dogs? My filter gets the correct people that have dogs, but how...

Difference access between the server and my computer mac

osx,symfony-1.4,lamp,chmod
I retrieve a project in symfony 1.4 . The project is currently running on an Ubuntu server (LAMP). When I run the project on my Mac , the photos do not appear yet the path is good . I think it is a problem of access rule but i am...

How to get Famo.us draggable modifier's render node

draggable,famo.us
I am trying to get parent renderNode of a draggable modifier on 'end' event, is there any api to get a renderNode to which draggable belongs to? My code is as follows : /*globals define*/ define(function(require, exports, module) { var View = require('famous/core/View'); var Surface = require('famous/core/Surface'); var Transform =...

Social-buttons hover effect changing icon color

ruby-on-rails,twitter-bootstrap,font-awesome
I am using Social Buttons for Bootstrap (http://lipis.github.io/bootstrap-social/) to add icon links to facebook and twitter, but I'm having trouble getting them to behave like the examples on the above site. The buttons show up fine, but when you hover over them, the icon changes to a darker color. In...

Android dynamic gallery gridview from php

php,android,arrays,gridview,android-imageview
I have a working GalleryActivity with an ImageAdapter. It display on the screen a gridview (3 columns) loading image from a drawable array. public class GalleryActivity extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.grid_layout); GridView gridView = (GridView) findViewById(R.id.grid_view); // Instance of ImageAdapter Class gridView.setAdapter(new ImageAdapter(this)); gridView.setOnItemClickListener(new...

Creating and Populating JSON Object with jQuery via Loops

javascript,jquery
I am trying to create a JSON Object dynamically using some multiple .each() loops. I tried using .push() but I was only able to get the first "tier" of the JSON object (the first array) populated. The JS parses through an Excel Spreadsheet (2003/XML) file and needs to output this...

Custom UITableViewCell button title no longer visible after scrolling (reuse)

ios,uitableview,ios8,uibutton,storyboard
The storyboard's dynamic prototype custom cell contains a system UIButton. I set the button's title in cellForRowAtIndexPath: NSInteger votesCount = verse.helpfulVotesCount.integerValue; NSString *votes = [NSString stringWithFormat:@"​​%ld helpful vote%@", (unsigned long)votesCount, votesCount == 1 ? @"" : @"s"]; [cell.detailButton setTitle:votes forState:UIControlStateNormal]; Everything appears fine initially, until cells are scrolled off-screen. At...

complicated custom $.Event in modal.js

javascript,jquery
hey guys i was just going through the modal.js plugin and came across the following line : var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) now i guess the line is actually defining a custom event , i do understand custom event . to be honest , i understand in...

PostgreSQL - Returning the results of multiple arbitrary sub-queries

node.js,postgresql,postgresql-9.3,knex.js
Like the title of the question suggests, I'm attempting take a number of arbitrary sub-queries and combine them into a single, large query. Ideally, I'd like to the data to be returned as a single record, with each column being the result of one of the sub-queries. E.G. | sub-query...

Angular pass paramters in templateurl in stateprovider

angularjs,angular-ui-router
I am using a $stateprovider as follows from angular-ui-router in my angular application: .state('order', { url: "/order/:id", templateUrl: "/myapp/order" }) In the above scenario, we are passing an id to the controller and we can call it as ui-sref="order({id: 1234})". But now i want to make a direct call to...

convert List to zoo and use rollapply on the List

r,list,rollapply
I would like to convert a list object to zoo and then apply rollapply on the zoo object. Short example reproduced below (I have 90,000 such files to process, using UNIX:)). Assume my list has two dataframes. 1) I would like to convert the date in each of the dataframes...

OpenGL ES 2.0 Texture Won't Display

ios,objective-c,opengl-es,opengl-es-2.0
So I am currently learning OpenGL ES 2.0 with iOS and working on a maze game. The maze is randomly generated (so not a loaded model) and my struggle is texturing the walls and floor of the maze. My approach is to just treat the maze as a series of...

Loading Stages from external code

c++,inheritance,dll
I wrote a Pipe and Filter based architecture. To avoid confusion the Filter's are called "Stages" in my code. Here's the basic idea : I want other developers to have the possibility to implement their own Stage class and then I can add it into the list of Stages that...

JavaScript - find text in URL by position

javascript,jquery,indexof
This should be pretty easy but I'm struggling. I have a button that fires a function. I want an alert to fire as well that tells me which page the user was on. www.whatever.com/thispage1/whatever www.whatever.com/thispage2/whatever www.whatever.com/thispage3/whatever So after my button is clicked, I want an alert that reads back "thispage1"...

Do you have to re-register a ZMQ socket with the poller?

sockets,zeromq
I'm opening a ZMQ socket and registering it with a poller as follows: poll = zmq.Poller() socket = context.socket(zmq.DEALER) socket.setsockopt(zmq.IDENTITY, "identity") socket.connect(url) poll.register(socket, zmq.POLLIN) Now I'd like to close and re-connect the socket to the same url. What is the best way to do this given that it is registered...

Is there Django view decorator to check a condition that doesn't assume the input is a User?

python,django,python-decorators,django-permissions
I have a very simple Django decorator my_decorator1 that looks like this: def my_decorator_1(function): @wraps(function) def decorator(self, *args, **kwargs): self.my_val = random.randint(0,1) return function(self, *args, **kwargs) return decorator My Django APIView that looks like this: class MyApiView(views.APIView): @what_decorator_goes_here @my_decorator_1 def post(self, request, *args, **kwargs): """ Blah Blah Blah. The rest...

Sorting Parsed Data with jQuery

javascript,jquery,arrays,sorting,data
I am a noob. This is my first JS project. Please be gentle. I want to sort a list of clients (which is a list of keys from the variable “clients"), with a simple .sort(). I am unable to sort "clients", but I am able to sort "key_list" (they’re in...

Android - Back button doesn't call onResume()

android,back-button,android-theme,onresume,up-button
I'm a beginner at this, so bear with me. In my app, I want the theme of the app to update based upon user preference. I have a preferences page with a theme section, and here is the code for my MainActivity: @Override protected void onCreate(Bundle savedInstanceState) { SharedPreferences preferences...

Using VBA to manage multiple styles definitions in the same Word document

vba,ms-word,word-vba,office-2013
TL/DR: I have a game plan on how to do this below; however, I am wondering if my plan is going to prove to be too complicated, and what additional considerations I need to take into account before diving into building this project. Although I am not an experienced programmer,...

How to update the version of a Derby database

java,database,derby,javadb
When trying to create a table with a Boolean field, I've come across a Derby error that prompts me to update the database version from 10.3 to 10.7. I've found this question which apparently contains the solution: Tables for entities with boolean fields not created but I can't see the...

Curtain revealing view

ios,uiview,uiview-hierarchy,view-hierarchy
I am trying to achieve the following challenging effect: I want to move the white "curtain" down in order to reveal the red box. (Note: in the screenshots below the curtain is white and the background is grey) The problem is in the view hierarchy. In order for the box...

SQL SELECT Function In Wordpress Not Working

php,mysql,database,wordpress,select
I'm working on a basic selection function that grabs the row with the lowest id. Then just to make sure it works I have it dump the array, but something is wrong and it keeps returning null. I'm not sure where I went wrong. function select_min_id(){ global $wpdb; $table =...

Laravel Eloquent update just if changes have been made

php,laravel,eloquent
Is there any wat to update a record in laravel using eloquent models just if a change has been made to that record? I don't want the user requesting the database for no good reason over and over just hitting the button to save changes. I have a javascript function...

Enabling logging for Spring Social

java,spring,log4j,spring-social,spring-social-facebook
I have a Spring MVC application which uses Spring Social Facebook to enable Facebook login. This is working fine on my local machine, but it currently doesn't work in my staging environment. My problem is that I cannot figure out what goes wrong. When I try to login, I am...

Simple HTTP Post returning empty Request.Form

asp.net,http-post
I am trying a simply HTTP post to post data from one form to another in asp.net. sender page code <form id="form1" runat="server" method="post" action="CILandingPage.aspx"> <asp:TextBox name="txtUname" runat="server" Width="180px"></asp:TextBox> <asp:TextBox name="txtPassword" runat="server" TextMode="Password" Width="180px"></asp:TextBox> <asp:TextBox name="txtTransaction" runat="server" Width="180px"></asp:TextBox> and the receiver page has code lblUserName.Text =...

How to check whether a timestamp is 10 minutes old?

java,timestamp,milliseconds
I have a timestamp (searchTimestamp) which I need to check whether it is less than 10 minutes old or not. long currentTimestamp = System.currentTimeMillis(); long searchTimestamp = getTheTimestampFromURL();// this also gives me back timestamp in 13 digit (1425506040493) long difference = Math.abs(currentTimestamp - searchTimestamp); System.out.println(difference); if (difference > 10 *...

Do variables declared in constructors persist in the created object

java,variables,constructor,scope
If I want to declare a temp int within the constructor of an object, will that variable stay in memory after the construction is finished. Or will garbage collection remove it after its finished?

Coldfusion post form to cfc asynchronously

javascript,jquery,forms,coldfusion
First of all, let me start off by saying the product I am developing will be used by people that don't inherently have access to HTML5. Some of the individuals will still be using IE8. I have a form like the following: <form action="ee.cfc?method=xlsupload" enctype="multipart/form-data" method="post" <input type="file" id="xlsfile" name="xlsfile"...

Making simple game of Battleship

python
I am trying to implement a simple Battleship game. It is a one player game versus the computer. So far I am only able to input the positions of my ship without my program breaking lol. I am trying to generate random coordinates for the computer, but I can not...

Inherit product save method

openerp,odoo,odoo-8
I would like to run a script when a product is saved (added or updated). Following the advice of the answer to this thread, I created and installed a module and tried to override the save method of product.product, like so: # -*- coding: utf-8 -*- from openerp.osv import osv...

Output to textbox and improving the code

c#,winforms
So I'm learning C# and just hit the Forms section and it's not going aswell as I hoped and Im feeling as my code isn't properly written. Im also having problems figuring out how to output my calculated varible Im writting in with a button press. What im asking for...

C library freeing a pointer coming from Rust

rust,ffi
I want to do Rust bindings to a C library which requires a callback, and this callback must return a C-style char* pointer to the C library which will then free it. The callback must be in some sense exposed to the user of my library (probably using closures), and...

Not able to deserialize json data into structs

json,struct,go,deserialization
I'm a newbie to go and trying to write a simple app to pull some school data from greatschools.org. The json data looks like this: { "schools": { "school": [ { "gsId": 1, "name": "Catholic School", "type": "private", "gradeRange": "PK-9", "enrollment": 39, "parentRating": 4, "city": "Denver", "state": "CO", "address": "111...

Buffer of function pointers?

c,function,pointers,c89
I know it may sound sci-fi but I truly want to call a function x times, by using an array of function pointers to it and without involving a loop or anything that may slow down the target program. Is that possible and if yes, how exactly?

How to center rectangles on position in D3.js?

javascript,html,css,d3.js
I have a graph where I have both circles and rectangles along the ticks of my x-axis. I'd like to be able to center all elements on the ticks of the x-axis. Circles are automatically placed in the center and scaled with a radius attribute, but with rectangles, I am...

I want my JavaScript on my php/html website to update live and instantaneously

javascript,php,html,live,instant
This might sound a bit dumb, but how did they get the slider : http://demosthenes.info/blog/757/Playing-With-The-HTML5-range-Slider-Input#volume That number (%) updates instantaneously to the movement of your mouse when you slide the dot. I was wondering for my own 'learning purposes' how that is possible since with the same code that they...

Solr EdgeNGramFilterFactory and minGramSize

solr
Is there a way to use EdgeNGramFilterFactory and keep searching exact terms? I want keep minGramSize = 4, but if I search for "pad", I want get results of "mouse pad", because is a exact term inside the phrase. <fieldType name="ngran_text_general" class="solr.TextField" positionIncrementGap="100"> <analyzer type="index"> <tokenizer class="solr.StandardTokenizerFactory"/> <filter class="solr.EdgeNGramFilterFactory" minGramSize="4"...

fetch_array() - cannot add multiple array fields to new array

php,arrays,json,mysqli,fetch
I am trying to return a json from a MySQL query to use it with xCode but I cannot get an array of several objects with multiple fields. I have read the documentation on php.net and over here, but I still can't get it. 1) Let's say I have a...

Edit a credit card using Stripe checkout.js

stripe-payments
Checkout from Stripe has a great way to add a credit card for a transaction, by simply invoking StripeCheckout.open(). Is it possible to use .open() to edit a card? (passing in the card token) Also, where can I download a non-minified version of checkout.js to see the .open() method signature?...

How to select one row from similar records in sql server?

sql-server
I have a table which contains data like this, GroupName group_code company_name Company Jan Feb USA G142 3M Corp 3MCorp 117 35 USA G23581 3M Corp 3MCorp 117 35 USA G899 3M Corp 3MCorp 117 35 USA G2165 MNA Inc. MNA Inc. 5 3 USA G6245 MNA Inc. MNA Inc....

Retrieving Timed Metadata on Chromecast

chromecast,google-cast,id3,hls
We are developing a custom receiver for HLS video playback on Chromecast. Our stream has Timed ID3 Metadata embedded in the MPEG-2 Transport Stream (TS files). I need the exact position in the stream that these ID3 tags are located for our app to function properly. In my Custom Receiver,...

Call function through pointer to class member

c++,member-pointers
In following code: class foo { public: void foo_function() {}; }; class bar { public: foo foo_member; void bar_function(foo bar::*p_foo) { // what is the corrct sintax for following: this->*p_foo->foo_function(); // expression must have a pointer type?? } }; int main() { foo foo_obj; bar bar_obj; typedef foo bar::*p_foo; p_foo...

Parallel Computation Overhead

java,multithreading,compiler-construction,parallel-processing
I am using the following code as part of a CompilerPhase class. The method gets called (and benchmarked) by the main method of the compiler. ParallelCompilerPhase: private Consumer<ICompilationUnit> apply; // ... @Override public void apply(Collection<ICompilationUnit> units) { this.count = units.size(); for (ICompilationUnit unit : units) { new Thread() { @Override...

Does VS Online support building ASP.NET 5?

visual-studio-online,asp.net-5
I set up a build definition in VS Online for an ASP.NET 5 project and tried to get it automatically built and deployed to an Azure Website. But I'm seeing a build failure thrown by MSBuild as below. C:\a\src\src\WebApp1\WebApp1.kproj(7,3): error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v12.0\AspNet\Microsoft.Web.AspNet.Props" was not found....

Android error on interstitial loadAd

android,admob,interstitial
I am trying to implement support for Interstitial Ads in my android app, which I'm hoping to publish soon. I am encountering two problems for which I'm hoping someone might have some insight. I have followed the most current instructions I could find from Google. Firstly, I was wondering if...

jquery html() write function to include semantic HTML elements?

javascript,jquery,html
This is my first post and I'm a student with basically very little knowledge, so please be patient with me. I am trying to use the jquery html() writing capabilities to insert semantic elements into my html page. basically I placed empty html elements: <header></header> <footer></footer> Then I wrote a...

Get StringLength attribute from CodeProperty?

t4
I have created a set of T4 templates to generate the unit classes for a DAL. An issue I have is with providing a string of the correct length based on "StringLength" attribute on the properties of the entities. I tried accessing CodeProperty.Attributes, but it says there are zero attributes...

Paralell branches/clones in Mercurial?

mercurial,bitbucket
This question is not only technical. I want to get into the concept itself, too. There is a foreign project on BitBucket (e.g. ObjectListView). And I need to work on two problems at the same time. In git I would just create to branches in my local repository after clonening....

How to cause/stop Android ndk-build to display build steps

logging,android-ndk,ndk-build,verbose
I am using the Android NDK to build a project. This morning the output of ndk-build started displaying tons of output as if I had set a flag somewhere to debug the make process. Below is part of the log, showing where this output starts. The lines I want to...

ng-show doesnt hide my element when value is set to false

javascript,angularjs,scope,ng-show
I am working on a web page that shows a certain piece of text and then hides it. The show part is working, the hide part is not: HTML <div ng-show="uploadComplete" class="col-sm-2 control-label">Upload Complete</div> Javascript $http.post('/rest/upload-data', {msg:'hello word!'}). success(function(data, status, headers, config) { console.log(data + " " + status) $scope.uploadInProgress...

How dynamically add new input element if all others was filled in AngularJS

javascript,angularjs,angularjs-directive,angularjs-scope,angular-ngmodel
please watch this Plunker So I working with angular and need to add new input field when all others are filled in (by default on page placed 5 inputs and if all of them are filled automatically add one more input if new input also using will add one more...

Displaying wrong character in C

c
I'm testing deciphering strings using a key in standard C. I'm inputting a string, inputting my replacements and constructing a cipher based on the history of my replacements. For example, if I replace c with h in a string, I will store it in the string cipher as "ch ",...

How to change horizontal input to vertical output

unix,grep,cut
I am using UNIX Korn shell. I am trying to create a program in Unix that will search a text file which is shown below: Last Name:First Name:City:State:Class:Semester Enrolled:Year First Enrolled Gilman:Randy:Manhattan:KS:Junior:Spring:2010 Denton:Jacob:Rochester:NY:Senoir:Fall:2009 Goodman:Joshua:Warren:MI:Freshman:Summer:2014 Davidson:Blair:Snohomish:WA:Sophmore:Fall:2013 Anderson:Neo:Seattle:WA:Senoir:Spring:2008 Beckman:John:Ft. Polk:LA:Freshman:Spring:2014 Then take that line and cut it out and display it vertically....

How to get the Stanford parser output as a list of nodes and edges?

java,graph,nodes,stanford-nlp,edges
I'm processing a batch of text files, and I need to use the Stanford parser's output as a numeric list of nodes and edges where Nodes have IDs and labels, edges consist of two node ids and an edge weight like: Node List: 1  A , 2  B... Edge list: 1 2 10,...

What is setTranslatesAutoresizingMaskIntoConstraints:NO for?

ios,objective-c
In some project that I try to understand there is some code: [[[self foregroundContentView] contentView] addSubview:[self hueLabel]]; [[[self foregroundContentView] contentView] addSubview:[self hueSlider]]; [[[self foregroundContentView] contentView] addSubview:[self saturationLabel]]; [[[self foregroundContentView] contentView] addSubview:[self saturationSlider]]; [[[self foregroundContentView] contentView] addSubview:[self brightnessLabel]]; [[[self foregroundContentView] contentView] addSubview:[self brightnessSlider]]; [[[self...

Joining two database sets with different datatypes

join,sas
Trying to join two datasets, but the join is based on two different data types (numeric and text) SELECT * FROM D1.T1 c INNER JOIN D1.T2 d on c.CNUMBER=INPUT(d.CNUMBER, 8.) ; This is does not work. I can create a new dataset (copy existing one and add a numerical column)...

jquery remove() not removing the div

jquery,jquery-ui
I have jquery tab and when I click the little x to close it calls my delegate and the tab part is removed but the tab content isn't. In dev tools I still see it in the dom. I don't seem to be getting any errors either. Just wondering if...

beforeSave causes Queries to return nothing

javascript,parse.com,promise,cloud-code
I have a cloud function that takes in a request and creates objects as well as associates them in a chain of promises. Without a beforeSave this function works fine but the beforeSave exists to prevent duplicate entries of email addresses in the Email Class. REQUEST { "projectDescription": "Testing saveProject",...

Large Data Set | Can't Create Foreign Key

mysql
I have two tables with millions of rows (20+ GB) in a MySQL database. Adding a foreign key through phpMyAdmin times out after 16 hours (current default). The server environment is as follows: OS: Windows 2008 R2 Server Stack: WAMP CPU: Xeon X3464 RAM: 8Gb (Virtualized) Is this server setup/MySQL...

How to return all data from one column Android SQL

android,sqlite
I have an SQLite Database in my application. It has three columns. being _id, TEXT, and Location. If I want to return all the data from, say, the TEXT column should I use cursor.getColumnIndex(2)? I am obviously new to SQLite. And and all help is appreciated. Thanks everyone!

WKInterfaceTable scrollbar height

objective-c,watchkit,wkinterfacetable
How can I change the height of a WKInterfaceTable scrollbar? By default scrollbar height is equal to 1 row‘s height. What I am missing? ...

What is the syntax for querying in Python?

python,sqlite3,python-2.6
I sort of understand how this works, but I get lost after the WHERE. Please tell me what is wrong with the following and help me understand what it's doing in general: myVariable = cursor.execute("SELECT TARGET_.*, TARGET_, SOFTWARE_TARGET_ WHERE" "SOFTWARE_TARGET_.SOFTWARE1=%(sw_ID)s AND" "SOFTWARE_TARGET_.TARGET2=TARGET_.ID", sw_ID=sw_ID)) I keep getting the following error: OperationalError:...

Microsoft Access field formatting - adding unit type

forms,ms-access,format
I'm trying to display the unit type to some numeric fields in an access database. So for instance a value of '15' in FieldA will display as '15 inch', and '26' in FieldB will be '26 mm'. Is this possible with field formatting?...

Not a debuggee or not listening for a debugger to attach

java,debugging,netbeans,debian
I want to attach a debugger to a github project called Mamute. run.sh wires up the application. cat run.shreads: #!/bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" MAMUTE_DIR=$SCRIPT_DIR TIMESTAMP=BUILD_TIMESTAMP WEB_INF=${SCRIPT_DIR}/WEB-INF java -cp ${WEB_INF}/classes/:${WEB_INF}/lib/* \ -Ddeploy.timestamp=$TIMESTAMP \ -Dvraptor.webappdir=${MAMUTE_DIR} \ ${MAMUTE_OPTS} \ br.com.caelum.vraptor.server.Main \ not-grunt I don't know what "java...

R: How to compute the mean by ID in a given data frame?

r,apply
I have the following data: ID Value 1 3 1 5 How can I compute the mean by ID, and put the mean in the data frame as a new variable such that it is repeated for the same ID. The result should look like this: ID Value Mean 1...

Case statement in sqlserver in where clause with else as always true

mysql,sql,sql-server,tsql,case
I have used the always true statement e.g. 1 = 1 in case statement of where clause in MYSQL with following syntax: select * from tablename where (case when tablefield is not null then then tablefield = 'value' else 1 = 1 end) I want to know how can i...

Web API security with Thinktecture for clients accessing through backend services

thinktecture
How do I implement security for my web api that are being accessed by backend processes(windows services or local clients) using the thinktecture architecture. What would be the flow for my authentication? ...

WordPress - Display children category on page

wordpress,parent,children
I have a category list from A - Z. These categories are displayed on a page. When someone clicks on ex: "A": i want them to see all the children categories which are in "A". Is there a method of showing all these children categories? Because at the moment it...

Reverse int overflow

java,integer,int,overflow,reverse
int num = -340721550; int multi = -214882771; int result = num * multi; // = 10 If I know multi and result, how can I go backwards to num without brute forcing it? Or improve the speed of my brute forcing method public static int multiInverse(int multi, int result){...

“==” not doing what i think it should do in Python [duplicate]

python,comparison
This question already has an answer here: python lxml tree, line[] creating multiple lines, desire single line output 1 answer In a script im working on I do the following: data["serial"] = md5.new(json.dumps(data["data"])).hexdigest() ... ... lst = serialFile.readlines() if(len(lst) > 0): lastLine = lst[len(lst) - 1] ... ... print...

JDK 7 doesn't want to upgrade

java
I downloaded and installed perfectly the new JDK release (http://www.oracle.com/technetwork/java/javase/downloads/index.html), but whenever I am about to start a new project in NetBeans, the program only offers the "JDK 1.7" version, so I am not sure if it has been upgraded correctly or not.

Github - import an unversioned project from local filesystem

git
I have a folder in my local filesystem called "projecteuler". I would like to import the source files in this folder into a remote Github repository. How can I do this? My local folder "projecteuler" is not on any kind of version control system.

Node.js and Angular routing - How to make REST API inaccessible by browser URL

angularjs,node.js,rest,angular-ui-router
I use Angulars $http service to call for data on the backend. Let's say JSON data. An example URL to do so would be something like: /get/data Doing this from within Angular nicely returns the requested data. No problem. But even though I catch all other Angular routes using Angular...

HttpCookie gets deleted for unknown reason [duplicate]

c#,asp.net,cookies,httpcookie
This question already has an answer here: cookie values disappear when traversing between content pages 2 answers Alright, so. For some reason, this cookie is getting deleted/overwritten. It does exists for awhile. well, for one cycle of Code 2, but when code 2 is called again VIA a page...

Object reference not set to an instance of an object when calling foreach loop when calling it in the cshtml

c#,table,model-view-controller,foreach,tabular
So I am very new to MVC and development. What I am trying to do is basically create a single row table view of an user so that I can edit and update on that single row. (I hope I am making sense) So I am using MVC Razor View...

How to write a while() loop in Gforth

forth,gforth
I'd like to write a while() loop in Gforth. Unfortunately, the only tutorial online isn't useful due to a lack of examples, and examples on counted loops (what I'm not looking for) appear fundamentally different. What are some concrete examples of how to represent something like this? while (x >...

How to KEEP only the last line of consecutive lines starting with the same word?

bash,perl,awk,sed
See this thread : How to remove the second line of consecutive lines starting with the same word? Instead of keeping the first duplicate consecutive line starting with "TITLE", I would like to only keep the last one, to get from this input: TITLE something DATA some data TITLE something...

JScript Regex XML attribute using Sub-Match?

regex,xml,attributes,jscript
I have the following text I'm searching: <add key="Directory" value="" /> And this is my regex: add key=\x22Directory\x22 value=\x22([^\x22]*)\x22 My desired output is: <add key="Directory" value="blue" /> But, with what I have, it seems to be selecting the whole tag and producing: <blue /> But, according to regex101, it shouldn't...

How to query current row's DB name in SQL server?

sql-server,tsql
TableA exists in all 4 DBs, run this, Use DB1 go select CurrentDB=DB_NAME(), * From DB1..TableA union all select CurrentDB=DB_NAME(), * From DB2..TableA union all select CurrentDB=DB_NAME(), * From DB3..TableA union all select CurrentDB=DB_NAME(), * From DB4..TableA always got CurrentDB ='DB1'. is there a Simple way to get DB2,3,4 when...

How can I calculate the thickness of a set of strokes in an image?

image,matlab,image-processing
How can I calculate the thickness of each stroke in the attached image? I did a segmentation for all the nerves in the image and I labelled each object in the image. What I want is to know how to calculate the thickness of each nerve? Also, how can I...

Clickable text label inside an input [closed]

javascript,css,html5
As this picture shows, any easy way to create a clickable label inside an input ...

How can I get info on run time errors for Python modules built with f2py

python,numpy,fortran,f2py
Edit 3/6: Sorry, this was a false alarm. It seems to be working now. I believe the -g flag on gfortran and --debug-capi are sufficient after all to generate line numbers for GDB (gnu debugger). I will make a short answer summarizing how to do this in case it is...

solve sympy equation results in an error on numpy array dimensions

arrays,numpy,sympy
I'm currently trying to solve a system of equations using sympy (following this lecture on scientific python) and I'm getting the following error: Traceback (most recent call last): File "VMT.py", line 13, in <module> [Vmc, Vgp, tmc, tgp]) File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 311, in solve _assertRank2(a, b) File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/numpy/linalg/linalg.py", line 155,...

Absolute positioning bug in Internet Explorer 11

css,internet-explorer,internet-explorer-11
I am having a problem with absolute positioning in IE 11. All other browsers don't have this issue (tested in Firefox, Chrome, Opera, Safari). I am having relatively positioned element #obrazek (marked as green) which contains relatively positioned element #hrob (marked as red). In all other browsers #hrob is properely...

What is invoking the super class constructor here?

java,inheritance,constructor,superclass,super
I came across this code while looking for exam prep questions. I don't understand what is invoking the superclass constructor in this code? The output is ---> feline cougar cc THL public class Feline{ public String type = "f "; public Feline(){ System.out.print("feline "); } } - public class Cougar...

How to pass an array from AngularJS up python and store?

python,arrays,json,angularjs,cherrypy
I need to pass from AngularJS to python a JSON object. JSON structure would be: { "name": "Bob", "address": "Springfield", "cars": [ { "model": "Renault C15", "year": "1965" }, ... { "model": "Ford Ka", "year": "1998" } ] } This is a fragment of my AngularJS controller. All parameters are...

Bound component value isnt updating

ember.js
I have this component: App.AppTestComponent = Ember.Component.extend({ tagName: 'input', type: 'text', value: undefined, attributeBindings: ['type', 'value'], valueObserver: function() { console.log('This code is never triggered'); }.observes('value') }); I bind the value attribute using the attributeBinding, but when I change the textbox value, the value property isnt updating, and the valueObserver isnt...

How to avoid WPF Application not Responding when logging off

c#,wpf,windows-7,.net-4.0
When trying to press the standard Windows 7 logoff button while my WPF app is running, I get "This program is preventing Windows from logging off". I would like to force it to close without having to press "Force log off". Similarly, pressing "End Task" in the (applications) Task Manager...

Calling the Data-Attribute of a Image

javascript,jquery,html
I have a list of images in divs that i'm trying to call by their data attribute. What I want to do is find out if the img tag has a data attribute called "data-source", for now an alert is called. else run the rest of my code. HTML: <div...

How to change filenames when merging pull requests

git,merge
I have to merge two pull requests A and B. Both requests have paths with the same name but completely different content. I can't make them change their pull requests. One way I think this can be done is merge pr A normally and then fetch B on a new...

How do you access object properties from a nested polymer element?

javascript,polymer,shadow-dom
I would like to access javascript object data from a custom polymer element nested inside a list. The host page has the following: <core-list id="eventData"> <template> <event-card event="{{model}}"></event-card> </template> </core-list> With the following script: <script type="text/javascript"> var data = [ // server side code to populate the data objects here...