Wednesday, 15 January 2014

haskell - How to make constraints of class function depends from class instance? -


I'm playing with a wrapper for lists that can be indexed individually.

The basic class of such wrappers:

  class list where the list: :: - ->   

The cover of the index which can be indexed by integral

Data IdxByIntList ia = (Ix i, Integral i) = & gt; IdxByIntList {getList :: [a]}

If there is an example of IdxByIntList of list , then i Integral and Ix :

  Example (Integral I, Ix i) => The list (idxByIntList i) from where = list = getList  

looks like the indexed function in the constraint (Ix i, integral i) dissatisfied It is possible to do this in the IDX list indexed :

  example indexed IDXBIInLIS list where indexed = zip [0 ..] . GetList  

but it can not be compiled because the compiler type variable i to enum and Num .

Edit:

In the indexed for IdxByIntList , [0 ..] Code> (name, anonymous A) which goes to zip [0 ..] and so on and it goes to indexed . Therefore, should be bound to indexed (Ix I, Enum i, Num i, List (li)) but it is not.

An example of i is integral , so it is an example of Num and Enum .

I have common barriers to all indexed and there are additional constraints for this, which are dependent on solid examples. Here, I have to put IdxByIntList on the constraint (Ix i, list (i), integral i) on indexed . How can I do this?

About changing the class a bit

  {- # LANGUAGE typefile # -} Import data IECS indexed Li where indexed :: li ~ li = & gt; Li-A - & gt; [(I, A)] - I - Type of index - L - Type wrapper data IDXBIINLLITI AA = IDXIILLIL {getList :: [A]} Example (Integral I, IXI) = & gt; Indexed (IdxByIntList i) where indexed = zip [0 ..]. GetList  

This class creates the parameter only l instead of l , which may be sufficient for your use.

If you really need the do to be parametized on l , things will be more difficult; I think you need a related family type again * - & gt; Restrictions , which requires the constraintkinds extensions, and becomes odd to express family examples when more than one class obstacle is involved. (I do not know that this will work satisfactorily in practice.)


Lock or protect a data.table in R -


There are one or more ways to lock or preserve data.table , none Now they can be modified?

Say we have data:

  DT < After this I get the following behavior:  dt < Can I modify / code>? # Error or warning: DT # ID Val # 1: 1FU ##Uncategorized  

  dt [, val: = "bar"] # H2> 

It came because I am the author, a small R package at work which uses data.table on a large scale. It has some data.tables Translation tables), which may be the cause of issues (inappropriate translation) when a user accidentally modified it. I expected the data to be "internal" (as defined), but it does not.

Because it is only a problem with the data.table object, I just use the data according to the requirement within the function. Use frames, copying + casting Use data.table if I need I will go this route (my tables are small enough that time / memory overhead will not be seen), but I hope there is a more natural solution.

Here are some possible suggestions.

You can write your wrapper object (possibly using R6 package) which defines all edits to give an error to the device and do not change the underlying data, but the object Uses usable use functionality of standard data to read.

You can follow the approach of petals TeachingDemos function in package.

Both of the above are not correct and a determined person can still change them, they may not even be worth the work.

Every time your function runs, you can re-read your tables so that there is no need to change the disc, only r

There are tools / packages to calculate things like MD5sums, so that you can calculate for your data. Qualified, then when code runs, you can check MD5sum and close it.

You can save data data in RDTa style file and attach the file to the search path instead of loading it in the work directory. It can still be changed, but the chances of getting less than the spot are less and it will require more effort to change (make sure your code does not use local copies in the global environment ( get Use or :: or check that the local copy does not exist)).


vba - Excel Macro – Change the row based on value -


I want to change the macro below so that it can change the color of the part of the row, depending on the cell, if not in cell E2 If the value of "proof" is, the cells A2-E2 becomes red.

  sub-change color () lRow = range ("E" and rows.Count). (XlUp). For each cell in the row set MR = range ("E2: E" and lRow) if cell.Value = "proof" then cell.Interior.ColorIndex = 3 Next End Sub  
  the sub change changer (lRow = range ("E") 

And rows), replace cell.Interior.ColorIndex = 3 for a specific category. .ft.). (XLEP). For each cell in the row set MR = range ("E2: E" and LRO), if cell.Value = "proof" then the category ("a" & cell.ro & amp; ": E" & amp; ; Cell.ro). External Caller index = 3 next end sub

timer - How to count an amount of time from the last of a particular event, in AngularJS app -


In my angular app, I want to automatically save changes made by the user.

My strategy is that when the user stops to change, I want to do 20 seconds to AutoShare, if he is actively editing, then I want the timer to be the last Reset yourself to key stroke when it is allowed to run full 20 second course and trigger autosave.

How can I reset the clock regularly and any function can be triggered?

$ In the timeout angle, you can tell it from this function, through each ng-change Input is linked to the box. Cancel the promise and it has hit the ng-change every time.

HTML:

  & lt; Body ng-controller = "MainCtrl" & gt; & Lt; Input type = text ng-model = "theValue" ng-change = "queetosave ()" /> & Lt; / Body & gt;  

Script:

  var app = angular. Module ('plunker', []); App.controller ('MainCtrl', function ($ range, $ timeout) {$ scope.theValue = 'World'; var Autosive promo; $ scope.QueueAutoSave = function () {$ timeout.cancel (Auto-Svepromoz); Autosave promo = $ timeout (function () {alert ("saved!");}, 20000);}});  

Examples of working:


How to draw a ggplot2 boxplot with precalculated stats in R? -


I am trying to get a boxplate for the exact dataset. Datasets already I received the minimum, maximum, mean for a reply Time Test, 10th Pratisty and part 90th Pratisty I ran there anyway boxplot a ggplot2 this product?

I've included a sample of dateset.

Thanks,

  Flow Capability & lt; - C (1, 2, 3, 4, 5) response_time_min & lt; - C (9, 19, 29, 39, 49) response_time_10 & lt; - C (50, 55, 60, 60, 61) response_time_med & lt; - c (100, 100, 100, 100, 100) response_time_90 & lt; - C (201, 201, 250, 200, 230) response_time_max & lt; - C (401, 414, 309, 402, 311) df & lt; - Data. Frame (throughput, response_time_min, response_time_10, response_time_med, response_time_90, response_time_max) df throughput response_time_min response_time_10 response_time_med response_time_90 response_time_max 1 1 9 50 100 201 401 2 2 19 55 100 201 414 3 3 29 60 100 250 309 4 4 39 60 100 200 402 5 5 49 61 100 230 311  

Yes "Precomputed State".

  library (ggplot2) in ggplot (DF) + geom_boxplot (AES (x = factor (flow), ymax = response_time_max, looking for upper = response_time_90, y = response_time_med, mid = response_time_med, low = response_time_10, ymin = response_time_min), State = "identity")  

SQL Server Convert Rows to Columns -


इस सवाल का पहले से ही एक उत्तर है: < / P>

  • 2 जवाब

निश्चित नहीं है कि यह संभव है , ऐसे आदेश हैं जो किसी भी संविदा से जुड़ा जा सकता है, आईडी सभी अनुबंधों को प्रदर्शित करना है; समान पंक्ति से एक पंक्ति में मूल्य मैंने एक धुरी का उपयोग करने की कोशिश की है लेकिन मुझे नहीं लगता कि पिवोट के साथ पर्याप्त रूप से इसका इस्तेमाल करने के लिए मुझे यह पता लगाना है। वर्तमान में डेटा कैसे दिखाया गया है:

  आदेश कोई अनुबंध मूल्य 1 कॉन 1 5000 1 कॉन 2 10000 2 कॉन 3 2000 3 कॉन 500 500 3 कॉन 5000 3 कॉन 6 1000  

मैं इस तरह से डेटा को प्रदर्शित करना चाहूंगा:

  आदेश कोई अनुबंध मूल्य संविदा 2 मान 1 अनुबंध 3 मान 1 1 कॉन 5000 कॉन 2 10000 नल नल 2 कॉन 2000 2000 नेल नेल नेल नल 3 कॉन 500 500 सीएनआर 2000 1000  

किसी भी सुझाव के लिए धन्यवाद!

