Posts

Showing posts from June, 2015

How to simplify this Scala Fibonacci code, which returns the sixth digit? -

The purpose of the application is to display a number sequence and the user has to select the sixth digit: 1 2 3 5 8 ... However, to check the application's demands, another code was to be created, i.e. the sixth digit number of the sequence. Test Import org.scalatest.FunSuite Import org.scalatest.FunSpec Import org.scalatest.matchers.ShouldMatchers Class Calculation Test FenSuit {Test ("fibonacci") {emphasis (calculation. Fibonacci (1, 2) === 13)}} main object calculation {EFFibonaceae (A: IIT, B: IT): IT = {vir first: int = one var second: IT = b preferred third: int = 0 second fourth: int = 0 fifth: int = 0 viral sixth: int = 0 third = first + second fourth = second + it Ra = Fifth Third + Fourth sixth = fourth + fifth comeback sixth}} What The main code is possible to simplify, eg. Just doing the return of the sixth digit, instead of comparing each individual issue? You can define the sequence as infinite laziness Will not: Scala...

Can I manage two cloudbees accounts from one sdk? -

I have two Cloud Bodies - a private and invention of bees for a company allows me to specify a set of credentials. Is there any way i can manage both accounts with SDK? I thought - My personal account as an administrator account on the linked Company account.

c# - Entity Framework Delete Many to Many Relationship using stubs -

I am trying to remove many relationship entries between two entities, without asking any one of these first without first asking. Some on the lines of: phu fu = new foo () {id = 1}; Context.Foos.Attach (foo); Context.Entry (foo) .set = EntityState.Modified; Repeatedly = new times {id = 2}; Context.Bars.Attach (bar); Reference. Admission (bar) .set = EntityState.Modified; // This does not work: no exception, but the relationship was not deleted foo.Bars = new list & lt; Bar & gt; {times}; Foo.Bars.Remove (bar); Context.SaveChanges (); How can I remove times from foo? Bars relationships without first querying any unit? You must have stub entities unchanged and in that regard Unchanged state (call accept all changes even after ) foo.Bars = new list & lt; Bar & gt; {times}; ). Only then foo.Bars.Remove (bar); deleted will relate to the state and SaveChanges will remove it. You can confirm what is happening by inspecting the underlying ObjectCont...

ruby on rails - Can't use link path -

Hello I'm a new one in Ruby on Rails. I have encountered strange behavior I add a link and get it undefined local variable or method `diary_add_record_path ' But when I use a different route Use (main diary) it works fine Someone can tell me what is wrong with it. has two options i) Add a custom root name and use it get 'diary / add_record', for: 'add diary' ,: as = & gt; Add_diary gets your link link = 'Добавить запись', add_diary_path ,: remote = & gt; Truth: 'Data-Type' = & gt; 'Html' ,: id = & gt; 'New record-link'% & gt; ii) Rake the rake and locate the root rail generated for your path the rake roots | Grep 'add_record' and use it in your link

dataframe - How to collapse a matrix in R while getting min and max of some columns -

I have the following data frame in R. It represents a built-in protein structure for ease of explanation. Uniprots Chain ResSeq Serial P68871 D23 3446 P68871 D 24 3453 P68871 D 25 3457 P68871 D 26 3461 P68871 D 27 3470 P69011 A 38 3561 P69011 A39 3568 P69011 A40 3577 P69011 A41 3588 P69011 A42 35 99 P69011 A43 3610 P69011 A44 3625 P69011 A 463636 P0116 B2 4239 P0116 B4 4242 P0116 B5 4268 P0116 B6 4279 P0116 B 7 4285 P0116 B 8 4299 P0116 B90101 P0116 C15 5055 P0116 C 30 5199 P0116 C 42 5239 What do I need to do to drop it down, looks like this: Uniprot chain resSeq_start resSeq_end Serial_start Serial_end P68871 D 23 27 3446 3470 P69011 A 38 46 3561 3636 P0116 B 2 9 4239 5015 P0116 C 15 42 5055 5239 Actually, I want to fall down on the Fi RST 1,2 and 3 columns B. I can use in the fourth column as a Czech I which he had worked. I thought I could do it with the total, but that does not work. I can certainly do this with some glitch for some loops (reach a vector until a new unip...

javascript - Is it possible to create a jQuery mobile range slider for color selection, with labels, step borders, and step backgrounds? -

Image
jQuery mobile user allows the user to select upper and lower bounds; It is essentially two & lt; for "enhanced" elements to appear as a single slider with two "thumbs" or "handle". Input type = 'range' / & gt; The elements are elements. This works very well for ordinary numerical ranges (eg, one minute and maximum price), but I want to use it so that the user can choose a color range. Mapping color is not quite easy for numbers, and I want to provide some UI signals to help the user. I liked a lot like doing some research as I would like. You can see that the user can be interested in the type of blue color by establishing the fastest acceptable shadow, and the lowest acceptable shade of blue. There are several UI indications that make this selection comfortable for the user: The track (or "slider bar") has a different color for each discrete step is. They are connected to the sample, they actually use a gradient...

python - Attaching extra information to model instance - django -

I have a dynamic model that I want to attach an additional piece of information, depending on the environment according to the example (The user who is logged in) For this reason, I do not want to do this at the database level. Is that okay? Or there are problems that I'm not predicting "Type 'foo' or 'bar'" "def __init __ (auto, type): self.type = type views.py FooChat (FooOrBar): "" "" "never saved the database" def __init __ (self, foo_or_bar): self .__ dict__ = foo_or_bar .__ dict __copy () def check_type ( Self, external_type): If external_type == 'foo': self.is_foo = any other is true: self.is_foo = false foos_or_bars = FooOrBar.objects.all () foochecks = map (FooCheck, foos_or_bars) in foochecks For foocheck: foocheck.check_type ('foo') Additional credit questions: Is there a more efficient method of calling a method on many items i.e. the last with some clever To change the ...

design patterns - future/promise: pickup or delivery? -

I am trying to implement a simple futures module and basically it's C ++'s std :: future contains a promise in it and possibly many futures can get it if originally (if I understand it correctly ), Then prompts says "I have a ready price for pickup" and future raises it when it is ready. Have I ran into a situation where I think the caller would be better to provide you with the flags of any type of output buffer, and fill in the relevant thread buffer, then set flag . So it is no longer the future / promise, but some have inverted, where future says that "given me a notification when this value to" and promise is done by I do not know how to look for more information about this method. Is its name

r - Using a parameter for expression function -

I am trying to plot a narrative which I created with the expression function Is where logic for expression is a character that I want to plot as a Greek letter symbol. Here is an example of what I tried, which clearly does not work: param = "tau" tau.vec = c (1,2) , 3,4) conspiracy (Tau.Weck, Tau.Weck) Legend ("bottom", sapply (Tau.Wacee, Function (X) expression How should I consider any try it param = as.symbol ("tau") tau.vec = c (1,2,3), 4) conspiracy (Tau.Weck, Tau.Weck) Legend ("Talima", as .expression (sapply) (Tau.vec, function (x) bquote (. (Param) ==. (X) )))) Expression () does not allow variable values ​​to be avoided, bquote () to () syntax.

