2018-10-22         Maxwell

ASP.NET MVC users - do you miss anything from WebForms?

There are lots of articles and discussions about the differences between ASP.NET WebForms and ASP.NET MVC that compare the relative merits of the two frameworks.I have a different question for anyone who has experience using WebForms that has since moved to MVC:What is the number one thing that WebForms had, that MVC doesn't, that you really miss?EditNo-one has mentioned the WebForms validation controls. I am now working on some code that has a few dependant validation rules and implementing client-side validation for these is proving slow. As a PHP/Classic ASP person, I...

 asp.net                     14 answers                     61 view
 2018-10-22         Maxwell

Loading ontology to extract all the imported name spaces

I am trying to load an ontology saved on my PC. The file format is .n3. After a lot of work and searching for the possible solutions, I didn't find an appropriate way to load an ontology.I tried the following code: import edu.stanford.smi.protegex.owl.ProtegeOWL;import edu.stanford.smi.protegex.owl.model.OWLModel;public class Extractor {public static void main(String[] args) { String ontologyURI = "file:///C:/acco.n3"; try { OWLModel owlModel = ProtegeOWL.createJenaOWLModelFromURI(ontologyURI); System.out.println("Worked"); }catch (Exception ex...

 java                     1 answers                     85 view
 2018-10-22         Maxwell

gem install permission problem

qichunren@zhaobak:~> gem install hpricotERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions into the /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8 directory.Current login user is qichunren, and qichunre user have write permission with .gem dir.I would like to know why gem not install files into my home .gem dir first? Why my gem common first want to install files into /opt/ruby-enterprise-1.8.7/lib/ruby/gems/1.8 For a systemwide Ruby install, become root. For example:$ sudo gem install hpricotHowever, the modern approach in ma...

 ruby-on-rails                     5 answers                     85 view
 2018-10-22         Maxwell

paysafe internal error ErrorCode1007

I'm trying to use PaySafe Rest API Via php Curl (mycurl) but i'm getting error.my php code:$url="https://api.test.paysafe.com/cardpayments/v1/accounts/xxxxxxx/auths";// si erreur ajouter HTTP/1.1$headers=array('content-type: application/json');$call_api=new mycurl($url);$call_api->useAuth(true);$call_api->setName(" my username");$call_api->setPass("my password");$call_api->setHeaders($headers);$curlopt_postfields=json_encode( array( 'merchantRefNum' => 'merchant ref', 'amount' => 10, 'settleWithAuth'=>true, 'card' => array( 'paymen...

 php                     1 answers                     85 view
 2018-10-22         Maxwell

Batch delete files in subfolders with spacing in filenames

I have one directory with around 100 subdirectories, which include images. I then have a .txt list of images I need to delete from these folders. Since there are a few thousands, I'm looking for a way to batch delete these using bat file.But the problem is that my files are in subfolders and subfolders and also filenames include spaces. Example:MainFolder/Subfolder One/Image Sunshine.jpg<br>MainFolder/Subfolder One/Image Cloudy.jpgI've tried multiple options of del, also by putting all paths in txt file inside double quotes. But nothing deletes them.Any ideas how to d...

 batch-file                     1 answers                     97 view
 2018-10-22         Maxwell

How to set foreign keys in Firestore?

As an instance think of an e-commerce app where a user can upload as many as items and those items have categories and subcategories.How to set user_id as a foreign key in each items posted as well as item_id in users collection in order to query all the items posted by a specific user. How do we make use of reference data type in Firestore to set foreign keys?Are there any other methods to set foreign keys?Database Structure:Users/doc_id/name..Categories/fashion/clothing/auto_doc_id/type:denims in order to query all the items posted by a specific user.To achieve this,...

 java                     3 answers                     49 view
 2018-10-22         Maxwell

problem with python script

I want to run a csh file from a python script,example,#!/usr/bin/pythonimport osos.system("source path/to/file.csh")and I want this file to run in the same shell as I am running the python script, because the file.csh script is settings some environment variables that I need.Does anyone know how to do this in Python? A child process cannot affect the environment of the parent process. The best you can do is to run your csh script in a separate process, get the environment variables that it defines, then set each environment variable in your python script.Even with that, ...

 python                     2 answers                     67 view
 2018-10-22         Maxwell

How can I have different file for development and deployment using webpack?

I have some config files which basically stores some data.However, I am using different data for development and deployment.I don't want to manually change the file whenever I try to deploy it. Nor do I want to change the import statement before deployment.for example. I have some codeimport './config/data.js'I don't want to modify this. I only want the content of data.js to change between development and deployment.How can I setup webpack to achieve this? The way I am achieving this is to have different version of this file like dev.js, stag.js, prod.js and etc.Then I t...

 webpack                     1 answers                     42 view
 2018-10-22         Maxwell

What is the difference in functionality between ClassPathXmlApplicationContext and GenericXmlApplicationContext in Spring?

