让我们回顾一下"docx"和"pictures"之间的关系:
据我了解,*.docx存储原始图片(将图片复制/粘贴到Word中时的图片).每次使用该图片时,Word都会对原始图片进行"链接".
但是,如果您对该图片进行一些更改(例如调整大小,裁剪或更改颜色)Word会记住您的更改,修改"链接"(添加一些特殊标记).这很棒,因为你永远不会失去你的画面质量!
让我们从*.docx文件中获取图片.为此,我使用此代码段:
XWPFDocument wordDoc = new XWPFDocument( pathToFile );
for (XWPFParagraph p : wordDoc.getParagraphs()) {
for (XWPFRun run : p.getRuns()) {
for (XWPFPicture pic : run.getEmbeddedPictures()) {
byte [] img = pic.getPictureData().getData()
File outputfile = new File ( pathToOutputFile );
BufferedImage image = ImageIO.read(new ByteArrayInputStream(img));
ImageIO.write(image , "png", outputfile);
}
}
}
Run Code Online (Sandbox Code Playgroud)
但是这样我从*.docx获得原始图片.例如,如果您从图片中裁剪出一个部分并给我剩下的部分,那么我总能找到整个图像outputfile.这不好.
有谁知道如何通过Word中有人对其进行的所有更改来获取图片?
我在云CRM Dynamics 365中安装托管包时遇到了问题.由于我无法跟踪问题,因此很头疼.
让我解释一下要点:
我已false为所有组件设置了可自定义
我已经在Sandbox模式下注册了插件.我使用插件注册工具获取许可证和其他一些功能.
我试过两种方法.
第一:当我第一次尝试安装时,我从工作流程中获得了未处理状态.
第二:为解决上述问题,我尝试删除许可证处理相关组件.现在我从更新销售订单的插件组件中获取未处理状态.
最糟糕的是我没有在日志文件中收到任何错误消息或错误代码.
最后,这里有几个日志.有人可以提出解决方案吗?
--------------------------------------------------------------------------------------------------------
AsynchronousProcessingService Failed to add the item to the sync item collection for the mailbox : {8CBF53D0-896B-E611-80F2-FC15B4288714}. Exception details : Unhandled Exception: Microsoft.Crm.CrmArgumentException: Invalid input.
at Microsoft.Crm.Asynchronous.EmailConnector.ExchangeItemFinder.AddItemToSyncItemChangeInfoCollection(Item item, String itemId, SyncItemChangeType itemChangeType, ItemObjectType itemObjectType, String crmId)
Inner Exception: System.ArgumentException: Invalid input.
AsynchronousProcessingService Failed to add the item to the ItemFinder sync error collection for the mailbox : {8CBF53D0-896B-E611-80F2-FC15B4288714}. Exception details : Unhandled Exception: Microsoft.Crm.CrmArgumentException: Invalid input.
at …Run Code Online (Sandbox Code Playgroud) 我是协议缓冲区和C++的新手,所以这可能是一个基本问题,但我没有找到答案的运气.基本上,我想要在我的.proto文件中定义的字典的功能,如enum.我正在使用协议缓冲区来发送数据,我想定义单位及其各自的名称.一个enum允许我定义单位,但我不知道如何将人类可读的字符串映射到那个.
作为我的意思的一个例子,该.proto文件可能看起来像:
message DataPack {
// obviously not valid, but something like this
dict UnitType {
KmPerHour = "km/h";
MiPerHour = "mph";
}
required int id = 1;
repeated DataPoint pt = 2;
message DataPoint {
required int id = 1;
required int value = 2;
optional UnitType theunit = 3;
}
}
Run Code Online (Sandbox Code Playgroud)
然后有类似创建/处理消息的东西:
// construct
DataPack pack;
pack->set_id(123);
DataPack::DataPoint pt = pack.add_point();
pt->set_id(456);
pt->set_value(789);
pt->set_unit(DataPack::UnitType::KmPerHour);
// read values
DataPack::UnitType theunit = …Run Code Online (Sandbox Code Playgroud) 我正在尝试并排绘制同一图像的两个版本。当我绘制其中一张图像没有颜色条的图形时,它似乎具有正确的尺寸:

但是当我向左侧图像添加颜色条时,它会以某种方式缩小图像:

