This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void testReplaceDocument() { | |
MongoCollection<Document> artists = testDb.getCollection("artists"); | |
Bson queryFilter = new Document("_id", band1Id); | |
Document myBand = artists.find(queryFilter).iterator().tryNext(); | |
Assert.assertEquals( | |
"Make sure that the band created in the database is" | |
+ " the same as the band retrieved from the database", | |
bandOne, | |
myBand); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private fun generateInputStream(): InputStream { | |
val bytesOutputStream = ByteArrayOutputStream() | |
val out = ZipOutputStream(bytesOutputStream, Charset.defaultCharset()) | |
val writeEntry = ZipEntry("test.csv") | |
out.putNextEntry(writeEntry) | |
out.write("content".toByteArray()) | |
out.closeEntry() | |
out.close() | |
return ByteArrayInputStream(bytesOutputStream.toByteArray()) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.examples | |
import com.beust.klaxon.JsonArray | |
import com.beust.klaxon.JsonObject | |
import com.beust.klaxon.Parser | |
import com.examples.DownloadPodcast.Companion.NEXT_PUB_DATE_PUNTA_NORTE | |
import com.examples.DownloadPodcast.Companion.URL_PUNTA_NORTE | |
import java.io.BufferedInputStream | |
import java.io.File | |
import java.io.FileOutputStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<android.support.v7.widget.Toolbar | |
xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:app="http://schemas.android.com/apk/res-auto" | |
android:id="@+id/toolbar" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:background="?attr/colorPrimary" | |
android:minHeight="?attr/actionBarSize" | |
app:contentInsetLeft="0dp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.adiaz.expandablelist; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.BaseExpandableListAdapter; | |
import android.widget.TextView; | |
import java.util.List; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Now that we can declare tasks, it's time to think about the relationships | |
between tasks. For example, in a Java build, we can't JAR up our library | |
before compiling our sources. We model these relationships by task | |
dependencies and ordering. | |
We'll discuss three ways to configure the relationships between tasks: | |
`dependsOn`, `finalizedBy`, and `mustRunAfter`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright (C) 2016 The Android Open Source Project | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 | |
* | |
* Unless required by applicable law or agreed to in writing, software |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.sunshine.app"> | |
<application> | |
<activity>...</activity> | |
<provider | |
android:name=".data.WeatherProvider" | |
android:authorities="com.example.android.sunshine.app" | |
android:enabled="true" | |
android:exported="true" | |
android:permission="com.myapp.OhhhhDiosito"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ForecastCursorAdapter extends CursorAdapter { | |
public ForecastCursorAdapter(Context context, Cursor cursor, int flags) { | |
super(context, cursor, flags); | |
} | |
/** Remember that these views are reused as needed. */ | |
@Override | |
public View newView(Context context, Cursor cursor, ViewGroup parent) { | |
return LayoutInflater.from(context).inflate(R.layout.list_item_forecast, parent, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.android.sunshine.app; | |
import android.support.v4.app.Fragment; | |
import android.support.v4.app.LoaderManager; | |
import android.support.v4.content.CursorLoader; | |
import android.support.v4.content.Loader; | |
public class ForecastFragment extends Fragment implements LoaderManager.LoaderCallbacks<Cursor> { | |
NewerOlder