Sunday, 15 May 2011

how to get image url from database in php? -


I have problem in showing image url link on my showdb.php

My current DB record:

| _id _____ | ____ name _____ | _image |
____ 1 _____ | __bane ____ | Done Jp | | | | ____ 2 _____ | __aple ______ | Apple. JPG |

What do I want to do to know how this record is displayed in php after banana.jpg or image column below is www.myhost.com/image/banana.jpg?

What I find right now:
{"posts": [{"name": "banana", "image": banana.jpg}, // this {"name "From:" apple "," image ": apple.jpg} // this from}}


What do I need:

 < Code> {"post": [["name": "banana", & lt; Br> "Image": www.myhost.com/image/banana.jpg}, // this {"name": "apple", & lt; Br> "Image": www.myhost.com/image/apple.jpg} // be it}}  



And it's mine To show the current code your DB record:

  if ($ rows) {$ response ["success"] = 1; $ Response ["message"] = "post available!"; $ Response ["post"] = array (); Forex Currency ($ line as line $) {$ post = array (); $ Post ["name"] = $ line ["name"]; $ Post ["image"] = $ line ["image"]; // Update our repsonse JSON data array_push ($ response ["post"], $ post); } // resonant JSON response echo json_encode ($ response); } And {$ response ["success"] = 0; $ Response ["message"] = "no post is available!"; Die (json_encode ($ response)); }  

Is that code correct to change?
or if there is a link to do so, I am very happy :))

For your reply, thanks :))) * And sorry if my english is bad :)

============================================== ================================================== Resolve by: ============================= .yourhost.com / folder / '(dot) $ line ["image"]; = & Gt; 'Www.yourhost.com' $ line ["image"].

But, this will change to / in \ / : 'www.yourhost.com/file/ / file Add .jpg

JSON_UNESCAPED_SLASHES , for example:

  $ url = 'http://www.example.com/ '; Echo json_encode ($ url), "\ n"; Echo json_encode ($ url, JSON_UNESCAPED_SLASHES), "\ n";  

Happy coding people! :))

