我正在尝试使用PHPExcel生成的Excel文档中设置单元格的宽度:
$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setWidth('10');
$objPHPExcel->getActiveSheet()->getColumnDimensionByColumn('C')->setAutoSize(false);
Run Code Online (Sandbox Code Playgroud)
但那不起作用.
我需要在这里打电话的方法是什么?
我可能需要修改.htaccess文件.问题是我找不到它.我们在vhosts目录中有几个子域,每个子域都有一个关联的.htpasswd文件.如何找到.htaccess文件的位置.
显然,我没有设置它,我当然不是一个unix管理员专家.
我有一个文件本地保存到应用程序的私有存储中.我已经验证它存在,但每当我调用BitmapFactory.decodeFile时它总是返回null.
如果我将文件保存为资源并使用ImageView setImageResource,它总是显示正常.
问题是什么?
这是片段:
filename = "test.png";
if (doesFileExist(filename))
Bitmap bMap = BitmapFactory.decodeFile(filename);
Run Code Online (Sandbox Code Playgroud)
我也尝试过:
Bitmap bMap = BitmapFactory.decodeFile(getFilesDir().getPath()
+ filename);
Run Code Online (Sandbox Code Playgroud) 我尝试打电话时遇到以下异常
var log = LogManager.GetLogger(this.GetType());
Run Code Online (Sandbox Code Playgroud)
Common.Logging.dll中发生了'Common.Logging.ConfigurationException'类型的第一次机会异常
Common.Logging.dll中发生了'Common.Logging.ConfigurationException'类型的无法处理的异常
附加信息:无法从配置部分'common/logging'获取Common.Logging的配置.
这是一个引用的.NET 4应用程序
我的app.config有以下内容:
<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<configSections>
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.Simple.ConsoleOutLoggerFactoryAdapter, Common.Logging">
<arg key="level" value="ALL" />
<arg key="showLogName" value="true" />
<arg key="showDataTime" value="true" />
<arg key="dateTimeFormat" value="yyyy/MM/dd HH:mm:ss:fff" />
</factoryAdapter>
</logging>
</common>
</configuration>
Run Code Online (Sandbox Code Playgroud)
我试着像这样打电话:
var log = LogManager.GetLogger(this.GetType());
log.Debug(m => m("testing"));
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我想知道是否有一种方法可以通过其字节范围来检测mojibake(无效)字符。(举一个简单的例子,检测有效的ascii字符只是看它们的字节值是否小于128)鉴于旧的自定义字符集,例如JIS,EUC,当然还有UNICODE,有没有办法做到这一点?
眼前的兴趣是在C#项目中,但是我想找到一种尽可能与语言/平台无关的解决方案,因此我可以在c ++,Java,PHP或任何其他语言中使用。
Arrigato
我有一个带有启动画面的应用程序,几秒钟后打开了具有WebView的主要活动.问题是,只有这样,主要活动才开始加载URL,有时需要几秒钟.双重等待似乎很愚蠢.但是,我尝试预加载WebView的尝试并不那么成功.
问题的实质是初始屏幕和主要活动是两个不同的活动,WebView是主要活动的资源绑定(布局).复制WebView(webview2 = webview1)不起作用,这并不奇怪.
建议?
我刚从默认(app.cs)模板创建了一个可移植的应用程序,没有更改任何代码(虽然我似乎必须更新Xamarin.Forms以修复启动异常)并运行它.我得到了这个(没有图标显示):
为了彻底,这里是代码(再一次,模板没有任何改变):
namespace App3
{
public class App : Application
{
public App()
{
// The root page of your application
var content = new ContentPage
{
Title = "App3",
Content = new StackLayout
{
VerticalOptions = LayoutOptions.Center,
Children = {
new Label {
HorizontalTextAlignment = TextAlignment.Center,
Text = "Welcome to Xamarin Forms!"
}
}
}
};
MainPage = new NavigationPage(content);
}
Run Code Online (Sandbox Code Playgroud)
Droid项目,主要活动:
[Activity(Label = "App3", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)] …Run Code Online (Sandbox Code Playgroud) 我有几个应用程序,主要根据资源不同.截至目前,我正在将代码复制到每个应用程序.这可能有问题.例如,将错误修复为一个,并忘记更新其他错误.
我不认为创建JAR适合这种情况,因为这些是特定于应用程序的UI类(实际上是特定的android活动类),包括实际的应用程序启动代码.
有可能将这些源文件包含在几个包中,但后来我遇到的问题是每个文件在第一行指定了一个特定的包名.
大多数代码都与UI和Activity处理有关.(实际的公共代码已经在库中).类似的问题发布在这里.这种情况有没有优雅的解决方案?
我有一个适当使用NSURLConnection的应用程序.这些异步调用最终完成并正确释放(看起来像),但有时需要一些时间才能完成.
因此,有时我退出应用程序(注意,不仅仅是发送背景),其中一些连接仍处于活动状态.如果我立即重启应用程序,应用程序会在启动时冻结.(didFinishLaunchingWithOptions似乎永远不会被调用).
虽然我不确定这些连接是否是问题,但终止或取消任何剩余的可能是好的.有关如何做到这一点的任何建议?
关于如何调试重启的奖励点也.(我已经将NSLog语句保存到可下载的文件中)
这应该是非常基本的,我只是不知道如何.我有一个显示页面的webView太长而无法一次显示.现在,它显示滚动条,但它不会真正滚动.它只是有点摆动,只是让你知道它是一个活跃的滚动条.
希望在xml布局中尽可能地让我根据需要滚动页面以显示整个页面.
我的xml布局文件:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<WebView
android:id="@+id/news_view"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
Run Code Online (Sandbox Code Playgroud)
onCreate电话:
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.news);
WebView webView = (WebView) findViewById(R.id.news_view);
webView.setVerticalScrollBarEnabled(true);
webView.loadUrl("http://www.example.com/index.html");
}
Run Code Online (Sandbox Code Playgroud) 我已经接管了一些旧的遗留JSP代码,并希望为它添加一些邮件支持.嗯,它没有那么顺利,因为我得到错误,例如:
Session cannot be resolved to a type
An error occurred at line: 39 in the jsp file: /xxxxx/test.jsp
Message cannot be resolved to a type
MimeMessage cannot be resolved to a type
Run Code Online (Sandbox Code Playgroud)
等等
代码,样品取自某处(不漂亮......):
<%@ page import="java.util.*" %>
<%@ page import="javax.mail.*" %>
<%@ page import="javax.mail.internet.*" %>
<%@ page import="javax.activation.*" %>
<%@ page session="true"%>
<html>
<head>
<title>JSP JavaMail Example </title>
</head>
<body>
<%
String to = "sssssss@gmail.com";
String from = "admin@yyyyyy.com";
String subject = "subject";
String messageText = "body";
Properties …Run Code Online (Sandbox Code Playgroud)