auto-generate

Generate 3000 squares procedurally

感情迁移 提交于 2019-12-06 08:00:45
I need to build a widget that contains 3000 squares. Doing this manually would take a very long time, maybe some of you know the easiest way to generate the class .square 3000 times? I need also be able to alter the content of each square, for example a color, title, etc. Thx friends! <div class="square"> <h1>10</h1> </div> https://jsfiddle.net/srowf8hg/ You just need a loop and create a new square on each iteration. In order to be able to access each square individually, each generated square gets its own unique id: var cont = document.getElementById("container"); for(var i = 1; i <3001; ++i)

customizing some auto generated codes with T4

非 Y 不嫁゛ 提交于 2019-12-06 05:10:56
I Used "EF 4.x DbContext Fluent Genarator" to generate my poco classes , mapping files and also Context file, in EF Code first.(in fact "EF 4.x DbContext Fluent Genarator" uses 3 T4 files) now i want apply some changes on auto generated codes: change namespace of some classes. Mark some fields of some classes as [NonSerializable] change body of Some auto generated custom methods on pocos that i added to T4 template. how can i do these works with continuing using T4 files? for #3. this should help These classes are partial classes so you can create a new .cs file with same class as partial. add

How to automate property generation for a class in phpstorm?

半腔热情 提交于 2019-12-06 01:39:49
问题 If I implement a class, which gets some services injected, I have to write this bulk of code: <?php namespace Hn\AssetDbBundle\Services; use Psr\Log\LoggerInterface; use Symfony\Bundle\TwigBundle\TwigEngine; use Symfony\Component\HttpKernel\KernelInterface; /** * Class SomeNewService * @package Hn\AssetDbBundle\Services */ class SomeNewService { /** * @var TwigEngine */ private $engine; /** * @var KernelInterface */ private $kernel; /** * @var LoggerInterface */ private $logger; public

Generate Local Resource for all pages

我是研究僧i 提交于 2019-12-05 22:07:07
Is There Any Way or trick to generate local resource for all pages in visual studio 2010 automatically? I have about 500 pages and UserControls. its hard to generate resource for every page one by one. is there Any Add on or extension for this? shaahin. Write a script, no? A resource file is nothing but an XML file. MiFreidgeim SO-stop being evil Write a macro as suggested in Is it possoble to run 'Generate Local Resources Tool' programmatically? Also from http://www.guysmithferrier.com/post/2009/05/Localizing-ASPNET-MVC.aspx : Convert your HTML controls to equivalent ASP.NET server side

Auto-generate LESS styles for sprite icons

只谈情不闲聊 提交于 2019-12-04 19:03:57
I have icon sprites image with each icon in a 20 by 20 pixel area. Each icon has several variants (black, colour, white small etc.). And have a significant amount of them. Instead of writing styles for each individual icon I'd rather just provide their names in my LESS file and let the processor generate styles for them. This is what I came up with but it doesn't seem to work. @icons: upvote,downvote,comment,new,notify,search,popup,eye,cross; @array: ~`(function(i){ return (i + "").replace(/[\[\] ]/gi, "").split(","); })("@{icons}")`; @count: ~`(function(i){ return i.split(",").length; })("@

How to automate property generation for a class in phpstorm?

房东的猫 提交于 2019-12-04 05:35:49
If I implement a class, which gets some services injected, I have to write this bulk of code: <?php namespace Hn\AssetDbBundle\Services; use Psr\Log\LoggerInterface; use Symfony\Bundle\TwigBundle\TwigEngine; use Symfony\Component\HttpKernel\KernelInterface; /** * Class SomeNewService * @package Hn\AssetDbBundle\Services */ class SomeNewService { /** * @var TwigEngine */ private $engine; /** * @var KernelInterface */ private $kernel; /** * @var LoggerInterface */ private $logger; public function __construct(TwigEngine $engine, KernelInterface $kernel, LoggerInterface $logger) { $this->engine =

RESTful web service auto-generate WADL

人走茶凉 提交于 2019-12-03 14:48:41
问题 I have created a RESTful web service in C# and have deployed it to IIS. When I access the service HeadOffice.svc, I have the option to view the WSDL (HeadOffice.svc?wsdl). What I would like to do is have the option of viewing the WADL (e.g. HeadOffice.svc?wadl). Is this possible? I have read around the place that the general opinion is that this is not the best practice. However, I need the WADL for a school assignment, so any help would be much appreciated. 回答1: Suppose you already know that

RESTful web service auto-generate WADL

自古美人都是妖i 提交于 2019-12-03 04:32:22
I have created a RESTful web service in C# and have deployed it to IIS. When I access the service HeadOffice.svc, I have the option to view the WSDL (HeadOffice.svc?wsdl). What I would like to do is have the option of viewing the WADL (e.g. HeadOffice.svc?wadl). Is this possible? I have read around the place that the general opinion is that this is not the best practice. However, I need the WADL for a school assignment, so any help would be much appreciated. Regfor Suppose you already know that WADL is not standard / not supported widely. And when somebody needs WADL, may be then better to use

Python: How to solve the issue : 'badly formed hexadecimal UUID string' in Django

这一生的挚爱 提交于 2019-12-02 03:31:39
I have created 'post' model in which I included 'post_id' as the primary key field. When I am trying to create a post, it is raising an error: 'badly formed hexadecimal UUID string'. I would appreciate helping me in solve this. Here's my code. Models.py: class Post(models.Model): post_id = models.UUIDField(primary_key=True, default='uuid.uuid4', editable=False) user = models.ForeignKey(settings.AUTH_USER_MODEL, default=1) from1 = models.CharField(max_length=20) To = models.CharField(max_length=20) timestamp = models.DateTimeField(auto_now=False, auto_now_add=True) objects = PostManager() def _

How make toString() method return Super Class private fields also along with its instance fields?

六月ゝ 毕业季﹏ 提交于 2019-12-01 17:32:19
Is there a way to make toString() include private fields of the super class ? I tried adding a super.toString() , no use however. Please see the code below Employee.java package test; public class Employee { private String name; private int id; private double salary; public Employee(String name, int id, double salary) { super(); this.name = name; this.id = id; this.salary = salary; } public double getSalary() { return salary; } @Override public String toString() { return "Employee [name=" + name + ", id=" + id + ", salary=" + salary + "]"; } public static void main(String[] args) { Employee e