Posts

Showing posts from June, 2015

tsql - T-SQL - how to round DOWN to nearest .05 -

The database I am using is SQL Server 2005. I am trying to fill the values ​​in the nearest value .05 (nickel). So far I have: SELECT ROUND (number to turner / 5, 2) * 5 Which To evaluate approximately < 1.95 , 2 , No, 1.99 / Strong>. Specify the non-zero values ​​for the third parameter instead of the triangle: < Pre> SELECT ROUND (numberToBeRounded / 5, 2, 1) * 5 Note: Going from zero to side towards zero, but it only makes a difference if You can use the floor function to round negative values, but you can not specify the number of decimals. So that you should multiply instead of dividing: SELECT FLOOR (number ToBeRounded * 20) / 20

c# - Entity Framework Bulk Merge -

I am trying to use the entity framework to perform a merge operation. I have tried to use the intuitive approach to retrieve the record and then logic in the code, but it is very slow. I have also noticed using bulk entry library as a discussion, but it only supports bulk inserts So far my work was done to create a stored procedure There is a table value type defined for my table, using the reflection, the input dataset is generated dynamically, and then executes the stored procedure. What does this mean, of course, every time my table definition changes, I'll have to change the stored procedure code and table price type now. Is there a better way to do this? If I can dynamically generate the definitions of columns from the unit framework which will be a great help in advance. Edit: I am talking about T-SQL merge: The best solution probably depends on exactly from "a merge operation". What do you mean if you want to include organizations from the set

javascript - Can't create a mesh from a loaded Three.js object -

