Skip to content

Instantly share code, notes, and snippets.

View sAbakumoff's full-sized avatar

Sergey Abakumoff sAbakumoff

View GitHub Profile
private SizeF MeasureText(string text, Font font)
{
using(var bitmap = new Bitmap(1,1))
using(var graphics = Graphics.FromImage(bitmap))
{
var size = graphics.MeasureString(text, font);
return new SizeF(size.Width / bitmap.HorizontalResolution, size.Height / bitmap.VerticalResolution);
}
}
Dim val1 As GrapeCity.ActiveReports.Expressions.ExpressionObjectModel.ParameterValue = New Expressions.ExpressionObjectModel.ParameterValue
Dim val2 As GrapeCity.ActiveReports.Expressions.ExpressionObjectModel.ParameterValue = New Expressions.ExpressionObjectModel.ParameterValue
Dim val3 As GrapeCity.ActiveReports.Expressions.ExpressionObjectModel.ParameterValue = New Expressions.ExpressionObjectModel.ParameterValue
val2.Value = "TEST12"
val3.Value = "TEST13"
val1.Value = "TEST"
Runtime.Parameters(1).ValidValues.Add(val1)
Runtime.Parameters(1).ValidValues.Add(val2)
<link rel="stylesheet" href="GrapeCity.ActiveReports.Viewer.Html.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="GrapeCity.ActiveReports.Viewer.Html.js"></script>
static void ProcessReportComponent(IReportComponent component)
{
if (component == null)
return;
if (component is IReportComponentContainer)
{
var container = component as IReportComponentContainer;
foreach (var comp in container.Components)
{
ProcessReportComponent(comp as IReportComponent);
// introduce extension method:
public static class VieweExtensions
{
public static bool IsSidebarVisible(this Sidebar sidebar)
{
return
sidebar.ParametersPanel.Visible | sidebar.SearchPanel.Visible |
sidebar.ThumbnailsPanel.Visible | sidebar.TocPanel.Visible;
}
{"columns":[],"data":[],"stats":{"contains_updates":true,"nodes_created":14,"nodes_deleted":0,"properties_set":14,"relationships_created":14,"relationship_deleted":0,"labels_added":14,"labels_removed":0,"indexes_added":0,"indexes_removed":0,"constraints_added":0,"constraints_removed":0},"plan":{"root":{"operatorType":"EmptyResult","runtime-impl":"INTERPRETED","planner-impl":"RULE","DbHits":0,"Rows":0,"version":"CYPHER 2.3","planner":"RULE","runtime":"INTERPRETED","identifiers":[],"children":[{"operatorType":"Merge(Into)","ExpandExpression":"(u)-[ UNNAMED210:Follows]->(me)","Rows":14,"DbHits":57,"identifiers":[" UNNAMED210","f","me","u"],"children":[{"operatorType":"UpdateGraph","DbHits":70,"Rows":14,"UpdateActionName":"MergeNode","LegacyExpression":"f","Index":":User(login)","identifiers":["f","me","u"],"children":[{"operatorType":"Eager","Rows":14,"DbHits":0,"identifiers":["f","me"],"children":[{"operatorType":"UNWIND","Rows":14,"DbHits":0,"identifiers":["f","me"],"children":[{"operatorType":"SchemaIndex",
/***
Copyright (c) 2016, Alexander Choporov aka CoolCmd
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDE
function select_keywords(r, emit) {
try{
var package=JSON.parse(r.content);
(package.keywords || []).forEach(function(keyword){
emit({keyword : keyword});
});
}
catch(ex){
}
{
"name": "pokemon",
"version": "0.7.0",
"description": "Get Pokémon names",
"license": "MIT",
"repository": "sindresorhus/pokemon",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
function extract_package_name(r, emit) {
var output = Object.assign(r);
try{
var package=JSON.parse(r.content);
emit(Object.assign({}, r, {name : package.name}));
}
catch(ex){
emit(Object.assign({}, r, {name : 'JSON_ERROR'}));
}
}