我尝试使用以下代码自定义.Net垂直进度条(使用Visual 2010):
<ProgressBar Name="VolumeMeter" Orientation="Vertical" Margin="4,30,0,0" Value="50" HorizontalAlignment="Left" VerticalAlignment="Top" Height="300" Width="10">
<ProgressBar.Template>
<ControlTemplate TargetType="ProgressBar">
<Border BorderBrush="Green" BorderThickness="1">
<Grid Name="PART_Track" Background="Red">
<Rectangle Name="PART_Indicator" Fill="Blue"/>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="Orientation" Value="Horizontal">
<Setter TargetName="PART_Indicator" Property="VerticalAlignment" Value="Stretch"/>
<Setter TargetName="PART_Indicator" Property="HorizontalAlignment" Value="Left"/>
</Trigger>
<Trigger Property="Orientation" Value="Vertical">
<Setter TargetName="PART_Indicator" Property="VerticalAlignment" Value="Bottom"/>
<Setter TargetName="PART_Indicator" Property="HorizontalAlignment" Value="Stretch"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ProgressBar.Template>
</ProgressBar>
Run Code Online (Sandbox Code Playgroud)
但是,它没有显示进展,有什么不对?
我按照https://developers.google.com/bigquery/authorization#service-accounts-appengine中的说明 从app引擎到bigquery进行了一些查询.
在第2步中,我点击Google Api控制台中的团队,然后重定向到App Engine>管理>权限.我将服务帐户名称添加为电子邮件,并选择我选择开发人员的角色("可以编辑"选项不可用),然后单击"邀请用户".之后,会显示一条消息:"已将电子邮件发送至xxxxxx@appspot.gserviceaccount.com进行验证." 状态为待定.我如何确认电子邮件?,似乎这里有一个错误...
接下来,我使用以下代码进行了测试:
#!/usr/bin/env python
import httplib2
import webapp2
from google.appengine.api import memcache
from apiclient.discovery import build
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from oauth2client.appengine import AppAssertionCredentials
# BigQuery API Settings
PROJECT_NUMBER = 'XXXXXXXX'
credentials = AppAssertionCredentials(scope='https://www.googleapis.com/auth/bigquery')
http = credentials.authorize(httplib2.Http(memcache))
service = build("bigquery", "v2", http=http)
class MainHandler(webapp2.RequestHandler):
def get(self):
query = {'query':'SELECT word,count(word) AS count FROM publicdata:samples.shakespeare GROUP BY word;',
'timeoutMs':10000}
jobRunner = service.jobs()
reply = jobRunner.query(projectId=PROJECT_NUMBER,body=query).execute()
self.response.out.write(reply)
app = webapp2.WSGIApplication([
('/', …Run Code Online (Sandbox Code Playgroud) google-app-engine authorization server-to-server google-bigquery
有一种方法可以在firebase-admin python sdk中添加服务器时间戳吗?我尝试:
firestore.SERVER_TIMESTAMP
firestore.constants.SERVER_TIMESTAMP
Run Code Online (Sandbox Code Playgroud)
但是,我得到这个例外:
TypeError: ('Cannot convert to a Firestore Value', <object object at 0x10380fc20>, 'Invalid type', <class 'object'>)
Run Code Online (Sandbox Code Playgroud)