正如任何普通开发人员所应该的那样,我喜欢手动,繁琐和重复的任务.最近我意识到 - 在众多git repos上创建拉取请求占用了我太多的时间.大多数时候你必须一遍又一遍地遵循几乎所有的步骤:
在某些时候,我开始想知道如果不使用Web客户端我是否可以做到这一切.而且似乎有可能.Stash和Bitbucket有一个api,Github也有一个(虽然它不同 - 第一个使用ssh而后者是http)
现在,这件事可能会简化一些事情,但我觉得它可能会更好.
我使用Emacs(Spacemacs发行版,具体而言).现在我想知道是否有人已经构建了任何与之集成的东西magit,或者我自己可以做到这一点?我的意思是它有多难?脚本应该允许您提交然后推送分支,然后使用给定的默认值创建基于该分支的"开发"的拉取请求.有人做过这样的事吗?
你们可以指点一些elisp利用magit相似功能的插件.也许我能够自己写点东西.
天哪!我讨厌这个.为什么这么复杂?
我正在做的事情:
我有一个带有几个UserControl的表单,每个UserControl都有一个DataGrid.每个网格都通过.ItemSource属性与ObservableCollection绑定,每当程序捕获一个事件时,它就会对其中一个隐含的集合进行更改.但是网格图片不会更新.
是否有类似ISNULL()或COALESCE()的东西,但不是检查空值而是空值.
例如:
SELECT cu.last_name, cu.first_name, cu.email, hu.email FROM
(SELECT DISTINCT c.first_name, c.last_name, c.email, c.household_id, h.head_of_household_id
FROM rd_customers c
JOIN rd_households h ON c.household_id = h.household_id
JOIN ad_registrations r ON r.customer_id = c.customer_id
JOIN ad_meeting_times a ON r.session_id = a.session_id and a.meeting_time_id = 203731) cu
LEFT JOIN rd_customers hu ON hu.customer_id = cu.head_of_household_id
Run Code Online (Sandbox Code Playgroud)
而不是返回四列我想得到三个,而第三个假设有cu.email或hu.email的值,如果第一个是EMPTY!ISNULL和COALESCE不在这里工作我不知道为什么
这到底是什么?MVC3的DropDownList中是否存在某种错误?SelectedValue未显示为在标记中实际选择的内容.
我正在尝试不同的方法,没有任何作用.
public class SessionCategory
{
public int Id { get; set; }
public string Name { get; set; }
}
public static IEnumerable<SessionCategory> Categories
{
get
{
var _dal = new DataLayer();
return _dal.GetSesionCategories();
}
}
@{
var cats = Infrastructure.ViewModels.Session.Categories;
var sl = new SelectList(cats, "Id", "Name",2);
}
@Html.DropDownList("categories", sl);
Run Code Online (Sandbox Code Playgroud) 如果我做对了,jQuery自动完成插件和jQuery UI自动完成小部件之间存在差异.哪一个更好,你建议使用?我支持第二个,但我不确定.
你能指点我几个示例代码片段吗?基本上我需要从动作方法中获取值.
我觉得很愚蠢,但我不得不承认,我需要你帮助的人似乎很容易找到合适的答案
public class Foo
{
public string Name { get; set; }
public string Time { get; set; }
public Foo(string name, string time)
{
Name = name;
Time = time;
}
}
var o = new List<Foo>
{
new Foo("Breakfast","9:00"),
new Foo("Lunch", "12:00"),
new Foo("Breakfast", "8:00")
};
Run Code Online (Sandbox Code Playgroud)
如何在9:00和午餐时享用早餐,而不包括8点的早餐?
我开始是这样的:
var a = o.GroupBy(x => x.Name);
Run Code Online (Sandbox Code Playgroud)
但它只会给你名字,我也需要时间.
是否可以仅使用Elements API在视图上创建按钮?
var root =
new RootElement ("LoginScreen"){
new Section ("Enter your credentials") {
new EntryElement ("Username", "Your user name", "user1"),
new EntryElement ("Password", "Your password", "", isPassword:true),
},
new Section () {
new RootElement ("Login"){
//Here should be a button
}
},
new Section () {
new BooleanElement ("Save your credentials", false),
},
};
var dv = new MainController (root, true){ Autorotate = true };
navigation.PushViewController (dv, true);
Run Code Online (Sandbox Code Playgroud)
我知道使用Reflection API可以实现OnTapAttribute,但我想知道如何使用Elements API.
当用户点击按钮时,它应推送另一个视图控制器...
为了上帝的缘故,有人告诉我如何在UIActionSheet上添加图片.
我正在添加它,但不能强制工作表重新拉伸其高度,因此Subview适合.
var sheet = new UIActionSheet ("Sheet with a picture");
sheet.AddButton ("Pick New Picture");
var subView = new UIView(new RectangleF(20,100,280,200)){
BackgroundColor = UIColor.FromPatternImage(Picture)};
sheet.AddSubview(subView);
sheet.AddButton ("Cancel");
sheet.CancelButtonIndex = 1;
Run Code Online (Sandbox Code Playgroud)
我试图改变subView和工作表的contentMode.没工作.我究竟做错了什么?

