2018-10-22         Rose

How to add label to asp full calendar?

<!DOCTYPE html><html><head runat="server"><title>ASP.NET FullCalendar</title><link href="//cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.1/themes/cupertino/jquery-ui.min.css" rel="stylesheet" /><link href="//cdnjs.cloudflare.com/ajax/libs/fullcalendar/3.1.0/fullcalendar.min.css" rel="stylesheet" /><link href="//cdnjs.cloudflare.com/ajax/libs/qtip2/3.0.3/jquery.qtip.min.css" rel="stylesheet" /><link href="cal.css" rel="stylesheet" /></head><body><form id="form1" runat="server"><asp:ScriptManager ID="Sc...

 jquery                     1 answers                     100 view
 2018-10-22         Rose

Making .log files persistent

I have a software which generates .log files, and the problem is that they are not persistent (each time the programs try to write an event it might rewrite over an past event which is not desirable) Do you know a way in which I can write a python script for detecting when the program is opening a .log file in order to write something and make sure that he is not overwriting?Thanks! You are trying to open the log file in write mode.You Have To Open The File In Append Mode Tryf=open('<filename>','a')f.write(<log entry>)f.close() [XXX]you can use module logg...

 python                     3 answers                     81 view
 2018-10-22         Rose

Bookshelf Association Error

I am trying to create associations and use those associations to create queries, but I keep receiving this error: Stack TraceHere is the file with my models and query. (test.js)import knex from 'knex';import { client, host, user, password, database, charset} from './environment/dev';import bookshelf from 'bookshelf';const Knex = knex({ client: client, connection: { host: host, user: user, password: password, database: database, charset: charset }});const Bookshelf = bookshelf(Knex);Bookshelf.plugin('registry');co...

 mysql                     1 answers                     37 view
 2018-10-22         Rose

How to find the workspace where the file is checked out in P4v

I have a file checked out. So, when I tried to check out the file, it says "the file is checked out by another user and cannot checkout multiple versions of it". I tried seeing the "checked out by" tab in P4V and it shows my P4V id. But the file is not shown in any of pending lists in any of the work spaces I have. I need to find the workspace where the file is checked out so that I can revert it. You can hover your mouse over the item showing the blue checkmark in P4V, and it will show you who has it checked out and in what workspace. In this image, the workspace name i...

 p4v                     1 answers                     17 view
 2018-10-22         Rose

How to convert metric/Inch to CGSize - Swift

I need to render a PDF for a given metric size. I can render a PDF in iOS coordinates but how can I convert i.e. 1mm to points. Thanks The size of a point depends on the device. You will need a reference table and check which device you are running on. You can find more information about size conversion here. And this page will help you get the device model you are running your app on. [XXX]

 ios                     1 answers                     97 view
 2018-10-22         Rose

GAMS Binary Variable Logic Decision

i got a problem with my GAMS modelling (linear problem, no multiplication of binary variables allowed).I'd like to have three binary variables where the first value depends on the other two.The value table is given below (v1=x if (v2=y and v3=z)) V1 | V2 | V3----+----+---- 1 | 1 | 1 0 | 1 | 0 0 | 0 | 1 0 | 0 | 0So v1 is 1 only if both v2 and v3 are 1. How can I turn this behavior into equations in gams where v1, v2 and v3 are binary variables?Thanks in advanceSebastian The following three equations together should do the trick:e1.. v1 =g= v2 + v3 - 1;e2.. v1 ...

 binary                     1 answers                     25 view
 2018-10-22         Rose

django users and groups - show group membership in admin?

The django admin's User management gives us easy access to setting a User's group allegiances via the list for picking the Groups. This is the ManyToMany relationship default widget for assignment. And for the most part that's nice for User creation from the get go.However, say I have a huge number of users and groups...I'd like the chance to view and manage group membership by clicking on the Group in the admin and see all the members in a similar picker (or via the horizontal widget). Is there a builtin django method/trick to show ManyToMany relations in "reverse?"Sett...

 django                     1 answers                     95 view
 2018-10-22         Rose

Finding a key inside a nested dictionary with Python

Ditionary:data = { "president": { "name": "Zaphod Beeblebrox", "species": "Betelgeusian" }}What I'd like to do is return if a key named "name" exists.if 'president' in data and 'name' in data['president']: print("found")This works fine but only if I have pre knowledge of the dictionary's structure. Is there a way of knowing if there's a subkey called "name" recursively? I only found how to do this for the top level. You can do a recursive search:data = { "president": { "name": "Zaphod Beeblebrox", "species": "Betelgeusian" }}def...

 python                     3 answers                     41 view
 2018-10-22         Rose

How do I do in Eclipse to build my custom java package and project at the same time?

