FAQ Database Discussion Community


How can I make a “pretty” table overflow with plain HTML/CSS

html,css
I have two rows of words in a div (basic text output, no tables etc yet), e.g. a b c d e f g h i 1 2 3 4 5 6 7 8 9 Now those lists can be very long and the format breaks easily on small monitors....

Using validate_presence_of with strict validations

ruby-on-rails,ruby,rspec,shoulda
I’m using the Shoulda gem. I’m using the validate_presence_of method. It is working nicely. It doesn’t seem to work, however, when using a strict validation. Example: class Thing < ActiveRecord::Base validates :status, presence: true # works validates :status, presence: true, strict: true # does not work end describe Thing do...

Deleting multiple rows from 1 to p

excel,vba,excel-vba
I'm trying to delete multiple rows from 2 to p. normally, if you want to delete rows from 2 to 1234 you do this: Rows("2:1234").EntireRow.Delete So I thought I should try that: dim p as long, p = (Range("N2").Value) Rows("2:p").EntireRow.Delete But I've got an error. (type mismatch) Anyone has an...

Replace list of emojies in JavaScript

javascript,jquery,regex,replace
I have a list of emojies like: var emojies = ["smile", "smiley", "grin", "joy"]; And I want to detect and replace the :emoji_name: by <span class='emoji emoji_name'></span> with a function, for example, if text is: Hi guys! :smile:, replace the :smile: by <span class='emoji smile'></span> and i guess regex solve...

Styled Link Not Centred

html,css
I've styled this link using font awesome to create a down arrow to reveal/hide the login options. However, it's no-longer centre. How can I make it centre? I will also be making it change to an up arrow when down, to be done with javascript, if it's font awesome creating...

How to add numbers to grouped columns that might repeat, in chronological order