图片应该适合按钮之间,或者以某种方式通过任何其他方式适合在工作表上
我已经将一个背景图像应用到我的ViewController:
ParentViewController.View.BackgroundColor = UIColor.FromPatternImage (image)
Run Code Online (Sandbox Code Playgroud)
现在,当屏幕方向改变时,它会破坏我的整个背景,因为那张照片保持不变.当然我可以在Photoshop中旋转图像并将其放入我的项目中,但我对软件工程师的骄傲感到反感.
我搜索了很多来源.我尝试过Objective-c样本.我在c#中只发现了一些.我没有时间学习UIKit和Core Graphics之间的差异.我试过了CGContext.RotateCTM,我试过用它来实现CGAffineTransform.MakeRotation.它不起作用.我只需要做一件简单的事情.
显然在使用RotateCTM或改变之前,CGAffineTransform你必须以某种方式定义关键点.
请有人给我看一个简单的例子,它是如何工作的.
UPD:
这是我到目前为止所得到的:
var image = new UIImage ("Images/background.jpg");
if (interfaceOrientation == UIInterfaceOrientation.LandscapeLeft) {
CGImage imageRef = image.CGImage;
var width = imageRef.Width;
var height = imageRef.Height;
CGImageAlphaInfo alphaInfo = imageRef.AlphaInfo;
CGColorSpace colorSpaceInfo = CGColorSpace.CreateDeviceRGB ();
CGBitmapContext bitmap =
new CGBitmapContext (IntPtr.Zero, width, height, imageRef.BitsPerComponent, imageRef.BytesPerRow, colorSpaceInfo, alphaInfo);
bitmap.TranslateCTM(0, imageRef.Height);
bitmap.RotateCTM((float)-1.5707f);
bitmap.DrawImage (new Rectangle (0, 0, height, width), imageRef);
image = UIImage.FromImage (bitmap.ToImage());
bitmap …Run Code Online (Sandbox Code Playgroud) 抱歉,代码量很大,我无法用less来解释。基本上我正在尝试从许多任务中写入文件。你们能告诉我我做错了什么吗?_streamWriter.WriteLine()抛出ArgumentOutOfRangeException.
class Program
{
private static LogBuilder _log = new LogBuilder();
static void Main(string[] args)
{
var acts = new List<Func<string>>();
var rnd = new Random();
for (int i = 0; i < 10000; i++)
{
acts.Add(() =>
{
var delay = rnd.Next(300);
Thread.Sleep(delay);
return "act that that lasted "+delay;
});
}
Parallel.ForEach(acts, act =>
{
_log.Log.AppendLine(act.Invoke());
_log.Write();
});
}
}
public class LogBuilder : IDisposable
{
public StringBuilder Log = new StringBuilder();
private FileStream _fileStream; …Run Code Online (Sandbox Code Playgroud) parallel-processing multithreading task task-parallel-library c#-4.0
xamarin.ios ×3
c# ×2
c#-4.0 ×2
autocomplete ×1
background ×1
coalesce ×1
data-binding ×1
elisp ×1
emacs ×1
git ×1
ios ×1
isnull ×1
jquery ×1
jquery-ui ×1
linq ×1
magit ×1
pull-request ×1
sql ×1
task ×1
uiimage ×1
wpf ×1