यह एक सुंदर एक गतिशील एसक्यूएल धुरी बनाने के तरीके के माध्यम से आपको चलने का अच्छा काम ध्यान में रखने के लिए कुछ चीजें हैं ... अगर आपके द्वारा शामिल किए जाने वाले अनुबंधों की संख्या में असाधारण रूप से बड़ा हो जाता है तो आपके डायरेक्टिव एसक्यूएल कथन आपके varchar variable में फिट होने के लिए बहुत बड़ा हो सकता है। इसके अलावा, प्रदर्शन बहुत खराब हो सकता है। तो अपने डेटा को जानिए और इसे आवश्यक रूप से फिल्टर करें लेकिन यह आपको उस आउटपुट को देना चाहिए जो आपके लिए पूछ रहे थे। (यदि आपको अनुबंध प्रति डेटा के 2 कॉलम चाहिए, तो आपको रचनात्मक बनाना होगा। लेकिन मुझे संदेह है कि यह पर्याप्त होगा।)


string - Python Extract variable data from lines -


I need to extract several pieces from an HTML file in the Axle Sheet. I have pulled the data, now let me find the lines Here is an example:

  "501.92 seconds: iPhone 5s_DownStream HTTP_TCP_Downlink_1: ILOAD = ** 12.000 ** Mbps Oding = ** 4.999 ** Mbps Freight = 4.980 Mbps L4 Goodput = 4.788 Mbps Packet loss = 0.38 SLA result = ** failed ** & lt; font color = white & gt; " 

I bold those items Confirms that require I figure. Because these values ​​make every change in every file and they should be saved in the variable name, I really do not know where to start

OK, here's the answer to a hack ... it does not look beautiful, but if your string pattern remains the same, you should be able to get results.

  string = "501.92secs: iPhone 5s_DownStream HTTP_TCP_Downlink_1: ILOAD = ** 12.000 ** Mbps Oding = ** 4.999 ** Mbps Freight = 4.980 Mbps L4 Goodput = 4.788 Mbps Packet Loss = 0.38 SLA results = ** fail ** & lt; font color = white & gt; "import re-def getnumbers (string, pattern): Results for pattern = [], number in pattern.items (): match = re.search (Pattern, string) valuestart = match.span () [1] results.append ([Pattern, (string [valuestart + 3: valuestart + number + 3]) Return result # If you need to get more value , Then add them to the dictionary in logic. # The number next to each pattern represents the expected size of the result. Print (meet (string, {"ILOAD =": 7, "OLOAD =": 7, "result =": 4})) # [['result' = ',' failed '], [' offset = ',' ' 4.999 ** '], [' ILOAD = ',' 12000 * ']]  

awk - Selecting columns using specific patters then finding sum and ratio -


I want to calculate the sum and ratio values ​​from the data given below. (Actual data includes more than 200,000 columns and 45000 lines (lines)).

For the purpose of clarity I have only given simple data format.

  #Frame BMR_42 @ o22 BMR_49 @ o13 BMR_59 @ o13 BMR_23 oo BMR_10 @ o13 BMR_61 @ o26 BMR_23OO1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0 1 1 1 4 1 1 0 0 1 0 1 5 0 0 0 0 6 1 0 1 1 0 1 0 7 1 1 1 1 0 0 1 1 1 1 1 0 0 0 0 9 1 1 1 1 1 1 1 10 0 0 0 0 0 0  

With some criteria the column should be selected.

The column data on which I think is the only column with " @ O13 " below I have selected columns selected from above examples.

  BMR_49 @ O13 BMR_59 @ o13 BMR_10 @ o 13 1 0 1 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 1 0 1 1 0 1 1 1 0 0 0 0  

With the selected column, I want to calculate:

1) The sum of all "1" in this example we get the value 16.

2) Number of total rows to be "1" (at least one time) is 8 rows from the above example, with at least one occurrence of "1".

Finally,

This is: "All" 1 (1 "1") with the total lines of the ratio of all "1" For example, the total of the total) / (total lines with the opportunity of "1"), for example, " @ O13 "

  awk '{i (i = 1; i & lt; = NF; i ++) if (i ~ / @ O13 /); Print ""} '$ file2  

Although this run does not show the value

Any kind of assistance should be appreciated on offer.

should do this:

  awk 'NR == 1 { For (i = 1; (i i) if ($ i) {s ++; f ++}; (i) in (i) i  with 1 = 16 rows = 1 / s> 

some more Readable:

  awk 'nr == 1 {for (i = 1; i & lt; = nf; i ++) if ($ i ~ / @ O13 /) if (F) R ++} END {print "number of 1" = "s \" \ nrows (a = i) = (for i == "1") {s ++ f ++} 1 = "r \" \ Nratio = "s / r} 'with the file  

how to get Visual Studio to show formatted color for iOS Xcode .m files -


I Xcode my iPhone (iPhone / iPad). I want to use Microsoft Visual Studio to edit M-purpose-files.

I like a .c file. V. S. for treatment of M file How do I set it?

How to do it:

Step ... 1. Visual Studio 2010 & Amp; 2013: Tools -> Options -> Text Editor -> File Extension 2. Type 'M' in the Extension field. 3. Field "Editor:" = Microsoft Visual C ++, 4. Press "Add", 5. OK, close 6. Open and reopen your .m file


eclipse - BIRT computed column use operator LIKE -


How to use operators in BIRT computed columns?

I tried:

  if (line ["department"] == "% desc%") {'test1'} and {'test2'}  

but it does not work. I have an error (line ["department"] such as "% desc%") {'test1'} and {'test2'}

Message is - [row: 1, column: 28] missing)


for example in crystal reports I use

  If {department} is like ["* ​​desc *", "* desc1 *"] then 'test1' and 'test2'  

but support of the BIRT operator does not do. Thank you in advance

as SQL syntax, while expression syntax for a calculated column is javascript. But when you can get the same result with pure SQL, why are you using a compute column? As with Oracle, the following SQL expression is the equivalent:

  The case when 'DEP%' is like DEPT, then 'test1' and 'test2' end  

OTOH If you insist on using a calculation column, you can use regular expressions.


parsing - How do I parse custom file with F#? -


I have a custom file in which the data is included in the format as below

  Prop1: value1 prop2: value2 prop3: value 2 table example 1 abcde10 11 12 13 14 12 13 11 12 20 table instances 2 xyz 1 3 4 3 4 0 table imports 3 prs 2 3 5 5 5 0  

I want to be able to parse this file and map the contents of POCO. I was really excited to work with CSV type provider in F #, but then I quickly realized that it may not be possible to use it in my case. Do I have to write my own parser in this case?

>

If this is a file format, then I will just write the parser with hand. Divide the file into separate tables, headline and header, then throw each line at String.Split and the resulting array parsed in specific record types for the table.

If that file format is more or less standardized and you expect that you will need to parse it more often and in different contexts (and / or you're feeling adventurous), you Always type your own type provider.


PHP move_uploaded_file directory and mysql table -


तो यह काम करता है:

  यदि (move_uploaded_file ($ _ files ["fileToUpload"] [ "Tmp_name"], $ target_file)) {गूंजती "फ़ाइल" बेसएनाम ($ _FILES ["fileToUpload"] ["नाम"]) "अपलोड कर दिया गया है।"; } Else {गूंज "क्षमा करें, आपकी फ़ाइल अपलोड करने में एक त्रुटि हुई।"; }  

और यह भी काम करता है

  echo imagejpeg ($ image, null, 30); $ Image = ob_get_clean (); ob_end_clean (); $ इमेज = जोड़ लार्स ($ इमेज); $ Sql ​​= "zzimages में शामिल करें (` user_id`, `नकल`) मूल्य ('9', '$ image')";  

लेकिन जब मैं डायरेक्टरी में डालने के लिए $ इमेज की कोशिश करता हूं और इसका उपयोग करता हूं, तो यह काम नहीं करता है। मुझे $ चित्र का उपयोग करने की आवश्यकता है क्योंकि यह ठीक से घुमाए गए छवि का प्रतिनिधित्व करता है।

तो यह काम नहीं करता, कृपया सलाह दें:

  यदि (move_uploaded_file ($ image, $ target_file) ) {गूंजती है "यह काम करने की ज़रूरत है"}  


android - Popup Window Animation not working -


I am trying to animate a popup window when shown with push_up in the animation from the bottom of the scene Close with a push_up animation but not working, popup normally shows with exclusion animation (very fast). Here's my code:

push_up_in.xml

  and set xmlns: android = "http://schemas.android.com/ APK / Ridge / Android "& gt; & Lt; Android Translation: Period = "1000" Android: fromYDelta = "100% p" Android: toYDelta = "0" /> & Lt; Alpha Android: Period = "1000" Android: fromAlpha = "0.0" Android: toAlpha = "1.0" /> & Lt; / Set & gt;  

push_up_out.xml

  & lt; Set xmlns: android = "http://schemas.android.com/apk/Native/Android" & gt; & Lt; Android Translation: Period = "1000" Android: fromYDelta = "0" Android: toYDelta = "- 100% p" /> & Lt; Alpha Android: Period = "1000" Android: fromAlpha = "1.0" Android: toAlpha = "0.0" /> & Lt; / Set & gt;  

styles.xml

  style name = "popup_animize" & gt; & Lt; Item name = "android: windowEnterAnimation" & gt; @ Anime / push_up_in & lt; / Item & gt; & Lt; Item name = "android: windowExitAnimation" & gt; @ Animation / push_up_out & lt; / Item & gt; & Lt; / Style & gt;  

and where the popup window is shown in the code:

  last popup window pw = new PopupWindow (pop view, 100 , 100, true); Pw.setBackgroundDrawable (new bitmapreadable ()); Pw.setOutsideTouchable (true); Pw.setAnimationStyle (R.style.popup_anim); Pw.showAtLocation (this.findViewById (R.id.map_layout), Gravity. BOTTOM, 0, 0); See map = (see) findViewById (R.id.map); Int mapwidth = map.getWidth (); Int mapheight = map.getHeight (); Int popup = (int) (maphit * 0.3); Pw.update (mapwidth, popup);  

Any ideas?

I do not think where you are setting the content view, nothing to show And if not, try not to be ready to make the background, and set the layout in the background, so that some problems have been solved with incorrect display colors in my project.


mapreduce - Riak: query array of 2i through Map Reduce -


Can I query secondary index in jobs in Rica, rather than just one key? Key ":" + "or" + + + + "" I "want to do something like this:

 " inputs ": {" bucket ": myBynet," index ":" MyIndex "," key "or" + key "," query ": [{" map ": {" language ":" javascript "," name ":" Riak.mapValuesJson "}}}}}  