just attached to www.myhost.com/image/ Do your image entry in the post array

  if ($ rows) {$ response ["success"] = 1; $ Response ["message"] = "post available!"; $ Response ["post"] = array (); Forex Currency ($ line as line $) {$ post = array (); $ Post ["name"] = $ line ["name"]; $ Post ["image"] = 'www.myhost.com/image/'$$[[image "]; // Insert here // Update our representative JSON data array_push ($ response ["post"], $ post); } // resonant JSON response echo json_encode ($ response); } And {$ response ["success"] = 0; $ Response ["message"] = "no post is available!"; Die (json_encode ($ response)); }  

javascript - How do you JSON.stringify an ES6 Map? -


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

  • 4 जवाब

मैं शुरू करना चाहूंगा जेएस ऑब्जेक्ट्स के बजाय का उपयोग करना, लेकिन मुझे वापस ले जाया जा रहा है क्योंकि मुझे पता नहीं है कि कैसे एक JSON.Stringify () मैप मेरी चाबी स्ट्रिंग होने की गारंटी है और मेरे मूल्य हमेशा सूचीबद्ध होंगे I क्या मुझे सीरियललाइज़ करने के लिए एक आवरण विधि लिखना है?

आप नहीं कर सकते।

वस्तुओं की एक नक्शा की चाबी कुछ भी हो सकती है लेकिन JSON सिंटैक्स केवल स्ट्रिंग के रूप में कुंजी की अनुमति देता है। तो यह एक सामान्य मामले में असंभव है।

मेरी चाबी स्ट्रिंग होने की गारंटी है और मेरे मूल्य हमेशा सूची में होंगे

इस स्थिति में, आप उपयोग कर सकते हैं एक सादे ऑब्जेक्ट इसमें ये फायदे होंगे:

  • यह JSON को सख्ती से सक्षम हो जाएगा।
  • यह पुराने ब्राउज़रों पर काम करेगा।
  • यह हो सकता है तेज।

Spring repository components not found in gradle subproject (Springboot) -


मेरे पास एक मल्टी प्रोजेक्ट ग्रेडले प्रोजेक्ट है:

ht-java

    < Li> एचटी-डोमेन
  • एचटी-स्क्रेपर

एचटी-स्क्रेपर एचटी-डोमेन में स्थित डोमेन मॉडल और डेओस का उपयोग करता है जब मैं Springboot ऐप को प्रारंभ करता हूं मुझे निम्न त्रुटि मिलती है:

  org.springframework.beans.factory.NoSuchBeanDefinitionException: कोई योग्यता बीन प्रकार [com.hypetube.domain.dao.ChannelRepository] के लिए पाया निर्भरता: कम से कम 1 बीन की उम्मीद है जो इस निर्भरता के लिए ऑटोरोवर उम्मीदवार के रूप में उत्तीर्ण होती है। निर्भरता एनोटेशन: {@ org.springframework.beans.factory.annotation.Autowired (आवश्यक = सच)}  

जब मेरे पास एचटी-स्क्रेपर के भीतर रिपॉजिटरी कक्षाएं हैं, तो ठीक काम करती है।

मेरा स्प्रिंग ऐप इस तरह दिखता है:

<पूर्व> @ कॉन्फ़िगरेशन @ सक्षम Enable AutoConfiguration @ComponentScan ({"com.hypetube", "com.hypetube.domain"}) @EnableConfigurationProperties // इसका उपयोग करें अन्य गुणों के स्रोतों को पंजीकृत करने के लिए उदा संपत्ति फ़ाइलें सार्वजनिक वर्ग अनुप्रयोग {निजी स्थिर अंतिम लॉगगर लॉग = LoggerFactory.getLogger (application.class); सार्वजनिक स्थिर शून्य मुख्य (स्ट्रिंग [] आर्ग्स) {SpringApplication.run (application.class); } @ बीन सार्वजनिक रेस्टस्टेंटल रिक्त टेम्पलेट () {नई रेस्टमेटप्लेट () लौटें; } @ एटोवायर निजी पर्यावरण पर्यावरण; @PostConstruct public void printActiveSpringProfiles () {log.info ("निम्नलिखित स्प्रिंग प्रोफाइल सक्रिय हैं: {}", नए अर्रेलिस्ट & lt; & gt; (Arrays.asList (env.getActiveProfiles ()))); }}

settings.gradle:

  शामिल करें 'ht-domain', 'ht-scraper'  

Build.gradle (ht.scraper):

  संकलन प्रोजेक्ट (": ht-domain")  

सब कुछ काम करना चाहिए; प्रोजेक्ट संकलित करता है कि कोई भी त्रुटियां आसन्न नहीं हैं बस जब मैं ऐप शुरू करता हूं तो त्रुटि होती है।

यह बहुत अजीब है क्यों spring-boot < / Code> प्लगइन में ht-domain subproject शामिल नहीं है कार्यवाही परीक्षण के लिए ht-scraper / build.gradle

  परीक्षण {classpath = project (": ht-domain") के लिए कोड का निम्न भाग जोड़ें। Main.runtimeClasspath}  

लेकिन अभी भी पैक किया गया अनुप्रयोग चलाने में समस्या है। मैंने PlaylistRepository वर्ग से सभी एनोटेशन निकाल दिए हैं और एप्लिकेशन :

  @EnableMongoRepositories ({"com.hypetube .डोमेन "})}  

नहीं यह अच्छी तरह से शुरू होता है - कम से कम कोई वर्ग के मुद्दे नहीं हैं I आशा है कि किसी तरह मदद करता है और जैसा कि मैंने बहुत अजीब व्यवहार कहा है: /


c++ - How small can I get full fledged compiler like clang or gcc in terms of size for an embedded system? -


I am creating an embedded Linux system and trying to fit my secondary boot loader (AT191) Am, u-boot, linux kernel, and root 8 mb data on flash chip. Busybox takes around 2 MB, although I can take it up to about 1 MB, and U-boot takes approximately 512 KB and that too I am sure I can be small.

Can I reduce their size? By taking cross compiling on my desktop, we take codes like things needed for large compilers and optimizations and build code to handle all the architectures except armv5te? Or have I been left with 50+ MB binary for GCC? If there is no hope of receiving it under 6 MB, what do I get?

You may want to take a look at some optional compilers; GCC is not known to be small, in particular, you may be interested in, small compiler :)


xml - How to convert decimal to integer in xpath? -


इनपुट xml में निम्नलिखित तत्व शामिल हैं:

  & lt; संख्याऑफ भुगतान & gt; 14.0 & lt; / numberOfPayments & gt;  

मुझे निम्नलिखित सीमाओं के साथ संख्या को पूर्णांक में कनवर्ट करना होगा:

  • XML एक बाहरी स्रोत से आ रहा है, मैं उन्हें भेजने के लिए नहीं कह सकता
  • यह एक XPath होना चाहिए, मैं किसी भी अन्य भाषा का उपयोग नहीं कर सकता

आप राउंड () का उपयोग कर सकते हैं। एक्सपैथ क्वेरी ये होगी:

<प्री> राउंड (/ संख्याओफ़ भुगतान / पाठ ())

या यदि आप फ़िर गोल किए बिना पूर्णांक भाग में रुचि रखते हैं मंजिल () :

  फर्श का उपयोग करें (/ numberOfPayments / text ())  

Google Groups PHP API Get existing Group -


The group is trying to access PHP API and get existing group settings and members.

divideandconquer .se, I have modified my code:

  function get_google_group ($ groupId) {$ group = false; Try {echo '& lt; Br / & gt; Getting Google Groups: '. $ Group ID '& lt; Br / & gt; '; $ MyClient = $ this- & gt; GetClient (); $ MyClient- & gt; AdScope ('https://www.googleapis.com/auth/apps.groups.settings'); $ GroupsettingsService = New Google_Service_Groupssettings ($ myClient); $ Group = $ groupsettingsService- & gt; Group-> Obtain ($ groupId); Echo 'success: group ='; } Hold (exception $ E) {echo '& lt; Br / & gt; *** Avatar *** '$ E- & gt; Received message () '& lt; Br / & gt; '; return false; } Return group $; }  

I am still getting an exception: on the 'received' method to call:

  Getting Google Groups: 04k668n33tdjvkw *** Incomplete ** * GET https://www.googleapis.com/groups/v1/groups/04k668n33tdjvkw Error calling: (403) GDita inadequate messages inadequate permission  

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

Do not use directly Google_Service_Groupssettings_Groups_Resource . Use Google_Service_Groupssettings , like this:

  $ myClient-> AddScope ('https://www.googleapis.com/auth/apps.groups.settings'); $ GroupsettingsService = New Google_Service_Groupssettings ($ myClient); $ Group = $ groupsettingsService- & gt; Group-> Obtain ($ groupId);  

indexing - Julia Find Index of Iterative Value -


I'm trying to find an item's pointer in an array in which an item from the item There is a step in Is there a function that enables me to do this?

  dim = 3 length = 10 arrayTuple = fill! (Array (Int64, dim), Length) # [10,10,10] RR = Fill! (Array (Int 6, Tupal ...), 1) AR # print the item in the node index for the end of the array  

IIUC, you can use:

  julia & gt; Enumerate (I, item) for (AR [1: 5]) println (i, "", item) end 1 1 2 1 3 1 4 1 5 1  

If you The multi-dimensional version you want, you can use instead:

  julia & gt; In each index (A) printen (i, "", [i]) and base. Iterator MD Cartesian Index (1, 1) 1.0 Base. EshtersMD Cartesian Index (2,1,1) 1.0 Base. Internetnamesmd CartesianIndex_3 (3,1,1) 1.0 Base.InternersMD.Cartion Index_3 (1,2,1) 1.0 [... and similar]  

Is there any In-Memory Distributed Hash Table implementation Perl? -


I see the memory distributed in the hash table implementation in Perl. Is there any one suggestion

If you mean an implementation that you can use from Perl, Number of modules for Memcached Interfaces eg:.

If you are looking for an implementation that is written in Perl, then I have no suggestion.


MySQL dump on WAMP server using PHP -


I am trying to dump mysql database using a PHP file. I'm using Windows 7 OS.

But I always get an error; This is my code

  $ user = 'root'; $ = 'Mypassword' passed; $ Host = 'localhost'; //$sql_file='db_backup.sql '; $ CMD = "E: \\ wamp \\ bin \\ mysql \\ mysql5.6.12 \\ bin \\ mysqldump -h $ host -u $ user -p $ exits hospital gt; db_backup.sql"; Exec ($ CMD, $ output, $ return); If ($ return! = 0) {// 0 OK is dead ('error:'. Implode ("\ r \ n", $ output)); } Echo "full dump";  

Any suggestions would be greatly appreciated. Thank you.

OK I have got the solution, anyone can find it useful.

  user $ = 'root'; $ = 'Mypassword' passed; $ Host = 'localhost'; $ CMD = 'E: \ wamp \ bin \ mysql \ mysql5.6.12 \ bin \ mysqldump --user =' $ User '--password =' $ Pass. ' --host = Localhost Hospital & gt; Db_backup4.sql '; // var_dump ($ cmd); Exit; Exec ($ CMD, $ output, $ return); If ($ return! = 0) {// 0 OK is dead ('error:'. Implode ("\ r \ n", $ output)); } Echo "full dump";  

python - append rows to a Pandas groupby object -


I am trying to figure out the best way to put the instrument back into a multi-indexed panda dataframe.

value Datafrem this way to me:

  Metric 1 metric 2 Arpiarpi Fyue 0 1 2 3 B 4 5 6 7 times 8 9 10 11 B12 13 14 15  

I would like to get the following results:

  metric 1 metric 2 RPRP FUA 0 1 2 3B 4 5 6 7 average 2 3 4 5 times a 8 9 10 11 b12 13 14 15 average 10 11 12 13  

Please note, I know that I df.mean (level = 0) Can be found in the form of a different data frame as the level 0 group. This is not what I want - I want to include the group, that means the rows return in the group.

I think I am able to get the results, but I think I am doing this wrong / possibly a liner which I am missing is that this expensive python repetition Here is my example code:

  import as NP import panda as PD data numpy = np.arange (16) .reshape (4,4) ROW_INDEX = [[("Foo", "a"), ("fu", "b"), ("bar", "a"), ("bar", "b")] col_index = [(((" "," R "), (" matric1 "," p "), (" metric 2 "," r "), (" Metric 2 "," P ")] col_multiindex = pd.MultiIndex.from_tuples (col_index) DF = pd.DataFrame (data, index = PD KMultiIndexkfrom_tuples (ROW_INDEX), Column = Col_multiindex) New_row_index = [] data = [] for the name, group df.groupby (level = 0) for index_tuple, line group.iterrows (): new_row_index.append (index_tuple) data.append (row.tolist ()) new_row_index.append ((name it "average")) data.append (group.mean (). tolist ()) print pd.DataFrame (data, index = pd.MultiIndex. from_tuples (new_row_index), column = col_multiindex )  

In which result is:

  Metric 1 metric 2 RPRP times one 8 9 10 11 b 12 to 13 14 to 15 average 10 11 12 13 Fu A 0 1 2 3B 4 5 6 7 AVG 2 3 4 5  

For some reason the groups flips the order, but more or less what I want is to do.

The main thing is that you need to do here to attach your means to the main dataset. Before doing so requires a major move queued you Indekss ( reset_index () and set_index () is consistent with so that you will be more or less after adding them Ready to sort by the same key. <35>: In [pre] : df2 = df.groupby (level = 0) .mean () [36]: df2 ['index2' ] = 'average' [37] in :. df2 = df2.reset_index () set_index ([ '. index', 'index2']) attached (DF) .sort () [38]: df2 out [38]: Metric 1 Metric 2 RPR Index Index 2 times Average 10 11 12 13 A 8 9 10 1 1B 12 13 14 15 FU AGG 2 3 4 5A 1 2 3B 4 5 6 7 As far as the rows are ordered, the best thing is to name the names Setting so that sorting puts them in the right place (like A, B, average). For short lines you can use Fancy Indexing:

 In  [3]: Df2.ix [[4,5,3,1,2,0]] Out [39]: Metric 1 Metric 2 RPR Index Index 2Fu A1 1 2 3B 4 5 6 7 AVG 2 3 4 5 times One 8 9 10 11b 12 13 14 15 average 10 11 12 13  

linux - how to print file from the match string until EOF -


निम्नलिखित कमांड फाइल WORD

  awk '1; / WORD तक प्रिंट करें / {Exit} 'फ़ाइल  

लेकिन फ़ाइल का अंत स्ट्रिंग WORD शामिल नहीं होने तक स्ट्रिंग WORD से फ़ाइल कैसे मुद्रित करें?

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

जैसा कि इटान रीज़नर एक टिप्पणी में कहते हैं, इसमें रेंज पैटर्न की एक अच्छी रसोई की किताब है लेकिन एक पैटर्न से एक फ़ाइल के अंत तक मिलान करने का सबसे आसान तरीका है:

  awk '/ WORD /, 0' फ़ाइल  

एक पैटर्न युक्त रेखा के बाद लाइन से प्रिंट करें, हम इसके बजाय ऐसा कर सकते हैं:

  awk 'found, 0; / WORD / {found = 1}' file  

पहली पंक्ति का हिस्सा भी मुद्रित करने के लिए जो WORD के निम्नलिखित शब्द से मेल खाता है, यह केवल अंतिम क्रिया को संशोधित करने के लिए आवश्यक है, लेकिन match पर एक स्पष्ट कॉल के साथ नियमित अभिव्यक्ति को बदलने के लिए सुविधाजनक है RSTART और RLENGTH को सेट करने के लिए:

  awk 'मिला, 0; मैच ($ 0, / WORD /) {found = 1; print substr ($ 0, RSTART + RLENGTH}'  

रेंज पैटर्न में अभिव्यक्ति , अभिव्यक्ति , और इसका अर्थ है कि पहली पंक्ति से मेल खाता है पहली पंक्ति में पहली अभिव्यक्ति जो अंतिम अभिव्यक्ति से मेल खाती है, शामिल है। जब तक फ़ाइल पूरी तरह से संसाधित नहीं हो जाती तब तक इस श्रेणी को दोहराया जाता है।

इन उदाहरणों में, दूसरी अभिव्यक्ति हमेशा मूल्यांकन करती है Es to 0 (झूठी), इसलिए रेंज कभी समाप्त नहीं होती है और पैटर्न पूरी तरह से एक बार सभी लाइनों का मिलान हो जाता है।

इसी तरह, "सभी लाइनों को छापें जब तक एक पैटर्न को हल करने का एक और तरीका "निम्न होगा, हालांकि यह कम कुशल है क्योंकि यह पूरी फाइल पढ़ता है:

  awk 'NR == 1, / WORD /' फ़ाइल  

इसके अलावा, यदि लक्ष्य केवल पैटर्न के उदाहरण तक प्रिंट करना है (जैसा कि पूर्ण प्रतिमान युक्त पूरी लाइन के विपरीत, हम मूल प्रोग्राम का एक सरल संशोधन कर सकते हैं:

  awk 'मैच ($ 0, / WORD /) {प्रिंट (उप ($ 0,1, RSTART + RLENGTH)); बाहर निकलें} 1 ' 

better alternative on for loop verilog -


I am a newbie in verilog. I am searching online and most of them suggest that using loop in Verlog coding. Do not So is there a better option to change the loop? The problem I am facing now is that I have to loop for 1 or 2 in the case statement. And I was thinking about better options but did not come with any

example of my code:

  always @ (*) case (help) 4 ' D1 It would be great if any of you put some light on it. For start (i = A, i & lt; = 20; i = i + b) start temporarily [i-1] = 1; For end 4'd2: (i = A, i & lt; = 20; i = i + b) floating start [i-1] = 1; B = B + 1; End 4'd3: To start (i = A, i & lt; = 20; i = i + b) Temporary start [i-1] = 1; B = B + 1; (I = a; i> = 1; i = i-b) start ending the temporary [i-1] = 1; B = B + 1; Final end default: temp = 0; For verilog-loops are fine, but they need to be able to stabilize, so if  

If you plan for synthesizing, static anol means that the loop is not dependent on any external variable. For example, for (i = 0; i & lt; 10; i = i + 1) is constant. For (i = A, i & lt; = 20; i = i + b) is not static because it depends on a variable a and B .

You can create a static to run the variable as a condition inside the loop (i = a, i & lt; = 20; i = i + b) for < / Code> becomes:

  tmp_var = A; Start for (i = 0; i & lt; = 20; i = i + 1) if (i == tmp_var) // start ... your argument here ... tmp_var = tmp_var + b; End of End  

Those issues which need to be addressed beyond the scope of the question:

The way you b and temporary are slightly related.

  • b appears to be an input, but if you are also increasing it is illegal to manipulate this input for synthesis if it is an input, Create a local variable as the default value in the form of B and you can always change it later in the block. If this is not input, then it is making a logging argument; Which is not good and I will cover the next temp with it

  • adding temporary logic is flexible argument is difficult Because time is important; When the litter is transparent or closed, and hold while recognizing the time requirements to learn. The more complex logic argument is difficult, it is predictable. Inclined side-by-side assignments in RTL on one side of the estimated blocks (i.e. always @ * ). To solve this, make sure that each bit is assigned to each pass of the combination blocks. One of the safest safeguards is to assign a default value to your logic before moving it. Example:

      always @ (*) start temporary = 0; // default for a constant temp_B = b; // one input value // default ... your logic ... end  

android - how do I use textfield_default_holo_dark.9.png -


I am using a textview in a dark background so that I use light-colored 'light-light' themed items Instead of defaulting in my activity, in the past, I copied them from my Android device to their own removals directory. There should be a better way but I have not got it yet. Please suggest ...


ios - How to solve keychain access warning after app transfer to new account -


I have a few questions about the "potential loss of key mill access".

I used an app for the old account, but now I want to update that app and when I try to submit the update build, shows me the key mill Has to suffer potential losses, but there is no error (using new provisions profile by encode). So I search on Google about it and I think that the reason is that old team id and new team id, its variation and because of this you can not create a provisioning profile with the old team id, so I "XC: com. Using a new XCode such as "TESTING.Test", I am creating a new profile and submitted the application using it with war.

But after submitting the app, I received an email from Apple "In the previous version software [XYZXYZ.com.TESTING.Test '] is an application-identifier value and the software is being presented In the new version ['ABCACC.com.Testing Test'] is an application-identifier. As a result,

1) If I ignore the "Provisional Warship" key, the new provision profile I am using Will the app not be able to use NSUSerDefaults? Or any other important information? (And does this problem not only reach old bunch of old installs or new installs?)

2 ) How to solve this problem?

Any help is epiiced

According to the docs, it will be anyway

.

NSUserDefaults There is nothing to do with this if you have a keychain From Classes are not used - - so they can leave safely this warning.


jquery - How to format/customize data in table columns using datatables server processing? -


The problem is very straight forward when using the original code databases server processing only plain text to page Is displayed on Instead, it pulls properly that what is in the database column in table columns with any additional HTML formatting.

Example: Here is an IMG that looks formatted text HTML and CSS . Each column in the table has its own style / format now when datatable requests a server processing server / database, like I said, just like they are in the database, to see this format , As shown above, I have to put the HTML inside it in the database. IE:

  & lt; Span class = "Label label-hazard" & gt; Tag & lt; / Span & gt;  

or

  & lt; Span class = "label bg-color-green-dark" & gt; Category labels & lt; / Span & gt;  

How can I format the results removed from the database and in the table column on the page? I prefer to add the tag to that entire tag instead of just tags in the tag tag.

Does this page have to stop the results before the hit, format it, then post it on the page?

code:

  $ (document) .ready (function () {$ ('# example'). Datatale ({"processing": true, "server Side ": true," ajax ":" script / server_processing.php "," column defects ": [{" data ":" first name ", // you should have feedback in this name: JSON" render ": function ( Data, type, complete, meta) {return '& lt; span class = "label label-threat" & gt;' + data + '& lt; / span & gt;'}}}]});}); Use the  render  option in the  

column, Data: ({"columnDefs": [{"targets": 0, // "column_name" in the column starting with "data"):

, // This name is your JSON response " Render ": function (data, type, complete, meta) {return '& lt; Span class = "label label-danger" & gt; + Data + '& lt; / Span & gt; ';}}]});  

Check the documents here:. Use data to match the properties / key of the source object / key. If you are not using any key, then use target


php - Trying to get property of non-object error JSON -


I am trying to get the place of Instagram pictures from my account. The API is giving me all kinds of information about my account and pictures, but when I try to get the position of my pictures it says:

Non-object assets Trying to get .. ..

My code looks like this:

($ phplijst-> Data as $ data ) {Echo "& lt; img src =". $ Data- & gt; Image-> Less_situation-> url "/"; ";"; Echo "& lt; p & gt;" . $ Data- & gt; Location- & gt; Latitude "& lt; / p & gt;"; }

The first "echo" gives me all the images from my account. The second "echo" wants to give me the longitude of all the images on my account. Instead it gives me the error message, does anyone know how to fix it?

This means that $ data-> Location is not an object.
You should check your object structure with var_dump ($ data) and verify that you expect it on that layout.


php - Error when persisting an embedded document with DoctrineMongoDB : array given -


I am working on a project, which uses Principle-Mongo DB and Symphony.

I have a document here:

Music Inc:

East> & lt ;? Php // app / resources / documents / music.fp namespace AppBundle \ Document; Use the principle \ ODM \ MongoDB \ Mapping \ Annotations as the Mangaodbi; / ** * @MongoDB \ document (collection = "BV_MUSC_INFOs") * / class musicInfos {/ ** * @MongoDB \ Id (strategy = "auto") * / protected $ id; / ** * @MongoDB \ ReferenceOne (targetDocument = "user") * / protected $ user; / ** * @MongoDB \ EmbedMany (targetDocument = "InstrumentsPlayed") * / protected $ instruments = array ();

More embedded documents:

  & lt; Php namespace AppBundle \ Document; Use the principle \ ODM \ MongoDB \ Mapping \ Annotations as the Mangaodbi; / ** * Mongodebi \ embedded document * / class instrument plated {/ ** * @MongoDB \ ReferenceOne (target document = "tool") * / protected $ tool; / ** * @MongoDB \ Field (type = "int") * / protected $ practiceLevel;  

After this I have created a form to fill out those documents:

   

Controller

   Tie ($ request); If ($ form-> isValid ()) {$ user = $ this- & gt; Container-> Get ('security.context') - & gt; GetToken () - & gt; GetUser (); $ MusicalInfos- & gt; SetUser ($ user); $ Dm-> Continues ($ musicalInfos); $ Dm-> Flush (); $ Response = new JasonRespons (); $ Response- & gt; Setdata (array ('registred_musical' = & gt; true)); $ Refund; }  

But when I try this, I always get the exception: Warning: spl_object_hash () expects parameter 1 to be an object,

I do not know why ...

Thank you for your help!


java - Database times out waiting for a free available connection -


So I am using Java Framework version 2.3.7, when I try to call a stored procedure It throws an exception: / P>

[ Error ] - There is an error in trying to load the gifts by the picture. The waiting for the free available connection ended Java.sql.SQLException: Timed out waiting for an available free connection com.jolbox.bonecp.DefaultConnectionStrategy.getConnectionInternal (DefaultConnectionStrategy.java:88) ~ [bonecp-0.8.0.RELEASE.jar: na] on com.jolbox.bonecp on .AbstractConnectionStrategy.getConnection (AbstractConnectionStrategy.java:90) ~ [bonecp-0.8.0.RELEASE.jar: na] on com.jolbox.bonecp.BoneCP.getConnection (BoneCP.java:553) ~ [bonecp-0.8.0 .RELEASE.jar: na] at com.jolbox.bonecp BoneCPDataSource.getConnection (BoneCPDataSource.java:131) ~ [bonecp-0.8.0.RELEASE.jar: na] - play.api.db.DBApi $ class.getConnection (DB.scala: 66) on ~ [Play-jdbc_2. 11-2.3.7.jr: 2.3.7]

Java code:

  callable format cst = null; Results set rs = null; Connection Conn = DB.getConnection (); & Lt; Picture & gt; Picture = null; Try {conn = db.getConnection (); (Gift gift: giftList) {CST = conn.prepareCall ("? {Sp_set_pictures_LOAD_PICTURES_BY_GIFT ()} call"); Cst.setInt (1, gift.getID); Rs = cst.executeQuery (); If (rs.next ()) {Pictures = new array list & lt; Picture & gt; (); Do {Picture p = New Picture (rs.getInt (1)); Pictures.add (p); } While (rsnext ()); Gift.setPictures (pictures); }}} Hold (exception e) {logger Terror ("There has been an error trying to load the picture by gift. \ N" + e.getMessage (), e); } Finally {if (CST! = Null) CST = Faucet; Conn; }  

application.conf:

  db.default.autocommit = true db.default.isolation = READ_COMMITTED db.default . Partition number = 2 db.default.maxConnectionsPerPartition = 5 db.default.minConnectionsPerPartition = 5 db.default.acquireIncrement = 1 db.default.acquireRetryAttempts = 10 db.default.acquireRetryDelay = 5 seconds db.default.connectionTimeout = 20 sec DB default.idleMaxAge = 10 minutes Select db.default.idleConnectionTestPeriod = 5 minutes db.default.initSQL = "1" db.default.logStatements = false db.default.maxConnectionAge = 1 hour db.default.queryExecuteTimeLimit = 1 second < / Code> 

You call DB.getConnection () twice, perhaps because of this, the JDBC driver makes 2 connections, But you only turn off the other.


java - get a String and put a standart text before -


I want to set a normal text, and after the text, there should be a personal number such as: you Can I beat my score? (X.XX seconds)

I have tried this:

  FacebookDialog shareDialog = New FacebookDialog.ShareDialogBuilder (this) .setLink ("www.facebook .com / FrozenSparks.ch ") .setName (.setText (" Can you beat my score? ")) (Prefs.getString (" thetime1 "," - "))) .build (); UiHelper.trackPendingDialogCall (shareDialog.present ()); }  

, but it only gives me some errors.

How to do something like this:

  .setName ("what Can you beat my score? + Prefs.getString ("thetime1", "-"))  

There are many mistakes in your code sample, brackets / braces, I hope That would only be a copy and paste fault.


interrupt - measuring time between two rising edges in beaglebone -


I am reading the sensor output as the sensor wave (0-5 volts) through the oscilloscope. Now I want to assess the frequency of a period with the beagle bone , so I should be measuring between two rising edges of time S. Although, I have to work with Beagle bone Have no experience with you Can you give some advice or sample code about measuring time between rising edges?

How do you need it to be deterministic? If you can tolerate some wrongdoing, then you can probably do it on the main Linux OS; If you want to be a fancy pants, then it looks like a possible use case for BBB's PRU (which I have not used so much unfortunately, so take enough salt in it). I hope you can write PRU code which just sits with an unlimited external loop and then start looping inside that loop until the pin is detected, then starting from appearing to pin show 1 (This is the first rising edge), the counting starts until the pin again shows 0 (it will be a falling edge) or any other loop for the next rising edge ... in any way, you Counters can be assumed And you should be able to change it directly in time (PRU) as a fixed frequency for each instruction, and 200 MHz (50ns / instruction) Believing your loop

  #Pins start with Inner Loop 1 1: RegisterX = loadPin increment counter jump if Zero Register X internal loop 1 # pin now High Inner Loop 2: RegisterX = Loadpin increment counter jump if internal loop 2 for a register # PIN is now low  

It should take 3 instructions per pay per instructions, so that you can get time as 3 * counter * 50 ns.


javascript - Getting JS error after upgrade Sitecore version 6.6 to 7.0 -


हमने साइटकोर v6.6 को साइटकोर v7.0 में अपग्रेड किया है। लेकिन मैं प्रकाशित नहीं कर पा रहा हूं। जब मैंने क्लिक किया प्रकाशित करें लिंक कुछ भी नहीं होता है फिर मैंने नीचे दिए गए मोज़िला वेब कंसोल में त्रुटि की जांच की:

यहां छवि विवरण दर्ज करें < / P>

त्रुटि:

  प्रकार त्रुटि: this.browser.showModalDialog फ़ंक्शन नहीं है।  

मुझे क्या याद आया।

धन्यवाद

यह इसलिए है क्योंकि showModalDialog आधुनिक ब्राउज़रों में पदावनत है।

showModalDialogs पूर्व-7.1 साइटकोर रिलीज़ में उपयोग किया गया था।

आपको क्या जरूरत है आपके लिए एक उचित पैकेज स्थापित करना है। साइटकोर संस्करण।

यहां विभिन्न साइटकोर संस्करणों के लिए साइटकोर सहायता पैच की सूची है:

या


functional programming - Processing 2 List in F# -


I have some data, such as:

  id = [11; 9; 12] ;; Student = [(9, "n"); (10, "Ben"); (11, "Carl"); (12, "Dave")] ;;  

Please help to apply a function named getName for example

  & gt; GetName (ID, student) ;; - If you are learning '' '' '' '' '' '' '' 'then functional programming, then the correct approach will be to use recursive. But to help you with that, you have to share the code you tried to write.  

In practice, the easiest option might be to list the list dict and then see all the IDs in the dictionary:

  Give students to two students = Lookup = Instruction student ID. & Gt; List.map (Funny id -> Lookup. [ID]) Student ID student  

c# - How do I make an USB printer halt mid-print? -


What I'm trying to do, a USB printer treats a bit like a bit matrix printer when the page actually In the exit, then able to control.

What I have to do, two PDF files, one for the top of the page and one for the bottom, and print the PDF to the printer first, stop and wait for the second PDF. , Then continue printing the second PDF on the second half of the page.

The idea is that the first part of the paper should be able to tear off the punched page, without waiting for the second half. I am using C # and have noticed many different ways of printing raw data, but I am not searching much on this matter. Thank you in advance and please tell me if any information is needed!


javascript - jQuery datatables dynamically changing is not removing correct rows in Ruby on Rails -


I am using jQuery Databates with dynamically changing columns using colivos. Everything is working fine (add and remove columns).

But when the data is loaded and trying to remove a column, it is not removing the relevant rows properly instead of just deleting the column but the same row data in the next column Is being displayed. It should also be removed.

Help fix this problem.

partner.js

  $ ("#" example: "data" (data "" ":" c ";" clear ";; & Lt; lfrtip; search: false, paging: wrong," bServerSide ": true," sxxsource ": window.location href," fnServerData ": function (sSource, aoData, fnCallback) {console.log (SSource); console.log (aoData); console.log (fnCallback); Warning ('data change'); $ .getJSON (sSource, AoData, function (JSN) {// Do you have any additional processing on callback Then the dataable FnCallback (json)});}});  

transaction.html.erb # where the table is listed.

This is where The data is being loaded in each loop.

  
gt; div class = "panel-title"> gt; & lt; span Class = "panel-title" & gt; & lt; i class = "fa-exchange"> gt; & lt; / i & gt; & amp; nbsp; and & nbsp; transaction & lt; / span & gt; ; & Lt;% = Partial assign: 'date_filter', local: {filter_name: 'load_more'}%>
& Lt;% = sd.merchantname% & gt; & Lt; / Td> & Lt; Td> & Lt;% = sd.bank_name% & gt; & Lt; / Td> & Lt; Td> & Lt;% = sd.payment_gateway% & gt; & Lt; / Td> & Lt; Td> & Lt;% = get_status (sd.status)% & gt; & Lt; / Td> & Lt; Td> & Lt;% = sd.amount% & gt; & Lt; / Td> & Lt; Td> & Lt;% = sd.discount% & gt; & Lt; / Td> & Lt; Td> & Lt;% = sd.additional_charges% & gt; & Lt; / Td> & Lt; Td> & Lt;% = get_added_on_date sd.addedon% & gt; & Lt; / Td> & Lt; / TR & gt; & Lt;% end% & gt; & Lt; / Tbody & gt; & Lt; / Table & gt; & Lt; Div id = "align" & gt; & Lt;% If @ all_settlement_details.count & lt; 1%> & Lt; A href = "" class = "load-more" data-click = "1" & gt; Nothing, more & lt; / A & gt; & Lt;% else% & gt; & Lt; A href = "" class = "load-more" data-click = "1" & gt; Load more ... & lt; / A & gt; & Lt;% end% & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt; & Lt; / Div & gt;

Enter image details here column before unchecking # position

Enter image details here click on "check" status "

See two images. In the Status column, start focusing on the " Status" , "Zodiac" column. The row data is "left" for the "Status" column, but when I uncheck the status column, the Status column is removed, but the row data that "left" is now next column Amount has been moved in.

I could not understand why this is happening, how can I correct this behavior.


python - Spin up VM using Ansible without Vagrant -


I have a specific requirement, where I can use alone without vagrant in my host machine.

Two questions related to it:

  1. Is it possible to spin VM on a host machine using a libvirt / KVM account as a hypervisor? I know that the responsive is called a module which is capable of doing this. But I could not find any real example of using this. Appreciation If someone can point me through example YAML through which I can spin VM
  2. With Ansible, is it possible to run my playbook with Python code? If I'm not mistaken then there is a Python API supported by Ansabal. But it is possible to give YAML files as input to this API, which performs tasks from YAML.

  1. Of course - if you have SSH access.
  2. Yes, you can run responsive through your Python API or command line call. About passing YAML file - too - Yes.

java - Binary Search Tree In-Order Traversal to a new array -


I have traveled in a BST sequence while printing workout as a workout, but the task was to add a The new list contains ...

I tried to do this by creating a list outside the law and adding the array [i] to the list, by increasing the value 'x', but I have a NullPointerException

  int [] bstArray; Int x = 0; Public int [] Return InOrderTraversal (BSTNode node) {if (node ​​== tap) bstArray back; If (node ​​.getLeftChild ()! = Null) {returnInOrderTraversal (node.getLeftChild ()); } BstArray [x] = node.getValue (); X ++; If (node ​​.getRightChild ()! = Null) {returnInOrderTraversal (node.getRightChild ()); } Return bstArray; }  

thanks

  int [] bstArray; & Lt;     > Int [] bstArray = new bstArray [someLength]; & Lt; ------- In this way use bstArray [x] = node.getValue ();  

vim - VsVim automatically switching to select mode -


I am using the current version of VSVim in Visual Studio 2013 and there is a behavior with which I can not work And that happens when I'm in insert mode, and when I select the text, it automatically switches to select mode. I want to state clearly when I want to be in the selection mode so that when I stay in the inclusive mode I will be there.

Play with different icons options. Maybe it would be most suitable to you:

  set mouse = n  

c# - saving not validating properties -


There is a strange need in my project. I have to use the verifier on that field which is binding for the view and on the setter -The property change method. This is done:

  Public class MyValidationRule: Validation rule {Private const int MyLength = 17; Public override validation object (Object Value, CultureInfo Culture Infosa) {var valueString = (string) value; If (valueString! = Null & amp; amp;; valueString.Length == MyLength) {new validation returns (actual, empty); } New Validation Return Return (Wrong, "Invalid Value"); }}  

and XAM:

   & Lt; /Binding.ValidationRules> & Lt; / Binding & gt;  

This work is fine but this requirement really is that I should not value the value in DB. The verifier should only have a red background.

I want to call the property's property when the value is not valid

edit

I want to call the Setter with this validity rule My property, when its length is not equal to 17 (MyLength).

I did this differently, I implement the IDataErrorInfo interface and apply its members :

  public string this [string columnName] {get {return Validate (columnName); }} Public string error {received; Private set; } Public string valid (string propertyName) {string error = null; Switch (propertyname) {case "value": if (_value.Length! = 17) error = "invalid value"; break; } Error = error; Return error; }  

and in binding, set flag:

  validated data eros = "true"  

now working I wanted to


java - android Database access not working -


What I'm trying to do is create a table, then enter some values ​​in it and select. The problem I am facing is app preventing unfortunately. I do not know what the problem is.

My code is: This class calls the database handler

  increases the public class service events {Personal Static Last String DB_NAME = "EventDB"; Override public null on @reate (bundle saved instainstate) {super.naught (savedinstenstate); SetContentView (R.layout.edit_product); Bundle Extras = Milentant (). GetExtras (); String event = extras .getString ("event"); String date = additional .getString ("date"); String College = Extras .getString ("College"); DatabaseHandler db = new databank (getApplicationContext ()); Db.insert_data (event, date, college); String c = db.select_data (); Toast. Make text (getApplicationContext), "EventName:" + c + "", Toast. LNNHHLANG). Show (); }}  

database handler

  public class database bundler SQLiteOpenHelper extended {personal constant end-end DATABASE_VERSION = 1; Private static final string DATABASE_NAME = "EventDB"; Private static final string TABLE_NAME = "eventlist"; Public databashendler (reference reference) {super (references, database, ANN, blank, databasebessons); } @ Override Creates on Public Zero (SQLiteDatabase db) {// Category Table query string CREATE_ITEM_TABLE; CREATE_ITEM_TABLE = "Create table event (event name varchar (100), event varchar (100), college varchar (100));"; Db.execSQL (CREATE_ITEM_TABLE); } @ Override Public Wide On Upgrade (SQLiteDatabase DB, Int JuniorWarson, Int Newversion) {} Zero Insert DataData (String EventName, String Date, String College) {SQLiteDatabase = DB = this.getWritableDatabase (); Material values ​​= new material value (); Values.put ("eventname", eventname); Values.put ("EVENTDATE", date); Values.put ("college", college); Db.insert (TABLE_NAME, null, value); Db.close (); } Public string select_data () {SQLiteDatabase db = this.getWritableDatabase (); String selectQuery = "Select event from event list where eventname = 'techcontest'"; String c = faucet; Cursor cursor = db.rawQuery (selectQuery, zero); Cursor.moveToFirst (); C = cursor.getString (0); Return c; }}  

Shows my logs

  03-16 20: 00: 19.116 8378-8378 / com.example.android E / SQLiteLog: (1 ) There is no such table: eventlist 03-16 20: 00: 19.122 8378-8378 / Com. Examples. Android E / SQLite Database: College = ACS University eventdate = 2-02-15 eventname = error in inserting techocontest android.database.sqlite.SQLiteException: EventList (code1): EventList (code1):, while compiled: Enter the Eventilist (College, event, eventmeam) value (?,?,?)  

Do not think that you are closing the database in the select_data () method.


php - Mysql special characters not updating correctly -


I have updated a column with a value in a table

"Size: Rabbit Inside: 31 ½ "x 50 ¼" Rabbit min 3/8 "

. But it was updated

"Size: Rabbit inside: 31 half" x 50 ¼ "Rabbit min 3/8".

When I put the query into phpmyadmin, it gets updated correctly.

Thank you, A. John Melchior.

I have successfully inserted the given text from phpmyadmin I have added "and then the string Insert inside This is the query I've used: Enter the value in the sample_table (`user_input`)

  value ('' size: inside the rabbit: 31 ½" x 50 ¼ "rabbit min 3 / 8 "');  

Differences between Azure Block Blob and Page Blob? -


As I recently started walking with Windows Azure , I came to a position I'm the one who has a block blob & amp; Page drops . I am currently in the process of uploading some text, CSV or DAT files in Blob Storage and then using a C # program, I am doing a MapReduce for this. Yes, I have gone through some articles, like

but they could not get a clear idea. To reduce, block blob vs. page blob . Any help would be appreciated.

Differences on MSDN are very good, TL; DR:

  • Block blobs are for your discrete storage objects such as JPG, log files, etc., which you usually see as a file in your local OS Are there. Max. Size 200 GB 4.77 TB Only regular (non-premium) storage
  • Pages blobs are for random read / write storage, such as VHD (in fact, there are page blops that are used for Ezur virtual machine disks). Max. Size 8 TB is supported by both regular and premium storage.

Note: Premium pages have specific types of blobs (as opposed to regular page blops, which can be any size up to 8TB)

  • 512GB
  • 1024GB
  • 2048GB
  • 32GB
  • 4096 GB
  • Premium storage provides guaranteed IOPS and throughput, which is selected based on page bob size (120 IOPS + 25 MB / s 32 GB to 7500 IOPS + 250 MB / S @ 2048 GB and 4096 GB)). Specific details are documented around Iops + Throughput details.


    objective c - How to power iOS device off -


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

    • 2 जवाब

    हां। मुझे वास्तव में लगता है कि जो मैं पूछ रहा हूं वह असंभव है, लेकिन मैं जानना चाहूंगा कि क्या आपके पास कोई विचार है कि कैसे आईफ़ोन को तेज या उद्देश्य सी कोड के साथ ताकत दे, या कम से कम हवाई जहाज मोड में प्रवेश करें।

    आप इसे एप्पल द्वारा प्रदत्त सार्वजनिक एपीआई के साथ नहीं कर सकते यह बिना रिमूथ निजी एपीआई का उपयोग कर किया जा सकता है लेकिन ऐप्पल की नीति के अनुसार, किसी भी निजी एपीआई के उपयोग से ऐप स्टोर से ऐप की अस्वीकृति हो जाएगी।


    java - Spring social login using google plus? -


    मैं वसंत सामाजिक का उपयोग कर रहा हूँ Login.jsp में मेरे पास facebook और twitter के लिए कोड नीचे है।

      & lt; फ़ॉर्म आईडी = "tw_signin" action = "& lt; c: url value =" / signin / twitter "/ & gt;" विधि = "पोस्ट" & gt; & Lt; a href = "जावास्क्रिप्ट: शून्य (0)" ऑनक्लिक = "document.forms.tw_signin.submit ();" & gt; & Lt; img alt = "ट्विटर" src = "$ {pageContext.request.contextPath} /images/icons/twitter-login.png" & gt; & Lt; / a & gt; & Lt; / प्रपत्र & gt; & Lt; form id = "facebook_signin" action = "& lt; c: url value =" / signin / facebook "/ & gt;" विधि = "पोस्ट" & gt; & Lt; इनपुट प्रकार = "छिपा हुआ" नाम = "दायरा" मान = "ईमेल" & gt; & Lt; a href = "जावास्क्रिप्ट: शून्य (0)" ऑनक्लिक = "document.forms.facebook_signin.submit ();" & gt; & Lt; img alt = "Facebook" src = "$ {pageContext.request.contextPath} /images/icons/facebook-login.png" / & gt; & Lt; / a & gt; & Lt; / प्रपत्र & gt;  

    एफबी के लिए मैं document.forms.facebook_signin.submit (); बुला रहा हूँ। इसी तरह मुझे Google + ?

    के माध्यम से लॉगिन प्रदान करने की आवश्यकता क्या है?

    jquery - PHP/Ajax PDF generation timeout -


    I have a code in PHP / ajax / jquery, so documents with values ​​from the database can be prepared. But when the user wants to create a large number of PDF and word files, then I have a problem with the time required to generate large numbers of files.

    Creating files for mySQL database from the line ID that I want to create a PDF or word from every element works well, I have used: and MPDF.

    1 file creation ~ 2-3 seconds when user can generate 500 records and wants to pack it in .zip, then I have a problem.

    My code looks like this:

    I am sending it to the client side by creating an AJAX call:

      function () {var Ids = new array (); $ .AJX ({type: 'post', url: 'ajax / generate_pdf.fpp', data: {'filename': $ ("# filename"). Val (), 'idPDF': ids.toString ()} $ ("#"); $ ("#moded") .app ("Loading" .br />); $ ("#moded") .Append (Data);}) .file (function () {Warning ("Error ..");}); }  

    My generic_pdf.php file looks like this:

       

    You have a problem with the request timeout. Either you can:

    1. To avoid having maximum time to run the script, tell your php, going from 0 to the following function:

        set_time_limit 0);  

    2. Refactor your code so that the customer will have 1 Ajax un 2 for every 2 seconds. The request will send the request, and the server always generates 1 PDF each request.

    3. The above two options will wait a very long time for the customer. You can do whatever you can, Google drives the same way when you try to upload a large file, it will notify you at the end of the process (by email, for example) . UD For databases in the database, you can make your call queue ID of PDF documents to make calls, and then run through a cron job queue and actually generate it so that the user is free from the "loading" screen To be. When your (async) process is finished, inform the client via email, if available, or any other option that is appropriate for your user case.


    How to "flatten" a multi-dimensional array to simple one in PHP? -


    This is probably the starting question, but I am already going through long term documentation and I have no solution I could have thought that I could use split bouts for each dimension and then put those strings back to form a new simple array with str_split . Although I never know whether the add pattern is also not in the values ​​and after doing so, str_split can break my original values.

    Is there anything like alliance ($ array1, $ Array2) for inside of a multi-dimensional array?

       aflat); / * Array (11) {[0] = & gt; Int (1) [1] = & gt; Int (2) [2] = & gt; Int (3) [3] = & gt; Int (4) [4] = & gt; Int (5) [5] = & gt; Int (6) [6] = & gt; Int (7) [7] = & gt; Int (8) [8] = & gt; Int (9) [9] = & gt; Int (10) [10] = & gt; Int (11)} * /? & Gt;  

    mysql - SQL query and SELECT -


    I want to select some datas from several tables, but I can see my limitations in SQL. MySQL returns with my query here:

      | IdCandidate | Date | Hour | Name operator 758 | 04/30/2015 | 15h00 | BRYAN 856 | 04/30/2015 | 17h20 | BRYAN 20 | 04/03/2015 | 15h30 | BRYAN 956 | 05/01/2015 | 11h00 | Karl 758 | 05/01/2015 | 10h20 | CARL  

    But I want the last place of every teacher's day: for Brillon 17h20, for CARL 11h00

    I think I can make it a selector I ... from ... WHERE IN (....) But is there a more "beautiful" way?

    Thank you.

    Use a correlated sub-query to get the latest lessons of each day / teacher: / P>

      idCandidate, date, hour, name selector from TablelineNum T1 = Hourly (select maximum (hour) from Tblename T2 where t1.date = t2.date and t1.NameOfTeacher = t2.NameOfTeacher)  

    iphone - How to get the sent emails in ios -


    I have a requirement that I have to send an email and show them in the items sent. Using the iOS Mail API I can send emails but I can not retrieve the items I sent.

    Is there a probable way for all the details like (Message Message Body, ...) to store sent emails and send them to the items sent? (MFMailComposeViewController *) controller didFinishWithResult

    {// Any method of getting mail information sent}

    You can set MFMailComposeViewControllerDelegate in the. This representative has one method

      - mailComposeController: didFinishWithResult: error:  

    The result is sent by anonymity so that you can find out that the mail was sent. Was it or not? You can then save your email message / topic and show the user list of the emails you have sent.


    Adding a different color to the barplot using ggplot2 in R -


    मेरे पास डेटा सेट है

      data = data.frame (देश = सी ("चीन", "संयुक्त राज्य अमेरिका", "यूनाइटेड किंगडम", "ब्राजील", "इंडोनेशिया", "जर्मनी"), प्रतिशत = सी (85,15,25,55,75,90))  < / पूर्व> 

    और इसके लिए कोड

      नाम = डेटा $ कंट्री बारप्लॉट (डेटा $ प्रतिशत, मुख्य = "डेटा 1", क्षितिज = TRUE, names.arg = names, col = "लाल")  

    दिए गए मानों का प्लॉट किए जाने के बाद मैं बार प्लॉट में ग्रे रंग जोड़ना चाहूंगा।

    देश चीन के लिए उदाहरण के लिए कहें बार ग्राफ को 85 के लिए प्लॉट किया जाता है शेष 15 को ग्रे रंग में लगाया जाना चाहिए। संयुक्त राज्य के लिए समानांतर बार बार चार्ट के लिए स्तंभ 15 में स्तंभ 15 में रखा गया है शेष 85 को ग्रे रंग होना चाहिए।

    इस पर कोई भी मदद बहुत सहायक है धन्यवाद

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

      # एक चर बनाने वाला "प्रतिपूरक प्रतिशत" डेटा $ compl & lt; - 100 - डेटा $ प्रतिशत # साजिश के वास्तविक व पूरक प्रतिशत दोनों एक बार में, वांछित रंग (लाल और भूरे रंग) के साथ बारप्लॉट (as.matrix (t (डेटा [, सी ("प्रतिशत" ("लाल", "ग्रे"))  

    Img src = "https://i.stack.imgur.com/doMjD.png" alt = "छवि विवरण यहां दर्ज करें">

    संपादित करें
    पर आधारित, इसे ggplot2

      लाइब्रेरी के साथ ऐसा करने का एक तरीका है (reshape) melt_data & lt; - पिघल (डेटा, आईडी = "देश") ggplot (melt_data, aes X = देश, y = मान, भर = चर)) + geom_bar (stat = "identity")  

    Docker pull or Docker run doesn't actually do anything -


    I am trying to run something called Trail Das through which the Dvor Container is through a Shaver on a VM (Once I'm moving it, I'll transfer it to an AWS example). That's why I have installed a Doker on Vicker and therefore I say to run the chef

      Docker Run- id -p 80:80 \ appliedtrust / traildash  
    < P> or even

      Docker has pulled Trust / Trailer  

    applied to VM and is:

      Unable to locate locally installed trust / trailashash, the repository applied to the repository / trailer 2015/03/16 12:40:38 https://index.docker.io/v1/repositories / Applied / trildash / images: get x509: standard The letter is valid for Ssl7302.cloudflare.com, * .archeagemall.co, *. Astrubbank.com, * .billhr2847.com, * .dallasjuniorforum.org, * .goudportal.nl, * .habbinfo.info, * .hoistandcrane.com, * .jlfresno.org, * .jlknoxville.org, * .jlsantabarbara org * Water Vichitakorg * Kjrlegabilenekcom * Kokegudskcom * Kpbjfkorg * Kstnsberryonlinekcom * Kunfarmovia.com * Kusepandkcom * Kvksineinjurihelpsntrkcom , Archeajmllkcom, Astrubba Nkkcom, Billhr2847kcom, Dllsjniorforumkorg, Gudaportlknl, Hbbinfaokinfo, Hoistandkranekcom, Jlfresn Okorg, Jlknogvillekorg, Jlsntberbrakorg, Jlvichitakorg, Jrlegabilenekko M, okaygoods.com, pbajf.org, stansberryonline.com, Inappropriate Females Com, usepnd.com, vaccineinjuryhelpcenter.com, index.docker not Io  

    And then nothing, the container will not actually start nor I would not pull in a different directory on the Docker files when pulled any files?

    What do I do, is it running?

    If you are doing everything right, but if you do it with the same 2 (IAM roll set-up) If you are running outside, you must clearly cross the AWS credits and alternatively other criteria. For more information, take a look at


    javascript - Two functions in one button - Calculate and Submit form -


    I am currently working with a calculator that calculates the value of the price, as well as a button Submit a form field to my email in click. Javascript / jQuery and HTML to work in Mailto:?

    Another method is already working by using

      go = $ ('button'); Go.click (function () {// bunch of code here});  

    Research did not find any clear solution through the web, so I tried to ask here.

    Try ...

      $ ('button') . Click (function () {// code count here and HTML element $ ('#formId'). Submit (); // to submit form using code id or class}};  

    angularjs - ng tags not working in internet explorer -


    I have an angular app that works fine on all browsers except IE, especially ng TAGS instructions to create a tag I'm unable to use ENTER or COMMA for There is no bug in the console and I'm not sure how to fix it.

    It is not possible that you want the answer, but if it is not really necessary then just IE Ignore, since I developed the last time IE IE supports most of my developers-friends.

    The cost (according to the time) / profit is not worth the IE to be compatible .


    javascript - encoding json in jQuery call -


    मेरे पास एक जेसन है:

      {"one \ -test": { "नाम": "एक \ -test", "link": "xxx"}, "दो \ -test": {"नाम": "दो \ -टीस्ट", "लिंक": "yyy"}}   

    और मेरी जावास्क्रिप्ट फ़ाइल में मैं एक jQuery कॉल का उपयोग करता हूं

      var myJson; JQuery.getJSON ('path / myJson.json', फ़ंक्शन (डेटा) {myJson = डेटा;});  

    दुर्भाग्यवश कॉल सफल नहीं होता है, इस अर्थ में कि myJson = data निष्पादित नहीं किया गया है (मैंने कथन संदेश को बयान से पहले ही रखने की कोशिश की है लेकिन यह को निष्पादित नहीं किया गया है) और चर myJson अभी भी अपरिभाषित है (मैं $। जब के साथ कॉल के अंत के लिए इंतजार किया था और मैंने myJson < कोड>)। सबसे अधिक संभावना यह समस्या नाम एक \ - टेस्ट और दो \ -टेस्ट (वर्ण '\' और '-') के प्रारूप हो सकती है, क्योंकि पथ सही है ( मुझे पूरा यकीन है)। मैं उन नामों को नहीं बदल सकता, फिर मुझे कुछ और के बारे में सोचना होगा। कोई उपाय? मैंने इस तरह एक एजेक्स कॉल करने की कोशिश की:

      फ़ंक्शन getJson (myJson) {$ .ajax ({प्रकार: "GET", url: "path / myJson.json", डेटा: {} , कंटेंट टाइप: "एप्लिकेशन / जेसन; वर्णसेट = यूटीएफ -8", डेटाटाइप: "जेसन", सफलता: फ़ंक्शन (डेटा) {myJson = डेटा;}}); }  

    लेकिन परिणाम अभी भी वही है।

    संपादित करें

    अगर मैं उसी कोड को निष्पादित करने की कोशिश करता हूं {"नाम": "एक \ -test", "link": "xxx"}, "ट्वोटेस्ट": {"नाम": "दो \ - परीक्षण "," लिंक ":" yyy "}}

    यह सफल होता है। यह "खराब प्रारूप" का एक अन्य प्रमाण है

    अगर मैं उसी कोड को निष्पादित करने की कोशिश करता हूं :

    ...

    यह सफल होता है यह "खराब प्रारूप" का एक अन्य प्रमाण है

    ठीक है, यह हमें बताता है कि जेएसओएन पार्टर का उपयोग किया जा रहा है उन "वन \ -टीस्ट" स्ट्रिंग्स को अमान्य के रूप में व्याख्या कर रहा है । आप उस तरह से पढ़ सकते हैं (और ऐसा प्रतीत होता है कि लोग ऐसा करते हैं, क्योंकि यह उन तारों को खारिज करता है), हालांकि

    कोई भी चरित्र बच सकता है।

    ... जो तर्क देता है कि जबकि व्यर्थ, \ से पहले - एक त्रुटि नहीं होनी चाहिए लेकिन शायद आरएफसी का अर्थ है कि किसी भी पात्र को यूनिकोड से बचने या इसी तरह से बचाना पड़ सकता है।

    सबसे अच्छी चीज होगी जो आपने कही थी कि आप नहीं कर सकते: JSON को ठीक करें सबसे अच्छे-अनावश्यक- सबसे खराब-समस्याग्रस्त \ से पहले -

    अगला सबसे अच्छी बात होगी कुछ पूर्व प्रसंस्करण करना आप JSON को पार्स करने की कोशिश करने के लिए jQuery नहीं कहकर सीधे स्ट्रिंग प्रतिस्थापन कर सकते हैं:

      $। Ajax ({type: "GET", url: "path / MyJson.json ", डेटा: {}, डेटाप्रकार:" टेक्स्ट ", // & lt; === सफलता को पार्स न करें: फ़ंक्शन (डेटा) {// ...}});  

    फिर सफलता कर रही है:

      myJson = JSON.parse (data.replace (/ \\ - / g, "-"));  

    ... हालांकि निश्चित तौर पर यह एक भोली प्रतिस्थापन है।

    यहां उस दूसरे बिट का डेमो है:

      var डेटा = '{' + '' One \ -test ": {'+'" नाम ":" एक \ -test ", '+'" लिंक ":" xxx "'+'}, '+'" दो \ परीक्षण ": {'+'" नाम ":" दो \ -टैस्ट ", '+'" लिंक ":" yyy "'+'} '+'} '; Var myJson = JSON.parse (डेटा.रेले (/ \\ - / g, "-")); snippet.log (myJson [ "एक-परीक्षण"] नाम।); // "एक-टेस्ट"  
      & lt;! - स्क्रिप्ट `स्निपेट` ऑब्जेक्ट प्रदान करता है, देखें Http://meta.stackexchange.com/a/242144/134069 - & gt; & Lt; script src = "http://tjcrowder.github.io/simple-snippets-console/snippet.js" & gt; & lt; / स्क्रिप्ट & gt;  
    < / P>

    c++ - Infix to postfix calculator/ reading input -



    c++ - Infix to postfix calculator/ reading input -

    i need implement infix postfix calculator using stacks , queues in c++. know algorithm follow i'm having problem starting. programme should go following:

    enter valid infix expression: 3 + 4 * 5 / 6 resulting postfi look is: 3 4 5 * / 6 + result is: 6.3333

    so need read input command line , that's i'm having problem. code far:

    using namespace std; #include <iostream> #include <stdlib.h> #include <stack> #include <queue> int main() { stack <string> convert; stack <string> evaluate; queue <string> store; string data; float num; cout << "enter valid infix expression: "; while (getline(cin, data)) { store.push(data); } homecoming 0; }

    my problem here how stop loop , how can numbers string input can force them queue print them later on? code pushing entire string the first slot in queue. hope can help.

    thank you

    use class tools written me

    tools.h

    static class tools { public: static char* topostfix(char* source); static double calculatepostfix(char* source); static bool contain(char* source,char character); };

    tools.cpp

    #include "tools.h" #include <stack> #include <iostream> #include <string> using namespace std; char* tools::topostfix(char* source) { stack<char> symbol; string postfix = ""; int = 0; char variables[] = { "0123456789abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz" }; bool find = false; while (*source != '\0') { switch (*source) { case '+': case '-': case '*': case '/': symbol.push(*source); break; case ')': postfix += symbol.top(); symbol.pop(); default: find = tools::contain(variables, *source); if (find) { postfix += *source; find = false; } } source++; } // attach other operator in stack(pop all) while (!symbol.empty()) { postfix += symbol.top(); symbol.pop(); } char* p = new char(postfix.length()); const char* o = postfix.c_str(); (int = 0; < postfix.length(); i++) p[i] = o[i]; homecoming p; } double tools::calculatepostfix(char* source) { char numbers[] = { "0123456789" }; stack<double> number; (int = 0; < strlen(source); i++) { char character = source[i]; if (tools::contain(numbers, character)) { number.push(atof(&character)); } else { double number1, number2; switch (character) { case '+': number2 = number.top(); number.pop(); number1 = number.top(); number.pop(); number.push(number1 + number2); break; case '-': number2 = number.top(); number.pop(); number1 = number.top(); number.pop(); number.push(number1 - number2); break; case '*': number2 = number.top(); number.pop(); number1 = number.top(); number.pop(); number.push(number1 * number2); break; case '/': number2 = number.top(); number.pop(); number1 = number.top(); number.pop(); number.push(number1 / number2); break; } } } homecoming number.top(); } bool tools::contain(char* source, char character) { int size = strlen(source); (int = 0; < size ; i++) { if (source[i] == character) homecoming true; } homecoming false; }

    usage :

    std::cout << "postfix : " << tools::topostfix("a+(b*c+t)") << std::endl; std::cout << "answer : " << tools::calculatepostfix("24*95+-") << std::endl;

    c++ stack queue calculator

    facebook api, getting comment likes, not just like_count -



    facebook api, getting comment likes, not just like_count -

    using facebook graph api explorer, trying 'likes' comment in public group. request using is

    ->/v2.1/340032752841177?fields=feed{message,comments{likes,message,from,like_count}}

    where 340032752841177 grouping id. tool accepts request ok, quietly doesn't homecoming 'likes' list on comments:

    "comments": { "data": [ { "message": "henry's comment.", "from": { "id": "830700716960157", "name": "henry carmichael" }, "like_count": 1, "id": "340035706174215" } ],

    i have expected likes list appear in dictionary above.

    in question learned can likes of single comment this:

    ->/v2.1/340032752841177_340035436174242_340035706174215/likes "data": [ { "id": "10152551090402608", "name": "charlie burns" } ],

    where 340032752841177_340035436174242 post id , 340035706174215 comment id.

    the problem approach have request each comment , parsing big facebook grouping many comments.

    is there way 'likes' of comments without having each comment individually? thanks.

    no cant list of likes comments 1 call, number of them.

    if seek running ->/v2.1/340032752841177/feed?fields=comments.summary(true) can fields can returned comments endpoint. sample response is:

    "comments": { "data": [ { "id": "340035706174215", "from": { "id": "830700716960157", "name": "henry carmichael" }, "message": "henry's comment.", "can_remove": false, "created_time": "2014-10-06t15:21:55+0000", "like_count": 1, "user_likes": false } ]

    as see there no total list of likes , comments endpoint isn't returning more inforamtion. all.

    futhermore can check graph api explorer. here screenshot of available fields in comments endpoint:

    as see there not "likes_list" field, 1 time again there no way can list of likes comments.

    the solution 1 suggesting. 1 request each comment

    facebook-graph-api

    entity framework - EF6 DbContext lifecycle issue -



    entity framework - EF6 DbContext lifecycle issue -

    i've decided architect solution without repositories , unit of work (given ef repository/uow why abstract abstraction). have service/business logic layer phone call ef directly. service has number of methods (create, update, delete) phone call _context.savechanges() , injecting dbcontext in constructor.

    however if phone call multiple methods using same service instance , 1 fails, farther service methods fail. example

    var svc = new personservice(); var person = new person{ name = "angie" }; svc.create(person); svc.delete(56); //delete person id 50

    lets assume create throws exception on savechanges reason. when phone call delete, there still faulty person object in context, when delete method calls savechanges throw same exception.

    of course of study can around instantiating new personservice in calling code screams wrong.

    this leads me using new context each service method, mean method injection instead of constructor injection hoping avoid.

    i've considered going repository/uow seems moves problem 1 layer deeper.

    is method injection of context right way go or missing here?

    thanks

    entity-framework

    ios - Object assigned to property of target view controller in prepareForSegue comes out as a UITableViewCell -



    ios - Object assigned to property of target view controller in prepareForSegue comes out as a UITableViewCell -

    i trying set property of view controller i'm segueing to custom object (restroom), it's coming out uitableviewcell.

    here code origin view controller triggering segue. userdidselectrestroomnotification method called when user selects cell in table view lists restrooms - application supposed segue view controller lists details of restroom:

    - (void)userdidselectrestroomnotification:(nsnotification *)notification { restroom *selectedrestroom = (restroom *)[notification object]; [self performseguewithidentifier:@"showrestroomdetails" sender:selectedrestroom]; }; - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { if ([segue.identifier isequaltostring:@"showrestroomdetails"]) { restroomdetailsviewcontroller *restroomdetailsviewcontroller = (restroomdetailsviewcontroller*)segue.destinationviewcontroller; restroomdetailsviewcontroller.restroom = sender; } }

    here code in info source notification posed:

    - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { // post notification when selection made nsnotification *notification = [nsnotification notificationwithname:rrtableviewdidselectrestroomnotification object:[self restroomforindexpath:indexpath]]; [[nsnotificationcenter defaultcenter] postnotification:notification]; } - (restroom *)restroomforindexpath:(nsindexpath *)indexpath { homecoming [self.restroomslist objectatindex:[indexpath row]]; }

    point being, sending along restroom object in notification.

    the issues comes when in restroomdetailsviewcontroller, trying set text of label name of restroom object i'm passing along:

    @interface restroomdetailsviewcontroller () @property (weak, nonatomic) iboutlet uilabel *namelabel; @end @implementation restroomdetailsviewcontroller - (void)viewwillappear:(bool)animated { [super viewwillappear:animated]; self.namelabel.text = self.restroom.name; } @end

    it crashes @ self.namelabel.text = self.restroom.name. when inspect objects, see self.restroom object uitableviewcell. confuses me farther that uitableviewcell appears cell selected user trigger segue -- i.e. 1 set in info source:

    - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { nsparameterassert([indexpath section] == 0); nsparameterassert([indexpath row] < [_restroomslist count]); uitableviewcell *restroomcell = [tableview dequeuereusablecellwithidentifier:restroomcellreuseidentifier]; if(!restroomcell) { restroomcell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:restroomcellreuseidentifier]; } restroomcell.textlabel.text = [[_restroomslist objectatindex:[indexpath row]] name]; homecoming restroomcell; }

    i'm not understanding why happens , how restroom property assigned restroom object.

    why using postnotification ?

    i don't see requirement here utilize notification. simple function parameter work.

    try next way phone call segue

    - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath { [self performseguewithidentifier:@"showrestroomdetails" sender:[self restroomforindexpath:indexpath]]; } - (restroom *)restroomforindexpath:(nsindexpath *)indexpath { homecoming [self.restroomslist objectatindex:[indexpath row]]; } - (void)prepareforsegue:(uistoryboardsegue *)segue sender:(id)sender { restroom *selectedrestroom = (restroom *)sender; if ([segue.identifier isequaltostring:@"showrestroomdetails"]) { restroomdetailsviewcontroller *restroomdetailsviewcontroller = (restroomdetailsviewcontroller*)segue.destinationviewcontroller; restroomdetailsviewcontroller.restroom = selectedrestroom ; } }

    ios objective-c uitableview

    umbraco - Getting Media from code in repository -



    umbraco - Getting Media from code in repository -

    i'm working in umbraco 7 , i'm trying map info custom entity have created. mapping strings, int ect. quite simple can tell me how can map content created media picker, multi media picker , content picker?

    my simple model:

    public class frontpage : master { public string headline { get; set; } public htmlstring content { get; set; } public string image { get; set; } public ienumerable<xxxx> images { get; set; } <-- class/type should place here (imedia mayby) public ienumerable<xxxx> links { get; set; } <-- class/type should place here (icontent mayby) public ienumerable<newsitem> news { get; set; } }

    in repository have method:

    public frontpage getfrontpage(ipublishedcontent content) { var imageobject = <-- how map image image picker here var imagesobject = <-- how map images multi media picker here var linksobject = <-- how map multiple links content picker here var model = new frontpage { headline = !string.isnullorempty(content.getpropertyvalue<string>("headline")) ? content.getpropertyvalue<string>("headline") : content.name, content = new htmlstring(content.getpropertyvalue<string>("content")), image = <-- , goes here, images = <-- , goes here, links = <-- , goes here, news = null }; homecoming model; }

    i hope makes sence of guys/girls ;o)

    i found able phone call typedmedia , typedcontent in repository this:

    var helper = new umbracohelper(umbracocontext.current); var image = helper.typedmedia(content.getpropertyvalue("image")); var link = helper.typedcontent(content.getpropertyvalue("link"));

    this way can want both media , content picker ;o)

    umbraco umbraco7

    crash - C++/C Code::blocks crashes while editing -



    crash - C++/C Code::blocks crashes while editing -

    i'm not completly sure if it's proper inquire here, but...

    i'm pupil forced work code:blocks ide on win7 (64 bits), , keeps crashing everytime seek , add/edit #include, i've tried in both c , c++ , think it's got editor since compiles correctly.

    has else had problem? there way prepare it?

    best bet search through code::blocks ticketing system see if knows problem.

    if no-one does, raise ticket yourself.

    it'd thought provide much info there front end possible, such source files (or plenty of them cause actual problem), project settings, ide version, , on.

    that'll ticket moving along faster if have chase information.

    crash ide codeblocks

    sql - Mysql tables link with each other -



    sql - Mysql tables link with each other -

    i create 3 tables in mysql:

    movies: id-name-country tv-series: id-name-country artists: id-name-country

    instead of entering country info these tables seperately, planning create table:

    countries: id-country

    and create first 3 tables take country info countries table. (so that, if name of 1 country misspelled, easy right in 1 place. info in other tables updated automatically.

    can "foreign keys"? is right approach?

    your approach far correct, only if "country" in tv-series , artist mean country id , not value. , yes can utilize foreign keys (country id in tv-series , artist foreign key linking countries);

    edit: side note: looking @ edit sense obliged point out if planning link movie/tv-show artist need 4th table maintain normalization you've got far.

    edit2: usual way decide whether need tables check kind of connection 2 tables or values have.

    if it's 1 many (like artist country of origin), fine. if have many many, film artist 1 artist can in multiple movies , 1 film can have multiple artists need linking table. if have 1 1 relation (like customer_id , passport details in banking system, stored separately in client , passport tables, joining them makes more sense because banks hold details of 1 valid passport each client , 1 passport can used 1 person) can merge tables (at risk of not meeting normalization 3 criteria)

    mysql sql

    Issue whilst comparing instances with HashMaps in Java -



    Issue whilst comparing instances with HashMaps in Java -

    i trying value hashmap via custom class have created.

    the custom class:

    public class coordinates { private int x; private int y; public coordinates(int x, int y) { this.x = x; this.y = y; } public int getx() { homecoming this.x; } public int gety() { homecoming this.y; } public boolean issame(coordinates coords) { if (coords.getx() == this.x && coords.gety() == this.y) { homecoming true; } homecoming false; } public string getasstring() { homecoming "("+this.x+", "+this.y+")"; } public coordinates getcoords() { homecoming this; } }

    i have hashmap called coordsjcb , when seek jcbutton (a custom swing button) says cannot find it.

    private static hashmap<coordinates, jcbutton> coordsjcb = new hashmap<coordinates, jcbutton>(); coordsjcb.get(coords);

    i did little debugging , noticed that

    system.out.println(new coordinates(2, 3).equals(new coordinates(2, 3)));

    printed false, though same. googled , got many answers overriding .equals function. not help me don't want compare 2 instances of 'coordinates', need value hashmap passing instance of coordinates.

    any help much appreciated have absolutely no thought do. :/

    the hashmap's key set hashes elements , compares them hash.

    you need override object.hashcode , object.equals in coordinates class.

    your equals method should homecoming true when x , y equal othercoordinates.x , othercoordinates.y respectively.

    for hashcode it's bit trickier because hash based on 2 ints, need find way avoid weak hashes (i.e. duplicated hashes).

    your ide's boilerplate hashcode implementation functionalities should help out there, can additional bit shifting , utilize improve prime seeds.

    for instance in ecplise:

    right-click coordinates class click source click generate hashcode() , equals()...

    java hashmap instance

    c - Linux Kernel: Static Const vs #Define -



    c - Linux Kernel: Static Const vs #Define -

    which more "appropriate" when writing linux kernel module: using static const define constant, or #define ?

    i have kernel module related piece of hardware, , have typical constant that's number of buffers. rather hard-code "3" everywhere, want utilize constant. c style recommends taking static const, notice kernel chock total of #define's on place. there reason?

    it used couldn't do:

    const size_t buffer_size = 1024; unsigned char buffer[buffer_size];

    in c, since buffer_size not "real" constant. hence see

    #define buffer_size 1024 unsigned char buffer[buffer_size];

    instead.

    as of c99, can former, not in global scope. won't work outside of function (not if made static). since much code in kernel deals similiar constructs, might 1 reason using preprocessor instead.

    note: don't forget sizeof, it's tool when comes not repeating size constant on place, regardless of how constant implemented.

    c linux linux-kernel

    wcf - Using basicHttpbinding and get the response in raw data -



    wcf - Using basicHttpbinding and get the response in raw data -

    i've looked day , couldn't able find right reply on how response of web service using basichttpbinding without soap formatting.

    can know how ? or way getting raw info ? (like string)

    you have utilize webhttpbinding. @ next articles, might help you:

    creating wcf service soap/rest endpoints how enable rest , soap both on same wcf service an introduction restful services wcf

    wcf soap basichttpbinding raw-data

    Where are the files in Windows Azure -



    Where are the files in Windows Azure -

    where files windows azure cloud service reside? have been looking , looking , can't seem find it. need create changes of files , can't find them. there cpanel file manager available?

    it depends on mean cloud service.

    paas = can alter files creating new cspkg , deploying it. cannot modify files via rdp. iaas = rdp vm , whatever want do. can utilize things winrm, service extensions, chef/puppet, etc websites = update file in repository (ie. github) or upload file via ftp

    azure

    android - how to find color name based on color code? -



    android - how to find color name based on color code? -

    i have color code #ffa100. have define in values xml

    <color name="orange">#ffa100</color>

    i want find name "orange" based on color code value "#ffa100" how can find it? want utilize name of color in programme value several colors defined , has code server.

    use,

    color.parsecolor("#ffa100");

    like,

    mtextview.settextcolor(color.parsecolor("#ffa100")); //set text color mtextview.setbackgroundcolor(color.parsecolor("#ffa100")); // set background color

    android android-resources color-codes

    java - TileMap Collision -



    java - TileMap Collision -

    how do proper collision tilemap?

    this current solution:

    int toptilex = ((tilemap.xoffs - x) - 32 - 1) / tile.tile_size; int toptiley = ((tilemap.yoffs - y) - 32 - 1) / tile.tile_size; int bottomtilex = ((tilemap.xoffs - x) - 1) / tile.tile_size; int bottomtiley = ((tilemap.yoffs - y) - 1) / tile.tile_size; int lefttilex = ((tilemap.xoffs - x) - 32-1) / tile.tile_size; int lefttiley = ((tilemap.yoffs - y) - 32-1) / tile.tile_size; int righttilex = ((tilemap.xoffs - x)-1) / tile.tile_size; int righttiley = ((tilemap.yoffs - y)-1) / tile.tile_size; if (keyboard.iskeydown(keyboard.key_w)) { if (!tilemap.getlayer(0)[math.abs(toptiley+1)][math.abs(toptilex)].isblocked()) { tilemap.yoffs++; } } if (keyboard.iskeydown(keyboard.key_s)) { if (!tilemap.getlayer(0)[math.abs(bottomtiley-1)][math.abs(bottomtilex)].isblocked()) { tilemap.yoffs--; } } if (keyboard.iskeydown(keyboard.key_d)) { if (!tilemap.getlayer(0)[math.abs(righttiley)][math.abs(righttilex-1)].isblocked()) { tilemap.xoffs--; } } if (keyboard.iskeydown(keyboard.key_a)) { if (!tilemap.getlayer(0)[math.abs(lefttiley)][math.abs(lefttilex+1)].isblocked()) { tilemap.xoffs++; } }

    but player stuck in corners , tiles wouldn't work. tell me proper way check collision , handle collision without playing getting stuck , such.

    java opengl 2d lwjgl

    asp.net - System.Web.MVC not copied into bin folder since MS14-059. How to protect against creating builds with missing DLLs as a result of Windows Updates? -



    asp.net - System.Web.MVC not copied into bin folder since MS14-059. How to protect against creating builds with missing DLLs as a result of Windows Updates? -

    this morning reported our web app on our qa server broken next error reported web.config:

    could not load file or assembly 'system.web.mvc, version=5.1.0.0, culture=neutral, publickeytoken=31bf3856ad364e35' or 1 of dependencies. scheme cannot find file specified

    remembering seeing windows update mentioned mvc, did digging , found lots of people reporting recent windows update breaking mvc.

    after much digging through questions , our server, seems what's bitten not match what's in other questions, appear related. here's think know:

    our app broken uses asp.net mvc 5.1 mvc installed via nuget our buildserver , qa servers not have mvc 5.1 installed (therefore, not gac'd)

    what believe has broken caused "bad build" created:

    a patch mvc 5.1 installed on buildserver via windows update despite not having mvc 5.1 installed in gac the patch has set "updated" version of mvc 5.1 in gac copylocal=true ignored when dll in gac; hence since patch, means builds of our app buildserver no longer have system.web.mvc in output folder since system.web.mvc not in gac on our qa servers (they have not yet been patched), application fails, because system.web.mvc cannot found

    assuming behavior described above correct, means time ms service nuget dll via windows update that not have in gac, our buildserver start producing incomplete builds (missing out dlls have been injected gac).

    upgrading mvc 5.2 solves issue (likely because wasn't patched, , hence not injected gac); dll copied output folder. there no changes in diff upgraded 5.2.2 except version number changes (there's no <private> node been added/edited).

    we not wish start gacing everything, nor creating manual build steps re-create of our dlls bin folder in case ms patches them.

    so, can alter today ensure don't ever end out buildserver silently producing bad builds if ms patch other dlls in future?

    a patch mvc 5.1 installed on buildserver via windows update despite not having mvc 5.1 installed in gac

    yes, behavior design. see http://blogs.msdn.com/b/dotnet/archive/2014/01/22/net-4-5-1-supports-microsoft-security-updates-for-net-nuget-libraries.aspx.

    the patch has set "updated" version of mvc 5.1 in gac

    yes, that's correct; it's how patch gets updated code run instead of old code. see https://technet.microsoft.com/en-us/library/security/ms14-059.

    copylocal=true ignored when dll in gac; hence since patch, means builds of our app buildserver no longer have system.web.mvc in output folder

    not exactly. happens project copylocal=true gets switched copylocal=false. copylocal can set in 1 of 2 ways: 1) if there's explicit <private>true</private> setting in .csproj file, or 2) default, if no such setting exists (gac'd assemblies not copylocal default; other assemblies do).

    so appears have happened in case project file didn't have setting in csproj file. result, gui showed setting based on evaluated default value before patch (copylocal = true) after patch installed, gui show new default value gac'd assembly (copylocal = false).

    since system.web.mvc not in gac on our qa servers (they have not yet been patched), application fails, because system.web.mvc cannot found

    that's correct.

    assuming behavior described above correct, means time ms service nuget dll via windows update not have in gac, our buildserver start producing incomplete builds (missing out dlls have been injected gac).

    for .csproj reference without explicit <private>true</private> setting, correct. also, note using nuget update mvc reference can remove setting if present. see http://nuget.codeplex.com/workitem/4344.

    upgrading mvc 5.2 solves issue (likely because wasn't patched, , hence not injected gac); dll copied output folder. there no changes in diff upgraded 5.2.2 except version number changes (there's no node been added/edited).

    that's correct. since mvc 5.2 not gac'd, without explicit <private>true</private> setting, default value of non-gac'd assembly copylocal=true.

    we not wish start gacing everything, nor creating manual build steps re-create of our dlls bin folder in case ms patches them. so, can alter today ensure don't ever end out buildserver silently producing bad builds if ms patch other dlls in future?

    the best can today is:

    put explicit <private>true</private> settings in .csproj file nuget bundle assembly references. until nuget bug #4344 fixed, time utilize nuget update bundle reference, go .csproj file , re-add explicit <private>true</private> setting.

    asp.net .net asp.net-mvc windows security

    ios - Mixing Images and Video using AVFoundation -



    ios - Mixing Images and Video using AVFoundation -

    i'm trying splice in images pre-existing video create new video file using avfoundation on mac.

    so far i've read apple documentation example,

    assetwriterinput making video uiimages on iphone issues

    mix video static image in calayer using avvideocompositioncoreanimationtool

    avfoundation tutorial: adding overlays , animations videos , few other links

    now these have proved pretty useful @ times, problem i'm not creating static watermark or overlay want set in images between parts of video. far i've managed video , create blank sections these images inserted , export it.

    my problem getting images insert them selves in these blank sections. way can see feasibly create series of layers animated alter opacity @ right times, can't seem animation work.

    the code below i'm using create video segments , layer animations.

    //https://developer.apple.com/library/ios/documentation/audiovideo/conceptual/avfoundationpg/articles/03_editing.html#//apple_ref/doc/uid/tp40010188-ch8-sw7 // let's start making our video composition avmutablecomposition* mutablecomposition = [avmutablecomposition composition]; avmutablecompositiontrack* mutablecompositiontrack = [mutablecomposition addmutabletrackwithmediatype:avmediatypevideo preferredtrackid:kcmpersistenttrackid_invalid]; avmutablevideocomposition* mutablevideocomposition = [avmutablevideocomposition videocompositionwithpropertiesofasset:gvideoasset]; // if first point's frame doesn't start on 0 if (gframes[0].starttime.value != 0) { debuglog("inserting vid @ 0"); // add together video track composition track time range 0 first point's starttime [mutablecompositiontrack inserttimerange:cmtimerangemake(kcmtimezero, gframes[0].starttime) oftrack:gvideotrack attime:kcmtimezero error:&gerror]; } if(gerror) { debuglog("error inserting original video segment"); geterror(); } // create our parent layer , video layer calayer* parentlayer = [calayer layer]; calayer* videolayer = [calayer layer]; parentlayer.frame = cgrectmake(0, 0, 1280, 720); videolayer.frame = cgrectmake(0, 0, 1280, 720); [parentlayer addsublayer:videolayer]; // create offset value should added each point new video segment should go cmtime timeoffset = cmtimemake(0, 600); // loop through each additional frame for(int = 0; < gframes.size(); i++) { // create animation layer , assign it's content cgimage of frame calayer* frame = [calayer layer]; frame.contents = (__bridge id)gframes[i].frameimage; frame.frame = cgrectmake(0, 720, 1280, -720); debuglog("inserting empty time range"); // add together frame point composition track starting @ point's start time // insert empty time range duration of frame animation [mutablecompositiontrack insertemptytimerange:cmtimerangemake(cmtimeadd(gframes[i].starttime, timeoffset), gframes[i].duration)]; // update time offset duration timeoffset = cmtimeadd(timeoffset, gframes[i].duration); // create layer transparent frame.opacity = 0.0f; // create animation setting opacity 0 on start cabasicanimation* frameanim = [cabasicanimation animationwithkeypath:@"opacity"]; frameanim.duration = 1.0f; frameanim.repeatcount = 0; frameanim.autoreverses = no; frameanim.fromvalue = [nsnumber numberwithfloat:0.0]; frameanim.tovalue = [nsnumber numberwithfloat:0.0]; frameanim.begintime = avcoreanimationbegintimeatzero; frameanim.speed = 1.0f; [frame addanimation:frameanim forkey:@"animateopacity"]; // create animation setting opacity 1 frameanim = [cabasicanimation animationwithkeypath:@"opacity"]; frameanim.duration = 1.0f; frameanim.repeatcount = 0; frameanim.autoreverses = no; frameanim.fromvalue = [nsnumber numberwithfloat:1.0]; frameanim.tovalue = [nsnumber numberwithfloat:1.0]; frameanim.begintime = avcoreanimationbegintimeatzero + cmtimegetseconds(gframes[i].starttime); frameanim.speed = 1.0f; [frame addanimation:frameanim forkey:@"animateopacity"]; // create animation setting opacity 0 frameanim = [cabasicanimation animationwithkeypath:@"opacity"]; frameanim.duration = 1.0f; frameanim.repeatcount = 0; frameanim.autoreverses = no; frameanim.fromvalue = [nsnumber numberwithfloat:0.0]; frameanim.tovalue = [nsnumber numberwithfloat:0.0]; frameanim.begintime = avcoreanimationbegintimeatzero + cmtimegetseconds(gframes[i].endtime); frameanim.speed = 1.0f; [frame addanimation:frameanim forkey:@"animateopacity"]; // add together frame layer our parent layer [parentlayer addsublayer:frame]; gerror = nil; // if there's point after 1 if( < gframes.size()-1) { // add together our video file composition range of point's end , next point's start [mutablecompositiontrack inserttimerange:cmtimerangemake(gframes[i].starttime, cmtimemake(gframes[i+1].starttime.value - gframes[i].starttime.value, 600)) oftrack:gvideotrack attime:cmtimeadd(gframes[i].starttime, timeoffset) error:&gerror]; } // else add together our video file range of points end point , videos duration else { [mutablecompositiontrack inserttimerange:cmtimerangemake(gframes[i].starttime, cmtimesubtract(gvideoasset.duration, gframes[i].starttime)) oftrack:gvideotrack attime:cmtimeadd(gframes[i].starttime, timeoffset) error:&gerror]; } if(gerror) { char errormsg[256]; sprintf(errormsg, "error inserting original video segment at: %d", i); debuglog(errormsg); geterror(); } }

    now in segment frame's opacity set 0.0f, when set 1.0f place lastly 1 of these frames on top of video entire duration.

    after vide exported using avassetexportsession shown below

    mutablevideocomposition.animationtool = [avvideocompositioncoreanimationtool videocompositioncoreanimationtoolwithpostprocessingasvideolayer:videolayer inlayer:parentlayer]; // create layer instruction our newly created animation tool avmutablevideocompositionlayerinstruction *layerinstruction = [avmutablevideocompositionlayerinstruction videocompositionlayerinstructionwithassettrack:gvideotrack]; avmutablevideocompositioninstruction *instruction = [avmutablevideocompositioninstruction videocompositioninstruction]; [instruction settimerange:cmtimerangemake(kcmtimezero, [mutablecomposition duration])]; [layerinstruction setopacity:1.0f attime:kcmtimezero]; [layerinstruction setopacity:0.0f attime:mutablecomposition.duration]; instruction.layerinstructions = [nsarray arraywithobject:layerinstruction]; // set instructions on our videocomposition mutablevideocomposition.instructions = [nsarray arraywithobject:instruction]; // export final composition video file // convert videopath url our avassetwriter create file @ nsstring* vidpath = creatensstring(outputvideopath); nsurl* vidurl = [nsurl fileurlwithpath:vidpath]; avassetexportsession *exporter = [[avassetexportsession alloc] initwithasset:mutablecomposition presetname:avassetexportpreset1280x720]; exporter.outputfiletype = avfiletypempeg4; exporter.outputurl = vidurl; exporter.videocomposition = mutablevideocomposition; exporter.timerange = cmtimerangemake(kcmtimezero, mutablecomposition.duration); // asynchronously export composition video file , save file photographic camera roll 1 time export completes. [exporter exportasynchronouslywithcompletionhandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ if (exporter.status == avassetexportsessionstatuscompleted) { debuglog("!!!file created!!!"); _close(); } else if(exporter.status == avassetexportsessionstatusfailed) { debuglog("failed damn"); debuglog(cstringcopy([[[exporter error] localizeddescription] utf8string])); debuglog(cstringcopy([[[exporter error] description] utf8string])); _close(); } else { debuglog("noidea"); _close(); } }); }]; }

    i feeling animation not beingness started don't know. going right way splice in image info video this?

    any assistance appreciated.

    well solved issue in way. animation route not working, solution compile insertable images temporary video file , utilize video insert images final output video.

    starting first link posted assetwriterinput making video uiimages on iphone issues created next function create temporary video

    void createframeimagevideo(nsstring* path) { nslog(@"creating author @ path %@", path); nserror *error = nil; avassetwriter *videowriter = [[avassetwriter alloc] initwithurl: [nsurl fileurlwithpath:path] filetype:avfiletypempeg4 error:&error]; nslog(@"creating video codec settings"); nsdictionary *codecsettings = [nsdictionary dictionarywithobjectsandkeys: [nsnumber numberwithint:gvideotrack.estimateddatarate/*128000*/], avvideoaveragebitratekey, [nsnumber numberwithint:gvideotrack.nominalframerate],avvideomaxkeyframeintervalkey, avvideoprofilelevelh264mainautolevel, avvideoprofilelevelkey, nil]; nslog(@"creating video settings"); nsdictionary *videosettings = [nsdictionary dictionarywithobjectsandkeys: avvideocodech264, avvideocodeckey, codecsettings,avvideocompressionpropertieskey, [nsnumber numberwithint:1280], avvideowidthkey, [nsnumber numberwithint:720], avvideoheightkey, nil]; nslog(@"creating writter input"); avassetwriterinput* writerinput = [[avassetwriterinput assetwriterinputwithmediatype:avmediatypevideo outputsettings:videosettings] retain]; nslog(@"creating adaptor"); avassetwriterinputpixelbufferadaptor *adaptor = [avassetwriterinputpixelbufferadaptor assetwriterinputpixelbufferadaptorwithassetwriterinput:writerinput sourcepixelbufferattributes:nil]; [videowriter addinput:writerinput]; nslog(@"starting session"); //start session: [videowriter startwriting]; [videowriter startsessionatsourcetime:kcmtimezero]; cmtime timeoffset = kcmtimezero;//cmtimemake(0, 600); nslog(@"video width %d, height: %d, writing frame video file", gwidth, gheight); cvpixelbufferref buffer; for(int = 0; i< ganalysisframes.size(); i++) { while (adaptor.assetwriterinput.readyformoremediadata == false) { nslog(@"waiting within loop"); nsdate *maxdate = [nsdate datewithtimeintervalsincenow:0.1]; [[nsrunloop currentrunloop] rununtildate:maxdate]; } //write samples: buffer = pixelbufferfromcgimage(ganalysisframes[i].frameimage, gwidth, gheight); [adaptor appendpixelbuffer:buffer withpresentationtime:timeoffset]; timeoffset = cmtimeadd(timeoffset, ganalysisframes[i].duration); } while (adaptor.assetwriterinput.readyformoremediadata == false) { nslog(@"waiting outside loop"); nsdate *maxdate = [nsdate datewithtimeintervalsincenow:0.1]; [[nsrunloop currentrunloop] rununtildate:maxdate]; } buffer = pixelbufferfromcgimage(ganalysisframes[ganalysisframes.size()-1].frameimage, gwidth, gheight); [adaptor appendpixelbuffer:buffer withpresentationtime:timeoffset]; nslog(@"finishing session"); //finish session: [writerinput markasfinished]; [videowriter endsessionatsourcetime:timeoffset]; bool successfulwrite = [videowriter finishwriting]; // if failed write video if(!successfulwrite) { nslog(@"session failed error: %@", [[videowriter error] description]); // delete temporary file created nsfilemanager *filemanager = [nsfilemanager defaultmanager]; if ([filemanager fileexistsatpath:path]) { nserror *error; if ([filemanager removeitematpath:path error:&error] == no) { nslog(@"removeitematpath %@ error:%@", path, error); } } } else { nslog(@"session complete"); } [writerinput release]; }

    after video created loaded avasset , it's track extracted video inserted replacing next line (from first code block in original post)

    [mutablecompositiontrack insertemptytimerange:cmtimerangemake(cmtimeadd(gframes[i].starttime, timeoffset), gframes[i].duration)];

    with:

    [mutablecompositiontrack inserttimerange:cmtimerangemake(timeoffset,ganalysisframes[i].duration) oftrack:gframestrack attime:cmtimeadd(ganalysisframes[i].starttime, timeoffset) error:&gerror];

    where gframestrack avassettrack created temporary frame video.

    all code relating calayer , cabasicanimation objects have been removed not working.

    not elegant solution, don't think 1 @ to the lowest degree works. hope finds useful.

    this code works on ios devices (tested using ipad 3)

    side note: debuglog function first post callback function prints out log messages, can replaced nslog() calls if need be.

    ios osx avfoundation cgimage caanimation