Thursday, 15 April 2010

c# - How can I post a partially completed form without overwriting old information? -


I have a view that allows users to edit some properties, there are many properties I can see from I do not want to be, however, I can not just put everything in the hidden areas for postback.

I'm sure that this is a normal scenario, is it an easy way to post changes only from the scene, such that the properties stored in the database are not overwritten with zero or default values ?

I know that I can store the model in session session, the edit scene is called and then the changes are checked when the form is posted back, but it seems that Like the hack? Instead of looking at your domain model object, use a different visual model in which only the properties that you want the user to display. Are there. When the visual model is posted back, retrieve the domain model and update its property with the visual model.


android - Fragments, How to overlay Fragment layout to an existing Layout XML and vice-a-versa? -


In my app, an activity with layout xml (the first page) blows on the form of the method, on some event (like button click) , I want to use the fragment class through the pieces as a container on the layout XML above and inflate the layout XML. Like below, my layout is XML (first page).

  & lt; Frame layout xmlns: android = "http://schemas.android.com/apk/res/android" xmlns: tools = "http://schemas.android.com/tools" Android: id = "@ + ID / container "Android: layout_width =" match_parent "Android: layout_height =" match_parent "& gt; & Lt; button .... & Gt; & Lt; / FrameLayout & gt; Click the  

button, I want to use the piece within the same layout container. So I use the code below the activity (on the button click).

  Fragment Manager fManager = getFragmentManager (); Fragment Transaction eTransaction = FMnager. BBT transactions (); MyFragment frag = New MyFragment (); FTransaction.replace (R.id.container, frag); FTransaction.commit ();  

Now, the new layout is visible through the piece but the old layout is also in the background and visible.

I do not want to first to use pieces from layout, as I am doing. I want to make a layout xml first, then on some event, use piece layout, and again, by piece, I want to switch to layout xml, it means vice-a-versa.

Like,

  from layout xml footage to setContentView () - & gt; Layout through pieces - & gt; Layout XML sets flows through contentview ()  

How to hide pseudo layout XML (the first page), when the slice layout increases and vice-versa is opposite?

If the piece covers the whole screen, you can set the background of the piece to a solid color Are there. / P>


sql - select and insert in one statement -


 <कोड> # Temp2 (RowNumber, ValFromFunc, FuncWeight, प्रतिशत) में डालने का चयन करें RowNumber, PercentMatch, @constVal, PercentMatch * dbo.MatchDate से @constVal (@date)  

dbo.MatchDate (@date) एक इनलाइन TVF जो इस तरह दिखता है:

  बनाएं कार्य [ dbo]। [MatchDate] (@DateFromUser nvarchar (20)) से dbo.Patients पी के रूप में वापसी का चयन करें p.Rowid RowNumber, कास्ट (100 INT के रूप में) के रूप में के रूप में PercentMatch तालिका लौटाता है जहां datename (दिन, p.DOB) = @DateFromUser जीओ  

मेरे पास यह क्वेरी है जहां मैं एक क्वेरी में चयन कर रहा हूं और सम्मिलित हूं। अब मैं एक विस्तारित आवश्यकता जो मुझे ModifiedAt dbo.MatchDate (@date) द्वारा दिया पंक्तियों के लिए और में डालने # Temp2 केवल जांच करने के लिए की आवश्यकता है यदि ModifiedAt लौटाई गई पंक्तियों के लिए कुछ समय से अधिक है टी।

मैं इसके बाद के संस्करण में यह कैसे कर सकता हूं?

आप कर सकते थे अपने कार्य करने के लिए लेकिन केवल ऐसा करना उचित है अगर संशोधित तारीख जोड़ें, तो उसे जोड़ने नहीं है, तो आप केवल सुविधा के लिए यह कर रहे हैं।

यदि आप उस मार्ग को चुनते हैं तो आपकी क्वेरी बस

  INSERT # # (आरओएनम्बर, वालफ्रमफंक, फ़नकीइट, प्रतिशत) में होनी चाहिए। चयन पंक्ति संख्या, प्रतिशत मैच, @ कन्स्टवील, PercentMatch * @constVal FROM Dbo.MatchDate (@ तिथि) जहां संशोधितएट & gt; @YourComparisonDateTime  

हालांकि, आप को संशोधित करने की ज़रूरत नहीं होगी क्योंकि आप अभी भी एक मूल्य पर कार्य कर सकते हैं।

  INSERT IN # Temp2 (RowNumber , ValFromFunc, FuncWeight, प्रतिशत) का चयन करें f.RowNumber, f.PercentMatch, @constVal, dbo.MatchDate से f.PercentMatch * @constVal (@date) भीतरी च f.RowNumber = t.RowNumber --टी पर YourSourceTable टी में शामिल हो। पंक्ति संख्या पहचान या पीके कॉलम है जो f.RowNumber से मेल खाता है - और किसी भी अन्य आवश्यक परिस्थितियों की शर्तों WHERE t.ModifiedAt & gt; @YourComparisonDateTime  

मैंने बहुत सारी मान्यताओं को यहां बनाया है ताकि आपको रिक्त स्थान को भरना होगा या अतिरिक्त जानकारी प्रदान करनी होगी।

आशा है कि आपकी सहायता करता है।

संपादित करें

  INSTERT # # 2 (रोनेम्बर, वालफ्रमफंक्स, फ़नकाइट, प्रतिशत) का चयन करें f.RowNumber, f.PercentMatch, @constVal, f PercentMatch * @constVal FROM dbo.MatchDate (@Date) एफ आंतरिक प्रवेश रोगियों पी। पर आर। संख्या संख्या = पी। आरओआईडी आंतरिक शामिल परिणाम rs पर आरक्षित rs। Rowid = f.RowNumber WHERE p.ModifiedAt & gt; RsmodifiedAt  

excel - How to delete a special row -


शीट 1 में मेरे पास एक कक्ष A3 (52) है:

शीट 2 में, मैं पंक्ति को हटाना चाहता हूं जहां शीट 1 की A3 की संख्या है। यह संख्या केवल पहले कॉलम में हो सकती है।

स्क्रीनशॉट 2

