Saturday, 15 January 2011

Rails console/pry shows ActiveRecord has_many/belongs_to references in invalid state? -


मेरे पास दो मॉडलों में एक काफी सरल है I_many / belongs_to संबंध:

  class उपयोगकर्ता & lt ; ActiveRecord :: बेस है has_many: प्राधिकरण, आश्रित:: नष्ट ... अंत वर्ग प्राधिकरण & lt; ActiveRecord :: बेस is_to: user ... end  

... सभी अच्छा।

लेकिन जब मेरे पास मौजूदा प्राधिकरण वाले उपयोगकर्ता हैं, और रेल का उपयोग कंसोल (ध्यान दें कि मैं वास्तव में एक pry मणि का उपयोग कर रहा हूं - क्या यह प्राइ-संबंधी हो सकता है?) किसी अन्य प्राधिकरण को कुछ अन्य प्राधिकरणों को फिर से असाइन करने के लिए, जैसे:

<पूर्व> & gt; Some_auth = user_b.authorizations.first & gt; User_a & lt; & lt; Some_auth & gt; Some_auth.user = user_a & gt; Some_auth.save

... तो मुझे स्वामित्व के अजीब विरोधाभासी राज्य मिलते हैं:

  & gt; User_b.authorizations.count = & gt; 0 & gt; User_b.authorizations.first = & gt; # & Lt; प्राधिकरण आईडी: 7, यूज़र_आईडी: 9, ... & gt; & Gt; User_b.authorizations.first.user_id = & gt; 9 & gt; User_a.authorizations.first.user = & gt; # & Lt; उपयोगकर्ता आईडी: 7, ... & gt;  

पूरी तरह से अजीब, सही?

अब, मुझे लगता है कि मुझे दोनों करने की ज़रूरत नहीं है

  & gt; User_a & lt; & lt; Some_auth  

और

  & gt; Some_auth.user = user_a  

... लेकिन मैं उस रिडंडेंसी से इस व्यवहार की अपेक्षा नहीं करूँगा!

क्या कोई मेरी मदद कर सकता है यह समझने में कि क्या गलत हो रहा है? < / P>

ध्यान दें कि जब मैंने रेल को कंसोल छोड़ दिया और इसे फिर से शुरू किया, तो समस्या दूर जा रही है ...

अपने केस को हल करने के लिए आप अपने प्राधिकरण वर्ग के साथ : inverse_of विकल्प का उपयोग करना चाह सकते हैं। यह जैसा_आ: प्रयोक्ता, व्युत्क्रम_ऑफः: प्राधिकरण की तरह दिखेगा - और फिर यह काम करेगा जैसे आप इसे करने की अपेक्षा करते हैं।

आप "सेटिंग व्युत्क्रम" खंड में और अधिक पढ़ सकते हैं।


rest - Determine the number of records in a saleforce table without knowing the table's field names -


I'm using the Salesforce REST API to determine the number of records in each Salesforce table, ideally I The table will be able to do a query like this:

  SELECT COUNT (*) FROM & lt; Variable_table_name & gt; - or - SELECT COUNT () FROM & lt; Variable_table_name & gt;  

Unfortunately, SOQL does not support * select all without any code running COUNT () Either it does not work either.

My last resort is a two step process:

  1. Use the SOBJX field to get the name of the resource
  2. with that field name < Code> COUNT

This means that I would not like to do this for two tablets instead of just one of two network calls.

To use it, COUNT () thanks Salman without any fields The problem for me was that the web response to COUNT (Id) is different from the web response to COUNT () .

WebResponse content

  {"totalize": 1, "done": true, "records": [{"attributes": {"type" : "Aggregate result"}, "exprode": 260}]  

COUNT web content

 {"totalSize ": 260," done ": true," records ": []}  

When using COUNT () , I should Records.expr0 to see property instead of totalSize


Interactive website for linux server -


Creating a website through which Linux server may be used and where some actions can execute scripts such as some Commandments need some expert guidance with some concepts. Let me guide how I can get it, I have gained many inability to achieve the right concepts or methods. Or is it even possible.

Did you experiment with lines like anything else? As JNWil pointed out, any of these methods would be infinitely more secure. Also, consider using things like Cron for scheduled jobs.

However, sometimes a webpage can be acceptable to run programs on a server such as the IOT project to do this, you will install an API page using the back-end language such as PHP ( Recommended if you are using Linux). In the back-end language you will check your user credentials and then run the command.

Some guidelines to do this:

  1. Never allow commands to complete the task by using controlled inputs like webpages, buttons only, selection boxes and sliders That is to say, a button to get an Ardino to close the gallery, or a slider to light a light bulb to a gallery, or to start a program for some index.
  2. None of these "command buttons" should do anything harmful either delete a folder or file.

regex - Perforce commands Regular Expressions -


मेरे पास कमांड एक्जीक्यूशन की लाइनें निम्नानुसार हैं:

  2806 I deep Sd_bordeaux 117: 02: 40 IDLE कोई नहीं 2807 मैं गहरी sd_bordeaux 17:02:40 आईडीले कोई नहीं 2808 मैं गहरी sd_coddeaux 117: 02: 40 IDLE सभी 2809 मैं rahul sd_coddeaux 117: 02: 40 IDLE सभी  
< P> मैंने कमांड को चलाने के लिए कमांड को चलाने के लिए कमांड को चलाने के लिए लिखा है और उसे सरणी @ लाइनों में संग्रहित करने और निर्दिष्ट परिस्थितियों को प्राप्त करने के लिए regex का उपयोग करना है। लेकिन मुझे वांछित परिणाम नहीं मिल रहा है

<पूर्व> मेरी $ command = qx | p4 मॉनिटर शो -अल | | मेरी $ kill_id; मेरे @lines = विभाजन ("\ n", $ आदेश); मेरी $ पंक्ति (@lines) के लिए {अगले अगर नहीं $ लाइन = ~ / (\ d +) \ s + /; मेरी $ आईडी = $ 1; अगर ($ line = ~ / sd_bordeaux \ s + (\ d +): \ d +: \ d + \ s + / और $ पंक्ति = ~ / आईडीएल \ s + none $ /) {my $ hours = $ 1; प्रिंट "$ घंटे"; प्रिंट "\ n"; }

}

मुझे कोई त्रुटि मिल रही है

  आरंभिक मान का उपयोग $ घंटे की स्ट्रिंग में ./p4.pl < / कोड>  

मुझे "2806" और "2807" संख्या $ आईडी के रूप में प्राप्त करने में दिलचस्पी है और पहले अंक "117" & amp; "17" के रूप में $ घंटे।

कृपया कुछ मदद कर सकते हैं जहां मैं गलत हो रहा हूं। धन्यवाद।

$ 1 इसमें सबसे हाल ही में सफल होने वाले पहले कब्जा से मिलान किया गया था Regex match।

जब आप त्रुटि प्राप्त करते हैं, तो सबसे हाल ही में सफल मिलान / IDLE \ s + none $ / के खिलाफ था, जिसमें कोई कैप्चर नहीं है।

निम्नलिखित समतुल्य होगा:

  यदि ($ line = ~ / sd_bordeaux \ s + (\ d +): \ d +: \ d + \ s + /) {my $ hours = $ 1; अगर ($ पंक्ति = ~ / आईडीईई \ s + कोई भी $ /) {प्रिंट "$ घंटे \ n"; }}  

लेकिन ऐसा लगता है कि आपको निम्न की आवश्यकता है:

  यदि ($ line = ~ / sd_bordeaux \ s + (\ d +): \ D +: \ d + \ s + IDLE \ s + कोई भी $ /) {my $ hours = $ 1; प्रिंट "$ घंटे \ n"; }  

यह समस्या बताता है और इसे कैसे हल किया जाए, लेकिन गैरी एक अधिक पढ़ें।


Alternative methods for coverting formulas to values in Excel using VBA -


I first want to make a process to pull data from Bloomberg and want to change all the sources based on their values. So far, I have come up with two approaches 1. Use BDH code to draw data first for the range of cells, and then paste all the data as values ​​after populated. 2. Use the BDH code to drag the data and paste the code as a value immediately before executing the next cell. The following is my code (I use another approach):

j = last - time = 6 for time active =. For kel (j, 1) i = 3, Colonel C ticker = ActiveSheat.Cell (2, I). Value ActiveSite Seals (J, I). Formula = "= BDH (" "" and "" ticker and "", "" last "", "" "" & Amp;; & amp; time and; "", "" and time and " "" Day = a "," "fill = p" ")" application Waiting (Now + Time Vila ("00:00: 03")) ActiveSheet.Cells (j, i) .Value = ActiveSheet.Cells (j, i) .Value Next Next

When I run this code on Bloomberg, paste the chip as T and they are still the code I think 3 seconds in the application. The wait is not enough, but I want to change my whole method and do not want to count how many seconds one price has to be populated. Does anyone have experience with this and can provide a fast way to populate prices from Bloomberg? Although the first approach I mentioned above is also an option, but I like to get the values ​​while popularizing the data. Thanks!

I actually came up with an answer to my problem .. but it still uses onetime There are other ways to make sure that

  for sub pulldata () = Jammu = last - for 6 time = ActiveSheet.Cells (j, 1) for i = 3 Lastcol 'starts with the Colonel C ticker = ActiveSheet.Cells (2, i) .Value ActiveSheet.Cells (j, i). Formula = "= BDH (" "" & "", "" Last_Price "", "" "and time and" "" "" and time and "", "" day = one "," P "") "Start a new sub time to eliminate the last macro all pestespicious () from time to time + timevilla (" 00: 00:03 ")," pastestyle "next next end sub. Intecol finalcol = ActiveSheet.Cells (1, ActiveSheet.Columns.Count) .end (xlToLeft) .color set myrange = category (ActiveSheet.Cells (final - 6, 3), ActiveSheet.Cells (last, lastcol)). My Category Values ​​= Diamonds Value End Sub  

html - max-width css property stops centered div from working in internet explorer? -


I have a navbar div inside a parent that is horizontally centered / re-shaped using the following CSS Giving:

 . Navbar- Basic-Cover {width: 100%; Margin: 0 auto; } .navbar-child-wrapper {Status: Completed; Correct: 0; Left: 0; Margins: Auto; Max-width: 1200px; Cushion Top: 10px; }  

Although the maximum-width property being centered in Internet Explorer appears to stop my navbar and floats it on the left (works on all other browsers). If I change the max-width to width, it works, but stops automatically resizing to be responsive.

Is there any work for this?

try it

  .navbar-child-wrapper {status: Relative; Margin: 0 auto; Max-width: 1200px; Cushion Top: 10px; }  

powershell - Handle output that can either be an array or a single string -


I have a script that receives data from the web service in XML format. Some elements can be there - or not - and it may contain one or more sub elements, so I get the value with it:

$ uid = $ changeRecord.newAttrs | Where {$ _. Name-EC 'UID'} | Choose - Expand Property Value | Selection Index 0

This works fine in most of the answer There is only one sub element in the part and even if not, then I am only interested in the first one, however, the last part | Select -index 0 generates silent warnings in the Windows Event Log (see also) if & lt; Values ​​& gt; Within there is only one element so I would like to get rid of the error.

That's why I'm looking for errors to get the same behavior without any errors - and possibly not just try- hold around.

Thank you!

// Update: As mentioned below, so far the answers do not solve the problem. So far the closest is

  ([array] ($ changeRecord.newAttrs | where {$ _ .name-eq 'uid'} | Select- ExpandPrafficity Value)) [0]  

This fails with any errors if there is no element in the array. With any thought it can be controlled even within a line?

Have you tried this: choose-object-first 1 ?

  $ uid = $ changeRecord.newAttrs | Where-object {$ _. Name-EC 'UID'} | Selection-object-ExpandProfility Value | Choose-Object-First 1  

linux - Quoting with ssh command with a function call -