It's said that a java package may contain classes, interfaces, enums, ... but I've been seeking over the net and I still haven't found what I'm looking for ... When I see package info files they also include classes... My idea is that package defines classes, interfaces, etc. in the same file but the code of the class should be in a separate class file, shouldn't it?Should I name the same package in each class I create for Eclipse to put them all together under the same package without the need of a package info file? On the other hand, is really necessary that Eclipse crea...

 java                     1 answers                     37 view
 2018-10-22         Rose

use the select2 boxes value to filter table

I am trying to filter a table using multiple select2 boxes.jQuery(function() { jQuery('.js-example-basic-multiple').select2(); jQuery('.js-example-basic-multiple').on("select2:select", function(e) { var loc = $('.js-example-basic-multiple').val(); jQuery('#events-table td.hidden-location').removeClass('hidden-location'); jQuery('#events-table td:not(".' + loc + '")').addClass('hidden-location'); if (loc == 'all') { jQuery('#events-table tr').removeClass('hidden-location'); } });});select { width: 300px;}tr { background: white;}td { border: 1px soli...

 javascript                     1 answers                     8 view
 2018-10-22         Rose

SELECT command: String or binary data would be truncated

When I'm trying to run the query:SELECT id FROM tbl_MessageData WHERE data LIKE 'very_long_text' I get the error: String or binary data would be truncatedThe data field is defined to be Text and I succeeded inserting the "very_long_text" (the actual text is about 10000 chars long) into it. You can only use 8000 chars in a query. Text data type will be removed in a future version of Microsoft SQL Server, instead use varchar or nvarchar.You can see your column INFO: SELECT column_name, data_type, character_maximum_length FROM information_schema.columns WHERE table...

 sql                     1 answers                     4 view
 2018-10-22         Rose

How to initialize the class only once and retain the overidden properties in python

I am carrying out XML parsing for a list of XML files. I am using a module which overrides the XMLParser class of element tree. This is the code-import syssys.modules['_elementtree'] = Nonetry: sys.modules.pop('xml.etree.ElementTree')except KeyError: passimport xml.etree.ElementTree as ETclass Parse(): def __init__(self): self.xmlFiles = [list_of_xmlFile_paths] def parse_xml_files(self): for filepath in self.xmlFiles: root = ET.parse(filepath, LineNumberingParser()).getroot() for elem in root: print(elem.start_...

 python-3.x                     1 answers                     70 view
 2018-10-22         Rose

Lock a local git branch from any further changes

Say I have this sequence of commands:current_branch="$(git rev-parse --abbrev-ref HEAD)"git checkout -b "foo"git lock "$current_branch" # i made this upwhat I want to do is lock a branch so that I cannot accidentally make changes to it after I am done with it. For example, after a feature branch has been squashed and merged into the integration branch.Is there a way to do this with git? Perhaps there is a way to lock a worktree using https://git-scm.com/docs/git-worktree? How about we roll this feature ourselves? Lets start with your git lock command. We can write that...

 git                     2 answers                     38 view
 2018-10-22         Rose

Adding custom claims to ClaimsPrincipal when using AddAzureADB2C in MVC Core App

When authentication using azure AzureADB2C I would like to add custom claims which are managed in the portal to the Claims Principle current code in start up services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme) .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options));I was thinking it should work something like this but on token validated is never hit services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme) .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options)) .AddJwt...

 c#                     1 answers                     98 view
 2018-10-22         Rose

SQLAlchemy ORM: create 2 attributes for the same column

I'm working on the refactoring a legacy Alchemy ORM project, and for retro-compatibility reasons I need to keep some old attribute names and re-map them with a new name.Alchemy ORM provide column_property(attribute) function that helps to create a read-only new attribute that reference an other attribute.The other known way to solve this problem is using hybrid_property:@hybrid_propertydef price(self): return self.old_price@price.setterdef price(self, value): self.old_price = valueIs there any more concise way to alias getter and setter of column. For simple mirror...

 python                     1 answers                     62 view
 2018-10-22         Rose

Retrive a field which has array of objects(ref) using nodejs

Im having mongo(mongoose) collection called "asserts" and "users".Having list of documents in "asserts" collection.Now while adding a user I need to select multiple "asserts". So need to set "ref" to asserts collection.Below is my modal asserts_list: { type: [Schema.Types.ObjectId], ref: "asserts" },POST operation is working fine (i.e) I can add multiple object IDs in Mongoose in array. But while performing list using AppComp.find({}) with populate, asserts_list is returning empty array([]).Help me to retrieve array of object ids in find({}) using nodejs. You nee...

 javascript                     1 answers                     127 view

Page 1 of 145  |  Show More Pages:  Top Prev Next Last