< P> यहाँ मेरा कोड है, लेकिन यह काम नहीं करता है:

  sub delete_ligne () Dim I as Integer application.ScreenUpdating = I = 1 से 6600 के लिए गलत (कक्ष (i, 1 ) = "" "(" संशोधन ")। रेंज (" बी 7 ") मूल्य) तब सेल्स (i, 1) .EntireRow.Delete i = i - 1 End यदि अगला अनुप्रयोग। स्क्रीन अपडेटिंग = ट्रू एंड सब  

कोई भी समाधान?

अभी भी सुनिश्चित नहीं है कि "यह काम नहीं करता" इसका मतलब है, लेकिन यह मदद कर सकता है:

<पूर्व> उप delete_ligne () मंद रेंग के रूप में रेंज मंद WB कार्यपुस्तिका के रूप में मंद I जैसा पूर्णांक अनुप्रयोग। स्क्रीन अप Ating = False Set WB = 'आपकी कार्यपुस्तिका को परिभाषित करें यहां सेट करें आरएनजी = डब्ल्यूबी। शीट (2) .रेन्ज ("बी: बी")। खोजें (क्या: = WB.Sheet (1) .रेन्ज ("ए 3"), _ LookIn: = xlValues, LookAt: = xlWhole, MatchCase: = False) जबकि नहीं Rng कुछ भी नहीं है। Rows (1)। अंतराल। सेट करें आरएनजी = WB.Sheet (2) .रेंज ("बी: बी")। (क्या: = WB.Sheet (1)। रेंज ("ए 3"), _ लुकइन: = एक्सएलवील्यूज, लुक एट: = एक्सएलहोल्म, मैचसीज़: = फॉल्स) वेंड एप्लीकेशन। स्क्रीनअपडेटिंग = ट्रू एंड सब्

सही स्थानों को इंगित करने के लिए WB , शीट (2) , और शीट (1) को परिभाषित करने के लिए समायोजित करें।

। खोज 6600 पंक्तियों को पाशन की तुलना में काफी तेज हो जाएगा और उसे कोई आदेश नहीं मिल रहा है कि वह पंक्तियां पाती / हटाती है

आप एक बाहरी लूप जोड़ सकते हैं यदि अधिक कोशिकाएं जांचने हैं कि "A3"


angularjs - yeoman and angular on digitalocean doesn't work -


I try to run angular part with Yemen on digitalocean but I get an error

< Img src = "https: //i.stack.imgur.com/nlXj1.png" alt = "male error">

While trying to use the Keystone Generator, I ran on this issue

I was a new user (I was logged in as a root user through a cloud 9 workspace Was) with root privileges and then Number solved this problem by running yo as a new user.


barcode - Save generated bar code image in database and in folder using codeigniter -


I used the library to generate barcodes, but the problem is that I get the generated image How can I save?

Here I am giving my code which I have used:

In the Controller:

 Add  function ($ barcode) { $ PostData ['bar_code'] = $ this- & gt; Set_bar code ($ postData ['bar_code']); } Function set_barcode ($ code) {$ this- & gt; Load-> Library ('zend'); $ This- & gt; Zend-> Load ('Zend / Barcode'); $ Bar_code = Zend_Barcode :: Render ('code128', 'image', array ('text' = & gt; $ code), array ('imageType' =>> 'jpg')) - & gt; Draw (); Return $ bar_code; }  

How can I save the image of the generated bar code?

Help as a son as possible.

Thank you!

I found the solution :

  Function set_barcode ($ code) {$ this- & gt; Load-> Library ('zend'); $ This- & gt; Zend-> Load ('Zend / Barcode'); $ File = Zend_Barcode :: Draw ('code128', 'image', array ('text' = & gt; $ code), array ()); $ Code = Time () $ Code; $ Store_image = imagepng ($ file, "../ barcode / {$ code} .png"); $ Code back. '. Png '; }  

Store the image using the imgepng function.
It will store bar code image in bar code folder.


How to get subject from gmail and put into a google doc or spreadsheet -


I am trying to automatically remove subject line in Google Doc or spreadsheet. I found a basic example but did not know how it worked.

  Get all threads in the function process inbox () {// inbox word threads = GmailApp.getInboxThreads (); (Var i = 0; i & lt; threads.length; i ++) {// Receive all messages in a given thread var message = thread [i] .getMessages (); // Repeat every message for (var j = 0; j & lt; messages.length; j ++) {// log message subject to Logger.log (message [j] .getSubject ()); }}}}  

this is javascript, java is not script above, your Collects all the messages in a list, which is the right move, but it will not be written in the sheet.

After that you have to add an extra function to write it out. If you are in a spreadsheet, then you can use something like that. I have modified the above function so that the subjects are inserted into the array instead of logging in to the console, and return it to that array.

  function process inbox () {var threads = GmailApp.getInboxThreads (); Var topics = [[]]; (Var i = 0; i & lt; threads.length; i ++) {var message = thread [i] .getMessages (); (Var j = 0; j & lt; messages.length; j ++) {topics [j] = [message [j] .getSubject ()]; }} Return topics; } Write the function autosibix () {var ss = SpreadsheetApp.getActiveSpreadsheet (); Var letter = ss.getSheets () [0]; Var topics = process inbox (); Var rang = sheet.getRange (1,1, subject length, 1); Range.setValues ​​(topics); };  

r - What is the meaning of the "local data frame" message from `dplyr:::print.tbl_df`? -


dplyr का उपयोग करते समय, tbl_df फ़ंक्शन एक बयान कहता है डेटा फ्रेम "स्थानीय" है:

  & gt; Mtcars% & gt;% + group_by (गियर) स्रोत: स्थानीय डेटा फ्रेम [32 x 11] समूह: गियर एमजीजी सिल ... 1 21.0 6 ...  

मैंने सोचा कि एक स्थानीय डेटा फ्रेम का अर्थ स्मृति में था, और गैर-स्थानीय डेटा फ्रेम एसक्यूएल जैसी एक डेटाबेस था। मुझे लगता है कि मैं उस धारणा में गलत हूं, यद्यपि। इस बारे में लगभग 25:25, केविन मार्कम कहते हैं कि data.frame ऑब्जेक्ट्स स्थानीय डेटा फ्रेम नहीं हैं, जो मुझे विश्वास था कि वे थे।

मैंने tbl_df दस्तावेज़ीकरण और एक खोज फ़ंक्शन का इस्तेमाल करते हैं, लेकिन स्थानीय डेटा फ्रेम का विवरण नहीं मिल सकता है।

प्रश्न: क्या है एक स्थानीय डेटा फ्रेम?

मैं उल्लेख के लेखक हूँ सवाल में इस चर्चा से संबंधित कार्यों का सारांश यहां दिया गया है:

  • डेटा.frame () नियमित डेटा फ़्रेम बनाने के लिए आर फ़ंक्शन है। <
  • डेटा_फ्रेम () स्थानीय डेटा फ़्रेम बनाने के लिए dplyr का फ़ंक्शन है।
  • tbl_df () और स्थानीय डेटा फ़्रेम में नियमित डेटा फ़्रेम (या एक सूची) को परिवर्तित करने के लिए as_data_frame () है dplyr के फ़ंक्शन।
  • तो, नियमित और स्थानीय डेटा फ्रेम के बीच अंतर क्या है? बहुत कम। एक स्थानीय डेटा फ़्रेम, सिर्फ एक नियमित डेटा फ्रेम है, जो कि अच्छे मुद्रण के लिए tbl_df वर्ग के साथ लपेटा गया है। (डेटा अब भी हुड के तहत एक नियमित डेटा फ्रेम में संग्रहीत है।)

    विशेष रूप से, स्थानीय डेटा फ्रेम को छपाई केवल पहले दिखाता है 10 पंक्तियां, और कई कॉलम जैसे आपकी स्क्रीन पर फिट हो सकते हैं। (आप मेरे ऊपर से जुड़े ट्यूटोरियल से पहले इस व्यवहार के एक उदाहरण को देख सकते हैं)

    सभी dplyr फ़ंक्शंस डिफ़ॉल्ट रूप से एक स्थानीय डेटा फ़्रेम लौटाते हैं, यद्यपि आप इसे data.frame () फ़ंक्शन का उपयोग करके एक नियमित डेटा फ्रेम में वापस परिवर्तित कर सकते हैं। ऐसा करने का एक कारण यह है कि यदि आप नियमित डेटा फ्रेम प्रिंट करते हैं, तो आप अधिक पंक्तियां या अधिक कॉलम देखना चाहते हैं हालांकि, dplyr आपको इसे परिवर्तित किए बिना ऐसा करने की अनुमति देता है:

      लाइब्रेरी (dplyr) लाइब्रेरी (nycflights13) # एक स्थानीय डेटा फ्रेम (10 पंक्तियों, कॉलम की चर संख्या) प्रिंट करें # प्रिंट 15 पंक्तियाँ प्रिंट (उड़ानें, एन = 15) # सभी पंक्तियों को प्रिंट करें (इसे चलाने न दें, क्योंकि इसमें 336,776 पंक्तियां हैं) प्रिंट (उड़ानें, एन = आईपी) # सभी कॉलम प्रिंट (उड़ानें, चौड़ाई = आईपी) प्रिंट करें  < / प्री> 

    डीप्टर के बारे में एक डेटा फ्रेम है जो अधिक तकनीकी विवरण प्रदान करता है।


html - Bradley Hand ITCBold font is not displaying in mozilla and chrome -


I am facing the problem of brandly handwritten fonts, its Safari is right in Safari, The problem is code here called Mozilla and Chrome.

  @ font-face {font-family: "BradleyHandITCBold"; Src: url (BradleyHandTTCBold.T.TF); } .newfont {font-family: 'BradleyHandITCBold'; }   

Solution: Mozilla and Chrome have only one problem because of its modern browser and TTF font Does not support, so TTF needs to be converted to WOFF or WOFF2. I have converted it to WOFF converter using TTF and it's working perfectly. Here is the code resolved.

  @ font-face {font-family: 'BradleyHandITCBold'; Src: url ("css / BradleyHandITCBold.ttf") format ('truetype'); Src: url ("css / BradleyHandITCBold.woff") format ('woff'); } .newfont {font-family: 'BradleyHandITCBold'! Important; Font-size: 31px; }  

I am posting here to help other developers in the future. Thank you for your comment @ t.niese


android - How to use the bitmap generated by ThumbnailUtils.createVideoThumbnail? -


I think thumbnailValue.SentVideo will generate a thumbnail of the video. But the result of the process is how to use the bitmap file? Should I add another image view to keep the thumbnail bitmap? The video VIT does not seem capable of displaying a bitmap.

Yes, you have to use the imageview, on which you set the thumbnail length. Bitmap set generated from Sent Video. will do. Video view generated will not be able to display the bitmap.


How do you Allow the user to search for a date in a database, showing them all relevant information c# -


I want to find a specific date (using text box) and allow the database to show them all I have already compiled the information I entered in that date, shown below:

  selected date ([test result]), [user / test] from WHERE Date '%' + @value + '%' / Code>  

I have used the data grid view on a phone so that the sub To see a blind search, a cover box and a search button have been added and I have used the code given below this button:

  this.user_TestTableAdapter.search (this. QuestionareDataSet1._User_Test, textBox1.Text);  

The error I get is that a word with a date can not be compared, which I understand. Do I need to convert the search date to string?

Thank you.

Compose the date on the input field in the format "secure" (jQuery for websites See date in the blink method).

  var selectedDate = Convert.ToDateTime (txtInputDate.Value); Var sql = "SELECT * FROM from table to WHERE date field" "+ selectedDate.ToString (" yyyy-MM-dd ") +" 'and now (); ";  

You can also do such things ...

  var dateAddDaysValue = 2; ("Yyyy-MM-dd") + "'and" "+ Selected date. AddDays (dateAddDaysValue). Ostring (" yyyy-MM-dd ") + "';';  

Cheerio!

Edit: You should know that this method of building SQL queries is very low for injection. Make sure you are hybriding your questions properly.


c++ - Dynamic taskbar icon depends on configuration of taskbar? -


I have implemented the possibility of loading custom taskbar icons during the runtime (according to).

I now saw a strange behavior: the new taskbar icon is set correctly, but Windows 7 still shows the old (original) mark when "Taskbar Button" is always in the properties of "taskbar buttons" , Hide label "is configured for. On choosing one of the other options to display a custom icon.

So: What is the idea of ​​this or how does the problem of THS overcome? I want to show the custom icon in all configurations of the taskbar.

Thank you!


php - bcrypt returning wrong calulation -


I'm new to bcrypt This is my test code that Hahed password

  if (! $ ErrName & amp ;;! $ ErrE required mail & amp ;; $ errPassword) { "lib / password. php"; $ Hash = password_hash ($ password, PASSWORD_BCRYPT); // password_compat function if (password_verify ($ password, $ hash)) {$ result = "$ name \ n $ hash \ n $ email"; } Else {echo "did not work"; }}  

When I validate it does have the example does not match the password '1234' $ 2y $ 10 $ Wz / 1MRBMFauEtGdJNeaKq.5INBmig0Nip2urekRON8ekLkYesdj6i and when I daily validate it do I get invalid salt modification

the problem is that PHP library's new "2y" prefix uses a bug in

use this and some other libraries as "2a" native code with prefixes and old There was a need to separate the new, secure code.

Replace 2A with just 2 A


gruntjs - grunt sass sourcemaps sass wrong path? -


I have a raucous project, but I am not remembering the sarotap for sass Style.css.map like this Looks:

  {"version": 3, "file": "style.css", "source": ["../style.scss", "..//general. scss "," ../_align.scss "," ../_cf.scss "," ../_fixed-fluid.scss "]," sourcesContent ": []," mapping ":" ACAA; EACI, AAAQ ; Aar, AAAS ;; Agb; EC, came ;; Agb; EC, came ;; Agnb, EC, come; Aad, come, tap, AAAS, VAT, AAAS, VAT, Aak; Iakr came; Iaz come; Iav, Azam, are, come, tap, Aak ;; Aihb; EC, AAAS ;; Ak3Bb; ease, come; Ykw, Aak; Aar, came ;; Agd; ease, come; Ykw, Aak, Aal, Azam; Aan , suggests ;; Aib; EC, AAAS; Aekt come; App came ;; Agb; EC, AAAS; Aekt came; Aaz, Aagb; Aacb, Aak ;; Aiz, EC, come; Aaz, Aak, etc. Come, gashes; Aaf, Aagb; Iakr, AAAS, VAT, AAAS, VAT, Aak; Iakr, Aagb ;; Aikb; EC, AAAS; Aekt, Aagb ;; Ak3CpB, Aag; AX, AAAS; Aekt, AAAS ;; Acfb ; EACI, AAAO; EACP, AAAO; EACP, AAAY ;; AAGhB; EACI, AAAO; EACP, AAAO ;; AAIX; EACI, AAAO; EACP, AAAY; EACZ, AAAO; EACP, AAAC "": []  

}

The 'source' path is incorrect. Instead of "../ style.scss" Strong> / sass must be /style.scss

Grunt project file:

  module.exports = function (pebbles) {Required ('jit- Grunt.initConfig ({pkg: grunt.file.readJSON ('package.json'), connect: {server: {option: {port: 9000, livereload: true, keepalive: true open: True, hostname: 'local host'}}, saas: {option: {sourceMap: true, sourceMapEmbed: true}, district: {files: {'district / style.css':' property / saas / style Scss '}, outputStyle:' ws Doors '}}, autoprefixer: {single_file: {src:' dis / Stylekcss '}} Watch: {options: {eggs: false, Livereload: true} mother: {files :. [' property / ['Sass', 'autoprefixer']}, html: {files: [index.html, 'views / *. Html]],}, JS: {files: [' Assets / js / * .js']}},});};  

How does one configure this source path correctly in my granut file? Thanks! The source map has been working hard for some time because version v.18.0 (node- Sass v2) I feel like I'm slowly awaiting a downstream change from libsass> node-sass to make my way to suffocation. Node sass v3 should fix these issues.

I recommend coming back to version v0.17.0 so that many source maps work again


Ember.js: Which one should I choose between Namespace, Service, and Util? -


I am currently working on the Amber CLI application. Now checking the strategy of implementing certification.

Now, I am planning to create Auth.js, which will maintain the login status and take action.

For example, they are using "namespace", but have put it in the UILLL folder.

I also feel like an amber. The service is suitable for putting Auth.js.

It seems that both namespace and service are the nicknames for amber objects.

What kind of rules should I apply?

I actually answered the same question. Long story short: Do not waste your time and usage, you'll save working hours :) It is a very flexible library that can handle different authentication / authorization mechanisms in parallel and separate tabs of the browser.

Otherwise, amber services are the way to go!


matrix - How to build a termdocumentmatrix in R -


I was wondering if it is possible to create a term download matrix without using the package TM.

I was thinking about using two loops in combination with a grep, but unfortunately I did not manage to make some useful.

  Matrix & lt; - Matrix (, nrow = (in length (leverster), = ncol = length (levector)) (i in 1: length) (for in j: 1: length (l)) {lijst & lt; - [grep (lvector [i], l [J]] (length (lists) == 0) {matrix [i, j] == 0} and {matrix [i, j] == 1}}}  

thx in advance

FWW, here's a way:

  get.dtm & lt; - function (txts) {require (plyr) dtm & lt; - do.call (rbind.fill.matrix, lapply (txts, function (txt) t (table (Scan (file = text connection (txt), what = "character", quiet = True))))) dtm [is.na (dtm)] <0 - Return (dtm)} get.dtm (c ("This is a text lesson", "this is just another text")) # This is the second lesson # [1,] 1 1 2 1 0 0 # [2,] 0 1 1 1 1  

Template Classes and methods in C++ -


I am using C # for almost a year, I try to go to C ++ in Visual Studio I am here. Anyways, I am trying to create a normal binary tree in C ++ and run some compilation errors that I can not seem to fix.

The initial research class indicated the template to be placed in the header file, however

some advice would be greatly appreciated with some other advice.

Thanks

Here's the code.

  #include "stdafx.h" using namespace std; Int _tmain (int argc, _TCHAR * argv []) {tree_node & lt; Int & gt; IntTree (1, tree_node & lt; int & gt; (1), tree_node & lt; int & gt; (2)); Cout & lt; & Lt; IntTree.toString () & lt; & Lt; Endl; Return 0; } Template & lt; Class TData & gt; Class triode {Private: Teadata data; TreeNode & LT; TData & gt; & Amp; Left; TreeNode & LT; TData & gt; & Amp; right; Zero set data (tudata data) {data = data; } Public: TriNode & lt; TData & gt; (Tudata data) {set data (data); } Treeode & lt; TData & gt; (Tudata data, Triode & lt; TData & gt; Left node, Triode & lt; tidata & gt; Correct node) {Setdata (data); SetLeft (leftNode); SetRight (rightNode); } Zero set lift (TreeNode  and left node) {Left = leftNode; } Zero setwrite (treenode  & amp; rightNode) {right = rightNode; } Treeode & lt; TDTDa & gt; & Amp; GetLeft () {Return Left; } Treeode & lt; TDTDa & gt; & Amp; GetRight () {Return correct; } TDITA & amp; GetData () {Return and Data; } String to string () {return left-> ToString () + Data + Right-> ToString (); }}; Error C2228: '.toString' should be left cell / straight / union Error C2065: 'Triode': Undeclared identifier error C2065: 'IntTree': Undeclared identifier error C2062: type 'int' unexpected  
Post-text "itemprop =" text ">

At the point of use in your _tmain () TreeNode & lt; & Gt; has not been announced yet.

You must include the full template class announcement / definition before _tmain () , or better than that by adding it to a different header file.


c# - Send email using smtp -


I am trying to send emails outside of my domain network. I have done this within my company domain for months without any problem. Now I am trying to make customer email process easier by using code system.net.mail

  string recipient = "nobody@gmail.com"; String = "donutrayplay_modmen.com"; Mail message mail = new mailmax (from, recipient); Mail.Subject = "Your ..." Mail. Body = message; Mail.IsBodyHtml = True; SmtpClient Client = New SmtpClient ("mydomainip"); Client.port = 25; Client.UseDefaultCredentials = True; Client.Send (mail);  

I added this to the web config:

  & lt; System.net & gt; & Lt; MailSettings & gt; & Lt; Smtp delivery method = "network" & gt; & Lt; Network host = "maidomimep" port = "25" default credentials = "true" /> & Lt; / Smtp & gt; & Lt; / MailSettings & gt;  

Then I setup the IIS as a credential with domain IP in the host and windows. I am able to send emails while debugging on my computer, but once I publish the application in IIS, no email is coming, the application does not put any error and I received the message sent to me (I It is set in your application). Please note: We provide security for the web. Do not want to write server's credentials in config. Thanks


android - OnItemClickListener with multiple viewType in adapter -


I have an adapter that has several view types defined like

  public class ListAdapter BaseAdapter {... @ Override Public Entry Typecount () {Return 2; } @ Override Public Intuit item VU Type (int i) {return (boole ())? 1: 0); } @ Override Public View getView (int i, View View, ViewGroup ViewGroup) {int type = getItemViewType (i); If (type == 1) {return view type (R.layout.list_item_ads_alert, i, see, view group); } And {return view type (R.lit.list_itemads, i, see, view group); }}}  

Then in my pieces I intimate it and set it in the list, plus I add an item listener to it

  ListAdapter adapter = new ListAdapter (); ListView.setAdapter (adapter); ListView.setOnItemClickListener (New AdapterView.OnItemClickListener) {@Override Public Zero onItemClick (AdapterView & LT;? & Gt; AdapterView, View View, J., Long L) {Log.d ("Application", "Push Item" + I);}});  

The problem is that when I click on an item of another type of type is not called My ItemClickListener, but it works for the first viewing type

< P> Do you know if there is a specific way to itemclick for this matter? Of course I can add an onClick to the second type of type, but it does not look correct (code separation)

< P> If your 2 scene types are a checkbox or a button, then that widget is stealing the focus from the generator view, and no permission to click the parent view. In order to prevent your occurrence of your 2 visual type in its root layout, you should keep

  android: descendantFocusability = "blocksDescendants"  

The idea of ​​parents is not able to steal the focus.


javascript - Add item to Value service in AngularJS -


मेरे पास निम्न है:

  .value ('objs', {item1: ' कुछ आइटम ', आइटम 2:' अन्य आइटम '});  

और मैं इस पर आइटम जोड़ना चाहता हूं। इसलिए मैंने इसके लिए एक नियंत्रक बनाया:

  .controller ('myCtrl', फ़ंक्शन ($ scope, objs) {$ scope.addToObjs = फ़ंक्शन (i) {objs.push (i); } $ Scope.addToObjs ({आइटम 3: 'और दूसरी वस्तु'});});  

क्या यह संभव नहीं है?

आप किसी ऑब्जेक्ट पर पुश को कॉल करने का प्रयास कर रहे हैं। ऐसा करने का प्रयास करें:

<पूर्व> $ scope.addToObjs = फ़ंक्शन (i) {angular.extend (objs, i); }

javascript - Can users upload files directly to Google Cloud Storage without authentication? -


I am just setting up a simple JS photo uploader on my site. This photo uploads directly to the Google Cloud Storage bucket.

I used the code from my official

but if you see that code, you will see that it requires authentication. I am certified and able to upload photos. , But I want everyone to upload their files without signing in to their Google accounts.

Is this possible?

You can use a POST policy doctor:

A signed request will be allowed to create a signed request with different constraints in content-lamban, content-size, etc.), which allows unauthorized users to upload in your bucket with the given obstacles.


localhost - php on local machine not behaving what am I overlooking? -


So php is not providing a page at all on the local machine, what am I seeing?

The information is expected .php output only with the following code test.php is always waiting for the local host

   

By waiting forever, I mean the status of the browser: "Waiting for localhost"

Can anyone turn on the light?

Files are not showing because I have to show it once and before the server is restarted After the file is edited and re-saved. This is released by restarting Apache!


linux - TCP acks are paused, then resumed, then paused again. Why? -


Note: This has been moved to the question.

I like to help find something in my application due to low data transfer rate.

I have 12 embedded systems and a Linux server. I embedded system send data to server on TCP over Ethernet link through a switch. The following is a TCP stream graph which is made of wirehark capture from traffic from a board.

TCP streamgraph

As you can see, data The transfer takes approximately 5.8 mbit / s to about 0.25 seconds. It's as fast as I can expect that the embedded system should go. After this, the transfer is delayed showing the closeup of the following article:

zoomed streamgraph

A ladder-shaped curve below the ACK label shows how much data has been done by the server at any time. The RWIN with the respective curve label shows how much space will be in buffers on DATPC. Sent small vertical segment actual packets are sent.

At point A, the server sends the data as quickly as it is sent to, but again no accence is sent by the server for a period of 23ms. The embedded system is allowed to send up to RWIN without waiting for ACK, but it does not do this because it needs to keep data sent around a solid (as long as they need to be revised) and send buffer space limited .

Then, on point B, all the data received are ACCD once and sends the resume for the normal escoding and 2.5ms before another break.

WAHARC Capture was made from a separate PC which was connected to a port on the switch that all the data was shown and the embedded system on which it was connected was received on the port.

The Linux server runs a Java application that stores data and disk on them. It does not show any signs of maximizing the CPU. The operating system is with Ubuntu Server 12.04 default network settings.

I can see that I can get the benefit of sending more buffer space in the embedded system to match the amount of window space received in the Linux server, but it does not seem to be a limiting factor.

My questions are:

  1. The reason for stopping the Linux server can be ACK though it clearly receives everything properly Is able to?
  2. How can I go about debugging it?


orm - Entity Framework: Doing JOINs without having to creating Entities -


Just starting with the unit framework (code first), and let me say that when I load it Problems are happening in SQL data which is quite complex. For example, suppose I have the following tables which stores which animals are in the category of animals and animals in the world. Name: string field id: integer - back refers to field table animal id integer AnimalCategoryId integer - refers back to AnimalCategory

Suppose that I want to create a query with the unit framework The most simple thing is that a specific area will load all the animals, using LINQ to create 3 unit areas, animal category, and animal and to load data.

But we say that I am not interested in loading any AnimalCategory information and only define the entity class to represent AnimalCategory so that I can JOIN. How can I do this with the unit framework? Even with its many mapping functions I do not even think that this is possible.

In non-entity framework solutions, it's easy using INNER Jones in SP or Inline SQL, so what are my options in the unit framework? Will I pollute my data model with these useless tables, so that I can include one?

This is a matter of choice I think EF with multiple junctions of transparent junction tables Selects to support, i.e. where affiliate tables are only two foreign key in the affiliates.

And I can imagine why.

To get started in several organizations, the junction table is nothing: a junction, a union. However, in a series of multiple-to-many (or several-to-one) associations, for any table that contains it, it will be extraordinary to be just a union in your example ...

  Animal → AnimalCategory → Area  

... AnimalCategory will only enter a primary key ( Id ) And a foreign key ( RegionId ). It would be useless though: Animal can also be a regional there is no reason to support a data model that does not make sense.

What you are doing later, this is a model in which the table takes the information ( AnimalCategory.Name ), but where you have it in the form of a transparent junction table You want to map, because the model of a particular class does not need this information.

Your attention is on reading the data but EF has to support all CRUD functions. Here the problem will be how to handle the inserts? Assume that name is a required field.

Another problem would be that a statement like ...

  area. Unimple Add (animal);  

... two things can mean:

  1. a animal and new Animal category , later references the area .
  2. An existing AnimalCategory - without being able to choose any one

EF does not want to select for some default behavior, you have to make your choice, so you can not do without access to AnimalCategory .


linux - How can I set up the time to run in Python Script -


I'm trying to run my dragon script to run at specific times.

For example, I do not want to run it from 12 a.m. to 3 p.m. So it will run from 3 AM to 11 PM and sleep for 3 hours and will be gone again after 3 AM.

I do not want to kill PID, if it runs till 12 o'clock then I want it.

  is correct while ending curr_time = 'date + "% H% and sleep between times between 12 and 3 o'clock.  M $ s" ` [$ Curr_time -ge 235000 -a $ curr_time -l 030000] Going for 12000 gold then go before 12:00 to check the time so that it can be stopped before 12. Sleep for less than 3 hours because it breaks 3:00; Fired  

But the main question is. I can not think of a way to do this in dragon. Also, is there a way to wake up automatically to sleep until 3:00? How long should I sleep? Ideally you should use an existing scheduler, but if you want to sleep on your own, then

The module makes it quite straightforward:

  while importing the date time 1: now = datetime.datetime.now () if now. Be & lt; 3: at_3 = datetime.datetime.combine (datetime.date.today (), datetime.time (3)) to_sleep = (at_3 - now) .seconds time.sleep (to_sleep) # work ...  

Leaflet adding an offset to marker -


I'm getting the center of the center of a book to show its label

Then, Specifying an offset while offing, from where it appears the upper and the Writer.

The thing is that I need to add offset to entryJSON.getBounds (). GetCenter () code.

Is there a way to add offsets in a booklet of the lathete object? (I can imagine something like entering JSON.getBounds (). GetCenter () Offset ([-10, -57]) but it does not work ...)

  Var marker = new l. Marker (Antision JSON Jettbonds) GetCenter (), {Opacity: 0.01}); Marker.bindLabel ('Whatever', {noHide: true, className: "info", offsets: [-10, -57]});  

Labels work with offset property pixels, a l.lat << Code> Works with objects, pixels are not what you can do using the L.Map conversion methods and change your current coordinate position to pixel position, change it And then convert back to:

  var latLng = L.latLng ([0,0]), var point = map.latLngToContainerPoint (latLng); Var newPoint = L.point ([point.x - 10, dot.ae-57]); Var newLatLng = map.containerPointToLatLng (new point);  

Example:

Reference:


python - Compute "distance matrix" -


I will try to use a simple example that I am after.

  aGrid = Np.arange (1,9) bGrid = np.arange (101, 109, 0.5) a, b = np. Mesegrid (Agrid, BGRID, Indexing = 'IJ') N.P.Ramand.Sed (66) Valid = NP .random.choice ([True, False], Ashp)  

The form of matrix I think about the valid which determines whether you "grid point (a, b) or not. If you do not have permission to stay there, then you b will have to proceed further: you need to move to the left (with

I try to create this transition matrix Staying: For each item in this valid matrix, this "travel distance" determines that you need to reach the next true item. In the example, I have set the travel distance continuously with 0.5 B amplitude. If you have already created a < Code> true , your distance is 0 .

For the given seed it is valid

  array ([[[wrong, true, true, true, true, true, false, true, true, true, wrong, false, True, false, true], [true is true, true, true, false, true, false, true, true, true, true, true, false, true, false] [ True, false, false, false, true, true, true, false, false, true, false] true, true, false, false, true, false, false, false, true, False, false, false, true, false, false, true, false] true, true, true, true, true, true, false, true, False, false, false, false, false, false, true, false, false, true, true, false, true, false, true, false, false, false, false, true, false, false, True, false, true, false, true, true, false, false, true, false, true, false, true], [false, true, false, false, true, false, true, false, true, false, false , False, true, false, false]],  

some expected output

for the very first element, we can find the value of true In the left part Can not take more - default should be np.NaN . For the next 5 elements with the first line, the distance is 0 : they are already in valid places infection [0, 6] = 0.5 : it is left to an element left Need to move on.

Then, the first two rows

  array ([[NN, 0, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.5, 0, 0.5],  

I was trying to use a combination of np.argmax and the np.argmax is the "largest element which is true , But smaller than x , for each x , while every element is x in valid . < Strong> it is highly inefficient. What would be a better way to reach it?

Perhaps this is one of the vector Apart from this, besides, I can not rely on the homogeneity of 0.5 as given in this example. The approach requires calculating the distance between the current cell and Next legal entity by using (or b ).

It seems that this is the trick:

  transition = np.array (valid, dtype = float) for category i (valid. Size [0]): For the category J (valid. [1]): Infection [i, j] = 0 if valid [i, j] second infection [i, j-1] + bgrid [j] - BGrid [J-1] if j> 0 other np.NAN  

properties - Spring Property place holder: reading value from external property file fails -


I'm trying to read Logpath external property file.

I have under spring configuration. I am using Spring 2, Maven.

Beans-Config.xml

  & lt; Bean id = "Loglakeshn" class = "org.springframework.beans.factory.config .PropertyPlaceholderConfigurer" & gt; & Lt; Property Name = "Location" & gt; & Lt; Price & gt; File: ///d: /logpath.properties< / Pricing & gt; & Lt; / Property & gt;  

Logpathkproprtijh

  Logpath = D: / log / log Mayprojekt >  

Log4jkproprtij Log4jkrutloger = Info, file Log4j. appender.file = org.apache.log4j.RollingFileAppender log4j.appender.file.file = $ {Logpath} log4j.appender.file.MaxFileSize = 10MB log4j.appender.file.MaxBackupIndex = 10 log4j.appender.file.layout = Org .apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern =% d {yyyy-MM-dd HH: mm: ss}% -5p% c {1}:% l -% m% n

I do not know how to log path logpath.property file Lodge 4 Jekprop to $ 4 Placeholder to send to $ {logpath} Am I missing anything in the Beans Configuration XML? Any Help


java - Redirect whole page from imported JSP -


मेरे दो jsp हैं, हम कहते हैं ए.जे.ए.स्प और B.jsp एजेस्प में निम्न कोड है:

  & lt; c: import url = "B.jsp" & gt; & Lt; c: परम नाम = "पृष्ठ_ शीर्षक" मान = "शीर्षक" / & gt; & Lt; / c: आयात & gt;  

में B.jsp मुझे कुछ शर्तों की जांच करने और Login.jsp के पुनर्निर्देशन करना होगा। मैं response.sendRedirect (Logn.jsp)

करने से यह प्राप्त करता है कि समस्या यह है कि बी.एस.एस.पी. पर रीडायरेक्शन किया जाता है तो परिणाम है कि ब्राउज़र लॉग इन। Jsp और ए.जे.ए.स्प की सामग्री को प्रदर्शित करता है, लेकिन मुझे पूरे पेज को Login.jsp पर रीडायरेक्ट करने की आवश्यकता है। यही है, ब्राउज़र को केवल लॉग इन। Jsp ही दिखाना चाहिए।

विचार करें कि B.jsp पर रीडायरेक्शन किया जाना चाहिए, जब तक कि कोई तरीका नहीं बी.एस.एस.स्प यूआरएल को रीडायरेक्ट कर सकते हैं।

संपादित करें: ए.एस.एस. और B.jsp विभिन्न परियोजनाओं से संबंधित है

अपने में अनुरोध के रूप में

Pre> & lt; c: set var = "login" value = "true" scope = "request" / & gt;

फिर ए.जे.एस्प में ध्वज जांचें और यदि मौजूद है तो रीडायरेक्ट करें

  & lt; C: यदि test = "$ {login == 'true'}" & gt; & Lt; c: पुनर्स्थापना url = "/ login.jsp" / & gt; & Lt; / c: यदि & gt;  

इसके बजाय एक jsp: include करने की कोशिश करें।

  & lt; jsp: include page = "B.jsp "& Gt; & Lt; jsp: परम नाम = "पृष्ठ_ शीर्षक" मान = "शीर्षक" / & gt; & Lt; / jsp: शामिल & gt;  

.net - Remote query Windows Server 2008 for locked files -


OK, I have a problem that is getting bothered: We have a PDF file on a server that is regularly multiple Users are seen, but it is also quite regularly updated by a single user. The user who edits reads the file only after editing, but when other users open the file, the server still locks it.

I can log in from remote server and find out that the file is Administrative Tools -> Computer Management (Connect to another computer) -> System Tools -> Shared Folders -> Open Files.

The process of PDF editing is done on the intranet site created on MIVC, running on IIS, I would like to be able to tell the user who has edited that file, which has locked the file so that they call them / IM and ask to close it, and therefore stop the bug all times at our administrator.

I should guess that someone should probably manage the computer MGT interface, but does anyone know how can I get this list recovered in .net?

I got the answer, openfiles.exe gives it at the command prompt.

How it can be implemented in nanet


c++ - CRTP and Boost TTI -


I tested the following code with GCC 4.9.0 and it is expected to be 3.5.15. The program outputs the 'true' in the expected form. However, if I remove the comment in front of the enum then it changes to 'wrong' what's happening here? How can I ensure that has_mem boolean is set to true My final goal is to have a member function in straight A, which is enabled by enabling if only then Class T has a fixed member function .

  #include & lt; Iostream & gt; #include & lt; Boost / tti / has_member_function.hpp & gt; BOOST_TTI_HAS_MEMBER_FUNCTION (func) template & lt; Class T & gt; Structure A {// enum: bool {has_mem = has_member_function_func & lt; T, Zero, Promotion :: Emple :: Vector & lt; Const T & amp; & Gt; & Gt;: value}; A () {std :: cout & lt; & Lt; Std :: boolalpha & lt; & Lt; Has_member_function_func & lt; T, Zero, Promotion :: Emple :: Vector & lt; Constant & amp; & Gt; & Gt;: value & lt; & Lt; "\ N"; }}; Structure B: Public A & LT; B & gt; {Zero Funk (const B & amp;) {}}; Int main () {B b; }  

I came to know that the following problem resolves my problem.

  #include & lt; Iostream & gt; Struct empty_ {}; Template & lt; Class derT> Structure A {A (DRT * PTR): M_PTR (PTR) {} // template & lt; Class T = empty_ & gt; Zero func () {m_ptr-> F (); } Private: derT * m_ptr; }; Structure B: Public A & LT; B & gt; {B (): A & lt; B & gt; (This) {} void f () {std :: cout & lt; & Lt; B: f: \ n ";}}; Structure C: Public A and LT; C & gt; {C:: A & lt; c & gt; (this) {} zero (g) () {std :: cout & lt; & lt; "c :: g \ n";}}; int main () {b b; cc; b.func (); cg (); // does not compile (as That is meaningless) because there is no function in cell C f () //c.func ();}  

This works because function function is a template function, such as sfinee Takes care of the efficiency of the competent_i fi.


c# - Caliburn Micro publish / subscribe -


I am working through the following tutorials and I am currently stuck in the published / subscription part.

I have everything set up, so it should actually publish the events, but the message of subscribing does not get the message.

I have done the following:

Publishing View Model:

  [Export (typical (colorful visual model)) Public class color vivo model: Property Of course {Private Readonly Event Aggregator Agents; [Importer resource] public color visual model (event aggregator events) {this.events = events; } Public Zero Red () {this.events.PublishOnUIThread (New ColorEvent (New SolidColorBrush (Colors.Red))); } Public zero green () {this.events.PublishOnUIThread (New ColorEvent (New SolidColorBrush (Colors.Green)); } Public Zero Blue () {this.events.PublishOnUIThread (New ColorEvent (New SolidColorBrush (Colors.Blue)); }}  

See subscription:

Am I missing something or why is not I asked after publishing the color avalanche to my handle method?

Thanks in advance

Where is the event aggregator coming from? Is there an example that is shared between AppViewModel and ColorViewModel ?

Is the event aggregator registered as a single or in equal Ninject?


Perl : Decoding Regex -


I highly appreciate if someone can help me understand the following.

  = ~ / (? & Lt;! [\ W.]) ($ Val) (?! [\ W.]) / Gi)  
< P> This is what I picked up, but I can not understand it. / P>

Lookaround: (? = A) for a lookhead, ?! for the negative lookhead, or ? & Lt; No and and to Regex (that is, the string that matches the contents of the variable $ val ) Strong> The word is surrounded by letters or points.

By typing $ val in parentheses, remembering the corresponding matching part in $ 1 .

See for details.

Note that = ~ is not a part of regex, it is a "binding operator".

Similarly, gi) is part of something larger. g means matches are globally , which match on the basis of context , and i matches The case makes insensitive (which could only affect $ val) in the entire expression bracket, perhaps, but we can not see the opening.


ios - Why does this AES128 Decryption take so long on iPhone? -


I am decrypting an image sent from a php server. I use CryptoSwift Library to decrypt the image; Image comes in the form of NSDT, and after decryption I am making a UII from NSDTA.

But decryption takes about 1 minute and 10 seconds, which is very slow. Image data size:

  println (imageData.length) Results: 32592  

I believe this is not a large file? This is the code that I use to decrypt the image data:

  Let AES = AES (key: keydata, iv: ivData, block mode: .cc) decrypted data = AES? .discrypt (encrypted snap, delete: true) image = UIImage (data: decrypted data!)  

I have tried to run this process on different threads, but he has the same Results given when I am decrypting the image, the simulator uses 100% CPU and 21.5 MB RAM.

Any help is appreciated, thanks!

swift 2.0

Encrypting some simple sample code here and decrypting NSData with ECB mode and 128-bit AES key.

Test code

  Let's keystring = "M02cnQ51Ji97vwT4" let's keydata = (keystroke as NSString). Detauting encoding (NSUTF8StringEncoding) as an annotation! Give the message- "Do not try to read this lesson. Top Secret Stuff" data = (give message as NSSTING). Database Encoding as NSDAT (NSUFF 8 string encoding)! If you go to encryptedData = testCrypt (data, keyData: keyData, operation: UInt32 (kCCEncrypt)) print ("encryptedData: \ (encryptedData)") go to decryptedData = testCrypt (encryptedData, KeyData: keyData, operation: UInt32 (kCCDecrypt)) {print ("decryptedData: \ (decryptedData)")}}  

Crypto method:

  func TestCrypt (Data: NSDTa, Key Data: NSDTA, Operation: CCOperation) - & gt; NSData? {Know keyBytes = unsafePointer & lt; UInt8 & gt; (KeyData.bytes) print ("keyLength = \ (keyData.length), keyData = \ (keyData)") go to dataLength = int (data.length) dataBytes = UnsafePointer & LT; UInt8 & gt; (Data.bytes) print ("DataLang = \ (data length), data = \ (data)") cryptdata: NSMutableData! = NSMutableData (length: int (data length) + kCCBlockSizeAES128) cryptPointer = unsafebutter pointer & lt; UInt8 & gt; (CryptData.mutableBytes) cryptLength = size_t (cryptData.length) Let's give two long = size_t (kCCKeySizeAES128) algorithms: CCAlgorithm = UInt32 (kCCAlgorithmAES128) Let's option: CCOptions = UInt32 (kCCOptionECBode + kCCOptionPKCS7Padding) var numBytesEncrypted: size_t = 0 cryptStatus = If the UInt32 (cryptStatus) == UINT32 (kCCSuccess) {cryptData.length = int (numBytesEncrypted) print (CCCrypt (Operation, Algorithm, Options, Kebites, Klemtha, Zero, DataBytes, Datelenda, CryptoPointer, Crypt Long, and amp; numbytesEncrypted) "CryptLength = \ (numBytesEncrypted), cryptData = \ (cryptData)")} else {print ("Error: \ (cryptStatus")} return cryptData; }  

Output:

  Data: & lt; 446f6ec2 b4742074 72792,074 6f207265 61642,074 68,697,320 74,657,874 2e20546f 70,205,365 63,726,574 20,537,475 6666 & gt; KeyLenal = 16, Keydata = & lt; 4d303263 6e513531 4a693937 76775434 & gt; DataLength = 46, data = & lt; 446f6ec2 b4742074 72792074 6f207265 61642074 686 97320 74657874 2e20546f 70205365 63726574 20537475 6666 & gt; CryptLength = 48, cryptData = & lt; 5fd86c65 6544720c 9659b43f 2e77bf8d 9c2373d9 e1042a3d ce9a19f8 2900521e c3f8075a b6866ba5 2fcd5793 bbeb8e0c & gt; EncryptedData: & lt; 5fd86c65 6544720c 9659b43f 2e77bf8d 9c2373d9 e1042a3d ce9a19f8 2900521e c3f8075a b6866ba5 2fcd5793 bbeb8e0c & gt; KeyLenal = 16, Keydata = & lt; 4d303263 6e513531 4a693937 76775434 & gt; DataLength = 48, data = & lt; 5fd86c65 6544720c 965 9B 43F2e77bf8d 9c2373d9 e1042a3d ce9a19f8 2900521e c3f8075a b6866ba5 2fcd5793 bbeb8e0c & gt; CryptLength = 46, cryptData = & lt; 446f6ec2b 4742074 72792074 6f207265 61642074 686 97320 74657874 2 E 20546F 70205365 63726574 20537475 6666 & gt; Decrypted Data: & lt; 446f6ec2b 4742074 72792074 6f207265 61642074 686 97320 74657874 2 E 20546F 70205365 63726574 20537475 6666 & gt;  

php - Merging 2 website pages likes? -


I have a website where I added a buttons button to Facebook. Assume that the website URL is "www.xyz.com"

I have articles in this website, each of which has an ID in the URL such as "www.xyz.com/3/some-text- Here "

See the same content in my website" www.xyz.com "and" www.xyz.com/3/title-here ". My question is how to tell Facebook that these links are the same, if a user likes or shares these web pages, then both pages will get the same likes and shares.

Thank you. /p>

Solution On other pages, the property of data-href is set in a single page References:


java - Android: Getting HTTP 403 Forbidden upon calling https://maps.googleapis.com/maps/api/geocode/xml -


I have developed an Android application since 2012. Since now I have used the free web service API V3 for geocoding without any API key, so that we have a limit of 2,500 requests per IP, not for a key:

Everyone has worked fine for this period when sometimes some soffers of my users error 403 - this web server is prohibited during the call.

Has Google changed something for the use of its web servers?

Eventually, I can use the GeoCoder class of the Android Framework.

But I still have another webservice which I call:

Can this webservice suffer from a 403 error? So far, I do not know if I get a 403 error in the Geocode, then I will not say the instructions as a webservice.

HTTP 403 response

Here's a little There is information that you may want to see ... you can get more information about it.

> Web service requests can also receive HTTP 403 (Prohibited) error In most cases, this is due to an invalid URL signature. To verify it, remove the client and signature parameter and try again:

If the response is HTTP 200 (OK), then there was a signature problem. This usage is not related to the limitations; See Troubleshooting issues in the web service chapter of the Google Docs API for documentation documentation. If the response is still an HTTP 403 (prohibited) error, the signature was not necessarily a problem, it may be related to the limitations of use instead, it mainly means that your access to the web service has been blocked on this basis. It has been said that the limitations of usage in your application are increasing or otherwise the web service has been misused. If you have to face this problem, please contact Google Enterprise Support. Requests for all web services require a URL signature. Requests will be rejected with an HTTP 403 (Prohibited) error, which will include the client parameter, but the signature parameter will not be lost, or vice versa.

Problems

You can limit the use limitations of the Google Maps API web services beyond this limit:

per day Too many requests sending requests are being sent very fast, that means sending too many requests requests per second for a long time or otherwise misusing web services. More than other usage limits, e.g. Per request points in height API

Solution

The above problems can be known by the combination of two methods:

Reduce usage, web services By optimizing applications to use more efficiently, increasing the limitations of usage through purchase of additional allowances for your Google Maps API for work licenses, when possible.

This is a good link that can help just as well.

This article will focus on optimization methods to use web services more efficiently.


CSS: how to make a horizontal images scroller with two images per column? -


मेरे पास एक क्षैतिज छवि स्क्रॉलर है, जैसे:

यह मार्कअप:

  & lt; div class =" slider-horizontal "& gt; & Lt; span ng-repeat = "छवियों में छवि" & gt; & Lt; a href = "#" & gt; & Lt; img ng-src = "{{image}}" / & gt; & Lt; / a & gt; & Lt; / span & gt; & Lt; / div & gt;  

और यह शैली:

  .slider-horizontal {white-space: nowrap; अतिप्रवाह: ऑटो; अतिप्रवाह- y: छिपा हुआ; }  

नहीं, मैं इस तरह से कुछ प्राप्त करने के लिए वर्तमान में से किसी भी नीचे एक माध्यमिक छवि जोड़ना चाहूंगा:

< Img src = "https://i.stack.imgur.com/6A9SH.jpg" alt = "डबल छवियों के साथ स्क्रॉलर">

(एनबी: बिल्कुल और न ही व्यक्तियों और न ही डिस्काउंट लेबल असली हैं छवियां ...: -)

क्या यह संभव है? आप क्या सुझाव देंगे? मैं इसे प्रबंधित नहीं कर सकता, मेरे सारे परीक्षण एक ही पंक्ति में सभी छवियों के साथ समाप्त हो जाते हैं, या सभी एक ही स्तंभ पर ...: - (

@Radnaw टिप्पणी का जवाब: यह मैं जो कोशिश करता हूं:

  & lt; div class = "slider-horizontal" & gt; & lt; span ng-repeat = "चित्रों में छवि" & gt; & lt; a href = "#" & Gt; & lt; img ng-src = "{{image}}" / & gt; & lt; img src = "चित्र / वॉटरमार्क / लेबल पेज" /> & lt; / a & gt; & lt; / span & gt; & lt; / div & gt ;  

(बड़ी सफलता नहीं, जैसा कि मैंने कहा था ...: - ()

संपादित किया गया:

क्या आपने ऐसा कुछ करने का प्रयास किया

  & lt; div class = "slider-horizontal" & gt; & lt; span class = " स्लाइडर-छवि "एनजी-दोहराने =" छवियों में छवि "& gt; & lt; a href =" # "& gt; & lt; img ng-src =" {{image}} "/ & gt; & lt; br & gt; & lt; img src = "Myimg.jpg" / & gt; & lt; / a & gt; & lt; / span & gt; & lt; / div & gt;  

सीएसएस:

  .slider- क्षैतिज {सफेद-स्थान: अब्राप; अतिप्रवाह: ऑटो; अतिप्रवाह-वाई: छिपा हुआ;} .slider-image {फ्लोट: बाएं; मार्जिन-दाएं: 20px; प्रदर्शन: इनलाइन-ब्लॉक; }  

cookies - Which event in Kendo UI Grid, shall i use save the State of Grid -


I want to save the state of the cando grid (paging, columns, groups, filters, etc.).

I want to save state objects in cookies.
What is the event in the Canon UI grid, I will use to save the state grid.

This might probably help after coming into this JBBN in one of the tellerics forums

Personally, I think that you should try to use local storage to stay consistent. The telcic demo shows:


java - Publishing ZIPs to Artifactory from Jersey/JAX-RS Client -


I have a set of necessities / JAX-RS clients, which can be used to publish zip files on prosthetic limbs. staying. Specifically, I have to publish a zip:

It shows that the artificial limb reveals:

  PUT / libs -release-local / my / jar / 1.0 / jar-1.0.jar {"uri": "http: // localhost: 8080 / artifactory / libs-release-local / my / jar / 1.0 / jar- 1.0.jar "," DownloadYourery ":" http: // localhost: 8080 / creative / libs-release-local / my / jar / 1.0 / jar-1.0.jar "," repo ":" Libs-release-local " , "Path": "/my/jar/1.0/jar-1.0.jar", "created": ISO8601 (yyyy-MM-dd'H'H: mm: ss.SSSZ), "created": "userY "," Size "(" Md5 ": string," sha1 ": string}," originalchecksums ": {" md5 ": string," 1024 ", // by "MimeType": "app / java-archive", "checksum" Sha1 ": string}}  

So it seems that the Somelib-1.0.0.zip . My proposal to do this is as follows:

  // Groovy pseudo code for put unit: class publication {@JsonProperty string Yuri @JesenProperty String Download Yuri @Jesonproperty String Repo @JesenProperty String Path @ JsonProperty Date Created The @JesPrintPro String was created @Jesonproperty Integer Size @JesonProperty String MimeType @JesanProperty Map & lt; String, string & gt; Checksum @Jesanproporty map & lt; String, string & gt; However, 2 problems:  

security

A security barrier at the endpoint of a user with 'deployment' permissions Required. I have such users, although I am not sure how to implement this auth on client-side. Artifactory uses the original proof for your ending points? If so, then this work would be something like this (?):

  client client = client.require (); WebResource resources = client.resource (BASE_URI); Client.addFilter (new HTTPBasicAuthFilter ("Deployment", "12345"); // Dummy credentials, clearly  

put unit

most important , I do not understand that PUT unit should be jersey / jx-rs-style using POJOs, I can do something like this:

  // Then, Groovy pseudo code publication = get () // Ideally the zip is read in portable format, the path is webResource.path ("libs-release-local"). Path ("ourorg"). Path ("somelib"). Path ("1.0.0"). Path ("somelib-1.0.0.zip"). Type (mediatype ???) Unit (publication) .put (???)  

However, I still do not know how to send the actual ZIP file. There is a path field, which specifies the local (client-side) path to binary, but this is only a string / reference, not to publish the actual binary!

Also, according to Wikipedia, Zip Media Type is app \ zip , but there is no such definition in JX-RS.

Any ideas here?

Basic is the good unit again, you do not need any docs in the JSON you see That is the result of the PUT call.


opengl - What's the meaning of the indirect cmd used in glMultiDrawElementsIndirect -


I'm confused about using glMultiDrawElementsInirect (), did anyone know me about cmd struct used by that drawing command Can you explain the meaning of?

Structure CMD:

  count = .. primcount = .. firstIndex = .. baseVertex = .. baseInstance = ..  

If I have three different triangle strips, will it happen?

(int n = 0; n & lt; 3; n ++) {count = indexCount; Primcount = 1; First index = n * count; BaseVertex = 0; BaseInstance = n; ...}

Setup Buffers:

  Protected Zero Setup Buffers () {gl.glGenVertexArrays (1, Voobf); Gl.glBindVertexArray (vaoBuff.get (0)); Gl.glGenBuffers (5, vboBuff); // bound indirect buffer object gl.glBindBuffer (GL4.GL_DRAW_INDIRECT_BUFFER, vboBuff.get (0)); Gl.glBufferData (GL4.GL_DRAW_INDIRECT_BUFFER, ExampleCount * 5 * integer. SISE / 8, blank, GL 4.GL_STATIC_DRAW); Gl.glBufferSubData (...); // Drag the example ID into the shader with buffer object gl.glBindBuffer (GL4.GL_ARRAY_BUFFER, vboBuff.get (1)); Gl.glBufferData (GL4.GL_ARRAY_BUFFER, example work * integer. SESE / 8, drawnexbuff, GL 4.GLSADATCDRAW); Gl.glVertexAttribIPointer (d_idLoc, 1, GL4.GL_UNSIGNED_INT, 0, 0); Gl.glVertexAttribDivisor (d_idLoc, 1); Gl.glEnableVertexAttribArray (d_idLoc); // bind vertex data buffer object gl.glBindBuffer (GL4.GL_ARRAY_BUFFER, vboBuff.get (2)); Gl.glBufferData (GL4.GL_ARRAY_BUFFER, ExampleCount / Column_subdivision * Work Buffets * Float. SESEA / 8, Blank, GL 4.GLSAMTICDRW); Gl.glBufferSubData (...); Gl.glVertexAttribPointer (verPosLoc, 3, GL4.GL_FLOAT, incorrect, 0, 0); Gl.glEnableVertexAttribArray (verPosLoc); // Bind vertex index data buffer object gl.glBindBuffer (GL4.GL_ELEMENT_ARRAY_BUFFER, vboBuff.get (3)); Gl.glBufferData (GL4.GL_ELEMENT_ARRAY_BUFFER, ExampleCount / Column_sub division * Index buffs * integer. SISEA / 8, blank, GL 4.GLSADATADRAW); Gl.glBufferSubData (...); // bind texture coordinate data buffer object gl.glBindBuffer (GL4.GL_ARRAY_BUFFER, vboBuff.get (4)); Gl.glBufferData (GL4.GL_ARRAY_BUFFER, ExampleCount / Column_sub division * TexasBuffies * Float. SSEAG / 8, blank, GL 4.GLSADATACDRAW); Gl.glBufferSubData (...); Gl.glVertexAttribPointer (tc_inLoc, 2, GL4.GL_FLOAT, false, 0, 0); Gl.glEnableVertexAttribArray (tc_inLoc); }  

Drawing command:

  gl.glBindVertexArray (vaoBuff.get (0)); Globind buffer (GL4.GL_DRAW_INDIRECT_BUFFER, vboBuff.get (0)); Gl.glMultiDrawElementsInirect (GL4.GL_TRIANGLE_STRIP, GL 4.GL_UNSIGNED_INT, blank, 3, 0);  

It is certain, there are some problems within the top data. The second is all right.


Symfony overiding form fosuser omit getParent gives me error -


I'm just reading FOSuserbundle override forms. It says that:

If you do not want to reuse the fields included in the FOSUserBundle by default, you can leave the getParent method and all fields can be configured manually.

When I do this, it gives me an error.

Any help will greatly appreciate.

My simple code

  name space CTC \ bundle \ user bundle \ form type; Use Symfony \ Component \ Form \ AbstractType; Use Symfony \ Component \ Form \ FormBuilderInterface; Class RegistrationFormat Type AbstractType {Public Function BuildForm (Forfbuilder Interface $ builder, array $ option) Expands {// Form Field $ Builder-> Add ('User Eligibility', Faucet, Array ('Label' = & gt; 'Title')); $ Builder- & gt; Add ('userFirstName'); } // If you do not want to reuse the fields added by FOSUserBundle by default, you can leave the getParent method and all fields can configure themselves // Public function getParent () // {// return 'fos_user_registration'; //} public function getName () {return 'ctc_user_registration'; }}  

Returns:

Type the visual data of the form Scalar, array or ArrayAccess is expected to be an example, But class CTC \ bundle \ user bundle \ unit \ is an example of the user. You can avoid this error by setting the "data_class" option to "CTC \ bundle \ userbundle \ unit \ user" or by adding a visual transformer to the square CTC \ bundle \ user bundle \ unit \ user's scaler, array or \ ArrayAccess An example of

You can use the setDefault function:

  1. Add Usage Statement.

    Use Symphony \ optionsResolver \ optionsResolverInterface;

  2. Add function

      Public function set default options (OptionsResolverInterface $ resolver) {$ resolver- & gt; Set Defaults (array ('data_class' = & gt;' YamilovS \ MyESchoolBundle \ Entity \ User ',' Intention '=>; Registration',)); }  

html - How to animate the color of an Ionicon? -


I want to change the color (think SVG) I tried the following, but this is only the SVG icon Shows:

Elements

  & lt; Class = "ion-social-twitter button-house" & gt; & Lt; / A & gt;  

CSS

  .button-home {fill: #fff; Webkit-Animation: Animation Button 20000 Mms Infinite; -moz-animation: animation-button 20000 mms infinite; -A-Animation: Animation-Button 20000ms Infinite; Animation: Animation-Button 20000 MMS Infinite; Font-size: 25V; } @ -webkit-keyframe animation-button {0% {fill: red; } 25% {fill: yellow; } 50% {fill: blue; } 75% {fill: green; } 100% {fill: red; }} @ Keyframe animation-button {0% {fill: red; } 25% {fill: yellow; } 50% {fill: blue; } 75% {fill: green; } 100% {fill: red; }}  

using ionicons as the font Just change fill to color , like -

  @ - WebKit-keyframe animation-button {0% {color: red; } 25% {color: yellow; } 50% {Color: blue; } 75% {color: green; } 100% {Color: Red; }} @ Keyframe animation-button {0% {color: red; } 25% {color: yellow; } 50% {Color: blue; } 75% {color: green; } 100% {Color: Red; }}  

Demo with bootstrap glyphicon here


sql - How to copy file without using XP_CMDSHELL? -


I am using SQL Server 2008. I would like to give users the possibility to copy files, what is possible without using the XP_CMDSHELL process? Because I should not change the permissions for this.

Error when I try to copy using XP_CMDSHELL:

Exec permission on object 'xp_cmdshell' was rejected, database 'mssqlsystemresource', Schema 'sys'.


ruby on rails - Adding span next to input field with simple_form and custom wrapper -


मेरे पास कस्टम आवरण है:

  config.wrappers: input_group, टैग: 'div' , वर्ग: 'फॉर्म-ग्रुप', एरर_क्लॉस: 'है-एरर' डू | बी | B.use: html5 b.use: प्लेसहोल्डर b.optional: maxlength b.optional: पैटर्न b.optional: min_max b.optional: readonly b.use: लेबल, वर्ग: 'नियंत्रण-लेबल' b.use: इनपुट, वर्ग : 'टैग पर नियंत्रण', 'प्रपत्र-नियंत्रण', wrap_with: {tag: 'div', class: 'input-group'} b.use: error, wrap_with: {tag: 'span', class: 'help-block'} b.use : संकेत, रैप_वि:: {टैग: 'पी', वर्ग: 'सहायता-ब्लॉक'} एंड  

और इनपुट के साथ एक फ़ॉर्म:

  & lt; % = Simple_form_for @event do | f | | & Gt%; ... & lt;% = f.input: start_date, जैसा:: स्ट्रिंग, आवरण:: इनपुट_ समूह% & ​​gt; ... & lt;% end% & gt;  

यह HTML बनाता है:

  & lt; div class = "form-group string वैकल्पिक event_start_date" & gt; & Lt; label class = "event_start_date" के लिए स्ट्रिंग ऐच्छिक नियंत्रण-लेबल & gt; प्रारंभ दिनांक & lt; / label & gt; & Lt; div वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट वर्ग = "स्ट्रिंग ऐच्छिक फॉर्म-कंट्रोल" प्रकार = "टेक्स्ट" नाम = "इवेंट [start_date]" id = "event_start_date" & gt; & Lt; / div & gt; & Lt; / div & gt;  

मैं इनपुट तत्व के बगल में स्पैन जोड़ना चाहता हूं:

  & lt; div class = "form-group string वैकल्पिक event_start_date" & gt; & Lt; label class = "event_start_date" के लिए स्ट्रिंग ऐच्छिक नियंत्रण-लेबल & gt; प्रारंभ दिनांक & lt; / label & gt; & Lt; div वर्ग = "इनपुट-समूह" & gt; & Lt; इनपुट वर्ग = "स्ट्रिंग ऐच्छिक फॉर्म-कंट्रोल" प्रकार = "टेक्स्ट" नाम = "इवेंट [start_date]" id = "event_start_date" & gt; ---- & gt; & Lt; span class = "input-group-addon" & gt; टेस्ट & lt; / span & gt; & lt; ---- & lt; / div & gt; & Lt; / div & gt;  

मैं यह कैसे कर सकता हूँ? (स्पैन पाठ प्रत्येक इनपुट तत्व के लिए अलग-अलग होगा)

अगर कोई और अभी भी इसके लिए खोज रहा है, तो संकेत सहायक ठीक उसी तरह करता है: इनपुट फ़ील्ड के बगल में मनमाने ढंग से पाठ वाला एक तत्व जोड़ता है ऊपर दिए गए उदाहरण में ऐसा दिखेगा:

पहले संकेत wrapper तत्व को span

  config को बदलें .wrappers: input_group, टैग: 'div', class: 'form-group', error_class: 'has-error' do | b | ... b.use: संकेत, wrap_with: {tag: 'span', class: 'help-block'} ... end  

और फिर संकेत आपके विचार में:

  & lt;% = simple_form_for @event do | f | & Gt%; ... & lt;% = f.input: start_date, जैसा:: स्ट्रिंग, आवरण:: इनपुट_ समूह, संकेत: 'परीक्षण'% & gt; ... & lt;% end% & gt;  

A responsive triangular prism in three.js -


I want to create a triangular prism in three.js where one user is able to highlight When clicking, its shirr / edges / faces

the color of the triangle is playful on the mouse-move. How can I make a triangle in the form of rectangular planes? I received a steady implementation in the cube and cuboid, but it did not include any rotation of planes and triangles. Here, I have created a different mesh for every 5 objects.

I'm not sure the depth of the canvas renderer is to be trimmed but you can easily get rid of those artifacts. You can use the WebGL renderer.


firebug - How can I inspect a rollover status? -


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

  • 7 उत्तर

मैं जांचना चाहूंगा ड्रॉप-डाउन मेनू का रोलओवर स्थिति मैंने क्रोम इंस्पेक्टर और इसके टॉगल एलीमेंट स्टेट सुविधा के साथ ऐसा करने की कोशिश की, जैसा कि आप यहां देख सकते हैं:

हालांकि इस तरह से मेरे लिए काम नहीं करता है।

मैं इनके निरीक्षण करना चाहता हूं इस साइट के सबमेनू:

इसलिए मैं कुछ अतिरिक्त सीएसएस नियम जोड़ सकता हूं, जबकि मेनू अभी भी खुला है।

मैं यह कैसे कर सकता हूं?

एक त्वरित नज़र लेने के बाद, आप नेस्टेड div class = "drop_down_start" जोड़ सकते हैं > विशिष्ट मेनू हेडर के लिए जांच करना चाहते हैं जब तक कि कक्षा मौजूद नहीं है, उप मेनू दृश्य / प्रदर्शित किया जाएगा। -

-

->

पहले:

  & lt; div class = "second bellow_header" शैली = "ऊंचाई: 0 पिक्सेल; शीर्ष: 85px;" & gt; & lt; div वर्ग = "आंतरिक" & gt; & lt; ul & gt;  

के बाद:

  & lt; div class = "second bellow_header drop_down_start" style = "height: 0px; शीर्ष: 85px;" & gt; & lt; div वर्ग = "आंतरिक" & gt; & lt; ul & gt;  

नोट:

मेनू लगातार बंद करने का प्रयास करेगा इसलिए, यदि आवश्यक हो,।


c# - How to declare common variable for all action in a asp.net page -



c# - How to declare common variable for all action in a asp.net page -

i have 1 asp.net page next , button , variable "i", each time click next or button, variable "i" increment or decrease 1. how declare variable i? don't want utilize "public static int i" should utilize session or viewstate? there improve ways this?

the view state state of page , controls. automatically maintained across posts asp.net framework.

every time page posts back, starting on scratch - initialized 0, example, 0 again. because server doesn't know lastly time page ran - knows clicked button submits form that.

when page sent client, changes in properties of page , controls determined , stored in value of hidden input field named _viewstate. when page 1 time again post _viewstate field sent server http request.

as on incrementing variables in asp.net on button click

if need persist value across postbacks, standard method utilize viewstate:

public property mycounter() integer dim val object = viewstate("mycounter") homecoming if(val isnot nothing, cint(val), 0) end set(byval value integer) viewstate("mycounter") = value end set end property

it's possible utilize session, persist value across pages , requests life of user's session. work, can utilize same sample above, replacing viewstate session.

c# asp.net

php - How to send a facebook notification to a user using curl without facebook SDK -



php - How to send a facebook notification to a user using curl without facebook SDK -

i tried next following output facebook since requires post.

$ch = curl_init('https://graph.facebook.com/appuserid/notifications?access_token=*****&href=index.php&template=test'); curl_setopt($ch, curlopt_returntransfer, 1); curl_setopt($ch,curlopt_post, 1); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_ssl_verifyhost, 0); $response = curl_exec($ch); var_dump($response); var_dump(json_decode($response));

then following, might doing wrong?

string '<!doctype html public "-//w3c//dtd xhtml 1.0 strict//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" id="facebook"> <head> <title>facebook | error</title> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="cache-control" content="no-cache" /> <meta name="robots" content="noindex,nofollow" /> <style type="text/css"> html, body { margin: '... (length=2131) null

you can quite using native facebook php-sdk:

https://developers.facebook.com/docs/php/gettingstarted/4.0.0

here's api method documentation sending notifications: https://developers.facebook.com/docs/graph-api/reference/v2.1/user/notifications

example usage php-sdk:

/* php sdk v4.0.0 */ /* create api phone call */ $request = new facebookrequest( $session, 'post', '/{user-id}/notifications', array ( 'href' => '/testurl?param1=value1', 'template' => 'this test message', ) ); $response = $request->execute(); $graphobject = $response->getgraphobject(); /* handle result */

php facebook http facebook-graph-api curl

apache - Script timed out before returning headers with php set_time_limit(0) runs fine by SSH -



apache - Script timed out before returning headers with php set_time_limit(0) runs fine by SSH -

i have script generates study client csv, writes file usesreadfile() output browser.

i'm having issue big study (takes 11 minutes generate, 700kb in size) throwing 500 error. apache says "script timed out before returning headers"

i have tried using set_time_limit(0) in script , setting max_execution_time in php.ini 900 (15 minutes) no avail. have error_log() calls emailing throughout script , study script generated ok, , ini_get('max_execution_time') within script returns 0 (i'm assuming means unlimited). if log in via ssh , run script using php scriptname.php runs fine , outputs csv shell.

could there setting, perhaps within apache, causing timeout issue? know should move script cron perhaps right time issue (isn't clients) i'd resolve timeout issue.

php apache timeout

algorithm - merge sorted lists -



algorithm - merge sorted lists -

i trying come split , conquer algorithm merging j sorted lists n number of elements i'm stuck; don't know how split problem smaller sub-problems. want more efficient merging algorithm goes this:

merge first 2 lists; merge resulting list 3rd list; merge resulting list 4th list, etc. takes o(j * jn).

u can in o(j*log(j)n) time

while(n!=1) i=0 n/2 merge list(i) list list(n) n = n/2

that way u merge whole grouping pairs, pairs of pairs , on

algorithm merge divide-and-conquer

java - How to create JUNIT Reports using runlistener? -



java - How to create JUNIT Reports using runlistener? -

i have been using junit testing. able run testcases problem how create junit reports programatically using runlistener(without using ant or maven). bit stuck , appreciate guidance same.

listener implementation:-

junitcore junit = new junitcore(); junit.addlistener(new myjunitlistener()); junit.run(allejbjunittests.class);

how proceed creation of report?

you can generate html study using stringbuffer.

string filepath = "file path want maintain report"; string reportfilename = "myreport.htm"; junitcore junit = new junitcore(); junit.addlistener(new myjunitlistener()); result result = junit.run(allejbjunittests.class); stringbuffer mycontent = getresultcontent(result, size);//size represents number of allejbjunittests class, suppose if have 5 ejb classes size 5. writereportfile(filepath + "/" + reportfilename, mycontent);

// method give html content.

private stringbuffer getresultcontent(result result, int numberoftestfiles) { int numberoftest = result.getruncount(); int numberoftestfail = result.getfailurecount(); int numberoftestignore = result.getignorecount(); int numberoftestsuccess = numberoftest - numberoftestfail - numberoftestignore; int successpercent = (numberoftest != 0) ? numberoftestsuccess * 100 / numberoftest : 0; double time = result.getruntime(); stringbuffer mycontent = new stringbuffer("<h1>junitee test report</h1><h2>result</h2><table border=\"1\"><tr><th>test files</th><th>tests</th><th>success</th>"); if ((numberoftestfail > 0) || (numberoftestignore > 0)) { mycontent.append("<th>failure</th><th>ignore</th>"); } mycontent.append("<th>test time (seconds)</th></tr><tr"); if ((numberoftestfail > 0) || (numberoftestignore > 0)) { mycontent.append(" style=\"color:red\" "); } mycontent.append("><td>"); mycontent.append(numberoftestfiles); mycontent.append("</td><td>"); mycontent.append(numberoftest); mycontent.append("</td><td>"); mycontent.append(successpercent); mycontent.append("%</td><td>"); if ((numberoftestfail > 0) || (numberoftestignore > 0)) { mycontent.append(numberoftestfail); mycontent.append("</td><td>"); mycontent.append(numberoftestignore); mycontent.append("</td><td>"); } mycontent.append(double.valueof(time / 1000.0d)); mycontent.append("</td></tr></table>"); homecoming mycontent; }

// generate study in particular directory have mentioned.

private void writereportfile(string filename,stringbuffer reportcontent){ filewriter myfilewriter = null; seek { myfilewriter = new filewriter(filename); myfilewriter.write(reportcontent.tostring()); } grab (ioexception e) { } { if (myfilewriter!=null) { seek { myfilewriter.close(); } grab (ioexception e) { } } } }

cheers !!

java junit junit4 junit3

php - Add custom customer address attribute in sales order grid collection in magento -



php - Add custom customer address attribute in sales order grid collection in magento -

hi want show custom client address attribute in sales order grid.

how accomplish ?

below collection. have added table fields table unable add together attributes customer/address

protected function _preparecollection() { $collection = mage::getresourcemodel('sales/order_grid_collection'); $collection->getselect()->joinleft(array('sfoa'=>'sales_flat_order_address'), 'main_table.entity_id = sfoa.parent_id , sfoa.address_type="shipping"',array('sfoa.street', 'sfoa.city','sfoa.company','sfoa.customer_address_id')); $collection->addfieldtofilter('customer_id', mage::registry('current_customer')->getid()) ->setiscustomermode(true); mage::log($collection); $this->setcollection($collection); homecoming parent::_preparecollection(); }

thanks guys.

anurag patbandha

according code ,you can add together fields of sales_flat_order_address. if want add together customer address attribute order grid need join customer/address collection on default shipping or billing address

php magento magento-1.7

javascript - Call ajax.fail() from ajax.success() -



javascript - Call ajax.fail() from ajax.success() -

so want conditionally phone call .fail method within .success method, how?

var ajaxcall = $.ajax({ url: purl, type: "post", data: pdata, datatype: "json", processdata: false, contenttype: "application/json; charset=utf-8" }) .always(function () { alert("always"); }) .success(function (data) { if (data == "fail") { ajaxcall.fail(); return; } alert("success"); }) .fail(function () { alert("fail"); });

$.ajax homecoming promise can't directly. best shot :

var fail = function () { alert("fail"); }; var ajaxcall = $.ajax({ url: purl, type: "post", data: pdata, datatype: "json", processdata: false, contenttype: "application/json; charset=utf-8" }) .always(function () { alert("always"); }) .success(function (data) { if (data == "fail") { fail(); return; } alert("success"); }) .fail(fail);

javascript jquery ajax json

sql - Display data if Count(distinct) is 0 -



sql - Display data if Count(distinct) is 0 -

sql server 2008

sql query displays ip address if nowadays

select [ip_addr1_text], count(distinct [ip_addr1_text]) instances sem_computer, [dbo].[v_sem_computer] sem_computer.computer_id = [dbo].[v_sem_computer].computer_id , [ip_addr1_text] = '10.10.10.10' grouping [ip_addr1_text]

output

ip_addr1_text instances 10.10.10.10 1

if ip address count 0, output null.

how modify query instances outputs 0, next non-existant ip address, i.e.

select [ip_addr1_text], count(distinct [ip_addr1_text]) instances sem_computer, [dbo].[v_sem_computer] sem_computer.computer_id = [dbo].[v_sem_computer].computer_id , [ip_addr1_text] = '10.10.10.11' grouping [ip_addr1_text]

should output

ip_addr1_text instances 10.10.10.11 0

edit

screenshot of view

ip_addr1_text alias

column cast(case when ip_addr1 < 0 0xffffffff + ip_addr1 else ip_addr1 end / 256 / 256 / 256 & 0xff varchar) + '.' + cast(case when ip_addr1 < 0 0xffffffff + ip_addr1 else ip_addr1 end / 256 / 256 & 0xff varchar) + '.' + cast(case when ip_addr1 < 0 0xffffffff + ip_addr1 else ip_addr1 end / 256 & 0xff varchar) + '.' + cast(case when ip_addr1 < 0 0xffffffff + ip_addr1 else ip_addr1 end & 0xff varchar)

select [ip_addr1_text], coalesce(count(distinct [ip_addr1_text]),0) instances sem_computer left bring together [dbo].[v_sem_computer] on sem_computer.computer_id = [dbo].[v_sem_computer].computer_id , [ip_addr1_text] = '10.10.10.11' grouping [ip_addr1_text]

sql sql-server

c# - EditorForTemplate inside a DisplayForTemplate MVC Razor -



c# - EditorForTemplate inside a DisplayForTemplate MVC Razor -

i trying utilize html display template looping through model data. within display template, wanted utilize editorfor template display different set of data, in doing so, running issues kid model empty. upon playing around , getting guidance david, able create work. below, please find updated working solution.

update (correct solution)

public class targetingareaviewmodel { public int dealerid { get; set; } public int orderid { get; set; } public list<targetingareaorderitemviewmodel> targetingareaorderitems { get; set; } public targetingareaviewmodel() { this.targetingareaorderitems = new list<targetingareaorderitemviewmodel>(); } } public class targetingareaorderitemviewmodel { public int orderitemid { get; set; } public int packagemediatypeid { get; set; } public string packagemediatypeheader { get; set; } public string mediatypedesc { get; set; } public string targetingadditonalinfo { get; set; } public list<targetingareaitemviewmodel> targetingareaitems { get; set; } public targetingareaorderitemviewmodel() { this.targetingareaitems = new list<targetingareaitemviewmodel>(); } } public class targetingareaitemviewmodel { public int orderitemid { get; set; } public int packagemediatargetingfieldid { get; set; } public string targetingareafieldtitle { get; set; } public string targetingvalue { get; set; } public bool isenabled { get; set; } public bool isrequired { get; set; } public string comment { get; set; } }

parent view

@model models.targetingareaviewmodel @{ applicationcontext.current.pagetitle = "targeting info"; layout = "~/views/shared/mainlayout.cshtml"; } @using (html.beginform("orderitemtargetinginfo", "home", formmethod.post, new { @class = "form-horizontal" })) { @html.displayfor(m => m.targetingareaorderitems) <div class="col-sm-12"> <div class="pull-right"> <input id="submit" type="submit" value="submit" class="btn btn-primary" /> </div> </div> }

displayfor template view

@model models.targetingareaorderitemviewmodel <div class="row"> <div class="col-sm-12"> <div class="col-sm-12 btn-primary" style="margin-bottom: 10px; margin-top: 10px;"> @html.label(model.mediatypedesc, new { @style = "font-weight: bold; padding-top: 10px; font-size: 18px;" }) @html.hiddenfor(m => m.orderitemid) </div> </div> </div> <div class="row"> <div class="col-md-12"> @html.raw(model.packagemediatypeheader) </div> </div> <br /> <div class="row"> <div class="col-sm-12"> @html.editorfor(m => m.targetingareaitems) </div> </div> <br /> <div class="row"> <div class="col-md-12"> <div class="form-group"> @html.label("additional info:", new { @class = "control-label col-md-2" }) <div class="col-md-6"> @html.textareafor(m => m.targetingadditonalinfo, new { @class = "form-control" }) </div> </div> </div> </div>

now, able display data, info out of model on post. works great!!

in parent views passing in targetingareaorderitems of model kid view expecting targetingareaviewmodel. instead should pass in entire model:

@html.displayfor(m => m)

c# asp.net-mvc

ruby - Computing Document Similarity Matrices in Sphinx? -



ruby - Computing Document Similarity Matrices in Sphinx? -

does sphinx provide way precompute document similarity matrices? have looked @ sphinx/solr/lucene; seems lucene able indirectly using term vectors computing document similarity term vectors.

currently using tf-idf-similarity gem these calculations, incredibly slow dataset grows; on^(n-1!).

currently trying find faster alternative this. lucene seems potential solution, doesn't have much back upwards within ruby community if sphinx has way of doing ideal.

just clarify; not trying live search similarity matching, appears mutual utilize case both lucene , sphinx, trying precompute similarity matrix create similarity between documents dataset. subsequently used in info visualizations different types of user analysis.

also prior experience doing i'm curious benchmarks. how looks in terms of time process , how much computing powerfulness and/or parallelization using reference number of documents , doc size average.

currently taking 40 minutes me process 4000 documents , 2 hours process 6400 records. providing 2 different sizes , times here give indication of growth expansion can see how slow become big datasets.

ruby lucene similarity tf-idf cosine-similarity

php - How to write a new CSV file and send as Email attachment -



php - How to write a new CSV file and send as Email attachment -

ok have next code after adding phpmailer:

<?php $name = $_post['id']; $email = $_post['username']; $password = md5($_post['password']); $usergroup = $_post['usergroup']; $lastsid = $_post['lastsid']; $fname = $_post['fname']; $lname = $_post['lname']; $lastaccess = $_post['lastaccess']; $company = $_post['company']; $phone = $_post['phone']; $addone = $_post['addone']; $addtwo = $_post['addtwo']; $city = $_post['city']; $stateprov = $_post['stateprov']; $country = $_post['country']; $postalcode = $_post['postalcode']; $rescom = $_post['rescom']; $addbook = $_post['addbook']; $subscriptions = $_post['subscriptions']; $affilid = $_post['affilid']; $affilcommpct = $_post['affilcommpct']; $affilsalestodate = $_post['affilsalestodate']; $affilcommearned = $post['affilcommearned']; $affilcommowed = $_post['$affilcommowed']; $affilcommpaid = $_post['affilcommpaid']; $whlsalepct = $_post['whlsalepct']; $show_currency = $_post['show_currency']; $loyaltypoints = $_post['loyaltypoints']; $fp = fopen("feed.csv", "w+"); $savestring = $name . "," . $email . "," . $password . "," . $usergroup . "," . $lastsid . "," . $fname . "," . $lname . "," . $lastaccess . "," . $company . "," . $phone . "," . $addone . "," . $addtwo . "," . $city . "," . $stateprov . "," . $country . "," . $postalcode . "," . $rescom . "," . $addbook . "," . $subscriptions . "," . $affilid . "," . $affilcommpct . "," . $affilsalestodate . "," . $affilcommearned . "," . $affilcommowed . "," . $affilcommpaid . "," . $whlsalepct . "," . $show_currency . "," . $loyaltypoints . "\n"; fwrite($fp, $savestring); fclose($fp); echo "<h1>thank you.</h1><p>we confirm details , send new business relationship details via email within next working day.</p><p><a href='test2.php'>back main page</a></p>"; /* email finished file */ require_once('/public_html/xx/class.phpmailer.php'); $email = new phpmailer(); $email->from = 'my@emailaddress; $email->fromname = 'test name'; $email->subject = 'form test'; $email->body = $bodytext; $email->addaddress( 'my@emailaddress' ); $file_to_attach = '/public_html/xx/'; $email->addattachment( $file_to_attach, 'formdata.csv' ); homecoming $email->send(); ?>

nothing happens! please advise? getting no error logs

i have tried write $searchstring fputcsv() no success. need workaround have 1 field checkboxes options separated comma.

please help, appreciate feedback. :)

since have posted little details - can suggest following:

instead of - write on same file:

$fp = fopen("formdata.csv", "w+");

try this:

$date_time = date('y-m-d h:i:s'); $fp = fopen("formdata" . $date_time . ".csv", "w+");

and after fclose($fp);:

trigger email code , send generated csv file attachment.

hope helps. allow me know, if want know further.

php forms csv

windows - Error Connecting to the Server -



windows - Error Connecting to the Server -

i got next error in windows pc when tried connect server in postgresql

an error has occured: error connecting server: fatal: password authentication failed user "postgres"

perhaps should check if username correct.

windows postgresql

xcode - NSStatusItem app focus -



xcode - NSStatusItem app focus -

how can menubar application accomplish same behaviours 1password or dropbox:

clicking menu bar icons or popovers not steal focus, e.g. while in illustration textedit , open 1password/dropbox, blinking cursor disappears window not go background, yet can type 1password's text field. even though didn't take focus in first place, disappear when click application

i figured out how mouse on works in dropbox popover table view using nstrackingarea options mouseenteredandexited, assumeinside, , activealways.

i trying same behaviour work in nspopover opens nsstatusitem.

i found workaround now. able same behaviour using non-activating nspanel window level kcgpopupmenuwindowlevelkey , had override canbecomekeywindow homecoming true.

unfortunately haven't found way yet nspopover behave way since it's not subclass of nswindow.

xcode osx nsstatusitem nspopover