Friday, 15 July 2011

java - how to search sum of numbers in Binary Tree? -


I need to find any combination of numbers in the binaries, which will give me the amount I'm looking for . For example, for that number of trees: 9,1,6,3,2,5 If the system gets the sum of 18, then this string will return "9,1,3,5". How can I do this? .

The combination needs to start with root and pathway & amp; The method requires working in backtracking recursion

I have written the code:

  public string path (int sum) {return path (amount, route); } Private string path (integer amount, node t) {if (t == blank) return ""; Sum = sum - t.getNumber (); If (zodiac == 0) returns T.getNumber () + ","; Return path (zodiac, T. leftfone ()) + path (zodiac, T. gatititon ()); }   

Your recursive implementation is actually It is near, but there are some things that require some adjustments.
First, two things need to be done for the recurring implementation:

  1. base case This problem ultimately leads from the point of view of division and win
  2. General case which is used to split the problem into small pieces until reaching the desired base case .
    You have gone into the problem that you are printing only the last node that your yoga is zero The reason is that the reason you revise is because the last call will again return to the method it is called, where the amount is more than zero .


    If that tree reaches one leaf and no amount is found, then it is not present in the sub-tree.
    return "";

    And if amount is is found in sub-tree
    return t.getNumber () + ",";

    Other We have not reached this amount, there are more children nodes
    path (t.getleftSon ()); Path (t.getRightSon ()); Return t.getNumber () + ","


    I have not tested this exact code in an IDE, but the argument must be correct


objective c - iOS rubymotion app poor performance -


Works fine on my app emulator, but it is very slow and long on the real device (iPhone 4). Push animation is engaged and scrolling is now smooth here is an example of controller

hummmm It is not a simulator, but a monituting tool that can help monitor the process of the app in real device.


Problems with version of kgdb patch -


My kernel version is 2.6.35. I can not find any Kilo DB 2.6.35 online.

Does anybody know which DJB can I use?

After kernel 2.6.35, both KGDB and KDB kernel sources are embedded in the tree, so for them There is no patch file.


java - How to make Liferay control panel fields like Web-Content's Description a mandatory input field? -


I want to make some fields in the control panel whenever a new web-content, structure or a template creates I want it to not be saved, as long as the user has added some text in the description and other fields. Apart from this, I want to be able to check the grammar of the text written in these areas. I think I might have to use some web services to do this. Is there something outside the liphere to achieve it? If I want to write code, will I make a hook? I want to do this on Liferay 6.1. Thank you. Enter image details here Example: Make a description field as a required field in this screen-shot, as soon as There is no name.

whenever a new web-content, structure or template, I want it to be Unless the user has added a text to the description and other fields.

Is it looking for you? If not, please provide a practical example.

Edit:

Option 1 : Create a "structure" with the field "Details" with type HTML, and make it Required < / Strong> Add web content to the newly created structure.
Option 2 : Create a "hook" to add verification to the basic default web-content

For grammar check :
See plazes at the following link: [Lifier Portal 6 in SCAYT and CeEditator]

Hope this will be helpful.


prolog - Generate list of numbers to fit certain criteria -


I had a predicate for creating a list of numbers,

  gener_numbers (0 , []). Generated_num (n, [head | tail]): - N & gt; 0, is head N, N1N -1, generated_ number (N1, tail).  

I am trying to modify it so that these numbers increase X and Y to a limit. The conditions are that 1 & lt; X & LT; Y and S = X + Y and S < 100 .

I am struggling to work, how to do it, I have tried, but it is not right anywhere.

  gener_numbers (1, []). Yield_number (x, [[head, y, s] | tail)): - x> gt; 1, Head X is, Y is x1, sx + y, x1 x -1, generated_ number (x1, tail).  

I have S & gt; 100 but he stopped the code from working at all.

My later output was [1,2,3], [2,4, 6], [39, 12], [20,25,45] . Obviously these are some examples, in reality there will be 1000s.

I think I might need to recurse twice. Add 1 to X while adding 1 to 20 until the extent does not reach the limit, add 1 to X and keep adding 1 to 1, until it reaches the limit and make sure to do it again and again That every possible pair has been created.

There are a few ways for this approach to formulate tremendous force to iterate on one of the two pairs in the equation For the base layer is the second layer. This solution will provide the first list in the order of the total amount, then X :

  with the value of gen_numbers (maxSum, the result): - MaxSum> 1, gen_numbers (2, maxim, 1, result). Gen_numbers (Yoga, Yoga, Yoga, []). % 'Yoga' has reached the maximum value value (points, maxms, yoga, results): -% 'X' has reached the maximum value  

By counting down instead, I can forward the list and retain tail recurrence without the use of an assist list. I was compelled by X and yoga and y is different

A cleaner approach to use the CLPFD library and the terms To specify the constraints of:

 : - use_module (library (CLPFD)). Yoga (yoga, [x, y, s]): - [x, y] these 1. SUM, yoga ([x, y], # = and lieutenant; yoga), label ([x, y]) S X + Y. gen_numbers (maxim, result): - Search ([x, y, s], equation (maxim, [x, y, s]), result).  

Here, equation / 2 presents one of each solution at a time, and findall / 3 collects them . This solution is easily scalable to make more resolution.


Hidden Parameters for drop down selections using tlist/SQL -


To give you some perspective on the question in hand, I prepared a report for a student information system that On the selectable criteria from the set of pulls drop down, on an html page List / SQL is used in the drop-down list There are only 3 drop downs in the current report:

The start date, end date and game logs are codes for the sports drop down here:

  select log.logtypeid, when logged in subtype null THEN '' ELSE log.subtype END subID, lt.Name logotype, case WHEN To_char (st.ValueT) is empty THEN '- No' ELSE '-' || Login to To_char (st.ValueT) END Subtype Log Inner GN Lieutenant. Logtypeid = lt.id LEFT OUTER gene ST at ST.Name = to_char (lt.ID) and st.value = log.subtype and st.Cat = 'subtype' where lieutenant. = 'Log-tip' and log .logtypeid = '3 9 35' Subtype by order  

For the report to prepare the report now, I believe that I am listed in the drop down or Each selection is required in the game drop down to pull some data in your current situation, and the way it should remain ...

  Game - Baseball Game - Bowling Games - Boys Basketball Games - Boys Golf Games - Dancing El - Diving  

represents the game Logteepeed 3935. The subtype in the baseball is 101, the bowling subtype is 102, etc.

To draw the report to design the data, there are two additional subtypes that need to be pulled, but unfortunately they catch a separate Loppipid, 626. Therefore, if the student has a 3935 (logotype) 101 (subtype) in ID 1, then he / she has his / her 626 (logotype) 29 (subtype) and 626 (loppiped) 43 (subtype).

  Example of data: Student LooseIP SUBTYPE 6382 626 27 6382 626 41 6382 626 38 6382 626 43 6382 626 29 6382 3935 109 6382 3935 117 6383 626 43 6383 626 30 6383 626 43 6383 626 25 6383 626 43 6383 626 14 6383 3935 117 6400 626 38 6401 626 28 6401 626 36 6401 3935 110 6402 15 3 6405 3935 101 6405 3935 115 6405 626 29 6405 626 43 Make it so easy For (I hope), all 3935 games should be displayed in the dropdown, as well as related subtypes Any student on whose criteria is set (only one game can be selected at a time), in the report Not log-type 626, subtype 29, and Logipeed 626 subtypes should draw the 43. I believe the case can fall between the answer, but I am unsure about the syntax. Any help or suggestions would be greatly appreciated. thank you in advanced. 


filter - How can I sort a column based on previous column in angularjs -


I want to sort the two columns, which are related to the example: I sort a name, and Then I want to sort the list name according to date, but, when I do this, it overwrites my type and changes it according to date and ignores this type on the basis of name,

Is it possible to date a date by name? When do you click on the top? If someone can give me a hint, please?

  $ scope.filteredList = null; $ Scope.orderByName = function (intermediate, reverse) {if ($ scope.filteredList == zero) {$ scope.dataList = $ filter ("orderby") ($ scope.dataList, predicate, reverse); $ Scope.filteredList = $ scope.dataList; } And $ scope.dataList = $ filter ("orderby") ($ scope.filteredList, predicate, reverse); $ Scope.filteredList = $ scope.dataList;}} $ $ scope.orderByDate = function (bottom, reverse) {If ($ scope.filteredList == zero) {$ scope.dataList = $ filter ("orderby") ($ scope.dataList, predicate, reverse); $ Scope.filteredList = $ scope.companyInfo;} and ($ scope .companyInfo = $ filter ("orderby") ($ scope.filteredList, predicate, reverse); $ Scope.filteredList = $ scope.dataList;}}; HTML: & lt; a ng-click = "reverse =! Reverse; Orderbayanam ('date', reverse) "> an ng-click =" reverse =! Reverse; orderbreeder ('name', reverse) ">   

code here That's me I use it, but every time I click on any column, then this data changes again.

You may want to write your own order through the function. Your HTML can look like:

  ng-repeat =" employee in staff order: my assertfunction " 

In your function, you can type something like this:

  $ scope.mySortFunction = function {employee} {return employee. Name + '~' + employee .Date; }; In your case, the code below should work:  
  $ scope.filteredList = null; $ Scope.orderByName = function (intermediate, reverse) {$ scope.sortedOnName = true; If ($ scope.filteredList == zero) {$ scope.dataList = $ filter ("orderby") ($ scope.dataList, predicate, reverse); $ Scope.filteredList = $ scope.dataList; } And $ scope.dataList = $ filter ("orderby") ($ scope.filteredList, predicate, reverse); $ Scope.filteredList = $ scope.dataList;}} $ $ scope.mySortFunction = function (data listing) { Return Data ListEnment.name + '~' + Data ListAddmentDate;} $ Scope.orderByDate = function (predicate, reverse) {if ($ scope.sortedOnName) {if ($ scope.filteredList == zero) {$ scope.dataList = $ Filter ("orderby") ($ scope.dataList, $ scope.mySortFunction, reverse); $ Scope.filteredList = $ scope.companyInfo;} and ($ scope.companyInfo = $ filter ("orderby") ($ scope .filteredList, $ scope.mySortFunction, reverse); $ Scope.filteredList = $ scope.dataList;}} and {if ($ scope.filteredList == faucet) {$ scope.dataList = $ filter ("orderby") ($ Scope.dataList, predicate, r S); $ Scope.filteredList = $ scope.companyInfo;} and ($ scope.companyInfo = $ filter ("orderby") ($ scope.filteredList, predicate, reverse); $ Scope.filteredList = $ scope.dataList;} }};  

Theoretically it should, but if you make some corrections to make it work, please let me know so that I can update the answer.


Joint Probability Distribution in R -


I have marginal distribution and my x, y variables are not independent.

Thanks

This R-package IPSUR

Please see in the package documentation, especially 7.1 joint and marginal probability determination


javascript - How can I remove newline characters at the beginning and ending of a string? -


मुझे नीचे स्ट्रिंग है:

  var str = "\ ncat \ n"  