sql,sql-server
Query: DECLARE @EmploymentLength TABLE ( EmployeeID INT, Date DATE, DateFlag CHAR(1), RowNumber INT ); INSERT INTO @EmploymentLength ( EmployeeID, Date, DateFlag ) SELECT z.EmployeeID, z.Date, z.DateFlag FROM (SELECT EmployeeId, HireDate AS Date, 'H' AS DateFlag FROM dbo.Employment WHERE EmployeeId = 328195 AND HireDate IS NOT NULL UNION SELECT EmployeeId, TerminationDate...

Why are my sections are overlapping, no bg-color? CSS [closed]

html,css
Here is my code. http://codepen.io/anon/pen/MwoLdR The text of my sections are overlapping, and the background-color: #xxxxxx; of every section is not showing up. This may be a position issue, but when I change position: relative; to absolute, the text aligns to the left even though it is set as center....

Python testing ncurses

python,ncurses
I'm developing terminal app. And I'm wondering how can one test the terminal user interface made with ncurses. Does any one have some experience with this kind of testing? So far my best shot will be to test app with capturing stdout and compare it with what it should be....

Database Multiple select Query , Unable to Retrieve Desired Data

sql,sql-server,database,select,join
I have three Tables as given below , I want to search record on base of three Different cafeterias in Single query,I want to search record whether user give Brand_Name , Drug_Id, Generic Name It give same output I.E. all record of That Drug_ID ,I am new to Database, however...

Does PostgreSQL quickly search for columns with arrays of strings?

arrays,database,performance,postgresql,indexing
According to Can PostgreSQL index array columns?, PostgreSQL can index array columns. Can it do searches on an array column as efficiently as it does for non array types? For example, suppose you have a row from a questions table (like SO): title: ... content:... tags: [ 'postgresql', 'indexing', 'arrays'...

How to filter by field of field (multi level relationship) in django admin?

python,django,django-models,django-admin
With models design like this: class School(models.Model): name = models.CharField(max_length=50) class Grade(models.Model): name = models.CharField(max_length=10) school = models.ForeignKey(School) class Student(models.Model): name = models.CharField(max_length=100) grade = models.ForeignKey(Grade) Since Student object doens't have direct relation with School object, How can I filter django-admin to only display students from selected school?...

Writing the most basic Unit test in Angular 2?

javascript,unit-testing,karma-runner,ecmascript-6,angular2
Problem: As soon as I import Angular 2 into a file none of my tests execute. Question: How can I set up my karma config to support angular two so my test pass properly? OR Question: How can I set up any testing framework with angular2 written in es6? Git...

Do I need a queue for a socket pair pattern?

python,sockets,tornado
I'm writing a Tornado server that allows for communication between sockets in a kind of pairing pattern. This looks something like def write_to_paired(self, message): if (paired == online): paired.write_message(message) class typeASocket: def on_message(message): write_to_paired(message) class typeBSocket: def on_message(message): write_to_paired(message) These connections will only ever be 1:1. Do I need a...

What $('.element'); returns?

javascript,jquery,jquery-ui
Some sources say: var objectA = jQuery('.someClass'); // returns new instance of jQuery object. Some say: var objectA = jQuery('.someClass'); // returns an array of elements with class='someClass'. If the above statement returns a jQuery object, then how objectA is behaving as an array? Thanks....

For-Each Loop Alternative - Clarification

java,loops,foreach,iterator
I am working through lessons in Java, and have not been able to completely understand what is going on in the following lesson. Purpose: The purpose of this lesson is to explain how a for-each loop works by creating an alternative that simulates how the for-each loop would work. In...

WCF Service - Failed to Invoke service - JSON

c#,json,wcf
Failed to invoke the service. Possible causes: The service is offline or inaccessible; the client-side configuration does not match the proxy; the existing proxy is invalid. Refer to the stack trace for more detail. You can try to recover by starting a new proxy, restoring to default configuration, or...

What is difference between versions of eclipse like juno, kepler etc.? Which version to choose for web development?

eclipse,eclipse-plugin,web-deployment
Eclipse has so many versions like Juno, Indigo, Galileo, etc. Are they just versions or they are specific for what we are developing? If they are specific which one to choose for web development? Currently I have Juno which I am using for android development, is it possible to use...

ExtJS Remove item of a store

javascript,extjs,extjs5
In a extjs app I have a tree panel that reads an json file, in the tree panel i have a check box that execute an action, additionally I save the checked element in a grid panel of a tab panel... I want to remove any element of the store...

Keeping a div the same size no matter the screen resolution

css,html5
Simple question, probably really obvious but, I made a circular div that will be a floating action button. I want it to be the same size no matter the screen size or resolution. For example, if it's a half inch wide on a smartphone I want it to also be...

Increment number in string C++ [duplicate]

c++,string,int,increment
This question already has an answer here: Converting an int to std::string 7 answers I'm trying to increment the name of the file based on the number associated with the filename. If I make the variable postFix an int type, it gives an error (understandably) since I can't concatenate...

Using UIProgressBar to show percentage?

cocoa-touch,uiprogressview
I was hoping there was a way to utilise the UIProgressBar by having it show the percentage or something instead of it animating/loading. For example, if in a game you have collected 25/100 coins, the progress bar would be lit 25% of the way... I haven't been able to find...

Qualtric REST API

javascript,ajax,qualtrics
I am new to web development, currently building an html web app, where I need to get data from a Qualtric survey and use it to modify my web app. I looked into Qualtric REST API here:https://survey.qualtrics.com/WRAPI/ControlPanel/docs.php#overview_2.4 and tried to follow it. I added these lines to my javascript and...

SQL Query: How to show the opposite result of your query in select statement

sql
Im a lil bit stuck here, really hope somebody could help me out. I couldn't found yet the answer from google. Ok let say the data is like below: TableName=> Events | Node_Name| Status | +----------+-----------+ | Node_1 | Completed | | Node_1 | Completed | | Node_2 | Failed...

Track information of current song in Universal App

c#,xaml,win-universal-app,universal,windows-media-player
I'm trying to get the track info (song, album, artist name) of the currently played media in an Windows Universal App. The information can be updated by using the SystemMediaTransportControls. Is it possible to read the information of a song played by another app (like XBox Music)?...

AngularJS Custom Google Maps directive with error: 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.`

angularjs,google-maps
I would like to create a simple directive in AngularJS that displays a Google Maps according to a location. I´m getting this error: Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. I have created next plunker to reproduce the problem: http://plnkr.co/edit/Fnmanw1sjblKTJNmYGaV?p=preview...

Saving dictionary of numpy arrays

python,numpy
So I have a DB with a couple of years worth of site data. I am now attempting to use that data for analytics - plotting and sorting of advertising costs by keyword, etc. One of the data grabs from the DB takes minutes to complete. While I could spend...

PHP Loop through results and output html table tr and td issue [closed]

php,mysql
Trying to generate html table columns and rows by looping through mysql results. Rows and cols defined within the variables $row_count and $col_count: $id = $_GET['id']; $sql = "SELECT * FROM $table WHERE id = {$id}"; $result = $db->query($sql); if($result->num_rows) { while($row = $result->fetch_object()) { $row_count = $row->rows; $col_count =...

.htaccess URL-Rewrite solution?

apache,.htaccess,mod-rewrite,url-rewriting,rewrite
I need to rewrite my url using .htaccess The url is http://www.domain.com/subfolder/search-brands/index.php/?q=Garment Bags&brand=traveler apos s choice And i want it to work like this http://www.domain.com/subfolder/search-brands/Garment Bags/traveler apos s choice Anyone can make it? Thanks a lot for your help!...

Load a site at the bottom of the page

javascript,html,css,wordpress
I am working on a build for a client of mine and they are wanting this page to load at the bottom of the site, and then the user scrolls up through the site. So basically, the site is built backwards. This site is built on WordPress and I am...

Android contact image placeholder in listview

android,file,uri,contacts,android-contacts
I have an activity with a listview and a custom adapter. Retrieving the contact information and the image is not the problem. I can not display an alternative image if there is not one for the contact. Checking if the URI is NULL does not work for me. I am...

Canvas image cropper - canvas.toDataURL is acting asynchronously does this return any kind of promise

javascript,html5-canvas
If I put an alert between 'toDataURL' and a canvas draw using the result then everything proceeds as expected. Does toDataURL fire an event on the canvas or should I use some kind of 'onLoad' for the image src I am setting it to? IE img.addEventListener('load',function(){...}...

Long string line breaking for unknown reason in PHP

php
I am generating an email and I noticed some of my inline CSS styling was not showing correctly. Upon further investigation, it appears as if my output is getting line breaks randomly throughout the string. Here is the portion of PHP where the line breaks are occurring <?php $message .=...

Asymptotic complexity for typical expressions

time-complexity,asymptotic-complexity
The increasing order of following functions shown in the picture below in terms of asymptotic complexity is: (A) f1(n); f4(n); f2(n); f3(n) (B) f1(n); f2(n); f3(n); f4(n); (C) f2(n); f1(n); f4(n); f3(n) (D) f1(n); f2(n); f4(n); f3(n) a)time complexity order for this easy question was given as--->(n^0.99)*(logn) < n ......how?...

How to add a class to an element that is outside of your onclick element

javascript,jquery,if-statement,onclick
I need some help with some If statement. I have this div <div id="features-dots"> <ul> <a href="#"><li class="one"></li></a> <a href="#"><li class="two"></li></a> <a href="#"><li class="three"></li></a> </ul> </div> and <div class="feature_thumb"> <a class="feature_thumb" id="one" onclick="return false;"></a> </div> <div class="feature_thumb"> <a class="feature_thumb" id="two" onclick="return...

Setting Firemonkey control font programmatically in C++

c++,firemonkey,c++builder-xe7
I have a custom Firemonkey control that extends TEdit which is dynamically created on a form. I am attempting to set it's font size when it is created using: Search->Font->Size = 15; However, the font remains unchanged on the control. I have another control of the same type that is...

Inconsistent use of tabs and spaces

python
I'm getting the error "inconsistent use of tabs and spaces in indentation" but as far as I can tell everything is as it should be. Specifically it refers to the for item in poly(1:): and it has an up carrot below the last colon. I'm using Notepad++ editor and Python...

Looping Arraylist of Arrays java

java,arrays,jsp,arraylist,javabeans
I have a method in the model that creates an ArrayList array me from a resultset, I need is cross it from jsp, I could not do, any help? This is the code of the arraylist public ArrayList listar(){ String sql="select * from eventos"; ArrayList lista=new ArrayList(); try { st=con.createStatement();...

Microsoft Graph API Accessing basic info of a user that is outside tenancy

oauth,ms-office,ews,multi-tenant,azure-active-directory
I am developing a multi-tenant web app managing the mail, contacts and calendar of users. On the AzureAd management portal, I registered my app as multi-tenant and I manage to get OAuth tokens for both people out and inside my tenancy, replacing the tennantId by "common" when querying the Authentication...

String Index Out Of Range (Python) I have made bounds too

python
import time password=input("What's your password?") ans = "" password=password.lower() alpha = "abcdefghijklmnopqrstuvwxyz" n = 0 a=0 starttime=time.time() while ans !=password: print(a) for i in range(len(password)): letter=alpha[n] ans+=letter if ans[a] != password[a]: print(ans) ans = ans.replace(ans[a],"") n+=1 break else: a+=1 print(ans) n=0 break print("Password Found!") endtime=time.time() time=endtime-starttime print("It took " +...

How can I add a transition effect when opening my custom modal window?

javascript,jquery,html,css
I'm trying to add a transition when my modal window appears, but I really don't know how to do with my own code. I don't want use a custom plugin. The effect that I want is on this page: http://tympanus.net/Development/ModalWindowEffects/ It's the "Slide in (bottom)". This is my HTML code:...

Not getting desired elements from XDocument

c#,linq-to-xml
I am doing a company name search from a website. The website returns the response as XML. I am trying to convert the XML to a custom List. I have converted the XML response into a XDocument but the node values that I am trying to get are not retrieved....

scoped_session object has no attribute 'create_all'

python,flask,sqlalchemy,flask-sqlalchemy
I have the following code that sets up my database with Flask-SQLAlchemy. I'm getting an exception "AttributeError: scoped_session object has no attribute 'create_all'". Can someone please explain to me why I'm getting the error and how I can fix it? :) __init__.py: from flask import Flask app = Flask(__name__) from...

Docker Compose with one Terminating Container

docker,exit,exit-code,docker-compose,fig
I'm having a docker compose setup of a database container, an application container and one container which pre-loads the database with necessary data. I want to start all of the containers together with docker-compose up while the pre-loading container terminates after it is one with exit 0. But terminating this...

Opencv mlp Same Data Different Results

c++,opencv,machine-learning,neural-network,weight
Let Me simplify this question. If I run opencv MLP train and classify consecutively on the same data, I get different results. Meaning, if I put training a new mlp on the same train data and classifying on the same test data in a for loop, each iteration will give...

No type was found that matches the controller name

asp.net,asp.net-web-api2
I've got the infamous Web Api No type was found that matches the controller name. I had this web service working until we did a little restructuring of the file system and classes and now I'm getting this error. The File system sits as default with the Controllers and Models...

Expanding the size of ListView cell on tap

xamarin,xamarin.forms
I'm trying to implement a solution to increase the size of a ListView Cell when tapped using Xamarin Forms (and custom renderers if required). I'm still pretty new to C#, and the idea of data binding is still a little unclear to me, however, it seems like that is the...

Autofilling a form with visitor's country using IP address

ruby-on-rails,ruby,geoip,freegeoip
This is the first time I'm doing this. I have a form for new users (Investor model) and I want it to be that once the form is loaded, based on the visitor's IP, the country field is already filled with the country. I heard of geoip gem. Don't know...

trying to get a running time stamp on Qt

c++,qt,while-loop
I am trying to keep a running time stamp every so many milliseconds. This will eventually be attached to a temperature reading. Right now the time stamp is only displaying after the rest of my program has run and I need it to populate in real time. My updated code...

Pass array on url using zend framework 2 routes

php,zend-framework,routes,zend-framework2
I have a web app that lets user make multiple searches and show the results of that searches all on the same page. Here's a basic structure: Search 1 - Attribute 1 = X - Attribute 3 = Y Search 2 -Attribute 2 = Z All these results are loaded...

SCAPY PYTHON - Get 802.11 DS Status

python-2.7,scapy,802.11
I'm trying to use SCAPY to create a sniffing program to demonstrate 802.11 device association[s] and roles within an 802.11 network. SCAPY has simple functions to identify Beacon frames, probe requests and probe responses. I'm trying to dig a bit deeper than that and do my own evaluation based upon...

How to retrieve authData from a ParseUser?

android,facebook,parse.com
I'm trying to retrieve the authData field from a ParseUser. With Parse 1.9.1, I used to do it like so: ParseUser user = ParseUser.getCurrentUser(); HashMap authDataMap = (HashMap)user.get("authData"); HashMap facebookMap = (HashMap)authDataMap.get("facebook"); String facebookId = (String)facebookMap.get("id"); And this worked fine. Something changed though. I don't know if it's because I...

Is there a way to determine the order of the self.collectionview.visiblecells?

ios
On a collection view, i would like to know the first item that's being displayed on the collection view. I figured i would look at visibleCells and would be the first item on the list, but it's not the case. Any help would be appreciated.

passing combobox values between forms

c#,winforms
Fairly simple problem i know its something simple i'm doing wrong but i need another set of eyes to help me out here. I have 2 forms/classes and i want to pass the combobox.selectedtext from form, to a string in form2. public partial class Form1 { public Form1() { InitializeComponent();...

How to apply a function to the elements of a pandas dataframe

pandas,lambda,dataframes
I want to apply a lambda function to the elements of a dataframe, in the same way as np.sqrt returns a dataframe with the sqrt of each element. However pd.DataFrame.apply apply the function to an row or an column. Is there a similar comand that apply a lambda function on...

GET document canceled upon first visit (Chrome)

javascript,jquery,google-chrome,debugging,developer-tools
This is a very strange issue with google chrome that some of my customers are reporting that is happening to them when they first visit my website. Bascially what happens is when they load Chrome for the first time, enter my website domain and press enter. It will load for...

Nested sql query error in java [closed]

java,mysql,postgresql
Statement stmt = conn.createStatement(); sql = "SELECT P1, P2 FROM " + "(SELECT (3959 * acos(cos(radians(T2.origin_lat)) * cos(radians( T1.origin_lat )) * cos(radians(T1.origin_lon) - radians(T2.origin_lon)) + sin(radians(T2.origin_lat)) * sin(radians(T1.origin_lat )))) " + "as dis," + "T1.id as P1,T2.id as P2 FROM public.dummy T1 CROSS JOIN public.dummy T2 " + "where...

User selecting item in map

c++,maps
I am currently writing a command line game program where I have stored the categories and solutions in a map<string, vector<string>>. The key value is the category and the vector is a vector of solution strings. I would like to prompt the user to select a category however I am...

Calling Up A Correct, Individual, Modal Menu from a Classic .ASP Repeat Region

javascript,jquery,asp-classic
I have a note section in my form that allows users with permissions to add information to a particular record. Part of this not section must allow users to delete their own notes or to edit their own. The issue I seem to be having is when I add a...

How to add plot labels of different axes to the same legend in Python?

python,matplotlib,plot,axes
I am trying to plot two curves on two y-axes as shown in figure. The red plot (pressure) the primary axis and green (needle lift) the secondary axis. And I am trying to add the plot labels to the same legend. But I cannot add them to the same legend....

How to set up default local push path in Mercurial?

mercurial
I am trying to set default local push path for Mercurial. I do not need a remote server, instead I want to use my working directory as default path. How do I set it up? My hgrc file does not work and looks like this: [path] default = /home/user/myscript/ default-push...

What does `\+` signify as an operator in prolog?

syntax,prolog
I have encountered the symbol \+ in prolog and am not sure as to what it signifies. I have gone through the prolog documentation and am either not being too resourceful or have not really noticed it. Thank you for your answer! ...

Why wouldn't lodash 'some' function work as expected?

javascript,sails.js,lodash
I'm trying to use lodash 2.4.1 in order to know if there's at least one element within an array with true as its value. So I decided to use lodash some or any function. This is what my code looks like: if ( _.some([lineup.reachesMaxForeignPlayers(), lineup.reachesBudgetLimit()], true) ) { response.send(400, "La...

Python custom sort

python,sorting,python-3.x
I am trying to sort a list using Python's sorted function. In Python 3 the cmp keyword argument was removed. Unfortunately it seems that I can not implement my algorithm using the key keyword argument since I both objects in order to compare the data. Example Sorted Data 59 59...

Web scraping error: exceptions.MemoryError

python,web-scraping,scrapy,scrapy-spider
I'm trying to download data from gsmarena. A sample code to download HTC one me spec is from the following site: "http://www.gsmarena.com/htc_one_me-7275.php" as mentioned below. The data on the website is classified in form of tables and table rows. The data is of the format: table header > td[@class='ttl'] >...

HTML CSS POSITIONING

html,css,positioning
.container {width: 100%;} .nav h1 {float: left;} .nav ul {float: right;} .nav li {display: inline-block;} <div class="nav"> <div class="container"> <h1>.nav h1 Resume</h1> <ul> <li>.nav ul .nav li Home ul li</li> <li>Portfolio ul li</li> <li>Skills ul li</li> <li>Experience ul li</li> <li>Contact ul li</li> </ul> </div> </div> <div class="slider"> <h2>div.slider h2...

Finding the desired amount of smallest Doubles in an ArrayList

java,arraylist,collections
I have an ArrayList filled with Double values, and based on user input (an int), I need to find the indices of the entered amount of smallest Doubles from this List. For example, if the user were to type in 5, and the ArrayList looked as such (is actually much...

Open a spreadsheet in the middle of macro

vba,excel-vba
Currently, I have a sub which downloads an Excel file from the Internet. I would like to open the spreadsheet and run more commands on it prior to the sub ending. The issue is that the spreadsheet does not open until the macro has finished executing thus it cannot find...

Query 2 tables join

php,mysql,left-join
I want to get all the films whose genre is equal to ID_GENRE = 8. This is the query that I'm doing: http://l4c.me/fullsize/2-tablas-1434140362.png $query_GetSimilar = sprintf("SELECT * FROM z_movie,z_movie_genre ORDER BY z_movie.visits DESC WHERE z_movie_genre.id_genre = 8 LIMIT 18"); $GetSimilar = mysql_query($query_GetSimilar, conect::dbconect()) or die(mysql_error()); $row_GetSimilar = mysql_fetch_assoc($GetSimilar); $totalRows_GetSimilar =...

Format a multi-result single Json value

javascript,jquery,json,asp.net-mvc,razor
I have a change/getJson function that looks like this: $('#CountryId').change(function () { $.getJSON('@Url.Action("StateList", "Manage")', {id: $('#CountryId').val()}, function (data) { var items = '<option value="">Select a State</option>'; $.each(data.List, function (i, state) { items += "<option value='" + state.Value + "'>" + state.Text + "</option>"; }); $('#StateId').html(items); //Fail //console.log(">>>>" + data.LatLng.Latitude); //$('#Latitude').val(data.LatLng.Latitude);...

Cannot find the CSS Errors in Chrome

css,google-chrome,browser,web-inspector
I'm trying to debug a website and in Chrome's inspect element I'm seeing 8 errors and 1 warning. The Warning shows up right next to the problem. However, the Errors don't show up anywhere and I can't locate them. Also, the errors and warnings show an underline when I hover...

CreateView with additional model

django,django-generic-views
I'm using a CreateView to create a User. views.py: class UserCreateView(CreateView): model = User form_class = UserCreateForm success_url = reverse_lazy('patient:users') forms.py class UserCreateForm(ModelForm): class Meta: model = User fields = ['first_name', 'last_name'] I have another model, UserGroups, defined as follows: class UserGroup(models.Model): users = models.ManyToManyField(User, blank=True, related_name='user_groups') name = models.CharField(max_length=50)...

Using Pandas to Iteratively Add Columns to a Dataframe

python,loops,pandas,dataframes
I have some relatively simple code that I'm struggling to put together. I have a CSV that I've read into a dataframe. The CSV is panel data (i.e., unique company and year observations for each row). I have two columns that I want to perform a function on and then...

WebStorm not tabbing correctly on a single file

javascript,ide,webstorm
For some strange reason, WebStorm has decided that all tabs typed in for a single file shall be single spaces, instead of the 4 the editor is set for. I have checked, all my other source files are still working correctly. Things I have tried: Closing tab and reopening Renaming...

Android webview in viewpager

android,html,webview
Got a viewpager with webview. Webview loads an url . Loaded url might contain a slideshow . Problem slideshow doesnt swipe , because viewpager swipe works over it. How to fix it ??

Compare two DATETIME fields from multidimensional array and return a value or index

php,mysql,arrays,multidimensional-array,comparison
I have a user table. I have 2 DATETIME per row that I'm looking at. I will look at $lastLog date and $lastReceived (for last received lead) and determine which is newer and that becomes their $eligibleTime. We will then look for the oldest $eligibleTime to select which user should...

New window opening with parent window's controls

c++,winapi
Sorry for english slaughter but i can't find anything about that. I'm trying to open an empty window in c++ with winapi but new window opening with parent window's controls like a clone. case VBTN: { vsa1 = CreateWindowEx(NULL, L"Window Class", L"Test", WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, 350,...

Linq statement created in vb.net not working in c#

c#,vb.net,linq
I am trying to convert the following in C# and can't figure it out. Dim query = From p In products Select p.ProductId, p.ProductName, p.ProductCategory Distinct Is this trying to return an anonymous object? Here is my attempt in C#: var query = from p in products select p.ProductId, p.ProductName,...

What is preventing my event handler method from completing?

c#,wpf,concurrency,exception-handling,event-handling
I'm using a SerialPort, WPF for user interface, a 'ui' object to handle application logic, and a wrapper around SerialPort. The method in question is called when the SerialPort.DataReceived event is fired. It begins to run, then after reading the data, just seems to exit, even though it has tons...

MongoDB query Mixed Type field with $in

mongodb
I'm trying to query a Mixed Type field with $in but it doesn't seem to be working: db.acts.find({user: { _id: { $in: [ObjectId("555b63c6b9aaf6d80aecccc3")] } }}) But I have a user with field of _id with a value of ObjectId("555b63c6b9aaf6d80aecccc3") Why is it not working ?...

Bonobo Git Server Configruation: HTTP Error 500.19 - Internal Server Error at line 71

iis,windows-server,windows-server-2012-r2,iis-8.5,bonobo
I have tried to configure Bonobo Git Server. I have followed the included instructions, and after trying to visit the server for the first time, I get the following error: There is a similar question; however, it gives an error at one line prior and the solution the author answered...

How to pass data from page to Portlet class through AJAX call?

ajax,jsp,liferay,portlet
I'm trying to pass a value in an AJAX 'GET' request to my Portlet class, but I can't quite figure out a way to access such variable's value in the class. My AJAX code is: function loadXMLDoc() { var nocache = new Date().getTime(); var xmlhttp=new XMLHttpRequest(); var url = "${mURL}";...

Updating cart based on values of multiple select tags in rails

jquery,ruby-on-rails,ajax,ruby-on-rails-4
I've implemented a cart in Rails so that when showing said cart, the quantity of each item is displayed as a select tag to allow users to change quantities (the way Amazon does it.) This is how I generate the select tags, which I do for every item in the...

Listing rows in columns that have the letter e [closed]

sql,sql-server
Below I have a query that I have been working on for awhile: SELECT * FROM EMPLOYEE E WHERE LAST_NAME LIKE %E% This query is supposed to list every last name that I have in my column that has the letter e in it. The only problem is, is that...

Java actionPerformed questions

java,swing,jframe,jpanel,action
Hello everyone I am new to java programming and I begin to fell in love with making simple JPanel or JFrame games. But recently I'm starting to challenge myself on writing a more complicated game called "Doodle jump". As most of you may already heard of this game you are...

Please explain this code to me [closed]

c#,asp.net,cookies,request
We hit an unexpected error during our school project. Someone took the time and figured out what it was. But when he fixed it he couldn't explain what he did. I hope someone can explain the following line of code: public string aantalVoorArtikel(object id) { int artikel_id = (int)id; if...

Select every first element of array of integer arrays to array

arrays,postgresql,plpgsql
How to select every first element of array of integer arrays to array? {{1,2,3},{2,15,32},{5,16,14},...} -> {1,2,5,...}

Legend Duplication

javascript,kendo-ui,kendo-chart
I have the following implementation and it is functional. I wonder how I could able to fix duplicate of legend in my current implementation. Please watch fname="NY" for (var i=0;i<e.series.data.length;i++){ if (e.series.data[i].valueColor != "" && e.series.data[i].fname != "") { color = e.series.data[i].valueColor, legendName=e.series.data[i].fname } } FIDDLE...

How can I move file in php Laravel 5 ?

php,laravel,laravel-4,laravel-5
I'm trying to move file from one place to another place. In this case is my user profile picture. Since I store my user profile picture base on their username, so when they change their username. I will need to move thier profile photo, Otherwise, the image link will be...

Convert Apache Spark Scala code to Python

python,scala,apache-spark
Can anyone convert this very simple scala code to python? val words = Array("one", "two", "two", "three", "three", "three") val wordPairsRDD = sc.parallelize(words).map(word => (word, 1)) val wordCountsWithGroup = wordPairsRDD .groupByKey() .map(t => (t._1, t._2.sum)) .collect() ...

shell script to capture string from a table

bash,shell,command-line
I am writing a shell script to upload a file to a specific folder on google drive. I have started out on the terminal though, to see how it can be done. $ now=$(date +"%Y") $ echo now 2015 $ drive list | grep -w $now 0B6g6AG_EmqeJM3ZKSHc5cUNJZ2M delete.txt 18.0 B...

SQL - Select all person whose “firstName lastName” contain a name

mysql,sql,database
I have a database table "person" with two columns firstName and lastName. Now I want to select all the persons whose "firstName lastName" contains a given name. How can i do it with a SQL query? Example: Person x with firstName: A B and lastName: C Person y with firstName:...

How to replace words ending with -ing with a static string

c#,regex
In my block of code below, I am triyng to replace words ending with -ing with a static text "------". However, this doesn't seem to work and throws --- all over the place. What am I doing wrong? string ingString = "I like programming, running, jobs and swimming."; string ingWords...

find_or_create from array

ruby-on-rails,ruby,ruby-on-rails-4
I have an array of two Airport structs and need to check if each exists already, and, if not, create it. The unique key for each airport is its :iata code. When created or found I need to add both Airports to @trip airports = [departure_airport, arrival_airport] airports.each do |a|...

Tween Arc outerRadius()

javascript,d3.js
In the following code, when you click on an arc of a circle, it tweens the outer radius of that particular arc of the circle. var data = { "details": [ { "id": 1, "name": "AAA", "pcArray": [25,75], "type": "c", "subtype": "p", }, { "id": 2, "name": "BBB", "pcArray": [25,175],...

Use AngularJS nested ng-repeat to create elements

angularjs,ng-repeat
I am working with angularjs ng-repeat. I have this code: angular.module('app', []) .controller('MainCtrl', function($scope) { var items = [1,2,3,4,5,6,7]; $scope.items = items; }); I want to have html result like this: <ul> <li> <a href="">1</a> <a href="">2</a> </li> <li> <a href="">3</a> <a href="">4</a> </li> <li> <a href="">5</a> <a href="">6</a> </li>...

Octave plot different colour for every point

plot,octave
I am having a specific problem. Firstly I am using octave. I have a dataset where every row is of the following format: datarow = [ x, y, z, colourIndex]; The length of the dataset is irrelevant, but suppose it is 10. I want to be able to plot the...

frama-c metrics output to file for metrics-by-function

frama-c
I am trying to output the metrics results to a file. I know that I can call -metrics-output, and output the global metrics analysis to a file, but I am also trying to get the results of each function. Calling: frama-c -metrics -metrics-output test.txt -metrics-by-function example.c or: frama-c -metrics -metrics-by-function...

DateFormatter for format 'Fri, 19 Jun 2015 20:05:23 GMT'

ios,objective-c,nsdate,nsdateformatter
I am trying to determine the DateFormatter dateFormat element for the following timestamp: Fri, 19 Jun 2015 20:05:23 GMT I have tried the following without success: E', dd MMM yyyy hh:mm:ss zzz EE', dd MMM yyyy hh:mm:ss zzz EEE', dd MMM yyyy hh:mm:ss zzz E', dd MMM yyyy hh:mm:ss zz...

Reading unformatted name/value pairs from a file, formatting it, and printing it out in Python 2 dictionary [closed]

python,python-2.7,dictionary,io
Given a text file like so # Name_value_pair.txt name1 = value1 name2 = value2 name3 = "some value3" name4=value4 name5= name6 Is it possible to read that file, format it into a dictionary and print it out using python? I know how to open and read the files, but I...

How can I get simulated react events to update the values of the ref in my component?

javascript,unit-testing,testing,reactjs,reactjs-testutils
So I have a react component that looks something like this: class SignInForm extends React.Component { constructor(props) { super(props); } onFormSubmit(event) { const username = React.findDOMNode(this.refs.username).value; const password = React.findDOMNode(this.refs.username).value; // very basic validation if (username && password.length > 6) { this.props.flux.signIn({ username, password }); } event.preventDefault(); } render() {...