id stringlengths 5 11 | text stringlengths 0 146k | title stringclasses 1
value |
|---|---|---|
doc_23530400 | redirect(base_url().'user/login/?redirect=site/cart_steps/steps');
and it works fine in localhost and when i uploaded it to server it didnt redirect. I checked all the codes and above this all code executes. But when it comes to redirect the page doesnt redirects. I also tried
redirect(base_url().'user/login?redirect=... | |
doc_23530401 | I want to do this:
date_num = '09'.gsub(/<match the zero>/, '')
date_num = '20'.gsub(/<same expression should not match the zero>/, '')
What is the best way of doing this in Ruby?
A: You can use a negative look-behind to prevent a match on zeros that are preceded by a non-zero digit. This does not require the numeri... | |
doc_23530402 | Does anybody know?
Exception:
W/BugSenseHandler(2881): Transmitting ping Exception Connect to /168.63.83.24:443 timed out
A: It means the app can't connect to the IP 168.63.83.24 on port 443 (which is usually for HTTPS), it times out before it's able to connect.
| |
doc_23530403 | I have downloaded the framework and moved to the webroot(in linux), and execute the command "yiic webapp ../../testapplication".
But i got the error as "command not found".
Install YII framework in xampp for ubuntu
I have followed these steps. But I couldn't succeed.
Please help me on this.
A: You need to run
./yiic
... | |
doc_23530404 | pattern = next(p for p in pattern_list if p.method(input))
However, in my application it is common that there is no such p for which p.method(input) is true, and so this will raise a StopIteration exception. Is there an idiomatic way to handle this without writing a try/catch block?
In particular, it seems like it wo... | |
doc_23530405 | The main problem I have is that the values comes in different data types, so the INT does not return as a string.
Is there a simple way to do it? or do I have to look at the examples where you create custom converter?
dynamic data = table.CreateDynamicInstance();
var jsonBody = Newtonsoft.Json.JsonConvert.SerializeObj... | |
doc_23530406 | We have the functionality to capture screenshots but after the package upgrade facing an error while screenshot capture. I am using webview to render view in the electron application.
Here is the code how I am using to load view in webview.
const webview = <webview src="path" class="webview__3kBDE" style="width: 768px;... | |
doc_23530407 | Building on the previous update, I think I have a better insight into doing this, but I need the answer to this question. In the current for loop there is a variable named tstring. I need to do a something like the following, but it does not work. I get the error Collection expression type 'NSString *' may not respond... | |
doc_23530408 | In order to aggregate by days I've tried these two ways:
aggregate(myzoo,format((index((myzoo)),"%Y-%m-%d")),sum)
aggregate(myzoo,as.Date(index(myzoo)),sum)
I don't know why they don't give the same output.
myzoo series had the weekends removed. The "as.Date way" seems to be OK but the "format way" aggregation giv... | |
doc_23530409 |
A: If the UUID has changed, you can't use svn relocate. The safest thing to do is to check out a fresh working copy, then copy your changes over to it and commit them. Otherwise, see these search results for some ideas about how to do it. Warning: it involves mucking with the contents of your .svn directory, which is ... | |
doc_23530410 | df <- data.frame (Year = c("2010", "2010", "2010", "2010", "2011","2011","2011","2011","2012","2012","2012","2012","2013","2013","2013","2013"),
Sale = c(100,200,50,500,400,200,400,145,100,456,345,321,100,200,250,400),
Group = c("A", "B", "C", "D","A", "B", "C", "D","A", "B", "C"... | |
doc_23530411 | I would like to restrict the maximum file size which can be uploaded, and although I can do a client-side validation on the file-size, a pure client-side solution is not very robust and I would like to add a server-side validation as well. Is it possible to do this using IAM roles for the "S3:PutObject" action?
A: You... | |
doc_23530412 | ||
doc_23530413 | <input type="text" ng-model="selected" typeahead="item.state for item in states" typeahead-editable="false" />.
The control works in that it retrieves a list from the web service and when the user selects the state it populates the text input correctly and stores the state name in the $scope.selected variable. Howeve... | |
doc_23530414 | What it has done is prepended the local Servers work directory to the front of the Path it had me choose.
I feel this is a Bug or how am I suppose to get the most current copy of a script in TFS when the Build Definition runs.
A: Tried with a simple powershell script on my side, but couldn't reproduce your issue, the... | |
doc_23530415 | When my SyncAdapter finished syincing i post a message into the message bus:
EventBus.getDefault().post(new EventMessagesRefreshed());
In my target class i do the following:
@Subscribe
public void onEvent(EventMessagesRefreshed event) {
this.init();
}
And in my init() i create the adapter for the recyclerview and... | |
doc_23530416 | In my line containing -> var result = csvParser.ReadFromString(csvReaderOptions, ReadCsvFile().ToString()).ToList();
^^I have tried taking out the '.ToString' and then placing 'await' in front of 'ReadCsvFile()'. An error then pop up in debug saying there is a 'CsvFileMapping Error = ,'
public async Task<IActionResult>... | |
doc_23530417 | class SomeViewModel
{
public SomeViewModel(SomeService service)
{
service.SetViewModel(this); // <- Move this call to Autofac
}
}
class SomeService
{
public void SetViewModel(object viewModel)
{
//...
}
}
Instead of manually calling service.SetViewModel in every ViewModel, I w... | |
doc_23530418 | Sarah Smith 1234566 UK
Homer Simpson 3456677 USA
Max Power 4567932 Canada
Meg Griffin 5689321 USA
Sarah Smith 345677 USA
So I wanna exctract all data for one person be in a worksheet, so Sarah Smith has her own worksheet that shows her info, homer simpson has his own that shows his ... | |
doc_23530419 | Here is my GetApiToken class with the ApiToken function
class GetApiToken {
public func ApiToken(link: String, completionBlock: @escaping (String) -> Void) -> Void
{
let url = URL(string: link)!
let jsonDict = ["username": "snow", "password": "ssssssssss"]
let jsonData = try! JSONSer... | |
doc_23530420 | function update_data(storedata)
{
obj.onclick=function() {remover(this,storedata); };
}
Not able to access storedata within the inner function.
When I try using alert(obj.onclick) the result comes out to be remover(this,storedata). It seems the variable is not been replaced by its value!!
Any Ideas?
A: It is "rep... | |
doc_23530421 | How can I keep the display awake as long as the video chat is active?
A: You can use the org.chromium.power plugin. To install it, run:
cordova plugin install org.chromium.power
When the video chat starts, use the requestKeepAwake API:
chrome.power.requestKeepAwake('display');
When the video chat ends, use the relea... | |
doc_23530422 | export const actFetchMealsRequest = () => {
return (dispatch) => {
return callApi('/Product', 'GET', null).then(res => {
dispatch(GetAllMeal(res.data));
});
}
}
/*GET_ALL_MEAL*/
export function GetAllMeal(payload){
return{
type:'GET_ALL_MEAL',
payload
}
}
A... | |
doc_23530423 | function invokeGraphApi() {
// #4: Get an access token to the Microsoft Graph API
authContext.acquireToken(azurePorperties.endpoints.graphApiUri,
function (error, token) {
// TODO: Handle error obtaining access token
if (error || !token) {
displayAlert('danger',... | |
doc_23530424 | func showSearchBar(searchBar: UISearchBar, navigationItem: UINavigationItem) {
searchBar.alpha = 0
navigationItem.titleView = searchBar
searchBar.showsCancelButton = true
navigationItem.setRightBarButtonItem(nil, animated: true)
for subView in searchBar.subviews {
for subsubView in subVi... | |
doc_23530425 |
Server Error in '/DatingGridView' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: Could not load file o... | |
doc_23530426 |
A: I appreciate this tutorial, perhaps can help you:
http://nhforge.org/blogs/nhibernate/archive/2008/09/17/value-objects.aspx
The author explain the concept of value object, using them like components.
A: That helped me a lot maybe you should try.
A: Here is a 4-part blog posting about FluentNHibernate. Not sure e... | |
doc_23530427 | Example:
class loadFile{
function loadObject($object){
//load object here
}
}
$loadmefiles = new loadFile();
//use $loadmefiles->loadObject() as autoloader
spl_autoload_register();
$goat = new Animal('goat');
Hopefully you understand what I am getting at.
A: This is done by passing an array to spl_autolo... | |
doc_23530428 | name: CI
on:
push:
release:
types: [published]
jobs:
test:
runs-on: ubuntu-latest
steps:
# ...
deploy-staging:
runs-on: ubuntu-latest
needs: test
if: github.event_name == 'push' && github.ref == 'staging'
steps:
# ...
I went through the following steps:
*
*Make some ... | |
doc_23530429 | The files have certain columns with DATE datatype (yyyy-mm-dd).
The pipeline runs fine but inserts NULL into all the Date type columns.
A: The DATE values may be getting written to Parquet as int64 with a timestamp logical type annotation (https://github.com/apache/parquet-format/blob/master/LogicalTypes.md#timestamp)... | |
doc_23530430 | So, this code right here works just fine, the pygame window is present, and you can close it by pressing X button:
#pygame initialization code and etc.
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
#code for drawing stuff out
... | |
doc_23530431 | I wish to learn a Cox PH model on in-sample data and then use the parameters derived on out of sample data as follows:
# learn IS params
model.PH <- coxph(Surv(days.IS, outcome.IS) ~ predictor.IS)
# apply IS params to OOS data to make predictions
predictions.raw <- predict(model.PH, newdata = predictor.OS)
# binarise... | |
doc_23530432 | string sChar = "$$VIC123-456-789pppEEX";
I would like to parse the above examples of sChar to result in the following value
123-456-789
What this regex would do is find the first Number in the string as well as the next 10 characters. The next 10 characters can be special characters, alpha, or numberic.
A: Here the ... | |
doc_23530433 | Here's my code:
PImage floorImage;
void setup() {
size(1200, 600, P3D);
smooth(8);
floorImage = loadImage("floor3.png");
}
void draw() {
background(0);
ambientLight(255,255,255);
camera(0.0,100.0,-300.0,mouseX-width/2.0,-(mouseY-height/2.0),0.0,0.0,-1.0,0.0);
for(int x=-20;x<20;x++)
{
for(int z=... | |
doc_23530434 | The first two items (blue column and green column) are 50% width each and stretch to fill the screen.
See picture:
HTML:
<div id='container-row'>
<section class='container-column pic-bkg'>
<nav id='main-nav'>
<ul id='main-nav-list'>
<li>Home</li>
<li>Link</li>
<li>Link</li>
... | |
doc_23530435 | main program
use my_module
call my_subroutine()
end program main
module my_module
contains
subroutine my_subroutine()
print *, "Hello World!"
end subroutine my_subroutine
end module my_module
When I try to compile this file I get:
Fatal Error: Can't open module file 'my_module.mod' for reading at ... | |
doc_23530436 | ServerDetails servers = ConfigurationManager.GetSection("serverDetails") as ServerDetails;
var server = from s in servers
where s.Name == serverName
select s;
I get the error:
Could not find an implementation of the query pattern for source type
'MyNamespace.ServerDetails'. 'Where' not fou... | |
doc_23530437 | Thanks for any answers.
Bye
A: As it is this question is incredibly vague. Any more specifics you could add about what you are trying to accomplish would likely lead to a better answer.
I would think you can override onKeyDown or dispatchKeyEvent in your Activity and you'll get callbacks when a key on the keyboard is ... | |
doc_23530438 | <textarea readonly class="form-control prj-info"></textarea>
And my Jquery code:
$(".btn-get-prj-info").click(function () {
if ($('.edt-prj-code').val().length < 7) {
$("textarea.prj-info").html("ERROR");
}
else {
setTimeout(
function () {
... | |
doc_23530439 | server.R
library(shiny)
shinyServer(
function(input, output) {
output$species_table <- renderTable({ iris[iris$Species == input$species,] })
output$json <- RJSONIO::toJSON(iris[iris$Species == input$species,], byrow=T, colNames=T) # error line
}
)
ui.R
require(shiny)
specs = as.character(unique(iris$Speci... | |
doc_23530440 | library(TeachingDemos)
txtStart("command_split_1000/dir_1.txt")
files <- list.files(path="data/split_1000/dir_1", pattern="x*", full.names=TRUE)
total.coefs <- data.frame()
for (x in files) {
message('Running: ', x)
output <- tryCatch({
ulfasQTL::findSqtl(x, geneObjectName = "gene_after_preprocess", snpFile... | |
doc_23530441 | The trouble is that the column must exist to be referenced. However through the UI there doesn't appear to be any way to hide the column. You can set its width to 0 and the border around it has a de-emphasized look. Though it holds some width. And then if you need to add columns (because stupidly you deleted them w... | |
doc_23530442 | It's still pretty basic but I've managed to send and receive messages with a user Loged In with Spark and another at the emulator.
After some SO reading I decided to create a service for my XMPP connection that I bind to every Activity. I currently have three activities
*
*MainActivity ( user logIn and connection t... | |
doc_23530443 | Can't open /usr/local/share/GeoIP/GeoLite2-Country.mmdb.gz
The GeoIP directory exists in that location, and it already had some .dat files from other things I was trying with the GeoIP Python library, but the .mmdb.gz file is not present before or after running the command. Here's the configuration file I have in /usr... | |
doc_23530444 | This is how the date variable looks like
1.383160e+10
Is there a way to convert this format to datetime using Python?
I've tried various ways of using the datetime module and time module. But what I get is a date from the year 2408
# Here I'm using the float from the first row in the dataframe
time.gmtime(1383160... | |
doc_23530445 | Microsoft.Office.Interop.Word.Application objword = new Microsoft.Office.Interop.Word.Application();
objword.WindowState = Microsoft.Office.Interop.Word.WdWindowState.wdWindowStateNormal;
Microsoft.Office.Interop.Word.Document objDoc = objword.Documents.Add();
Microsoft.Office.Interop.W... | |
doc_23530446 | <SelectLocation city={cityValue} />
I use 2 JSON files. This is city1.json
[{"value":"city1","towns":[{"value":"town1_1"},{"value":"town1_2"}]}]
and city2.json
[{"value":"city2","towns":[{"value":"town2_1"},{"value":"town2_2"}]}]
'cityValue' is a string and is the index to determine the value of the array of JSON's ... | |
doc_23530447 | For example, When I run the stored procedure in sql server management studio:
CALL x_prodcedure 1,2
It outputs (not a rowset): Invalid ID/data
When I make the same call in php, no rowset data is found and errorinfo returns:
Array
(
[0] => 00000
[1] => 0
[2] => (null) [0] (severity 0) [(null)]
[3] => 0
[4] =>... | |
doc_23530448 | /Users/jday/.rvm/gems/ruby-2.0.0-p0@rails3.2/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require': /Users/jday/.rvm/gems/ruby-2.0.0-p0@rails3.2/gems/html5-0.10.0/lib/html5/inputstream.rb:305: too short escaped multibyte character: /^ (SyntaxError)
( [\xC2-\xDF][\x80-\xBF] ... | |
doc_23530449 | However, I would like to log some messages from those classes. So I have tried to use slf4j-api with the android binding. With the intention to provide the simple binding on my tests.
But the "test" module start with complaining that there are two slf4j binding in the classpath and that he is using the android-binding.... | |
doc_23530450 | Some facts:
*
*The balls are SKSpriteNode's.
*Each ball is a parent node that has a child node (an overlay with the opposite rotation of the ball to provide the illusion of lighting/shadow). So, we're talking about 2 nodes for each ball.
*The balls' textures are preloaded up front and stored in memory via textureNa... | |
doc_23530451 |
I am able to see the extra ListViewItems in Snoop(having Visibility as Collapsed), ListView too shifts the items upwards but it doesn't adjusts its height to remove the empty space!
I can surely say that this is happening due to VirtualizedStackPanel as changing the ItemsPanel to StackPanel solves the issue. Here is t... | |
doc_23530452 | @Component
@Order(1)
public class CarsFilter extends OncePerRequestFilter {
@Override
protected void doFilterInternal(HttpServletRequest httpServletRequest,
HttpServletResponse httpServletResponse,
FilterChain filterChain) throws ServletExc... | |
doc_23530453 | DateTimeZone timeZone = <Code that gets a TimeZone instance>
int offset = timeZone.getStandardOffset(new Date().getTime());
I'm wondering why the call to timezone.getStandardOffset() requires that a number of milliseconds be passed in. My suspicion is that this is to take into account historical variations in a time z... | |
doc_23530454 | Remove color gradient from scaled unit bitmap, the answer works with 1x1 pixel. How to achieve the same result with, for example, 2x2 pixels with red, blue, green and yellow colour, how to remove gradient in that case (stretched image) with SetPixel?
| |
doc_23530455 | Private timer As DispatcherTimer
Private CountUp As Integer
Public Sub DispatcherTimerSetup()
timer = New DispatcherTimer()
timer.Interval = New TimeSpan(0, 0, 1)
AddHandler timer.Tick, AddressOf timer_Tick
timer.Start()
End Sub
Private Sub timer_Tick(sender As Object, e As Object)
CountUp += 1... | |
doc_23530456 | I can use either one of them, but the problem is I can't set the collider on any of them mesh collider isn't working correctly.
The maze which was built by ProBuilder has mesh in the mesh collider component but my player still falls through.
If there is a better way please let me know. Thank you
I have convex ticked to... | |
doc_23530457 | class PersonController extends RestfulController<Person> {
static responseFormats = ['json', 'xml']
PersonController() {
super(Person)
}
}
However, now I want to add a search option to this. What is the Grails way of making this possible?
I thought of adding the following:
def search(Map params) ... | |
doc_23530458 | public RequestTest Test(string url)
{
var test = new RequestTest() { Url = url };
var sw = new Stopwatch();
var request = WebRequest.CreateHttp(test.Url);
request.AllowAutoRedirect = true;
request.Method = "HEAD";
request.UserAgent = "Accept-Language: en-US,en;q=0.5";... | |
doc_23530459 |
A: You could make them custom buttons in a TableLayout or use a GridView and incorporate it like a ListView
| |
doc_23530460 | columnvalues = List(df.columns.values)
['ColA','ColB','ColC','ColD','ColE']
rowData=df.loc[df['ColA']=='apple']
ColA ColB ColC ColD ColE
13 apple NaN height width size
I have columnValues, but if I could also row values I can easily use
dict(zip(colValues, rowValues)) method to create columnKey row... | |
doc_23530461 | Date A B C
01/04/2012 2 5 Y
05/04/2012 3 4 Y
06/05/2012 7 6 Y
09/05/2012 8 2 N
11/05/2012 1 4 Y
15/06/2012 5 4 Y
That continues on with more rows.
I want to plot a bar chart with date on the bottom axis converted to show just the month (i.e. April, May, July) and then on the y-... | |
doc_23530462 | i7-860 (12GB RAM, 120GB SSD) running Ubuntu 14.04 and MySQL 5.5 (OLD)
To a new machine:
i7-7560U (16GB RAM, 512GB SSD) running Ubuntu 16.04 and MySQL 5.7 (NEW)
Both machines have the same PHP configuration (7.1) and the out of the box MySQL configuration for their respective versions.
On the OLD machine, my phpunit tes... | |
doc_23530463 | @app.get("/movies/", response_model=schemas.Movie)
def read_movie_by_title(title: str, db: Session = Depends(get_db)):
db_movie = crud.get_movie_by_title(db, title=title)
return db_movie
@app.get("/movies/", response_model=List[schemas.Movie])
def read_movies(skip: int = 0, limit: int = 100, db: Session = Dep... | |
doc_23530464 | I can see that my get request is successfull and that data is retrieved from my backend however when rendering I get this error :
TypeError: startup.map is not a function
CardList
C:/personalworkspace/unicorn/front/src/components/CardList.js:30
27 |
28 | return (
29 | <div className="card list">
> 30 | ... | |
doc_23530465 |
GLEW=%THIRD_PARTY_ROOT%\GLEW
GLEW_1_5_5=%GLEW%\glew-1.5.5
GLEW_BIN_PATH=%GLEW_ROOT%\bin
GLEW_INCLUDE_PATH=%GLEW_ROOT%\include
GLEW_LIB_PATH=%GLEW_ROOT%\lib
GLEW_ROOT=%GLEW_1_5_5%
OSG=%THIRD_PARTY_ROOT%\OpenSceneGraph
OSG_2_8_3=%OSG%\OpenSceneGraph-2.8.3
OSG_BIN_PATH=%OSG_ROOT%\bin
OSG_INCLUDE_PATH=%OSG_ROOT%\include
... | |
doc_23530466 | For example my program wants the user to guess a number between 1-1000. My program works perfectly, except when the user inputs any other character other than a number it goes CRAZY. Anyways, I want it to check and make sure that the user is inputting numbers, not something silly. So I have been going in circles trying... | |
doc_23530467 | Does it have to do with strsep? I didn't use strtok because I want to catch the null tokens if the string consisted of ",," multiple delimiters with nothing in between them.
Since tempStr has malloced well over the necessary amount, it should be sufficient to as a *dest for strcpy. I have been stuck on this for hours. ... | |
doc_23530468 | Does Rails have the same structure as Java when testing If statements like:
IF text1 = text2 Then
... do something ...
Else
... do something ...
Thanks,
Nick
A: if text1 == text2
...
elsif text2 == text3
...
else
...
end
http://en.wikibooks.org/wiki/Ruby_Programming/Syntax/Control_Structures#if_expression
http... | |
doc_23530469 | Here's a snippet of the code I'm using:
for (int l = 0; l < tmxMap.Tilesets[k].Tiles.Count; l++)
// This line throws an error
if (tmxMap.Tilesets[k].Tiles[l].Properties != null)
// and if I remove the above line, this line throws an error
for (int m = 0; m < tmxMap.Tilesets[k].Tiles[l].Propertie... | |
doc_23530470 | plist = ['p5', 'p14', 'p23', 'p32', 'p41', 'p50', 'p59', 'p68', 'p77', 'p85', 'p95']
for pltcount in range(len(plist)):
plt.plot(data1[pltcount], np.exp(data2)[pltcount], marker='o', label=str(plist[pltcount]))
plt.legend()
plt.show()
This is using the plt.style.use('fivethirtyeight') to make the plots nicer. ... | |
doc_23530471 |
*
*Create an object
*Read in an enormous amount of data for that
*After calculating that object's score, print it out
*Delete the object from memory because each object has a lot of variables attributed to it
*Loop it 1000 times
It seems simple enough but after looking around I see things about destructors bu... | |
doc_23530472 | You can reproduce this error(?) when you often click the "Add button". The first view clicks, both messages were printed and some clicks later only the first listener further works.
Runnable example:
import javafx.application.Application;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import... | |
doc_23530473 | 1) File info :
Testval.txt :
10,10
2) Reading the file and storing the values into variable.
code :
val rangetab = spark.read.format("csv").option("header","false").option("inferSchema","true").load("s3a://clientbucket/Check/TestVal.txt")
val a = rangetab.first()
println(a)
Then i am getting out like (10,10). I wan... | |
doc_23530474 | When I try to add a Test target from the + button it asks me to choose a Target to be tested either A or B. my tests are the same on both targets.
This is where I am confused. How can I have same units tests across all targets? Thanks .
A: You can't have two host applications in single test target. You have to select... | |
doc_23530475 | This is my device:
vctl config get platform.driver registry_configs/33333.csv
That prints:
[
{
"Reference Point Name": "signal_payload",
"Volttron Point Name": "signal_payload",
"Units": "percent",
"Unit Details": "(default 0.0)",
"BACnet Object Type": "analogValue",
"Property": "presentValue"... | |
doc_23530476 | Would flatten help? Looks so to me, but I just cannot get it working. Take a look how far I am now at https://jqplay.org/s/6bxD-Wq0QE, anyone can make it working?
BTW,
*
*.data.search.edges[].node | {name, topics: ..|.topics?} works, but I want all topics from the same node to be in one array, instead of having sam... | |
doc_23530477 | There is an Access table that is displayed in the datagrid in wpf. I'm trying to change the data in wpf so that they write to the access table, but I get an error. Did by analogy with localdb Code below
var accessUpdate = $@"UPDATE ORDERS SET
email = @emailAccess,
product_number ... | |
doc_23530478 | >>> pattern = re.compile(r'^<HTML>')
>>> pattern.match("<HTML>")
<_sre.SRE_Match at 0x1043bc8b8>
>>> pattern.match("⇢ ⇢ <HTML>", 2) # ⇢ stands for whitespace character.
None
When we are using ^ metacharacter and matching pattern then any whitespace character at the beginning as given below doesn't ... | |
doc_23530479 | I have an activerecord People, with attributes a,b,c. How can I do indexing only when b equals "type1", not indexing otherwise?
Currently what I know is
def search_data
{
a:a,
b:b,
c:c,
}
end
A: A bit late but a teammate came up through this question earlier today and I think the topic deserves a mor... | |
doc_23530480 | e.g Table_A
col
------
aaa
bbb
aaa
ccc
e.g Table_B
aaa
ccc
ddd
bbb
and likewise similar data for Table_C. I want to have the following as the result:
aaa 3
bbb 2
ccc 2
ddd 1
Currently, I have this
select col, count(*) from Table_A UNION select col, count(*) from Table_B UNION select col, count(*) from Table_C group ... | |
doc_23530481 | I need to be able to find the WebView that Phonegap uses when it calls:
super.loadUrl("file:///android_asset/www/index.html");
I've tried creating a new WebView in the main.xml file and loading the index.html page into it which only causes a Null Pointer Exception.
Any help would be great.
///
Edit:
The code below... | |
doc_23530482 | The code works. However, it seems as though I'm repeating myself unnecessarily. In particular, the only operations that differs between the queue and the stack is the push operation (do we push new objects onto the front or the back of the list?). It seems as though there should be some way to define the common operati... | |
doc_23530483 |
*
*keras code of mean squared error use return mean -> 1 / N -> is N batchsize?
*keras code of categorical crossentropy use return reduce_sum -> 1. I remember categorical crossentropy also need divided by batchsize.
Please explain this.
This is code of mean squared error:
def mean_squared_error(y_true, y_pred):
... | |
doc_23530484 | Vertical viewport was given unbounded height.
I tried to use flexible on GridView it worked but I need to use GridView.Builder Specifically
and if I tried to wrap it with Flexible or specific height container it doesn't scroll ,any tips?
import 'package:flutter/material.dart';
class Products extends StatefulWidget {
... | |
doc_23530485 | I have a field with a currency ( € 245,78 ) and I can't read with my tool.
If I use this code:
$get_data_ab = utf8_encode($data->val(4,6,$sheet_def));
the result is:
¬ 246246246246.246246
If I use:
$get_data_ab = $data->val(4,6,$sheet_def);
the result is empty.
What is wrong? How can I charge the € values in a varia... | |
doc_23530486 | HTML
<body>
<canvas id="bg_canvas" width="" height=""></canvas>
</body>
jQuery
// Expand canvas to full viewport size
var vp_width = window.clientWidth;
var vp_height = window.clientHeight;
$("#bg_canvas").css({
"width" : vp_width,
"height" : vp_height
});
// Canvas Drawing
va... | |
doc_23530487 |
*
*The completion of a state inserts a "completion event" at the beginning of the event queue and the "completion transition" is thus only executed then the state machine is explicitly stepped, OR
*completion of a state immediately triggers the "completion transition" (and possibly subsequent "completion transition... | |
doc_23530488 | HTML:
<table width="700" align="center" class="ui-corner-bottom background_grey border_bottom_blue border_left_blue border_right_blue">
<tbody>
<tr>
<td valign="top"><table width="600" align="center" style="margin-top: 25px;" class="ui-corner-all background_white border_all_grey" id="line_items">
... | |
doc_23530489 | The above line of code statement shows false.
Even though 8 is an int.
How does this work?
I would like to know how is operator works in this case.
Thank you.
A: just a small mistake in your syntax. You should have written type(8) is int in your condition statement which is the correct syntax. type(object) returns the... | |
doc_23530490 |
List<String> objects = Arrays.asList(arr);
long northCount = (objects.contains("NORTH")) ? objects.stream().filter("NORTH"::contains).count() : 0;
long southCount = (objects.contains("SOUTH")) ? objects.stream().filter("SOUTH"::contains).count() : 0;
long eastCount = (objects.contains(... | |
doc_23530491 | var elem = document.getElementById('scroll-area'),
track = elem.children[1],
thumb = track.children[0],
height = parseInt(elem.offsetHeight, 10),
cntHeight = parseInt(elem.children[0].offsetHeight, 10),
trcHeight = parseInt(track.offsetHeight, 10),
distance = cntHeight - height,
mean = 50, /... | |
doc_23530492 | Up to now, I've set the TextLabel and DetailTextLabel text to be something really long (so that it'll take up the entirety of the width assigned to the blue labels), set the font to UIColor.Clear, and then taken their measurements each time they're rendered. That's horrible for lots of reasons, but it works in a fashio... | |
doc_23530493 | Is there a way to do this or am I ahead of my time?
A: I think you could use the debug mode to see all methods called
A: Run DEBUG in your IDE, your each step in application will move you to the right place in the code, during your program you can see each variable value.
Also you can follow each code line which you... | |
doc_23530494 | "Yowza, that’s a big file. Try again with a file smaller than 25MB."
My project folder size is in Kb's even not in Mb's.
A: Try and list all the files of your current repository, sorted by size.
Chances are, you have, by mistake, included one large binary.
| |
doc_23530495 | public class Item
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int ID { get; set; }
[Required]
[MaxLength(255)]
public string Name { get; set; }
[Required]
public ItemCategory Category { get; set; }
}
and an ItemCategory class:
public class ItemCategory
{
[Da... | |
doc_23530496 |
How can I recreate that font with the engraved look?
Thanks in advance for your help!
A: Simply set the shadow color to white:
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor clearColor];
label.shadowColor = [UIColor whiteColor];
label.shadowOffset = CGSizeMake(0.0, 1.0);
| |
doc_23530497 | Here is an example fiddle: https://jsfiddle.net/vn6t3nwd/
HTML:
<div id="timer-container">
<div id="timermode">up</div><div id="timermode">down</div>
<div id="timercontrol">stop</div>
<div id="timercontrol">go</div>
</div>
CSS:
#timer-container {
position: relative;
width: 100%;
padding-bottom: 56.25... | |
doc_23530498 | (document.getElementById("ipv") as HTMLInputElement).value;
instead of:
document.getElementById("ipv").value;
?
A: The function getElementById returns object with type HTMLElement.
From lib.dom.d.ts:
/**
* Returns a reference to the first object with the specified value of the ID or NAME attribute.
* @param eleme... | |
doc_23530499 | import pandas as pd
from matplotlib import pyplot as plt
n = 0.4
k = 53
d = 0.000264
r = 0.000132
p = 15000
u = (n/n+1)*(p*1/2*k)**(1/n)*(d**((n+1)/n) - r**((n+1)/n))
plt.plot(u)
Graph produced:
A: First off, note that (p*1/2*k) is a very confusing way to write a multiplication. In (about all) programming languages... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.