I have the following two Python functions: @classmethod def serialize_dict(cls, d): values = [] for column_name in cls().distinguishing_column_names(): value = str(d[column_name]) if value == 'None': value = '' values.append(value) return ' '.join(va
I have a large directory of folders (call it C:\Main). I need to set up a batch script to search the subfolders of that directory for a string within the filename (not the text within the file). I'm having trouble finding an answer. Essentially, let'
is there an easier way to write this if statement? int main () { char k[100]; int i=0; ifstream fd ("info.txt"); while (!in.eof()) { fd >> k[i] if (int(k[i]) != 96 || int(k[i]) != 97 || int(k[i]) != 98 || int(k[i]) != 99) i++; } } and so o
I am creating an Add-in (using C#) for Microsoft Word and want to trigger some functionality when some text/image etc. is dragged from any source and dropped into Word. So basically I want to trap the Drop event in Word. However I am not able to find
I am quite the beginner - but I have a lot of experience with respect to Electrical Engineering and formulas - over 30 years worth! Trying to construct an app for the iPhone. Loaded the SDK, bought myself a Mac, got a couple of "Chapter" pages w
As the ReactJS (and other flux implementations, such as redux) recommended: https://facebook.github.io/react/docs/thinking-in-react.html#step-3-identify-the-minimal-but-complete-representation-of-ui-state We should't keep a state which can be compute
Hi I have a table facility. Which holds a score for each day (Multiple scores can be reported each day and both would be valid) I need to calculate the 90th percentile, SD, and Mean for score by month. Facility: Id Month Date score 1 Jan 1 5 1 Jan 1
Firstly, I know that with Model View Presenter there are different implementations, and in my mind as long as you have the layers of abstraction clearly defined and doing their appointed roles then how you implement this pattern is open to interpreta
I have a console service I'm currently testing. I was planning on using a timer for it to last all day, with an interval check every 30 seconds, however, it looks like alot of people don't like using timer's with a service in that fashion. Is It wise
I'm using redux but when I run my code I have this error: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead. I install npm i prop-types -S but I I still have the same error. ./components/action/
Anybody know where to find an sample form using MSChart in C#? I made an example. //name program.cs using System; using System.Collections.Generic; using System.Windows.Forms; namespace MSChart_Sample { static class Program { /// <summary> /// The m
I am implementing a function which removes duplicates from an unsorted doubly linked list. I removed other functions to keep the code short and more clear. Please assume other functions like InsertFront do work correctly. I am having trouble attachin
I have the following power function which operates on integers and it works fine: int ipow( int base, int exp ) { int result = 1; while( exp ) { if ( exp & 1 ) { result *= base; } exp >>= 1; base *= base; } return result; } Now I'd like to have
I have spinner and edittext, and i want if spinner is selected can setfocus in edittext. I am already try, but not going to work, how to fix this? This is my code : edkontak1.setOnEditorActionListener(new TextView.OnEditorActionListener() { @Override
I need to reassign a single file pointer to multiple files sequentially. I have the file paths correctly in a string path. when i pass the path and the file pointer to a function to reassign, I get "Aborted (core dumped)".. FILE * fptr; //Global
I have a memory buffer whose address i want to store in an unsigned integer value. uint8_t* _buff = new uint8_t[1024]; uint64_t* _base_addr = (uint64_t *)_buff; I want the address of the location pointed by _buff or _base_addr (anyhow it is the same
I have this error Invalid object name 'dbo.Vacancies' But I have Model for Vacancies Here it is public partial class Vacancy { [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstruc
I'm using Quartz library to run a schedule task.I used it like this ISchedulerFactory scheduleFact = new StdSchedulerFactory(); IScheduler scheduler = scheduleFact.GetScheduler(); scheduler.Start(); IJobDetail job = JobBuilder.Create<MyJob>() .WithI
I have a model which looks like this public class MyModel { .... public virtual ICollection<Comm_ent> Comments { get; set; } } and the submodels look like public class Comm_ent { ... public virtual My_Model MyModel{ get;set;} } In my Comm_ent Datata
I have some existing hand written GUI code that I wrote in a text editor the hard way. It eventually compiled nicely but now I want to use the GUI builder in NetBeans v7.3 to make some extensive improvements. I cannot for the life of me find any info
I have the following html/javascript code that uses websockets to communicate with a server. It seems like I can only send(message) only inside the onmessage() and onopen() functions. How can I send data outside of those functions ? <!DOCTYPE HTML>
More of a general MATLAB question than looking for programming advice -- if I have: y = cellfun(@(x)sum(x(:)), Z, 'un', 0); where there are a combinations of NaN's and real numbers in each cell matrix, when I sum all elements of those matrices per ce
I have a datagridview bound to a datasource, and in each row in the grid there is a category, product, and quantity. I want to filter the products in each row according to the selected category. I'm using C# and DevExpress. How can I do this? Please
While programming my Authentication app on Laravel, I came across to an error I've never seen before. I've been brainstorming for almost an hour for the cause of this problem but yet I can't find a solution. Error: Class User contains 3 abstract meth
I am willing to use a data structure as an overflow buffer of constant space. I want to have efficient insert but most importantly efficient removal of the min element. I was thinking of using a heap since I have O(log(n)) find_min() and log(n) inser
I have multiple files in a directory. i want to pull out certain lines from all those files and print to an output file. File1 line1 line2 line3 line4 File2 line1 line2 line3 line4 and like so i have many files. Desired Output File1 line2 line4 File2
I have two data frames df1 # a b # 1 10 20 # 2 11 21 # 3 12 22 # 4 13 23 # 5 14 24 # 6 15 25 df2 # a b # 1 4 8 I want the following output: df3 # a b # 1 14 28 # 2 15 29 # 3 16 30 # 4 17 31 # 5 18 32 # 6 19 33 i.e. add df2 to each row of df1. Is ther
I'am trying to use backload (https://github.com/blackcity/Backload) to upload images to a mvc application we are currently building. It is supposed to be able to store images in database but I had no luck finding an example that demonstrates this fea
I have this case LoginViewController - initial ViewController) present NavigationControllerB (in NavigationControllerB I have many ViewController) NavigationControllerB present ViewControllerC ViewControllerC present ViewControllerD In the ViewContro
I have a datepicker in my Meteor app. When I insert or update the date into my collection, after creating a variable from the value of the datepicker, I do this: due: moment(new Date(due)).toDate() Which inserts the date into mongo like this: Tue Jun