मुझे शेल कमांड को इस प्रकार निष्पादित करने की आवश्यकता है:

  ssh & lt; device & gt; "कमांड"  

कमांड को इस प्रकार लागू किया जाता है:

  $ (typeset); & LT; function_name & gt; \ "Arguement_string \"; सीडी ...; Ls ...  

यहां उद्धृत करने के लिए बिल्कुल कैसे? क्या यह सही है?

  "" $ (टाइपसेट); & LT; function_name & gt; \ "Arguement_string \" "cd ...; ls ..."  

मैं खोल लिपियों में इस उद्धरण के साथ भ्रमित हूँ।

<

  कमांड_अरे == 
(Function_name "प्रथम तर्क" "दूसरा तर्क") printf -v कमांड_स्ट्रित '% q' "$ {command_array [@]}" ssh_str = "$ (typeset); $ command_str" एसएसएच मशीन "$ ssh_str" < / Pre>

आप चाहते हैं कि आप command_array को बना सकते हैं - सशर्त रूप से जोड़ों के लिए तर्क का प्रयोग करके, केवल उन उद्धरणों का उद्धरण जिसे आप आमतौर पर उन मानों के लिए उपयोग करते हैं, और दें printf% q ssh के माध्यम से पास करने के लिए सामग्री को सुरक्षित बनाने के लिए आवश्यक सभी अतिरिक्त उद्धरण जोड़ें।


यदि आप एक स्क्रिप्ट को बढ़ते हुए बनाने की कोशिश कर रहे हैं, तो आप कि ऐसा है:

  remote_script = "$ (typeset)" $ '\ n' safe_append_command () {स्थानीय command_str printf -v command_str '% q' "$ @" दूरस्थ_क्रिप्ट = "$ command_str "$ '\ n' } Safe_append_command cp "$ file" "$ destination" safe_append_command tar -cf /tmp/foo.tar "$ {destination% / *}" # ... etc ... एसएसएच मशीन "$ remote_script"   

ध्यान दें कि इस मामले में, सभी विस्तारों को स्थानीय स्तर पर लेते हैं, जब स्क्रिप्ट उत्पन्न होती है, और शेल निर्माण जैसे कि रीडायरेक्शन ऑपरेटरों का उपयोग नहीं किया जा सकता (उन्हें किसी फ़ंक्शन में एम्बेड करके फिर दूरस्थ सिस्टम को typeset के साथ पास करें)। ऐसा करने का अर्थ है कि safe_append_command को कोई भी डेटा पारित नहीं किया जा सकता - कोड के रूप में माना जा सकता है - लचीलेपन की लागत पर संभावित सुरक्षा छेदों के बड़े वर्गों को रोकना।


xml - How to display the image in the correct format -


मेरे पास follwing XSLT कोड है:

  & lt; xsl: template match = "data [@ कुंजी = 'चित्र'] "& gt; & Lt; xsl: मान का चयन करें = "substring- के बाद (तस्वीर, '।')" / & Gt; & Lt; xsl: मान का चयन करें = "substring-before (चित्र, '।')" / & Gt; & Lt; / XSL: टेम्पलेट & gt;  

और साथ ही:

  & lt; डेटा कुंजी = "तस्वीर" मान = "द- parlotones.jpg" / & gt;  

मुझे निम्नलिखित XML आउटपुट होना है:

  & lt; photo format = "jpg" & gt; पास्कल-पियर्स & lt; / photo & gt;  

वांछित आउटपुट प्राप्त करने के लिए मुझे क्या जोड़ना चाहिए?

मान लें कि वांछित आउटपुट & lt; photo format = "jpg" & gt; -पारकोल-पियर्स एंड लेफ्टिनेंट / फोटो & gt; , प्रश्न के इनपुट के लिए और & lt; photo format = "jpg" & gt; के लिए -पीरकलोटोन & lt; / photo & gt; :

  & lt; xsl: टेम्पलेट मैच = "डेटा [@ कुंजी = 'चित्र']" & gt; & Lt; फोटो प्रारूप = "{substring-after (@value, '।')}" & Gt; & Lt; xsl: मान का चयन करें = "substring- पहले (@value, '।')" / & Gt; & Lt; / फोटो & gt; & Lt; / XSL: टेम्पलेट & gt;  

अपने इनपुट & lt; डेटा कुंजी = "तस्वीर" मान = "the-parlotones.jpg" /> the-parlotones.jpg < / Code> विशेषता मान का मान है, इसलिए और & Gt; चित्र के रूप में काम नहीं करेगा < डेटा की विशेषता डेटा का मान है।

< / html>

vb.net - media player cannot play next song in listbox -


 <कोड> यदि AxWindowsMediaPlayer1.playState = WMPLib.WMPPlayState.wmppsMediaEnded फिर ListBox1.SelectedIndex + = 1 AxWindowsMediaPlayer1.URL = ListBox1। SelectedItem AxWindowsMediaPlayer1.Ctlcontrols.play () अंत यदि  

यह सूचीबॉक्स का सूचकांक बदलता है, लेकिन यह अगली फ़ाइल नहीं चलाता है। फ़ाइल मौजूद है और इसमें सामान्य तरीके से खेलने में कोई समस्या नहीं है। क्या किसी को पता है कि गलत क्या है?

टाइमर जोड़ने के लिए समाधान होना चाहिए "

 < कोड> निजी उप Timer1_Tick (ByVal इस वस्तु के रूप में, ByVal ई EventArgs के रूप में) Timer1.Tick मंद आइटम हैंडल पूर्णांक आइटम के रूप में = ListBox1.SelectedIndex तो Form1.AxWindowsMediaPlayer1.playState = WMPPlayState.wmppsStopped फिर Me.ListBox1.SelectedIndex = आइटम +1 Form1 .AxWindowsMediaPlayer1.URL = FileUrls (ListBox1.SelectedIndex) Timer1.Start () वरना Timer1.Start () अंत अगर अंत उप  

भी निम्न कोड काम करते हैं। पहले टाइमर जोड़ने प्लेलिस्ट और करने के लिए अतीत कोड निम्नलिखित

निजी उप Timer1_Tick (ByVal इस System.Object के रूप में, ByVal ई System.EventArgs के रूप में) हैंडल Timer1.Tick

  यदि Form1.AxWindowsMediaPlayer1.playState = WMPPlayState। तब wmppsStopped तो ListBox1.SelectedIndex & LT; ListBox1.Items.Count - 1 तब ListBox1.SelectedIndex = ListBox1.SelectedIndex +1 प्रपत्र 1.एक्सविंडोवाइंडैपेलियर 1.उरल = लिस्टबॉक्स 1.सेक्टेडइंडएक्सअसे 'कुछ भी नहीं करें अगर कोई आइटम खेलने के लिए समाप्त नहीं होता तो एंड एंड एंड कम  

angularjs - How to use angular $compile with d3.js to manipulate SVG string? -


I have a bunch of icons stored in the form of strings. I am working on an instruction to add these basic markings to the dome - with some options for manipulation - adding the size of a framework, adding filling and adding stroke etc. My instructions look at the properties of the $ element, accordingly updates the scope. I am using ng-bind-html inside the template to render the symbol. I am quite new to Kangaroo, and this is the most complex problem that I have solved so far. I am using compilation like this:

  $ compile (icon) (scope, function (e, s) {var svg = d3.select (e) .append ("circle" ). Attr ("r", "20") ... ...} [0] .autter HTML)  

Am I on the right track?


php - Adding row table for each ID in mysql? -


I am trying to create a website to create a radio, and I want to create a page that includes radio Playlist will be included. I made a table with rows and columns (song name | DJ) and here is the code:

   

I want to create a MySQL table that includes songs and names of their DJ. I want to make it so much, add a new line for each id (song name | DJ) Is given, something like this:

  song name. DJ Song 1 | DJ 1 song 2 | DJ 2 song 3 Thank you in advance 

assuming that You need to loop the records in the result set given by the query to create a data row already in your database table.

Example see here


javascript - How do you add and save a POST variable to Qualtrics? -


I have some web-based software that interacts with a user (PHP, HTML, built in javascript) . The software records the interaction of the user (for example, the web session), and after completing a task to the users, I would like to complete a survey of them, to codify survey in PHP or Javascript (which can be small) Instead, I want to use Quatttrix. I want to link my survey output to UIIDID with their interaction data, which defines in my software, but it is not clear how on how. I want to take the following approach:

  1. Submit a form in a qualifying survey with a User ID POST variable.
  2. Save this POST variable as output in the Cultatrix.

Is there any way to do this, and if so, how? If there is another way to link Quatttronics Survey data without using post variables, then I am open for it (unless it is GET).

Quatttrix does not accept 'post', so you have to use 'get'. After that you can pass the User ID as a field. In the flow of the survey, define the User ID as an embedded data variable and do not assign a value to it ... This will specify the value from your form. Embedded data variables are saved in your feedback data.

  & lt; Form action = "https://survey.qualtrics.com/SE/" method = "get" & gt; & Lt; Input type = "hidden" name = "SID" value = "SV_abc123DEF456" /> & Lt; Input type = "hidden" name = "userID" value = "userID_value" /> & Lt; Input type = "submit" value = "take survey" /> & Lt; / Form & gt;  

What's the problem with 'mill'? Do not you want the user to see your ID in the address bar URL? If this is the case, you can encrypt it, then call QualTrint to un-encrypt a web service.


Chrome Addressbar invisible -


Recently I came to know that after the size of my Chrome browser during testing with the supervisor open, my address / URL The bar becomes unrecoverable. Although URL bar autofocus since opening a new tab I can usually enter the URL, but the bar can still be invisible. Do anyone know why is this or how is this feature / bug disabled?

Has anyone seen anyone before, or is it just me? chrome bug

Appreciate the help, thx


asp.net - How can I redirect users to different pages based on session data in asp -


  संरक्षित शून्य btnLogin_Click (ऑब्जेक्ट प्रेषक, EventArgs ई) {सदस्य ई = नए सदस्य (); ई = ई। लॉगिन (txtEmail.Text, txtPassword.Text); सत्र ["उपयोगकर्ता"] = ई; यदि (सत्र ["उपयोगकर्ता"] = नल) {ई = (सदस्य) सत्र ["उपयोगकर्ता"]; अगर (ई। यूज़र टाइप == "डॉक्टर") {Response.Redirect ("Donate.aspx"); } और अगर (ई। यूज़र टाइप == "व्यवस्थापक") {Response.Redirect ("admin.aspx"); } Else {Response.Redirect ("user.aspx"); }} और {lblMessage.ForeColor = System.Drawing.Color.Red; LblMessage.Text = "अमान्य ईमेल / पासवर्ड"; }}}  

