This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class LineChart { | |
| // LineChart by https://kevinkub.de/ | |
| constructor(width, height, values) { | |
| this.ctx = new DrawContext(); | |
| this.ctx.size = new Size(width, height); | |
| this.values = values; | |
| } | |
| _calculatePath() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class BaseApiController : ApiController | |
| { | |
| public HttpResponseMessage Options() | |
| { | |
| return new HttpResponseMessage { StatusCode = HttpStatusCode.OK }; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //this will work | |
| // WITH Lambda syntax | |
| var toUpdate = ctxt.Medida.AsEnumerable().Join(diferencia.Ids, c => c.ID, ci => ci, (c, ci) => c).ToList(); | |
| // WITH SQL syntax | |
| var toUpdate = (from m in ctxt.Medida.AsEnumerable() | |
| join d in diferencia.Ids | |
| on m.ID equals d | |
| select m).ToList(); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| static public void SynchronizeEntities(List<MyEntity> entities) | |
| { | |
| MyDataContext ctxt = MyDataContext.GetFachadaDAL(); | |
| // bulkinsert de las medidas | |
| var sBuilder = new StringBuilder(); | |
| var sWriter = new StringWriter(sBuilder); | |
| var serializer = new XmlSerializer(typeof(MyEntity[])); | |
| serializer.Serialize(sWriter, entities.ToArray()); | |
| ctxt.BulkInsertEntity(sBuilder.ToString()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /****** | |
| Extracted from stackoverflow: | |
| http://stackoverflow.com/questions/591853/search-for-a-string-in-all-tables-rows-and-columns-of-a-db | |
| This code should do it in SQL 2005, but a few caveats: | |
| It assumes that all objects are owned by dbo. If that's not the case you'll need to adjust it. | |
| It is RIDICULOUSLY slow. I tested it on a small database that I have with only a handful of tables and it took many minutes to complete. If your database is so big that you can't understand it then this will probably be unusable anyway. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var regex_coords = /\-?[0-9]+[\.]{0,1}[0-9]*/; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <table class="table table-striped" style="border-collapse:collapse;"> | |
| <thead> | |
| <tr> | |
| <th>#</th> | |
| <th>Date</th> | |
| <th>Description</th> | |
| <th>Credit</th> | |
| <th>Debit</th> | |
| <th>Balance</th> | |
| </tr> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * ValidateSpanishID. Returns the type of document and checks its validity. | |
| * | |
| * Usage: | |
| * ValidateSpanishID( str ); | |
| * | |
| * > ValidateSpanishID( '12345678Z' ); | |
| * // { type: 'dni', valid: true } | |
| * | |
| * > ValidateSpanishID( 'B83375575' ); |