उपरोक्त स्ट्रिंग से मुझे आउटपुट होना चाहिए

  str = "cat"  

क्या कोई भी है ऐसा करने का सबसे अच्छा तरीका है?

आपको स्ट्रिंग के चारों ओर सफेद स्थान वर्णों को ट्रिम करने की आवश्यकता है, इस तरह से

  console.log ("\ ncat \ n" .trim ()); // बिल्ली  

आप एक स्ट्रिंग का आरम्भ और समाप्त होने वाले सभी सफेद स्थान वर्णों को भी निकाल सकते हैं, जैसे कि

  console.log ("\ T \ t \ t \ r \ ncat \ t \ r \ n \ r" .replace (/ ^ \ s + | \ s + $ / g, '')); // बिल्ली  

नियमित अभिव्यक्ति का मतलब है कि स्ट्रिंग की शुरुआत में एक या अधिक सफेद स्थान वर्ण ( \ s का अर्थ सफेद स्थान का अर्थ है) ( ^ का अर्थ स्ट्रिंग की शुरुआत है) या स्ट्रिंग के अंत में ( $ स्ट्रिंग के अंत का मतलब है)। + के बाद \ s का अर्थ है कि एक या अधिक बार से मेल खाएं जी के बाद / वैश्विक मिलान का मतलब है, यह वास्तव में एक बार से अधिक बार RegEx मैच बनाता है इसलिए, जब भी मैच मिलेगा, तब उसे खाली स्ट्रिंग के साथ बदल दिया जाएगा।


DD-MM-YYYY date format possible for input in orbeon? -


I use the Orbeon form and I have calendar input.

When I select a date, I show the date in American format: MM / DD / YYYY for example, I have 1/27/2015!

How can the date in the input URI format DD / MM / YYY show? Like the 27/01/2015

I have tried without success:

   ... ... & lt; Fr: view & gt; ... & lt; Xf: input id = "startOfWork-control" bind = "startOfWork-bind" class = "" date = "[d] / [m] / [y]" & gt; & Lt; Xf: label ref = "$ form-processing / startof / labels" /> & Lt; Xf: signal riff = "$ form-processing / startof / hint" /> & Lt; Xf: warning ref = "$ fr-resources / detail / labels / alert" /> & Lt; / XF: Input & gt; ... & lt; / Fr: view & gt; ...  

You can set oxf.xforms.format. Input.date property as [D] / [M] / [Y] , as:

    

And you can find more in other supported values.


What happens if orchestration triggers a salt-master service restart? -


Suppose I have an orchestress file that runs salt-formula salt. Suppose I made some column changes, which gives results in an update in the master's config file, in return for causing the salt-master service to be restarted.

What happens to running the remaining orchestra? Specifically, what happens if the config change is like some GitFS remotes, where new files may be available after salt. Master status runs?

Text "itemprop =" text ">

Once the salt master service is restarted, a highway prevents the death of its tracks in salt-master restart to maintain the state highways. There is no work to do, where you put a flags or grains on the file system and check your Highways for those flags.

It is being said that If you try the state The Sarreastri or State Runner, which is not necessarily dependent on the salt-master daemon, I have not tested it, but the state is most likely the circuit, although the salt-master daemon is restarted.

I can have some time for testing sometime, but I recommend this test in your environment.


c# - WPF Print/ Print Preview Using DocumentViewer -


I am trying to get print preview to work but I do not see anything. I have a form called a screenshot form which uses document view here is the xaml code:

   & Lt; / Catalyst & gt; & Lt; /Style.Triggers> & Lt; / Style & gt; & Lt; /DocumentViewer.Resources> & Lt; / DocumentViewer & gt;  

The code behind it only returns a property property:

  public IDocumentPaginatorSource document {get_viewer.doco; } Set {_viewer.Document = value; }}  

I then have my visual model which I call to do a print preview to call screenshots. This is the place where I'm trapped window pops up properly, but it does not display any content.

  ScreenshotsForm oForm = New ScreenShotForm (); OForm.DataContext = This; OForm.ShowDialog ();  

I know I'm missing something, but I can not understand it. :?


elasticsearch - Logstash stops receiving after some time in ELK stack? -


मेरे पास ELK स्टैक (एलस्टिकसेचर / लॉगस्टैश / किबााना) स्थापित और चल रहा है।

मैं एक सर्वर का उपयोग करता हूं जैसा कि ELK सर्वर को अन्य सर्वर से सभी लॉग एकत्र करने और संग्रहीत करने के लिए लॉग-फास्ट-फॉरवर्डर को ELK पर लॉग भेजने के लिए उपयोग किया जाता है। समस्या यह है:

लॉग्स्ट लॉग्स के एक बहुत प्राप्त कर रहा है (जैसा कि मैंने tailf logstash.stdout के साथ चेक किया है) पर कुछ अवधि के बाद जब मैं tailf logstash.stdout फिर से, लॉगस्टेश डेमन को पुनरारंभ करने के बाद इसे पुन: प्राप्त करने के बाद कुछ भी नहीं (लॉग प्राप्त नहीं करना) हो सकता है।

"post-text" itemprop = "text"> < P> जब आप फ़ाइलों में डेटा को फ़िल्टर करने के लिए लॉगस्टैश का उपयोग करते हैं, तब जब लॉगस्टास को ईओएफ (फ़ाइल का अंत) मिलता है, तब क्या होता है जो आपने कहा था।

अगर ऐसा लगता है कि मैं सोच रहा हूं, तो आप यह कर सकते हैं:

shippers का उपयोग करने के मामले में, शायद फाइल के समान काम करता है।

लेकिन अगर आप बेहतर अपनी समस्या / त्रुटियों का वर्णन करते हैं तो आप अधिक संभव प्रस्ताव प्राप्त कर सकते हैं।


windows - Why could the behavior of batch script be inconsistent on various computers? -


I am writing a batch script to automatically push and drag on the git (for reasons I will not go here).

The script works fine on my PC, but my colleagues do not work on the computer. It goes to the part where MessageBox.exe asks what you want to do , But I get an error on his PC

  Find: Yes: Can not specify file or directory.  

The script works fine on my PC. We have only one OS, so I do not know where to start from.

I know this is a very loose question, and I'm new to scripting in Windows, but any signal would be great. / P>

Thanks! % script path% temp2.txt "Yes"! Scripts Path! Temp 2. TT & amp; (! Scriptpath! Inputbox.exe "Commit Message:" "GIT Imperative Is ticking ... "& gt; Scriptspath! Temp 2. Txt set / p commitMessage = & lt ;! Scriptpath! Temp2.txt Echo! CommentMessage! Git add.Git commit -a -m"! CommitMessage! " Git push). (Echo resonant to manually push changes!)!! Scriptpath! Temp2.txt) del% scriptPath% temp.txt echo back original directory (% cwd%) CD / D% Change in cwd% endlocal

I recommend that your partner << Strong> sign , then find is a completely different executable (Search e-file.)

I must point look obviously it % SystemRoot% \ System32 \ find.exe . This bypass saugwin if it is installed and uses Find of Windows. If Sagvin is not installed, then it is safe to use clear definitions - this is where Windows will find the executable using its normal strategy.


string - Java : How to count the number of decimals contained in a double value that represent money? -


A change made application, created with Java, I'm facing a problem number of decimal in a double value Calculate for a while.

Double values ​​represent money, so all my operational results should be done, which can be stored as a double value 12.5797886 in the form of 12.587886 after an operation at the original price. To counter this effect, I chose to use the string, such as:

  string amount string = string.value (amount); String decimal = sum string. Substring (amountString.indexOf ('.') + 1);  

So if the amount is 12.58, I get 58 and not 57,978 ...

My problem only changes to 12849561476651.2501535 in such a way as to the large amount , Scientific notation while stored in a double then double the value of the amount 1.284956147665125E13

Unfortunately I can not count just after the dot dot and position 13. Position is just this one where the original After the kind of decimation everything will take 2501535 one 0 to the third place, on After Nam position 25 goals to 13.

I do not find any solution for people who want to print decimal values ​​without scientific notation, they use .printf (% F, ...) or something similar.

But, if this is possible, how will I fill the number of decades contained in double values ​​and will take care of storage problems and scientific notation?

I should know whether it is more than 2 decimals In addition, if you have a beautiful display solution, even if it is a complex or strange one, it would be great.

Thanks

Do not use double or float to store the currency , Or to store any decimal number that should be accurate, because double and float can be wrong.

You can use BigDescam, or you can use an int or long and keep track of your decimal point.

For more information on this, see "Item 48: section", "Must be effective in bloch" by Java:


Android listView adaptor error -


I define this string array:

  String [] mCountryList = new string [200 ];  

and fill the variable with JSON data, and when I use that variable with a ArrayAdapter :

  ArrayAdapter & LT; String & gt; MyAdaptor = New Array Adapter & lt; String & gt; (Manactivity.es, android.r.litt.system_list_item_1, mCountryList);  

I get this error:

java.lang.NullPointerException

I think that string array < Code> McountryList can be zero values ​​for example:

  mCountryList [0] = "x"; McountryList [1] = "x"; MCountryList [2] = Null;  

How can I resolve this?

I get the stacktrace:

2459-2459 / com.example.behzad. Behmytour E / Android Rentaim: Fatal Exception: The main process: com.example.behzad.behmytour, PID: 2459 JavaklangkNullPointerException Android. On Widget.ArrayAdapter.createViewFromResource (ArrayAdapter.java:394) android.widget.ArrayAdapter.getView android.widget.ListView.makeAndAddView (ListView.java:1790) android.widget on android.widget.ListView.fillDown (ListView.java on .AbsListView.obtainView (AbsListView.java:2263) (ArrayAdapter.java:362): 691) android.widget.ListView.fillFromTop (ListView.java:752) android.widget.ListView.layoutChildren (ListView.java:1630) In android.widget.AbsListView.onLayout (AbsListView.java2091) on Android at View.View.layout (View.java:14817) on android.view.ViewGroup.layout (ViewGroup.java:4631)

It seems that one of your items is null , as you might have thought, but your question was not easily understood. The solution is, make sure it is not.

You may want to use a list instead of an array, and then only populate as many items. You have 200 items Together there is a steady array of space, of course you will always have 200 items.

Then use it:

  list & lt; String & gt; MCountryList = New Arreshochi & lt; String & gt; (); Instead of  

  string [] mCountryList = new string [200];  

and then to populate it, something like this:

  mCountryList.add ("your string");  

javascript - Time-driven trigger not working in Google Spreadsheet -


मेरे पास एक सरल कोड है जो निम्न प्रकार की तरह दिखता है:

  function setValue () {var Col = "E"; Var sh = स्प्रेडशीट ऐप.टैक्टिव स्प्रेडशीट (); Var मान = sh.getRange ("शीट 2!" + कोला + "1:" + कोला) .getValues ​​() var सीटी = 0; जबकि (मान [सीटी] [0]! = "") {सीटी ++; } सीटी ++; Sh.getRange (col + ct) .setValue (गणित.फ़्लूर ((मठ। यादृच्छिक () * 10) + 1)); };  