यह लॉगिन है

  सार्वजनिक सदस्य लॉगिन (स्ट्रिंग ईमेल, स्ट्रिंग पासवर्ड) {string constr = "डेटा स्रोत = याज़न-पीसी; प्रारंभिक सूची = वृद्ध; उपयोगकर्ता = सा; pwd = yazan7; "; SqlConnection conn = नया SqlConnection (constr); SqlDataAdapter da = नया SqlDataAdapter ("प्रमाणीकरण", conn); Da.SelectCommand.CommandType = System.Data.CommandType.StoredProcedure; Da.SelectCommand.Parameters.AddWithValue ("@ ईमेल", ईमेल); Da.SelectCommand.Parameters.AddWithValue ("@ पासवर्ड", पासवर्ड); डेटाटाईबल डीटी = नया डाटाटेबल (); conn.Open (); da.Fill (डीटी); conn.Close (); यदि (dt.Rows.Count & gt; 0) नए सदस्य आईडी = int.Parse (dt.Rows [0] ["ID"]। ToString ()), FName = dt.Rows [0] ["FName"] वापस लौटाएं टॉस्ट्रिंग (), एलएननाम = डीटी। आरओ [0] ["एलएननाम"]। टूस्ट्रिंग (), ईमेल = डीटी। आरओ [0] ["ईमेल"]। टूस्ट्रिंग (), लिंग = डीटी। आरओ [0] [ "लिंग"]। ToString (), पासवर्ड = dt.Rows [0] ["पासवर्ड"]। ToString (), RePassword = dt.rows [0] ["RePassword"]। ToString (), यूज़रटाइप = dt.rows [0] ["यूज़रटाइप"]। ToString (), जन्मदिन = डीटी। आरओ [0] ["जन्मदिन"]। ToString (),  

यह वर्ग है

मेरे पास 3 उपयोगकर्ता हैं डॉक्टर एडमिनेट फ़ैमिली की आवश्यकता है जब उपयोगकर्ता लॉगिन होता है तो वह एक डॉक्टर पेज पर पुनः निर्देशित करता है (डॉक्टर। एस्पएक्स) और अगर वह एक पेज पर व्यवस्थापक रीडायरेक्ट (admin.aspx) होता है तो सत्र का उपयोग कैसे करें? ???

एक लॉगिन वर्ग को परिभाषित करें ..

  वर्ग dcLogin {सार्वजनिक आईडी स्ट्रिंग {get; set;} सार्वजनिक नाम स्ट्रिंग {get; set;} सार्वजनिक प्रकार स्ट्रिंग {get; set;} }  

जब उपयोगकर्ता को तब लॉग इन करना होता है .. सेट

  dcLogin objLog = new dcLogin (); objLog.id = userid; objLog.name = उपयोगकर्ता नाम; ObjLog.type = 'usertype' - व्यवस्थापक / चिकित्सक / उपयोगकर्ता सत्र ["लॉगिन"] = objLog;  

अब आप किसी भी समय उपयोगकर्ता के प्रकार की जांच कर सकते हैं।

  dcLogin objLog = (dcLogin) सत्र ["लॉगिन"];; अगर (objLog.type == "व्यवस्थापक") {response.redirect ("admin.aspx"); }  

संपादन 2: लॉगिन के बाद एक सामान्य होम पेज बनाएँ।

  logininhome.aspx सुरक्षित पृष्ठ_लॉड () {if (session ["user"]! = नल) {सदस्य ई = (सदस्य) सत्र ["उपयोगकर्ता"]; यदि (ई। यूज़र टाइप == "डॉक्टर") {response.rediter ("doctor.aspx"); } और अगर (ई। यूज़र टाइप == "व्यवस्थापक") {response.rediter ("admin.aspx"); } और {response.rediter ("user.aspx"); }}}  
पर क्लिक करें

sass - Updating variables created by lighten/darken functions by modifying the original base color afterwards -


I currently create a mix in that I use to create buttons with deep hover values ​​and color I am trying to lighten my work for some reason in Sass, instead of the hex value of the returned color, spots white and black for the background color. Here this code is on the pen:

  $ btn_color: #fff; $ Btn_lfa: 1; $ Btn_color_amount: 100%; $ Color_funcs: ('black tax': $ btn_color, $ btn_color_amount black (), 'light': light ($ btn_color, $ btn_color_amount), 'transparentize': transparentize ($ btn_color, $ btn_alpha)); _btn_color ($ base_color, $ amount, $ hover) {background @mixin: $ base_color; A: Hover, A: Focus {@each $ FUNC_NAME, $ color_func $ color_funcs {@if ($ FUNC_NAME == $ Hover) {$ btn_color: $ base_color; $ Btn_color_amount: $ amount; Background color: $ color_func; }}}} .btn {display: inline-block; Vertical-alignment: bottom; Text align: center; Range radius: 10px; Text-decoration: None; } {.btn_blue @include _btn_color (# 3c3c3c, 10%, 'black tax'); }  

Once you exit this block of code, the expression Now does not exist, only the price he does to evaluate:

  $ color_funcs: ('black tax': black tax ($ btn_color, $ btn_color_amount), 'light': $ Btn_color, $ btn_color_amount lighter (), 'transparent': transparent ($ btn_color, $ btn_alpha));  

After this point there is nothing to change to $ btn_color Saasya can not go back in time and repeat those expressions because they are original colors (black ) Have already been evaluated using

What can you do call function.

  @mixin _btn_color ($ base_color, $ amount, $ func) {background: $ base_color; One: hover, focus (background color: call ($ func, $ base_color, $ amount);}} .btn_blue {@include _btn_color (blue, 10%, 'dark'); white color;}  

LinkedIn Job Search API - Python -


Error 403 Client Error: Forbidden: Unknown Error

I try to run the following code to remove I am not able to generate / remove data from linkdin's API, for some reason, I search for job search and people. Although the code company throws data / results for the search, can you please help .... my code below

  CONSUMER_KEY = '77m7cr0kctqdq213rlr' CONSUMER_SECRET = '6lFnGu5oihmrdZir' USER_TOKEN = '01e3d4bfaddc62f-4822-904-3b9d4ccca355' USER_SECRET = '30dae38d-9f77- 7a45-a493-70c742cd3f36' RETURN_URL = '' oauthlib import Imported from imported linkedin * Imported JSSN Certification = Linked. Linked DeveloperActification (ConsumerQue, ConsumerAmmyArtT, USER_TOKEN, USER_SECRET, RETURN_URL, LinkedIn.PMSSS.values ​​()) App = LinkedIn LinkedInApplication (Authentication) Q ंट "*" * 120 company = application.search_company (selectors = [{Companies': ['name', 'universal-name', 'website-url']}], parameters = {'keyword': 'dragon' }) Print json.dumps (company, inde nt = 3) #profiles = application.search_profile (selectors = [{'people': ['first name', 'last name']}], parameters = {'keyword': 'Apple microsoft'}) # print Json.dumps (profile, indent = 3) # # jobs = app.Search_ when (selector = [{'Jobs': [' id ',' customer-job-code ',' posting- Date ']}], params = {' title ':' dragon ',' count ': 2}) # Print [Div> 


jquery - How to show pager only if there is more than one page in free jqgrid -


नि: शुल्क jqgrid शीर्ष-स्तरीय टूलबार के साथ प्रयोग किया जाता है:

  $ .extend (सत्य, $ .jgrid.defaults, {MTYPE: 'पोस्ट', iconset: "FontAwesome", navOptions: {स्थिति: "केन्द्र"}, autoresizing: {कॉम्पैक्ट: सच है, widthOfVisiblePartOfSortIcon: 13}, toppager: सच है, viewrecords: झूठे, rowList : [50, 500, 1000], पंक्ति नोम: 50, ...  

बटन और पेजर इन-ब्लॉक तत्वों के रूप में प्रदान किए गए उपकरण पट्टी के बाईं ओर स्थित हैं। शीर्ष स्तर उपकरण पट्टी का हिस्सा

में जवाब से कोड का उपयोग कर
  $ ( "# grid_toppager") .find ( "। ui-PG-बटन") .प्रत्येक (समारोह (i) {$ निकाल दिया जाता है (यह) .attr ({tabindex: स्ट्रिंग (i) भूमिका: "बटन"});।।}); $ ( "# grid_toppager_left") को छिपाने (); $ ( "# grid_toppager_right") को छिपाने (); $ ("#grid_toppager_center") एट्र ("कॉलस्पैन", "2") ; $ ("# Grid_toppager_center")। सीएसएस ({width: "", "text-align": "left", "white-space": ""}}); $ ( "# Grid_toppager_center") ( "& gt; .navtable") लगता है।। संलग्न ($ ( "# grid_toppager_center") (पाते हैं। "& Gt; table.ui-PG-तालिका")); $ ("# Grid_toppager_center")। ("& Gt; .navtable & gt; table.ui-pg-table") खोजें। Css ({display: "inline-block"}); $ Grid.bind ( "jqGridAfterGridComplete", समारोह () {var पी = $ (this) .jqGrid ( "getGridParam"), $ toppager = $ (p.toppager); "। Navtable"। $ Toppager.find () सीएसएस ("चौड़ाई", "");     });  

एक ही कोड का प्रयोग तालिकाओं को संपादित करने के लिए किया जाता है, जिनमें विभिन्न पंक्तियों की संख्या होती है। शीर्ष स्तर टूलबार में jqgrid पेजर तभी अधिक है कि एक पृष्ठ है दिखाने के लिए कैसे (50 से अधिक पंक्तियाँ)?

कई तालिकाओं कुछ पंक्तियां हो सकती हैं और पेजर दिखा nessecary नहीं है।

यदि नई पंक्तियाँ जोड़ दी जाती हैं तो स्वचालित रूप से या वैकल्पिक रूप से दिखाई देनी चाहिए, उपयोगकर्ता पेजर को प्रकट होने के लिए मजबूर करने के लिए पृष्ठ को रीफ्रेश कर सकता है।

अपडेट

गति पुनर्प्राप्ति

के अनुसार उपयोग किया जाता है केवल पेजेज़ + 1 पंक्तियों को वापस किया जाता है JSON परिणाम ASP.NET MVC4 में अभिलेख मान के बिना बनाया जाता है:

  वापसी नया {total = rowList.Count () & lt; पंक्तियां? पेज: पेज + 1, पेज, पंक्तियाँ = पंक्ति लिस्ट};  

p.reccount और p.records हमेशा समान मान हैं और इस प्रकार पेजर प्रदर्शित नहीं होता है। इस मामले में सशर्त रूप से पेजर को कैसे दिखाना है? शायद पृष्ठ आकार के साथ पृष्ठ में रिकॉर्ड की तुलना करना चाहिए?

यदि मैं सही ढंग से इस समस्या को समझता हूं तो आप < / P>

  loadComplete: फ़ंक्शन () {var p = $ (this) .jqGrid ("getGridParam"), $ topPagerButtons = $ (p.toppager + " _center ") लगता है (।" & gt; .navtable & gt; table.ui-PG-तालिका "); $ TopPagerButtons [p.reccount & lt; P.records? "छुपा हुआ देखना"](); }  

देखें। आप डेमो में पृष्ठ पर 20 या अधिक पंक्तियां प्रदर्शित करने का विकल्प चुन सकते हैं और पेजर के साथ बटन छिपाएंगे।


ruby - Compare two consecutive elements in an array -


I want to create a "bubble sort" method, which means that I take two elements in an array consistently, their Compare and if the left element is more than the right element, then they should change the situation. Unless my array is sorted in ascending order, I want to repeat it.

My code works only partly if my array is too big then nothing will happen (I have to leave Ruby with CTRL + C) with my array my code works fine with 5 elements Is:

  def bubbles (array) while array.each_cons (2) .any? {| A, B (A & lt; = & gt; b) & gt; = "}" If there are two consecutive elements where the first one is # bigger than the other. I know that the error should be in any way. Do Array.each_with_index.map | Number, index | If array [index + 1]. Nil? Number break elithief number & gt; Array [index + 1] array [index], array [index + 1] = array [index + 1], array [index] # swap position! If I call my method with an array of 4 elements, then it works fine:  
  Bubbles ([1, 5, 8, 3]) # => [1, 3, 5, 8]  

If I say it with a large array, it does not work:

  Bubbles ([5 , 12, 2, 512, 99, 1, 2, 323, 2, 12]) # = & gt; nothing happen. I have to rub Ruby with ctrl + c  

Have I somehow made an infinite loop with the statement of my time?

"post-text" itemprop = "text">

The problem is in your stop condition unless you have an array, as far as each element is less is less than the next but in your long array you have duplicated the elements, so the sorted elements will have adjacent elements which are identical of each other.

If your code is not very fancy then your life is easy :)

  while array.each_cons (2) .What? {| A, B One & gt; B}  

keyboard shortcuts - Sublime Text - command to make first character uppercase -


वहाँ upper_case और lower_case आदेश हैं:

< ("Ctrl + k", "ctrl + u"], "कमांड": "ऊपरी सीज़"}, {"कुंजियाँ": ["" Ctrl + k "," ctrl + l "]," command ":" lower_case "},

मैं स्ट्रिंग के पहले अक्षर को कैपिटल करने के लिए कमांड की खोज कर रहा हूं, जिसे सौंपा जा सकता है कस्टम शॉर्टकट के लिए।

के अंतर्गत संपादित करें - & gt; कन्वर्ट केस है शीर्षक केस विकल्प। निम्न कुंजी बाध्यकारी कार्य करना चाहिए:

  {"कुंजियां": ["ctrl + k", "ctrl + t"], "कमांड": इसे अपने कस्टम कुंजीपैकेज में जोड़ें, और यह  Ctrl   के ,  के लिए डिफ़ॉल्ट कमांड को ओवरराइड कर देगा।   Ctrl   टी  -  fold_tag_attributes । वैकल्पिक रूप से, आप 

  {"चाबियाँ": ["ctrl + k", "ctrl + i"], "कमांड" का उपयोग कर सकते हैं: "title_case "}  

जो कि डिफ़ॉल्ट शुभकामनात्मक मेमॅप में कुछ भी नहीं सौंपा गया है।

यदि आप अन्य प्रकार के रूपांतरणों में दिलचस्पी रखते हैं, तो पैकेज नियंत्रण पर प्लग इन देखें । यह snake_case , camelcase , पास्कल सीज़ , dot.case , और dash-case < / कोड>, कुछ अन्य उपयोगिताओं के साथ, जैसे स्लैश के साथ शब्दों को अलग करने के लिए फ़ंक्शन।


angularjs - SharePoint/Angular can't delete item - Error 412 -


Update: I changed my services and controller as follows and now I received an error 412 (HTTP / 1.1 412 precondition failed) Here is my updated code:

service:

  appServices.factory ('appType', ['$ resource', function ($ resource) {return $ resource ("/ '_' / / web / lists / Getbaititl ( 'Todo of the list ") / item (: ID)", {id: "IID"}, {' query ': {method: "GET", isArray: false, headers: {' accept Do ':' Application / Jason; odata = nometadata '}},' update ': {vs Respect: accepted 'patch', header: { ':' application / Jason; Odata = Notadeta '}},' save ': {' acceptable '' application / Jason; Odata = Notadeta ',' Content-type: Val ()}}, 'Delete': {method: 'DELETE', Header: {'Accept': 'Application / Jason; Odata = Namedateeta', 'X-RequestDigestest': $ ("#__ REQUESTDIGEST"). App / jason; odata = nmtadata ',' content-type ':' app / jason; odata = nometadata ',' x-requestdigest ': $ ("#__ REQUESTDIGEST"). Val ()},' IF-MATCH ' : "*"},});}]);  

Controller's Relevant Part:

  $ scope.removeType = function (type) {appType.delete ({id: type.Id}); Console.log ("Deleted" + type.ID); }}]]);  Original post:   

I am trying to delete an item / row in the Coerie app created at the top of SharePoint 2013 , But when I try to delete it, which appears to be the process, nothing is removed from the SharePoint list, using the Network tab in IE, I get 400 error < P> Here's my controller:

  Device drivers. [ "$ Radius ',' app type, Retrieve function ($ scope, app type) {// thus $ scope.types = []; Aptaipkkyuri ({}, function (data) {$ scope.types = Data.value;}); // Type of type var typeInterview = new app type; $ scope.addType = function {Console.log ("clicked"); typeEntry.Title = $ scope.itemtype; typeEntry. $ Save ();} // Delete types $ scope.removeType = function (type) {appTypes.delete ({}, {id: type.ID}); console.log ("deleted" + type.ID);} }]));  

Here's my HTML:

  & lt; Table class = "table table-stripe" & gt; & Lt; TR & gt; & Lt; Th & gt; & Lt; / Th & gt; & Lt; Th & gt; Action & lt; / Th & gt; & Lt; / TR & gt; & Lt; Tr ng-repeat = "type type" id = "type {{type.Id}}" & gt; & Lt; TD & gt; {{Type.Title}} & lt; / Td> & Lt; TD & gt; & Lt; Button type = "button" class = "btn btn-threat" data-ng-click = "delete type (type)" & gt; Remove & lt; / Button & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;  

This is my service:

  App Services. Fasitr ( 'app types, [ "$ resource', function (resource) (return $ resource)" / _api / web / lists / getbytitle ( 'Todo of the list ") / item", {id: "@ ID" }, {'Query': {method: "GET", isArray: false, header: {'accept': 'application / json; odata = nometadata'}}, 'update': {method: 'patch', header : {'Accept': 'application / json; odata = nometadata'}}, 'save': {method: '' '' '' 'Approval': 'Application / Jason; odata = nometadata', 'Content type "delete" application / Jason; odata = nometadata ',' X-Anuroddigenst ": $ (" #__ requested ") .val ()}}, '': {method: Delete 'headers: {' Accept ':' Ape 'ICT-MATCH': ('#__ Requestor'). Val (), 'I-MATCH': 'Application / Jason; Odata = Nmamadata', 'X-Request Didest': $ ("#__ Requestor"). '*'}}}}}}}}]); Here is some sample JSON:  
  {"value": [{"file system object type": 0, "id": 5, "id" : 5, "ContentTipID": "0x01004CE051F4BDBACB43BB22C234F8F497FE", "Title": "Type 1", "Modified": "2015-03-13T18: 35: 09Z", "Manufactured": "2015-03-13T18: 35: 09Z "," Id "", "author id": 12, "editor id": 12, "odeta_uversian string": "1.0", "attachment": wrong, "GUID": "9ceee022-a418-43d4-86b1-1de6d68edc47"}]}   "post-text" itemprop = "text"> 

I am using the following headings when extracting an item from the list.

  "acceptable": "application / Jason; Odata = verbose", "content-type" "application / Jason; Odata = verbose", "X-Anuroddigenst": $ ( "# __ The requester "). Val (), "If-match": "*", "X-HTP-Mathard": "Delete"  

This works for me Hope it's helpful too is.


ipc - Which type of connection do I make for Shared Memory in ZeroMQ? -


I have one application that receives value from the sensor and has a very high rate. Just want to create the Python code to get the latest value, when the Python code requests.

I was thinking about using shared memory for this purpose, but I do not see any example in the ZeroMQ website.

I'm new to ZeroMQ. I do not know whether this is also possible.

Are you essentially using ZMQ as a vehicle for two different processes Store and recover between shared memory space? If so, then you are digging in details which are not available for you in ZMQ. Generally, in your situation you will use the "IPC" connection protocol, and JMM decides to store, send and retrieve that message on your system.

I have not seen in the following how it can choose the option to do this in any scenario, I do not expect it to use shared memory, but somehow, I am not aware of any way of implementing ZMQ to behave.


.net - Remove hyperlink from all the excel cells in a xls (MS-Interop) document using c# -


Do anyone know how to efficiently remove all hyperlinks in Excel documents using C #? I'm using MS-Interop to deal with Excel documents. Thanks !!

Call the ClearHyperlinks () method to the specified limit Home tab In the editing section of the clear drop-down list, it is equivalent to using the hyperlink command, only the hyperlinks will be removed; All other cell contents, such as text and formatting, remain unaffected.


batch file - How do I find the name of the fields for an Install? -


I am trying to create an INSTALL.CMD file for some programs. I am unsure of how the respective field

Say for example, I am setting up Microsoft Office and it asks for a domain name, serial number, company name etc. How do I label those fields for a CMD file?

Is there a file or document that tells you labels for these areas?

For office products, there is no better way to customize batch script to install. Launch setup.exe from the command line with / admin ("setup.exe / admin") to launch Office customization tool . This is a GUI to make the changes you want, including licensing information, company name etc. this one. Save as MSP, which you have inserted in the installer's update folder (or creating a folder). After this you can create a new application in SCCM (better than package) and use the Setup.exe / adminfile "updates \ Custom.msp"

can do.

r - validating poisson GAM models with caret -


I use a 'carat' package in R to run a cross-verification for a normalized additive model (GAM) I am trying. I can get it to work for GLM, and it seems that it should be simple to run the same thing, but it can not be found to work, see below:

  dat < - Data.frame (label = round (RPIIS (10020), v1 = rnorm (100), v2 = rnorm (100)) tc & lt; - trainControl ("cv", 10, savePred = T) (Fit & lt; - train (label ~., Data = data, method = "glm", trControl = tc, family = poisson (link = "log")) ) (Fit 1 & lt; - Train (label ~., Data = date, method = "gam", trControl = tc, family = poisson (link = "log"))  

The important warning that was thrown during running the last line is:

  20: in eval (expr, envir, enclos): failed to fit the model fit fold10: Select = FALSE, method = GCV.Cp error mgcv ::: gam (modForm, data = dat, family = dist, choose = choose the ultimate $, formal argument "family" matching with many real arguments It seems that someday the family's logic is not being sent to gam () in the same way that it is in Glam () to search the web. After that I have not found any examples of this work. Any help would be appreciated! 

On further review, POSON results seemingly are not supported by any GAM-based model type in the carat

Not (at least in the documents, if not explicitly support these types of models) Carat codebase.

c# - Get variable info from PowerShell to asp.net page -


I am currently working on an asp.net page that will run a power shell script on a server.

PowerShell script checks to see if the user input that is stored in the $ userinput variable, matches the variable $ name.

I am managed to get the variable on the PowerShell script from ASP.NET page. Default.aspx.cs searches and replaces the script on userinput and then saves the script as a modified version.

I would like to print on the asp.net page I have defined an output label on the asp.net page named output that has variable $ results from PowerShell script.

While going on, the label does not display information from the $ $ convertible result.

Thank you in advance

Test.ps1

  $ name = "test" $ userinput = "* userinput *" if (($ userinput) -a $ name) {$ result = "name $ Userinput already taken!"} And {$ result = "name $ userinput available!" }  

Default.aspx

  & lt ;! DOCTYPE html public "- // W3C // DTD XHTML 1.0 Transcription // N http: //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> & Lt; Html xmlns = "http://www.w3.org/1999/xhtml" & gt; & Lt; Head id = "head1" runat = "server" & gt; & Lt; Title & gt; Analog cloud & lt; / Title & gt; & Lt; Link rel = "stylesheet" href = "stylesheets \ style.css" type = "text / css" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Div id = "logo" & gt; & Lt; Img src = "images \ logo.png" alt = "logo" height = "100" width = "250" /> & Lt; / Div & gt; & Lt; Form id = "form1" runat = "server" & gt; & Lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Nbsp; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr & gt; & Lt; TD & gt; & Amp; Nbsp; & Lt; / Td> & Lt; Td> Enter Application Name & lt; / Td> & Lt; / Tr & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Br / & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; ASP: Text box id = "Input" run = "server" textual = "single line" width = "200px" height = "20px" & gt; & Lt; / Asp: text box & gt; & Lt; ASP: label id = "output" runat = "server" text = "output text" width = "300px" height = "20px" & gt; & Lt; / ASP: Labels & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Amp; Nbsp; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Asp: button id = "ExecuteCode" runat = "server" text = "execute" width = "200" onclick = "ExecuteCode_Click" /> & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Default.aspx.cs

  using the system; Using System.Collections.Generic; Using System.Linq; Using System.Web; Using System.Web.UI; Using System.Web.UI.WebControls; Using System.Management.Automation; Using System.Text; Using System.IO; Namespace PowerShellExecution {Public Partial Square Default: System.Web.UI.Page {Secure Zero Page_load (Object Sender, EventArgs E) {} Secure Zero ExecuteCode_Click (Object Sender, EventArgs E) {// Clean Label Output. Text = string.mpty; // Start PowerShell engine var shell = PowerShell.Create (); String strContent = null; (Using the StreamReader objReader = new StreamReader ("C: \\ user \\ sysadmin \\ Desktop \\ Test.ps1") {strContent = objReader.ReadToEnd (); } StrContent = strContent.Replace ("* userinput *", input text.); File. Type all text ("C: \\ user \\ sysadmin \\ Desktop \\ Test_modified.ps1", strContent); //this.executePowerShellCode(strContent); // Add Script to PowerShell Object Shell. Commands.AddScript ("C: \\ user \\ sysadmin \\ Desktop \\ Test_modified.ps1"); // execute script var = shell.Invoke (); // Display results, convert string to BaseObject // Note: Use Out String for Console-Output (Results.Count & gt; 0) {// We use a string builder ton, our result Make text, var builder = new StringBuilder (); Foreach (result in var psObject) {// Convert base object to a string and add it to string builder. // Add to line break builder \ r \ n Append (psObject.BaseObject.ToString () + "\ r \ n"); } // Encode the string in HTML ('dangerous' carriers such as  Text = Server.HtmlEncode (builder.ToString ());} // string url = "testpage.html"; / / response Redirect (url);}}}  


python - TypeError: prepare_request_body() got multiple values for keyword argument 'redirect_uri' -


Trying to use Google OAuth2 with requests - oauthlib I already have to use Ajax and the stuff But tried to log on to the Django backend with Google OAuth2 data, it seems that I would have to use a libary like this (because they are ready to work on middleware and an authentication backend, I write that content Do not want to)

I have another problem There I use the class-based ideas do, but tutorials are showing only function based views.

Okay, after getting my code from Google I am trying to bring an access token. The problem is that I can not get it to work.

This is where magic happens (not really .. actually):

  Class log view (redirect view): authorization_base_url = r'https: //accounts.google.com / o / oauth2 / auth 'token_url = r'https: //accounts.google.com/o/oauth2/token' client_id = R 'was completely forgotten that a' client_secret = r'super, super secret 'redirect_uri =' http: // localhost: 8000 / day / callback 'scope = [' r'email ', r'https: // Www.googleapis.com/auth/userinfo.profile '] Get DEF (self, request): google = OAuth2 session (s) Own .client_id, redirect_uri = self.redirect_uri, scope = self.scope) authorization_url, state = google.authorization_url (self.authorization_base_url, access_type = 'offline', approval_prompt = "power") request.session ['oauth_state'] = state Return redirect (authorization _url)  

This works just fine. And as soon as it comes back from Google:

  Class callback view: Get Def (self, request): r = request.GET.copy () google = OAuth2 Session (login view) client_id, state = request.session ['oauth_state']) authorization_response = (LoginView.redirect_uri + "? / Callback state =" + request.session ['oauth_state'] + "& code =" + R ['code']) Tokens = google.fetch_token (LoginView.token_url, authorization_response = authorization_response, client_secret = LoginView.client_secret, redirect_uri = LoginView.redirect_uri,) ...  

And of course My Traceback:

Traceback: File "/ home /patrik/.virtualenvs/cms/local/lib/pyth 112 of the on2.7 / site-packages / django / core / handlers / base.py "get_respon" response = wrapped_callback (request, * callback_pass, ** callback_keyware) file "/home/patrik/.virtualenvs/cms/local/ Lib / python2.7 / site-packages / django / views / generic / base.py "69 return file in self.dispatch (requests, * args, ** kwargs)" /home/patrik/.virtualenvs/cms/local /lib/python2.7/site-packages/django/views/generic/base Received "send 87" in the return handler (Request, * args, ** kwargs) file "/home/patrik/Schreibtisch/cms/cmsproject/apps/topics/views.py" 106 redirect_uri = LoginView.redirect_uri, on file /D / callback writing error: "/home/patrik/.virtualenvs/cms/local/lib/python2.7/site-packages/requests_oauthlib/oauth2_session.py" fetch_token 167. password = password, ** kwargs) Exception type Exception value in: ready_request_body () has received several values ​​for keyword argument 'redirect_uri'

Where does this error come from?

fetch_token () method is not a redirect_uri Instead, parameter will instead make this parameter available for example with the attribute google.redirect_uri .

In other words, it should be used for OAuth2Session Give it to the constructor instead:

  google = OAuth2 session (loginview.client_id, state = request. Session ['oauth_state'], redirect_uri = LoginView.redirect_uri)  

Google Analytics. Force root domain to show as "external" -


I have a website on a subdomain: sub.main.com which has nothing in common with the root domain "main .com ".

When I try to see referrals from the root domain - it is not there. In some ways Google does not include it in the referral report, possibly because it is the original domain of my website. Is there any way to force root domains to count?


olap - Use CSV or Text file as a data source for SSAS cube -


Do we have a CSV or text file as a data source for SSAS cube, I work with a lot of data I keep the SSAS cubes (ROLAP) for the same analysis. Data (~ 2GB) comes in the form of a formatted text file every hour that I upload to a DB that acts as a data source for the cube. Cube then receives this data from DB and processes it. I would like to use the text file directly on the cube, it can save a lot of time.

I never tried this, but I think it is possible if you have ACE provider .

To connect to a flat file, the ACE provider must be installed on your computer.

Source:


javascript - Modifying embedded hyperlink in asp.net repeater -


I am using an asp.net repeater and data from SQL to data tie I am here. I want to modify the hyperlink on the client side based on the DataRow . There may be several other hyperlinks in the table, but I have to process one in the other column alone. What is the best way to do that? Any code sample is highly appreciated.

  & lt; Table border = "0" cellpadding = "2" cellspacing = "0" width = "100%" id = "myTable" & gt; & Lt; TR & gt; & Lt; Td align = "left" & gt; Id & lt; / Td> & Lt; Td align = "left" & gt; DESCRIPTION & lt; / Td> & Lt; Td> STATUS & lt; / Td> & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 10 & lt; / TD & gt; & Lt; TD & gt; & Lt; Span style = "color: red; font-weight: bold" & gt; The server is down & lt; / Span & gt; & Lt; A href = "/ admin.aspx" & gt; Here & lt; / A & gt; To continue. & Lt; / TD & gt; & Lt; Td> No response & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt;  

You can use the following jQuery to change all the links in the second column of 2 seconds Line:

  $ (document) .ready (function () {$ ('# myTable tr: nth-child (2) td: nth-child (2) a'). Function () {var someValue = '/ 2'; $ (this) .prop ('href', some value $ $ (this) .prop ('href'));});});  

This is the point from where you can get some code of that code, you can get your code anyway & lt; Asp: repeater & gt; to add it to the output & lt; Td> Such a data may be placed in the form, such as:

Repeater Output

  ... & lt; Td data-id = "2" & gt; & Lt; Span style = "color: red; font-weight: bold" & gt; The server is down & lt; / Span & gt; & Lt; A href = "/ admin.aspx" & gt; Here & lt; / A & gt; To continue. & Lt; / TD & gt; ...  

JS

  var someValue = '/' + $ (this). Parent (). Data ('id');  

Function Trouble in Java Programming 2 -


  आयात करें java.util.Scanner; पब्लिक क्लास पिलंड्रोम {सार्वजनिक स्थिर स्ट्रिंग पिलंड्रोम चेकर (स्ट्रिंग मूल, स्ट्रिंग रिवर्स) {स्ट्रिंग फेंक 1 = ""; स्कैनर शांति = नया स्कैनर (System.in); System.out.println ("\ n \ n यह जाँचने के लिए एक स्ट्रिंग दर्ज करें कि यह एक भ्रम है"); मूल = peace.nextLine (); इंट लंबाई = मूल.लाइन (); के लिए (इंट मैं = लांति -1; i & gt; = 0; i--) रिवर्स = रिवर्स + मूल.छार्ट (i); यदि (मूल। एंगल (रिवर्स)) System.out.println ("\ n \ n ईंटर्ड स्ट्रिंग एक पेलंड्रोम है।"); Else System.out.println ("\ n \ n ईंटर्ड स्ट्रिंग एक पेलंड्रोम नहीं है।"); फ़ेन्क 1 वापसी; } सार्वजनिक स्थिर शून्य चरित्र संख्या अंक (स्ट्रिंग मूल) {int letters = 0, अंक = 0, खाली = 0, लंबाई = 0; चार च; के लिए (int i = 0; i & lt; लंबाई; i ++) {ch = मूल.छार्ट (i); यदि (च == 'ए' || सीसीएल == 'ए' || सीसी == 'बी' || सीएच == 'बी' || सीएच == 'सी' || सी == 'सी' || Ch == 'd' || ch == 'डी' || च == 'ई' || च == 'ई' || च == 'एफ' || च == 'एफ' || च = = 'जी' || सीएच == 'जी' || सीएच == 'एच' || सीएच == 'एच' || सीएच == 'आई' || सी == 'आई' || सीएल == ' J '|| ch ==' j '|| ch ==' k '|| ch ==' k '|| ch ==' l '|| ch ==' एल '|| ch ==' m ' || सीसी == 'एम' || सीएच == 'एन' || सीएच == 'एन' || सीसी == 'ओ' || सीएच == 'ओ' || सीएच == 'पी' || च == 'पी' || च == 'q' || च == 'क्यू' || च == 'आर' || च == 'आर' || च == 's' || ch = = 'एस' || च == 'टी' || सीसीएल == 'टी' || सीसी == 'यू' || सीएल == 'यू' || सीएल == 'वी' || सी == ' वी '|| सीसीएल ==' डब्ल्यू '|| सीएच ==' डब्लू '|| सीएच ==' एक्स '|| सीएच ==' एक्स '|| सीएच ==' वाई '|| सीएसी ==' वाई ' || सीएच == 'जेड' || सीएसी == 'जेड') अक्षरों ++; Else if (ch == 0 || ch == 1 || ch == 2 || ch == 3 || ch == 4 || ch == 5 || ch == 5 || ch == 6 | | Ch == 7 || ch == 8 || ch == 9) अंक ++; Else if (ch == '') रिक्त ++; } System.out.println ("पत्र:" + पत्र); System.out.println ("अंक:" + अंक); System.out.println ("रिक्त स्थान:" + रिक्त स्थान); } सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग अरिज []) {स्ट्रिंग मूल = "", रिवर्स = ""; Int लंबाई = 0, अंक = 0, रिक्त स्थान = 0, अक्षरों = 0; Char ch = ''; स्कैनर शांति = नया स्कैनर (System.in); स्ट्रिंग func1 = PalindromeChecker (मूल, रिवर्स); Println (func1); CharacterNumberCounter (मूल); }}  

मेरे प्रोग्राम में अक्षरों, संख्याओं और श्वेतस्थान की संख्या प्रदर्शित क्यों नहीं की जा रही है? मुझे यह काम करने के लिए फ़ंक्शन का उपयोग करना आवश्यक था। सबसे पहले मुझे बताया गया था कि अगर प्रविष्ट स्ट्रिंग एक पेलंड्रोम है या फ़ंक्शन का इस्तेमाल नहीं कर रहा है, तो मैं सफल रहा, लेकिन जब मैंने अगला किया तो यह हमेशा चार, संख्या, सफेद स्थान की संख्या प्रदर्शित करता है।

पाइलंड्रोम चेकर को बुलियन के रूप में सबसे अच्छा परिभाषित किया गया है। मैंने तालमेल की जांच के लिए पुनरावर्ती का उपयोग किया है
इसके उपयोग के एक बहुत लंबे अक्षय चेक की स्थिति के बजाय || या , ascii मानों की जांच, बेहतर लग रहा था आप भी regex का उपयोग कर सकते हैं

अपना कोड बदल गया है, लेकिन यहां यह है:

  import java.util.Scanner; पब्लिक क्लास टेस्ट 1 {सार्वजनिक स्थिर बूलियन पाइलंड्रोम चेकर (स्ट्रिंग्स) {if (s.length () == 0 || s.length () == 1) सत्य वापस; यदि (एस.प्रचा (0) == एस। चाट (एस। लांघ () - 1)) पलंड्रोम चेकर लौटते हैं (एस। एसबस्ट्रिंग (1, एस। लांघ () - 1)); विवरण झूठा है; } सार्वजनिक स्थिर शून्य चरित्र संख्या अंक (स्ट्रिंग मूल) {int letters = 0, अंक = 0, खाली = 0, लंबाई = 0; चार च; के लिए (int i = 0; i & lt; मूल। लांघ (); i ++) {ch = मूल.छार्ट (i); अगर ((CH & gt; = 65 & amp; amp; & amp;; CH & lt; = 90) || (CH & gt; = 97 & amp; amp;; CH & lt; = 122)) अक्षरों ++; अन्यथा यदि (च & gt; = 48 & amp; amp;; CH & lt; = 57) अंक ++; Else if (ch == '') रिक्त ++; } System.out.println ("पत्र:" + पत्र); System.out.println ("अंक:" + अंक); System.out.println ("रिक्त स्थान:" + रिक्त स्थान); } सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग एल्ग्स []) {स्कैनर शांति = नया स्कैनर (System.in); System.out.println ("स्ट्रिंग फॉर पलंड्रोम चेक"); Println (PalindromeChecker (peace.nextLine ())); System.out.println ("चार गिनती के लिए स्ट्रिंग प्रविष्ट करें"); CharacterNumberCounter (peace.nextLine ()); }}  

exchangewebservices - EWS SearchFolder does not return values from body -


I am trying to create a searchfolder using the EWS API (managed or web service directly). I have noticed that if I create ItemSchema.Body on SearchFilter.ContainsSubstring , then I do not get any conversations about it.

Here's how I create my folder:

  var folder = new search folder (service) {DisplayName = topic}; Var search parameter = folder Search parameters; SearchParameters.SearchFilter = New SearchFilter.ContainsSubstring (ItemSchema.Body, Subject, ContainmentMode.Substring, ComparisonMode.IgnoreCaseAndNonSpacingCharacters); SearchParameters.RootFolderIds.Add (WellKnownFolderName.Root); Search Parameters Traveler = Searchfolder Travelers Dip; Folder.Save (WellKnownFolderName.SearchFolders);  

Later, I try to get the conversation from this folder:

  service.FindConversation (conversation view, folder.id);  

And it gives 0 conversations.
I made sure to send two messages to my email account, with only one special word in the first subject, and the other with the same word in the body. If I make a searchfolder with a filter on ItemSchema.Subject , I get the first conversation, but using the above searchfolder I did not get the expected result.

Is there some restrictions in relation to Substring Search Filter? I tried to use generalized body or textboard, but then I found errors in the folder creation process, is there anything else I'm missing?

Search filtering on the body might be problematic, it goes back that potentially large in content tables How the properties like body are handled, a query string search might work, but you can not use the query string to create a search folder.


how to dynamically change the gridview rows and columns in Android -


I am using Gridview in my activity. I also have a custom grid adapter to show the image and text view on each grid.

On starting my activity, I need to create dynamic grid rows and columns based on the values ​​

  count = 4 2x2 grid number = 9 3x3 grid count = 16 4x4 grid  

Please tell me how I can get this functionality.

My Gridview:

I have created the column Android: numColumns = "auto_fit" so it's default for 2 columns.

I also have a custom grid adapter

  & lt ;? Xml version = "1.0" encoding = "UTF-8"? & Gt; & Lt; RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: background = "@ drawable / Grid_ color_selector" & gt; & Lt; ImageView android: id = "@ + id / image" Android: Leaut_vidth = "100 DP" Android: Leaut_hait = "100 DP" Android: Leaut_margin Right = "10 DP" / & gt; & Lt; TextView android: id = "" @ + id / Day_TextView Android: Layout_width = "Wrap_content" Android: Layout_height = "Wrap_content" android: background = "@ drawable / gridview_line_norecord" android: gravity = "center" Android: textcolor = "@ android : Color / White "Android: Text Size =" 24sp "Android: Text =" Hello "/>   

350); }

But I'm worried about manually giving value inside the activity. As I think it can give unusual UI for landscape mode.

Please help me move forward.

Homie's comment is correct

Use the recycle view and grid layout manager. ! In .xml

  & lt; Android.support.v7.widget.RescyclerView Android: layout_width = "match_parent" android: layout_height = "match_parent" android: numColumns = "2" Android: horizontalSpacing = "@ Dimen / gridview_horizontal_spacing" Android: verticalSpacing = "@ Dimen / gridview_vertical_spacing" Android: ID = "@ + id / recyclerView" />  

and recyclerView.setLayoutManager (New GridLayoutManager (reference, number));

or

Gridview.setNumColumns (number);


ios - Create a textfield over MKAnnotation Callout Swift -


I would like to create an editable callout, and this is the best way to create a text file in a quick way , I was wondering how to remove the CGP of annotations so that I could use it to keep the CGRx of my field of text. I'm using this code to display a annotation at a tape point, how would a reverse be? If anyone suggests better ways to create editable callouts, then the suggestions are welcome

  var point: CGPoint = gestureRecognizer.locationInView (self.Map) EventLoc = self.Map.convertPoint (Point, ToCoordinateFromView: self.Map) 

I'm not yet familiar with swift, but by language Free, MKMapView has a method in convertCoordinate: toPointToView: which you use to convert CLLocationCoordinate2D to CGPoint Can code>.

Edit

From:

Converts a map coordinate to a point in the specified view.

So the final argument in your case should be your map view:

whose coordinating system wants you to locate the specified map coordination if this parameter If zero, the return point is specified in the coordinate system of the window. If the view is not zero, then it should be related to the same window, such as map view.


yeoman - Yo sync copy possibility for files -


Is there any possibility of using this.copy in the yoke generator in sync mode? I need my sub-generator, while all the files of the original generator are copied. You can use

this.fs.commit (function () {});

To write in-store files on disk.


c# - Wrapping "C++ dll" in "C++/CLI" when function returns pointer to abstract class -


मेरे पास c ++ dll है: अप्रबंधित कोड। एच दिखता है:

  #include "stdafx एच "संरचना वर्ग 1 {सार्वजनिक: आभासी शून्य विधि () = 0; }; Extern "C" __declspec (dllimport) वर्ग 1 * Create_function ();  

अप्रबंधित कोडकप की तरह दिखता है:

  #include "stdafx.h" #Include "UnmanagedCode.h" वर्ग Class2: Class1 {सार्वजनिक: शून्य विधि () {}}; कक्षा 1 * बनाएँ_फंक्शन () {क्लास 2 * सी 2 = नया क्लास 2 (); // मुझे इस उदाहरण के लिए मुफ्त स्मृति की परवाह नहीं है Class1 * c1 = (Class1 *) c2; वापसी सी 1; };  

मेरे पास c ++ / cli प्रबंधित वर्ग है:

  #include "library.h" # शामिल "unmanagedCode.h" typedef Class1 * (* Createfunction) (); नामस्थान CLIWrapper {सार्वजनिक रेफरी क्लास ManagedClI {निजी: कक्षा 1 * cl1; सार्वजनिक: ManagedClI () {} शून्य बनाएँ () {// लाइब्रेरी वर्ग स्ट्रिंग ^ पथ = "library.dll को पथ" के साथ सी + + पुस्तकालय को लोड करने के लिए कुछ सामान्य दिनचर्या; // बस सिस्टम :: रनटाइम :: इंटरऑप सर्विसेज :: मार्शल; Const char * cpath = (const char *) (मार्शल :: स्ट्रिंगटीओएचजीलोबेलाएन्सी (पथ))। ToPointer (); लाइब्रेरी लोडर; Loader.load ((स्ट्रिंग) cpath, गलत); मार्शल :: FreeHGlobal (सिस्टम :: IntPtr ((शून्य *) cpath)); Createfunction hDet = (Createfunction) loader.getProcAddress ("Create_function"); Cl1 = hDet (); cl1- & gt; विधि (); // अगर मैं cl1- & gt; विधि () को कॉल करता हूं तो यह सही काम करता है !! } कुछ फंक्शन (शून्य) {cl1- & gt; विधि (); // लेकिन अगर मैं cl1- & gt; विधि () यहां कॉल करता हूं तो यह एक त्रुटि फेंकता है !!! }}; }  

मैं अपने सी # एप्लिकेशन में ManagedCli वर्ग का उपयोग करता हूं, कुछ ऐसा:

  CLIWrapper.ManagedClI वस्तु = नया CLIWrapper.ManagedClI (); object.Create (); object.SomeFunction (); // & lt; - यह त्रुटि के कारण होता है  

object.SomeFunction () त्रुटि का कारण बनता है: संरक्षित मेमोरी पढ़ने या लिखने का प्रयास करता है जब यह कॉल करता है cl1 - & gt; विधि () । लेकिन एक ही समय में cl1- & gt; विधि () सामान्यतः Object.Create () में काम कर रहा है।

मुझे लगता है कि मैं कर रहा हूँ कुछ कोड को लपेटते समय Create_function () क्या कोई सुझाव दे सकता है?

आपका लाइब्रेरी लोडर केवल एक लोडर से ज्यादा है । यह सीएलआई ऑब्जेक्ट है जो DLL को लोड करता है। जब इसका अंतिम संदर्भ दूर हो जाता है और इसे साफ किया जाता है, तो DLL लोड हो जाता है।

आपके सार वर्ग की वर्चुअल फ़ंक्शन तालिका उस DLL में रहती है, जैसा कि ये फ़ंक्शन जो इंगित करता है। जब DLL लोड हो जाता है, तो वर्चुअल फ़ंक्शन तालिका अमान्य हो जाती है, और विधि को कॉल करने का प्रयास अपरिभाषित व्यवहार होने वाला है।

इसे पहले सन्निकटन में ठीक करने के लिए, लाइब्रेरी स्थानीय

के बजाय अपने ManagedClI वर्ग में ऑब्जेक्ट करें।

ios swift parse.com: How to query a "like" as well ignore case-sensitive search keyword? -


There are 2 name fields in my class I want to search using UISearchBar I

What is it now?

  query.whereKey ("front", hasPrefix: searchText)  

This works fine, But I also want to search for the field "back" as or , as well as I want to ignore case-sensitive writting.

As far as I know there is no "likes" search within parse? Does this mean I'm limited to the hasPrefix function?

Thank you!

Edit:

  func fetchAllObjectsFromLocalDatastore (searchText: string) {var query = PFQuery (className: "Card") if (searchText! = "") {Var front = PFQuery (className: "Card") front.whereKey ("front", string in: search text) var back = PFQuery (classname: "card") back.whereKey ("back", string: search text) query = PFQuery .orangeWithSubqueries ([front, back])} query.fromLocalDatastore () query.findObjectsInBackgroundWithBlock {(objects, error) - & gt; In void ...  

It works for me now!


javascript - ng-view Angular not showing the text output -


  & lt; html & gt; & Lt; शीर्ष & gt; & Lt; script src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> & Lt; script src = "angular-route.js" & gt; & lt; / स्क्रिप्ट & gt; & Lt; / head & gt; & Lt; / head & gt; & Lt; body ng-app = "myApp" एनजी-नियंत्रक = "cont1" & gt; & Lt; a href = # कुत्तों & gt; कुत्तों & lt; / a & gt; & Lt; a href = # बिल्लियों & gt; बिल्लियों & lt; / a & gt; & Lt; div ng- दृश्य & gt; & lt; / div & gt; & LT; स्क्रिप्ट & gt; angular.module ( "MyApp", [ 'ngRoute']) config ( '$ routeProvider', समारोह ($ routeProvider) {$ routeProvider.when ( "/ कुत्तों", {templateUrl:। "one.html"}) .जब ("/ बिल्लियों", {templateUrl: "two.html"})। अन्यथा ("/ बिल्लियों", {redirectTo: "/ कुत्तों"})}); App.controller ("cont1", फ़ंक्शन ($ दायरा) {$ scope.model = {संदेश: "यह मेरा ऐप वन है !!!"}}); & Lt; / स्क्रिप्ट & gt; & Lt; / body & gt; & Lt; / html & gt;  

मैं अनुच्छेद में संदेश प्राप्त करने में असमर्थ हूं 'यहाँ बिल्लियों हैं' या 'दो कुत्तों' पर क्लिक करने पर; इन फ़ाइलों को एक ही फ़ोल्डर में एक.html और 2.html के रूप में सहेजा जाता है।

मैंने एक ही फ़ोल्डर में कोनेुलर-रूट.जेएस फाइल डाउनलोड और जोड़ दी है। कृपया मदद!

मैंने रूटर प्रदाता में नियंत्रकों को रखा है लेकिन यह आवश्यक नहीं है, और इसे जोड़ने के लिए इसे अभ्यस्त करना होगा! : (

आप उस ऑब्जेक्ट के अंदर अपने टेम्पलेट्स के लिए नियंत्रकों को सम्मिलित करने के लिए भूल जाते हैं। नीचे देखें:

 <कोड> & lt; html & gt; & lt; शीर्ष & gt; & lt; स्क्रिप्ट src = "http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js" & gt; & lt; / स्क्रिप्ट & gt; & lt; स्क्रिप्ट src = "कोणीय route.js" & gt; & lt; / स्क्रिप्ट & gt; & lt; / head & gt; & lt; / head & gt; & lt; शरीर एनजी-ऐप = "MyApp" एनजी नियंत्रक = "cont1" & gt; & lt; a href = # कुत्तों & gt; कुत्तों & lt; / एक & gt; & lt; a href = # बिल्लियों & gt; बिल्लियों & lt; / a & gt; & lt; div एनजी-व्यू & gt; & lt; / div & gt; & lt; स्क्रिप्ट & gt; angular.module ( "MyApp", [ 'ngRoute']) config ( '$ routeProvider', समारोह ($ routeProvider) {$ routeProvider.when ( "/ कुत्तों", {templateUrl:। "one.html", नियंत्रक: "cont1"} ) .जब ( "/ बिल्लियों", {templateUrl: "two.html", नियंत्रक: "cont1"}) .otherwise ( "/ बिल्लियों", {redirectTo: "/ कुत्तों"})}); app.controlle आर ("cont1", फ़ंक्शन ($ गुंजाइश) {$ scope.model = {संदेश: "यह मेरा ऐप वन है !!!"}}); & Lt; / स्क्रिप्ट & gt; & Lt; / body & gt; & Lt; / html & gt;  

cmusphinx - The range of variation for each parameter for pocketsphinx_continuous app -


I found that there are so many parameters to create speech recognition (such as input parameters in pocketsphinx_continuous app). There are many parameter animations, other floating values ​​are for the Pocketsphinx_continuous app, where can I find the limit of variables for each parameter?

Not really useful unless you understand what's going on.

A parameter change may require changes in other parameters or recognition in very rare but important cases.

Normally the parameters are approximate or close to it. If you are interested, then you can convert each parameter into a small (+/- 10% relative) within the current value, but one important The change is hardly the right thing.

If you are interested in some decoding tuning, it is better to describe what you want to archive.


scalability - CometD long polling - Does it scale nicely to high traffic? -



scalability - CometD long polling - Does it scale nicely to high traffic? -

if utilize cometd long polling:

suppose there 1000 messages in sec sent subscribers, cometd allow them auto-batched each client doesn't have re-connect each single message?

do "lazy channels" (as described here: http://docs.cometd.org/3/reference/#_java_server_lazy_messages) auto-batch queued messages sent clients upon timeout?

if on other hand don't utilize lazy channels, , suppose "batch-publish" messages on channels 1, 2 , 3:

cometd.batch(function() { cometd.publish('/channel1', { product: 'foo' }); cometd.publish('/channel2', { notificationtype: 'all' }); cometd.publish('/channel3', { update: false }); });

(http://docs.cometd.org/3/reference/#_javascript_batch)

does client subscribed 3 channels receive them in batch too? or send them separately, forcing client re-connect after each message (slow)?

cometd offers application developers total command of batching features, allowing have maximum flexibility, performance , scalability.

when using http long-polling transports, there 2 places batching may happen.

from client server solved using cometd api , explicit batching (like snippet above). batching @ level typically in command of application, although cometd internal batching avoid exhausting connections server.

from server client there more variations.

for broadcast non-lazy channels there no automation, , happens first message client (that not publisher) trigger flush of message queue; while beingness sent, other messages queue on server side client , on next /meta/connect whole queue flushed. 10 messages scheme like: 1-flush-9-flush (enqueue 1, flush queue, enqueue other 9 while waiting /meta/connect come back, flush other 9).

for broadcast lazy channels there automation, cometd wait before sending messages next rules of lazy messages. typical scheme be: 10-flush.

for service channels, in command of application. client can send batched messages application via service channel (whose messages not broadcast automatically cometd). application on server can receive first message , know other 9 come, can wait send them until lastly has arrived. when lastly arrives, can utilize batching api batch responses clients, like:

class="lang-java prettyprint-override">list<serversession> subscribers = ...; (serversession subscriber : subscribers) { subscriber.batch(() -> { subscriber.deliver(sender, "/response", response1); subscriber.deliver(sender, "/response", response2); subscriber.deliver(sender, "/response", response3); }); }

of course of study responses may different messages received, both in content , number. scheme here can application wants, it's mutual have 10-flush, efficient.

a note regarding batching of messages sent publisher. special case , it's default automated: while processing incoming messages publisher, cometd starts internal batch particular publisher, message delivered publisher batched , flushed @ end of processing of incoming messages.

the bottom line cometd pretty tuned give maximum of performance , scalability in mutual cases, yet leaves application room customizing behaviour accomplish maximum efficiency using application specific knowledge of message patterns.

i encourage @ cometd documentation, tutorials , javadocs.

scalability broadcast server-push cometd batching

c - Cast from "int" to "unsigned short" after applying bitwise operator "~" -



c - Cast from "int" to "unsigned short" after applying bitwise operator "~" -

static analysis tool utilize raises warning code :

uint16 var1 = 1u; uint16 var2 = ~var1;

i check misra c 2004 rules , find 10.5 rule :

if bitwise operators ~ , << applied operand od underlying type unsigned char or unsigned short, result shall cast underlying type of operand.

ok, it's not problem, implicit cast applied (i think "cast" means implicit or explicit cast). 10.1 rule says :

the value of look of integer type shall not implicitly converted different underlying type look complex.

an previous illustration of complex operation : ~u16a

i alter code :

uint16 var1 = 1u; uint16 var2 = (uint16) ~var1;

and obtain warning : think conversion of int negative value unsigned int value not safe. check c99 standard (iso c99) § 6.3.1.3 don't understand if conversion of int unsigned short specified.

in embeddedgurus article read :

c = (unsigned int) a; /* since positive, cast safe */

my questions :

have explicit conversion signed int unsigned short unspecified behavior ? if yes, how utilize complement operator unsigned short in safe way ?

the operands of arithmetic , bitwise operators undergo standard promotions before value computed. shorter int promoted either int or unsigned int, depending on platform (i.e. depending on whether int can represent values of type that's beingness promoted).

on platform, uint16_t standard-promoted int, since int can represent values of uint16_t. bitwise negation applied int value, cause of problem.

to deterministic result independent of platform, convert value unsigned int yourself:

uint16_t var2 = (uint16_t) ~((unsigned int) var1);

note correct, since unsigned int required able represent values of uint16_t.

c casting

Angularjs Page contents change according to pages set in routers -



Angularjs Page contents change according to pages set in routers -

i trying create simple website angularjs

i have controller:

nglesson.controller('pages_contents', ['$scope', function ($scope) { $scope.homepage = { pageuri: 'home', pagename: 'home', pagedescription: 'bla bla bla', pagecontent: 'bla bla bla bla blabla' }; $scope.aboutpage = { pageuri: 'about', pagename: 'about', pagedescription: 'bla bla bla', pagecontent: 'bla bla bla bla blabla' }; // , on... }]);

i have router rules:

nglesson.config(['$routeprovider', function ($routeprovider) { $routeprovider. when('/home', { templateurl: 'templates/content-container.html', controller: 'pages_contents' }). when('/about', { templateurl: 'templates/content-container.html', controller: 'pages_contents' }). otherwise({ templateurl: 'templates/something-else.html' }); }]);

i have basic template templates/content-container.html. not know parameters set within of it. 1 works: {{homepage.pagecontent}} of course of study homepage.

i tried different controller @ first, appeared had set different controllers in when() function in router. meaned different templates , kinf of stupid.

i cannot figure myself. there simple solution? can give me advices? give thanks much in advance!

you don't need different controllers it's suggested.

typically you'd create html template , augment angular dynamic content.

if have static content may include in template not in angular.

you can page.

nglesson.controller('about_contents', ['$scope', function ($scope) { $scope.aboutpage = { pageuri: 'about', pagename: 'about', pagedescription: 'bla bla bla', pagecontent: 'bla bla bla bla blabla' }; // , on... }]);

and add together controller router configuration , ng-controller="about_contents" html

angularjs

How do I set/unset cookie with jQuery? -



How do I set/unset cookie with jQuery? -

how set , unset cookie using jquery, illustration create cookie named test , set value 1?

see plugin:

https://github.com/carhartl/jquery-cookie

you can do:

$.cookie("test", 1);

to delete:

$.removecookie("test");

additionally, set timeout of number of days (10 here) on cookie:

$.cookie("test", 1, { expires : 10 });

if expires alternative omitted, cookie becomes session cookie, , deleted when browser exits.

to cover options:

$.cookie("test", 1, { expires : 10, //expires in 10 days path : '/', //the value of path attribute of cookie //(default: path of page created cookie). domain : 'jquery.com', //the value of domain attribute of cookie //(default: domain of page created cookie). secure : true //if set true secure attribute of cookie //will set , cookie transmission //require secure protocol (defaults false). });

to read value of cookie:

var cookievalue = $.cookie("test");

you may wish specify path parameter if cookie created on different path current one:

var cookievalue = $.cookie("test", { path: '/foo' });

update (april 2015):

as stated in comments below, team worked on original plugin has removed jquery dependency in new project (https://github.com/js-cookie/js-cookie) has same functionality , general syntax jquery version. apparently original plugin isn't going anywhere though.

jquery cookies

java - Why does super not refer to the variable in super class? -



java - Why does super not refer to the variable in super class? -

in below code, why super still referring subclass variable, , not super class variable?

class feline { public string type = "f "; public feline() { system.out.print("feline "); } } public class cougar extends feline { public cougar() { system.out.print("cougar "); } public static void main(string[] args) { new cougar().go(); } void go() { type = "c "; system.out.print(this.type + super.type); } }

what subclass variable? haven't declared one, this.type refers superclass's variable.

if declared public string type; in both superclass , subclass, work way expecting. right now, type variable you've declared 1 on superclass.

also, shadowing variables bad practice, gets confusing type mean.

java super

Running a PHP script that runs a Python script that runs a bash script, hangs on bash -



Running a PHP script that runs a Python script that runs a bash script, hangs on bash -

i have python script encoding video , calling shell script uploads new video dropbox. works fine command line needed create others execute have php script calling python script.

i don't want php script run forever (it takes 15-30 mins complete), want kick off python script , done. figured out need create happen , said works on command line. when called via php, video encodes file never uploads. can see dropbox script kicked off , listed process using percent of cpu, percent never changes, seems stuck/dead.

the command looks this, beingness run using cmd()

script.py -options &>/logs/phptopython.log &

the shell script kicked off using popen

any suggestions?

thanks

it sounds permissions issue. double check permissions on directory trying upload video. if on linux can modify permissions on directory this:

chmod 755 /path/to/dir

this gives file owner read, write , execute permissions (7). grouping , other users read , execute permissions (5).

apache running different user when run command in bash. quick test see if it's permission issue grant 777 on directory. wouldn't leave way though – it'd way identify if permissions issue.

if script works 777 permissions, either alter owner of directory user apache runs or add together apache user directory's grouping , grant grouping write permisssions.

edit: noticed said utilize cmd(), i'm guessing on windows. comments might still relevant chmod command won't work on windows.

php python bash shell

uitableview - Need index path.row for textfield -



uitableview - Need index path.row for textfield -

i using xib file label on left side , textfield on right side. using xib in ui tableview. need row value whenever click on textfield (right side).

i able row value on left side(label side) not on textfield.

please help. thanks.

why don't seek tagging textfield? i.e. give tag textfield , on didselect tag by

textfield.tag

and utilize wherever want.

uitableview xcode5 xib

printing user documents in grails -



printing user documents in grails -

i'm working on application has print invoices. writing needed variables application excel file, leave application, open word document merges in excel file before printing.

i think there should smarter way in grails.

who knows ?

grails printing pretty-print

php - Cakephp raw query with paramaters -



php - Cakephp raw query with paramaters -

is possible in cakephp?

$messages = $this->message->query("select * messages (from_id = :id , to_id = :user_id) or (to_id = :id , from_id = :user_id) order created desc", array( 'id' => $id, 'user_id' => $user_id ) );

you can seek this:

$messages = $this->message->find('all', array( 'conditions' => array( 'or' => array( array('from_id' => $id, 'to_id' => $user_id), array('to_id' => $id, 'from_id' => $user_id), ), ), 'order' => array( 'created' => 'desc', ) ));

php mysql sql cakephp

compilation - How to compile a C code during execution time, and get a pointer to the corresponding function? -



compilation - How to compile a C code during execution time, and get a pointer to the corresponding function? -

suppose generate c programme during execution time:

source = "int add_x_y(int x, int y){ homecoming x + y; }"; source_size = 42;

i want next function:

void* compile(char* source, int source_size);

such that:

int (*f)(int,int) = compile(source, source_size); printf("%d\n",f(2,3));

outputs:

5

and compile can't depend on external tools (compilers), i'd utilize in emscripten (which converts c programme .js file).

is possible?

someone else can fill in of specifics improve i, if don't mind calling out gcc or linking it, should doable. if write code out file, compile file shared library (.so). there, it's simple matter of loading shared library , getting address of desired symbol.

c compilation jit

ios - iOS8 Regional Localization (e.g. pt-BR)? -



ios - iOS8 Regional Localization (e.g. pt-BR)? -

from understand, ios8 supports regional localisations (in case want back upwards pt-br).

see http://www.ibabbleon.com/ios-language-codes-iso-639.html

i having problems this, testing brand new single view application, in xcode have added pt , pt-br languages project, , altered text accordingly in pt.lproj , pt-br.lproj directories.

after setting device pt-br , running, text displayed pt, not pt-br desired.

indeed logging preferred locale returned nslocale

nsstring *language = [[nslocale preferredlanguages] objectatindex:0]; nslog(@"locale = %@", language);

returns 'locale = pt'...

am missing steps or bug in ios8?

thanks help...

for reason, ios8 using pt portuguese brasil (instead of pt_br). when select portuguese portugal, localization pt_pt

i've deleted localization, , added generic portuguese (and replaced .strings files old ones).

ios localization ios8 xcode6

javascript - Object.freeze doesn't really freeze -



javascript - Object.freeze doesn't really freeze -

mdn claims executing .freeze on object:

nothing can added or removed properties set of frozen object.

now take @ example:

var span = document.createelement("span"); span.id = "foo"; console.log(span.id); //foo object.freeze(span); span.setattribute("id", "bar"); console.log(span.id); //bar

the id property changed when object frozen. through span.hasownproperty("id") know id indeed local property of span.

the whole dom object in javascript should prevent id beingness changed. not doing thing. why?

the reason why .id still beingness changed, because not beingness changed. looks has changed. .id defined setter , getter, grabs corresponding attribute value upon called. if preset setter , getter manually removed, value not alter expected:

var span = document.createelement("span"); delete span.id; //remove setter , getter span.id = "foo"; console.log(span.id); //foo object.freeze(span); span.setattribute("id", "bar"); console.log(span.id); //foo

the actual dom separate accessible object in js, getattribute("id") still homecoming "bar".

javascript dom

Scratch output file .txt or similar -



Scratch output file .txt or similar -

i want know if there easy way open .txt file , load comma delimited info variables in scratch , furthermore add together variable info scratch .txt file or similar?

i have done fair bit of google searching not come across thought inquire guys.

i love utilize java or school kids , cannot teach them in java or else need have in scratch annoying cannot change.

scratch not have file io capabilities, , uncertainty ever will.

the closest thing know of importing/exporting list. right-click on list watcher scratch ide, , export. produce .txt file, each list item on new line. if have formatting txt file, can import using same method. each line corresponds list item. comma delimited info doesn't work this.

mit-scratch

c# - ESRI Map control PanTo -



c# - ESRI Map control PanTo -

i'm trying create map center on latitude/longitude esri map command uses it's own x/y coordinate system.

control.mapcontrol.panto(new mappoint(control.mapcenter.latitude, control.mapcenter.longitude));

this code not work. there "conversion" routine mappoint out of lat/lon or should do?

the method utilize conversion lat/long(spatial reference 4326) esri coordinates (spatial reference 102100) follows:

// create mappoint lat/long coordinates var mappoint = new mappoint(long, lat); // need convert lat/long esri var webmercator = new webmercator(); var converted = (mappoint) webmercator.fromgeographic(mappoint);

before doing conversion step, can check spatial reference of mappoint see if needs converted.

c# silverlight geolocation esri

java - Build transformation engine based on rules -



java - Build transformation engine based on rules -

i want build transformation engine based on rule set (from cobol java) illustration have next cobol code:

perform 3 times if x = 10 then; else phone call para01. end perform.

i want able define rules following:

rule1: pattern: perform $var times ==> (int = 0; < $var; ++) rule2: pattern: if status ; else block_of_code ==> if (!(condition)) block_of_code

so java code after transformed this:

for (int = 0; < 3; ++) if (!(a== 10)) para01();

is there tool, platform available help? in case need develop scratch, there recommendation? give thanks much

some people seek kind of thing regular expressions. doesn't work; regular expressions can't handle context-free matching.

the right reply program transformation systems.

these tools parse source, build asts, , allow 1 write code transformations in source syntax, much op has shown.

while there ton of theory (see scholar.google.com term "program transformation), building these tools difficult. notion of parsing code fragments (as op has hinted at) requires pretty interesting twists in parsing machinery. i've been in space since 1980s, , seen tools listed @ wikipedia built on lastly 15-20 years; don't see lot more of them. experience have building our scheme (see bio) 50 man-years of phd level software engineering, i'm not surprised don't see more of them.

these tools typically require precise language front end end useful, , much of work in using them goes after have basic transformation engines built. (see discussion on parsing java , c++; applies as complex legacy languages cobol).

[a query in comment wanted know more larn more technical detail. if want "first-cut" deep technical detail, survey pretty good, focuses on "pure" transformation engines (operating on abstract syntax trees).

i happen believe 1 needs considerably more that; see bio give-and-take of "life after parsing". can older technical paper on our dms system, and/or more recent video overview of our system, including how differs, in google tech talk.

in comment on original question, there request "deep technical tour". see this detailed give-and-take on how dms handles rewrite rules; page links deep discussions of related topics.

java parsing compiler-construction transform transformation

How to get selector type using javascript or jquery for use in switch statement -



How to get selector type using javascript or jquery for use in switch statement -

i have next code find type of selector , respond appropriately. ugly best have been able come far distinguish between input types checkbox, radio, text, , select drop downwards list. hoping there way switch statement.

if ($(selector).is(':checkbox')){ //do }else{ if (selector.indexof("radio") >= 0){ //do }else{ if ($(selector).is('input') || $(selector).is('select')) { //do } } }

one thing bring $(selector).is('input') way figured out how grab input type="text" grab checkboxes had set @ bottom.

i utilize $().attr().

if($(selector).attr('type') == 'text')

javascript jquery jquery-selectors css-selectors

libgdx - How to animate textures in a 3d model? -



libgdx - How to animate textures in a 3d model? -

i wish have animated 3d texture in libgdx code struggling find out how it.

i assume how "should" done either;

a) straight accessing , modifying texture on model. (via pixmap? bytebuffer?)

or

b) prerendering big image containing frames (say, 20) , moving uv co-ordinates create illusion of animation. (akin imagestrips in 2d/webdesign).

i did work out how replace material eachtime, seems much worse way of doing it. if show commands need either a) or b) (or similar optimal method) great-fall. maths fine with. intricacies of opengles or gdx not :)

(the solution should @ to the lowest degree work html/android compiles, ideally everything)

since latest release easy play 2d animation on 3d surface. first create sure familiar 2d animation concept, explained on here: https://github.com/libgdx/libgdx/wiki/2d-animation. then, instead of using spritebatch, can utilize textureregion (which animation#getkeyframe returns) set material of surface, shown here: https://github.com/libgdx/libgdx/blob/master/tests/gdx-tests/src/com/badlogic/gdx/tests/g3d/textureregion3dtest.java. in render method:

attribute.set(animation.getkeyframe(statetime, true));

or if want more generic approach:

instance.getmaterial("<name of material>").get(textureattribute.class, textureattribute.diffuse).set(animation.getkeyframe(statetime, true));

or, if there's 1 material in modelinstance:

instance.materials.get(0).get(textureattribute.class, textureattribute.diffuse).set(animation.getkeyframe(statetime, true));

libgdx textures bytebuffer

node.js - Too Many Redirects on OpenShift after push -



node.js - Too Many Redirects on OpenShift after push -

i have node.js application running on openshift. after testing code on local environment pushed instance on openshift. after doing so, went check changes on public site , browser reported getting many redirects. tried @ haproxy status , getting many redirects.

i have done investigation , here i've found:

i checked nodejs logs , node server started (no errors) i've ssh'd machine , ran curl -vvv $openshift_nodejs_ip:8080 , returned index.html should. when run curl -vvv http://minutepolitics-minutepolitics.rhcloud.com/ response:

response:

hostname not found in dns cache trying 54.81.203.46... connected minutepolitics-minutepolitics.rhcloud.com (54.81.203.46) port 80 (#0) / http/1.1 user-agent: curl/7.37.1 host: minutepolitics-minutepolitics.rhcloud.com accept: */* http/1.1 302 found date: thu, 23 oct 2014 03:26:06 gmt server apache/2.2.15 (red hat) not blacklisted server: apache/2.2.15 (red hat) vary: host x-powered-by: php/5.3.3 location: http://minutepolitics-minutepolitics.rhcloud.com/ connection: close accept-ranges: none content-length: 0 content-type: text/html closing connection 0

also, when ssh machine , run /etc/init.d/haproxy start output is: starting haproxy: [alert] 294/230821 (134951) : starting frontend main: cannot bind socket [failed]

from here, don't know or seek working again.

any , help apprecaited! thanks!!

node.js openshift haproxy

ios - Using IBoutlet in constant initalization -



ios - Using IBoutlet in constant initalization -

i want utilize iboutlet mapview in mapmanager. realise connection have nowadays mapview mapmanager. thought work:

@iboutlet var mapview: mkmapview! var locationmanager = cllocationmanager() var userlocation: mkuserlocation! allow mapmanager: mapmanager = mapmanager(mapview : mapview)

now, wonder if right way it. mean, going utilize mapview in model isn't best thing do. how realise idea?

i think code should not compile, because when initializing mapmanager implicitly referencing self, unavailable until class properties have been initialized.

i solve problem defining implicitly unwrapped mapmanager property:

var mapmanager: mapmanager!

which initialized when mapview set:

@iboutlet var mapview: mkmapview! { didset { self.mapmanager = mapmanager(mapview: mapview) } }

of course of study before referencing mapmanager have sure mapview has been initialized, otherwise runtime exception raised.

ios xcode swift