If they are different, please provide examples for each use case. ClassPathXmlApplicationContext is one of the most common ApplicationContext implementations. You can simply point an XML (bean definition) resource on the classpath and it loads it up.ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("example-context.xml");GenericXmlApplicationContext is an ApplicationContext which has built-in XML support. It is similar to ClassPathXmlApplicationContext and FileSystemXmlApplicationContext but it allows us to point to more than one xml files using...

 spring                     1 answers                     48 view
 2018-10-22         Maxwell

EditText text not overlapping over clear button in all 4 emulator devices I'm using, EXCEPT NEXUS 4

I have the following result in my EditText: (from left to right)Android Emulator:(Respectively)3.2QVGA API 15, Nexus S API 23Nexus 5X API 23, Galaxy S7 API 24Results in all 4 of devices are fine expect on my Nexus 4 where the result is the following: NEXUS 4 API 22: Here is my code: XML: <android.support.design.widget.TextInputLayout android:id="@+id/firstNameTextInput" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1"> <AutoCompleteTextView ...

 android                     1 answers                     73 view
 2018-10-22         Maxwell

Mysql subquery fails, need help :)

I have a table PICTURES:username varchar(50) picture_id varchar(50) datetime ...and I have a table FRIENDS:user_1 varchar(50) user_2 varchar(50) datetime When you have friends on the website your username goes in user_1, and your friend username's go in user_2. For each new friend a new row...I want to show the 5 last pictures of the friends of one user (user_1)so I try SELECT p.picture_id, p.datetimeFROM pictures AS pWHERE p.username = ( SELECT f.user_2 FROM friends AS f WHERE f.user_1 = '(ENTER USERNAME HERE)' ORDER BY f.datetime DESC LIMIT 5)ORDER BY p....

 php                     4 answers                     57 view
 2018-10-22         Maxwell

My fulltext index option in sqlserver2008 is greyed out?

My fulltext index option in sqlserver2008 is greyed out?Is it a seperate install? You can enable it by executing sp_fulltext_database command. [XXX]Make sure the Full Text Search feature was installed. Run the following query against your database:SELECT SERVERPROPERTY('IsFullTextInstalled')A result of '0' (Zero) means Full Text search is not installed on the server. A result of '1' (one) means Full text search is installed on the SQL Server. If it is not installed you'll need to rerun the SQL Server setup and add the Full Text Search feature. Here's a good article...

 sql-server-2008                     6 answers                     14 view
 2018-10-22         Maxwell

VBA - "FORMAT" function isn't recongnised on 1 computer

I've coded something in VBA to help my co-workers and it's working on 8 computers but on this one computer, everytime I try to start the code, it gives me an error.Sorry I'm translating from French into English but the error is:Compilation error:Project or library isn't foundThe actual code is:' ============================================' === TRAITEMENT DES PRODUITS DU GROUPE 10 ===' ========== FOURNISSEURS STANDARDS ==========' ============================================ Case 10 Select Case var_Prix ...

 excel-vba                     1 answers                     22 view
 2018-10-22         Maxwell

List Azure providers currently in use via API

I'm looking for an effective way to query the Azure resource manager API for all providers currently in use by my subscriptions - similar to what the resources.azure.com provides providers listed via resource explorer--EDIT STARTAn example, If I deploy a SQL DB into Azure, the Microsoft.SQL provider is used in the subscription. I deploy a Web App, Microsoft.Web lights up etc. etc.I'm looking for a quick way to identity all the types of resources deployed within a subscription without having to get all the resource groups and the iterating through the resources and manually ...

 azure                     1 answers                     33 view
 2018-10-22         Maxwell

DocumentDB TransientFaultHandling Best Practice

I've been writing very verbose retry logic for throttled DocumentDB client calls. The example below is a common example of this with 10 retry attempts.My question is two fold:Is this best practice, and is there a less verbose way to handle this? I see that there is a Microsoft.Azure.Documents.Client.TransientFaultHandling nuget package that is supposed to achieve the same results with less code, but I cannot find any examples on StackOverflow or Google and there does not seem to be any clear documentation available from Microsoft.int maxRetryAttempts = 10;while (maxRetryAtt...

 c#                     1 answers                     33 view
 2018-10-22         Maxwell

How to disable code inspection errors in README.md file in Android Studio

In my GitHub README.md file, which is in the root of my Android project, I have code snippets like the following ones:```xmlandroid:windowSoftInputMode="stateHidden"``````javaMongolToast.makeText(getApplicationContext(), "ᠰᠠᠢᠨ ᠪᠠᠢᠨ᠎ᠠ ᠤᠤ︖", MongolToast.LENGTH_LONG).show();```However, in Android Studio these code snippets give errorsI don't want to be warned of supposed code errors in the README file. How do I disable all errors here?Notes:I know how to suppress inspections normally in code with @SuppressLint or going into settings and unchecking the lint inspection. I don't ...

 android-studio                     2 answers                     1 view

Page 1 of 146  |  Show More Pages:  Top Prev Next Last