पहली खाली पंक्ति को देखने के लिए, कॉलम के ऊपर लूप क्या करता है, और उसमें एक यादृच्छिक मूल्य रखता है यह केवल परीक्षण उद्देश्यों के लिए है और अगर मैं फ़ंक्शन मैन्युअल रूप से ट्रिगर करता है तो ठीक काम करता है। जब भी मैं परिवर्तन पर ट्रिगर करता हूं, तो फ़ंक्शन भी ट्रिगर हो जाती है, इसलिए जब भी मैं बैकस्पेस को मारा या शीट में कुछ करता हूं, स्तंभ E में एक नया यादृच्छिक संख्या दिखाई देती है। यह, हालांकि, समय-चालित ट्रिगर्स के लिए काम नहीं करता है। मैंने प्रत्येक मिनट के माध्यम से एक ट्रिगर सेट करने से सब कुछ परीक्षण किया है:

स्क्रिप्ट संपादक ... -> संसाधन -> आपके सभी ट्रिगर -> समय-चालित -> मिनट टाइमर < / Em>

और यहां तक ​​कि यह कोड भी डाल:

  ScriptApp.newTrigger ("setValue")। Timebased ()। बाद (1 * 60 * 1000) .create ( );  

जो hypothetically कार्य को ट्रिगर करने के लिए एक मिनट के बाद एक निश्चित समय बीत चुका है। इनमें से कोई भी काम नहीं है, और मुझे पता नहीं क्यों क्या इस समारोह में हर मिनट आग लगाने का कोई अन्य तरीका है? चूंकि समारोह में परिवर्तन पर भी (लेकिन यह केवल एक वैकल्पिक) है, वहाँ एक स्क्रिप्ट है जो उत्पादन और परिवर्तन पर शीट पर प्रभाव जो अंततः इस फ़ंक्शन को ट्रिगर करेगा

फ़ंक्शन को setValue () के अलावा कोई अन्य नाम दें , क्योंकि यह एपीआई में पहले से ही एक विधि नाम है, जो शायद कंपाइलर को भ्रमित करता है।

आप ट्रिगर मेनू का उपयोग करने में सक्षम होना चाहिए, आपका कोड बस ठीक करने के बाद मैं फ़ंक्शन का नाम बदल चुका हूं।

बीटीडब्ल्यू आप हर मिनिट्स () विधि चाहते हैं यदि आप इसे प्रोग्रामेटिक रूप से करना चाहते हैं।

  ScriptApp.newTrigger ("myfunction") .timebased () .everyMinutes (1) ।सर्जन करना();  

और अगर आप चाहते हैं कि इस फ़ंक्शन को आग लग जाए तो स्प्रेडशीट में कोई परिवर्तन हो, तो आप केवल

  फ़ंक्शन पर एडिट (ई) {myfunction () का उपयोग करेंगे ; }  

c++ - Memory Organising for big data -


I have a class that says four integers I need to create 1 million examples of the above class. How do I create. .?

The ethical approach is: class arrMyObjectes [1000000];

But it will be 1million * sizeof (obj) = 16 million bytes of continuous memory block ****, which will be difficult to meet ..

< P> The better way would be: * Class arrMyObjectes [1000000];

We will now create 100,000,000 objects using new and we will store points in the above indicator array ... even here In this case we need 1 million * size (indicator) = 4million bytes of continuous memory block .. It is also difficult to think ..

Is there any other Better way

about std :: deque & lt; Class & gt; Objects (1000000); or std :: list & lt; Classes & gt; Objects (1000000); . None of those containers are compatible.

If the implementation tries to catch the closest block for those constructors, you can generate them individually:

  std :: deque & lt; Class & gt; Objects; For (unsigned i = 0; i <1000000; ++ i) objects .emplace_back ();  

Similar to std :: list

Reference:

< / Html>

hapijs - why is this joi regex validation for hex color failing -


Why should it be regex, but is it failing?

error