I exported a model to Clara with four textures in three jazz object formats. It results in a .json file. I am trying to load it and displayed it correctly. If I do the following (taken directly from clara.io export support), it loads and displays, but without texture: var loader = new three.ObjectLoader (); Loader.load ("wsc3.json", function (obj) {scene.add (obj);}); One thing I have found is the context of using a different type of loader, it is possible to convert the weighted object into three. Get mesh, texture, and then apply them in the net I have an example of this: loader = new three JSONLoder (); Loader.load ("wsc3.js", function (geometry, content) {// file Y contentForphylll = Get content loaded from new three.MacefaceMaterial (content); // Loaded geometry and content of mesh Make our net together = new three. Aries (geometry, contentframe file); scene.add (Aries);}); The problem with using JSONLoader is that I am exporting the sub-part in th

c# - Label in UserControl (Winforms) don't show -

लेबल के साथ एक उपयोगकर्ता नियंत्रण रखना, एक होमब्रे "टेक्स्टबॉक्स" (नियंत्रण से सीधे विरासत में मिला है) और एक बटन। लक्ष्य को प्रासंगिक नियंत्रणों के लिए "चिपकने वाला" लेबल रखना होता है, इसलिए रूपों का डिज़ाइन अधिक सरल है। मैंने ओनपेंट () घटना को ओवरराइड कर दिया, इसलिए "टेक्स्ट बॉक्स" की बुद्धि को लेबल की चौड़ाई को ध्यान में रखते हुए गणना की जाती है। इसके बदले में उपयोगकर्ता के नियंत्रण की एक प्राप्य संपत्ति से अपना पाठ लिया गया है। इस तरह, UserControl की पूरी चौड़ाई डिजाइनर में दिखाई देती है। सभी कंप्यूटिंग को सही ढंग से किया जाता है (जब लेबल के लिए पाठ बड़ा होता है, पाठ की चौड़ाई कम होती है, और वाइसवर्सा ...)। और फिर से: यदि लेबल पाठ रिक्त है, लेबल को कोई दृश्यमान नहीं के रूप में चिह्नित किया गया है, और जैसे लेकिन लेबल नहीं दिखाया गया है कुछ विचार? टीएए मैंने शेल की सलाह का पालन किया लेकिन एक मोड़ के साथ। यदि आप UserControl OnPaint इवेंट से ड्रास्ट्रिंग () करने का प्रयास करते हैं, तो निहाल होता है, क्योंकि सभी नियंत्रण के बाद फॉर्म के लिए OnPain

performance - Empty loop is slower than a non-empty one in C -

When trying to figure out how long it takes to execute a line of code, I It looked strange: int main (char argc, char * argv []) {time_t start, end; Uint64_t i; Double total_time, free_time; Int A = 1; Int B = 1; Start = clock (); For (i = 0; i <(1 <- 31) -1; i ++); End = clock (); Free_time = (double) (end-time) / CLOCKS_PER_SEC; Printf ("% f \ n", free_time); Start = clock (); For (i = 0; i <(1 <31) -1; i ++) {A + = B% 2; } End = clock (); Free_time = (double) (end-time) / CLOCKS_PER_SEC; Printf ("% f \ n", free_time); Return (0); } which shows executed: 5.873425 4.826874 Why more time is used than empty loop Second, there is a directive? Of course I have tried many forms, but every time, an empty loop takes more than one time with a single instruction. Note that I have tried to swap the order of loops and add some warm-up code and this I get codeblocks as GNU gcc compiler, linux ubuntu 14.04 with the IDE form I am using and QuadCar

c - getting the biggest sample frequency supported from ALSA -

I was wondering if there is an ALSA function which can tell which of the recording using ALSA Sample frequencies support? This will be the function. For example, see.

javascript - Find index in array of objects -

I would like to search the index in the array conditions in the array are objects, and I want to filter them on properties. I know which keys I want to filter and their value for now I have given the code to filter the data and returns the object data to me, but not an array of arrays. "Data": {"text": "one", "site-id": "1", "irritation": "default", "user id": "8", "time "", "User": "7", "time": 1374156747}, {"text": "two", "site-id": "1", "irritation": "default", "user-id": 1374156735}]; Var filter = {userid: '7', Chid: 'default'}; Function getIndexOfArray (list, support) {var pnames = _keys (props) back _.find (list, function (obj) {return_.all (pnames, function (pname) {return obj [pname] == PROP [Pname] })}}}} Check = getIndexOfArray (data, filterParam); // &

c# - How to initialize an array of dictionaries -

इस सवाल का पहले से ही एक उत्तर है: < / P> 6 उत्तर मैं इसे प्राप्त करने में असमर्थ हूं सिंटैक्स सही या किसी भी संसाधन का इसका उदाहरण है। ऐसा कुछ करने की कोशिश कर रहा हूं: पंक्ति = नया शब्दकोश & lt; स्ट्रिंग, स्ट्रिंग & gt; [] [["ए": "ए"}, {"बी": "बी"}] इस वाक्यविन्यास पर कोई भी विचार? आप इस तरह से कोशिश कर सकते हैं: पंक्ति = नया शब्दकोश & lt; स्ट्रिंग, स्ट्रिंग & gt; [] {नया शब्दकोश & lt; स्ट्रिंग, स्ट्रिंग & gt; {{"ए", "ए"}}, नया शब्दकोश & lt; स्ट्रिंग, स्ट्रिंग & gt; {{"बी", "बी"}}};

php - xdebug profiling from command line doesn't work -

When I try to run xdebug profiling (from the command line), the script immediately dies. I did not get any response (if I stopped to run the script with the xdebug framework, then the script does exactly what I would expect.) I am running php 5.4.13 in Centos 6. I have tried two different methods to enable the settings: Editing Php.ini, and using the -d flag when I execute the script. The related part of my php.ini looks like this: [xdebug] zend_extension = "/ usr / lib64 / php / module / xdebug.so" xdebug Remote_enable = 1 xdebug.default_enable = 0 xdebug.profiler_output_dir = "/ tmp / outline" # xdebug.profiler_enable = 1 # Please try to uncomment my script profile for this line I call the script using one of these two commands (and make sure the INI file line is commented (or not suitable). $ & gt;/ Usr / bin / php script / daemon / post process. FTP-C4 or $> / Usr / bin / php -d Xdebug.profiler_enable = 1 scripts / daemon / postproc

mobile - Can I use Android L switch control theme in android 4.0 -

I want to know, can I use the Android L switch control theme on Android 4.0? For example please. Thanks, A * * 1.) Create a new project by file-> new-> Android project name, this switches example. 2.) Write the following in the main.xml: ** Switch Android: text = "standard switch" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" android: layout_marginbottom = "32dip" /> & Lt; Android: layout_height = "wrap_content" Android: layout_marginBottom = "32dip" /> & Lt; Android: layout_height = "wrap_content" android: layout_marginBottom = "32dip" /> gt; & Lt; Android: textOn = "Start" Android: textOn = "Start" Android: textOff = "Stop" android: layout_marginBottom = "32dip" /> & Lt; / LinearLayout & gt; & Lt; / Scrollview & gt; 3.) Run for the output. Step: 1.) Create a project

java - Glassfish whont start on linux server -

After First of all I'm a newbie on Linux, do not hate me. I've done the same thing on windows and have always got it to work for the first time trying on a linux box. 1) I have installed Glassfish 4 which is JDK7 or need more. 2) I installed JDK 8 3) I set JAVA_HOME to the JDK 4) I unziped Glassfish. When I get the following run glassfish4 / bin / asadmin I have the following error formula exception "main" java.lang.UnsupportedClassVersionError: bad version number java.lang.ClassLoader in .class file. defineClass1 java.lang.ClassLoader.defineClass (ClassLoader.java:620) java.security.SecureClassLoader.defineClass (SecureClassLoader.java:124) (Native Method On java.net.URLClassLoader.defineClass) (URLClassLoader.java:260 ) on java on java.net.URLClassLoader.access $ 100 java.net.URLClassLoader $ 1.run (URLClassLoader.java:56) (URLClassLoader.java:195) java.security.AccessController.doPrivileged (Native method). .findClass (URLClassLoader.java:188

angularjs - AngularFire 0.8 bindTo only works for first change -

Hi, I am trying to create an app using the new Analyzer version 0.8, which has an updated version of the $ bind, which is $ bindTo Although IM is getting a little hard with this method, the only way to tie the changes seems to be back in the firebase on the first update. Do not make later changes to the data on the page. Do I need to redeem the object on every update? I have created a simple app to show this problem. In the app, any object is created in a factory (test) that adds the object to the $ root scope. The administrator then accesses it, and a viewer accesses it and updates as needed. Factory (services / test.js) app factory ('test', function ($ firebase, FIREBASE_URL, $ rootScope) { Var URL = FIREBASE_URL + 'test12 /'; var test = {create: function (user, obj) {console.log ("create new test object"); Obj.something = "1234"; obj.somethingElse = "567" ; Obj. $ Priority = "7"; obj. $ Save (set); setCurrentTest (use

c# - Single object in view model base not updated in UI -

I have a visual model that uses the ViewViewloadBaze from the MVVLite framework. As follows: Public category WorkDayViewModel: ViewModelBase {Private IWorkDayServiceAgent _workDayServiceAgent; Private working day _ workday; Public work day weekday {return {workdays; } Set {// _ workDay = value; // RaisePropertyChanged (); Set (() => works, referee _workday, value); }} Public WorkView Model (IWorkDayServiceAgent Business Day Service Agent) {_workDayServiceAgent = workDayServiceAgent; } Public Emission Zero LoadworkCard (Date of Date) {Workday = Wait _ Workday Service. Gateworld (Date); } Public Zero Load Worker (working day workday) {_workDay = working days; }} I am obliged to do a WindowsPhonePage using the workday dataContext feature I'm setting the data reference on the first item when the dialog is not shown in the OnNavigatedTo method. workDayViewModel.WorkDay = (works) navigation object cache.gate (); However, I have a button on that page to switch to

javascript - Angular directive for customized html tag in table -

Let me use the EngelsJS instructions to allow HTML tags to be understood as tags bold The solution has been found b . However, this does not work so & lt; Bold & gt; {{TestWorks}} & lt; / Bold & gt; will style the text as bold When I have {{testText}} , where it is within the scope: $ scope.testText = "& Lt; bold> Peter "; This does not work even when I should change the value to HTML to use ng-bind-html , you Can you find the code that the instructions were implemented before evaluating the expression? Variables for binding some HTML to an angle You can verify the $ sce module To use Live sample: .controller ('myController', ['$ scope', '$ sce', function ($ scope, $ sce) {$ scope. TestText = $ sce.trustAsHtml ("& lt; bold> gt; Peter & lt; / bold & gt;");}]);

Python code coverage on p4 diff -

I am running python unit test cases and am collecting coverage using python coverage command. The code changes into existing files; there were no previous trial cases for the same file. And its purpose is only with difference, the part of the code that has changed. Apart from this, how many lines of reports were covered, how many covered, how many unavailable, and% line numbers were covered as a diff file. Is there any device that can show coverage reports on the difference of a file, especially P4 difference or change number Provides coverage reporting for a single commute, however in Git. It's open-source, you can customize it according to your needs, or even contribute to Perforce support.

jquery - Migration of a Yii PHP Application -

I need to convert my PHP application from one server to another (Goddady to inMotionHosting) Godaddy: PHP: 5.3.2 MYSQL: 5.1.63 InMotion: PHP v5.4.30 MySQL v.5.6.17 I am using Yii Framework v1.1.8, and I Is real looking 1.1.15 Is this a good time to update in the actual version ??? Is there good back compatibility in Yii? I am using jQuery 1.6.2, should I update to jQuery 1.11.1 ??? What about v2.1.1 ??? I understand that updating Yii and JQuery is not started, but I have to update my UI soon. "text"> I know that with jQuery 1.9 things Getting rid of, therefore, for the previous compatibility, jQuery is migrated Yii 1.1.8 to 1.1.15 is only bug fixes and enhancements. There should not be any harm to an update here, but as usual ... first test. Renewing Yii v2.x is a bad idea for you right now. The minimum PHP version is 5.4 and with this, Yii made great use of up-to-date language features. Although V2 is still in beta and I do not suggest that for an

google apps script - GAS: Error encountered: An unexpected error occurred -

I have very little knowledge in coding with UI on Google Apps Script I try to apply a simple form to the spreadsheet I am doing Spreadsheets do two things: If a field is left empty, then it should create a warning message. After filling all the fields, the information should be input into the spreadsheet (not displayed in the code given below). My stage 1 is failing badly because it gives me a popup error: : An unexpected error occurred: My code is more complex than the one given below but this also results in: Function A (e) {var doc = SpreadsheetApp.getActiveSpreadsheet (); Var app = UiApp.createApplication (). SetTitle ('new name'); Var form = app.createVerticalPanel () SetId ('form'); Var grid = app.createGrid (2, 3) .setId ('grid'); Grid.setWidget (0, 0, app.createLabel ('name:')); Grid.setWidget (0, 1, app.createTextBox (). SetName ('name')); Grid.setWidget (0, 2, app.createHTML (.) SetId ('nameRequired')); Gr

c# - Transferring data from one page to another windows 8 phone app -

I am trying to transfer data from one page to another, in which I am making. I'm getting the error Error 1 Name 'EnterName Box' is not present in the current context Can someone tell me what I did wrong? The first page (getStartedButton takes you to another page) [code] using the system; Using System.Collections.Generic; Using System.Linq; Using System.Net; Using System.Windows; Using System.Windows.Controls; Using System.Windows.Navigation; Using Microsoft.Phone.Controls; Use of Microsoft phone. Shell; Using FinalProjectPhoneVersion.Resources; Namespace Ultimate ProjectPhone Warson {Public Partial Class Home Page: Phone Apps Page {Stable Int Strike; Stable int counter; Stable random random = new random (); Static ER random number 1; Static and random number 2; // Constructor Public Manpage () {Initialization (); // ApplicationBar // BuildLocalizedApplicationBar () sample code for localization; } // Set local code for BuildLocalizedApplicationBar () // // // on a loc

javascript - phonegap save image from url to album -

For how to save the image URL for the album using phonegap Android My The code is: & lt; A href = "#" onclick = "Svetofotoalbum ( 'Https://bildkfonegpkcom/imejej/aiconkpang', true);" & Gt; Click to save & lt; / A & gt; You will need to use the file transfer plugin Function Album (Mary) {var fileTransfer = new FileTransfer (); Var uri = Encoder (Mary); Var filePath = "cdvfile: //localhost/persistent/myImageFolder/myImage.jpg"; fileTransfer.download (uri, FilePath, function (entry) {console.log ( "Download complete:" + entry.fullPath);}, function (error) {console.log ( "Download error source" + error.source); console.log ( "Download error target" + error.target); console.log ( "error code to upload" + error.code);}, false, {header: { "Authority": "basic dGVzdHVzZXJuYW1lOnRlc3RwYXNzd29yZA ==" }}); } & Lt; A href = "#" onclick = "Svetofoto

qt - How to resize QTableWidget on Widget by dragging its corner -

Image
Like the following screen shot I want to resize QTableWidget by dragging the bottom right corner. I How to do? Here's my code. PySide.QtGui Import QApplication, QWidget, QTableWidget Week = ["Mon", "Sue", "Withdrawal", "Piceide." From thr "," fri "," sat "," sun "] ap = QApplication ([]) mainWidget = QWidget () tableWidget = QTableWidget (mainWidget) tableWidget.setRowCount (3) Table Widget.setColumnCount (7) tableWidget.setHorizontalHeaderLabels (Week) MainWidget.show () Thank you. One way to do this is by using QSizeGrip in a layout inside the table widget: tableWidget-> Set Window Flex (QT :: SubVando ); QSizeGrip * sizeGrip = new QSizeGrip (tableWidget); QGridLayout * Layout = New QGridLayout (tableWidget); Layout-> Ad Widgets (Size Grid, 0,0,1,1, Qt :: AllBlueMt | QT :: AlienGuRight); QSizeGrip The class provides a resize handle to resize the top-level window when you

python - Obtain one number from numpy subarrays given its peer -

I have an array, which is similar to the number of numbers (size 2 of the form): pairs = NP Array (Array ([[1, 2], [5, 12], [9, 33], [9, 1], [34,7]]) Like: nums = np.array ([1,12,9]) What do I have to do is associate the numbers in the numbers array exactly The result should be result = np.array ([2, 5, 33, 9, 1]) How can I get Is it using numpy functions? I'm using lazy comparisons (actually using lists), for each element in the nums array, I check that it is in everybody and I store values. If the order of elements does not matter, you can use it easily: & gt; & Gt; & Gt; Np.concatenate (pairs [:, 1] [np.in1d ​​(pairs [:, 0], numbers)], pairs [:, 0] [np.in1d ​​(pairs [:, 1], number) ])) Array ([2, 33, 1, 5, 9]) Edit: To protect the order For, you can use it: & gt; & Gt; & Gt; Pairs [np.in1d ​​(pairs, numbers). Your ((pairs.shape [0], 2)) [,: [1,0]]] array ([2, 5, 33, 9, 1])

c - How to use ap_parse_form_data and keep request body? -

"postprint" itemprop = "text"> I'm developing some authentication display for Apache before passing a request to a module backend. At this time some authentication form data needs to be parsed. The problem is that the request body is removed from the ap_parse_form_data , so long as it passes through my module and goes to the ProxyPass instruction that closes the backend , The request body has gone and the backend believes that no form data has been given. Is there a way to use the ap_parse_form_data to retain the request code like this? ap_parse_form_data I was able to get the same effect by manually adding a request body manually Was: apr_bucket_brigade * new_brigade = apr_brigade_create (req-> pool, req-> connection & gt; bucket_alloc); Apr_bucket * Bucket = apr_bucket_transient_create (reencoded_form_data, strlen (reencoded_form_data), req-> Connection-> Batty_loc); APR_BRIGADE_INSERT_TAIL (new_brigade, bucket); Req-> Kep

ruby on rails - The action 'destory' could not be found in controller -

I think I'm losing it, I do not understand why a simple delete link will all work suddenly I'm getting this error:. AbstractController :: Action on ActionNotFound / Action v41w74v2 Can not be found for 'Destroy' for Plan Controller Plan Controller: Class Plan Controller & lt; ApplicationController before_filter: authenticate_user! DEF Index @plans = Plan.all End DEF New @plan = Plan.new def @plan = Plan.new (plan_params) If @ plan.save end up making @plan.trips.empty? @possible == plan.group.trips render "add_trips" and redirect_to plan_path, notice: "Plan successfully created" and finally show 'new' end-end def = plan = Plan.find_by_unique_identifier (parameter [: id] ) End edit DEF @plan = Plan.find_by_unique_identifier (parameter [: id]) @group = @ plan.group @possible = @ plan.group.trips Submit "add_trips" def end @plan = Plan.find_by_unique_identifier (parameter [ : Id]), then @ Plan.update_attributes (plan_pa

objective c - Number of Rows in UITableView Needs to Differ after Delete -

I have a table with multiple sections. When there is no line in a given section, I come back from 1 to numerOfRowInSection and then make some default text. I do not allow this row to be selected or edited. The problem is that this section allows the removal of lines when the data is (again I disable it when the data is not present and I'm displaying my default text). However, suppose that this section contains a line of actual data. When the user deletes this line, then he should reload the table and my default text will be shown because the data for this section is no longer present. What really happens is an AP terminal error because it is expecting 0 rows after deletion (1 row ago, delete 1 row, 0 line result). . In my code though when the rows 0 is mentioned as I do not have math work and the error returns everything stops 1 Question: How can I put a default line when the table is empty , But allow it to be removed so that when the last line of data is removed it will

c - How could this happen when reading a socket with a error ENOMEM return -

error How can this be done when reading socket with ENOMEM returns? Man 2 read, I can not find any details about this error, someone can help me thanks. My Linux kernel 2.6.26-1-686 isomom is an OS error code, As defined in Kern / include / kern / errno.h, which is returned due to inadequate memory The name is the error no memory for the ENOMEM. One of the error codes returned by the fork () call means that no more storage space is available anymore. They are raised in relation to the socket when there is not enough resources available to make the socket. The value of the error code is 12. You can handle this error instantly and release all the allocated resources as soon as possible, to avoid the need to allocate new resources. Edit: To obtain a data buffer, read the socket due to allocation and need to be free after your requirement. Also make sure that there is sufficient memory to return the error if failing to allocate memory.

python - Error when trying to use matplotlib -

I'm just trying to plot an original line chart with dragon's matplotlib. But I am constantly getting errors and fixing one by one but this time it is stuck. I'm using Python 2.7 and below is the code that I'm trying to run. & gt; & Gt; & Gt; Import PLL as matplotlib.pyplot & gt; & Gt; & Gt; Plt.plot ([1,2,3,4]) gt; & Gt; & Gt; Plt.ylabel ('some number') & gt; & Gt; & Gt; Plt.show () Below is Traceback What am I missing? & gt; Tracebacks (Last Call Last): File "& lt; pyshell # 9", line 1, in & gt; & Lt; Module & gt; & Gt; Import matplotlib.pyplot plt file "C: \ Python 27 \ lib \ site-packages \ matplotlib \ pyplot.py", line 24, in & gt; & Lt; Module & gt; & Gt; Import the matplotlib.colorbar file to "C: \ Python 27 \ lib \ site-packages \ matplotlib \ colorbar.py", in line 27, in & gt; & Lt; Module & gt; & Gt; Martplate le

sql - Storing Hash in Sqlite table . Do I use Serialization? -

I am preparing an app for which to store historical financial data for different stocks I currently have one The stock table where the columns are stock symbols, how I am trying to decide to store with stock names and numerical data. For example, for column stockprice, I have a complete hash where the key date is the value of a string and value share. This information should be easily accessible (fast random access). I've read something about serializing, but I wonder if this is the best option (or if it's applicable at all). Instead, there is a way to automatically generate a squat table for each stock, and which represent columns and rows, representing the stockpoints, create columns? I appreciate all the information in this matter and maybe some explanations, where I should use the serialization or is there a better option Edit 1: What is the active model serialization is relevant? () 2 Edit: Is it appropriate to create and think about the Stockpace model instead;

c# - Read specific columns and there values from .CSV file and store it in a hashtable -

I want to read the specific columns from my .csv file and want to store the value in the hashtable. There are 9 columns in the CSV file, out of which I want to read 4 columns and their value (column names like PeopleId, HashValue, SecurityToken, and Date). I have tried the code below, but when I read, I have some worries in values. hashtable HT = new hashtable (); (TextFieldParser parser = New TextFieldParser (csv_file_path)) using {parser.TextFieldType = FieldType.Delimited; Parser.SetDelimiters (","); While (! Parser.EndOfData) {try {string [] fields = parser.ReadFields (); Ht.Add (areas [0], fields [1]); } Hold (exception before) {// ...}}} foreach (string key in ht.Keys) {Console.WriteLine (String.Format ("{0}: {1}", key, HT [key]) ); } I need help specifying the name of the column and only those values ​​in my hashtable are to be found.

java - Faking User-Agent when sending request to server? -

I am reading and if this is the customer for duplicate user-agent < / Code> when sending the request? Question (s) - The user sends a request via Curl , but the fake is to see if the The request from mobile is coming? Is this possible? - Can the server detect it? - Can the server stop it? Thank you It is possible and easy that all you have to do is make the user -Agent header string has been set. I've seen a browser, which allowed you to set it up (do not remember which one). On the server it is very difficult to know that many bots pretend to be a browser so that they are not filtered.

python - How to customize QComboBox with CSS -

Image
Creates QComboBox with five items in the code below .setStyleSheet () The color of the pull-down background changes using the method. QtCore, QtGui app from PyQt4 import = QtGui.QApplication ([]) combo = QtGui.QComboBox () for category (5): combo.addItem ('% s'% id (i)) combo.setStyleSheet (' background -color: gray ') combo.show () sys.exit (app .exec_ ()) Question: Two white bars appearing above and below the ComboBox pull-down menu How to get rid of? Here's a screenshot showing the problem: padding needs to be set to zero with vertical axes: combo.setStyleSheet ('background color: gray; padding: 0px10px 0px10px;') Result:

Crystal Report: ERROR : [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified -

When I try to run a report in the Crystal Reports, I get the following error Did you get rid of this error Recommended method: Error: [Microsoft] [ODBC driver manager] Data source name was not found and no default driver specified This error is telling you that it can not find your specified DSN. On Windows you can create user data sources and system data sources. If DSN was a user created for use with crystals, it was a user DSN and your app runs under another user who you are not getting DSN. If this is the case, try making the system DSN and see if it fixes the problem

ios - Unique UITableViewCell with different functionality -

Each of my projects UITableViewCell need to show as a unique I say 10 cells, all 10 cells There will be various subwigs attached to it. To achieve this goal, I am creating new cells every time which means that I am not dequeCell: . Every time I have been assigned a new cell - (UITableViewCell *) Talikadrishy: (UITableView *) Table View Selforroattindappath: (Ansaisakspath *) Suckankpth {UITableViewCell * cell = no sales = [[ UITableViewCell alloc] initWithStyle: UITableViewCellStyleDefault reuseIdentifier: @ "ABC"]; Return cell; } Whether it is okay to proceed with this or there is a better alternative approach. and which is required to download images from a cell URL I use the following would slice [imgSection setImage: [UIImage imageWithData: [NSData dataWithContentsOfURL: [NSURL URLWithString: column.icon]]]]; Please help me with the solution you do this can make reuse identifier - (UITableViewCell *) tableView: (UITableView *) tableView cellForR

ruby on rails - Prevent Sidekiq from printing "(...) INFO: Sidekiq client with redis options {}" on tests -

I use the Rail 4 default test framework and have written some tests that give sidekick some work in "background" Let's hope. But when I run the Rock Exam then the results of my test are seen in this way: ............. 2014- 08-01T05: 40: 52Z 12000 TID-ABCDF 123 Information: Sidekick Client with Radis Options {} ............................ ...... ... Ended in 3.0s, 9000 runs / s, 150.000 claims / S 30 runs, 400 claims, 0 failures, 0 errors, 0 stops Now it looks okay with the tests but the logs of the SideSaike worker are actually disturbed by this log To stop I am trying this in my working class: Class MyWorker includes: Sidekick :: Workers Sidekick_Points queue: my_queue def initialize Rails.logger.level = 2 # Set: Warning Level Super End Diff Display (movie_id) # Rails.logger.level = 0 # Back to: Debug Level? # Some code end and << code> Both the Rails.logger.level line with comment and uncommented, but the logged line did not disappear. How

sql - Get the last inserted ID -

I have to get the ID of the last line inserted in the table and use it with a variable in SQL Server. Here is my code: SELECT IDENT_CURRENT ('profiles') I tried to add a section SELECT IDENT_CURRENT ('profiles') WHERE profile. User = '2' My error is: multi-part identifier "profile user." Can not be constrained. your second query another code to WHERE To do the clause work ( to the extent that does not make a mistake ), you need multi-part identifier anchor WHERE profiles.userid = '2 from the profile Profile with SELECT IDENT_CURRENT ('Profile'). ' User / pre> but it does not make much sense because WHERE will not block the result of changing the bottom-line result (ie, The final identification created for the code> profile ) - possibly more than once in the result set. Back to your first query If you really want to get the final identity value to delete the line created for profile

Tizen emulator not detecting DNS settings -

मेरे पास 32-बिट विंडो 7 एंटरप्राइज़ संस्करण के साथ Tizen sdk 2.2.1 स्थापित है समस्या Tizen emulator DNS सेटिंग्स का पता लगाने नहीं है मैं वेबसाइट के आईपी पता का उपयोग कर वेबसाइट खोल सकता हूँ लेकिन एमुलेटर के ब्राउज़र में वेबसाइट का नाम टाइप करके नहीं। यहां समस्या क्या हो सकती है एमुलेटर DNS सेटिंग्स का पता लगाने क्यों नहीं कर रहा है।

java - ant fails unknown argument: -buildfile=build.xml -

This question can be a basic one but I'm not sure why I got this error: unknown logic : -buildfile = build.xml When trying to run ant in shell script. I am using: Anti-version : 1.9.3 < OS : Linux Java version < / Strong>: 1.7.0_65 I am trying to run an ant in a chip script file. Div class = "post-text" itemprop = "text"> From: ant [option] [target [target2 [target3] ...]] Options: ... -bildfile & lt; File & gt; Use the given buildfile Therefore between = between -buildfile and , but instead a space . Instead, try: ant -Dfile1 = file1 -Dfile2 = file2 -buildfile = build.xml -verbose : ant -Dfile1 = file1 -Dfile2 = file2 -buildfile build.xml -verbose

vb.net - Need Logic for allocating Space in listbox -

Image
I am developing a numerical game using VB.Net. For this, I need to generate the following patterns in a list box: 0 1 0 1 2 1 0 1 2 3 2 1 0 1 2 3 ......... ........ 10 9 ... 1 0 1 ...... 9 10 I created the pattern with the following code: PUBLIC GENERAL LINKS Generate generic links (system-by-submitting. Objects, bye-bye system.EventArge). Just like integer = CINT (text box 1 text) demat s string = "" I for integer = 0 to ns = "j" for j as integer = 1 to 1 phase -1 s = s + csrr (j) & amp; For the next "J = 0 I S = s + CSRR (J) & amp; "" Next list box 1. item. Add (S) Next End Sub but it will not format the formatted output as needed. The following is the output of my code: I think this is my last one: DM N As integer = CINT (text box 1 text) dim number = enableable Category (-N, N * 2 + 1) _ Select (x) Math.Abs ​​(X)) Dim result = numerical. Select category (0, N + 1) _. (Function (x) string .joined ("", n

Powershell - Variable scope behaves strangely -

I have a small script that reads the members of the AD group and then I have them with an array of users Comparison To accomplish this, I use some nested loops and if the situation and my big problems are facing, then my $ member changer suddenly Lose scope and empty . I tried to set the radius to $ globals: members or $ script: members , which had no effect. The following is the source code I have. Any suggestion, pushing in the right direction, how it works and how it helps is highly appreciated. Thanks in advance! Edit : I have to go ahead with my work, from $ member variable to out string Even I am very curious about what happened, so if someone knows what happened, please highlight me. foreach ($ group in group) {# members $ member = $ group | Get ADGroupMember | Out String # Out String fixes this issue This small print shows $ $ to the members that everything is fine # if a necessary part of each group is needed to match ($ group.Name -Match "Group-

google apps script - Dynamically changing the Image file in a form -

I hope someone can help me what I'm doing is the right way. My Google Site should be the only form of a form (only a question) to organize online questions. The form contains the user, email, question id, an image (the image is basically a question), the multichause answer. Since the questions are too much I would like to keep only one form to get the answer. I spread the scheme (see only) to share the url for each exam for each user. My problem is that how to change the image file on a fly by clicking on the URL shared by a user. What did I do? I change the image based on script execution, and ask the user to click Change the image to take the test on the URL is done by creating a pilot form which Will read the question id and lift the image related to g.drive. But I have to face an issue that the user has to refresh the page to get the correct URL (only changes to the question id in the URL, so if not refreshing, then it raises the old question ID). Is there any way a use

c# - The value is not within the expected range -

Can we present two UI elements in the same grid position in the selection of the combo box in a related event. The exact problem I have is the grid and there are two rows inside the grid. The first line always shows me a combo box (from which I was talking about the first line) In the second row of the same position will have to render the different UI elemts. So I tried rendering the UI elements in the Combo Selection Changed Event. But the problem occurs when I select the first element, it is displayed correctly but when I try to select the second UI element in the same situation on the combo selection change One warns "Value is not within the expected range." On line: "biggrid.children.Add (ck);" My code for doing this is: grid childGrid = createChildGrid (); Grid ck = new grid (); // The second row on the CK will include line zero and the UI elements include the combo box. Roud Definition. Add (New Row Definition ()); Ck.RowDefinitions.Add (new

javascript - Store the occurrence in an array -

I'm looking for an effective way to count the incidence of elements I read data in a loop, and each In the phase I want to increase the right object element in the result array, or create a new one, if it is not yet available. I have to work with so many data, so I need a quick solution here is a working version: var hugeDataObject = [{ID: '1234 ', Dark: true}, {id:' 5678 ', dark: true}, {id:' 91011 ', dark: true}, {id:' 91011 ', dark: false}]; Var ID = []; Var dark = []; Var allIds = []; Var allDarks = []; HugeDataObject.forEach (works) (var index = allIds.indexOf (attrs.id); if (index> = 0) id [index]. Sum + = 1; other {ids.push ({type: attrs ID, zodiac: 1}); allIds.push (attrs.id);} var index = allDarks.indexOf (attrs.dark); if (index> = 0) dark [index] amount + = 1; other {Darks.push ({type: attrs.dark, zodiac: 1}); allDarks.push (attrs.dark);}}); But I have more types, which I need to count, so there is a lot of variables. Re

javascript - Show the active site in an iframe as an extension to the parent page url -

So I'm registering with a menu on the left and registering it with an iframe on the right for everything IFRAME and Navigation Works perfectly with, but one thing is missing. I have to url the change in the original page: "address.com/help" For example: "address" com / help / unicorn "when I left the link" unicorn.html "in the navigation Make an extension of the original URL in the iframe to the active site. I have seen var iframe = $ ('iframe'); var contentWnd = Iframe.attr ('contentWindow'); var url = contentWind.window.location.href; Window.location.hash = url; on a different thread, but I think that It can not even be found to work. Looks like you're looking for

c# - Using chrome instead of SHDocVw.InternetExplorer -

In my VB6 application I am using SHDocVw.InternetExplorer and navigate to the websites , Fill out the taxbox, and submit. Dual IE as the new SHDOCVY Internet explorer iE.Navigate "www.google.com" iE.Visible = true So how can I use Chrome as an example to all the functionality such as I I can work in SHDocVw. Internet Explorer. Please guide me. The .NET solution is also welcome I do not understand your question very much and my vb6 is very dust (Not to say that this is a big old) ... SHDocVw has defined Internet Explorer as a browser that can be used by platforms and is used by the Internet Explorer Launcher There was a hook to access / P> In .net, you can access an example of Chrome which is hosted on your code using libraries such as CEFSharp . You will need to create a window and keep your Chrome browser as its control. Once you do this, you will be able to navigate to the desired page. I was taken a quick look and did not get cover for vb6, but th

parse.com - problems using Parse in my app android -

I used parse I am trying to parse. When I'm trying to run an APK, and click on the button I get this error: Unfortunately, Appname has been closed What to do? What's my fault I tried and tried to hold up with the statement still does not work. What I want to send textview.getText () To do "foo" in ToString () database Here is my code: TextView tv; Long ds; TextView td; Private static final integer CAMERA_REQUEST = 1888; View a private image view image; Create at the public zero () {Start the parsing (this, "id", "id"); } Creates protected void (interstensions saved from bundles) {super. Contents (Saved Instantstate); SetContentView (R.layout.activity_main); Button bx = (button) Find VVBID (RID. BCPTURE); Button BR = (button) Find VVBID (RID. Brefres); Button bs = (button) Find VVBID (RID.besubmit); Bs.setOnClickListener (see the new OnClickListener) {@Override Click Public Zero (see V) {Pars object test object = new pars object ("Te

C# program is looking for sql server compact 3.5, but I'm using 4.0 -

OK, it really bothers me, and if I do not tell the title of the question correctly what is my problem Is it I have a program built in C #, which is used by the entity framework and SQL Server CE. I have developed it on Windows 7, and it works fine. I have a Windows 8.1 machine on which I have tested it, and it also works fine on it However, on some Windows 8.1 computers, the program crashes as soon as it reaches the database I try to get the following error: Exception of non-tampering: system. Unknown Operation Exception: An entity framework provider, which was found with "System.Data.SqlServerCe.3.5" for the ADO.NET provider with an unchanged name. Ensure that the provider has been registered in the 'entry formwork' section of the application config file. See for more information. Now, it really confuses me, because I have the latest NuGet package for SQL Server CE on my project (4.0). I used the SQL Server CE Toolbox to create a SQL Server CE 4.0 datab

c# - Best way to implement Drag and Drop Dashboard items in WPF? -

I am trying to create a dashboard application, and I am trying to create layout rules for it and Kind of and I'm not sure what is the best way to go about it. Basically I had a custom grid control, so I can easily add it to my custom control. It works in this sense that if you put stuff in the beginning, then it was fine. But I want to implement the drag and drop feature in it and it does not really do this. The biggest annoyance is just finding out how the row and column is in the grid, in which position is the position of my mouse. So I thought that instead of the grid, I can use a canvas, and I measure the grid slots manually. But I'm not sure there is any better way. How do I want to copy on Android, you can have widgets for the Home screen and you can drag and drop them around the screen. I want it to be just essentially When you pull, I want to do a green rectangular move instead of thing and make it red if it is more than anything like I said, basically as soon a

Start an Android animation synchronized with another -

I run a pulse animation (= scale and scale-up) on a scene with a failing repetitive mode: View 1 Start animation (animation-heavy animation (this, R. anime pulse)); Again, with an event based on a button, I start another pulse animation in another scene. view2.startAnimation (AnimationUtils.loadAnimation (this, R.anim.pulse)); Is it possible to wait for the other first, so they can be synchronized? (Scale at the same time scale and at the same time scale).

refactoring - Change parameter of method in java good practice -

I have a low function in java, a good example can not be, but just come to mind;) Public Student Update Update Student (Student Degree Scholarship) {studentEntity.setName (...); StudentEntity.setAddress (...); Student student return; } The above approach is good practice or otherwise, what will be the other option, can we store a student gap in different variables and return it and can return it . For example public scholarship update student (student degree student scholarship) {student degree * student = student = student; _studentEntity.setName (...); _studentEntity.setAddress (...); Return _stintentity; } Is that correct? How Much Accelerating Method Should Be? Please make me right if wrong! Thank you :) There is no reason to write StudentEntity _studentEntity = StudentEntity; This is just redundant. If you are just updating and prefer back to primarily. The second way is to create unnecessary illusions while reading the code.

python - What is a clearer way to generate this sequence of numbers? -

Image
I have to prepare a list like this: [0, 2, 6, 12, 20, 30, 42, 56, 72, 90] And this is my current code g = lambda x: x + g ( X - 2) If x & gt; 0 and 0 print (for i in the category of [g (2 * i)) (10)] What is a clear and more direct way to generate the sequence? These are some of the first things that appear, a number that is the product of two consecutive integers N * (n + 1) I found it in search. It is easy to generate them with the understanding of the list: gt; & Gt; [0, 2, 6, 12, 20, 30, 42, 56, 72, 90]

vba - Excel changes dates where the day is lower than the month (e.g 2nd april) to the reverse (e.g 4th feb) -

I have some tables with Excel and dates. The situation is as follows: We have monthly reports with many tabs, which import macros in the central spreadsheet, there are about 120 columns in it. After importing, I have to add some formulas to some last columns relevant to the data, but are not included in the data, and one of these is the duration (we start from April 1 and April 13 for the customer Working for the customer, 4 weeks duration in the year) To accomplish this, I have a separate sheet with all the dates in column A., after that period and other columns in the following column. A simple Vlookup looks at the date and gives the duration. However, some dates are stored in the form of text (and therefore vlookup # N / A), ordinary fix, paste special - Add spaces, cell and wola, and if it does If it does manually it works. But that means all the work is done for the user, so I tried to program it according to the code given below: 'Sheets ("dates and duration&quo

c# - Regex in Route attribute - RESTful API ASP.NET Web API -

I have a problem with regular expression in the root attribute. I want to create a RESTABLE API, where you can filter the results You can specify the start date and end date in the URL. What I've done so far: [HttpGet] [root ("date / {start date: datetime: regex (\\ d {4} - \\ d {2} - \ \ D {{End}: {{end_date: datetime: regex (\\ d {4} - \\ d {2} - \\ d {2})} ")] [root (" date / {startDate: date: regular Expression (\\ d {4} / \\ d {2} / \\ d {2})} / {* ENDDATE: Date: Regular Expression (\\ d {4} / \\ d {2} / \ \ D {2})} ")] Public IEnumerable & lt; Recommendation & gt; GetRecommendationByDate (DateTime StartDate, Datetime? AndDet) {var output = DB. Where (R = & gt; RiPrinted == True & amp; amp; amp; R.CreditedDetate.Cartrate> & gt; & amp; amp; R.R.Comp.net (EnddateHouse Value? AndDet. Value: Datetime.now) 0). Orderbidescosing (R => R.Last Modified) .Oolist (); Return output; } It does not work as to how I want it, because

javascript - How to add text between html tags in a string client side? -

After calling in a library, I get the following string var data = " 123.456 "; & lt; Td> & Lt; I & lt; Td> After the content of some data (a & lt; img / & gt; tag) / Td & gt; and get something like & lt; Td> 123.456 & lt; Img src = 'path' / & gt; & Lt; / Td> How is this properly in jQuery? You can change your variable in the jQuery object by attachment () < / Code> to img var data = "& lt; td> 123.456 ; Data = $ (data) .append ("& lt; img src = 'path' />").prop('outerHTML '); Alert (data)

image - Test for created file with Spock in Gradle -

I have a job that produces a picture, so I want to write a test for this comparison of this image binary < em> the first picture Resources has been generated in the folder def setupSpec () {project = ProjectBuilder.builder (). Hopefully Build () GenericPicTask = project.tasks.create (SomePlugin.GENERATE_PIC_TASK_NAME, GeneratePicTask)} def 'picture Test Create () {When the file filename = new File ( "Information") Then Generate PicTask.createPicture (fileName) FileName.exists () == true} but there is an error that c: \ user \ user \ apeda \ local \ temp \ gradle1393280218367058727projectDir \ build \ Info.PNG (system specified can not find the path) working drawings generatePicTask to stop action Generate Project object is a dummy project so I do not know that it was also executed. How can I fix this? I see 3 problems from your current perspective: Your test current Do not trust working directory So instead of creating a file like thi

c# - How to use true, false and both condition in sql server -

I have a check box in my design (active) This stores either 0 or 1. I need to find items based on the check box value, i.e., active or inactive or both. For activating I can use 1 and I can use 0 to be inactive. But I need to use all the conditions (true, false, truth and false). Assume: You have 0 for active, To activate 1 < Li>> Where such type of section: - is the name of the active column and @active is the query parameter WHERE {Existing rule} and (@active = 2 or @active = Active) update: Because you have not added the appropriate tags, so I have UI and ado . You can use these methods for other technologies. For Winforms: Assume that your checkbox its threeSTATE property ( IsThreeState in WPF) is passed to true , you can receive and pass values ​​like this: SqlCommand cmd = conenction.CreateCommand (); Active active; Switch (checkbox 1. checkstate) {case checkstate. Checked: active = 1; break; Case Checkstate Uncheck: active =