javascript - POST request 404 (Not Found) with angular.js and ExpressJS -

I am trying to send an application requesting access to my ExpressJS server using AngularJS: angle controller ('app') controller ('contactCtrl', function ($ radius, $ http) {$ scope.envoyer = function (enrollment, organization, dog, telephone, message) {$ http.post ('/ contact ', {Nom: nom, organization: organization, courriel: courriel, telephone: telephone, message: message}). Then (function (error, response) {if (response.data.success) {console.log (' sent! ');}}}}}}; This is the code from the server: var mail Var = EMAIL_ACCOUNT_EMAIL = 'aaa@gmail.com'; Var EMAIL_ACCOUNT_PASSWORD = 'AAA'; Var smtpTransport = mailer.createTransport ({Service: "Gmail", Authentication: {User: EMAIL_ACCOUNT_EMAIL, Pass: EMAIL_ACCOUNT_PASSWORD}}; app post ('/ contact', function (rik, ridge, next) {var success = true; var mail option = {to: 'azez@email.com', subject: 'qsdxwccvfd', Html: 'sqdqsdq'}; smtp...

scripting - How to stop program from automatically closing in AutoIt? -

I'm new to the outlet, so please forgive me if it seems like a silly question I'm running a simple program Which opens an .exe file, but the executable immediately closes after opening, how can I stop the program from closing? Local engineer = "C: \ user \ Davis \ Desktop \ chess engine \ stockfish-5-win \ windows \ stockfish_14053109_32bit.exe" run ($ engine, "" @, @sw_mximage, $ STDOUT_CHILD) Edit: It seems that the executable function leaves executable open by executing $ STOUT_CHILD. However, I need to read the output from the program. local $ engine = "c: \ user \ Davis \ desktop \ chessEngine \ stockfish- 5-win \ Windows \ stockfish_14053109_32bit.exe "Local $ ipid = Run ($ engine," "@sw_mximese, $ STDOUT_CHILD) Stop the proceeding ($ IPID)

.htaccess - how to hide id from an url using htaccess mod-rewrite? -

I am using this code to rewrite my URL RewriteRule ([0 -9] *) - ([^ /] *) \. Html $ index.php? Menu_id = $ 1 and menu = $ 2 [qsappend] This again writes my URL: www.site.com/1- Home.html where 1 is id (menu_id) and the name of the home menu. I am looking for a solution where I would like to rewrite the URL: www.site "post-text" itemprop = "text"> Here's how. Rewrite rules ([^ /] +). Html $ index.php? Menu_id = 1 & amp; Menu = $ 1 [qsappend] Edit: You must compensate for the fact that you do not know Menu ID. For example I put a 1 there, BC I think you want all your menu IDs to be one. Your code here is broken: # This is where your ID code is located in #. This is a dash in your code. | This is your home part # v v v rewriterule ([0-9] *) - ([^ /] *). Html $ index.php? Menu_id = $ 1 and menu = $ 2 [qsappend] # | _____________________ | | __________________________ | # Revue script # www.site.com/1-...

c# - Fill a boolean array with List that contains indices that must be true -

मान लें कि मेरे पास सूची & lt; int & gt; NullValuesIds युक्त सूचकांक। मैं NullValuesIds से हैं, और LINQ का उपयोग कर सूचकांक में true असाइन करने वाले एक बूलीयन सरणी को कैसे प्रारंभ कर सकता हूं? (बूलियन सरणी का आकार आकार 100 जैसा होता है)। पूर्णांक maxIndex = nullValuesIds.Max (); // या कुछ अन्य अधिकतम var boolArray = संख्यात्मक। रेंज (0, मैक्स इंडैक्स)। चयन करें (NullValuesIds.Contains) .ओएरेरे (); यदि प्रदर्शन महत्वपूर्ण है, तो यह बहुत तेजी से होगा यदि NullValuesIds एक हैशसेट और लेफ्टिनेंट; int & gt; ।

C++ program to compare ages if 5 persons and print the name of the eldest person -

I am trying to write a C ++ program where I want to accept the names, ages and addresses of 5 people The greatest person I am capable of finding the age of the eldest person, but is confused on the way to print the name of that age. Please take a look at my code and help me how to do it. My C ++ code is: #include & lt; Iostream & gt; using namespace std; Structure Student {Core Name [20]; Old age; Four pairs [40]; }; Int main () {Student Stu [5]; Int i, Max; For {i = 0; i & lt; = 4; i ++} {cout & lt; & Lt; "Enter \ Nname"; Cin & gt; & Gt; Stu [i] .name; Cout & lt; & Lt; "Enter the age \"; Cin & gt; & Gt; Stu [i] .ge; Cout & lt; & Lt; "Enter the address \"; Cin & gt; & Gt; Stu [i] .add; } Max = stu [0] .ge; {If (stu [i] .age & gt; max) max = stu [i] .ge; for i (i = 0; i & lt; = 4; i ++) } Cout & lt; & Lt; "Maximum age is:" & lt; & Lt; Maximum; Return 0; } ...

associations - check satisfiability of a constraint when using rails shovel operator -

In my rail application, I have a group class in which there are many relationships related to the question "subgroup is going to happen." group group has_and_belongs_to_many: subgroups, class_name: 'group' ... end I am using shovel operator group group (sub group ) As a specific group X. The hindrance in this question is that we should not make any circle when adding the subgroup, that is, I have to ensure that none of the new members is already in the ancestor of Group X. A simple answer is to write a custom method to do this, which is definitely possible, but I want to know whether it is possible to use this False Operator and not a custom function of my own. is. I think it is not possible to get this behavior done with a shovel operator. The good news is that the union "duck" like an array, you can use the union operator with array for converting input, for example and gt; Group_a, group_b = Group.new, Group.new & gt; Group_a.subg...

Jquery on click action for 1 div but multiple activate -

मेरे पास निम्न divs हैं: & lt; div class = "album" & gt; & Lt; div वर्ग = "एल्बम-कवर" & gt; & Lt; img src = "cover.jpg" & gt; & Lt; / div & gt; & Lt; div वर्ग = "एल्बम-ट्रैक" & gt; & LT; ul & gt; & Lt; li वर्ग = "गीत" & gt; 01 - गाने & lt; / li & gt; & Lt; li वर्ग = "गीत" & gt; 02 - गीत & lt; / li & gt; & Lt; li वर्ग = "गीत" & gt; 03 - गाने & lt; / li & gt; & Lt;! - और इतने पर - & gt; & Lt; / ul & gt; & Lt; / div & gt; & Lt; / div & gt; उपरोक्त कोड एक कलाकार के प्रत्येक एल्बम के लिए जोड़ दिया जाएगा। मेरे पास फिलहाल jQuery है: $ (document) .ready (function () {$ ('। एल्बम-tracks')। Hide (); $ (' ('' एल्बम-कवर ')। क्लिक करें (फ़ंक्शन () (यदि ($ ('। एल्बम-ट्रैक ')। है (': छिपा हुआ ')) {$ ('। एल्बम-ट्रैक ')। स्लाइड डाउन (' easeInEx...

Referencing two or more JSON tables in Android with PHP -

I currently have a PHP script that returns JSON encoded COUNT (*) from two tables: JSON response to // array $ response = array (); // db connect square require_once 'db_connect.php'; // db $ db = connecting to new DB_CONNECT (); // Get all ratings from different tables $ result = mysql_query ("SELECT COUNT (*) as data 1 to table 1") or die (mysql_error ()); // Check the blank result if (mysql_num_rows ($ result)>) // // looping through all ratings // Rating node $ response ["rating"] = array (); While ($ row = mysql_fetch_array ($ result)) {// temp user array $ rating = array (); $ Rating ["data1"] = $ line ["data1"]; // Enter the single rating in the last response array array_push ($ response ["rating"], $ rating); } $ Result = mysql_query ("SELECT COUNT (*) AS 2 table2 data2") or die (mysql_error ()); While ($ row = mysql_fetch_array ($ result)) {// temp user array $ rating = array (); $ Rating ["data...

c# - Cannot deserialize object graph into object with inheritance hierarchy -

I have a way in which the following methods are included: [WebMethod ] There is a hereditary hierarchy like this: DayEntry-> DataEntry-> DayEntryLD Public Nine Savendents (list of & lt; DayEntry & gt; listofEntries, string language) / P> And there is an interface, so I have to take DayEntry and can not take DayEntryLD On the customer side, I can create an array by type of DayEntryLD and thus / saveDayEntries Send to web service Note :. $ .ajax ({type: "post", url: "DataProviderFD.asmx / saveDayEntries", contentType: "application / json; charset = utf-8", datatype: "json" , Async: incorrect, data: "{'listofEntries':" + JSON.stringify (data) + ", 'language': '" + lang + "'}"}); If I execute the code, I get the following error: "Object graph can not be horizontal in the type of day interval" I think I understand this problem, how to fix this? Does a...

c++ - Benefit of 64 bit over 32 bit with QT and opengl -

However, searching for a while, I can not get a clear answer to what the benefits are for compiling 64 bit programs over 32 beats. I How to compile for 32 or 64 bit, and there are some questions about 64 bit versions of OpenGL, but they do not know the base question, What I am getting is that it is difficult to use the Minigu compiler for 64 bit Since Qt does not seem to be official release. Currently I use MinjiW 32bit to create a 3D OpenLL program which focuses heavily on the speed with the upper part of the larger sets (using VBO to handle it). I think I will turn into Visual Studio for the release of windows and maybe use 64-bit unofficial release for other platforms. Since I am not getting an OS yet, the compiled 32 bit version does not work, but the targeted deployment of my application will be mainly on the high end computer in the research environment, I release 64 bit versions I'm fine. If the code is the same, then there is a specific advantage to switcher the c...

ruby - ERROR: Failed to build gem native extension on rubygem installation -

When trying to "install bundle", I get an error message below environment == OSX 10.9.4 , RBNI 0.4.0 , Ruby 2.1.2 , Homebrew 0.9.5 Gems :: Extension :: build error: Error: Failed to create gem native extension /Users/irotakagotanda/.rbenv/versions/2.1.2/bin/ruby extconf.rb *** extconf.rb failed *** Could not create Makefile due to some reason, maybe there is a lack of necessary libraries and / or headers. Check the mkmf.log file for information. You may need configuration options. Configurable options available: - With-Opt-Direction - Without - OPTION DIRECTION - OP-IN - WITHOUT OPTION = $ {opt-dir} / include --with-opt-lib-without-opt-in -lib = $ {opt-dir} / lib - with-makeup -pag - without-make-handling --srcdir =. --Kurdir - RUB = / User / Hirokkandan / Rbenv / version / 2.1.2 / bin / Rabbi / Users / Hirokagotand /. RBNV / Version-2.1.2 / LIB / RUB / 2/1 / F / FULUTIES. RB: 1573: In 'State': Any such file or directory @ rb_file_s_stat - ./212/ruby_de...

MongoDB relationships: embed or reference? -

I am new to mongodibi - coming from a relational database background. I want to create a question structure with some comments, but I do not know which relationship to use: embed or context ? A question with some comments, such as, would be such an structure: question title = 'aaa' content = bbb 'comments = ??? First of all, I want to use embedded annotations (I think the embed is suggested in MongoDB), such as: AAA content = 'BBB' comment = [[content = 'xxx', created = 'yyy'}, {content = 'xxx', created = 'yyy'}, { Content = 'xxx', it is clear, but I am worried about this matter: If I want to edit a specific comment, Mr. How do I get and how to get his question could /? ? I do not have any _id to allow me to find my question, neither do I question_f (I'm so newbie, I do not know if _id and question_ref .) Do I have ref not embed to use? Then I have to create a new collection for comments? ...

angularjs - Animate a directive when it appears on page -

I am trying to animate a directive in the page while clicking a button using NGMNET. How can I do this for the following code? I'm trying to follow the examples: but it did not understand how to do it. Any help will be highly appreciated :) & Lt; Ul & gt; & Lt; Li class = "animate" ng-repeat = "names in names: filter: $ scope.name" ng-enamate = "'animated'" & gt; {{Name}} & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Div & gt; & Lt; Button add-box & gt; Add Box & lt; / Button & gt; & Lt; Div id = "box-container" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt; Box.html & lt; Div class = "box" & gt; & Lt; / Div & gt; Search.js var search app = angular Modules ("Search app", ["NGNET"]); SearchApp.controller ("searchCtrl", function ($ scope) {$ scope.names = [...

dns - Mapping domain name to free PAAS web hosting cloud URL -

Many companies provide a PAAS web hosting service for free, e.g. Amazon, Google, CloudWeb When you use your service, they allocate URLs to access your app. If you use Google App Engine, for example, you are told that the URL to access your app is something like this If I have a domain name, say Maxis dot com, Google app Assigned Engine URL? For example, a request such as: will also be forwarded: But I still want to see the user, myxyz.com url in the browser address field? It is possible to assume, which company needs an approach to do this mapping? Found information about it. the answer is yes. The PASS company provides the means to be specified here, for example:

xcode - Sparkle appcast signing: The update is improperly signed -

I am trying to solve this issue and I have no luck. I am storing the project and signing the export format with XCode in the developer. What do I need to set up to properly sign this update: Page on Project Build Settings (currently Developer ID: Jeremy Laurenson (XXXX )) On the target creation settings page (currently Developer ID: Jeremy Laurenson (XXXX)) Scripting signing framework in my shine: LOCATION = "$ {BUILT_PRODUCTS_DIR}" / "$ {FRAMEWORKS_FOLDER_PATH}" detection = "Mac Developer: Jeremy Laurence "$ IDENTITY" "$ LOCATION / SPARKLE.framework" Sign in to my app's cast signin script: "codeign --verbose --force - #! / Bin / bash PROJECT_NAME = Testapp set -o errexit echo "Getting the version of App $ PROJECT_NAME in this directory." VERSION = $ (/ usr / libexec / PlistBuddy-c "Print: CFBundleVersion" "$ PROJECT_NAME.app / content / Info.plist") DOWNLOAD_BASE_URL = "http...

java - Is it acceptable to rewrite methods in a dependent class to avoid get().get().get() code? -

I used to brush my own points (int x, int y) and circle (point center, int radius) sections Was written for class relations and some basic mathematics. If I want to draw a circle on the screen, then my current code looks like: g.draw oval (circle.getCenter (.getX) - circle.getRadius (), circle.getCenter (). GetY () - circle.getRadius (), circle.getRadius () * 2, circle.getRadius () * 2); Is it acceptable to write methods in my circle class which passes the fields of my point in my main square / applet? g.draw oval Circle.getX () - circle.getRadius (), circle.getY () - circle.getRadius (), circle.getRadius () * 2, circle.getRadius ( ) * 2); My concern is that, when I start building more concrete objects (such as a player class), then I will terminate the code where a field through the layers The amount of text can be passed from int x = player.getCircle (). Getpoint () GetX (); Instead of int x = player.getX (); It seems that the beauty of Java is writing c...

c++ - Why decltype isn't implicit? -

Why type of expression is expected, why decltype can not be added to expression? template & lt; Class X, Square Y, Class Z & gt; Auto Foo (X X, Y, Z Z) {std :: vector & lt; Decltype (x + y * z) & gt; Values; // valid in c ++ 11 / c ++ 14 // std :: vector & lt; X + y * z & gt; Values; // Invalid values. Push_back (x + y * z); Return value; Type Type Type - OK} typed with Expression C ++ 14 compilers will reduce the function return type based on return expressions. Why can not it be extended in any expression -> type 'conversion? The same applies, why do I have to write: std :: vector & lt; Decltype (declval () + declval> () * declval & lt; z & gt; ()) & gt; Values; Instead of : std :: vector & lt; X + Y * Z & gt; Values; If the underlying permissions of decltype Some, consider the following example: struct tp {template Output: value parameter type parameter type Parameter If ...

php - How to apply bindValue method in LIMIT clause? -

Here is a snapshot of my code: $ fetchPictures = $ PDO-> ; Prepare ("Choose From Photos * Album Where: ALCID Order By ADC Limit: Skip, Max:"); $ False Image- & gt; Bind Value (': Album Id', $ _GET ['Album'], PDO :: Paramax); If (isset ($ _GET ['skip'])) {$ fetchPictures-> BindValue (': skip', trim ($ _GET ['skip']), PDO: Paramatti); } And {$ fetchPictures-> Byte value (': Skip', 0, PDO :: Paramatti); } $ Fetch Image-> Bind value (': max', $ max, pdo: parametti); Fetch $-> Ficture-> Execute () or die (print_r ($ fetch-pictures-> ErrorInfo ())); $ Picture = $ Fetch - Image-> Fetch All (PDO :: FETCH_ASSOC); I get There is an error in your SQL syntax; It seems that the PDO is adding single quote to my variable, which is manual for the right syntax to use near "15", "Line 1", which matches your MySQL server version is. I saw a limited portion of the SQL code, I foun...

sql - Join rows Google BigQuery -

I have a large table in Google BigQuery (i.e. 3 million lines) structure is something like this: name1 attribute1 name2 attribute2 name1 attribute2 Now I want to get the list of attributes per list that they have. So for the above example, I would like something like this: name1 attribute1, attribute2 name2 attribute2 Is it possible with BigQuery (without it Write any code, just as a SQL query)? I recommend that you use the GROUP_CONCAT function: Select name, group_connect (name of the column) is named by your group.

java - Read next or previous mysql rows and update current row without using cursors or auto-incremented value -

I need to record some records that are in a mysql table. The problem is that incrementable id is not a trusted way to know id, number, status P> . I want to read number one at a time and every time I want to read the next or the last, then I have no problem getting it from the database. Once I get the number, I want to double it and type the position of the column. The cursor will be useful, but the cursor will not allow me to read the underlying table which I am reading. Is there a solution that can allow me to read the next and previous values ​​and at the same time allow me to update the current line? Thank you. I am not saying that this is the best way, however, can be: $ rows = SELECT id FROM & lt; Table & gt; Forex currency ($ lines as $ line) {$ prev = SELECT number FROM OK, similar object can be obtained through the cursor.

javascript - Is it possible to make chartjs charts scrollable? -

I am trying to create charts for my analytics data using chart.js This is one. Presently it is with the default sample data. What I want to do is something like, infinite scrolling from left to right: How can I apply? Var randomScalingFactor = function () {return Math.round (Math.random () * 100)}; On lineChartData = {label: ["January", "February", "March", "April", "May", "June", "July"], Dataset: [{Label: "My First Dataset", fillColor: "Rgba (220,220,220,0k2)", Strokekolor: "Rgba (220,220,220,l)", Pointsolor: "Rgba (220,220,220,l)", Pointstrokekolor: "#fff" Pointःiligtfill: "#fff" Pointःiligtstroke: "Rgba ( 220,220,220,l) ", data: [randomScalingFactor (), randomScalingFactor (), randomScalingFactor (), randomScalingFactor (), randomScalingFactor (), randomScalingFactor (), randomScalingFactor ()]}, {label:" My second dataset ...

php - How do I select the highest column value in an SQL query IF another column is equal to a certain string -

I am trying to set up a matching system that chooses the highest value of two separate questions. I have seen other answers on the site and they do not help, I want to compare it originally: I want to get the highest value from the version column where type is equal to, for example "code> type1 ". I want to get the highest value from the version column, where is of type is equal to " type2 ". I want to compare these files with PHP and find out that type2 's version to type1 ' s version . Is there any way I can do that? Edit: Brian Dimilia has answered this question. Has a moderator answered it? I believe this will do the job you want: Select the version, type from tbl, where version = (maximum) (from tbl) select where type ('type1', 'type2')) Type Result column will show 'type1' if maximum (version) was associated with a type 1 record, or 'Type 2' if maximum (version) was connected to a t...

How to define Actions in LightSwitch ODATA and use them from LightSwitch HTML client -

My first question is on the stack overflow, so apologies if not right from the beginning ... My question is actually two times: Do I define the ODATA functions on the LightSwitch application data service (or any other internal defined data source) service level or entity set / entity level Can i do If so, how do I do this? (I can not find the route information in the application where I can override.) How do I redeem these tasks from the customer's behalf (built-in MS JS object Models in MSL or through Screen / Entity)? Even if LightSwitch could not work / can not work, I would like to know how to consume them on behalf of the client, because we are exposing the external Odata data sources to the customer through LightSwitch (And there are verbs defined in these ODATA sources). I know that I can use Jadata in favor of the customer and can use it to perform actions on the Odita source, but I would like to know whether LightSwitch has built-in support for it. More i...

xml - how to display a parent of an element only if it contains an attribute -

Trying to solve a puzzle, I want to display only a grand parent of an element If there is an attribute (no attribute) in it thanks in advance! I have the following code: & lt; Xsl: when test = "content / track" & gt; & Lt; Xsl: each selection = "content / track" & gt; & Lt; Div class = "container_orange" & gt; & Lt; Xsl: Select Value = ". / Text ()" Disable-output-escaping = "yes" /> Is & lt; B & gt; Current & lt; / B & gt; And & lt; B & gt; & Lt; Xsl: Select the value = "name (../..)"/& gt; & Lt; / B & gt; & Lt ;! - Shows only the name of the node which is a grandparent, but how does one attribute position? - & gt; & Lt; / Div & gt; & Lt; / XSL: for-each & gt; & Lt; / XSL: When & gt; Positions are called predictions and they are known in square brackets so that ../ . [@ *] selects grandparents who have any spe...

Split string Ruby on Rails based on number of characters -

मैं इन नंबरों को विभाजित करना चाहता हूं a = 900000 b = 1800000 c = 5000 एक [0] = 900 एक [1] = 000 ख [/ code> इन में एक [ 0] = 1800 b [1] = 000 c [0] = 5 सी [1] = 000 मैं यह कैसे कर सकता हूं? श्रेणी के साथ प्रयोग: a = 1800000 [a.to_s [0 ... -3], ए.टी.ओ.एस [-3 ..-1]] # = & gt; ["1800", "000"] का उपयोग करना a.divmod (1000) # = & gt; [1800, 0] ए.डि_मॉड (1000) .मैप {| n | | '% 03d'% n} # = & gt; ["1800", "000"] नियमित अभिव्यक्ति का उपयोग करना: a.to_s.match (/ (। *) (। {3} ) $ /)। कब्जा # = & gt; ["1800", "000"]

ios - How to pass data from form FormSeetController to the ViewController? -

I am trying to use this package: Now my question is, after I dismiss the formsheet, I am trying to cross the data between the form control controller. {// Maybe I can use UIViewController * VC in my SearchGardenView (form sheet), but how? [Self-subscripted dysmic]; // Here I'm trying to get the baby gardenid but its always zero; }; And this is from the preset controller: AddKid * kid = [[AddKid alloc] init]; NSArray * temp = [_responseDict value forKey: @ "id"]; Kid.kidgreenidid = [temp object endx: indexpath.ro]; [Self mz_dismissFormSheetControllerAnimated: Yes complete handler: ^ (MZFormSheetController * formSheetController) {// This rejects block formsheets}]; To see IM, it is necessary to pass the 'KJard IDD', but it is not always zero, even after this, I gave it as code above the show. Probably because the ViewController has already been loaded and when I came I need to find a way to cross that data, can you please help me? Ed...

.htaccess - Render symbolic link without redirecting -

I want to reach / rss-2 / at / rss / news Php (This file does not exist) Currently the feed (generated by a wp plugin) shows the feed / rss-2 / , I want to show it on the second page too. I tried Rewity condom% {REQUEST_URI} /rss/news.php Rewriteum ^ (. *) $ / Rss-2 / [R] But I can not find the appropriate flag which gives the destination instead of redirecting it. Looks at the WordPress URL in the address bar, you do not have to rewrite the URL. You can use the [P] flag for the proxy for the request, but I have heard that it is quite expensive because you are making an additional request on your own server with that URL. The second request will see the RSS-2 and handle it accordingly, which will pass it to 1 request, which will show it to the user. Additionally, a proxy connection has to be set for each request. See for more information.

Assign value into Dictionary that has a key type of <Tuple<int,int> C# -

I am writing code to generate a grid which is a graphical editor containing grid values ​​in a dictionary It is my method that I am working with you, to give an idea about this is the way to create your dictionary object. public dictionary & lt; Tupal & lt; Int, int>, string & gt; Generate GenerationTable (int _x, int_y) {int total = _x * _y; Var Grid = New Dictionary & lt; Tuple & lt; Int, int>, string & gt; (); //! It is needed later! (Int i = 1; i & lt; = _x; i ++) // External loop column {for (ii = 1; ii & lt; = _y; ii ++) // Inner loop line is - { Grid.Add (Tupl. (I, ii), "O"); }} Return grid; // should be equal elements of integer I know what to provide in the index to change the value. This is another method. Public zero color pixels (dictionary & lt; tuple & lt; int, int>, string & gt; _table, int _x, int _y, string _c) {foreach (_table) Where var pixel (k => KK.itim1 == _x and KK.itm 2 == _y)) {} // va...

javascript - Highcharts: Decide on charts placement after generation -

Is there any possibility of applying a high charge chart after it's ready? The background is that I have a dedicated container (i.e. -node) where the user will select one of the two potential charts. So I want to generate two charts, where users can go back and forth from one side to another as two (or possibly even more) charts, I have to generate them once in the beginning Want to I have always used all the examples and documents related to and gt; & Lt; Div & gt; -node: $ has created a high chart chart beginning with ('# container'). High Charters ({Series: [[Data: [29.9, 106.4, 12 9.2, 144.0, 135.6, 148.5, 216.4, 95.6, 54.4]}]}); Perhaps, you can use rendereTo to assign a chart: var myChart = new highcharts. Chart ({chart: {RenderTo: 'container'}, series: [[Data: [29.9, 106.4, 12 9.2, 144.0, 135.6, 148.5, 216.4, 95.6, 54.4]}]}); But: what I see is something like this: // First, define the chart (without any lieutenant; div...

ios - userInteraction is enabled but button action isn't called -

Image
I'm new to iOS programming my cell in a NIB. This cell displays an image that is working fine. I do not want the cell to do any work or to be selected. Therefore, I have the following code: cell. Selection style = UITableViewCellSelectionStyleNone; Cell.contentView.userInteractionEnabled = Yes; My problem I have a button that is not said on touch. I have an action defined Sel.am file but nothing happens I button to add programmatically, but in vain. I appreciate any help or signal because I have tried this for the past few hours. I am pretty sure that I am doing something silly. Update: This way my cell xib structure looks - Cells there. Nib, cell.m and cell.h. The main view controller is that it uses the DQURU equilibel vethidentifier method to get the cell. It works fine because I can see cell with the correct image. The action method is defined in cell.m Here is the xib file thanks. After you check SHTableCell.xib That you have prevented user interac...

sql - Automating the scheduletable of jobs -

There was a table where we had the names of the nomenclature and the time of tahara was stored there, I will run a script which Runs and checks if any Actually I want to create a script which will call my SQL query For example, the name of the table is SCHEDULE. .column JOBNAME and COLUMN SCHEDULE_TIME to move and rhythm Believing that the work was going on and when it was called "Joblo" and the actual time of every job is stored on that table in the column called "ACTUAL_TIME", then you will run something like: It will show the jobs that were set, or the job which was set to last 10 or more minutes, but which have not yet started (in the latter case, the third column will be zero) f S.jobname, S.schedule_time, s.jobname = l.jobname, where l.actual_time & gt; S.schedule_time or (l.actual_time is zero and (sysdate - s.schedule_time) * 24 * 60> = 10)

serial port - How to use NModbus and C# with PLC to to turn outputs on and off -

Hi all I am using the NModbus library, and was running on VS2012 and then VS-2010, but it was trying to run for VS 2008. And it's going to be better. When I run the code in DOS prompt, this is my output Modbus.IO.ModbusSerialTransport Write - TX: 1,16, 7,208,0,3 , 6,0,1,0,5,15,14,14,152 modusbus.io.modbusrtrrrrrrrrrrrrrrrrrrrrrrrrrrr transport-rx: 1,16,7,208,0,3,128,133 Now when If I run this script then I get flicker on my PLC unit for Rx and TX, but I do not see high output on my PLC here. Ministry associated piece of code {(serialport port = new serialport ( "COM1")) {// configure serial port port.BaudRate = 38400; Port.DataBits = 8; Port.Parity = Parity.Odd; Harbour. Port = stop One; Port.Open (); // modbus Master Build IModbusSerialMaster Master = ModbusSerialMaster.CreateRtu (port); Byte Slave ID = 1; Ushort startup base = 2000; // ushort [] registers = new users [] {1, 2, 3}; Ushort [] Registers = New Users [] {01, 05, 15}; // write three registers maste...

javascript - Save div order in local storage -

I'm using the Shapeshift jQuery plugin which was very easy to set up and use. But now I want to be able to save the div order in local storage so that the browser starts the next time and the div order will not change. I am absolutely new at the local level (like I had started reading about it a few hours earlier) and I am unable to understand it. Please help me LocalStorage is just a key value combination that can actually be used in this form: localStorage.setItem ("key", "value"); If you want to save the div command in it: localStorage.setItem ("divorder", "// div" // "); If you want to store the margin value, then store it in the following form: localStorage.setItem ("marginval", "// Margin value // "); You can get values ​​from the local level and keep them in variables or you want to: var margin = localStorage.getItem ( "Marginval"); Var divord = localStorage.getItem (...

javascript - Remove class on radio's that are not checked -

इसलिए मुझे यह कोड है & lt; ul id = "id_priori" & gt; & Lt; li & gt; & Lt; label = "id_priori_0" & gt; के लिए & Lt; इनपुट आईडी = "id_priori_0" नाम = "प्राथमिकता" प्रकार = "रेडियो" & gt; होल & lt; / लेबल & gt; & Lt; / li & gt; & Lt; / ul & gt; और यह कोड $ ("# id_tipo")। पर ('क्लिक', 'ली', फ़ंक्शन () {var self = $ (यह), रेडियो = self.find (": रेडियो") [0]; रेडियो। चेक किया गया! रेडियो! चेक किया गया; self.toggleClass ('on', radio.checked);}) .find (": रेडियो" ) .each (फ़ंक्शन () {$ (यह) .closest ('li')। ToggleClass ('पर', this.checked);}); मुझे क्या चाहिए जो सभी लेबल, जिनकी रेडियो की जांच नहीं की जाती है, को छोड़ना है? $ (": रेडियो: नहीं (चेक)")। प्रत्येक (फ़ंक्शन () {$ (this) .clostest ('li')। RemoveClass ('पर');}) ; वैसे भी, यह मानते हुए कि सभी रेडियो जुड़े हुए हैं...

mvvm light - Set Up INavigation with Xamarin.Forms and MVVMLight IOC -

I'm using MAVVML for XMERIN. IOC set up to create my first content page in the form and app Need some help to get .GetMainPage. My ViewModels have such constructors - public class newstype 1ViewModel: ViewModelBase {Private Readonly IContentService contentService; Private Readonly Invention Navigation; Public listing & lt; ContentModel & gt; Receive {content; Set; } Public Notatip 1 View Model (Navigation Navigation, IContent Services Service Services) {this.contentService = contentService; this. Navigation = Navigation; } My content pages have constructors - public partial class news type 1CP: content page {private newstype 1 viewmodel vm; Public Noutip 1CP (NewsTip 1ViewModel vm) {InitializeComponent (); I am using a ViewModelLocator class as the following - Public class ViewModelLocator {Public ViewModelLocator () {ServiceLocator.SetLocatorProvider (() = & Gt; SimpleIoc defaults); // service if (apps.probboad) {simplecok.default. Registrar & ...

dart - import polymer core-scaffold breaks google maps -

I have some working dart polymer code that shows a google map with some markers on it to show me a little bit It's been late, because it seems that the initial routine is a bit worse and it seems that sometimes it does not have enough time to load the map div before it tries to render again before. Anyway, as I said that I am getting the job now I wanted to keep a core band around it because they do it on many demos. The minute I add this line ... ... the whole thing breaks down, I get the console error: Exception: Class' GEliment 'is not an example method' [ ] '. NoSuchMethodError: Method not found: '[]' Receiver: Example of 'GElment' arguments: ["map"] I have commented on all other lines and subtracted it only on it is. / P> (as of today), using DartEditor 1.5.8 and upgrading to mode 0.12.0 This upgrade was done by core_element and paper_element to 0.1.x (before 0.0.x). . It looks fine now (although there is still ...

Is it possible to make both TCP and UDP connections between two pieces of software -

I am currently developing a highly sensitive game in Python using the client-server model. The speed of data exchanges between clients and servers should be very fast. Is it possible to make both UDP and TCP connections? Hats will be used only during the game. And TCP will be used for more reliability-essential messages such as connections, name change, chat ... Is this a good way to think? Or should I use UDP only? Yes, it might be a good idea to stop a lost packet full stream with UDP does not do. On the other hand, you need retraining and crowd control. I try to send messages through UDP and if there is no confirmation on a TTP connection, then they should be sent again on a TCP connection open. It should take 99% load of load to UDP and use crowd control and reliability for TCP.

multithreading - C# async await and threadpool -

I understand that when async is used and waits on a method called on UI thread That the UI thread can be freed to others, while waiting for something to finish the job, if I wait for the use of async method called a threadbull thread with that thread thread thread, while IO Does it complete? Is it back in the pool? When IO is complete, in the latter case what thread fulfills the method? If I wait async on a method called a threadbull thread, that thread of thread Happens while IO is complete? Is it returned to the pool? Yes, the thread pool thread is returned to the thread pool. When IO is completed, what does the thread accomplish in this latter case? By default, waiting will capture an existing "reference", and it will wait for the async method when is complete This is the "reference" Synchronization contaxes. Current Unless it is null , in that case "context" is functional. Current . In the UI case, there is a UI Synchro...

mysql - Trying to update one table from another -

I created this query and I can not seem to make it work. I have to admit that I am new on this, I have written a few simple questions in the past but I have not tried to update any other table before. I have seen some related posts here, but maybe I am just dense Am ... they are not looking to help. Here's what I am using: Insert in `customers_marketing_options` (` created_on`) Select `build_on`, from` client`, from where 'customer' 'Customer_id' = 'customer_marking_pop'. Customer_id`; Any help would be greatly appreciated. Connect customers to consumers / connect customers with customers customers.customer_id = customers_marketing_options.customer_id SET customers_marketing_options.created_on = customers.created_on

How to avoid creation of zero byte files upon closing a python file in 'w' mode due to an error? -

I am using Python 3.4.1 64bit on Windows 7. It's a question in hand, AFX, but I have included information in the case. Here is the relevant part of my code: def download_and_save (URL_list, file name, download_dir): # Process list for URL, file name in zip (URL_list, file name): # complete path Generate name FILE_PATH = Open the file = Download_dir + filename #. Open (FILE_PATH, 'Mau') with local_file as: # Write whatever url is on try: local_file.write (urllib.request.urlopen (url) .read ()) urlib.request.URLError as e Except: ifattat (e, 'cause'): print ("We failed to reach server ...") Print (E. Creston) Alief Hatter (E, 'code'): Print ("The server requested the complete .. ") print (" Error code: ", e.code) When I run this part of the code, I went to a bunch of errors ( Getaddrinfo failed - t Because of Ipo). When I checked the directory where it was saved later, I hope that a group of files with the file name was ...

In Swift how to call method with parameters on GCD main thread? -

In my app I have a function that creates an NSRURL session and uses Sesh.dataTaskWithRequest (req, completionHandler: {(Data, Feedback, Error) In this whole block of work, I need to make some calculations which call Adds a UIImage to the View Controller if I calculate the UIMAJ-add, so if I try to run it then the integer To see the code inside the block, Xcode says an error that I can not use the layout engine in the background process, so I found some code on SO, which tries to line a method on the main thread: sending time = send_time (DISPATCH_TIME_NOW, Int64 (0.0 * double (NSC_ PER_MSEC)) Send-time (time, transmission_gate_mine_qu), {back = UIApplication.sharedAppl Ication (.) SendAction (" DisplayQRCode: ", to: self.delegate, from: self, avent: zero)}) However, I do not know how the parameters of this function the "call Adder" and "volume BTC" I can recommend an optimal way to add I can do this, or a method call in the queue of an appl...

haskell - Creating (getting) a value instance from a phantom type -

I am using GADT to create original dimensions for currencies (according to the physical dimensions). Dimensions (such as USD, USD / EUR, EUR / USD) are displayed in the form of phantom type I would like to be able to print the quantity of a currency in the style of the example "10.3USD" or "0EUR" and rates such as show By using "10.3USD / EUR" I'm not sure how to describe my problem, so I would go for an example of how to solve it: {- # LANGUAGE GADTs # -} class) = & gt; Currency is a where unphantom :: A data USD = USD USD Show data EUR = Euro show example currency currency USD where unphantom = USD example currency EUR where unphantom = EUR data zodiac where one location :: currency one => Float - & gt; Show an example amount (amount A) where show (zodiac x) = show X ++ shows (Unfantom :: A) data where rate :: (currency A, currency B) => Float - & gt; Rate AB - ... With this code, I get an error $ ghc example.hs [1 of 1...

c++ - When can I use a forward declaration? -

I am looking for definition when allowing me to announce a class forwarding in another category header file : Do I allow it for a base class, a class organized as a member, to pass a member function from the context, etc.? Keep yourself in the compiler's position: When you declare a type of forward, all the compilers Knows that this type is present; It does not know anything about its size, members, or methods, that is why it is called incomplete type , therefore, you do not use the type to declare a member, or base class Because the compiler will need to know the type of layout. Assume the following forwarded declaration. square X; What can you do with an incomplete type: Li> incomplete type Announce a member to become an indicator or a reference to: class Foo {X * pt; X & PT; }; ); X F2 (); zero f3 (X *, X & amp;) {} X & amp; F4 () {} X * F5 () {} What you can not do with an incomplete type: Use it...

Python, CSV, skipping lines based on content -

I am handling CSV files with buffer rows before the header, the number of rows changes and some rows are stringed Nothing is nothing but the one thing that is consistent is that one or more cells in these buffer rows have zero values, so I am trying to release any line from a null cell. I've got this scripting outputting a blank file on the following script. I am feeling that I am not getting 'and' but I am feeling that if I put it in a loop, then I will prepare a file for each line ... Outf ("out_" + fileName, 'wb') in the form of inf (filename, 'rb') as outf: csvreader = csv.DictReader (inf) if 'csvreader.fieldnames' In: next (csvreader) else: fieldnames = [name 'url_source', 'downloaded_at'] + csvreader.fieldnames # csvwriter = csv.DictWriter (outf, field name) for csvwriter.writeheader () Add column name to node, in enumerate Line (csv Reader, 1): csvwriter .writerow (dict (line, url_source = csvUrl, downloaded_a...

php - Laravel Directory Restructuration -

I am very confused as a way to change Laravel's directory structure. I changed my directory structure to go to this structure: source file + app + bootstrap + public In the structure: source directory + app + public + bootstrap To change the directory structure, I have the public Code> bootstrap / path Code>, so it looks like this now 'public' = & gt; __DIR __. After doing this, app / public / index.php was giving me an error by saying that it was' '/ .. / app / public' Find the t autoload.php or start.php , so I went inside the file and the path of the two files was changed to the following: Expected __DIR __. '/.../bootstrap/autoload.php'; $ App = require_once __DIR __. '/ .. / .. / bootstrap / start.php'; Now the localhost: 8000 is actually loaded, but there is a problem - to be able to load css / javascript files, they require a In two directories, with / public and / app / public If I extract th...

javascript - What sort of monster is this? -

I got some javascript that looked like this, and I wonder what was it. It functions like a singleton class defined and installed within a variable declaration. What kind of construction do I say? & lt; Script & gt; Var abacus = {runningSum: 0, Ads: function (i) {this.runningSum + = i; This return }, Deductible: function (i) {this.runningSum - = i; This return }} Console.log (abacus.addSum (3)); Console.log (abacus.subtractSum (2)); & Lt; / Script & gt; This is not a monster, it is an unknown object constructor (literal), which is called abacus variable Has been assigned. It has three properties: running, adm, and substratems AddSum and subtractSum anonymous tasks are assigned.