child "color" fails because "color" with value "" # 333acf "" does not match required pattern: / ^ # [A -FA-F 0-9] {6} $ /]

  Valid: {payload: {avatar: joi.object (). Key ({Color: Joy String (). Regex (/ ^ # [A-FA-F 0-9] {6} $ /), icon: joi.string () .min (2)})}} < / Code> 

payload

  {"avatar": {color: "# 333acf", icon: "b1"}}}  

Your color string should have an extra end space

  {"avatar" : {Color: "# 333acf", icon: "b1"}}  

Or your regex needs to allow strings, more than 6 characters by removing the end of the string anchor.

  / ^ # [A-Fa-f0- 9] {6} /  

java - Parsing a number from a string with thousands seperators -


I'm parsing a longer value than the given string-s

long.valouf () and long.parceleng () will not work - because such a string is str format in 1,234,567 and can be surrounded by spaces.

I can process this string by getting it a number of points - then parsing the value. Therefore - this will be something like this

  str.trim (); String Tempere [] = Straplers (","); Str = ""; (For string: tempArray) str + = s;  

However, there should be a better way of doing this. what is this?

You can use it right here US will be enough though you will not notice whitespace Will have to take care of.

  string str = "1,234,567"; Number format format = NumberFormat.getInstance (locale.US); System.out.println (format.parse (str.replace ("," "")));  

Whatever you are a bit more powerful, you can also use it. You can add a group or a decimal separator:

  decimal font format decimal decimal = new auspicious (); Decimal formattus slugs decimalable format symboils = new passwordfind symbo (); DecimalFormatSymbols.setGroupingSeparator (','); DecimalFormat.setDecimalFormatSymbols (decimalFormatSymbols); System.out.println (decimal format.php (str.replace ("," "")));  

How to select the columns by the content in another column in data.table of R? -


I have data like this:

  & gt; DT & LT; -Data qualified (F = representative (C ('A', 'B', 'C'), each = 2), fine = C (10:15), A = C (1: 6), B = C 2: 7), c = c (3: 8)) gt; DT F OK ABC 1: A10 1 2 3 2: One 11 2 3 4 3: B12 3 4 5 4: B13 4 5 6 5: C14 5 6 7 6: C15 6 7 8  

Column F stores the column for each row to remove it. Therefore for the first 2 record columns, the column 'A' will be removed whereas the column 'B' will be drawn for the 3 and 4 records. 'Fix' will be kept for each record. The ideal output should be like this:

  F Fix new 1: one 10 1 2: one 11 2 3: b12 4 4: b13 5 5: c147 6: c15 8  

using sd to With = FALSE

  dt [,. (OK = OK, new = unselected (with SD [, F, = FALSE]), by = F] ## F Fix new ## 1: one 10 ## 2: one 11 2 ## 3 : B124 ## 4: B13 5 ## 5: C147 ## 6: C158  

c# - How do I configure NServiceBus to scan an assembly for IMessage? -


I am working with code that I have not written and I am trying to understand that one of the functions I do not understand the way the particular part is working. In particular, there are three projects in my solution:

  API message event processor  

There is a folder inside the events message using the NSSSBbis with the API processor The tax message will define in the message / event . iMessage extended classes in Messaging / Events .

In a configuration file, I found these lines just for the bus to be shared by both the processor and the API:

  var conventionsBuilder = config.Conventions () ; ConferencesBuilder.Defining Aventives (T = & gt; T. Namespace! = Null & amp; amp; Technologies with Starters ("Day.Stepe.") & Amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; "Event"); Return Configuration;  

It was previously implemented, and sections of Messages / Events instead of the first code instead of IMessage was not extended was defined as where and what message might be eligible as now, since I have iMessage , I thought I could remove those 3 lines. However, when I do, no messages ever make it in my line from the API that the code that attempts to publish this code is Just do it. Publish

How should I configure this so that I do not need to reference the hard-coded string assembly where messages are? Scan code to solve any thing Interpretation wish that IMessage enhances and it can be published, which considers as a thing and it can be handled.

EDIT: According to the NServiceBus docs

  By default, NServiceBus scans all assemblies in the Endpoint Bin folder to find the types of implementations of their interfaces. So that it can be configured automatically  

and Messages.dll appears in both the API and the processor's bin . So when all of my IMessages are in Messages.dll , should not they be available to default / start / subscribe to default behavior? To wit. Should not remove 3 lines in question, there is no effect?

The hierarchy of an event, if you are not using a random configuration, The reason:

  Concrete Avent: Ivette: IMages  

The reason for this is that after viewing it source code, your message endpoint mapping processed as follows Are:

  foreach (mapping in message mapping points) {mapping.Configure ((messageType, address) = & gt; {var conventions = context.Settings get (summo LANs. IMS message type (message type). Event type (Message type) || Conventions type (message type)) {return;} if (conventions. ISET type (message type)) {router.novistorcentroute (message type , Address); Return;} Router Registrar message route (message type, address);}); }  

Convention. ISEType has a look implemented as follows:

  eventsCommunication cache. AppLine Communication (T, Type = & gt; IsEventTypeAction (Type));  

I will not give you a full call stack but basically, you end here:

  t => Typef (event). ISASSANABLEFLOM (T) & amp; Typeof (IEvent)! = T  

This will evaluate as a false to implement iMessage for a solid event, hence the RegisterEventRoute is never called for your event, but it will be treated as a IMessage , which adhere to different routing rules (only one route per IMessage ).


algorithm - does DFS and BFS in O(n+m) change? -


हमें पता है कि एक ओ (n + m) समाधान (डीएफएस या बीएफएस) है अगर s से t का एक असत्य आलेखित आलेख G से n vertexes और के साथ पथ है या नहीं, मी किनारों ... यह एक आसन्न सूची के माध्यम से लागू किया जाएगा

अगर मैं अपने प्रोग्राम को एडजेंसी मैट्रिक्स के साथ कार्यान्वित करता हूं, तो क्या रनटाइम प्रभावित होगा? क्या यह एक अच्छा या बुरा विकल्प है?

संपादित करें: मुझे समय की जटिलता की गणना, इस तरह से, किसी भी विचार की आवश्यकता है?

कोड> एम प्रकार की लाइनें ab दर्शाती है कि शीर्ष a और शीर्षांक b के बीच का किनारा होता है। अब आप एक संगत मैट्रिक्स एम [] [] ऐसे एम [i] [j] = 1 लेते हैं, अगर i के बीच का किनारा है और j अन्यथा एम [i] [j] = 0 (जैसा कि ग्राफ को मैट्रिक्स को अधोरेखित किया जाएगा सममित होगा, इस प्रकार आप केवल ऊपरी / निचले आधे मैट्रिक्स को कम करने की स्मृति को संग्रहीत कर सकते हैं आधा )। अब आपको मैट्रिक्स लेना होगा और उसे 0 (सभी कक्षों) के लिए प्रारंभ करना होगा और किनारों के निशान एम [ए] [बी] = एम [बी] [ए] = 1 को स्कैन करते समय होगा। अब प्रारंभिक भाग ओ (एन ^ 2) है। किनारों को स्कैन और अंकन करना ओ (मी) है। अब बीएफएस / डीएफएस रूटीन को देखते हैं। जब आप एक नोड पर होते हैं, तो आप अपने सभी अनोखे कोने को देखने की कोशिश करते हैं। अब कहें कि हम शीर्ष <पड़ने वाले पड़ोसियों को जानना चाहते हैं a , आपको के लिए (int i = 0; i & lt; n; i ++) करना होगा यदि (एम [ए] [i] = = 1) (0 आधारित अनुक्रमण मानते हुए) अब यह प्रत्येक शीर्ष के लिए किया जाना चाहिए और इस तरह नियमित की जटिलता बन जाती है O (n ^ 2) भले ही m & lt; (N * (n-1)) / 2 (कोई भी किनारों और छोरों m के साथ सरल ग्राफ मान सकते हैं अधिकतम (n * (n-1)) / 2 )। इस प्रकार आपकी जटिलता पूरी हो जाती है O (n ^ 2) तो निकटता मैट्रिक्स का उपयोग क्या होता है? अच्छी तरह से डीएफएस / बीएफएस सिर्फ एक बड़ा एल्गोरिथ्म का हिस्सा हो सकता है, आपके एल्गोरिथ्म को यह भी बता सकता है कि क्या नोड a और b के बीच बढ़त है, जिस पर निकटता मैट्रिक्स ओ (1) समय लेता है इस प्रकार चाहे निकटता सूची या निकटता मैट्रिक्स चुनना वास्तव में आपके एल्गोरिथम पर निर्भर करता है (जैसे अधिकतम स्मृति जिसे आप ले सकते हैं, डीएफएस / बीएफएस रूटीन जैसी चीजों के लिए समय की जटिलता या दो कोने से जुड़ा आदि)। आशा है कि मैंने आपकी क्वेरी का जवाब दिया।


javascript - .getTime() Alternative without milliseconds -


what date (). Is there any way to use the getTime () function without getting time in millimeters? If there is no option for gate time, will I be given only accuracy in minutes?

Apart from this, I am not sure how to strip milliseconds from the soil object.

  var time = new date (). GetTime () Output: 1426515375925  

simple math if you want to assume in seconds Divide the result of 1000 to milliseconds:

  var seconds = new date (). GetTime () / 1000;  

To delete any decimal you may want to call Math.floor () :

  var seconds = Math .floor (new date). GetTime () / 1000); Is there any other function that I can use only 1/1/1970 for me, I do not want to count the number as accurately.   

Surely, divide the seconds by 60 or divide the millisecond by 60000:

  var min = Math.flur (new date). GetTime () / 60000);  

  var milliseconds = 1426515375,925, seconds = monastery. Floor (milliseconds / 1000), // 1426515375 min = monastery. Floor (millisecond / 60000); // 23775256  

database - What's the difference between fourth and fifth normal form? -


They look like me, especially when it comes to decomposition, what exactly is the difference?

A relationship is in R4 NF iff, every non-transitional mutual dependency, J, satisfied by R R is contained with the key of the candidates, where J is dependent on any 2 estimates of R (R1, R2).

A relation is in R5 NF. Iff is dependent on the integration of the denominational R, R, R, with the key of the candidate's candidates, where J in R (R1, R2, .. RN) depends on any of the n estimates. .

In other words, 4 NFs are very much like 5 NFs, but only 2-part dependency under 4-NF is relevant, whereas in all N-Part to meet the requirements of 5 NF The dependence involved in the N-Part should be considered. Therefore, 4 NF is not very important and exists only for historical reasons, that is because it was first discovered and published. Practically, this is probably easier to ignore 4NF because 5NF is more useful and important.


c++ - How to specify that template parameter is a class template, and infer its template type from another template parameter? -


एक टेम्पलेट फ़ंक्शन पर विचार करें:

  टेम्पलेट & amp; typ; आउटपुट कंटनेर टाइप करें typename, typename ContainerType & gt; स्थैतिक आउटपुट कंटैनेरप्रकार प्रक्रिया कंटेनर (कंटेनर टाइप c) {OutputContainerType परिणाम; ... वापसी परिणाम; }  

मैं इसे ऐसा कोई समस्या नहीं कह सकता:

  std :: vector & lt; MyClass & gt; v; Const ऑटो परिणाम = प्रोसेसर कंटेनर & lt; std :: सेट & lt; MyClass & gt; & gt; (वी);  

हालांकि, मुझे पता है कि फ़ंक्शन विभिन्न कंटेनरों को स्वीकार और उत्पादन करेगा, लेकिन हमेशा एक ही तत्व प्रकार के साथ। इसलिए std :: set & lt; MyClass & gt; & gt; निर्दिष्ट करना है बेमानी है; मैं processContainer & lt; std :: set & gt; (v) टाइप करना चाहता हूं और इस तरह के कार्य प्रकार को decltype (v) :: value_type के रूप में अनुमानित करना है। मैं उसे कैसे कर सकता हूँ? मैंने

  टेम्पलेट & lt; टेम्पलेट & lt; & gt; क्लास आउटपुट कंटनेर टाइप, क्लास कंटेनर टाइप & gt; स्थिर आउटपुट कंटनेर टाइप & lt; typename कंटेनर टाईप :: मूल्य_टाइप & gt; प्रक्रिया कंटेनर (कंटेनर टाइप c) {}  

लेकिन यह कोई बात नहीं संकलित करने के लिए प्राप्त नहीं कर सकता है (सी + + टेम्पलेट सिंटैक्स की मेरी समझ और ट्रिक्स बहुत गहरी नहीं हैं, जैसा कि आप देख सकते हैं)। < / P>

यदि आप आवंटक के बारे में परवाह नहीं करते हैं, तो आप इसे छोड़ सकते हैं:

  टेम्पलेट & lt; टेम्पलेट & lt; typename ... & gt; क्लास आउटपुट कंटनेर टाइप, टेम्पलेट & lt; typename ... & gt; क्लास कंटेनर टाइप, टाइपनामनाम ValueType & gt; स्थिर आउटपुट कंटनेर टाइप & lt; मान प्रकार & gt; प्रोसेसर कंटेनर (कंटेनर टाइप & लेफ्टिनेंट; वैल्यू टाइप & gt; सी) {आउटपुट कंटनेर टाइप & lt; मान प्रकार & gt; परिणाम; // ... रिटर्न परिणाम; } Int main () {std :: सेट & lt; int & gt; S {1, 2, 3}; ऑटो v = प्रोसेस कंटेनर & lt; std :: vector, std :: सेट, int & gt; (एस); }  


User-defined date range for Access query pulling outside date range -


I have an Access 2007 database, which requires a query every week to run every week that worked in the first week Was there. The current setup is:

  • I have a query where the date range is the WHERE criterion: between [Form]! [Frm_Menu]! [Txt_fromdate] and [form]! [Frm_Menu]! [Txt_todate] + "1"
  • The "fromdate" and "todate" text boxes in frm_Menu are unbound text boxes. I "Sedet" has an "unchanged" event, which is selected in "date" in "todate" Fills in 6 days with date.
  • After filling "fromdate" and "todate" frm_Menu has a button to run the query. In these cases, when I run a query for a week's record, then I am out of the selected date range Entries are available. For example, if my "todate" text box is "3/1/2015" and "todate" in the text box "3/7/2015", then the results will be obtained from 3/1 to 3/7, but I am also getting results from 3/10, 3/11 and 3/12. First of all, I thought this "3/1/2015" can be read as "3 / 1x" / 2015, "but he does not explain why I only 3 / I am getting extra results in addition to 10 to 3/12 and not even 3/13 to 3/19.

    Does anyone know what might be the reason for this? This problem To solve, I'm just running a query that collects everything and then what is needed in Excel before sending it. In terms of course, I would like the person who needs this report to open the database themselves, select the date range, and then export query results from the login.

< P>

It has been found that instead of date / time there was data type for date column in the form of text. Trying the same question again and it worked perfectly. Just a PEBKAC error B.


java - Trying to wrap my head around 3 nested if statments -


Say I have an array of 5 stars and is related to that array, it has 3 arrays of all integers of the same size. String A [] = new string [5] int x [] = new int [5] int y [] = new int [5] int j [] = new int [5]

So that [0], x [0], y [0], z [0] are related to the same thing. I want to know which index (ss) holds the highest number in x [] if one The more people have the same highest number, then among them the greatest number is [] and if more than one has the same highest number which is the highest in one [] (believe it

This is best if it only checks the first 2 terms {If (x [i] & Gt; = Max) {if (x [i] == max) {if if i <= p> (y [i] & gt; = max) {max = x [i]; Winner = a [i]; max = or [i];}} and {max = x [i]; winner = team [i]; max = y [i];}} < P> then this is my new code

  Fixed Ent Plan Value () {for (int i = 0; i & lt; diff = y [i] - y [max];} (Diff == 0) {diff = y = ii} - x [max]; if (diff == 0) == 0) {diff = z [i] - z [ Purges];} if (diff & gt; 0) {Ma X = i}} return max;   

}

if string [n] related to int [n] for each N, then in fact you should write them correctly, they need to sort them by making comparative .

  Class Thing applies Comparable & lt; Thing & gt; {Last String A; Last int x; Final Ent Y; Last Int Zed; Public talk (string a, int x, int y, int z) {this.a = a; This.x = x; this. Y = y; This.z = z; } Compare @ Override Public Int (Thing O) {int diff = o.x - x; If (diff == 0) {diff = o.y - y; } If (diff == 0) {diff = o.z - z; } Return gap; } @ Override public string toting () {return "{" + a + "," + x + "," + y + "," + z + "}"; }} Public static integer maximum (thing [] things) {// NB - this should actually compare int max = 0; For (int i = 1; i & lt; things.length; i ++) {int diff = Things [i] .x - Things [max] .x; If (diff == 0) {diff = things [i] .y - things [max] .y; } If (diff == 0) {diff = things [i] .z - things [max] .z; } If (diff> 0) {// highest max = i; }} Return max; } Public Zero Test () {Cheung [] Things = New Thing [6]; Things [0] = New Thing ("Hello", 1, 2, 3); Things [1] = New Thing ("There", 1, 2, 4); Things [2] = New Thing ("Everyone", 0, 2, 3); Things [3] = New Thing ("How", 9, 0, 3); Things [4] = New Thing ("are", 8, 9, 3); Things [5] = New Thing ("You", 7, 2, 3); System.out.println ("Before:" + Arrays.toString (Things)); System.out.println ("Max:" + things [max (things)]); Arrays.sort (things); System.out.println ("Sorted:" + Arrays.toString (Things)); }  

tcl - Is there any way to rename 'set' -


When trying to rename

set function, I got the error too many nested Evaluation (endless loop?) (see below).

Perhaps because renamed uses set inside the internal. Is there any way to override this behavior? Set many nested evaluations (endless loop)

  Set "set CMD [Lindex $ Args 0]" (Process "::" Unknown "), line 8) Set" CMD [Lindyx $ Argos 0] "Process" :: Anonymous "from within line 8" set CMD [Lindex $ Ages 0] "(Process" :: Unknown "line 8) was brought from within ...   

Rename command is an underlying command, TCL, and any other The command is not dependent on the command, however, the interactive evaluation loop uses a slightly set in its history management code, as unknown commands when the name of the command Does not solve the existing command triggers an infinite loop when set is absent, what should the set be present as part of the handling code Stack Protection Code ( See interp recursionlimit ) finally kills things ...

The easiest fix is ​​to make sure that you set some to .

  # replace our replacement proc _set {varName {value} "}} {# This is 8.6-specific code, but you can other_smile_set tailcall {*} [Lrange [info] Level 0] 1 end]} # Swap things in with the two names on the same line ... Rename old_set; Rename replacement_set set  

Note that you do not need to be very careful in the script.


php - How do I run a Symfony Console command after composer install? -


मेरा composer.json में निम्नलिखित घोषणा है:

  "के बाद स्थापित-cmd": [ "Incenteev \\ ParameterHandler \\ ScriptHandler :: buildParameters", "Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: buildBootstrap", "Sensio \\ बंडल \\ DistributionBundle \ \ संगीतकार \\ ScriptHandler :: clearCache "," Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: installAssets "," Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: installRequirementsFile "], < / Code> 

मैं एक कस्टम कंसोल कमांड चलाऊँगा जो मेरे पास src / MyBundle / Command / MyCommand.php है। मैं कम्प्यूटर में चलने के लिए स्क्रिप्ट को कैसे जोड़ूं?

आप देख सकते हैं कि पोस्टऑक्टूक हुक कैसे कार्य करता है सेंसिओ डिस्ट्रीब्यूशनबंडल के लिए

उदाहरण के तौर पर, आप एक्मे डेमो बंडल के हैलो वर्ल्ड कमांड को कैसे कॉल कर सकते हैं:

ScriptHandler

  & lt;? Php नामस्थान Acme \ DemoBundle \ composer; संगीतकार \ स्क्रिप्ट \ CommandEvent का उपयोग करें; क्लास स्क्रिप्टहैंडलर \ Sensio \ Bundle \ DistributionBundle \ Composer \ ScriptHandler {/ ** * एक्मे डेमो बंडल के डेमो कमांड को कॉल करें। * * @ परम $ ईवेंट CommandEvent एक उदाहरण * / सार्वजनिक स्थिर फ़ंक्शन हैलो वर्ल्ड (CommandEvent $ event) {$ options = self :: getOptions ($ event); $ ConsoleDir = self :: getConsoleDir ($ इवेंट, 'हैलो वर्ल्ड'); अगर (शून्य === $ consoleDir) {वापसी; } // $ extraParam = ''; // यदि (! $ विकल्प ['कौन']) {// $ extraParam = '- जो'; //} स्थिर :: executeCommand ($ event, $ consoleDir, 'acme: hello', $ options ['process-timeout']); }}  

आप json फ़ाइल में अतिरिक्त परम का प्रबंधन कर सकते हैं।

composer.json

  "के बाद स्थापित-cmd": [ "Incenteev \\ ParameterHandler \\ ScriptHandler :: buildParameters", "Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: buildBootstrap", "Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: clearCache "," Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: installAssets "," Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: installRequirementsFile "" Sensio \\ बंडल \\ DistributionBundle \\ संगीतकार \\ ScriptHandler :: removeSymfonyStandardFiles "," एक्मे \\ DemoBundle \\ संगीतकार \\ ScriptHandler :: HelloWorld "],  

परीक्षण किया

मैं विस्तार ScriptHandler संस्करण की sensio-वितरण बंडल के वर्ग:

  sensio / वितरण गठरी (v3। 0.18)  

इस मदद की आशा


linux - Run Google Native Client (nacl_sdk) on Samsung Chromebook -


The original client I found was trying to follow the installation tutorial of the SDK. However, my Samsung Chromebook (in developer mode) / Naclsdk does not want to run (chmod + x done), but instead gives the following:

This system is not found on 32-bit runtime environment. Particularly 32-bit dynamic loaders required by the NaCl compiler ('/lib/ld-linux.so.2') were not found. This is included in the 'libc6: i386' package on modern Debian / Ubuntu systems.

They write that PNAL should run on ARM computers, however, on some other forums I did not read the case. I have tried to enable two flags, as described on one site which I can not post due to lack of reputation, but it seems that while using PNext only things will change, the establishment of SDK Not during

Is it possible to install that SDK on my Chromebook, and if so, how?

There is some confusion: when the documentation says "PNEX and NOLL work on ARM," its This means that the user will use the part that runs inside the chrome. SDK is currently only made for X86-64 Windows / Linux / OSX, not for ARM. The main reason is that never been requested, probably because ARM machines are significantly slower than normal development machines.

It is being said, I do not think it is stupid to use ARM as a development machine, and I have created my own PNACL toolchain for ARM in the past. I have not made it recently, and it can bitrate a bit, if you run into problems or suggest or send better patches! I hope that any issue is quite minor, especially if you want to use only pnacl-clang or nacl-clang (in opposition to GCC Toolchain).


php - Use of AND in Case statements in MYSQL -


OK, the purpose of this query is to check whether a record exists in table two, and if that type is Updates to duplicate, if it does not, then update it in the original. I have to check three areas, and all of them should be eligible as a duplicate entry.

At this time, it checks the correct table, finds if there is a duplicate, and changes I test on the position of 1 to 2 on all 9 records, however, it is only "duplicate "The first record is changing, even if they are all duplicates.

Am I able to use 'AND' case statement? If not, then someone has a suggestion that how can I change this query to work? I have tried to use a SELECT subquery, but it is not working.

Here is the code:

  $ query = "update first_table f left second_tables ON f .co_id = s.co_id SET f.status = 2, f.type = The case when the SLTFLTT and S.Lang = F.Lang and S.Nets = FNITS then 'Duplicate' ELSE 'original' END WHERE f.co_id =: coid and f.type = : Rtype and f.status =: "status"; $ Params = array (); $ Params [] = array (': coid', $ co_id, 'int'); $ Params [] = array (': replay', 'upload', 'str'); $ Params [] = array (': position', '1', 'int'); $ Db- & gt; Query ($ query, $ params);  

I used a little bit of advice from Ali Arshad and SKFfield. ..and come up with the solution!

  $ query = "upstate first_tables and join with second second f.co_id = s.co_id SET f.status = 2, f.type = case when (select_fresh_preblef.prop_id F where SLETT.F.T.T.T. and S.Lang = F.Lange and S.Nets = F.Nets) then 'duplicate' ELSE 'original' end hoofe F.CO.ID =: Cody and F. Type =: Retype and F. Stats =: Status "; $ Params = array (); $ Params [] = array (': coid', $ co_id, 'int'); $ Params [] = array (': replay', 'upload', 'str'); $ Params [] = array (': position', '1', 'int'); $ Db- & gt; Query ($ query, $ params);  

layout - Qt layouting: default size constraints vertically, setFixedSize horizontally -


I am developing a complex hierarchy of an app widgets and layouts, but in essence that there is a formula One formula is in the form of the upper widget and in the form of QScrollArea tabular widget (via QVBoxLayout ).

That can be QScrollArea represents a catalog (grid layout actually) QPushButton too many buttons s (or not).

I want my app to fit the following issues:

  • (both form and list) consume horizontal space all available, (the horizontal position and < Code> SpaceItem s) to refine its contents to fill the content margin.
  • Both will save as vertical space as possible, "lines" closer to each other.

I have resolved to use part of my problem setSizeConstraint (QLayout :: SetFixedSize) to form, which raises it, But also horizontally, due to which both the list and the form are different width, which does not look very well.

How can I get it? I mean, how something like might have to be incremented horizontally to fill the widget but should be standing as much as possible ?

Add a spacer as the last item in the layout:

  gridLayout-> addItem (new QSpacerItem (10, 10, QSizePolicy :: expanding, QSizePolicy :: detail), the last, 0);  

c++ - CPaneDialog control backgroung (text control) -


In my application I have CPaneDialog with control (eg text control) I try to set the background color for this CPanelDialog for this purpose, I overwrite OnEraseBkgnd

  BOOL CBgPaneDialog :: OnEraseBkgnd {CDC * PDC} {CBrush backBrush (RGB (255, 128, 128)); CBbrush * pOldBrush = pDC- & gt; Selection object (and backbrush); Kurt Rect; Pdc-> GetClipBox (& amp; Rect); PatBlt (rect.left, rect.top, rect.Width (), rect.Height (), PATCOPY); // need to erase pDC- & gt; Pdc-> SelectObject (pOldBrush); Return TRUE; Unfortunately, this is the other background on the control of CPaneDialog  

I overwrote the next method: OnCtlColor caontrol where to set one

  HBRUSH CBgPaneDialog :: OnCtlColor (CDC * PDC, CWnd * PWND, uint nCtlColor) {CBrush br.; Br.CreateSolidBrush (RGB (255, 255, 255)); HBR's HBR = (HBRUSH) BR; CWnd * pCheckBox = GetDlgItem (IDC_STATIC); // put id of your checkbox here. Int a; If (* pCheckbox == * pWnd) {br.DeleteObject (); Br.CreateSolidBrush (a = pDC- & gt; SetBkColor (rgb (255, 128, 128))); HRR = (HBRUSH) BR; } Other hbr = CPaneDialog :: OnCtlColor (PDC, PWND, NCTL roller); Returns HBR;  

}

The control background has changed, but not completely. Please see in the picture:

I can completely change the background for text control

After

Do not return the temporary brush Your code is ok for OnEraseBkgnd () because it is using the brush, it is not returning it, but OnCtlColor Instead use:

  class CMyDialog ... {COLORREF BkColor; CBRash BKbrush; // ...}; CMyDialog :: CMyDialog ... {BkColor = RGB (0, 255, 255); BkBrush.CreateSolidBrush (BkColor); } HBRSH CMIDiolog: :: OnCatLoler (CDC * PDC, CWND * PWND, UINT NCTL Roller) {// AD SCHEDU ... PDC- & gt; Setback Collar (BK Collar); Return BKbrush; }  

By the way, you can add mfc tag to your question to get a faster answer in the future.


syntax - How do you add alternative text to images in Dokuwiki? -


This is my image syntax ...

[{{: image-link.png? 200 This is the caption.}}]

What image adds, right aligned.

Your help is greatly appreciated ... Thanks!

You represent the DokuWiki syntax that you are using - which allows captions, but Empty the alt tag.

For example [{{:: Software: contao_install_open_sauce_00.png | Layout - & gt; Theme - & gt; & Gt; & Lt; Div class = "thumbinner: div class =" thumb2 tcenter "style =" 100% width "; & lt -: content import}}]

renders html" Gt; & Lt; A href = "/ business / lib / exe / detail.php id = software% 3Acontao% 3Acontao_4 & media = software: konto: contao_install_open_sauce_00.png" class = "media" title = "software: konto: contao_install_open_sauce_00. Png "& gt; & Lt; Img exify_intitialized = "true" src = "/ business / lib / exe / fetch.php media = software: konto: contao_install_open_sauce_00.png" class = "mediabox2" alt = "" & gt; & Lt; / A & gt; & Lt; Div class = "thumbcaption" & gt; & Lt; Strong & gt; Layout & lt; / Strong> → & lt; Strong & gt; Theme & lt; / Strong> → & lt; Strong & gt; Content import and lt; / Strong> & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;

and one (Wikipedia style) and creates an empty alt tag.

Then you can not populate an alt area using the ImageBox plugin, but you can enter the alt field You can populate [created image tag] using [3]. The alt tag generated by the built-in image tag is populated by the price you provided for (tooltip) "caption".

For example {{wiki: dokuwiki-128.png | This is the title}} (see: wiki: syntax # media_files)

renders HTML & lt; A href = "/_detail/wiki:dokuwiki-128.png?id=wiki%3Asyntax" class = "media" title = "wiki: dokuwiki-128.png" & gt; & Lt; Img exify_intitialized = "true" src = "/ _ media / wiki: dokuwiki-128.png" class = "mediacenter" title = "this is caption" alt = "this is caption" & gt; & Lt; / A & gt;

If you want both an title tag (tooltip) and a separate alt tag enabling HTML in your DokuWiki and Need to add an image using HTML


ios - iCloud key-value storage in WatchKit Extension -


I have an app that is syncing settings with iCloud key-value storage. It is between iOS device and app Today's expansion is doing great work among both, but there is no value set in the app in the NSWubtive Keiviewustore in the Watchkit extension.

In the Capabilities tab iCloud is turned on in both the app and the extension, key-value storage is checked, app groups are turned on and only one group is selected. I have examined the entitlement files for both extensions and they are similar.

Am I missing something?

Update

I got it working, but I'm not sure I had decided it.


highcharts - For highstocks data grouping can you set data group points to null if there is less than a certain number of samples within it? -


For example, if I have the level of data grouping set to year and every year is made up of 365 values, then I can 'ignore' in which I have less than 300 valid readings (like Nano).

Thank you for your help!

High charts dataguping groups do not indicate points based on time.

DOCKS: -

Obviously you can prepare your own approximation event: -


cron - bash file: cronjob vs manual, why are they different? -


I have a bash script that runs every five minutes. In addition to other things, it reads the existing files in PHP The script runs, and in the end it sends an email manually when it runs, it works when the kronobose runs, it partially completes the task. Code below:

  DIR = "/ somedir /" php $ {DIR} client.php $ DIR cat $ {DIR} alert_list.txt | Unique | Read the warning while; What to do [-s $ {DIR} alert / $ alert.txt]; Then send the #Exquote "Sending to Email ..." $ Warning & gt; & Gt; $ {DIR} email.txt DETAILFILE = "Tools /" $ warning DETAILFILEP = $ {DETAILFILE} ".txt" php $ {DIR} email.php $ Warning expired 'Search complete.' In 'conabob mode' this never goes for 'do' statement  

It does all this in manual mode.

Any thoughts?

Thanks a lot!

I found this problem within PHP scripts. Files located in other paths are not remembered when the relative call is automatically run, obviously, it is running from somewhere else, so it can not progress due to missing input files created by the initial PHP script.

Thank you.


pdf - How to suppress pdfcrop printing when using R rmarkdown render function? -


I tried to print stdout and stderr generated by RDMRDead, but when calling R Rmarkdown render function, But it does not know how to do

I have already used the cool option to touch the pandok command line execution, but it will override the printing of pdfcrop does not do.

Do anyone have some tips to fix this? / P>

I have run the script here:

  Rscript RNASeq_QC_run.R -v 1 --count ~ / devel / r / projects / rnaseq_qc / data / dataTest_Count_expression_generic2.txt - format generic - Design - / Devell / R / Project / RNCAction / Data / DataType Dispatch TTT - Outdoor Test / Out 5 & amp; & Gt; Test / Out 5.log  

This call is to present the function:

  generic_report_path & lt; - system.file ("Report", "QC_RNASeq_Count_generic.Rmd", package = "qc4rnaseq") generic_report_file & lt; - Paste (unlisted (strsplit (basename (Generic_report_path), ".rmd")), ".pdf", sep = "") render (input = Samany_report_path, Autput_form = "pdf_docum ENT", output_file = generic_report_file, output_dir = outdir_abs_path , Intermediates_dir = outdir_abs_path, cool = TRUE)  

Here is the content of the exam / out5.log: (between both stdout (regular) and stderr bold: **) Production

  ** crop /private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-2-1.pdf** PDFCROP 1.38, 2012/11/02 - Copyright (c) 2002-2012 by Heiko Arbedic == & gt; 1 page written on `/private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-2-1.pdf ' ** /private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-3-1.pdf** PDFCROP 1.38, 2012/11/02 crop - Copyright (c) 2002-2012 by Haikou Oberdiak . ==> 1 page written on `/private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-3-1.pdf ' ** /private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-4-1.pdf** PDFCROP 1.38, 2012/11/02 crop - Copyright (c) 2002-2012 by Haikou Oberdiak . ==> `/private/tmp/qc4rnaseq_run/test/out5/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-4-1.pdf 'written on one page execution time: 7.12010 9 seconds   

< div class = "post-text" itemprop = "text">

I found a solution to suppress messages using suppressMessages function even though it does not suppress all messages are only sent to stderr.

Here are my amendments:

  suppressMessages (Render (input = generic_report_path, output_format = "pdf_document" are now buried all messages sent to stderr, but my script Not all messages sent to stdout, but output I.  

This is still hidden print related to pdfcrop:

  PDFCROP 1.38, 2012/11 / 02 - Copyright (c) == & gt; `/private/tmp/qc4rnaseq_run/test/out7/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-2-1.pdf 'typed one page by 2002-2012 Heiko Orbedik PDFCROP 1.38, 2012/11/02 - Copyright Female) were 1 page written == & gt; `/private/tmp/qc4rnaseq_run/test/out7/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-3-1.pdf 'by 2002-2012 Heiko Orbedik. PDFCROP 1.38, 11/02/2012 - Copyright (c) == by 2002-2012 Heiko Orbedik & gt; on `/private/tmp/qc4rnaseq_run/test/out7/QC_RNASeq_Count_generic_files/figure-latex/unnamed-chunk-4-1.pdf ' 1 page written  

android - Using Facebook SDK ShareDialog to share message and photo -


I am using Facebook SDK for Android, because I want users to have an image generated in the app Should share + a message I already want to set as a suggestion.

I tried to use the new ShareDialog , but in some way I can not find any way to share photos and messages. FacebookDialog.PhotoShareDialogBuilder lets you share photos from the device, but no messages, while FacebookDialog.ShareDialogBuilder lets you share only one link.

What can I use instead? Should I go away from using the share dialogue?

You can create alert dialogs and edits within it, then allow you to add your comment to the user You can.

For the image, you can get image path for file storage and load it as bitmap.

Then create a bundle with the above comment and image and send a post FB API with valid and opened session.


sql - Error in creating linked server -


I have two SQL servers that have a SQL login with the same password defined as "SQLUditor" I have a link I want to make the server where only the user can "jump" on the other server. I try to do this via SSMS. On the Security tab, I use Login as a local login and remote user. At the bottom of the dialog box, I indicate the above login, no connection has been made. When I click OK, I get an error message:

Access to the remote server is denied because there are no login mappings. (Microsoft SQL Server, Error: 7416)

Any suggestions? Thank you.

Please create a proper user mapping. More about this protection is listed here:


c++ - Longest domino chain/sequence -



c++ - Longest domino chain/sequence -

i have run issue assignment of mine , appreciate tips/help on matter! have searched extensively help on problem, not find solutions.

i need find longest chain of dominoes possible, given set of 12 randomly picked dominoes. i've recursively generated possibilities of dominoes (there 91 possibilities using face values of 0 12). domino consists of 1 "brick" 2 squares on it: [a|b] 0 =< a,b <= 12. thus, illustration of domino [12,0] or [6,3] etc. dominoes may connect if adjacent halves have same value.

dominoes may flipped accommodate match. example, given [8,4], [9,4] flipped create pair [8,4][4,9]

the next (relevant question) methods available class:

void flipends(); // flips domino int getleft() const; int getright() const; bool hasbeenplayed() const; void setplayed(bool value);

so, sample info problem follows:

mydomino #0: [1 12 ] mydomino #1: [0 5 ] mydomino #2: [7 9 ] mydomino #3: [2 7 ] mydomino #4: [7 12 ] mydomino #5: [4 8 ] mydomino #6: [8 10 ] mydomino #7: [3 11 ] mydomino #8: [11 12 ] mydomino #9: [10 11 ] mydomino #10: [2 9 ] mydomino #11: [2 4 ]

this more of math problem, how can find longest chain of dominoes? assume must done recursively.

thanks in advance!

a sequence of dominos might represented {#3,y}, {#4,n}, {#0,y}, ... first number number of domino in hand , sec whether flipped or not. want check every possible sequence, prune illegal 1 early.

lets assume have function testsequence(sequence) tests sequence valid. maintain 2 lists, 1 of current sequence currentseq, , 1 of dominos have not yet chosen unused.

a recursion might like

checkallseq( currentseq, unused ) { foreach( domino in unused ) { unused2 = unused - domino // remove domino unused list seq1 = currentseq + {domino,true} // add together unfliped domino sequence test if( testsequence(seq1) ) { checkallseq(seq1,unused2) // recurse } // domino flipped seq2 = currentseq + {domino,false} if( testsequence(seq2) ) { checkallseq(seq2,unused2) } } }

i've missed few things out. tests possible sequences not result.

c++ recursion sequence chain

floating point - C++ double to long long -



floating point - C++ double to long long -

if write code in c++:

long long d = 999999998.9999999994; cout<<d;

i output: 999999999 (rounding up)

but output of code:

long long d = 999999998.9999994994; cout<<d;

is 999999998 (rounding down)

is precision. there way can alter precision. floor() function gives same output.

i noticed if assign value 8.9999994994 or 8.9999999994 d(above variable). output 8.

999999998.9999999994 not representable in double, actual value 1 of 2 representable numbers on either side of 999999998.9999999994 - either 999999998.99999988079071044921875 or 999999999 (assuming ieee-754 binary64 format), selected in implementation-defined manner. systems default round nearest, producing 999999999.

the net result on systems when write 999999998.9999999994 ends having exact same effect writing 999999999.0. hence subsequent conversion yields 999999999 - conversion floating point number integer truncates, here there nil truncate.

with 999999998.9999994994, closest representable numbers 999999998.999999523162841796875 , 999999998.99999940395355224609375. either 1 produces 999999998 after truncation. similarly, 8.9999999994, closest representable numbers 8.999999999399999950355777400545775890350341796875 , 8.9999999994000017267126168007962405681610107421875, , either 1 produce 8 after truncation.

c++ floating-point double floating-point-conversion

android - App does not start when using Cordova -



android - App does not start when using Cordova -

i have developed app using sapui5 technology , wanted deploy in android used phonegap cordova 2.9.

earlier getting error phone call " class not found" , searched on net , found missing config.xml file in libs -> xml folder copied , added config.xml file , got rid of alert message.

now problem app not start. shows blank screen.

below error log see in eclipse.

can help here.?

thanks in advance , vishesh.

install cordova plugin required project. see error log, couldn't find cordova plugin

android cordova

Java: passing static variables to constructors? -



Java: passing static variables to constructors? -

i have classa lot of static variables.

does create difference if access these variables in classb in static manner, i.e. calling classa.variable or if i'm passing these static variables constructor of classb (and assign static variables in classb later usage)? 1 use?

duplicating many fields bad thought because complicates maintenance.

if these fields genuinely variable, rather constants, have identically named variables in 2 different classes. have remember update both copies of each value in places in code update either 1 of them.

even if fields constants, duplicating them muddles meaning , purpose. ideally there should 1 place in programme these values defined, should class relevant , meaningful do.

another consideration is, how closely related classa , classb? if reason want pass these values parameters because classb might want used different class instead of classa, makes sense pass parameters because can't hardcode references original fields in classa. if there many such parameters, unwieldy. in case, can utilize separate class hold configuration state shared classes. classa (and classes it) create , initialize instances of configuration class, , pass single parameter classb. configuration class place many variables need declared , documented.

on other hand, if 2 classes intended 2 inseparable pieces of same application, classb can count on classa beingness there, indirection not necessary. question 1 time again becomes, want duplicate these fields in classb?

if want cut down typing classa. in front end of things, utilize static import @ top of classb:

import static packagename.classa.*; // imports static members import static packagename.classa.fieldx; // imports specific thing selectively

then can refer things field1, rather classa.field1. usage frowned upon can create confusing find variables coming from, win clarity if there few variables beingness used many times.

java constructor static

arrays - Java 2D ArrayList -



arrays - Java 2D ArrayList -

so every time run programme , come in 2nd choice, tells me rangecheck error , index0 , size 0.

what understand after research arraylist empty, how utilize add together function in 2d arraylist?

|abcdefghijklmnopqrstuvwx

--+------------------------

01|gggggggggggggggggggggggg

02|gggggggggggggggggggggggg

03|gggggggggggggggggggggggg

04|gggyyyyyyyyyyyyyyyyyyggg

05|gggyggggggggggggggggyggg

06|gggyggggggggggggggggyggg

07|gggyggyyyyyyyyyyyyggyggg

08|gggyggyggggggggggyggyggg

09|gggyyyyggggggggggyyyyggg

10|gggggggggggggggggggggggg

11|gggggggggggggggggggggggg

12|gggggggggggggggggggggggg

package map; import java.io.fileinputstream; import java.io.inputstream; import java.util.scanner; import java.util.arraylist; public class mapmain { public static void main(string [ ] args) { scanner input = new scanner(system.in); inputstream = null; int i; char c; string t; arraylist<arraylist<string>> contain = new arraylist<arraylist<string>>(); for(int l = 0; l < 30; l++) { contain.add(new arraylist<string>()); } try{ do{ int a=0; string elements; system.out.print("to load map come in 1\nto print loded map come in 2\nto alter specific elements press 3 "); a=input.nextint(); switch (a){ case 1 : system.out.print("what file dest?"); t=input.nextline(); = new fileinputstream(t); while((i=is.read())!=-1) { c=(char)i; string o = "ankosh"; //contain.add(contain.o); } break; case 2: while(true) { string u = contain.get(16).get(0); //system.out.print(contain); break; } break; case 3: system.out.print("what want insert?"); elements=input.nextline(); //switch (elements){ //case } break; } while(true); }catch(exception e){ // if i/o error occurs e.printstacktrace(); }finally{ } } }

you created array of arrays, , arrays contains, far it's ok. now, on case 2 trying reach first element of 16th array (basically of type string) null since didn't add together yet array. need before trying get(index), check length of array bigger index. in order add together array:content.get(16).add(str);.

java arrays arraylist

grouped_collection_select with data attributes in Rails -



grouped_collection_select with data attributes in Rails -

there next code:

= grouped_collection_select :filter, :service_id, @categories, :enabled_beauty_salon_services, :name, :id, :name, include_blank: 'choose service'

but need add together custom attributes 'data-duration' items in grouped_collection_select (not groups - items!). how can it? rails 4

ruby-on-rails

MSI upgrade with Powershell /DSC -



MSI upgrade with Powershell /DSC -

i able uninstall (ensure = "absent") or install product (ensure = "present"). however, if create new version of same product, comes same message - "already installed".

does mean way upgrade uninstall / install?

it sounds msi creating. create sure you're changing product code each version:

what productcode in msi package?

the product code unique guid of identifying application or product release; in other words, different versions , languages of product must have different product codes. http://msdn.microsoft.com/en-us/library/aa370854(vs.85).aspx. also, productcode can used query feature state, , product state. example, installer api "msiqueryfeaturestateex()" , "msiqueryproductstate()", etc.

powershell dsc

python - What does 'r' mean before a Regex pattern? -



python - What does 'r' mean before a Regex pattern? -

i found next regex substitution illustration documentation regex. i'm little bit confused prefix r before string?

re.sub(r'def\s+([a-za-z_][a-za-z_0-9]*)\s*\(\s*\):', ... r'static pyobject*\npy_\1(void)\n{', ... 'def myfunc():')

placing r or r before string literal creates known raw-string literal. raw strings not process escape sequences (\n, \b, etc.) , commonly used regex patterns, contain lot of \ characters.

below demonstration:

>>> print('\n') # prints newline character >>> print(r'\n') # escape sequence not processed \n >>> print('\b') # prints backspace character >>> print(r'\b') # escape sequence not processed \b >>>

the other alternative double every backslash:

re.sub('def\\s+([a-za-z_][a-za-z_0-9]*)\\s*\\(\\s*\\):', ... 'static pyobject*\\npy_\\1(void)\\n{', ... 'def myfunc():')

which tedious.

python regex string syntax

haskell - Yesod -- devel.hs: connect: does not exist (Connection refused) -



haskell - Yesod -- devel.hs: connect: does not exist (Connection refused) -

i'm moving web app new server , upgrading project yesod 1.2 1.4. when ran yesod devel got next error:

starting development server... starting devel application devel application launched: http://localhost:3000 devel.hs: connect: not exist (connection refused) exit code: exitfailure 1

i'm not sure how debug quickly. running on ubuntu 14.04 x64. i'm able run web server on port 3000.

i tracked downwards using database.memcache.server not having memcached running. yesod upgrade wasn't related.

haskell yesod persistent haskell-warp

sql server - Apparently massive primary key index -



sql server - Apparently massive primary key index -

disclaimer: not mssql dba....

i have used 2 sql queries presented elsewhere on stackoverflow [1]: http://stackoverflow.com/a/7892349/2195559 [2]: http://stackoverflow.com/a/17600911/2195559

[1] claims show total space used table , indexes [2] claims show total space used index

so looking @ largest table:

[1] gives usedspacekb = 58757504 . table , indexes 56gb

[2] gives indexsize(kb) = 55166168 largest index on same table (there others on same table - tiny in comparison). largest index 52gb

[1] - [2] (for indexes on same table) = 4gb.

so if [1] , [2] right , have understood output have 4gb table 52gb primary key index on it.

questions:

have understood [1] , [2] correctly? if how can have pk index 52gb on table 4gb? utilize nightly batch jobs remove old rows in table (its audit log), possible index not beingness reduced when rows removed table? what's simplest & quickest way clear index - drop , build or there more efficient mechanism?

the ddl table , pk index

create table "yyy"."xxx_audit" ( id numeric(19,0) primary key, version numeric(19,0), compressed_response image, date_created datetime, duration numeric(19,0), request text, response text, session_id varchar(255), uid varchar(255), webservice_uri varchar(255), event_id varchar(36) ) go create unique index pk__xxx_audit__6cc31a31 on "yyy"."xxx_audit"(id)

have understood 1 , [2] correctly?

no. have table clustered index of size 52 gb , non-clustered index of size 4gb. total size of indexes: 56 gb. not have other indexes. there no 'table', there indexes.

i suggest read table , index organization first. tables can organized heaps, clustered index b-trees (and clustered columnstores or hekaton indexes in sql server 2014 , later). searching 'table' base of operations heap, since declared primary key had become clustered index of table not have base of operations heap.

sql-server database

java - Eclipse reading wrong import on start up -



java - Eclipse reading wrong import on start up -

when ever started eclipse maven project called has error - kinda hard explain - see image

if class you`re trying import does exist, eclipse failure.

project -> clean should prepare it.

java eclipse

PHP get CSV from URL, load into array, format -



PHP get CSV from URL, load into array, format -

i trying write script download historic info yahoo finance csv. script loads info array i've run 2 problems. first despite creating date range pull yahoo, maintain getting entire historical info stock , i'm not sure why.i want lastly 6months calculated current day. second, able utilize str_getcsv load info array, have been unable create loop work set in table first row beingness headers of table columns , rest organized date in rows.

here code:

<?php $stock = "aapl"; $date = strtotime(date('y-m-d') . ' -1 month'); $date2 = strtotime(date('y-m-d') . ' -6 months'); $a = (date('m', $date)); $b = (date('d', $date)); $c =(date('y', $date)); $d = (date('m', $date2)); $e = (date('d', $date2)); $f =(date('y', $date2)); $s = str_getcsv(file_get_contents("http://ichart.yahoo.com/table.csv?s=$stock&a=$d&b=e&c=$f&d=$a&e=$b&f=$c&g=d")); stock:echo $stock; echo '<pre>'; print_r($s); echo '</pre>'; ?>

and here output:

aapl array ( [0] => date [1] => open [2] => high [3] => low [4] => close [5] => volume [6] => adj close 2014-10-10 [7] => 100.69 [8] => 102.03 [9] => 100.30 [10] => 100.73 [11] => 66270200 [12] => 100.73 2014-10-09 [13] => 101.54 [14] => 102.38 [15] => 100.61 [16] => 101.02 [17] => 77312200 [18] => 101.02 2014-10-08 [19] => 98.76 [20] => 101.11 [21] => 98.31 [22] => 100.80 [23] => 57364800 [24] => 100.80 2014-10-07 [25] => 99.43 [26] => 100.12 [27] => 98.73 [28] => 98.75 [29] => 42068200 [30] => 98.75

etc...

any help appreciated!

you missed dollar sign in url in b=e. , here code in rows:

$data = file_get_contents("http://ichart.yahoo.com/table.csv?s=$stock&a=$d&b=$e&c=$f&d=$a&e=$b&f=$c&g=d"); $rows = explode("\n",$data); $s = array(); foreach($rows $row) { $s[] = str_getcsv($row); }

php arrays loops csv

solr4 - Custom Solr Full Import -



solr4 - Custom Solr Full Import -

i have solr core core1, has couple of facet types , want implement custom import them. eg: have next facet types:

facet1 facet2 facet3

when utilize info import handler, don't want "delta" business reasons, , want clean / full-import facet1 , facet2 , leave lone facet3. possible in solr?

any help / direction appreciated.

you utilize approach similar 1 mentioned @ http://wiki.apache.org/solr/dataimporthandlerdeltaqueryviafullimport.

your query in data-config.xml

<entity ... query="select ... '${dataimporter.request.clean}' = 'true' or facet in (facet1, facet2)">

so indexing documents in facet1 , facet2 utilize

dataimport?command=full-import&clean=false

for doing total import facets, use:

dataimport?command=full-import&clean=true

(i haven't tested this, create sure.)

solr solr4 solrcloud

Change a make variable, and call another rule, from a recipe in same Makefile? -



Change a make variable, and call another rule, from a recipe in same Makefile? -

i have seen how manually phone call other target create target?, question bit different; consider illustration (note, stackoverflow.com changes tabs spaces in display; tabs preserved in source, if seek edit):

texengine=pdflatex pdflatex: echo engine $(texengine) lualatex: texengine=lualatex echo here want phone call pdflatex rule, check $(texengine) there!

here, if run default target (pdflatex), expected output:

$ create pdflatex echo engine pdflatex engine pdflatex

but, target lualatex, want to:

change make variable texengine lualatex, , call same code in pdflatex (which uses it).

how that?

clearly, in lualatex rule don't manage alter texengine variable, because when seek it:

$ create lualatex texengine=lualatex echo here want phone call pdflatex rule, check pdflatex there! here want phone call pdflatex rule, check pdflatex there!

... know if possible in makefiles.

use target-specific variable

there 1 more special feature of target-specific variables: when define target-specific variable variable value in effect prerequisites of target, , prerequisites, etc. (unless prerequisites override variable own target-specific variable value).

texengine=pdflatex pdflatex: echo engine $(texengine) lualatex: texengine=lualatex lualatex: pdflatex echo here want phone call pdflatex rule, check $(texengine) there!

the output is:

$ create pdflatex echo engine pdflatex engine pdflatex $ create lualatex echo engine lualatex engine lualatex echo here want phone call pdflatex rule, check lualatex there! here want phone call pdflatex rule, check lualatex there!

makefile make gnu-make

Cross products of elements of 3D array and matrix columns without loop in R -



Cross products of elements of 3D array and matrix columns without loop in R -

i'm working on fishery stock assessment model , want speed removing loop (actually 2 loops of same form). have array, a, dim(a)=[l,l,y], , matrix, m, dim(m)=[l,y]. these used create matrix, mat, dim(mat)=[l,y], calculating matrix products. loop looks like:

for(i in 1:y){ mat[,i]<-(a[,,i]%*%m[,i])[,1]}

can help me out? need speed gain. also, (don't know if it'll create difference but) each a[,,i] matrix lower triangular.

i'm pretty sure give results want. since there no reproducible example, can't absolutely sure. had trace of linear algebra logic see trying accomplish.

library(plyr) # need split array list of 9 matrices b = lapply(alply(a, 3), function(x) (x%*%m)) # perform 9 linear algebra multiplications sapply(1:9, function(i) (b[[i]])[,i]) # extract 9 columns want.

i used next test data:

a = array(rnorm(225), dim = c(5,5,9)) m = matrix(rnorm(45), nrow = 5, ncol = 9)

arrays r performance loops matrix

angularjs - How to mock service in angularAMD with karma/jasmine? -



angularjs - How to mock service in angularAMD with karma/jasmine? -

i have project using angularamd/requirejs/karma/jasmine, have basic configuration working, unit tests run , pass successfully.

i cannot mocked service injected correctly using either angular.mock.module or angularamd.value().

i have:

// service definition in services/myservice.js define(['app'], function(app) { app.factory('myservice', [ '$document', function($document) { function add(html) { $document.find('body').append(html); } homecoming { add: add together }; }]); } ); // test define(['angularamd', 'angular-mocks', 'app', 'services/myservice'], function(aamd, mocks, app) { describe('myservice', function() { var mybodymock = { append: function() {} }; var mydocumentmock = { find: function(sel) { // never gets called console.log('selector: ' + sel); homecoming mybodymock; } }; var svc; beforeeach(function() { // seek standard way mock service through ng-mock mocks.module(function($provide) { $provide.value('$document', mydocumentmock); }); // hedge bets - seek overriding in aamd ng-mock aamd.value('$document', mydocumentmock); }); beforeeach(function() { aamd.inject(['myservice', function(myservice) { svc = myservice; }]); }); it('should work', function() { // utilize svc expecting have injected mock of $document. spyon(mydocumentmock, 'find').andcallthrough(); spyon(mybodymock, 'append'); svc.add('<p></p>'); expect(mydocumentmock.find).tohavebeencalledwith('body'); expect(mybockmock.append).tohavebeencalledwith('<p></p>'); }); }); } );

does know i'm going wrong ? help much appreciated.

angular isn't asynchronous, think not ideia utilize both. if you're trying reach modularization method, okay, utilize requirejs optimizer build before set on browser, , tests, think can utilize requirejs optimizer build modules before, allow free "commonjs environment in tests".

angularjs karma-jasmine angular-amd

javascript - window.location.href doesn't work in Ipad and Iphone -



javascript - window.location.href doesn't work in Ipad and Iphone -

i used google login api in form. after logged in user, used window.location.href redirect user page, not working in ipad , iphone.

window.location.href = "http://example.com/test";

remove href shown below

window.location = "http://example.com/test";

javascript ios mobile

css - Removing a html attribute added from razor or keep it from adding -



css - Removing a html attribute added from razor or keep it from adding -

i'm adding input field via razor

@html.textboxfor(x => x.ccversandkosten, new { @class = "form-control" })

but adds html attributes don't want:

<input class="form-control" data-val="true" data-val-number="das feld&quot;versandkosten&quot; muss eine zahl sein." data-val-required="das feld &quot;versandkosten&quot; ist erforderlich." id="ccversandkosten" name="ccversandkosten" type="text" value="0" />

the attribute don't need value="0". thinks razor adds value attribute because variable ccversandkosten float, alter needs float.

is there way remove attribute or maintain razor adding ?

in model define float. "float" must not null. when model initialize, not-nullable variables initialize 0. not razor feature, c# feature.

so razor display field 0. can define variable nullable (float? ccversandkosten) display nil value attr.

@model mymodel means var model = new mymodel();, when create new class, c# initialize not-nullable variables. (float, int, double, datetime,..)

html css asp.net-mvc razor

c - PETSc undefined reference -



c - PETSc undefined reference -

i have pretty beginners' question, i'm lost now. i'm origin petsc, have problems compilation of code. i'm trying utilize own makefile, compiler keeps yelling "undefined reference" error. i've tried figure out myself several hours, don't see mistake. so, if you'll recognize mistake, help appreciated.

this whole error message:

mpicc petsclufact.o -l/home/martin/petsc-3.5.2/arch-linux2-c-debug/lib petsclufact.o: in function `main': /home/martin/dokumenty/programovani/petsclufact.c:18: undefined reference `petscinitialize' /home/martin/dokumenty/programovani/petsclufact.c:20: undefined reference `petsc_comm_world' /home/martin/dokumenty/programovani/petsclufact.c:20: undefined reference `matcreate' /home/martin/dokumenty/programovani/petsclufact.c:21: undefined reference `matsetsizes' /home/martin/dokumenty/programovani/petsclufact.c:22: undefined reference `matsetfromoptions' /home/martin/dokumenty/programovani/petsclufact.c:23: undefined reference `matmpiaijsetpreallocation' /home/martin/dokumenty/programovani/petsclufact.c:24: undefined reference `matgetownershiprange' /home/martin/dokumenty/programovani/petsclufact.c:26: undefined reference `matdestroy' /home/martin/dokumenty/programovani/petsclufact.c:28: undefined reference `petscfinalize' /home/martin/dokumenty/programovani/petsclufact.c:20: undefined reference `petscerror' /home/martin/dokumenty/programovani/petsclufact.c:24: undefined reference `petscerror' /home/martin/dokumenty/programovani/petsclufact.c:23: undefined reference `petscerror' /home/martin/dokumenty/programovani/petsclufact.c:22: undefined reference `petscerror' /home/martin/dokumenty/programovani/petsclufact.c:21: undefined reference `petscerror' collect2: error: ld returned 1 exit status make: *** [petsclufact] error 1

and .c file - it's not completed, it's test:

static char help[] = "reads petsc matrix , vector file , reorders it.\n\ -f0 <input_file> : first file load (small system)\n\ -f1 <input_file> : sec file load (larger system)\n\n"; #include <petscsys.h> #include <petscmat.h> int main( int argc, char **args ) { mat a; // matice //is isrow,iscol; // permutace radku sloupcu petscint r = 5, c = 5; // rozmery matice petscint i,j; // souradnice v matici petscint istart, iend; petscint ii; // pocitadlo petscscalar v; // 2-rozmerne pole ??? petscerrorcode ierr; petscinitialize( &argc, &args, (char*)0, help ); ierr = matcreate( petsc_comm_world, &a );chkerrq( ierr ); ierr = matsetsizes( a, petsc_decide, petsc_decide, r*c, r*c );chkerrq(ierr); ierr = matsetfromoptions(a);chkerrq(ierr); ierr = matmpiaijsetpreallocation( a, 5, petsc_null, 5, petsc_null );chkerrq(ierr); ierr = matgetownershiprange(a,&istart,&iend);chkerrq(ierr); matdestroy(&a); petscfinalize(); homecoming 0; }

here makefile:

include ${petsc_dir}/conf/variables include ${petsc_dir}/conf/rules cflags=-i${petsc_dir}/include -i${petsc_dir}/${petsc_arch}/include petsclufact: petsclufact.o mpicc petsclufact.o -l${ld_library_path} petsclufact.o: petsclufact.c mpicc ${cflags} -c petsclufact.c -o petsclufact.o

in $petsc_dir/include , ${petsc_dir}/${petsc_arch}/include there petsc header (.h) files located.

values of scheme variables are:

$petsc_dir=/home/martin/petsc-3.5.2 $petsc_arch=arch-linux2-c-debug $ld_library_path=/home/martin/petsc-3.5.2/arch-linux2-c-debug/lib

and construction of ld_library_path folder:

class="lang-none prettyprint-override">arch-linux2-c-debug/lib ├── libpetsc.a ├── libpetsc.so -> libpetsc.so.3.5.2 ├── libpetsc.so.3.5 -> libpetsc.so.3.5.2 ├── libpetsc.so.3.5.2 ├── modules │   └── 3.5.2-arch-linux2-c-debug └── pkgconfig └── petsc.pc

(answers in comments , edit. see question no answers, issue solved in comments)

@wesley bland wrote:

where passing library linker (or in case mpicc command? looks need -lpetsc in there in add-on -l<stuff> flag.

the op wrote:

i added -lpetsc flag makefile, looks now:

include ${petsc_dir}/conf/variables include ${petsc_dir}/conf/rules cflags=-i${petsc_dir}/include -i${petsc_dir}/${petsc_arch}/include petsclufact: petsclufact.o mpicc petsclufact.o -o petsclufact -l${ld_library_path} -lpetsc petsclufact.o: petsclufact.c mpicc ${cflags} -c petsclufact.c -o petsclufact.o

c makefile mpi petsc