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"?> | |
<ArrayOfQuestion xmlns="http://schemas.datacontract.org/2004/07/Abbyy.TranslationBattle.ObjectModels" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"> | |
<Question> | |
<Answers> | |
<Answer> | |
<AnswerDescriptions> | |
<AnswerDescription> | |
<Language>English</Language> | |
<Text>It is a long established fact that a reader will be distracted.</Text> | |
</AnswerDescription> |
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
class SearchActivity : AppCompatActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_search) | |
supportActionBar?.setDisplayHomeAsUpEnabled(true) | |
supportActionBar?.setHomeButtonEnabled(true) | |
val ft = supportFragmentManager.beginTransaction() | |
ft.add(R.id.search_container, EmptyFragment()).commit() |
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
{ | |
"totalCount":2, | |
"data":[ | |
{ | |
"orderNumber":"420107-21092016-274652", | |
"created":1474466614636, | |
"status":"WAIT_FOR_PAYMENT", | |
"statusUpdated":1474466614650, | |
"deliveryCost":249.0, | |
"paymentMethod":"OPS", |
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
// Contract | |
public interface IRepository<T> where T : class | |
{ | |
void Attach(T item); | |
T[] GetAll(); | |
T Get(int id); | |
void Add(T item); | |
void Update(T item); | |
void Remove(T item); |
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 class | |
public class ExampleClass | |
{ | |
public EventHandler TestEventHandler { get; set; } | |
} | |
// Entry point | |
class Program | |
{ | |
static void Main(string[] args) |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var mytype = new ExampleClass(); | |
var type = mytype.GetType(); | |
var metin = type.GetMethod("PrivateMethod", BindingFlags.Instance | BindingFlags.NonPublic); | |
metin.Invoke(mytype, null); | |
Console.ReadKey(); | |
} |
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
createdOrderDb.Add(new CreatedOrder() | |
{ | |
OrderNumber = "32323276677", | |
Status = OrderStatus.Accepted, | |
Products = new CreatedOrderProductInfo[] | |
{ | |
new CreatedOrderProductInfo() | |
{ | |
MarketplaceProductId = 323234, | |
Count = 3, |
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
catch (Exception ex) | |
{ | |
_log.Error(ex.Message, ex); | |
if (response != null) | |
{ | |
var result = await response.Content.ReadAsStringAsync().ConfigureAwait(false); | |
throw new RestClientException(ParseErrorResponse(result), ex); | |
} | |
throw; | |
} |
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
{"error":true,"message":"could not execute statement","stacktrace":"org.hibernate.exception.ConstraintViolationException: could not execute statement\n\tat org.hibernate.exception.internal.SQLStateConversionDelegate.convert(SQLStateConversionDelegate.java:112)\n\tat org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)\n\tat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:109)\n\tat org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)\n\tat org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:207)\n\tat org.hibernate.id.IdentityGenerator$GetGeneratedKeysDelegate.executeAndExtract(IdentityGenerator.java:84)\n\tat org.hibernate.id.insert.AbstractReturningDelegate.performInsert(AbstractReturningDelegate.java:42)\n\tat org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2791)\n\tat org.hibernate.persister.entity.Abs |
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 AppContext : DbContext | |
{ | |
public DbSet<Book> Books { get; set; } | |
public IEnumerable<DbEntityEntry> ChangedBooks { get; private set; } | |
public override int SaveChanges() | |
{ | |
ChangedBooks = ChangeTracker.Entries().Where(p => p.State == EntityState.Added || p.State == EntityState.Deleted || p.State == EntityState.Modified); | |
return 1; | |
} |