2015年06月

Controlling SSRS using TFS 2013

I am using TFS 2013 for source control and am trying to figure out how I can back store the source code for my reports on TFS. I want other users to be able to pull the source code to be able to modify a report or use it as the starting point for a new derivative.



I can't really seem to find any good solution for this problem.



Answers

You have to use Visual Studio 2013 together with SQL Server Data Tools - Business Intelligence for Visual Studio 2013.



This will give you the possibility to create SSRS projects in Visual Studio and add them to TFS source control.





Large mysql import progress drops to 20% after reaching nearly 90%

I have been trying to import a 60Gb sql file (mysql prompt reports 123Gb) to mysql. Its taking days for that import. I started with a simple import command.



Day1




mysql -u username -pPassword -h host db < db.sql




Day2
After a day to check status I ran



mysql> SELECT     Data_BB / POWER(1024,1) Data_KB,     Data_BB / POWER(1024,2) Data_MB,     Data_BB / POWER(1024,3) Data_GB FROM (SELECT SUM(data_length) Data_BB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql')) A;
+----------+--------------+--------------------+
| Data_KB | Data_MB | Data_GB |
+----------+--------------+--------------------+
| 120084976.196289062 | 120084.976196289062 | 120.084976196289062 |


+----------+--------------+--------------------+



Day3
I realized that I can also check `progress. On a separate prompt, I ran




ubuntu@ec2:~$ pv db.sql | sudo mysql -u username -pPassword -h host db




Day4
Today, when I checked,



The import terminal has broken connection




ubuntu@ec2:~$ pv db.sql | sudo mysql -u username -pPassword -h host db 10.5GB 14:38:43 [ 0B/s] [==========> ] 20% ETA 56:06:48




mysql> SELECT     Data_BB / POWER(1024,1) Data_KB,     Data_BB / POWER(1024,2) Data_MB,     Data_BB / POWER(1024,3) Data_GB FROM (SELECT SUM(data_length) Data_BB FROM information_schema.tables WHERE table_schema NOT IN ('information_schema','performance_schema','mysql')) A;
+----------+--------------+--------------------+
| Data_KB | Data_MB | Data_GB |
+----------+--------------+--------------------+
| 26303504 | 25687.015625 | 25.084976196289062 |
+----------+--------------+--------------------+


Question
Why would the progress suddenly become 25Gb, from 120Gb.





lumen - LengthAwarePaginator::resolveCurrentPage() is always 1

With lumen, I have the problem that this is always 1, also when I go to /artikel?page=2:



LengthAwarePaginator::resolveCurrentPage();


the complete code:



<?php namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Pagination\LengthAwarePaginator;
use Illuminate\Support\Collection;


class ArtikelController extends Controller {

public function index()
{
$dir = '../resources/views/artikel/';

$files = array_diff(scandir($dir), array('..', '.'));

$artikel = array();

foreach($files as $k => $v)
{
$id = substr($v,0,1);
$artikel[$id]['id'] = $id;
$artikel[$id]['name'] = substr($v,0,strpos($v,'.blade.php'));
}

//Get current page form url e.g. &page=6
$currentPage = LengthAwarePaginator::resolveCurrentPage();

#dd($currentPage);

//Create a new Laravel collection from the array data
$collection = new Collection($artikel);

//Define how many items we want to be visible in each page
$perPage = 2;

//Slice the collection to get the items to display in current page
$currentPageResults = $collection->slice($currentPage * $perPage, $perPage)->sortByDesc('id')->all();

//Create our paginator and pass it to the view
$paginatedResults = new LengthAwarePaginator($currentPageResults, count($collection), $perPage);

$paginatedResults->setPath('artikel');

return view('artikel', ['artikel' => $paginatedResults]);
}


I can't find the mistake. What could be the reason? (I have also updated to "laravel/lumen-framework": "5.1.*")



Answers

You can use this simple way to get your current page:



$currentPage = (int) app('request')->get('page', $default = '0');




Update data in ngDialog

I am using ngDialog in my project with data from my scope. I have a scope object named popupConge that I link to data of ngDialog :



ngDialog.open({ 
template: 'saisieCongeModalPanel',
className: 'ngdialog-theme-default width800',
data: $scope.popupConge,
scope: $scope,
});


The problem is that when I update $scope.popupConge, the data in my modal panel aren't updated.
For instance I have: <input type="text" id="motif" ng-model="ngDialogData.conge.motif"/> in my ngDialog. When I update $scope.popupConge.conge.motif, the input field isn't updated :s



Did I do something wrong ?



Thanks !



Answers

Since you are passing $scope to the dialog you should use the popupConge.conge.motif instead.



Try this.



<input type="text" id="motif" ng-model="popupConge.conge.motif"/>




CouchDB override a base JSON document

Is there a standard strategy (or agreed best-practice) in CouchDB for creating a JSON document that:




Is based on another document.
Contains a small number of JSON properties that represent overrides to the original document.


?



On receiving a request, CouchDB would calculate a result JSON document with the overrides applied and return it as a response. The user should not need to know or care that it's a composite document.



Answers

Thats a very good Question because you asking for the possibility AND best-practice. The answer is - it depends ;-)



Generally you can do it with a CouchDB _list. Par example you get two docs from the _view the _list is based on, calculate the composite doc and respond it. The downside is that this server-side computing is very performance relevant. Don't use it when your composite doc will be requested in e.g. every user session. But when your use-case is smth like e.g. a request from another service once every night that should be ok.



CouchDB will love you when you take an alternative approach which leads in result to the situation that the composite doc is ready-to-respond stored in an index.



If you want to store the composite doc exactly as it should be a CouchDB _update handler can be used. You get the custom properties of the doc in the payload and the default doc from the database, merge everything into the composite doc and store that under an unique id (or overwrite the default doc).



Last but not least you can also use two approaches which are based on CouchDB _view. Both will not deliver the composite doc but the default doc and the custom overwrites in one request. First approach is to build a view with a multipart key which groups the parent doc (default data) and the child's (overwrites) together - second approach is to create a view with linked data: emit the custom settings as value of the view row and overwrite the view row _id with the _id of the default doc. When the view row gets requested with the query param ?include_docs=true default data and custom overwrites will be included in the result.





↑このページのトップヘ