But I have not received any support for this. The keys are not in any particular order, so I do not think that I can use questions.

You definitely want to reduce the map with it If you tell the key to your goal, you can limit the range and possibly improve the performance.

  {"Input": {"bucket": myBycket, "Index": "myIndex", "start": "key": {{"" "" "" "" "" "" "" | V.key == "key2") {return [& Lt; & lt; put you here & gt; & gt;]} and {return []}} "}}]}  

You should note that JavaScript According to the reduction of the map, it has been officially demoted, so you will be able to develop new development. You might want to use Nkshns.


c - Getting specific chunk of data from file on FTP server -


I am writing a CTP client. I am not making any changes to the server program.
The amount of data from the file on the specific server I have
Assume that I have a file and I want to read the previous 100 bytes from the file. I do not want to read the full file

I have been able to get the whole file using the RETR filename , but I could not find any way to read bytes in specific quantities.

Is there a way to do this for a standard FTP server?

Is there a way to do this standard FTP server?

No, you can tell the server to the situation where it should start with the REST (restart) command, but you can not tell how much data Should send. After receiving the data you want, you can turn off the data channel. The FTP server would probably complain about it because it had received a RST (writing against a closed socket), but in most cases this problem should not be created.


java - Getting context of another webapp in tomcat -


मेरे पास टॉमकेट 8.0.20 पर निम्नलिखित विन्यास हैं:

  सी: \ tomcat Conf server.xml context.xml वेबएप ऐप एप 2 ...... सी: \ बाहरी एप 3 वेब एप 4 वेब एप 5 वेब   

मेरे पास & lt; संदर्भ क्रॉस कॉन्टैक्स = "true" & gt; .... & lt; / context & gt;

और server.xml में:

  .......... & lt; होस्ट नाम = "Host.com" एपबेस = "वेबएप्स" अनपैक वार्स = "सच्चा" ऑटोडियोजन = "सच" & gt; & Lt; कन्टेक्ट कैशिंगअल्ड = "झूठे" डॉकबेज़ = "सी: \ बाहरी \ एप 3 \ वेब" पथ = "" क्रॉस कंटैक्ट = "सच्चा" पुनः लोड करने योग्य = "सच" /> & Lt; कन्टेक्ट कैशिंगअल्वाज्ड = "झूठे" क्रॉस कंटैक्ट = "सच्चे" डॉकबेस = "सी: \ बाहरी \ एप 4 \ वेब" पथ = "/ एप 4" पुनः लोड करने योग्य = "सही" / & gt; & Lt; कन्टेक्ट कैशिंगअल्ड = "झूठे" क्रॉस कंटैक्ट = "सच्चा" डॉकबैज = "सी: \ बाहरी \ एप 5 \ वेब" पथ = "/ एप 5" पुनः लोड करने योग्य = "सच" / & gt; & Lt; / होस्ट & gt;  / app ,  / app2  या  / app5  से  / app4 का संदर्भ प्राप्त करना  

के रूप में काम करता है:

request.getServletContext ()। GetContext ("/ app") शून्य नहीं है।

हालांकि, / app3 का संदर्भ (संदर्भ पथ के साथ / )।

कोई भी विचार क्यों getContext ("/") शून्य है

जैसा कि यह निकला, यह संस्करण 8.0.15 के बाद टॉमके में प्रतिगमन है

< पी> एक बग रिपोर्ट दायर की

वापस 8.0.15 के लिए टॉमकट और यह अब काम कर रहा है ....


grails - How to make a created JSON object an groovy object, so that I cat access properties via dot(.) operator -


JSONBuilder वर्ग के माध्यम से मैंने एक JSON वस्तु बनाई:

  def json = नया JSONBuilder ()  

मैं इस JSON वस्तु को groovy ऑब्जेक्ट में कैसे रूपांतरित कर सकता हूं, ताकि मैं डॉट ('।') ऑपरेटर के माध्यम से json गुणों को एक्सेस कर सकूं? JSON ऑब्जेक्ट में फ़ील्ड - लक्ष्य है और मैं संपत्तियों का उपयोग कर सकता हूं:

  target.someProperty  

लेकिन लक्ष्य की संपत्ति संरक्षित है क्या JSON गुणों को एक्सेस करने का कोई अन्य तरीका है?

पीएस वर्तमान में मैं आसपास काम करता हूं:

  नया JsonSlurper ()। ParseText (json.toString ())  

यह काम करता है, लेकिन मैं कुछ सरल चाहता हूं। / P>

आप ऐसा कुछ कर सकते हैं:

  JSONObject jsonObject = JSON पार्स (json.toString ()) JSONObject println jsonObject.validproperty के रूप में MyObject myObject = new MyObject (गुण: jsonObject.properties)  

यह मैपिंग के बीच क्या है पर काफी हद तक निर्भर है (जाहिर है) आपका JSONObject और MyObject, लेकिन इसे कार्य करना चाहिए।


Powershell: How to rollup Array data? -


I have a custom CMDlet that can query the status of each service for the CSV-list of computers and then CVS- The file is okay, see the example below. I want to choose this CSV-output (this pipe is really true) and then run the comparison; Pure array query For example, calculate the number of unique computers and list every service list that runs on all computers, or the services running on all those services do not have to run

I have used several tests I went through the medium and although I can read the array input, select the specific kernel, I can not list the selection of unique computers and count them. Below is the current version of my code, where it declines in the list of computer names and shows me the proper calculations of unique values ​​and / or 3.

In this example, the services running on each computer should be the result of:

 SVc1 

Where am I wrong in my thinking? Your cooperation is commendable. Although not new to programming, I PS

  function myTest {[cmdletBinding ()] absolute ([parameter (mandatory = $ true, valueFromPipeline = $ True, ValueFromPipelineByPropertyName = $ True, HelpMessage = "List of input CSV files, ComputerName, Service, State")] [array] $ listofficesandscs) BEGIN {} Process {{$ # $ listofferingSVCS = $ listOffsourceAndSVCs | Where {$ _. State - AQ is "running"} | | Select ComputerName, ServiceName # write-output $ ListOfRunningSvcs $ UniqComps = $ ListOfSvrsAndSvcs | Group {$ _. ComputerName} | Write ComputerName output, select $ Unique Comps} {write-warning $ _. exception. Message} end {}} END {}} import-csv \ ComputerServicesList.csv | MyTest | Ft  My input CSV looks like this: COMPName SvcName state localhost running SVC 1 localhost Svc2 turned off Comp1 running SVC1 running Comp1 Svc2 Comp1 running Svc3 Comp2 Running Svc1 running Comp2 Svc3 < / Pre> 

import-CSV returns an array so the custom function No need Piping directly group-object requires a response from you.

  $ data = import-csv \ ComputerServicesList.csv $ uniqueComputerCount = ($ data | order-object CompName-exclusive). Data $ data | Group-object svcname | Where-object {$ _. Calculation -q $ uniqueComputerCount} | Select - Expand Advertisement Name  

This will return all the services present on all the hosts. In which case only the SVC1 is. If you want to make sure that they were running then the same output would be pure with small changes

  $ data | Group-object svcname, state | Where-object {$ _. Calculation -q $ uniqueComputerCount} | Selection-object-expandedparty name. The e-object {($ _ -split ",") [0]}  

is more to come from this, but I have the component for the question Are you expecting to process each line and compare some matching variables like you go with? PowerShell basically handles it when it looks like a garbage.

At present your function is getting a line of data at one time and that single item is being sent to group-object as I have in my comments It was said that you must match your variables to CompName ComputerName


ruby on rails - How do I fix my database when I've deleted the current migration file? -


My problem is that I was doing some spiking at some point and I migrated my database with that migration in which I had made Spike branch again I came back to my master branch (I have never traveled). Now this migration is always in my database and it is making it impossible to migrate my database.

When I run

ActiveRecord :: Migrator.get_all_versions

My deleted migration file timestamp in this array is in this array I want to remove this version from the migrator. Also I can not leave the database

If the database can be blown off, then the fastest way would be to leave the database, , And re-apply the migration with the following steps:

  rake db: drop rake db: create db: migrate  

if in the database Useful Information & amp; If it can not be blown away, then it is difficult. Only the potential option will go to the database level, and the changes made by the migration have to be reversed.

Which tables / columns were added / deleted in the migration, and then run SQL scripts to reverse those changes.

In addition to this, delete a specific line related to this migration: With the following query: Delete the schema_migrations table, with the following query:

  schema_migrase where version = ' 201503 ...... ' 

gnupg - I can’t get `git tag -s` to ask for my GPG password -


I can execute a GPG function manually, which indicates your password via poutry, temporarily With this password I GIT tag -s and it works, other wishes I get:

  gpg: signature failure: Operation canceled GPG: signature unsuccessful : Operation canceled error: Failed to sign GPG data: Error on tag Unable to Kshr  

I have established through Hombre to'm using Mac OS X 10.10.2 and Grit and Jianupiji 2.1 (advanced). How do I get git tag -s to ask my password?


python - Persist login in Django Rest Framework -


मैं Django Rest Framework का उपयोग कर रहा हूं और मैंने rest_auth का उपयोग करके एक लॉगिन समापन बिंदु सेट किया है; एस एंडपॉइंट हालांकि, प्रवेश के बाद, अगर मैं पेज को ताज़ा करता हूं तो लॉगिन अवैध है

मैंने इसे `/ लॉगिन चेन 'एंडपॉइंट सेट करके परीक्षण किया है, जिसे मैं लॉगिंग के बाद निम्नानुसार जांच करता हूं:

  @ipi_view ([' GET ',]) @permission_classes ([AllowAny,]) डीईएफ़ get_user (अनुरोध): उपयोगकर्ता = request.user प्रिंट (उपयोगकर्ता)  

प्रवेश करने के बाद, अगर मैं पृष्ठ पर रहने और प्रदर्शन एक / LoginCheck ', प्रिंट कमांड सक्रिय उपयोगकर्ता के उपयोगकर्ता नाम प्रदर्शित करता है हालांकि, पृष्ठ के रीफ्रेश पर, अगर मैं एक ही फ़ंक्शन करता हूं, तो यह अनाम उपयोगकर्ता प्रिंट करता है ( 'Rest_framework.authentication.SessionAuthentication',),)

मैं: मैं निम्नलिखित प्रमाणीकरण वर्गों

  REST_FRAMEWORK = { 'DEFAULT_AUTHENTICATION_CLASSES' का उपयोग किया है क्योंकि  TokenAuthentication  का उपयोग कर मैं एम.पी.ए. क्या मैं लगातार गैर फेसबुक लॉगिन के संदर्भ में याद आ रही है 

संपादित करें:

मेरी सेटिंग्स मिडलवेयर

  MIDDLEWARE_CLASSES = ( 'django.contrib .sessions.middleware.SessionMiddleware ',' corsheaders.middleware.CorsMiddleware ',' django.middleware.common.CommonMiddleware ',' django.middleware.csrf.CsrfViewMiddleware ',' django.contrib.auth.middleware.AuthenticationMiddleware ',' Django .contrib.auth.middleware.SessionAuthenticationMiddleware ',' django.contrib.messages.middleware.MessageMiddleware ',' django.middleware.clickjacking.XFrameOptionsMiddleware ',)  

यदि आप एक टोकन के साथ लॉगिन करते हैं, तो यह केवल उस अनुरोध के लिए ही होगा- respone चक्र डिज़ाइन के द्वारा यह नियमित डीजेंगो ब्राउज़र सत्रों की तरह निरंतर होना नहीं है। इसलिए किसी भी बाद के अनुरोधों के लिए आपको टोकन के मूल्य को संलग्न करना होगा। एक कुकी से प्राप्त कर रहा है या अपने ग्राहक आवेदन यह अन्य तरीकों से की दुकान पर निर्भर करता है

यहां कुछ उदाहरण कोड:।

  वर अनुरोध = नए XMLHttpRequest () request.setRequestHeader ( "प्राधिकरण", "टोकन" + टोकन); Request.open ("GET", "foo / bar", सच);  

VB6 Error when calling SQL Server SP: "Operation is not allowed when the object is closed" -


I have an old VB6 application that was connected to the production base database. The database was recently migrated to SQL Server 2008 R2 and now I am processing an app to keep it up-and-running. The error I am getting is "Operation is not allowed " when the object is closed.

This is the structure of the code on VB6:

  New ADODB.Connection connString = as the string reticular conn as the dim dim connString in the form of slow SQL "Provider = SQLNCLI10.1; Integrated Security = SSPI; Security Info = False, Initial List = CatalogName; Data Source = Production_Server_Name, "SQL =" EXEC sp_name @ param1, @ param2, @ param3, @ param4 "ADODB.Command Cmd = conn.Open connString as Cmd New ADODB.Command set Cmd.ActiveConnection = Conn Cmd.CommandText = SQL Cmd.CommandType = adCmdText CMD. CommandsTimeAut = 300DDRsADDB Record Setset RS = New ADODB Richeset R. Open sql, cone - & gt; Code fails on this line !!! RS set = Cmd.Execute () If there is nothing, or IsNull, then set RS = nothing bla bla bla bla bla.  

stored procedure code :

  process sp_name (integer, as in @ param1), as integral to param2, as integer as param3, as @ param4 nvarchar (150)) Set NOCOUNT - All code goes here Returns  

Code structure notes :

  • @param 1, Ultimate 2 and Ultimate 1 Integer Definition The value @param 4 different string values ​​by commas
  • I already know Adiodibi declared objects on the same line and may be instances.
    • The SP works perfectly when only the reading database is executed with the database from SSMS.
    • SP uses variable tables (@VariableTables) for intermediate processing accessories.
    • VB6 code works when "sp_who" bult in SQL Server SP
    • calling VB6 code works when SQL variable
    • calls for full merit SP fail (Exec DB. dbo.sp_name) using
    • SP failure

    Any words really appreciated for the error of this topic And correct answers are accepted immediately.

You need to open it for the first time

P>

  Moderate ADODB.Recordset set = as new ADODB.Recordset conn.Open () & lt; -. This rs.Open SQL missing, angle set rs = Cmd.Execute ()  

database design - Establishing One-to-One Relationship in Entity Framework -


When working with one-to-one relationship at the database level, we (I?) Often implement it In fact, one-to-many relationship ends.

For example:

  Make Table Master (MasterID INT Primary Key)  

and

 < Code> Create table child (childId INT Primary key, MasterID INT, contract child_master_fk foreign key (Master ID) reference master (MasterID))  

Single child only Can refer to a guru , there is nothing in preventing the same children s from referring to master , resulting in one-to- many Iste.

When creating an entity data model from such a database set up, it is reflected with the fact that the master unit will have reference to the child unit, but a master in the child's unit The unit will be a collection.

Since I look at logical relations, I hip as one-by-one, I do not expect that the child's master collection contains more than one element; Thus, I want to keep a child organization a master reference rather than a collection.

What is the correct way to accomplish this? Creating foreign key constraints in two ways at the database level? Missed the generated model?

tweak model Add a single reference property, which gives a single example and ignores the store property Then set the sole property overlooked by EF in its mapping configuration.

It is not what I call beautiful, but when using e-mail, such sacrifice is often the database already present.


alias - Faking Index per User: is having many aliases bad? -


On an elastic / elastic search website, many (thousands) customers are recommended to use and use an index LIS filters to separate your data invisibly.

I have heard that someone says that this is not a good practice because the nickname is part of the cluster state.

Why is this a matter? This is the first time I've heard it.

There is nothing wrong with the aliases per copy . The nickname is very light: when you make a surname, it looks at the index and puts an "alias tag" on that index.

When you perform a search against a nickname, if there is no matching index, it will examine the tagged aliases and use the underlying index. The whole process is very light, so there is really no problem, from a search perspective, to get many nicknames.

Note about cluster state, however, is valid (sorta). Millions of nicknames (or millions of fields etc.) will blot the cluster state. Whenever there is a change, this cluster state is published on all the nodes, which guarantees flexible detection that all nodes can respond to all questions.

The problem is that if your cluster position becomes overwhelming (hundreds of megabytes, etc.) the physical work of publishing it for the cluster becomes negligible, adding 800 nodes or 800 nodes to each 800 Imagine publishing 100 nodes. The Master also has a fixed CPU cost which becomes a problem.

In practice, there are lots of tricks to keep the difference between this correcration, cluster states, batching etc. But basically the cluster state represents an obstacle which can become a problem if you become very big in the state.

In the real world, some groups have never been able to access this problem, because for this a large number of fields / surnames / indexes / analysts actually have such a large size of a cluster state Do bloat.

If you are concerned about this, you can keep an eye on this. Pending tasks will show all cluster-level functions that are queued for processing on master node. It should be almost always empty, because the guru is sometimes interrupted in a cluster, but if you see this line rising (and high load on your master), then you may have a cluster state problem.


android - Providing Up (aka Back) Navigation - with UI Fragments -


Google Doc tells you how the button above in an app with multiple people Display activities (by specifying "parent" activities in AndroidManifest.xml):

screenshot

Although I'm working on a Bluetooth application (starts with minSdkVersion = 18 ) where single is the main activity and There are 3 pieces:

  • Mainforgement. Java
  • S
  • That's why I used the ActionBarActivity :

      MainActivity ActionBarActivity implements BleWrapperUiCallbacks {  

    and I setDisplayHomeAsUpEnabled (true) call method:

      @Orride Bundle Saved InstantStat) {super.onCreate (savedInstanceState); RequestWindowFeature (Window.FEATURE_INDETERMINATE_PROGRESS); SetContentView (R.layout.activity_root); GetSupportActionBar () setDisplayHomeAsUpEnabled (true).  

    This displays up button in my app, but I still have 3 questions:

    1. Up button (when I'm showing the mainframe)?
    2. How to "wire" the up button - does it currently touch nothing?
    3. What do I use instead of the following line in my AndroidManifest.xml? Android: Theme = "@Android: Style / Theme. Holo.NoActionBar"

I can answer the second question to provide navigation by overriding this method:

  Public Boolean Onoptsim selected (menu items) {Switch (item .getItemId ()) // // Response to Home button case Android at the top of the action bar. R.DHOM: Neville. NaveetupframeSmacket (this); Back true; } Return Super.Options item selected (item); }  

bash - If statement to display error if data is not present in a file -


  echo "Please enter a forum"; Forum; if [ ! $ Foreman]; Then echo "$ Forename not found"; Else grep -n "Forename: $ Forename" $ ​​filename | type;  

i

I am trying to use the above code to check that the user entering the string in the file exists, the file name is < Code> Address Book Txt which I assigned to the variable filename .

Can someone advise me whether this will work or recommend a better way of checking the file. You can print the contents of the file by using the cat for example:

   

You can now check that the string content is empty:

  if [- N "$ Content"]; Then you can use the  grep   

Code> content = $ (grep "$ pattern" "$ filename")

and if it will be the same


google spreadsheet - How Can I Use ImportHTML to Fetch My Modem's Stats Webpage? -


problem

I try to use Google Sheets function to draw statistics from the hints of my modem The page shows something like this:

  = IMPORTHTML ("http://192.168.100.1/cmSignal.htm", "table", 4)  < / Pre> 

is simple enough, but the function returns only the error: the URL "http://192.168.100.1/cmSignal.htm" can not return, something like that SE has seen degrees to different degrees SE

Doubt

Although I have explicitly said that the documentation has not been enabled, it seems that the function in Google Sheets is "remotely", as the sheet Is stored or processed at the end of Google, it effectively means that I can not use the function to drag data from a local website, such as the modem address, because an external machine for my LAN Do not know that Where is "192.168.100.1"

I think it is possible to install some sort of forwarding, but I am definitely unsure if the import supports HTML custom ports.

Questions and Needs

Question: Is it possible without resorting to some external scripting method

Note: I think maybe I have more than a million other ways to get the data, but I am particularly interested in this route. / P>

You can do this in Powerhale.

I am using:

$ url = 'http://192.168.100.1/cmSignalData.htm' $ r = invitation-webRevenue $ url. Get-WebRequestTable.ps1 $ r -TableNumber 3

Returns:

  Signal stats (Cowdwarts) bonding channel value ------- ------------------ -------------------- Channel ID 54 Total Unauthorized CodeWords 5117105038 Total Processed Codewords 26 Total Uncorrectable Codewords 1643  

And try to use different table numbers to scrape the data that you want.

Just call the call - grab the Webrequest script. / P>


symfony - extending CRUD controller in sonata admin and problems with PHP Strict standards -


Text after "div class =" itemprop = "text">

I am using the latest (Dev-Guru) Sonata Admin and I Sonata Admin for my own createAction () method want to make . . I want to save some user information, because I want to save some time, because what I have to do,

my custom controller is - s \ CoreBundle \ controller \ NewsAdminConroller.php

  & lt ;? Php namespace s \ core bundle \ controller; Use Sonata \ AdminBundle \ Controller \ CRUDController as the controller; Use Symfony \ Component \ Security \ core \ SecurityContextInterface; Class NewsAdminController extends the Controller {/ ** * Set system User ID * / Private function updateFields ($ object) {// some code - this is my own method} Public function createAction (Request $ request = null) code for // Creating ... this is similar to the default code}}  

Default CRUD - Sonata \ AdminBundle \ Controller \ CRUDController.php:

  Class CRUDController extends Controller {public function createAction (request $ request = null) {// ...}} Both arguments (in the same way) And it gives me an error:  

PHP strict standards: S \ CoreBundle \ Controller \ NewsAdminController's :: createAction declaration (Sonata \ AdminBundle \ Controller) \ CRUDController :: createAction (Symfony \ component \ HttpFoundation \ request must be compatible with $ request = zero) /home/mark/dev/project/src/S/CoreBundle/Controller/NewsAdminController.php on line 129

Sonata \ AdminBundle \ Controller \ CRUDController :: createAction (Symfony \ Component \ HttpFoundation \ Request $ request = NULL)

a request object , but if the Do not declare it, then it indicates that the S \ CoreBundle \ COntroller \ Request

simply use the "Symfony \ Component \ HttpFoundation \ Request; " at the top of the file.


javascript - Create ID using current DATE with additional auto increment number -


I have had trouble creating an ID for my form. I am currently using ASP Classic and Oracle I need to create an ID in which the current date and 2 additional numbers like: yyyymmdd + Auto increment in sequence order (2015031601, 2015031602) .

So far, I only return the current date value with the random number in my form which is created using the javascript in the Math.random () function. But the id actually needs to be automatically incremented in the number sequence.

The current date for the random number and the code for the math:

  var date = new date (); Var nowadays = date.getDate (); Var Azam = date.getMonth () + 1; Var nowadays = date.getFullYear (); Var q = nowadays; If (daemon = l = = 9) {var y = "0" + daeman; } And var y = Azamohan; If (nowadays, & lt; = 9) {var z = "0" + nowadays; } Else var z = todaydate; Var k = Math.flur ((Math. Random) * 20) + 01); & Lt; / Script & gt; & Lt; Script language = "javascript" & gt; Document.getElementById ('ID'). Value = q + y + z + k; & Lt; / Script & gt;  

create oracle sequence

  create sequence table_name_seq;  

and enter the ID before the INSERT trigger

  Start table_name_Ri to create a trigger on table_name before INSERT for each line (TO_CHAR (SYSDATE, 'YYYYMMDD') || table_name_seq.NEXTVAL): Dual to NEW.id; End;  

javascript - Clickevent triggering before viewModel can grab radio button values -


I have a backbone view for some radio buttons that are essentially handling on which the radio button is on the page The data is to be collected and what to do if the radio button is clicked.

My problem is on some pages (where the user is required to go to the next page, when clicking on the radio button, I know stupid, but this requirement) gathering information on the View Models radio button Before click event is being triggered

Click What is a way to trigger the visual model to gather that information before the event starts?

I have my event at the top

  extendEvents: {'click BTN': 'getClickEventAction'},  

Creating visual model

  createViewModel: function () {var viewModel = kb.viewModel (this model, {exclude: ['option']}); ViewModel.value = Workflow layout. Controll Value (see modell); // function where I am getting their prices and other fun stuff to make the rest of the app work. },  

and then my clickAdventure

  getClickEventAction: function (event) {var $ el = $ (event.currentTarget); Var Action = $ el.data ('clickeventaction'); Var code = $ el.data ('clickeventcode'); If (verb & amp; amp; this [verb]) this [action] (code); },  


c++ - Having problems trying to use a private class declared in header file in the cpp file -


I am implementing a binary tree and for doing so I have 2 files, a header and one implementation. CPP file is. In the header file I have declared a class 'node' in the private sector, and In the CPP file I have a function that gives 'node *', but when I try to compile my code, then I will get an "unknown type" 'node' function declaration.

Contextual Code:

 In  // Private: Class node {public: node * left; node * right; int data; node (int n) {it-> data = n; It-> left = null; it-> true = null;}}; // in.cpp node * Binary_Ordered_Tree_int :: insert (node ​​* n, int i) {if (n == NULL) {new Return the node (i);} If (n-> data is } i {n-> Enter true = (n-> true, i);} other {n-> left = (n-> left, i);} return n;}  
< P> Thank you in advance.

Because the type of return comes in the function name before (and its class ), The compiler does not know that he should look in the class, so you can either tell it:

Preferences> Binary_Ordered_tree_int :: node * Binary_Ordered_tree_int :: insert (node ​​* n, int i) / Code>

Or, if you have C ++ 11 available, you use the back type So that the type of return is in the context of the class:

  Auto Binary_Ordered_tree_int :: insert (node ​​* n, int i) -> Node *  

c++ - Does a filter / StringSink allocated with new require a delete? -


Consider the code line:

  string source (cipher, true, new pkc scripter filter (rng, decryptter, new string sysink (plain text)); The filter has been designed using the   

filter and stringsync object using new , now I'm curious whether I want to remove those people I am liable 'I am sure how I will do this because I need pointers for these objects.

When I look at test projects, I can not get a delete, so I delete these objects automatically.

But since the documentation may be wrong, I think I am sure.

By looking at those sections, both of them have their code from a member_ptr Adds that are related to auto deletion. You should not remove them manually, just handle it to the library.


menu - Submenu in wordpress -


I already have a menu, now I am creating submenu and I need simulators effect on this site: / P>

    > pre & lt; & Lt; Li & gt; & Lt; A href = "#" & gt; Item & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Item & lt; / A & gt; & Lt; Ul class = "sub-menu" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Submenu & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Submenu & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Item & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Item & lt; / A & gt; & Lt; Ul class = "sub-menu" & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Submenu & lt; / A & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Submenu & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Li & gt; & Lt; Li & gt; & Lt; A href = "#" & gt; Item & lt; / A & gt; & Lt; / Li & gt; & Lt; / Ul & gt;

    Structure:

    Menu functions:

    • The sub menu only appears when clicked on the parent menu
    • Background

Please show me any direction to me, how do I need to style it or use some script P>

Wordpress, by default, all & lt; Li & gt; A class of sub items "menu-" Kids item-is.

First of all, we will hide sub menu with CSS.

  .sub-menu {display: none;}  

Then with jQuery, we add a click function and .slideToggle to change the style display: block; and parents & lt; Li & gt; 's & lt; A & gt; Add a slide open / close effect when clicked.

  $ ('menu-item-has-kids'). Children ('a'). ('Click', function (event) {event.preventDefault (); $ (this) .next ('sub-menu'). SlideToggle (100) .end () .Parent ('menu item- Children-have '). Sister (' menu item-is-children ') Children (' A ') Next (' sub-menu ') SlideUp (100);});  

This is mine.

Here.


set difference - How not to lose copied elements in setdiff in R? -


I am not in another set that use the setdiff function to remove elements of the first set I am doing But after evaluating setdiff , I get such elements, but they are single values ​​(as if the first set was not in it); Like this:

  & gt; Setdiff (c ("x", "x", "y"), c ("y")) [1] "x"  

Is one of the elements to remove such elements The clever way but in an amount that was in the first set of results of this line?

  & gt; % C (% (c ("x", "x", "y"), [c ("x", "x", "y" C ("Y")) [1] "x" "x"  

reverse To simplify the expression, match % in% , and skip setdiff :

  & gt; X & lt; - c ("x", "x", "y") & gt; X [1] "x" "x" "y" & gt; X [! X% in% c ("y")] [1] "x" "x"  

AJAX OPEN in FirefoxDeveloperEdition fails to work like firefox or chrome -


Please state how the APK ID is included and how it can be changed.

I work on Ajax on client in Java, works great on all applications in Javascript, Firefox, Safari, and Chrome, but not on Firefox Developer Edition.

This issue is absolutely on request. Open Statement This does not work on Firefox Developer Edition I get an "error" in the console - it's all, just the colon. As I said, this statement works perfectly on Firefox. Is the latest version of.

The selection of XMLHttpRequest is working only in both Firefox and Firefox Developer Edition.

D


actionscript 3 - SmartFoxServer Basic exitCurrentRoom = false not working -


I'm trying to stay in the current room, but exitCrytrue = false is not working, I I leave it, how do I correct it or what's the problem ?!

I want to put every user in the lobby room to get updates until the game starts.

  var gameRoom = {}; GameRoom.name = Users; GameRoom.password = ""; GameRoom.maxUsers = 4; GameRoom.isGame = True; GameRoom.exitCurrentRoom = Wrong;  

sfs.createRoom (gameRoom);

Thanks

The problem is that exitCurrentRoom is Really exitCorrent It was wasted many hours, I hope it will help anyone.

More information on the last post.


android - Update AppWidget's ListView from Activity -



android - Update AppWidget's ListView from Activity -

i have appwidget listview within it. want update listview after add/remove/update item(s) activity class. have tried these before:

1)

intent intent = new intent(this, mywidgetprovider.class); intent.setaction("android.appwidget.action.appwidget_update"); int[] ids = { r.xml.widget_provider }; intent.putextra(appwidgetmanager.extra_appwidget_ids, ids); sendbroadcast(intent);

2)

appwidgetmanager appwidgetmanager = appwidgetmanager.getinstance(this); componentname thiswidget = new componentname(this, mywidgetprovider.class); int[] appwidgetids = appwidgetmanager.getappwidgetids(thiswidget); appwidgetmanager.notifyappwidgetviewdatachanged(appwidgetids, r.id.list);

3)

int widgetids[] = appwidgetmanager.getinstance(getapplication()).getappwidgetids(new componentname(getapplication(), mywidgetprovider.class)); (int id : widgetids) { appwidgetmanager.getinstance(getapplication()).notifyappwidgetviewdatachanged(id, r.id.list); }

and have no success. work, didn't.

now q is: there way 100% guaranteed update list view within appwidget?

android android-listview android-appwidget

android - Too many views in layout -



android - Too many views in layout -

i developing app in android , have next xml layout:

<?xml version="1.0" encoding="utf-8"?> <scrollview xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" > <linearlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical"> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/august" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10" /> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sun" android:paddingleft="5dip" android:paddingright="0dip"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentyfourth" android:paddingleft="0dip" android:paddingright="2dip" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/ten" android:paddingleft="0dip" android:paddingright="5dip"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/spitfiretournament" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/september" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10"/> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/thirteenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/haywardsheath" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentieth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/thanet" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentyseventh" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/medway" android:textsize="15sp" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/october" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10" /> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fourth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/medway" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eleventh" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/sevenoaks" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/eighteenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/oldcolf" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentyfifth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/three" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/beckenham" android:textsize="15sp" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/november" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10" /> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/first" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/tunbridgewells" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/fifteenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/aylesford" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentysecond" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/ashford" android:textsize="15sp" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/december" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10" /> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sixth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/crowborough" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/thirteenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/maidstone" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twentieth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/thanet" android:textsize="15sp" /> </linearlayout> <textview android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/january" android:textappearance="?android:attr/textappearancelarge" android:paddingtop="@string/size10" /> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/away" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/tenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/medway" android:textsize="15sp" /> </linearlayout> <linearlayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="bold" android:textallcaps="true" android:textsize="15sp" android:text="@string/home" /> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/sat" android:paddingleft="5dip" android:paddingright="0dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/seventeenth" android:paddingleft="0dip" android:paddingright="2dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/twofifteen" android:paddingleft="0dip" android:paddingright="5dip" android:textsize="15sp"/> <textview android:layout_width="wrap_content" android:layout_height="wrap_content" android:textstyle="italic" android:text="@string/sevenoaks" android:textsize="15sp" /> </linearlayout> </linearlayout> </scrollview>

my app appears crashing , i'm thinking perchance downwards number of views have in layout. there can minimise number of views maintain same layout within app?

as see in code, repeating part of design in xml file, suggest create include file instead of repeating xml, help minimise number of views need create base of operations xml file , include need it, here ex:

<?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <!-- header --> <include android:id="@+id/container_header_lyt" android:layout_height="wrap_content" android:layout_width="fill_parent" android:layout_above=... android:layout_toleftof=... layout="@layout/header_logo_lyt" //name of xml layout file want include /> ... </relativelayout>

after that, check code if wrong somewhere else in code

android xml

delphi - how to use a counter when refering to a specific edit box -



delphi - how to use a counter when refering to a specific edit box -

this question has reply here:

how access variable name(string)? 3 answers

here's i'm trying do,

for y:=1 8 begin if edittexty.text = '1' input1[y]:=true else input1[y]:=false;

the problem is, delphi recognizes edity.text whole variable

all want compare 8 editboxes 1's , set array value true/false. i'm trying loop whole process in order avoid writing out edit1.text, edit2.text etc. ideas ?

thanks help.

var lcomponent : tcomponent; begin y:=1 8 begin lcomponent := self.findcomponent('edit' + inttostr(y)); if (not assigned(lcomponent)) or (not (lcomponent tcustomedit)) continue; input1[y] := (lcomponent tcustomedit).text = '1'; end; end;

where self form holds edits.

delphi

html - How do I get my backgroun image to display behind the text in my header using CSS3? -



html - How do I get my backgroun image to display behind the text in my header using CSS3? -

i tried checking ensure image referenced can display in banner nil seems work.

here html:

<header id="header"> <h1> loved place on earth</h1> </header>

my css3:

header {font-family: journalregular; font-size: 250%; text-align: center; color:#b22222; **background-image: url("images/cover.jpg");}**

the image in right folder, , using right extension. tried url without quotes well. help!

first, image path have refered in relation of css path, in code example, image located on image folder , shared same root of css file.

if css locadte example:

rootfolder/css/nameofcssfile.css

and images located in:

rootfoder/images/backgroundfile.jpg

so reference have be:

background-image: url(../images/cover.jpg);

image path or without quotes, prefer without quotes

html css css3

grails - weceem 1.3-SNAPSHOT Provider net.sf.ehcache.hibernate.EhCacheRegionFactory not found -



grails - weceem 1.3-SNAPSHOT Provider net.sf.ehcache.hibernate.EhCacheRegionFactory not found -

i cloned weceem-app, weceem-plugin , weceem-spring-security, build them , i'm not able start app because of:

information: tld skipped. uri: http://www.springframework.org/tags defined loading weceem config file:/library/tomcat/shared/classes/weceem.properties loaded weceem properties: [searchable:[index:[path:/library/tomcat/websites/cms/search-indexes]]] setting searchable index path to: /library/tomcat/websites/cms/search-indexes weceem: initializing ehcache default weceem ehcache.xml plugin resource: class path resource [weceem-default-ehcache.xml] 2014-10-14 12:47:47,177 [localhost-startstop-1] info hibernate3.hibernatepluginsupport - set db generation strategy 'update' datasource default 2014-10-14 12:47:47,287 [localhost-startstop-1] info hibernate4.hibernatepluginsupport - set db generation strategy 'update' datasource default 2014-10-14 12:47:47,287 [localhost-startstop-1] error spring.beanbuilder - warning: cache provider set 'net.sf.ehcache.hibernate.ehcacheregionfactory' in datasource.groovy, class provider cannot found. using grails' default cache part factory: 'org.hibernate.cache.ehcache.ehcacheregionfactory'

even add together dependency weceem-app buildconfig.groovy:

dependencies { .... compile "net.sf.ehcache:ehcache-core:2.4.6" .... }

try update weceem sources github (especially weceem-spring-security): problem hibernate plugin version, changed weceem-spring-security hibernate 3 usage. (i see in log there info hibernate4).

grails groovy weceem

Array of TImage (Delphi Android) -



Array of TImage (Delphi Android) -

procedure tform1.controlclick(sender: tobject); var i: integer; begin := 2 dest.count-1 begin img[i-2].create(form1); img[i-2] begin parent:= panel1; width:= 100; height:= 150; top:= 10; left:= (i-2)*100; end; end; end;

img type array of timage, command tab. want timages show android gallery. gives me error access violation.

this looks classic error in creating object. instead of

obj.create;

you must write:

obj := tsomeclass.create;

in case need first of allocate array:

setlength(img, dest.count-2);

and in loop write:

img[i-2] := timage.create(form1);

to instantiate images.

delphi

python - PostgreSQL query and case sensitivity -



python - PostgreSQL query and case sensitivity -

i want assign case-sensitive alias column names in query, postgresql ignores case in alias , leaves lowercase. know stores in lowercase, want case sensitive alias in query. way working? renaming stuff manually after query execution huge dict sets sounds ridiculous.

update: of import note - i'm using amazon redshift. possible amazon limits it?

example

select superid supertable; ... cursor.execute(query) results = cursor.fetchall() row in results: print row['superid'] // ^ working ------------------------ select superid "superid" supertable; ... cursor.execute(query) results = cursor.fetchall() row in results: print row['superid'] // ^ not working

just try, may localization. seek different table or column names not contains "i". not superid may super.

python sql postgresql psycopg2 amazon-redshift

javascript - how to identify which radio button is selected in icefaces? -



javascript - how to identify which radio button is selected in icefaces? -

i have 3 radio buttons , want determine radio button selected farther processing.i have tried

document.getelementbyid("minselected"); document.getelementbyid("minselected").isselected(); and

document.getelementbyname("min");

but not working.

if using icefaces dont have utilize javascript tweek check box value.

try using ice:selectoneradio component. sample code given below

<ice:selectoneradio layout="pagedirection" partialsubmit="true" value="#{mybean.mybuttonvalue}"> <f:selectitem id="1" itemlabel="val1" itemvalue="val1" /> <f:selectitem id="2" itemlabel="val2" itemvalue="val2" /> <f:selectitem id="3" itemlabel="val3" itemvalue="val3" /> </ice:selectoneradio>

where mybean bean name , mybuttonvalue string variable in bean getter setter

when submit form itemvalue in bean on variable mybuttonvalue

javascript radio-button icefaces-1.8

batch processing - Bat file for hide/unhide -



batch processing - Bat file for hide/unhide -

i made bat file hide , unhide file folders. want enable/disable inheritance it. after hiding files cant access bat file.i want help modify bat file.here code.

@echo off cls :start echo hide. files in folder echo unhide. files in folder set /p choice=type want do? if '%choice%'=='hide' goto hide if '%choice%'=='unhide' goto unhide if not '%choice%'=='hide' if not '%choice%'=='unhide' goto :error :hide attrib /d /s +s +h attrib /d /s -s -h unhide.bat icacls "%cd%" /t /inheritance:r goto :qqq :unhide attrib /d /s -s -h icacls "%cd%" /t /inheritance:e goto :aaa :qqq echo "file hide successful" goto end :aaa echo "file unhide successful" goto end :error echo "please come in right command" goto:start :end pause

try cmd.exe.

attrib -h file.bat

if file.bat executable, hidden, can unhide this.

just replace file.bat batch file need unhide.

-pringles

batch-file batch-processing

swift - What is the proper syntax for accessing a struct variable? -



swift - What is the proper syntax for accessing a struct variable? -

what proper syntax access fellow member struct variable? i'm trying this:

struct 1 { var name:string = "ric" var address:string = "lee" } one.name

but lastly line produces error:

'one.type' not have fellow member named 'name'

how can access variable on struct?

it looks defined struct, didn't create instance of it. if create instance, can access name , address properties.

struct 1 { var name: string = "ric" var address: string = "lee" } var x = one() x.name

it may confusing because can set default values in definition, may create instantiating something.

swift struct

php - Getting JSON data ​​and put them in 3 different arrays -



php - Getting JSON data ​​and put them in 3 different arrays -

i'm working on android eclipse. i'm writing project app receives (also sends) info mysql database. wrote php file create project work. i'm using json communicate php file hosted in local server. don't have problems connection or similar problems receive type of json data:

{"field1":"a","field2":"abcbab","field3":5}, {"field1":"b","field2":"fakfef","field3":25}, {"field1":"a","field2":"faefe","field3":12}, {"field1":"c","field2":"aafefe","field3":30}, {"field1":"c","field2":"caere","field3":30},

etc..

now android app has target create 3 different arrays (one type of field1, 1 b , 1 c) subsequent processing json data. have 2 problems here.

i don't understand how select json value particular value of field. seek explain better, know these instructions:

jsonobject json_data = new jsonobject(result); json_data.getstring("field1");

but how say: "if field1 set value of field2 in arraya1 , field3 in arraya2", "if field1 b set value of field2 in arrayb1 , field3 in arrayb2", "if field1 c set value of field2 in arrayc1 , field3 in arrayc2". maybe i'm making harder looks don't know that. in way have 2 arrays each type of field1, there improve way want?. remember: can't alter code in php file output rows shown above.

php android mysql json

asp.net - Debugging JScript for .Net Framework -



asp.net - Debugging JScript for .Net Framework -

jsc, jscript compiler .net framework, has /debug option.

the suggested debugger, dbgclr.exe, not available anymore. know of available debugger step through jscript code?

just avoid misunderstanding, speaking of microsoft jscript, able access windows api, file system, office etc; not javascript comes browser.

when execute jscript using command line, can cscript , debug option. asked debugger want use, , can attach visual studio it. illustration (in command line, after launching cmd.exe):

cscript.exe "path jscript.js" //x <==(the //x turns on debugger)

after running this, there popup asks debugger want use. can either open new instance of visual studio, or if you're working jscript in visual studio already, can utilize existing instance.

this works visual studio express well.

asp.net .net jscript

excel - Optimizing code to fun faster when removing filters/copy data from row of minimum value of filtered data -



excel - Optimizing code to fun faster when removing filters/copy data from row of minimum value of filtered data -

i have info in columns 1 , 2 of sheet 1 (115 rows). these reference values. have info in columns 3 , 4 in activesheet (10000+). these raw info values.

the code have below find closest raw info value reference value taking difference, finding values between 0 , 15 minutes, finding minumum value , copying other info row on location.

i utilize 2 auto filters in process every reference value, happens 115 times. questions follows:

are adding/remove filters slowing downwards search? should through 10,000 info values rather filtering same day first? when find value of minimum value of filtered list, there improve way re-create on info other columns of same row?

i have added timer @ end of code help quantify. hope can help!!

sub updatedtimematcherwithfilters() 'make code fast possible application.screenupdating = false application.calculation = xlcalculationmanual dim minvalue, minrow integer dim searchrange, rng range dim elapsedtime integer starttime = time set searchrange = range("g1:g1697") 'count reference values totalrefval = worksheets("sheet1").cells(rows.count, 5).end(xlup).row 'count raw info values set rng = range("c2:c1000") 'totalrawdataval = activesheet.cells(rows.count, 3).end(xlup).row 'format columns needed columns("g:g").select selection.numberformat = "[h]:mm:ss;@" columns("i:i").select selection.numberformat = "[$-409]m/d/yy h:mm am/pm;@" columns("h:h").select selection.numberformat = "m/d/yy;@" j = 2 totalrefval 'filter date of reference value activesheet.range("$c:$c").autofilter field:=1, operator:=xlfiltervalues, _ criteria2:=array(2, "10/10/2014") 'find difference in times between reference info , raw data, 'put difference value in same row each d in rng.specialcells(xlcelltypevisible) activesheet.cells(d.row, 7) = worksheets("sheet1").cells(j, 5) - d next d 'turn off filter in column c activesheet.autofiltermode = false 'filter time differences between 0 , 15 minutes activesheet.range("$g:$g").autofilter field:=1, criteria1:=">0:00:00", _ operator:=xland, criteria2:="<0:15:00" 'find minimum value between 0 , 15 minutes minvalue = application.min(searchrange.specialcells(xlcelltypevisible)) 'find row of value of minimum difference minrow = application.match(minvalue, searchrange, 0) 'copy info columns c , d of minimum value's row cells(j, 9).value = cells(minrow, 3) cells(j, 10).value = cells(minrow, 4) activesheet.autofiltermode = false next j stoptime = time elapsedtime = (stoptime - starttime) * 24 * 60 * 60 application.screenupdating = true application.calculation = xlcalculationautomatic msgbox "elapsed time, screen updating on: " & elapsedtime & _ " sec." application.screenupdating = true application.calculation = xlcalculationautomatic end sub

why don't order raw info first (they dates/time right?)? because partition raw info sectors, , given reference value in sector. doesn't take long order set of info column (and secondary sorting on column).

the advantage beingness have 1 time many references you'll utilize on ordered data...

edit create reply more explicit (after comment )

no. don't think need re-organized info much @ all. see excel file:

i'm working on barcodes, order dates or other value. "random" column there can replace info in random orders after i've tested code.

let's i'm sorting barcodes (there's 200 rows in sheet, base of operations principle on many rows have), this. first, need phone call function sorts raw data. can primary sort (i sort column first), in case of equality have 2nd sorting value. can have more that, search sort method:

private sub sorting_all() dim test range set test = range("j" & 200) sheet1.range("a1", sheet1.cells(200, 10)).sort key1:=sheet1.range("a1"), order1:=xlascending, key2:=sheet1.range(columns(8).address()), order2:=xldescending, header:=xlyes, orientation:=xlsortcolumns end sub

then have function finds given value:

function findvalue(myvalue long) range dim numintervales integer, startat long, integer, myintervales variant, cutoff long 'as long not integer don't overflow numintervales = 4 'or whatever, set according data. determine programatically myintervales = getintervales(numintervales) = 1 numintervales - 1 'because if want 4 intervales, means 3 cutoff points cutoff = sheet1.cells(myintervales(i), 1).value if myvalue <= cutoff startat = myintervales(i - 1) 'if myvalue < cutoff #1, want start @ myintervales point between 0-1 exit elseif = numintervales startat = myintervales(numintervales - 1) end if next set findvalue = sheet1.cells.find(what:=myvalue, after:=sheet1.cells((startat + 1), 1), lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbyrows, searchdirection:=xlprevious, matchcase:=false) end function

that functions rely on finding range of data, function:

function findrange(mysheet worksheet, byrow_or_bycol string) range 'just find extend of info if byrow_or_bycol = "byrow" set findrange = mysheet.cells.find(what:="*", after:=mysheet.cells(1, 1), lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbyrows, searchdirection:=xlprevious, matchcase:=false) else set findrange = mysheet.cells.find(what:="*", after:=mysheet.cells(1, 1), lookin:=xlformulas, lookat:= _ xlpart, searchorder:=xlbycolumns, searchdirection:=xlprevious, matchcase:=false) end if end function

and on dividing raw info appropriate intervales, this:

function getintervales(numintervales) variant dim myintervales() integer, integer, myrange range, mystep long set myrange = findrange(sheet1, "byrow") mystep = round(myrange.row / (numintervales)) 'in case, 200 rows & 4 intervales = 50 rows per intervale = 0 (numintervales - 1) 'because array index start @ 1 redim preserve myintervales(i) ' myintervales(i) = mystep * (i) + 1 'because row(0) doesn't exist next getintervales = myintervales end function

finally need sort of main sort coordinate this:

private sub main() phone call sorting_all msgbox ("this result " & findvalue(sheet2.cells(1, 1).value).row) end sub

that's partly based on random test code project i'm on, it's not finished you'll thought (for illustration range sort method hard-coded, want find programatically).

you fancier this, illustration when import info add together info @ end of (already sorted) data, , phone call sorting function on newly added info (so don't sort 10 000 rows if added 900 unsorted rows it).

you determine programatically intervales set, illustration saying want intervales on 1000 or 2000 rows (just determines works best speed/efficiency).

finally, if you're going adding lots of data, mentionned devise scheme 1 time sheet gets 10 000 rows (for example), starts new sheet , works off one... 1 time again if info sorted, can code know sheet1 has info date xxxx date yyyy, etc.

excel vba excel-vba runtime autofilter