这是我注释掉颜色条行的代码:
def plot_amaps(self, anisotropy_map, parallel):
timepoint = self.t * self.timestep
amap_directory = self.directory + "amaps/"
fig = plt.figure(facecolor='w', dpi=180)
ax1 = fig.add_subplot(121)
fig.subplots_adjust(top=0.85)
ax1.grid(False)
txt = "Mean(r) = %.3f SD(r)= %.3f t=%dmin"
txt = txt %(self.mean, self.sd, timepoint)
ax1.set_title(txt)
amap = ax1.imshow(anisotropy_map, cmap="jet", clim = self.clim)
#divider = make_axes_locatable(ax1)
#cax = divider.append_axes('right', size='5%', pad=0.05)
#fig.colorbar(amap, cax=cax)
ax2 = fig.add_subplot(122)
ax2.set_title("Intensity image", fontsize=10)
ax2.imshow(parallel, cmap="gray")
ax2.grid(False)
ax1.axis('off')
ax2.axis('off')
if self.save is True:
self.make_plot_dir(amap_directory)
name = self.cell + "_time_"+str(timepoint)
plt.savefig(amap_directory+name+self.saveformat, …Run Code Online (Sandbox Code Playgroud) 打开应用程序后,它会跳转到辅助功能设置。但onServiceConnected在我打开我的AccessibilityService(称为VoiceService)后,不会调用 。
你能告诉我我该怎么办吗?VoiceService尽管我在 XML 中启用了它,但它似乎无法启动。或者我需要以不同的方式将 theMainActivity与 the绑定?VoiceService
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.wang.hearexpr">
<uses-permission
android:enabled="true"
android:name="android.permission.BIND_ACCESSIBILITY_SERVICE"/>
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service android:name=".VoiceService"
android:enabled="true"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE"
android:label="@string/service_name">
<meta-data
android:name="android.accessibilityservice"
android:resource="@xml/voice_config"/>
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService"/>
</intent-filter>
</service>
</application>
</manifest>
Run Code Online (Sandbox Code Playgroud)
语音配置.xml
<?xml version="1.0" encoding="utf-8"?>
<accessibility-service
xmlns:android="http://schemas.android.com/apk/res/android"
android:description="@string/service_description"
android:packageNames="com.example.wang.hearexpr"
android:accessibilityEventTypes="typeAllMask"
android:accessibilityFlags="flagDefault"
android:accessibilityFeedbackType="feedbackSpoken"
android:notificationTimeout="100"
android:canRetrieveWindowContent="true"
android:canRequestTouchExplorationMode="true"
android:settingsActivity="com.example.android.accessibility.ServiceSettingsActivity"/>
Run Code Online (Sandbox Code Playgroud)
语音服务.java
package com.example.wang.hearexpr;
import android.accessibilityservice.AccessibilityService; …Run Code Online (Sandbox Code Playgroud) 我刚刚问了 这个问题,并决定在我的协议缓冲区中编写枚举值的扩展。然而,即使使用这个简单的 .proto 文件,我在实际读取值时也遇到了极其困难的情况:
package test;
import "google/protobuf/descriptor.proto";
extend google.protobuf.EnumValueOptions {
optional string abbr = 54321;
}
message Person {
required string name = 1;
required int32 id = 2;
optional string email = 3;
enum PhoneType { MOBILE = 0 [(abbr)="Mobile ph"]; HOME = 1 [(abbr)="HomePhone"]; WORK = 2 [(abbr)="Work number"]; }
message PhoneNumber {
required string number = 1;
optional PhoneType type = 2 [default = HOME];
}
repeated PhoneNumber phone = 4;
}
message AddressBook { …Run Code Online (Sandbox Code Playgroud) 我有一个基于Spring的应用程序,它有一个后台轮询服务在一个单独的线程中运行,以更新database(EmployeeStatusPollService)中的数据状态.我使用JPA(Hibernate供应商)作为存储库.我在两个解决方案中实现了这项服务,但只有一个解决方案有效 以下是两种解决方案.
解决方案1:checkAndUpdateStatus其他服务类和poll服务中的事务方法调用它
@Service
public class EmployeeStatusPollService implements Runnable {
@Inject
private EmployeeService employeeService;
private static final int DEFAULT_PAGE_SIZE = 300;
private boolean flag = true;
public EmployeeStatusPollService() {
}
@PostConstruct
public void start() {
SimpleAsyncTaskExecutor executor = new SimpleAsyncTaskExecutor();
executor.setConcurrencyLimit(SimpleAsyncTaskExecutor.NO_CONCURRENCY);
executor.execute(this);
}
public void run() {
while(flag) {
try {
int pagenum = 1;
List<Employee> items = null;
do {
items = employeeService.checkAndUpdateStatus(pagenum, DEFAULT_PAGE_SIZE);
} while(items != null && items.size() == DEFAULT_PAGE_SIZE);
} catch(Exception ex) …Run Code Online (Sandbox Code Playgroud) 我是C的新手,我遇到了字符串问题.我想要做的是在循环中创建一个像"val1,val2,val3"的字符串.
目前我的代码看起来像:
char tagstr[60] = "";
int k;
int n = 5;
for (k=0; k < n; k++) {
char temp[10] = "";
sprintf(temp, ", val%d", k);
strcat(tagstr, temp);
}
Run Code Online (Sandbox Code Playgroud)
但是tagstr的输出是",val#",其中#是一些长整数值.我猜这里我的指针做错了但是我已经尝试了一切我能想到的但没有成功......任何帮助都会非常感激.
编辑:更多上下文,如果它有帮助:
int tagsClosed = strlen(pch1) - strcspn(pch1, ")");
do {
if (curTag.size > 0) {
// problem section
char tagstr[60] = "";
int k;
for (k = 0; k < 5; k++) {
char temp[10] = "";
sprintf(temp, ", val%i", temp, k);
strcat(tagstr, temp);
}
// This prints out …Run Code Online (Sandbox Code Playgroud) 最近我升级到xcode 8.我已经配置了通用链接,并且在我发布基于xcode 8的新版本之前一直工作正常.
令人惊讶的是,当我在模拟器中测试时,通用链接工作 - 我可以按右上角,然后在Safari中打开 - 再次我按右上角,它显示我打开应用程序的OPEN横幅.同时点击电子邮件中嵌入的URL也可以.
但是我无法在我的设备上打开应用程序中的任何链接.我的应用名称是kabuter和apple-app-site-association文件一样https://www.kabuter.com/.well-known
我检查并确认我的应用版本包含授权文件(其中包含applinks条目).
在apple appsearch-validation-tool中,我得到:
链接到应用程序
需要采取的行动
无法提取Universal Links所需的信息.了解如何实施推荐的通用链接.
提取的数据
错误没有具有域权利的应用程序用于验证深层链接双重身份验证的权利数据来自当前发布的应用程序版本.此数据可能需要48小时才能更新.
branch.io验证器https://branch.io/resources/universal-links/通过所有测试.
当我将设备连接到xcode时,我也会在日志中看到这个:
logging for process kabuter
2016-10-12 19:48:27.247786 kabuter[619:90471] WF: _userSettingsForUser mobile: {
filterBlacklist = (
);
filterWhitelist = (
);
restrictWeb = 1;
useContentFilter = 0;
useContentFilterOverrides = 0;
whitelistEnabled = 0;
}
2016-10-12 19:48:27.248052 kabuter[619:90471] WF: _WebFilterIsActive returning: NO
Run Code Online (Sandbox Code Playgroud)
有没有人遇到这个问题并找到解决方案?有什么指针吗?
我需要从头文件中提取一些信息,并且需要从如下字符串中获取站点名称:
0008 0080 LO Institution Name Site Name Here
Run Code Online (Sandbox Code Playgroud)
问题是网站名称也包含空格。我想到的唯一可行的方法是将行保存为字符串,然后在一定数量的字符后将站点名称作为字符串获取,如下所示:
回声 ${行:50}
但我想要更优雅的东西。
我刚刚注意到它还删除了Institution Name和之间的多个空格Site Name。
java ×3
image ×2
string ×2
android ×1
apache-poi ×1
bash ×1
c ×1
c++ ×1
colorbar ×1
dictionary ×1
docx ×1
dynamics-crm ×1
ios ×1
matplotlib ×1
plot ×1
python ×1
service ×1
spring ×1
xcode8 ×1
xwpf ×1